Merge "audio policy: use audio_devices_t when appropriate"
diff --git a/api/current.txt b/api/current.txt
index 1c4190e..77c9f6e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -4761,6 +4761,7 @@
public class ClipData implements android.os.Parcelable {
ctor public ClipData(java.lang.CharSequence, java.lang.String[], android.content.ClipData.Item);
ctor public ClipData(android.content.ClipDescription, android.content.ClipData.Item);
+ ctor public ClipData(android.content.ClipData);
method public void addItem(android.content.ClipData.Item);
method public int describeContents();
method public android.content.ClipDescription getDescription();
@@ -5378,6 +5379,7 @@
method public java.lang.CharSequence[] getCharSequenceArrayExtra(java.lang.String);
method public java.util.ArrayList<java.lang.CharSequence> getCharSequenceArrayListExtra(java.lang.String);
method public java.lang.CharSequence getCharSequenceExtra(java.lang.String);
+ method public android.content.ClipData getClipData();
method public android.content.ComponentName getComponent();
method public android.net.Uri getData();
method public java.lang.String getDataString();
@@ -5461,6 +5463,7 @@
method public android.content.Intent setClass(android.content.Context, java.lang.Class<?>);
method public android.content.Intent setClassName(android.content.Context, java.lang.String);
method public android.content.Intent setClassName(java.lang.String, java.lang.String);
+ method public void setClipData(android.content.ClipData);
method public android.content.Intent setComponent(android.content.ComponentName);
method public android.content.Intent setData(android.net.Uri);
method public android.content.Intent setDataAndNormalize(android.net.Uri);
@@ -5646,6 +5649,7 @@
field public static final java.lang.String EXTRA_UID = "android.intent.extra.UID";
field public static final int FILL_IN_ACTION = 1; // 0x1
field public static final int FILL_IN_CATEGORIES = 4; // 0x4
+ field public static final int FILL_IN_CLIP_DATA = 128; // 0x80
field public static final int FILL_IN_COMPONENT = 8; // 0x8
field public static final int FILL_IN_DATA = 2; // 0x2
field public static final int FILL_IN_PACKAGE = 16; // 0x10
@@ -10780,6 +10784,17 @@
method public abstract void onJetUserIdUpdate(android.media.JetPlayer, int, int);
}
+ public class MediaActionSound {
+ ctor public MediaActionSound();
+ method public synchronized void load(int);
+ method public synchronized void play(int);
+ method public void release();
+ field public static final int FOCUS_COMPLETE = 1; // 0x1
+ field public static final int SHUTTER_CLICK = 0; // 0x0
+ field public static final int START_VIDEO_RECORDING = 2; // 0x2
+ field public static final int STOP_VIDEO_RECORDING = 3; // 0x3
+ }
+
public class MediaMetadataRetriever {
ctor public MediaMetadataRetriever();
method public java.lang.String extractMetadata(int);
@@ -23359,6 +23374,7 @@
method public void onResolvedTextDirectionReset();
method protected void onRestoreInstanceState(android.os.Parcelable);
method protected android.os.Parcelable onSaveInstanceState();
+ method public void onScreenStateChanged(int);
method protected void onScrollChanged(int, int, int, int);
method protected boolean onSetAlpha(int);
method protected void onSizeChanged(int, int, int, int);
@@ -23568,6 +23584,8 @@
field public static final android.util.Property ROTATION_Y;
field public static final android.util.Property SCALE_X;
field public static final android.util.Property SCALE_Y;
+ field public static final int SCREEN_STATE_OFF = 0; // 0x0
+ field public static final int SCREEN_STATE_ON = 1; // 0x1
field public static final int SCROLLBARS_INSIDE_INSET = 16777216; // 0x1000000
field public static final int SCROLLBARS_INSIDE_OVERLAY = 0; // 0x0
field public static final int SCROLLBARS_OUTSIDE_INSET = 50331648; // 0x3000000
@@ -27500,14 +27518,24 @@
ctor public Switch(android.content.Context);
ctor public Switch(android.content.Context, android.util.AttributeSet);
ctor public Switch(android.content.Context, android.util.AttributeSet, int);
+ method public int getSwitchMinWidth();
+ method public int getSwitchPadding();
method public java.lang.CharSequence getTextOff();
method public java.lang.CharSequence getTextOn();
+ method public android.graphics.drawable.Drawable getThumbDrawable();
+ method public int getThumbTextPadding();
+ method public android.graphics.drawable.Drawable getTrackDrawable();
method public void onMeasure(int, int);
+ method public void setSwitchMinWidth(int);
+ method public void setSwitchPadding(int);
method public void setSwitchTextAppearance(android.content.Context, int);
method public void setSwitchTypeface(android.graphics.Typeface, int);
method public void setSwitchTypeface(android.graphics.Typeface);
method public void setTextOff(java.lang.CharSequence);
method public void setTextOn(java.lang.CharSequence);
+ method public void setThumbDrawable(android.graphics.drawable.Drawable);
+ method public void setThumbTextPadding(int);
+ method public void setTrackDrawable(android.graphics.drawable.Drawable);
}
public class TabHost extends android.widget.FrameLayout implements android.view.ViewTreeObserver.OnTouchModeChangeListener {
@@ -27634,9 +27662,12 @@
method public final int getAutoLinkMask();
method public int getCompoundDrawablePadding();
method public android.graphics.drawable.Drawable[] getCompoundDrawables();
+ method public android.graphics.drawable.Drawable[] getCompoundDrawablesRelative();
method public int getCompoundPaddingBottom();
+ method public int getCompoundPaddingEnd();
method public int getCompoundPaddingLeft();
method public int getCompoundPaddingRight();
+ method public int getCompoundPaddingStart();
method public int getCompoundPaddingTop();
method public final int getCurrentHintTextColor();
method public final int getCurrentTextColor();
@@ -27679,8 +27710,10 @@
method public float getTextScaleX();
method public float getTextSize();
method public int getTotalPaddingBottom();
+ method public int getTotalPaddingEnd();
method public int getTotalPaddingLeft();
method public int getTotalPaddingRight();
+ method public int getTotalPaddingStart();
method public int getTotalPaddingTop();
method public final android.text.method.TransformationMethod getTransformationMethod();
method public android.graphics.Typeface getTypeface();
@@ -27710,6 +27743,9 @@
method public final void setAutoLinkMask(int);
method public void setCompoundDrawablePadding(int);
method public void setCompoundDrawables(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
+ method public void setCompoundDrawablesRelative(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
+ method public void setCompoundDrawablesRelativeWithIntrinsicBounds(int, int, int, int);
+ method public void setCompoundDrawablesRelativeWithIntrinsicBounds(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
method public void setCompoundDrawablesWithIntrinsicBounds(int, int, int, int);
method public void setCompoundDrawablesWithIntrinsicBounds(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
method public void setCursorVisible(boolean);
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index 13b63dc..ba79c9f 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -86,11 +86,6 @@
dump_file("PAGETYPEINFO", "/proc/pagetypeinfo");
dump_file("BUDDYINFO", "/proc/buddyinfo");
- print_properties();
-
- /* TODO: Make last_kmsg CAP_SYSLOG protected. b/5555691 */
- dump_file("LAST KMSG", "/proc/last_kmsg");
- do_dmesg();
dump_file("KERNEL WAKELOCKS", "/proc/wakelocks");
dump_file("KERNEL CPUFREQ", "/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state");
@@ -99,6 +94,19 @@
run_command("PROCESSES AND THREADS", 10, "ps", "-t", "-p", "-P", NULL);
run_command("LIBRANK", 10, "librank", NULL);
+ do_dmesg();
+
+ run_command("LIST OF OPEN FILES", 10, SU_PATH, "root", "lsof", NULL);
+
+ for_each_pid(do_showmap, "SMAPS OF ALL PROCESSES");
+ for_each_pid(show_wchan, "BLOCKED PROCESS WAIT-CHANNELS");
+
+ // dump_file("EVENT LOG TAGS", "/etc/event-log-tags");
+ run_command("SYSTEM LOG", 20, "logcat", "-v", "threadtime", "-d", "*:v", NULL);
+ run_command("EVENT LOG", 20, "logcat", "-b", "events", "-v", "threadtime", "-d", "*:v", NULL);
+ run_command("RADIO LOG", 20, "logcat", "-b", "radio", "-v", "threadtime", "-d", "*:v", NULL);
+
+
/* show the traces we collected in main(), if that was done */
if (dump_traces_path != NULL) {
dump_file("VM TRACES JUST NOW", dump_traces_path);
@@ -124,6 +132,11 @@
dump_file("NETWORK ROUTES", "/proc/net/route");
dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route");
+ /* TODO: Make last_kmsg CAP_SYSLOG protected. b/5555691 */
+ dump_file("LAST KMSG", "/proc/last_kmsg");
+ dump_file("LAST PANIC CONSOLE", "/data/dontpanic/apanic_console");
+ dump_file("LAST PANIC THREADS", "/data/dontpanic/apanic_threads");
+
if (screenshot_path[0]) {
ALOGI("taking screenshot\n");
run_command(NULL, 5, SU_PATH, "root", "screenshot", screenshot_path, NULL);
@@ -134,11 +147,7 @@
"/data/data/com.android.providers.settings/databases/settings.db",
"pragma user_version; select * from system; select * from secure;", NULL);
- // dump_file("EVENT LOG TAGS", "/etc/event-log-tags");
- run_command("SYSTEM LOG", 20, "logcat", "-v", "threadtime", "-d", "*:v", NULL);
- run_command("EVENT LOG", 20, "logcat", "-b", "events", "-v", "threadtime", "-d", "*:v", NULL);
- run_command("RADIO LOG", 20, "logcat", "-b", "radio", "-v", "threadtime", "-d", "*:v", NULL);
-
+ /* The following have a tendency to get wedged when wifi drivers/fw goes belly-up. */
run_command("NETWORK INTERFACES", 10, SU_PATH, "root", "netcfg", NULL);
run_command("IP RULES", 10, "ip", "rule", "show", NULL);
run_command("IP RULES v6", 10, "ip", "-6", "rule", "show", NULL);
@@ -171,40 +180,17 @@
SU_PATH, "root", "wlutil", "counters", NULL);
#endif
- char ril_dumpstate_timeout[PROPERTY_VALUE_MAX] = {0};
- property_get("ril.dumpstate.timeout", ril_dumpstate_timeout, "30");
- if (strnlen(ril_dumpstate_timeout, PROPERTY_VALUE_MAX - 1) > 0) {
- if (0 == strncmp(build_type, "user", PROPERTY_VALUE_MAX - 1)) {
- // su does not exist on user builds, so try running without it.
- // This way any implementations of vril-dump that do not require
- // root can run on user builds.
- run_command("DUMP VENDOR RIL LOGS", atoi(ril_dumpstate_timeout),
- "vril-dump", NULL);
- } else {
- run_command("DUMP VENDOR RIL LOGS", atoi(ril_dumpstate_timeout),
- SU_PATH, "root", "vril-dump", NULL);
- }
- }
+ print_properties();
run_command("VOLD DUMP", 10, "vdc", "dump", NULL);
run_command("SECURE CONTAINERS", 10, "vdc", "asec", "list", NULL);
- dump_file("BINDER FAILED TRANSACTION LOG", "/sys/kernel/debug/binder/failed_transaction_log");
- dump_file("BINDER TRANSACTION LOG", "/sys/kernel/debug/binder/transaction_log");
- dump_file("BINDER TRANSACTIONS", "/sys/kernel/debug/binder/transactions");
- dump_file("BINDER STATS", "/sys/kernel/debug/binder/stats");
- dump_file("BINDER STATE", "/sys/kernel/debug/binder/state");
-
run_command("FILESYSTEMS & FREE SPACE", 10, SU_PATH, "root", "df", NULL);
dump_file("PACKAGE SETTINGS", "/data/system/packages.xml");
dump_file("PACKAGE UID ERRORS", "/data/system/uiderrors.txt");
run_command("LAST RADIO LOG", 10, "parse_radio_log", "/proc/last_radio_log", NULL);
- dump_file("LAST PANIC CONSOLE", "/data/dontpanic/apanic_console");
- dump_file("LAST PANIC THREADS", "/data/dontpanic/apanic_threads");
-
- for_each_pid(show_wchan, "BLOCKED PROCESS WAIT-CHANNELS");
printf("------ BACKLIGHTS ------\n");
printf("LCD brightness=");
@@ -219,9 +205,12 @@
dump_file(NULL, "/sys/class/leds/lcd-backlight/registers");
printf("\n");
- run_command("LIST OF OPEN FILES", 10, SU_PATH, "root", "lsof", NULL);
-
- for_each_pid(do_showmap, "SMAPS OF ALL PROCESSES");
+ /* Binder state is expensive to look at as it uses a lot of memory. */
+ dump_file("BINDER FAILED TRANSACTION LOG", "/sys/kernel/debug/binder/failed_transaction_log");
+ dump_file("BINDER TRANSACTION LOG", "/sys/kernel/debug/binder/transaction_log");
+ dump_file("BINDER TRANSACTIONS", "/sys/kernel/debug/binder/transactions");
+ dump_file("BINDER STATS", "/sys/kernel/debug/binder/stats");
+ dump_file("BINDER STATE", "/sys/kernel/debug/binder/state");
#ifdef BOARD_HAS_DUMPSTATE
printf("========================================================\n");
@@ -232,6 +221,22 @@
printf("\n");
#endif
+ /* Migrate the ril_dumpstate to a dumpstate_board()? */
+ char ril_dumpstate_timeout[PROPERTY_VALUE_MAX] = {0};
+ property_get("ril.dumpstate.timeout", ril_dumpstate_timeout, "30");
+ if (strnlen(ril_dumpstate_timeout, PROPERTY_VALUE_MAX - 1) > 0) {
+ if (0 == strncmp(build_type, "user", PROPERTY_VALUE_MAX - 1)) {
+ // su does not exist on user builds, so try running without it.
+ // This way any implementations of vril-dump that do not require
+ // root can run on user builds.
+ run_command("DUMP VENDOR RIL LOGS", atoi(ril_dumpstate_timeout),
+ "vril-dump", NULL);
+ } else {
+ run_command("DUMP VENDOR RIL LOGS", atoi(ril_dumpstate_timeout),
+ SU_PATH, "root", "vril-dump", NULL);
+ }
+ }
+
printf("========================================================\n");
printf("== Android Framework Services\n");
printf("========================================================\n");
diff --git a/cmds/stagefright/codec.cpp b/cmds/stagefright/codec.cpp
index fbf800c..0414b98 100644
--- a/cmds/stagefright/codec.cpp
+++ b/cmds/stagefright/codec.cpp
@@ -35,7 +35,8 @@
static void usage(const char *me) {
fprintf(stderr, "usage: %s [-a] use audio\n"
"\t\t[-v] use video\n"
- "\t\t[-p] playback\n", me);
+ "\t\t[-p] playback\n"
+ "\t\t[-S] allocate buffers from a surface\n", me);
exit(1);
}
@@ -49,6 +50,9 @@
Vector<sp<ABuffer> > mInBuffers;
Vector<sp<ABuffer> > mOutBuffers;
bool mSawOutputEOS;
+ int64_t mNumBuffersDecoded;
+ int64_t mNumBytesDecoded;
+ bool mIsAudio;
};
} // namespace android
@@ -57,9 +61,12 @@
const android::sp<android::ALooper> &looper,
const char *path,
bool useAudio,
- bool useVideo) {
+ bool useVideo,
+ const android::sp<android::Surface> &surface) {
using namespace android;
+ static int64_t kTimeout = 500ll;
+
sp<NuMediaExtractor> extractor = new NuMediaExtractor;
if (extractor->setDataSource(path) != OK) {
fprintf(stderr, "unable to instantiate extractor.\n");
@@ -78,11 +85,12 @@
AString mime;
CHECK(format->findString("mime", &mime));
- if (useAudio && !haveAudio
- && !strncasecmp(mime.c_str(), "audio/", 6)) {
+ bool isAudio = !strncasecmp(mime.c_str(), "audio/", 6);
+ bool isVideo = !strncasecmp(mime.c_str(), "video/", 6);
+
+ if (useAudio && !haveAudio && isAudio) {
haveAudio = true;
- } else if (useVideo && !haveVideo
- && !strncasecmp(mime.c_str(), "video/", 6)) {
+ } else if (useVideo && !haveVideo && isVideo) {
haveVideo = true;
} else {
continue;
@@ -96,13 +104,17 @@
CodecState *state =
&stateByTrack.editValueAt(stateByTrack.add(i, CodecState()));
+ state->mNumBytesDecoded = 0;
+ state->mNumBuffersDecoded = 0;
+ state->mIsAudio = isAudio;
+
state->mCodec = MediaCodec::CreateByType(
looper, mime.c_str(), false /* encoder */);
CHECK(state->mCodec != NULL);
err = state->mCodec->configure(
- format, NULL /* surfaceTexture */, 0 /* flags */);
+ format, isVideo ? surface : NULL, 0 /* flags */);
CHECK_EQ(err, (status_t)OK);
@@ -122,6 +134,8 @@
CHECK(!stateByTrack.isEmpty());
+ int64_t startTimeUs = ALooper::GetNowUs();
+
for (size_t i = 0; i < stateByTrack.size(); ++i) {
CodecState *state = &stateByTrack.editValueAt(i);
@@ -137,13 +151,7 @@
while (state->mCSDIndex < state->mCSD.size()) {
size_t index;
- status_t err = codec->dequeueInputBuffer(&index);
-
- if (err == -EAGAIN) {
- usleep(10000);
- continue;
- }
-
+ status_t err = codec->dequeueInputBuffer(&index, -1ll);
CHECK_EQ(err, (status_t)OK);
const sp<ABuffer> &srcBuffer =
@@ -179,7 +187,7 @@
for (;;) {
size_t index;
- err = state->mCodec->dequeueInputBuffer(&index);
+ err = state->mCodec->dequeueInputBuffer(&index, kTimeout);
if (err == -EAGAIN) {
continue;
@@ -204,7 +212,7 @@
CodecState *state = &stateByTrack.editValueFor(trackIndex);
size_t index;
- err = state->mCodec->dequeueInputBuffer(&index);
+ err = state->mCodec->dequeueInputBuffer(&index, kTimeout);
if (err == OK) {
ALOGV("filling input buffer %d", index);
@@ -261,12 +269,15 @@
uint32_t flags;
status_t err = state->mCodec->dequeueOutputBuffer(
&index, &offset, &size, &presentationTimeUs, &flags,
- 10000ll);
+ kTimeout);
if (err == OK) {
ALOGV("draining output buffer %d, time = %lld us",
index, presentationTimeUs);
+ ++state->mNumBuffersDecoded;
+ state->mNumBytesDecoded += size;
+
err = state->mCodec->releaseOutputBuffer(index);
CHECK_EQ(err, (status_t)OK);
@@ -292,10 +303,27 @@
}
}
+ int64_t elapsedTimeUs = ALooper::GetNowUs() - startTimeUs;
+
for (size_t i = 0; i < stateByTrack.size(); ++i) {
CodecState *state = &stateByTrack.editValueAt(i);
CHECK_EQ((status_t)OK, state->mCodec->release());
+
+ if (state->mIsAudio) {
+ printf("track %d: %lld bytes received. %.2f KB/sec\n",
+ i,
+ state->mNumBytesDecoded,
+ state->mNumBytesDecoded * 1E6 / 1024 / elapsedTimeUs);
+ } else {
+ printf("track %d: %lld frames decoded, %.2f fps. %lld bytes "
+ "received. %.2f KB/sec\n",
+ i,
+ state->mNumBuffersDecoded,
+ state->mNumBuffersDecoded * 1E6 / elapsedTimeUs,
+ state->mNumBytesDecoded,
+ state->mNumBytesDecoded * 1E6 / 1024 / elapsedTimeUs);
+ }
}
return 0;
@@ -309,9 +337,10 @@
bool useAudio = false;
bool useVideo = false;
bool playback = false;
+ bool useSurface = false;
int res;
- while ((res = getopt(argc, argv, "havp")) >= 0) {
+ while ((res = getopt(argc, argv, "havpS")) >= 0) {
switch (res) {
case 'a':
{
@@ -331,6 +360,12 @@
break;
}
+ case 'S':
+ {
+ useSurface = true;
+ break;
+ }
+
case '?':
case 'h':
default:
@@ -358,8 +393,12 @@
sp<ALooper> looper = new ALooper;
looper->start();
- if (playback) {
- sp<SurfaceComposerClient> composerClient = new SurfaceComposerClient;
+ sp<SurfaceComposerClient> composerClient;
+ sp<SurfaceControl> control;
+ sp<Surface> surface;
+
+ if (playback || (useSurface && useVideo)) {
+ composerClient = new SurfaceComposerClient;
CHECK_EQ(composerClient->initCheck(), (status_t)OK);
ssize_t displayWidth = composerClient->getDisplayWidth(0);
@@ -367,14 +406,13 @@
ALOGV("display is %ld x %ld\n", displayWidth, displayHeight);
- sp<SurfaceControl> control =
- composerClient->createSurface(
- String8("A Surface"),
- 0,
- displayWidth,
- displayHeight,
- PIXEL_FORMAT_RGB_565,
- 0);
+ control = composerClient->createSurface(
+ String8("A Surface"),
+ 0,
+ displayWidth,
+ displayHeight,
+ PIXEL_FORMAT_RGB_565,
+ 0);
CHECK(control != NULL);
CHECK(control->isValid());
@@ -384,9 +422,11 @@
CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction();
- sp<Surface> surface = control->getSurface();
+ surface = control->getSurface();
CHECK(surface != NULL);
+ }
+ if (playback) {
sp<SimplePlayer> player = new SimplePlayer;
looper->registerHandler(player);
@@ -396,10 +436,12 @@
sleep(60);
player->stop();
player->reset();
-
- composerClient->dispose();
} else {
- decode(looper, argv[0], useAudio, useVideo);
+ decode(looper, argv[0], useAudio, useVideo, surface);
+ }
+
+ if (playback || (useSurface && useVideo)) {
+ composerClient->dispose();
}
looper->stop();
diff --git a/cmds/surfaceflinger/Android.mk b/cmds/surfaceflinger/Android.mk
deleted file mode 100644
index 1df32bb..0000000
--- a/cmds/surfaceflinger/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- main_surfaceflinger.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libsurfaceflinger \
- libbinder \
- libutils
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/../../services/surfaceflinger
-
-LOCAL_MODULE:= surfaceflinger
-
-include $(BUILD_EXECUTABLE)
diff --git a/cmds/surfaceflinger/main_surfaceflinger.cpp b/cmds/surfaceflinger/main_surfaceflinger.cpp
deleted file mode 100644
index 6dbcf5c..0000000
--- a/cmds/surfaceflinger/main_surfaceflinger.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <binder/BinderService.h>
-#include <SurfaceFlinger.h>
-
-using namespace android;
-
-int main(int argc, char** argv) {
- SurfaceFlinger::publishAndJoinThreadPool(true);
- return 0;
-}
diff --git a/cmds/system_server/library/Android.mk b/cmds/system_server/library/Android.mk
index e8afce3..7d08a8c 100644
--- a/cmds/system_server/library/Android.mk
+++ b/cmds/system_server/library/Android.mk
@@ -5,13 +5,14 @@
system_init.cpp
base = $(LOCAL_PATH)/../../..
+native = $(LOCAL_PATH)/../../../../native
LOCAL_C_INCLUDES := \
$(base)/services/camera/libcameraservice \
$(base)/services/audioflinger \
- $(base)/services/surfaceflinger \
$(base)/services/sensorservice \
$(base)/media/libmediaplayerservice \
+ $(native)/services/surfaceflinger \
$(JNI_H_INCLUDE)
LOCAL_SHARED_LIBRARIES := \
diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java
index 5fee4de..adc7d35 100644
--- a/core/java/android/accounts/AccountManagerService.java
+++ b/core/java/android/accounts/AccountManagerService.java
@@ -18,6 +18,7 @@
import android.Manifest;
import android.app.ActivityManager;
+import android.app.AppGlobals;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@@ -33,6 +34,7 @@
import android.content.pm.PackageManager;
import android.content.pm.RegisteredServicesCache;
import android.content.pm.RegisteredServicesCacheListener;
+import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.DatabaseUtils;
@@ -48,11 +50,14 @@
import android.os.Message;
import android.os.RemoteException;
import android.os.SystemClock;
+import android.os.UserId;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
+import android.util.SparseArray;
import com.android.internal.R;
+import com.android.internal.util.IndentingPrintWriter;
import java.io.File;
import java.io.FileDescriptor;
@@ -62,6 +67,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@@ -94,7 +100,6 @@
private static final int MESSAGE_TIMED_OUT = 3;
private final IAccountAuthenticatorCache mAuthenticatorCache;
- private final DatabaseHelper mOpenHelper;
private static final String TABLE_ACCOUNTS = "accounts";
private static final String ACCOUNTS_ID = "_id";
@@ -148,14 +153,36 @@
private final LinkedHashMap<String, Session> mSessions = new LinkedHashMap<String, Session>();
private final AtomicInteger mNotificationIds = new AtomicInteger(1);
- private final HashMap<Pair<Pair<Account, String>, Integer>, Integer>
- mCredentialsPermissionNotificationIds =
- new HashMap<Pair<Pair<Account, String>, Integer>, Integer>();
- private final HashMap<Account, Integer> mSigninRequiredNotificationIds =
- new HashMap<Account, Integer>();
+ static class UserAccounts {
+ private final int userId;
+ private final DatabaseHelper openHelper;
+ private final HashMap<Pair<Pair<Account, String>, Integer>, Integer>
+ credentialsPermissionNotificationIds =
+ new HashMap<Pair<Pair<Account, String>, Integer>, Integer>();
+ private final HashMap<Account, Integer> signinRequiredNotificationIds =
+ new HashMap<Account, Integer>();
+ private final Object cacheLock = new Object();
+ /** protected by the {@link #cacheLock} */
+ private final HashMap<String, Account[]> accountCache = new HashMap<String, Account[]>();
+ /** protected by the {@link #cacheLock} */
+ private HashMap<Account, HashMap<String, String>> userDataCache =
+ new HashMap<Account, HashMap<String, String>>();
+ /** protected by the {@link #cacheLock} */
+ private HashMap<Account, HashMap<String, String>> authTokenCache =
+ new HashMap<Account, HashMap<String, String>>();
+
+ UserAccounts(Context context, int userId) {
+ this.userId = userId;
+ synchronized (cacheLock) {
+ openHelper = new DatabaseHelper(context, userId);
+ }
+ }
+ }
+
+ private final SparseArray<UserAccounts> mUsers = new SparseArray<UserAccounts>();
+
private static AtomicReference<AccountManagerService> sThis =
new AtomicReference<AccountManagerService>();
-
private static final Account[] EMPTY_ACCOUNT_ARRAY = new Account[]{};
static {
@@ -163,15 +190,6 @@
ACCOUNTS_CHANGED_INTENT.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
}
- private final Object mCacheLock = new Object();
- /** protected by the {@link #mCacheLock} */
- private final HashMap<String, Account[]> mAccountCache = new HashMap<String, Account[]>();
- /** protected by the {@link #mCacheLock} */
- private HashMap<Account, HashMap<String, String>> mUserDataCache =
- new HashMap<Account, HashMap<String, String>>();
- /** protected by the {@link #mCacheLock} */
- private HashMap<Account, HashMap<String, String>> mAuthTokenCache =
- new HashMap<Account, HashMap<String, String>>();
/**
* This should only be called by system code. One should only call this after the service
@@ -192,10 +210,6 @@
mContext = context;
mPackageManager = packageManager;
- synchronized (mCacheLock) {
- mOpenHelper = new DatabaseHelper(mContext);
- }
-
mMessageThread = new HandlerThread("AccountManagerService");
mMessageThread.start();
mMessageHandler = new MessageHandler(mMessageThread.getLooper());
@@ -203,6 +217,8 @@
mAuthenticatorCache = authenticatorCache;
mAuthenticatorCache.setListener(this, null /* Handler */);
+ UserAccounts accounts = initUser(0);
+
sThis.set(this);
IntentFilter intentFilter = new IntentFilter();
@@ -211,17 +227,36 @@
mContext.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context1, Intent intent) {
- purgeOldGrants();
+ purgeOldGrantsAll();
}
}, intentFilter);
- purgeOldGrants();
- validateAccountsAndPopulateCache();
}
- private void purgeOldGrants() {
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ private UserAccounts initUser(int userId) {
+ synchronized (mUsers) {
+ UserAccounts accounts = mUsers.get(userId);
+ if (accounts == null) {
+ accounts = new UserAccounts(mContext, userId);
+ mUsers.append(userId, accounts);
+ purgeOldGrants(accounts);
+ validateAccountsAndPopulateCache(accounts);
+ }
+ return accounts;
+ }
+ }
+
+ private void purgeOldGrantsAll() {
+ synchronized (mUsers) {
+ for (int i = 0; i < mUsers.size(); i++) {
+ purgeOldGrants(mUsers.valueAt(i));
+ }
+ }
+ }
+
+ private void purgeOldGrants(UserAccounts accounts) {
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
final Cursor cursor = db.query(TABLE_GRANTS,
new String[]{GRANTS_GRANTEE_UID},
null, null, GRANTS_GRANTEE_UID, null, null);
@@ -243,15 +278,15 @@
}
}
- private void validateAccountsAndPopulateCache() {
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ private void validateAccountsAndPopulateCache(UserAccounts accounts) {
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
boolean accountDeleted = false;
Cursor cursor = db.query(TABLE_ACCOUNTS,
new String[]{ACCOUNTS_ID, ACCOUNTS_TYPE, ACCOUNTS_NAME},
null, null, null, null, null);
try {
- mAccountCache.clear();
+ accounts.accountCache.clear();
final HashMap<String, ArrayList<String>> accountNamesByType =
new HashMap<String, ArrayList<String>>();
while (cursor.moveToNext()) {
@@ -265,8 +300,8 @@
db.delete(TABLE_ACCOUNTS, ACCOUNTS_ID + "=" + accountId, null);
accountDeleted = true;
final Account account = new Account(accountName, accountType);
- mUserDataCache.remove(account);
- mAuthTokenCache.remove(account);
+ accounts.userDataCache.remove(account);
+ accounts.authTokenCache.remove(account);
} else {
ArrayList<String> accountNames = accountNamesByType.get(accountType);
if (accountNames == null) {
@@ -286,19 +321,51 @@
accountsForType[i] = new Account(accountName, accountType);
++i;
}
- mAccountCache.put(accountType, accountsForType);
+ accounts.accountCache.put(accountType, accountsForType);
}
} finally {
cursor.close();
if (accountDeleted) {
- sendAccountsChangedBroadcast();
+ sendAccountsChangedBroadcast(accounts.userId);
}
}
}
}
+ private UserAccounts getUserAccountsForCaller() {
+ return getUserAccounts(UserId.getCallingUserId());
+ }
+
+ protected UserAccounts getUserAccounts(int userId) {
+ synchronized (mUsers) {
+ UserAccounts accounts = mUsers.get(userId);
+ if (accounts == null) {
+ accounts = initUser(userId);
+ mUsers.append(userId, accounts);
+ }
+ return accounts;
+ }
+ }
+
+ private List<UserInfo> getAllUsers() {
+ try {
+ return AppGlobals.getPackageManager().getUsers();
+ } catch (RemoteException re) {
+ // Local to system process, shouldn't happen
+ }
+ return null;
+ }
+
public void onServiceChanged(AuthenticatorDescription desc, boolean removed) {
- validateAccountsAndPopulateCache();
+ // Validate accounts for all users
+ List<UserInfo> users = getAllUsers();
+ if (users == null) {
+ validateAccountsAndPopulateCache(getUserAccountsForCaller());
+ } else {
+ for (UserInfo user : users) {
+ validateAccountsAndPopulateCache(getUserAccounts(user.id));
+ }
+ }
}
public String getPassword(Account account) {
@@ -310,21 +377,22 @@
if (account == null) throw new IllegalArgumentException("account is null");
checkAuthenticateAccountsPermission(account);
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- return readPasswordInternal(account);
+ return readPasswordInternal(accounts, account);
} finally {
restoreCallingIdentity(identityToken);
}
}
- private String readPasswordInternal(Account account) {
+ private String readPasswordInternal(UserAccounts accounts, Account account) {
if (account == null) {
return null;
}
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getReadableDatabase();
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getReadableDatabase();
Cursor cursor = db.query(TABLE_ACCOUNTS, new String[]{ACCOUNTS_PASSWORD},
ACCOUNTS_NAME + "=? AND " + ACCOUNTS_TYPE+ "=?",
new String[]{account.name, account.type}, null, null, null);
@@ -349,9 +417,10 @@
if (account == null) throw new IllegalArgumentException("account is null");
if (key == null) throw new IllegalArgumentException("key is null");
checkAuthenticateAccountsPermission(account);
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- return readUserDataInternal(account, key);
+ return readUserDataInternal(accounts, account, key);
} finally {
restoreCallingIdentity(identityToken);
}
@@ -390,21 +459,23 @@
if (account == null) throw new IllegalArgumentException("account is null");
checkAuthenticateAccountsPermission(account);
+ UserAccounts accounts = getUserAccountsForCaller();
// fails if the account already exists
long identityToken = clearCallingIdentity();
try {
- return addAccountInternal(account, password, extras);
+ return addAccountInternal(accounts, account, password, extras);
} finally {
restoreCallingIdentity(identityToken);
}
}
- private boolean addAccountInternal(Account account, String password, Bundle extras) {
+ private boolean addAccountInternal(UserAccounts accounts, Account account, String password,
+ Bundle extras) {
if (account == null) {
return false;
}
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
db.beginTransaction();
try {
long numMatches = DatabaseUtils.longForQuery(db,
@@ -437,11 +508,11 @@
}
}
db.setTransactionSuccessful();
- insertAccountIntoCacheLocked(account);
+ insertAccountIntoCacheLocked(accounts, account);
} finally {
db.endTransaction();
}
- sendAccountsChangedBroadcast();
+ sendAccountsChangedBroadcast(accounts.userId);
return true;
}
}
@@ -467,9 +538,10 @@
if (account == null) throw new IllegalArgumentException("account is null");
if (features == null) throw new IllegalArgumentException("features is null");
checkReadAccountsPermission();
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- new TestFeaturesSession(response, account, features).bind();
+ new TestFeaturesSession(accounts, response, account, features).bind();
} finally {
restoreCallingIdentity(identityToken);
}
@@ -479,9 +551,9 @@
private final String[] mFeatures;
private final Account mAccount;
- public TestFeaturesSession(IAccountManagerResponse response,
+ public TestFeaturesSession(UserAccounts accounts, IAccountManagerResponse response,
Account account, String[] features) {
- super(response, account.type, false /* expectActivityLaunch */,
+ super(accounts, response, account.type, false /* expectActivityLaunch */,
true /* stripAuthTokenFromResult */);
mFeatures = features;
mAccount = account;
@@ -537,21 +609,22 @@
if (response == null) throw new IllegalArgumentException("response is null");
if (account == null) throw new IllegalArgumentException("account is null");
checkManageAccountsPermission();
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
- cancelNotification(getSigninRequiredNotificationId(account));
- synchronized(mCredentialsPermissionNotificationIds) {
+ cancelNotification(getSigninRequiredNotificationId(accounts, account));
+ synchronized(accounts.credentialsPermissionNotificationIds) {
for (Pair<Pair<Account, String>, Integer> pair:
- mCredentialsPermissionNotificationIds.keySet()) {
+ accounts.credentialsPermissionNotificationIds.keySet()) {
if (account.equals(pair.first.first)) {
- int id = mCredentialsPermissionNotificationIds.get(pair);
+ int id = accounts.credentialsPermissionNotificationIds.get(pair);
cancelNotification(id);
}
}
}
try {
- new RemoveAccountSession(response, account).bind();
+ new RemoveAccountSession(accounts, response, account).bind();
} finally {
restoreCallingIdentity(identityToken);
}
@@ -559,8 +632,9 @@
private class RemoveAccountSession extends Session {
final Account mAccount;
- public RemoveAccountSession(IAccountManagerResponse response, Account account) {
- super(response, account.type, false /* expectActivityLaunch */,
+ public RemoveAccountSession(UserAccounts accounts, IAccountManagerResponse response,
+ Account account) {
+ super(accounts, response, account.type, false /* expectActivityLaunch */,
true /* stripAuthTokenFromResult */);
mAccount = account;
}
@@ -579,7 +653,7 @@
&& !result.containsKey(AccountManager.KEY_INTENT)) {
final boolean removalAllowed = result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT);
if (removalAllowed) {
- removeAccountInternal(mAccount);
+ removeAccountInternal(mAccounts, mAccount);
}
IAccountManagerResponse response = getResponseAndClose();
if (response != null) {
@@ -600,13 +674,18 @@
}
}
+ /* For testing */
protected void removeAccountInternal(Account account) {
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ removeAccountInternal(getUserAccountsForCaller(), account);
+ }
+
+ private void removeAccountInternal(UserAccounts accounts, Account account) {
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
db.delete(TABLE_ACCOUNTS, ACCOUNTS_NAME + "=? AND " + ACCOUNTS_TYPE+ "=?",
new String[]{account.name, account.type});
- removeAccountFromCacheLocked(account);
- sendAccountsChangedBroadcast();
+ removeAccountFromCacheLocked(accounts, account);
+ sendAccountsChangedBroadcast(accounts.userId);
}
}
@@ -619,13 +698,14 @@
if (accountType == null) throw new IllegalArgumentException("accountType is null");
if (authToken == null) throw new IllegalArgumentException("authToken is null");
checkManageAccountsOrUseCredentialsPermissions();
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
db.beginTransaction();
try {
- invalidateAuthTokenLocked(db, accountType, authToken);
+ invalidateAuthTokenLocked(accounts, db, accountType, authToken);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
@@ -636,7 +716,8 @@
}
}
- private void invalidateAuthTokenLocked(SQLiteDatabase db, String accountType, String authToken) {
+ private void invalidateAuthTokenLocked(UserAccounts accounts, SQLiteDatabase db,
+ String accountType, String authToken) {
if (authToken == null || accountType == null) {
return;
}
@@ -657,7 +738,7 @@
String accountName = cursor.getString(1);
String authTokenType = cursor.getString(2);
db.delete(TABLE_AUTHTOKENS, AUTHTOKENS_ID + "=" + authTokenId, null);
- writeAuthTokenIntoCacheLocked(db, new Account(accountName, accountType),
+ writeAuthTokenIntoCacheLocked(accounts, db, new Account(accountName, accountType),
authTokenType, null);
}
} finally {
@@ -665,13 +746,14 @@
}
}
- private boolean saveAuthTokenToDatabase(Account account, String type, String authToken) {
+ private boolean saveAuthTokenToDatabase(UserAccounts accounts, Account account, String type,
+ String authToken) {
if (account == null || type == null) {
return false;
}
- cancelNotification(getSigninRequiredNotificationId(account));
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ cancelNotification(getSigninRequiredNotificationId(accounts, account));
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
db.beginTransaction();
try {
long accountId = getAccountIdLocked(db, account);
@@ -687,7 +769,7 @@
values.put(AUTHTOKENS_AUTHTOKEN, authToken);
if (db.insert(TABLE_AUTHTOKENS, AUTHTOKENS_AUTHTOKEN, values) >= 0) {
db.setTransactionSuccessful();
- writeAuthTokenIntoCacheLocked(db, account, type, authToken);
+ writeAuthTokenIntoCacheLocked(accounts, db, account, type, authToken);
return true;
}
return false;
@@ -707,9 +789,10 @@
if (account == null) throw new IllegalArgumentException("account is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
checkAuthenticateAccountsPermission(account);
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- return readAuthTokenInternal(account, authTokenType);
+ return readAuthTokenInternal(accounts, account, authTokenType);
} finally {
restoreCallingIdentity(identityToken);
}
@@ -725,9 +808,10 @@
if (account == null) throw new IllegalArgumentException("account is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
checkAuthenticateAccountsPermission(account);
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- saveAuthTokenToDatabase(account, authTokenType, authToken);
+ saveAuthTokenToDatabase(accounts, account, authTokenType, authToken);
} finally {
restoreCallingIdentity(identityToken);
}
@@ -741,20 +825,21 @@
}
if (account == null) throw new IllegalArgumentException("account is null");
checkAuthenticateAccountsPermission(account);
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- setPasswordInternal(account, password);
+ setPasswordInternal(accounts, account, password);
} finally {
restoreCallingIdentity(identityToken);
}
}
- private void setPasswordInternal(Account account, String password) {
+ private void setPasswordInternal(UserAccounts accounts, Account account, String password) {
if (account == null) {
return;
}
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
db.beginTransaction();
try {
final ContentValues values = new ContentValues();
@@ -764,20 +849,20 @@
final String[] argsAccountId = {String.valueOf(accountId)};
db.update(TABLE_ACCOUNTS, values, ACCOUNTS_ID + "=?", argsAccountId);
db.delete(TABLE_AUTHTOKENS, AUTHTOKENS_ACCOUNTS_ID + "=?", argsAccountId);
- mAuthTokenCache.remove(account);
+ accounts.authTokenCache.remove(account);
db.setTransactionSuccessful();
}
} finally {
db.endTransaction();
}
- sendAccountsChangedBroadcast();
+ sendAccountsChangedBroadcast(accounts.userId);
}
}
- private void sendAccountsChangedBroadcast() {
+ private void sendAccountsChangedBroadcast(int userId) {
Log.i(TAG, "the accounts changed, sending broadcast of "
+ ACCOUNTS_CHANGED_INTENT.getAction());
- mContext.sendBroadcast(ACCOUNTS_CHANGED_INTENT);
+ mContext.sendBroadcast(ACCOUNTS_CHANGED_INTENT, userId);
}
public void clearPassword(Account account) {
@@ -788,9 +873,10 @@
}
if (account == null) throw new IllegalArgumentException("account is null");
checkManageAccountsPermission();
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- setPasswordInternal(account, null);
+ setPasswordInternal(accounts, account, null);
} finally {
restoreCallingIdentity(identityToken);
}
@@ -806,20 +892,22 @@
if (key == null) throw new IllegalArgumentException("key is null");
if (account == null) throw new IllegalArgumentException("account is null");
checkAuthenticateAccountsPermission(account);
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- setUserdataInternal(account, key, value);
+ setUserdataInternal(accounts, account, key, value);
} finally {
restoreCallingIdentity(identityToken);
}
}
- private void setUserdataInternal(Account account, String key, String value) {
+ private void setUserdataInternal(UserAccounts accounts, Account account, String key,
+ String value) {
if (account == null || key == null) {
return;
}
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
db.beginTransaction();
try {
long accountId = getAccountIdLocked(db, account);
@@ -840,7 +928,7 @@
}
}
- writeUserDataIntoCacheLocked(db, account, key, value);
+ writeUserDataIntoCacheLocked(accounts, db, account, key, value);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
@@ -868,15 +956,16 @@
}
void getAuthTokenLabel(final IAccountManagerResponse response,
- final Account account, final String authTokenType) {
+ final Account account,
+ final String authTokenType, int uid) {
if (account == null) throw new IllegalArgumentException("account is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
checkBinderPermission(Manifest.permission.USE_CREDENTIALS);
-
+ UserAccounts accounts = getUserAccounts(UserId.getUserId(uid));
long identityToken = clearCallingIdentity();
try {
- new Session(response, account.type, false,
+ new Session(accounts, response, account.type, false,
false /* stripAuthTokenFromResult */) {
protected String toDebugString(long now) {
return super.toDebugString(now) + ", getAuthTokenLabel"
@@ -921,6 +1010,7 @@
if (account == null) throw new IllegalArgumentException("account is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
checkBinderPermission(Manifest.permission.USE_CREDENTIALS);
+ UserAccounts accounts = getUserAccountsForCaller();
AccountAuthenticatorCache.ServiceInfo<AuthenticatorDescription> authenticatorInfo =
mAuthenticatorCache.getServiceInfo(
AuthenticatorDescription.newKey(account.type));
@@ -946,7 +1036,7 @@
// if the caller has permission, do the peek. otherwise go the more expensive
// route of starting a Session
if (!customTokens && permissionGranted) {
- String authToken = readAuthTokenInternal(account, authTokenType);
+ String authToken = readAuthTokenInternal(accounts, account, authTokenType);
if (authToken != null) {
Bundle result = new Bundle();
result.putString(AccountManager.KEY_AUTHTOKEN, authToken);
@@ -957,7 +1047,7 @@
}
}
- new Session(response, account.type, expectActivityLaunch,
+ new Session(accounts, response, account.type, expectActivityLaunch,
false /* stripAuthTokenFromResult */) {
protected String toDebugString(long now) {
if (loginOptions != null) loginOptions.keySet();
@@ -1000,14 +1090,14 @@
return;
}
if (!customTokens) {
- saveAuthTokenToDatabase(new Account(name, type),
+ saveAuthTokenToDatabase(mAccounts, new Account(name, type),
authTokenType, authToken);
}
}
Intent intent = result.getParcelable(AccountManager.KEY_INTENT);
if (intent != null && notifyOnAuthFailure && !customTokens) {
- doNotification(
+ doNotification(mAccounts,
account, result.getString(AccountManager.KEY_AUTH_FAILED_MESSAGE),
intent);
}
@@ -1090,26 +1180,27 @@
private Integer getCredentialPermissionNotificationId(Account account, String authTokenType,
int uid) {
Integer id;
- synchronized(mCredentialsPermissionNotificationIds) {
+ UserAccounts accounts = getUserAccounts(UserId.getUserId(uid));
+ synchronized (accounts.credentialsPermissionNotificationIds) {
final Pair<Pair<Account, String>, Integer> key =
new Pair<Pair<Account, String>, Integer>(
new Pair<Account, String>(account, authTokenType), uid);
- id = mCredentialsPermissionNotificationIds.get(key);
+ id = accounts.credentialsPermissionNotificationIds.get(key);
if (id == null) {
id = mNotificationIds.incrementAndGet();
- mCredentialsPermissionNotificationIds.put(key, id);
+ accounts.credentialsPermissionNotificationIds.put(key, id);
}
}
return id;
}
- private Integer getSigninRequiredNotificationId(Account account) {
+ private Integer getSigninRequiredNotificationId(UserAccounts accounts, Account account) {
Integer id;
- synchronized(mSigninRequiredNotificationIds) {
- id = mSigninRequiredNotificationIds.get(account);
+ synchronized (accounts.signinRequiredNotificationIds) {
+ id = accounts.signinRequiredNotificationIds.get(account);
if (id == null) {
id = mNotificationIds.incrementAndGet();
- mSigninRequiredNotificationIds.put(account, id);
+ accounts.signinRequiredNotificationIds.put(account, id);
}
}
return id;
@@ -1131,6 +1222,7 @@
if (accountType == null) throw new IllegalArgumentException("accountType is null");
checkManageAccountsPermission();
+ UserAccounts accounts = getUserAccountsForCaller();
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final Bundle options = (optionsIn == null) ? new Bundle() : optionsIn;
@@ -1139,7 +1231,7 @@
long identityToken = clearCallingIdentity();
try {
- new Session(response, accountType, expectActivityLaunch,
+ new Session(accounts, response, accountType, expectActivityLaunch,
true /* stripAuthTokenFromResult */) {
public void run() throws RemoteException {
mAuthenticator.addAccount(this, mAccountType, authTokenType, requiredFeatures,
@@ -1172,9 +1264,10 @@
if (response == null) throw new IllegalArgumentException("response is null");
if (account == null) throw new IllegalArgumentException("account is null");
checkManageAccountsPermission();
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- new Session(response, account.type, expectActivityLaunch,
+ new Session(accounts, response, account.type, expectActivityLaunch,
true /* stripAuthTokenFromResult */) {
public void run() throws RemoteException {
mAuthenticator.confirmCredentials(this, account, options);
@@ -1204,9 +1297,10 @@
if (account == null) throw new IllegalArgumentException("account is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
checkManageAccountsPermission();
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- new Session(response, account.type, expectActivityLaunch,
+ new Session(accounts, response, account.type, expectActivityLaunch,
true /* stripAuthTokenFromResult */) {
public void run() throws RemoteException {
mAuthenticator.updateCredentials(this, account, authTokenType, loginOptions);
@@ -1236,9 +1330,10 @@
if (response == null) throw new IllegalArgumentException("response is null");
if (accountType == null) throw new IllegalArgumentException("accountType is null");
checkManageAccountsPermission();
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- new Session(response, accountType, expectActivityLaunch,
+ new Session(accounts, response, accountType, expectActivityLaunch,
true /* stripAuthTokenFromResult */) {
public void run() throws RemoteException {
mAuthenticator.editProperties(this, mAccountType);
@@ -1259,16 +1354,16 @@
private volatile ArrayList<Account> mAccountsWithFeatures = null;
private volatile int mCurrentAccount = 0;
- public GetAccountsByTypeAndFeatureSession(IAccountManagerResponse response,
- String type, String[] features) {
- super(response, type, false /* expectActivityLaunch */,
+ public GetAccountsByTypeAndFeatureSession(UserAccounts accounts,
+ IAccountManagerResponse response, String type, String[] features) {
+ super(accounts, response, type, false /* expectActivityLaunch */,
true /* stripAuthTokenFromResult */);
mFeatures = features;
}
public void run() throws RemoteException {
- synchronized (mCacheLock) {
- mAccountsOfType = getAccountsFromCacheLocked(mAccountType);
+ synchronized (mAccounts.cacheLock) {
+ mAccountsOfType = getAccountsFromCacheLocked(mAccounts, mAccountType);
}
// check whether each account matches the requested features
mAccountsWithFeatures = new ArrayList<Account>(mAccountsOfType.length);
@@ -1346,6 +1441,23 @@
}
}
+ /**
+ * Returns the accounts for a specific user
+ * @hide
+ */
+ public Account[] getAccounts(int userId) {
+ checkReadAccountsPermission();
+ UserAccounts accounts = getUserAccounts(userId);
+ long identityToken = clearCallingIdentity();
+ try {
+ synchronized (accounts.cacheLock) {
+ return getAccountsFromCacheLocked(accounts, null);
+ }
+ } finally {
+ restoreCallingIdentity(identityToken);
+ }
+ }
+
public Account[] getAccounts(String type) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "getAccounts: accountType " + type
@@ -1353,10 +1465,11 @@
+ ", pid " + Binder.getCallingPid());
}
checkReadAccountsPermission();
+ UserAccounts accounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
- synchronized (mCacheLock) {
- return getAccountsFromCacheLocked(type);
+ synchronized (accounts.cacheLock) {
+ return getAccountsFromCacheLocked(accounts, type);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -1375,19 +1488,20 @@
if (response == null) throw new IllegalArgumentException("response is null");
if (type == null) throw new IllegalArgumentException("accountType is null");
checkReadAccountsPermission();
+ UserAccounts userAccounts = getUserAccountsForCaller();
long identityToken = clearCallingIdentity();
try {
if (features == null || features.length == 0) {
Account[] accounts;
- synchronized (mCacheLock) {
- accounts = getAccountsFromCacheLocked(type);
+ synchronized (userAccounts.cacheLock) {
+ accounts = getAccountsFromCacheLocked(userAccounts, type);
}
Bundle result = new Bundle();
result.putParcelableArray(AccountManager.KEY_ACCOUNTS, accounts);
onResult(response, result);
return;
}
- new GetAccountsByTypeAndFeatureSession(response, type, features).bind();
+ new GetAccountsByTypeAndFeatureSession(userAccounts, response, type, features).bind();
} finally {
restoreCallingIdentity(identityToken);
}
@@ -1435,12 +1549,14 @@
IAccountAuthenticator mAuthenticator = null;
private final boolean mStripAuthTokenFromResult;
+ protected final UserAccounts mAccounts;
- public Session(IAccountManagerResponse response, String accountType,
+ public Session(UserAccounts accounts, IAccountManagerResponse response, String accountType,
boolean expectActivityLaunch, boolean stripAuthTokenFromResult) {
super();
if (response == null) throw new IllegalArgumentException("response is null");
if (accountType == null) throw new IllegalArgumentException("accountType is null");
+ mAccounts = accounts;
mStripAuthTokenFromResult = stripAuthTokenFromResult;
mResponse = response;
mAccountType = accountType;
@@ -1578,7 +1694,7 @@
String accountType = result.getString(AccountManager.KEY_ACCOUNT_TYPE);
if (!TextUtils.isEmpty(accountName) && !TextUtils.isEmpty(accountType)) {
Account account = new Account(accountName, accountType);
- cancelNotification(getSigninRequiredNotificationId(account));
+ cancelNotification(getSigninRequiredNotificationId(mAccounts, account));
}
}
IAccountManagerResponse response;
@@ -1694,20 +1810,23 @@
}
}
- private static String getDatabaseName() {
- if(Environment.isEncryptedFilesystemEnabled()) {
- // Hard-coded path in case of encrypted file system
- return Environment.getSystemSecureDirectory().getPath() + File.separator + DATABASE_NAME;
- } else {
- // Regular path in case of non-encrypted file system
- return DATABASE_NAME;
+ private static String getDatabaseName(int userId) {
+ File systemDir = Environment.getSystemSecureDirectory();
+ File databaseFile = new File(systemDir, "users/" + userId + "/" + DATABASE_NAME);
+ if (userId == 0) {
+ // Migrate old file, if it exists, to the new location
+ File oldFile = new File(systemDir, DATABASE_NAME);
+ if (oldFile.exists()) {
+ oldFile.renameTo(databaseFile);
+ }
}
+ return databaseFile.getPath();
}
- private class DatabaseHelper extends SQLiteOpenHelper {
+ static class DatabaseHelper extends SQLiteOpenHelper {
- public DatabaseHelper(Context context) {
- super(context, AccountManagerService.getDatabaseName(), null, DATABASE_VERSION);
+ public DatabaseHelper(Context context, int userId) {
+ super(context, AccountManagerService.getDatabaseName(userId), null, DATABASE_VERSION);
}
/**
@@ -1799,15 +1918,6 @@
}
}
- private void setMetaValue(String key, String value) {
- ContentValues values = new ContentValues();
- values.put(META_KEY, key);
- values.put(META_VALUE, value);
- synchronized (mCacheLock) {
- mOpenHelper.getWritableDatabase().replace(TABLE_META, META_KEY, values);
- }
- }
-
public IBinder onBind(Intent intent) {
return asBinder();
}
@@ -1837,11 +1947,25 @@
+ " without permission " + android.Manifest.permission.DUMP);
return;
}
+ final boolean isCheckinRequest = scanArgs(args, "--checkin") || scanArgs(args, "-c");
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getReadableDatabase();
+ fout = new IndentingPrintWriter(fout, " ");
+ int size = mUsers.size();
+ for (int i = 0; i < size; i++) {
+ fout.println("User " + mUsers.keyAt(i) + ":");
+ ((IndentingPrintWriter) fout).increaseIndent();
+ dumpUser(mUsers.valueAt(i), fd, fout, args, isCheckinRequest);
+ ((IndentingPrintWriter) fout).decreaseIndent();
+ if (i < size - 1) {
+ fout.println();
+ }
+ }
+ }
- final boolean isCheckinRequest = scanArgs(args, "--checkin") || scanArgs(args, "-c");
+ private void dumpUser(UserAccounts userAccounts, FileDescriptor fd, PrintWriter fout,
+ String[] args, boolean isCheckinRequest) {
+ synchronized (userAccounts.cacheLock) {
+ final SQLiteDatabase db = userAccounts.openHelper.getReadableDatabase();
if (isCheckinRequest) {
// This is a checkin request. *Only* upload the account types and the count of each.
@@ -1858,7 +1982,7 @@
}
}
} else {
- Account[] accounts = getAccountsFromCacheLocked(null /* type */);
+ Account[] accounts = getAccountsFromCacheLocked(userAccounts, null /* type */);
fout.println("Accounts: " + accounts.length);
for (Account account : accounts) {
fout.println(" " + account);
@@ -1879,7 +2003,8 @@
}
}
- private void doNotification(Account account, CharSequence message, Intent intent) {
+ private void doNotification(UserAccounts accounts, Account account, CharSequence message,
+ Intent intent) {
long identityToken = clearCallingIdentity();
try {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
@@ -1891,7 +2016,7 @@
intent.getComponent().getClassName())) {
createNoCredentialsPermissionNotification(account, intent);
} else {
- final Integer notificationId = getSigninRequiredNotificationId(account);
+ final Integer notificationId = getSigninRequiredNotificationId(accounts, account);
intent.addCategory(String.valueOf(notificationId));
Notification n = new Notification(android.R.drawable.stat_sys_warning, null,
0 /* when */);
@@ -1962,7 +2087,7 @@
final boolean fromAuthenticator = account != null
&& hasAuthenticatorUid(account.type, callerUid);
final boolean hasExplicitGrants = account != null
- && hasExplicitlyGrantedPermission(account, authTokenType);
+ && hasExplicitlyGrantedPermission(account, authTokenType, callerUid);
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "checkGrantsOrCallingUidAgainstAuthenticator: caller uid "
+ callerUid + ", " + account
@@ -1984,13 +2109,15 @@
return false;
}
- private boolean hasExplicitlyGrantedPermission(Account account, String authTokenType) {
- if (Binder.getCallingUid() == android.os.Process.SYSTEM_UID) {
+ private boolean hasExplicitlyGrantedPermission(Account account, String authTokenType,
+ int callerUid) {
+ if (callerUid == android.os.Process.SYSTEM_UID) {
return true;
}
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getReadableDatabase();
- String[] args = {String.valueOf(Binder.getCallingUid()), authTokenType,
+ UserAccounts accounts = getUserAccountsForCaller();
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getReadableDatabase();
+ String[] args = { String.valueOf(callerUid), authTokenType,
account.name, account.type};
final boolean permissionGranted =
DatabaseUtils.longForQuery(db, COUNT_OF_MATCHING_GRANTS, args) != 0;
@@ -1998,7 +2125,7 @@
// TODO: Skip this check when running automated tests. Replace this
// with a more general solution.
Log.d(TAG, "no credentials permission for usage of " + account + ", "
- + authTokenType + " by uid " + Binder.getCallingUid()
+ + authTokenType + " by uid " + callerUid
+ " but ignoring since device is in test harness.");
return true;
}
@@ -2048,8 +2175,9 @@
Log.e(TAG, "grantAppPermission: called with invalid arguments", new Exception());
return;
}
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ UserAccounts accounts = getUserAccounts(UserId.getUserId(uid));
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
db.beginTransaction();
try {
long accountId = getAccountIdLocked(db, account);
@@ -2081,8 +2209,9 @@
Log.e(TAG, "revokeAppPermission: called with invalid arguments", new Exception());
return;
}
- synchronized (mCacheLock) {
- final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ UserAccounts accounts = getUserAccounts(UserId.getUserId(uid));
+ synchronized (accounts.cacheLock) {
+ final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
db.beginTransaction();
try {
long accountId = getAccountIdLocked(db, account);
@@ -2105,8 +2234,8 @@
return value != null ? ("[" + TextUtils.join(",", value) + "]") : null;
}
- private void removeAccountFromCacheLocked(Account account) {
- final Account[] oldAccountsForType = mAccountCache.get(account.type);
+ private void removeAccountFromCacheLocked(UserAccounts accounts, Account account) {
+ final Account[] oldAccountsForType = accounts.accountCache.get(account.type);
if (oldAccountsForType != null) {
ArrayList<Account> newAccountsList = new ArrayList<Account>();
for (Account curAccount : oldAccountsForType) {
@@ -2115,34 +2244,34 @@
}
}
if (newAccountsList.isEmpty()) {
- mAccountCache.remove(account.type);
+ accounts.accountCache.remove(account.type);
} else {
Account[] newAccountsForType = new Account[newAccountsList.size()];
newAccountsForType = newAccountsList.toArray(newAccountsForType);
- mAccountCache.put(account.type, newAccountsForType);
+ accounts.accountCache.put(account.type, newAccountsForType);
}
}
- mUserDataCache.remove(account);
- mAuthTokenCache.remove(account);
+ accounts.userDataCache.remove(account);
+ accounts.authTokenCache.remove(account);
}
/**
* This assumes that the caller has already checked that the account is not already present.
*/
- private void insertAccountIntoCacheLocked(Account account) {
- Account[] accountsForType = mAccountCache.get(account.type);
+ private void insertAccountIntoCacheLocked(UserAccounts accounts, Account account) {
+ Account[] accountsForType = accounts.accountCache.get(account.type);
int oldLength = (accountsForType != null) ? accountsForType.length : 0;
Account[] newAccountsForType = new Account[oldLength + 1];
if (accountsForType != null) {
System.arraycopy(accountsForType, 0, newAccountsForType, 0, oldLength);
}
newAccountsForType[oldLength] = account;
- mAccountCache.put(account.type, newAccountsForType);
+ accounts.accountCache.put(account.type, newAccountsForType);
}
- protected Account[] getAccountsFromCacheLocked(String accountType) {
+ protected Account[] getAccountsFromCacheLocked(UserAccounts userAccounts, String accountType) {
if (accountType != null) {
- final Account[] accounts = mAccountCache.get(accountType);
+ final Account[] accounts = userAccounts.accountCache.get(accountType);
if (accounts == null) {
return EMPTY_ACCOUNT_ARRAY;
} else {
@@ -2150,7 +2279,7 @@
}
} else {
int totalLength = 0;
- for (Account[] accounts : mAccountCache.values()) {
+ for (Account[] accounts : userAccounts.accountCache.values()) {
totalLength += accounts.length;
}
if (totalLength == 0) {
@@ -2158,7 +2287,7 @@
}
Account[] accounts = new Account[totalLength];
totalLength = 0;
- for (Account[] accountsOfType : mAccountCache.values()) {
+ for (Account[] accountsOfType : userAccounts.accountCache.values()) {
System.arraycopy(accountsOfType, 0, accounts, totalLength,
accountsOfType.length);
totalLength += accountsOfType.length;
@@ -2167,12 +2296,12 @@
}
}
- protected void writeUserDataIntoCacheLocked(final SQLiteDatabase db, Account account,
- String key, String value) {
- HashMap<String, String> userDataForAccount = mUserDataCache.get(account);
+ protected void writeUserDataIntoCacheLocked(UserAccounts accounts, final SQLiteDatabase db,
+ Account account, String key, String value) {
+ HashMap<String, String> userDataForAccount = accounts.userDataCache.get(account);
if (userDataForAccount == null) {
userDataForAccount = readUserDataForAccountFromDatabaseLocked(db, account);
- mUserDataCache.put(account, userDataForAccount);
+ accounts.userDataCache.put(account, userDataForAccount);
}
if (value == null) {
userDataForAccount.remove(key);
@@ -2181,12 +2310,12 @@
}
}
- protected void writeAuthTokenIntoCacheLocked(final SQLiteDatabase db, Account account,
- String key, String value) {
- HashMap<String, String> authTokensForAccount = mAuthTokenCache.get(account);
+ protected void writeAuthTokenIntoCacheLocked(UserAccounts accounts, final SQLiteDatabase db,
+ Account account, String key, String value) {
+ HashMap<String, String> authTokensForAccount = accounts.authTokenCache.get(account);
if (authTokensForAccount == null) {
authTokensForAccount = readAuthTokensForAccountFromDatabaseLocked(db, account);
- mAuthTokenCache.put(account, authTokensForAccount);
+ accounts.authTokenCache.put(account, authTokensForAccount);
}
if (value == null) {
authTokensForAccount.remove(key);
@@ -2195,27 +2324,28 @@
}
}
- protected String readAuthTokenInternal(Account account, String authTokenType) {
- synchronized (mCacheLock) {
- HashMap<String, String> authTokensForAccount = mAuthTokenCache.get(account);
+ protected String readAuthTokenInternal(UserAccounts accounts, Account account,
+ String authTokenType) {
+ synchronized (accounts.cacheLock) {
+ HashMap<String, String> authTokensForAccount = accounts.authTokenCache.get(account);
if (authTokensForAccount == null) {
// need to populate the cache for this account
- final SQLiteDatabase db = mOpenHelper.getReadableDatabase();
+ final SQLiteDatabase db = accounts.openHelper.getReadableDatabase();
authTokensForAccount = readAuthTokensForAccountFromDatabaseLocked(db, account);
- mAuthTokenCache.put(account, authTokensForAccount);
+ accounts.authTokenCache.put(account, authTokensForAccount);
}
return authTokensForAccount.get(authTokenType);
}
}
- protected String readUserDataInternal(Account account, String key) {
- synchronized (mCacheLock) {
- HashMap<String, String> userDataForAccount = mUserDataCache.get(account);
+ protected String readUserDataInternal(UserAccounts accounts, Account account, String key) {
+ synchronized (accounts.cacheLock) {
+ HashMap<String, String> userDataForAccount = accounts.userDataCache.get(account);
if (userDataForAccount == null) {
// need to populate the cache for this account
- final SQLiteDatabase db = mOpenHelper.getReadableDatabase();
+ final SQLiteDatabase db = accounts.openHelper.getReadableDatabase();
userDataForAccount = readUserDataForAccountFromDatabaseLocked(db, account);
- mUserDataCache.put(account, userDataForAccount);
+ accounts.userDataCache.put(account, userDataForAccount);
}
return userDataForAccount.get(key);
}
diff --git a/core/java/android/accounts/GrantCredentialsPermissionActivity.java b/core/java/android/accounts/GrantCredentialsPermissionActivity.java
index 0ee683c..4419c8c 100644
--- a/core/java/android/accounts/GrantCredentialsPermissionActivity.java
+++ b/core/java/android/accounts/GrantCredentialsPermissionActivity.java
@@ -113,8 +113,7 @@
}
};
- accountManagerService.getAuthTokenLabel(
- response, mAccount, mAuthTokenType);
+ accountManagerService.getAuthTokenLabel(response, mAccount, mAuthTokenType, mUid);
findViewById(R.id.allow_button).setOnClickListener(this);
findViewById(R.id.deny_button).setOnClickListener(this);
diff --git a/core/java/android/accounts/OnAccountsUpdateListener.java b/core/java/android/accounts/OnAccountsUpdateListener.java
index 38b371d..2b4ee50 100644
--- a/core/java/android/accounts/OnAccountsUpdateListener.java
+++ b/core/java/android/accounts/OnAccountsUpdateListener.java
@@ -17,11 +17,11 @@
package android.accounts;
/**
- * An interface that contains the callback used by the AccountMonitor
+ * An interface that contains the callback used by the AccountManager
*/
public interface OnAccountsUpdateListener {
/**
- * This invoked when the AccountMonitor starts up and whenever the account
+ * This invoked when the AccountManager starts up and whenever the account
* set changes.
* @param accounts the current accounts
*/
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index 6fbeee3..954ae66 100755
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -645,7 +645,7 @@
// onAnimate to process the next frame of the animations.
if (!mAnimationScheduled
&& (!mAnimations.isEmpty() || !mDelayedAnims.isEmpty())) {
- mChoreographer.postAnimationCallback(this);
+ mChoreographer.postAnimationCallback(this, null);
mAnimationScheduled = true;
}
}
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 8e8d37d..f895431 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -570,7 +570,18 @@
* tag. By doing so, other applications will need to declare a corresponding
* {@link android.R.styleable#AndroidManifestUsesPermission <uses-permission>}
* element in their own manifest to be able to start that activity.
- *
+ *
+ * <p>When starting an Activity you can set {@link Intent#FLAG_GRANT_READ_URI_PERMISSION
+ * Intent.FLAG_GRANT_READ_URI_PERMISSION} and/or {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION
+ * Intent.FLAG_GRANT_WRITE_URI_PERMISSION} on the Intent. This will grant the
+ * Activity access to the specific URIs in the Intent. Access will remain
+ * until the Activity has finished (it will remain across the hosting
+ * process being killed and other temporary destruction). As of
+ * {@link android.os.Build.VERSION_CODES#GINGERBREAD}, if the Activity
+ * was already created and a new Intent is being delivered to
+ * {@link #onNewIntent(Intent)}, any newly granted URI permissions will be added
+ * to the existing ones it holds.
+ *
* <p>See the <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a>
* document for more information on permissions and security in general.
*
@@ -3549,7 +3560,16 @@
/**
* Call this to set the result that your activity will return to its
* caller.
- *
+ *
+ * <p>As of {@link android.os.Build.VERSION_CODES#GINGERBREAD}, the Intent
+ * you supply here can have {@link Intent#FLAG_GRANT_READ_URI_PERMISSION
+ * Intent.FLAG_GRANT_READ_URI_PERMISSION} and/or {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION
+ * Intent.FLAG_GRANT_WRITE_URI_PERMISSION} set. This will grant the
+ * Activity receiving the result access to the specific URIs in the Intent.
+ * Access will remain until the Activity has finished (it will remain across the hosting
+ * process being killed and other temporary destruction) and will be added
+ * to any existing set of URI permissions it already holds.
+ *
* @param resultCode The result code to propagate back to the originating
* activity, often RESULT_CANCELED or RESULT_OK
* @param data The data to propagate back to the originating activity.
diff --git a/core/java/android/app/ApplicationErrorReport.java b/core/java/android/app/ApplicationErrorReport.java
index 588125d..ebf42619 100644
--- a/core/java/android/app/ApplicationErrorReport.java
+++ b/core/java/android/app/ApplicationErrorReport.java
@@ -98,7 +98,7 @@
/**
* Package name of the application which installed the application this
* report pertains to.
- * This identifies which Market the application came from.
+ * This identifies which market the application came from.
*/
public String installerPackageName;
diff --git a/core/java/android/app/Service.java b/core/java/android/app/Service.java
index 35bd8c0..be4b8af 100644
--- a/core/java/android/app/Service.java
+++ b/core/java/android/app/Service.java
@@ -163,7 +163,19 @@
* {@link android.R.styleable#AndroidManifestUsesPermission <uses-permission>}
* element in their own manifest to be able to start, stop, or bind to
* the service.
- *
+ *
+ * <p>As of {@link android.os.Build.VERSION_CODES#GINGERBREAD}, when using
+ * {@link Context#startService(Intent) Context.startService(Intent)}, you can
+ * also set {@link Intent#FLAG_GRANT_READ_URI_PERMISSION
+ * Intent.FLAG_GRANT_READ_URI_PERMISSION} and/or {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION
+ * Intent.FLAG_GRANT_WRITE_URI_PERMISSION} on the Intent. This will grant the
+ * Service temporary access to the specific URIs in the Intent. Access will
+ * remain until the Service has called {@link #stopSelf(int)} for that start
+ * command or a later one, or until the Service has been completely stopped.
+ * This works for granting access to the other apps that have not requested
+ * the permission protecting the Service, or even when the Service is not
+ * exported at all.
+ *
* <p>In addition, a service can protect individual IPC calls into it with
* permissions, by calling the
* {@link #checkCallingPermission}
diff --git a/core/java/android/content/ClipData.java b/core/java/android/content/ClipData.java
index a8b1bf4..a655dd4 100644
--- a/core/java/android/content/ClipData.java
+++ b/core/java/android/content/ClipData.java
@@ -153,7 +153,7 @@
final Bitmap mIcon;
- final ArrayList<Item> mItems = new ArrayList<Item>();
+ final ArrayList<Item> mItems;
/**
* Description of a single item in a ClippedData.
@@ -321,6 +321,33 @@
return "";
}
//END_INCLUDE(coerceToText)
+
+ @Override
+ public String toString() {
+ StringBuilder b = new StringBuilder(128);
+
+ b.append("ClipData.Item { ");
+ toShortString(b);
+ b.append(" }");
+
+ return b.toString();
+ }
+
+ /** @hide */
+ public void toShortString(StringBuilder b) {
+ if (mText != null) {
+ b.append("T:");
+ b.append(mText);
+ } else if (mUri != null) {
+ b.append("U:");
+ b.append(mUri);
+ } else if (mIntent != null) {
+ b.append("I:");
+ mIntent.toShortString(b, true, true, true, true);
+ } else {
+ b.append("NULL");
+ }
+ }
}
/**
@@ -336,6 +363,7 @@
throw new NullPointerException("item is null");
}
mIcon = null;
+ mItems = new ArrayList<Item>();
mItems.add(item);
}
@@ -351,10 +379,23 @@
throw new NullPointerException("item is null");
}
mIcon = null;
+ mItems = new ArrayList<Item>();
mItems.add(item);
}
/**
+ * Create a new clip that is a copy of another clip. This does a deep-copy
+ * of all items in the clip.
+ *
+ * @param other The existing ClipData that is to be copied.
+ */
+ public ClipData(ClipData other) {
+ mClipDescription = other.mClipDescription;
+ mIcon = other.mIcon;
+ mItems = new ArrayList<Item>(other.mItems);
+ }
+
+ /**
* Create a new ClipData holding data of the type
* {@link ClipDescription#MIMETYPE_TEXT_PLAIN}.
*
@@ -475,6 +516,46 @@
}
@Override
+ public String toString() {
+ StringBuilder b = new StringBuilder(128);
+
+ b.append("ClipData { ");
+ toShortString(b);
+ b.append(" }");
+
+ return b.toString();
+ }
+
+ /** @hide */
+ public void toShortString(StringBuilder b) {
+ boolean first;
+ if (mClipDescription != null) {
+ first = !mClipDescription.toShortString(b);
+ } else {
+ first = true;
+ }
+ if (mIcon != null) {
+ if (!first) {
+ b.append(' ');
+ }
+ first = false;
+ b.append("I:");
+ b.append(mIcon.getWidth());
+ b.append('x');
+ b.append(mIcon.getHeight());
+ }
+ for (int i=0; i<mItems.size(); i++) {
+ if (!first) {
+ b.append(' ');
+ }
+ first = false;
+ b.append('{');
+ mItems.get(i).toShortString(b);
+ b.append('}');
+ }
+ }
+
+ @Override
public int describeContents() {
return 0;
}
@@ -515,6 +596,7 @@
} else {
mIcon = null;
}
+ mItems = new ArrayList<Item>();
final int N = in.readInt();
for (int i=0; i<N; i++) {
CharSequence text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
diff --git a/core/java/android/content/ClipDescription.java b/core/java/android/content/ClipDescription.java
index b5fa20c..c6b51ef 100644
--- a/core/java/android/content/ClipDescription.java
+++ b/core/java/android/content/ClipDescription.java
@@ -184,6 +184,39 @@
}
@Override
+ public String toString() {
+ StringBuilder b = new StringBuilder(128);
+
+ b.append("ClipDescription { ");
+ toShortString(b);
+ b.append(" }");
+
+ return b.toString();
+ }
+
+ /** @hide */
+ public boolean toShortString(StringBuilder b) {
+ boolean first = true;
+ for (int i=0; i<mMimeTypes.length; i++) {
+ if (!first) {
+ b.append(' ');
+ }
+ first = false;
+ b.append(mMimeTypes[i]);
+ }
+ if (mLabel != null) {
+ if (!first) {
+ b.append(' ');
+ }
+ first = false;
+ b.append('"');
+ b.append(mLabel);
+ b.append('"');
+ }
+ return !first;
+ }
+
+ @Override
public int describeContents() {
return 0;
}
diff --git a/core/java/android/content/ContentService.java b/core/java/android/content/ContentService.java
index fc4c262..f827c3d 100644
--- a/core/java/android/content/ContentService.java
+++ b/core/java/android/content/ContentService.java
@@ -26,6 +26,7 @@
import android.os.Parcel;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.UserId;
import android.util.Log;
import android.util.SparseIntArray;
import android.Manifest;
@@ -163,6 +164,8 @@
Log.v(TAG, "Notifying update of " + uri + " from observer " + observer
+ ", syncToNetwork " + syncToNetwork);
}
+
+ int userId = UserId.getCallingUserId();
// This makes it so that future permission checks will be in the context of this
// process rather than the caller's process. We will restore this before returning.
long identityToken = clearCallingIdentity();
@@ -201,7 +204,8 @@
if (syncToNetwork) {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
- syncManager.scheduleLocalSync(null /* all accounts */, uri.getAuthority());
+ syncManager.scheduleLocalSync(null /* all accounts */, userId,
+ uri.getAuthority());
}
}
} finally {
@@ -229,13 +233,15 @@
public void requestSync(Account account, String authority, Bundle extras) {
ContentResolver.validateSyncExtrasBundle(extras);
+ int userId = UserId.getCallingUserId();
+
// This makes it so that future permission checks will be in the context of this
// process rather than the caller's process. We will restore this before returning.
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
- syncManager.scheduleSync(account, authority, extras, 0 /* no delay */,
+ syncManager.scheduleSync(account, userId, authority, extras, 0 /* no delay */,
false /* onlyThoseWithUnkownSyncableState */);
}
} finally {
@@ -250,14 +256,16 @@
* @param authority filter the pending and active syncs to cancel using this authority
*/
public void cancelSync(Account account, String authority) {
+ int userId = UserId.getCallingUserId();
+
// This makes it so that future permission checks will be in the context of this
// process rather than the caller's process. We will restore this before returning.
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
- syncManager.clearScheduledSyncOperations(account, authority);
- syncManager.cancelActiveSync(account, authority);
+ syncManager.clearScheduledSyncOperations(account, userId, authority);
+ syncManager.cancelActiveSync(account, userId, authority);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -283,12 +291,14 @@
public boolean getSyncAutomatically(Account account, String providerName) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_SETTINGS,
"no permission to read the sync settings");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
return syncManager.getSyncStorageEngine().getSyncAutomatically(
- account, providerName);
+ account, userId, providerName);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -299,12 +309,14 @@
public void setSyncAutomatically(Account account, String providerName, boolean sync) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,
"no permission to write the sync settings");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
syncManager.getSyncStorageEngine().setSyncAutomatically(
- account, providerName, sync);
+ account, userId, providerName, sync);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -315,10 +327,12 @@
long pollFrequency) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,
"no permission to write the sync settings");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
getSyncManager().getSyncStorageEngine().addPeriodicSync(
- account, authority, extras, pollFrequency);
+ account, userId, authority, extras, pollFrequency);
} finally {
restoreCallingIdentity(identityToken);
}
@@ -327,9 +341,12 @@
public void removePeriodicSync(Account account, String authority, Bundle extras) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,
"no permission to write the sync settings");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
- getSyncManager().getSyncStorageEngine().removePeriodicSync(account, authority, extras);
+ getSyncManager().getSyncStorageEngine().removePeriodicSync(account, userId, authority,
+ extras);
} finally {
restoreCallingIdentity(identityToken);
}
@@ -338,10 +355,12 @@
public List<PeriodicSync> getPeriodicSyncs(Account account, String providerName) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_SETTINGS,
"no permission to read the sync settings");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
return getSyncManager().getSyncStorageEngine().getPeriodicSyncs(
- account, providerName);
+ account, userId, providerName);
} finally {
restoreCallingIdentity(identityToken);
}
@@ -350,12 +369,14 @@
public int getIsSyncable(Account account, String providerName) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_SETTINGS,
"no permission to read the sync settings");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
return syncManager.getSyncStorageEngine().getIsSyncable(
- account, providerName);
+ account, userId, providerName);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -366,12 +387,14 @@
public void setIsSyncable(Account account, String providerName, int syncable) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,
"no permission to write the sync settings");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
syncManager.getSyncStorageEngine().setIsSyncable(
- account, providerName, syncable);
+ account, userId, providerName, syncable);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -381,11 +404,13 @@
public boolean getMasterSyncAutomatically() {
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_SETTINGS,
"no permission to read the sync settings");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
- return syncManager.getSyncStorageEngine().getMasterSyncAutomatically();
+ return syncManager.getSyncStorageEngine().getMasterSyncAutomatically(userId);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -396,11 +421,13 @@
public void setMasterSyncAutomatically(boolean flag) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,
"no permission to write the sync settings");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
- syncManager.getSyncStorageEngine().setMasterSyncAutomatically(flag);
+ syncManager.getSyncStorageEngine().setMasterSyncAutomatically(flag, userId);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -410,12 +437,14 @@
public boolean isSyncActive(Account account, String authority) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS,
"no permission to read the sync stats");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
return syncManager.getSyncStorageEngine().isSyncActive(
- account, authority);
+ account, userId, authority);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -426,9 +455,11 @@
public List<SyncInfo> getCurrentSyncs() {
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS,
"no permission to read the sync stats");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
- return getSyncManager().getSyncStorageEngine().getCurrentSyncs();
+ return getSyncManager().getSyncStorageEngine().getCurrentSyncs(userId);
} finally {
restoreCallingIdentity(identityToken);
}
@@ -437,12 +468,14 @@
public SyncStatusInfo getSyncStatus(Account account, String authority) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS,
"no permission to read the sync stats");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
return syncManager.getSyncStorageEngine().getStatusByAccountAndAuthority(
- account, authority);
+ account, userId, authority);
}
} finally {
restoreCallingIdentity(identityToken);
@@ -453,11 +486,13 @@
public boolean isSyncPending(Account account, String authority) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS,
"no permission to read the sync stats");
+ int userId = UserId.getCallingUserId();
+
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
- return syncManager.getSyncStorageEngine().isSyncPending(account, authority);
+ return syncManager.getSyncStorageEngine().isSyncPending(account, userId, authority);
}
} finally {
restoreCallingIdentity(identityToken);
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index ab62c44..5739119 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1137,7 +1137,7 @@
/**
* Activity Action: The user pressed the "Report" button in the crash/ANR dialog.
* This intent is delivered to the package which installed the application, usually
- * the Market.
+ * Google Play.
* <p>Input: No data is specified. The bug report is passed in using
* an {@link #EXTRA_BUG_REPORT} field.
* <p>Output: Nothing.
@@ -2688,12 +2688,20 @@
/**
* If set, the recipient of this Intent will be granted permission to
- * perform read operations on the Uri in the Intent's data.
+ * perform read operations on the Uri in the Intent's data and any URIs
+ * specified in its ClipData. When applying to an Intent's ClipData,
+ * all URIs as well as recursive traversals through data or other ClipData
+ * in Intent items will be granted; only the grant flags of the top-level
+ * Intent are used.
*/
public static final int FLAG_GRANT_READ_URI_PERMISSION = 0x00000001;
/**
* If set, the recipient of this Intent will be granted permission to
- * perform write operations on the Uri in the Intent's data.
+ * perform write operations on the Uri in the Intent's data and any URIs
+ * specified in its ClipData. When applying to an Intent's ClipData,
+ * all URIs as well as recursive traversals through data or other ClipData
+ * in Intent items will be granted; only the grant flags of the top-level
+ * Intent are used.
*/
public static final int FLAG_GRANT_WRITE_URI_PERMISSION = 0x00000002;
/**
@@ -3018,6 +3026,7 @@
private Bundle mExtras;
private Rect mSourceBounds;
private Intent mSelector;
+ private ClipData mClipData;
// ---------------------------------------------------------------------
@@ -3049,6 +3058,9 @@
if (o.mSelector != null) {
this.mSelector = new Intent(o.mSelector);
}
+ if (o.mClipData != null) {
+ this.mClipData = new ClipData(o.mClipData);
+ }
}
@Override
@@ -3729,6 +3741,16 @@
}
/**
+ * Return the {@link ClipData} associated with this Intent. If there is
+ * none, returns null. See {@link #setClipData} for more information.
+ *
+ * @see #setClipData;
+ */
+ public ClipData getClipData() {
+ return mClipData;
+ }
+
+ /**
* Sets the ClassLoader that will be used when unmarshalling
* any Parcelable values from the extras of this Intent.
*
@@ -4683,6 +4705,37 @@
}
/**
+ * Set a {@link ClipData} associated with this Intent. This replaces any
+ * previously set ClipData.
+ *
+ * <p>The ClipData in an intent is not used for Intent matching or other
+ * such operations. Semantically it is like extras, used to transmit
+ * additional data with the Intent. The main feature of using this over
+ * the extras for data is that {@link #FLAG_GRANT_READ_URI_PERMISSION}
+ * and {@link #FLAG_GRANT_WRITE_URI_PERMISSION} will operate on any URI
+ * items included in the clip data. This is useful, in particular, if
+ * you want to transmit an Intent containing multiple <code>content:</code>
+ * URIs for which the recipient may not have global permission to access the
+ * content provider.
+ *
+ * <p>If the ClipData contains items that are themselves Intents, any
+ * grant flags in those Intents will be ignored. Only the top-level flags
+ * of the main Intent are respected, and will be applied to all Uri or
+ * Intent items in the clip (or sub-items of the clip).
+ *
+ * <p>The MIME type, label, and icon in the ClipData object are not
+ * directly used by Intent. Applications should generally rely on the
+ * MIME type of the Intent itself, not what it may find in the ClipData.
+ * A common practice is to construct a ClipData for use with an Intent
+ * with a MIME type of "*\/*".
+ *
+ * @param clip The new clip to set. May be null to clear the current clip.
+ */
+ public void setClipData(ClipData clip) {
+ mClipData = clip;
+ }
+
+ /**
* Add extended data to the intent. The name must include a package
* prefix, for example the app com.android.contacts would use names
* like "com.android.contacts.ShowAll".
@@ -5660,6 +5713,12 @@
public static final int FILL_IN_SELECTOR = 1<<6;
/**
+ * Use with {@link #fillIn} to allow the current ClipData to be
+ * overwritten, even if it is already set.
+ */
+ public static final int FILL_IN_CLIP_DATA = 1<<7;
+
+ /**
* Copy the contents of <var>other</var> in to this object, but only
* where fields are not defined by this object. For purposes of a field
* being defined, the following pieces of data in the Intent are
@@ -5673,19 +5732,22 @@
* <li> package, as set by {@link #setPackage}.
* <li> component, as set by {@link #setComponent(ComponentName)} or
* related methods.
- * <li> source bounds, as set by {@link #setSourceBounds}
+ * <li> source bounds, as set by {@link #setSourceBounds}.
+ * <li> selector, as set by {@link #setSelector(Intent)}.
+ * <li> clip data, as set by {@link #setClipData(ClipData)}.
* <li> each top-level name in the associated extras.
* </ul>
*
* <p>In addition, you can use the {@link #FILL_IN_ACTION},
* {@link #FILL_IN_DATA}, {@link #FILL_IN_CATEGORIES}, {@link #FILL_IN_PACKAGE},
- * {@link #FILL_IN_COMPONENT}, {@link #FILL_IN_SOURCE_BOUNDS}, and
- * {@link #FILL_IN_SELECTOR} to override the restriction where the
- * corresponding field will not be replaced if it is already set.
+ * {@link #FILL_IN_COMPONENT}, {@link #FILL_IN_SOURCE_BOUNDS},
+ * {@link #FILL_IN_SELECTOR}, and {@link #FILL_IN_CLIP_DATA} to override
+ * the restriction where the corresponding field will not be replaced if
+ * it is already set.
*
- * <p>Note: The component field will only be copied if {@link #FILL_IN_COMPONENT} is explicitly
- * specified. The selector will only be copied if {@link #FILL_IN_SELECTOR} is
- * explicitly specified.
+ * <p>Note: The component field will only be copied if {@link #FILL_IN_COMPONENT}
+ * is explicitly specified. The selector will only be copied if
+ * {@link #FILL_IN_SELECTOR} is explicitly specified.
*
* <p>For example, consider Intent A with {data="foo", categories="bar"}
* and Intent B with {action="gotit", data-type="some/thing",
@@ -5742,6 +5804,11 @@
changes |= FILL_IN_SELECTOR;
}
}
+ if (other.mClipData != null
+ && (mClipData == null || (flags&FILL_IN_CLIP_DATA) != 0)) {
+ mClipData = other.mClipData;
+ changes |= FILL_IN_CLIP_DATA;
+ }
// Component is special: it can -only- be set if explicitly allowed,
// since otherwise the sender could force the intent somewhere the
// originator didn't intend.
@@ -5938,7 +6005,7 @@
StringBuilder b = new StringBuilder(128);
b.append("Intent { ");
- toShortString(b, true, true, true);
+ toShortString(b, true, true, true, false);
b.append(" }");
return b.toString();
@@ -5949,21 +6016,33 @@
StringBuilder b = new StringBuilder(128);
b.append("Intent { ");
- toShortString(b, false, true, true);
+ toShortString(b, false, true, true, false);
b.append(" }");
return b.toString();
}
/** @hide */
- public String toShortString(boolean secure, boolean comp, boolean extras) {
+ public String toInsecureStringWithClip() {
StringBuilder b = new StringBuilder(128);
- toShortString(b, secure, comp, extras);
+
+ b.append("Intent { ");
+ toShortString(b, false, true, true, true);
+ b.append(" }");
+
return b.toString();
}
/** @hide */
- public void toShortString(StringBuilder b, boolean secure, boolean comp, boolean extras) {
+ public String toShortString(boolean secure, boolean comp, boolean extras, boolean clip) {
+ StringBuilder b = new StringBuilder(128);
+ toShortString(b, secure, comp, extras, clip);
+ return b.toString();
+ }
+
+ /** @hide */
+ public void toShortString(StringBuilder b, boolean secure, boolean comp, boolean extras,
+ boolean clip) {
boolean first = true;
if (mAction != null) {
b.append("act=").append(mAction);
@@ -6031,6 +6110,19 @@
first = false;
b.append("bnds=").append(mSourceBounds.toShortString());
}
+ if (mClipData != null) {
+ if (!first) {
+ b.append(' ');
+ }
+ first = false;
+ if (clip) {
+ b.append("clip={");
+ mClipData.toShortString(b);
+ b.append('}');
+ } else {
+ b.append("(has clip)");
+ }
+ }
if (extras && mExtras != null) {
if (!first) {
b.append(' ');
@@ -6040,7 +6132,7 @@
}
if (mSelector != null) {
b.append(" sel={");
- mSelector.toShortString(b, secure, comp, extras);
+ mSelector.toShortString(b, secure, comp, extras, clip);
b.append("}");
}
}
@@ -6209,6 +6301,13 @@
out.writeInt(0);
}
+ if (mClipData != null) {
+ out.writeInt(1);
+ mClipData.writeToParcel(out, flags);
+ } else {
+ out.writeInt(0);
+ }
+
out.writeBundle(mExtras);
}
@@ -6254,6 +6353,10 @@
mSelector = new Intent(in);
}
+ if (in.readInt() != 0) {
+ mClipData = new ClipData(in);
+ }
+
mExtras = in.readBundle();
}
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java
index ba24036..b7dfe92 100644
--- a/core/java/android/content/SyncManager.java
+++ b/core/java/android/content/SyncManager.java
@@ -23,18 +23,23 @@
import android.accounts.Account;
import android.accounts.AccountManager;
+import android.accounts.AccountManagerService;
import android.accounts.OnAccountsUpdateListener;
import android.app.ActivityManager;
import android.app.AlarmManager;
+import android.app.AppGlobals;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
+import android.app.DownloadManager.Request;
+import android.content.SyncStorageEngine.OnSyncRequestListener;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.RegisteredServicesCache;
import android.content.pm.RegisteredServicesCacheListener;
import android.content.pm.ResolveInfo;
+import android.content.pm.UserInfo;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
@@ -48,6 +53,7 @@
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
+import android.os.UserId;
import android.os.WorkSource;
import android.provider.Settings;
import android.text.format.DateUtils;
@@ -132,7 +138,9 @@
private Context mContext;
- private volatile Account[] mAccounts = INITIAL_ACCOUNTS_ARRAY;
+ private static final AccountAndUser[] INITIAL_ACCOUNTS_ARRAY = new AccountAndUser[0];
+
+ private volatile AccountAndUser[] mAccounts = INITIAL_ACCOUNTS_ARRAY;
volatile private PowerManager.WakeLock mHandleAlarmWakeLock;
volatile private PowerManager.WakeLock mSyncManagerWakeLock;
@@ -166,7 +174,8 @@
Log.v(TAG, "Internal storage is low.");
}
mStorageIsLow = true;
- cancelActiveSync(null /* any account */, null /* any authority */);
+ cancelActiveSync(null /* any account */, UserId.USER_ALL,
+ null /* any authority */);
} else if (Intent.ACTION_DEVICE_STORAGE_OK.equals(action)) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "Internal storage is ok.");
@@ -186,28 +195,73 @@
private BroadcastReceiver mBackgroundDataSettingChanged = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
if (getConnectivityManager().getBackgroundDataSetting()) {
- scheduleSync(null /* account */, null /* authority */, new Bundle(), 0 /* delay */,
+ scheduleSync(null /* account */, UserId.USER_ALL, null /* authority */,
+ new Bundle(), 0 /* delay */,
false /* onlyThoseWithUnknownSyncableState */);
}
}
};
- private static final Account[] INITIAL_ACCOUNTS_ARRAY = new Account[0];
-
private final PowerManager mPowerManager;
private static final long SYNC_ALARM_TIMEOUT_MIN = 30 * 1000; // 30 seconds
private static final long SYNC_ALARM_TIMEOUT_MAX = 2 * 60 * 60 * 1000; // two hours
+ private List<UserInfo> getAllUsers() {
+ try {
+ return AppGlobals.getPackageManager().getUsers();
+ } catch (RemoteException re) {
+ // Local to system process, shouldn't happen
+ }
+ return null;
+ }
+
+ private boolean containsAccountAndUser(AccountAndUser[] accounts, Account account, int userId) {
+ boolean found = false;
+ for (int i = 0; i < accounts.length; i++) {
+ if (accounts[i].userId == userId
+ && accounts[i].account.equals(account)) {
+ found = true;
+ break;
+ }
+ }
+ return found;
+ }
+
public void onAccountsUpdated(Account[] accounts) {
// remember if this was the first time this was called after an update
final boolean justBootedUp = mAccounts == INITIAL_ACCOUNTS_ARRAY;
- mAccounts = accounts;
- // if a sync is in progress yet it is no longer in the accounts list,
- // cancel it
+ List<UserInfo> users = getAllUsers();
+ if (users == null) return;
+
+ int count = 0;
+
+ // For all known users on the system, get their accounts and add them to the list
+ // TODO: Limit this to active users, when such a concept exists.
+ for (UserInfo user : users) {
+ accounts = AccountManagerService.getSingleton().getAccounts(user.id);
+ count += accounts.length;
+ }
+
+ AccountAndUser[] allAccounts = new AccountAndUser[count];
+ int index = 0;
+ for (UserInfo user : users) {
+ accounts = AccountManagerService.getSingleton().getAccounts(user.id);
+ for (Account account : accounts) {
+ allAccounts[index++] = new AccountAndUser(account, user.id);
+ }
+ if (mBootCompleted) {
+ mSyncStorageEngine.doDatabaseCleanup(accounts, user.id);
+ }
+ }
+
+ mAccounts = allAccounts;
+
for (ActiveSyncContext currentSyncContext : mActiveSyncContexts) {
- if (!ArrayUtils.contains(accounts, currentSyncContext.mSyncOperation.account)) {
+ if (!containsAccountAndUser(allAccounts,
+ currentSyncContext.mSyncOperation.account,
+ currentSyncContext.mSyncOperation.userId)) {
Log.d(TAG, "canceling sync since the account has been removed");
sendSyncFinishedOrCanceledMessage(currentSyncContext,
null /* no result since this is a cancel */);
@@ -218,11 +272,7 @@
// the accounts are not set yet
sendCheckAlarmsMessage();
- if (mBootCompleted) {
- mSyncStorageEngine.doDatabaseCleanup(accounts);
- }
-
- if (accounts.length > 0) {
+ if (allAccounts.length > 0) {
// If this is the first time this was called after a bootup then
// the accounts haven't really changed, instead they were just loaded
// from the AccountManager. Otherwise at least one of the accounts
@@ -238,7 +288,8 @@
// a chance to set their syncable state.
boolean onlyThoseWithUnkownSyncableState = justBootedUp;
- scheduleSync(null, null, null, 0 /* no delay */, onlyThoseWithUnkownSyncableState);
+ scheduleSync(null, UserId.USER_ALL, null, null, 0 /* no delay */,
+ onlyThoseWithUnkownSyncableState);
}
}
@@ -277,10 +328,36 @@
private static final String ACTION_SYNC_ALARM = "android.content.syncmanager.SYNC_ALARM";
private final SyncHandler mSyncHandler;
- private final Handler mMainHandler;
private volatile boolean mBootCompleted = false;
+ static class AccountAndUser {
+ Account account;
+ int userId;
+
+ AccountAndUser(Account account, int userId) {
+ this.account = account;
+ this.userId = userId;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof AccountAndUser)) return false;
+ final AccountAndUser other = (AccountAndUser) o;
+ return this.account.equals(other.account)
+ && this.userId == other.userId;
+ }
+
+ @Override
+ public int hashCode() {
+ return account.hashCode() + userId;
+ }
+
+ public String toString() {
+ return account.toString() + " u" + userId;
+ }
+ }
+
private ConnectivityManager getConnectivityManager() {
synchronized (this) {
if (mConnManagerDoNotUseDirectly == null) {
@@ -297,6 +374,13 @@
mContext = context;
SyncStorageEngine.init(context);
mSyncStorageEngine = SyncStorageEngine.getSingleton();
+ mSyncStorageEngine.setOnSyncRequestListener(new OnSyncRequestListener() {
+ public void onSyncRequest(Account account, int userId, String authority,
+ Bundle extras) {
+ scheduleSync(account, userId, authority, extras, 0, false);
+ }
+ });
+
mSyncAdapters = new SyncAdaptersCache(mContext);
mSyncQueue = new SyncQueue(mSyncStorageEngine, mSyncAdapters);
@@ -304,12 +388,11 @@
Process.THREAD_PRIORITY_BACKGROUND);
syncThread.start();
mSyncHandler = new SyncHandler(syncThread.getLooper());
- mMainHandler = new Handler(mContext.getMainLooper());
mSyncAdapters.setListener(new RegisteredServicesCacheListener<SyncAdapterType>() {
public void onServiceChanged(SyncAdapterType type, boolean removed) {
if (!removed) {
- scheduleSync(null, type.authority, null, 0 /* no delay */,
+ scheduleSync(null, UserId.USER_ALL, type.authority, null, 0 /* no delay */,
false /* onlyThoseWithUnkownSyncableState */);
}
}
@@ -376,7 +459,7 @@
AccountManager.get(mContext).addOnAccountsUpdatedListener(SyncManager.this,
mSyncHandler, false /* updateImmediately */);
// do this synchronously to ensure we have the accounts before this call returns
- onAccountsUpdated(AccountManager.get(mContext).getAccounts());
+ onAccountsUpdated(null);
}
}
@@ -404,82 +487,6 @@
}
}
- private void initializeSyncAdapter(Account account, String authority) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, "initializeSyncAdapter: " + account + ", authority " + authority);
- }
- SyncAdapterType syncAdapterType = SyncAdapterType.newKey(authority, account.type);
- RegisteredServicesCache.ServiceInfo<SyncAdapterType> syncAdapterInfo =
- mSyncAdapters.getServiceInfo(syncAdapterType);
- if (syncAdapterInfo == null) {
- Log.w(TAG, "can't find a sync adapter for " + syncAdapterType + ", removing");
- mSyncStorageEngine.removeAuthority(account, authority);
- return;
- }
-
- Intent intent = new Intent();
- intent.setAction("android.content.SyncAdapter");
- intent.setComponent(syncAdapterInfo.componentName);
- if (!mContext.bindService(intent,
- new InitializerServiceConnection(account, authority, mContext, mMainHandler),
- Context.BIND_AUTO_CREATE | Context.BIND_NOT_FOREGROUND
- | Context.BIND_ALLOW_OOM_MANAGEMENT)) {
- Log.w(TAG, "initializeSyncAdapter: failed to bind to " + intent);
- }
- }
-
- private static class InitializerServiceConnection implements ServiceConnection {
- private final Account mAccount;
- private final String mAuthority;
- private final Handler mHandler;
- private volatile Context mContext;
- private volatile boolean mInitialized;
-
- public InitializerServiceConnection(Account account, String authority, Context context,
- Handler handler) {
- mAccount = account;
- mAuthority = authority;
- mContext = context;
- mHandler = handler;
- mInitialized = false;
- }
-
- public void onServiceConnected(ComponentName name, IBinder service) {
- try {
- if (!mInitialized) {
- mInitialized = true;
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, "calling initialize: " + mAccount + ", authority " + mAuthority);
- }
- ISyncAdapter.Stub.asInterface(service).initialize(mAccount, mAuthority);
- }
- } catch (RemoteException e) {
- // doesn't matter, we will retry again later
- Log.d(TAG, "error while initializing: " + mAccount + ", authority " + mAuthority,
- e);
- } finally {
- // give the sync adapter time to initialize before unbinding from it
- // TODO: change this API to not rely on this timing, http://b/2500805
- mHandler.postDelayed(new Runnable() {
- public void run() {
- if (mContext != null) {
- mContext.unbindService(InitializerServiceConnection.this);
- mContext = null;
- }
- }
- }, INITIALIZATION_UNBIND_DELAY_MS);
- }
- }
-
- public void onServiceDisconnected(ComponentName name) {
- if (mContext != null) {
- mContext.unbindService(InitializerServiceConnection.this);
- mContext = null;
- }
- }
-
- }
-
/**
* Initiate a sync. This can start a sync for all providers
* (pass null to url, set onlyTicklable to false), only those
@@ -500,6 +507,8 @@
* <p>You'll start getting callbacks after this.
*
* @param requestedAccount the account to sync, may be null to signify all accounts
+ * @param userId the id of the user whose accounts are to be synced. If userId is USER_ALL,
+ * then all users' accounts are considered.
* @param requestedAuthority the authority to sync, may be null to indicate all authorities
* @param extras a Map of SyncAdapter-specific information to control
* syncs of a specific provider. Can be null. Is ignored
@@ -507,7 +516,7 @@
* @param delay how many milliseconds in the future to wait before performing this
* @param onlyThoseWithUnkownSyncableState
*/
- public void scheduleSync(Account requestedAccount, String requestedAuthority,
+ public void scheduleSync(Account requestedAccount, int userId, String requestedAuthority,
Bundle extras, long delay, boolean onlyThoseWithUnkownSyncableState) {
boolean isLoggable = Log.isLoggable(TAG, Log.VERBOSE);
@@ -521,9 +530,9 @@
delay = -1; // this means schedule at the front of the queue
}
- Account[] accounts;
- if (requestedAccount != null) {
- accounts = new Account[]{requestedAccount};
+ AccountAndUser[] accounts;
+ if (requestedAccount != null && userId != UserId.USER_ALL) {
+ accounts = new AccountAndUser[] { new AccountAndUser(requestedAccount, userId) };
} else {
// if the accounts aren't configured yet then we can't support an account-less
// sync request
@@ -574,24 +583,23 @@
if (hasSyncAdapter) syncableAuthorities.add(requestedAuthority);
}
- final boolean masterSyncAutomatically = mSyncStorageEngine.getMasterSyncAutomatically();
-
for (String authority : syncableAuthorities) {
- for (Account account : accounts) {
- int isSyncable = mSyncStorageEngine.getIsSyncable(account, authority);
+ for (AccountAndUser account : accounts) {
+ int isSyncable = mSyncStorageEngine.getIsSyncable(account.account, account.userId,
+ authority);
if (isSyncable == 0) {
continue;
}
final RegisteredServicesCache.ServiceInfo<SyncAdapterType> syncAdapterInfo =
mSyncAdapters.getServiceInfo(
- SyncAdapterType.newKey(authority, account.type));
+ SyncAdapterType.newKey(authority, account.account.type));
if (syncAdapterInfo == null) {
continue;
}
final boolean allowParallelSyncs = syncAdapterInfo.type.allowParallelSyncs();
final boolean isAlwaysSyncable = syncAdapterInfo.type.isAlwaysSyncable();
if (isSyncable < 0 && isAlwaysSyncable) {
- mSyncStorageEngine.setIsSyncable(account, authority, 1);
+ mSyncStorageEngine.setIsSyncable(account.account, account.userId, authority, 1);
isSyncable = 1;
}
if (onlyThoseWithUnkownSyncableState && isSyncable >= 0) {
@@ -605,8 +613,10 @@
boolean syncAllowed =
(isSyncable < 0)
|| ignoreSettings
- || (backgroundDataUsageAllowed && masterSyncAutomatically
- && mSyncStorageEngine.getSyncAutomatically(account, authority));
+ || (backgroundDataUsageAllowed
+ && mSyncStorageEngine.getMasterSyncAutomatically(account.userId)
+ && mSyncStorageEngine.getSyncAutomatically(account.account,
+ account.userId, authority));
if (!syncAllowed) {
if (isLoggable) {
Log.d(TAG, "scheduleSync: sync of " + account + ", " + authority
@@ -615,8 +625,10 @@
continue;
}
- Pair<Long, Long> backoff = mSyncStorageEngine.getBackoff(account, authority);
- long delayUntil = mSyncStorageEngine.getDelayUntilTime(account, authority);
+ Pair<Long, Long> backoff = mSyncStorageEngine
+ .getBackoff(account.account, account.userId, authority);
+ long delayUntil = mSyncStorageEngine.getDelayUntilTime(account.account,
+ account.userId, authority);
final long backoffTime = backoff != null ? backoff.first : 0;
if (isSyncable < 0) {
Bundle newExtras = new Bundle();
@@ -630,9 +642,8 @@
+ ", extras " + newExtras);
}
scheduleSyncOperation(
- new SyncOperation(account, source, authority, newExtras, 0,
- backoffTime, delayUntil,
- allowParallelSyncs));
+ new SyncOperation(account.account, account.userId, source, authority,
+ newExtras, 0, backoffTime, delayUntil, allowParallelSyncs));
}
if (!onlyThoseWithUnkownSyncableState) {
if (isLoggable) {
@@ -644,18 +655,17 @@
+ ", extras " + extras);
}
scheduleSyncOperation(
- new SyncOperation(account, source, authority, extras, delay,
- backoffTime, delayUntil,
- allowParallelSyncs));
+ new SyncOperation(account.account, account.userId, source, authority,
+ extras, delay, backoffTime, delayUntil, allowParallelSyncs));
}
}
}
}
- public void scheduleLocalSync(Account account, String authority) {
+ public void scheduleLocalSync(Account account, int userId, String authority) {
final Bundle extras = new Bundle();
extras.putBoolean(ContentResolver.SYNC_EXTRAS_UPLOAD, true);
- scheduleSync(account, authority, extras, LOCAL_SYNC_DELAY,
+ scheduleSync(account, userId, authority, extras, LOCAL_SYNC_DELAY,
false /* onlyThoseWithUnkownSyncableState */);
}
@@ -691,11 +701,13 @@
mSyncHandler.sendMessage(msg);
}
- private void sendCancelSyncsMessage(final Account account, final String authority) {
+ private void sendCancelSyncsMessage(final Account account, final int userId,
+ final String authority) {
if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "sending MESSAGE_CANCEL");
Message msg = mSyncHandler.obtainMessage();
msg.what = SyncHandler.MESSAGE_CANCEL;
msg.obj = Pair.create(account, authority);
+ msg.arg1 = userId;
mSyncHandler.sendMessage(msg);
}
@@ -717,10 +729,10 @@
}
private void clearBackoffSetting(SyncOperation op) {
- mSyncStorageEngine.setBackoff(op.account, op.authority,
+ mSyncStorageEngine.setBackoff(op.account, op.userId, op.authority,
SyncStorageEngine.NOT_IN_BACKOFF_MODE, SyncStorageEngine.NOT_IN_BACKOFF_MODE);
synchronized (mSyncQueue) {
- mSyncQueue.onBackoffChanged(op.account, op.authority, 0);
+ mSyncQueue.onBackoffChanged(op.account, op.userId, op.authority, 0);
}
}
@@ -728,7 +740,7 @@
final long now = SystemClock.elapsedRealtime();
final Pair<Long, Long> previousSettings =
- mSyncStorageEngine.getBackoff(op.account, op.authority);
+ mSyncStorageEngine.getBackoff(op.account, op.userId, op.authority);
long newDelayInMs = -1;
if (previousSettings != null) {
// don't increase backoff before current backoff is expired. This will happen for op's
@@ -759,14 +771,14 @@
final long backoff = now + newDelayInMs;
- mSyncStorageEngine.setBackoff(op.account, op.authority,
+ mSyncStorageEngine.setBackoff(op.account, op.userId, op.authority,
backoff, newDelayInMs);
op.backoff = backoff;
op.updateEffectiveRunTime();
synchronized (mSyncQueue) {
- mSyncQueue.onBackoffChanged(op.account, op.authority, backoff);
+ mSyncQueue.onBackoffChanged(op.account, op.userId, op.authority, backoff);
}
}
@@ -779,7 +791,8 @@
} else {
newDelayUntilTime = 0;
}
- mSyncStorageEngine.setDelayUntilTime(op.account, op.authority, newDelayUntilTime);
+ mSyncStorageEngine
+ .setDelayUntilTime(op.account, op.userId, op.authority, newDelayUntilTime);
synchronized (mSyncQueue) {
mSyncQueue.onDelayUntilTimeChanged(op.account, op.authority, newDelayUntilTime);
}
@@ -790,8 +803,8 @@
* @param account limit the cancelations to syncs with this account, if non-null
* @param authority limit the cancelations to syncs with this authority, if non-null
*/
- public void cancelActiveSync(Account account, String authority) {
- sendCancelSyncsMessage(account, authority);
+ public void cancelActiveSync(Account account, int userId, String authority) {
+ sendCancelSyncsMessage(account, userId, authority);
}
/**
@@ -823,11 +836,11 @@
* @param account limit the removals to operations with this account, if non-null
* @param authority limit the removals to operations with this authority, if non-null
*/
- public void clearScheduledSyncOperations(Account account, String authority) {
+ public void clearScheduledSyncOperations(Account account, int userId, String authority) {
synchronized (mSyncQueue) {
- mSyncQueue.remove(account, authority);
+ mSyncQueue.remove(account, userId, authority);
}
- mSyncStorageEngine.setBackoff(account, authority,
+ mSyncStorageEngine.setBackoff(account, userId, authority,
SyncStorageEngine.NOT_IN_BACKOFF_MODE, SyncStorageEngine.NOT_IN_BACKOFF_MODE);
}
@@ -875,7 +888,8 @@
Log.d(TAG, "retrying sync operation that failed because there was already a "
+ "sync in progress: " + operation);
}
- scheduleSyncOperation(new SyncOperation(operation.account, operation.syncSource,
+ scheduleSyncOperation(new SyncOperation(operation.account, operation.userId,
+ operation.syncSource,
operation.authority, operation.extras,
DELAY_RETRY_SYNC_IN_PROGRESS_IN_SECONDS * 1000,
operation.backoff, operation.delayUntil, operation.allowParallelSyncs));
@@ -979,7 +993,8 @@
mBound = true;
final boolean bindResult = mContext.bindService(intent, this,
Context.BIND_AUTO_CREATE | Context.BIND_NOT_FOREGROUND
- | Context.BIND_ALLOW_OOM_MANAGEMENT);
+ | Context.BIND_ALLOW_OOM_MANAGEMENT,
+ mSyncOperation.userId);
if (!bindResult) {
mBound = false;
}
@@ -1034,10 +1049,19 @@
protected void dumpSyncState(PrintWriter pw) {
pw.print("data connected: "); pw.println(mDataConnectionIsConnected);
- pw.print("auto sync: "); pw.println(mSyncStorageEngine.getMasterSyncAutomatically());
+ pw.print("auto sync: ");
+ List<UserInfo> users = getAllUsers();
+ if (users != null) {
+ for (UserInfo user : users) {
+ pw.print("u" + user.id + "="
+ + mSyncStorageEngine.getMasterSyncAutomatically(user.id));
+ }
+ pw.println();
+ }
pw.print("memory low: "); pw.println(mStorageIsLow);
- final Account[] accounts = mAccounts;
+ final AccountAndUser[] accounts = mAccounts;
+
pw.print("accounts: ");
if (accounts != INITIAL_ACCOUNTS_ARRAY) {
pw.println(accounts.length);
@@ -1090,18 +1114,20 @@
// join the installed sync adapter with the accounts list and emit for everything
pw.println();
pw.println("Sync Status");
- for (Account account : accounts) {
- pw.print(" Account "); pw.print(account.name);
- pw.print(" "); pw.print(account.type);
+ for (AccountAndUser account : accounts) {
+ pw.print(" Account "); pw.print(account.account.name);
+ pw.print(" u"); pw.print(account.userId);
+ pw.print(" "); pw.print(account.account.type);
pw.println(":");
for (RegisteredServicesCache.ServiceInfo<SyncAdapterType> syncAdapterType :
mSyncAdapters.getAllServices()) {
- if (!syncAdapterType.type.accountType.equals(account.type)) {
+ if (!syncAdapterType.type.accountType.equals(account.account.type)) {
continue;
}
- SyncStorageEngine.AuthorityInfo settings = mSyncStorageEngine.getOrCreateAuthority(
- account, syncAdapterType.type.authority);
+ SyncStorageEngine.AuthorityInfo settings =
+ mSyncStorageEngine.getOrCreateAuthority(
+ account.account, account.userId, syncAdapterType.type.authority);
SyncStatusInfo status = mSyncStorageEngine.getOrCreateSyncStatus(settings);
pw.print(" "); pw.print(settings.authority);
pw.println(":");
@@ -1554,7 +1580,16 @@
private volatile CountDownLatch mReadyToRunLatch = new CountDownLatch(1);
public void onBootCompleted() {
mBootCompleted = true;
- mSyncStorageEngine.doDatabaseCleanup(AccountManager.get(mContext).getAccounts());
+ // TODO: Handle bootcompleted event for specific user. Now let's just iterate through
+ // all the users.
+ List<UserInfo> users = getAllUsers();
+ if (users != null) {
+ for (UserInfo user : users) {
+ mSyncStorageEngine.doDatabaseCleanup(
+ AccountManagerService.getSingleton().getAccounts(user.id),
+ user.id);
+ }
+ }
if (mReadyToRunLatch != null) {
mReadyToRunLatch.countDown();
}
@@ -1635,7 +1670,7 @@
Log.d(TAG, "handleSyncHandlerMessage: MESSAGE_SERVICE_CANCEL: "
+ payload.first + ", " + payload.second);
}
- cancelActiveSyncLocked(payload.first, payload.second);
+ cancelActiveSyncLocked(payload.first, msg.arg1, payload.second);
nextPendingSyncTime = maybeStartNextSyncLocked();
break;
}
@@ -1740,22 +1775,28 @@
final boolean backgroundDataUsageAllowed =
getConnectivityManager().getBackgroundDataSetting();
long earliestFuturePollTime = Long.MAX_VALUE;
- if (!backgroundDataUsageAllowed || !mSyncStorageEngine.getMasterSyncAutomatically()) {
+ if (!backgroundDataUsageAllowed) {
return earliestFuturePollTime;
}
+
+ AccountAndUser[] accounts = mAccounts;
+
final long nowAbsolute = System.currentTimeMillis();
ArrayList<SyncStorageEngine.AuthorityInfo> infos = mSyncStorageEngine.getAuthorities();
for (SyncStorageEngine.AuthorityInfo info : infos) {
// skip the sync if the account of this operation no longer exists
- if (!ArrayUtils.contains(mAccounts, info.account)) {
+ if (!containsAccountAndUser(accounts, info.account, info.userId)) {
continue;
}
- if (!mSyncStorageEngine.getSyncAutomatically(info.account, info.authority)) {
+ if (!mSyncStorageEngine.getMasterSyncAutomatically(info.userId)
+ || !mSyncStorageEngine.getSyncAutomatically(info.account, info.userId,
+ info.authority)) {
continue;
}
- if (mSyncStorageEngine.getIsSyncable(info.account, info.authority) == 0) {
+ if (mSyncStorageEngine.getIsSyncable(info.account, info.userId, info.authority)
+ == 0) {
continue;
}
@@ -1772,8 +1813,8 @@
: lastPollTimeAbsolute + periodInSeconds * 1000;
// if it is ready to run then schedule it and mark it as having been scheduled
if (nextPollTimeAbsolute <= nowAbsolute) {
- final Pair<Long, Long> backoff =
- mSyncStorageEngine.getBackoff(info.account, info.authority);
+ final Pair<Long, Long> backoff = mSyncStorageEngine.getBackoff(
+ info.account, info.userId, info.authority);
final RegisteredServicesCache.ServiceInfo<SyncAdapterType> syncAdapterInfo =
mSyncAdapters.getServiceInfo(
SyncAdapterType.newKey(info.authority, info.account.type));
@@ -1781,11 +1822,12 @@
continue;
}
scheduleSyncOperation(
- new SyncOperation(info.account, SyncStorageEngine.SOURCE_PERIODIC,
+ new SyncOperation(info.account, info.userId,
+ SyncStorageEngine.SOURCE_PERIODIC,
info.authority, extras, 0 /* delay */,
backoff != null ? backoff.first : 0,
mSyncStorageEngine.getDelayUntilTime(
- info.account, info.authority),
+ info.account, info.userId, info.authority),
syncAdapterInfo.type.allowParallelSyncs()));
status.setPeriodicSyncTime(i, nowAbsolute);
} else {
@@ -1830,7 +1872,7 @@
// If the accounts aren't known yet then we aren't ready to run. We will be kicked
// when the account lookup request does complete.
- Account[] accounts = mAccounts;
+ AccountAndUser[] accounts = mAccounts;
if (accounts == INITIAL_ACCOUNTS_ARRAY) {
if (isLoggable) {
Log.v(TAG, "maybeStartNextSync: accounts not known, skipping");
@@ -1843,7 +1885,6 @@
// start it, otherwise just get out.
final boolean backgroundDataUsageAllowed =
getConnectivityManager().getBackgroundDataSetting();
- final boolean masterSyncAutomatically = mSyncStorageEngine.getMasterSyncAutomatically();
final long now = SystemClock.elapsedRealtime();
@@ -1863,14 +1904,15 @@
final SyncOperation op = operationIterator.next();
// drop the sync if the account of this operation no longer exists
- if (!ArrayUtils.contains(mAccounts, op.account)) {
+ if (!containsAccountAndUser(accounts, op.account, op.userId)) {
operationIterator.remove();
mSyncStorageEngine.deleteFromPending(op.pendingOperation);
continue;
}
// drop this sync request if it isn't syncable
- int syncableState = mSyncStorageEngine.getIsSyncable(op.account, op.authority);
+ int syncableState = mSyncStorageEngine.getIsSyncable(
+ op.account, op.userId, op.authority);
if (syncableState == 0) {
operationIterator.remove();
mSyncStorageEngine.deleteFromPending(op.pendingOperation);
@@ -1905,11 +1947,11 @@
// disconnected for the target UID.
if (!op.extras.getBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_SETTINGS, false)
&& (syncableState > 0)
- && (!masterSyncAutomatically
+ && (!mSyncStorageEngine.getMasterSyncAutomatically(op.userId)
|| !backgroundDataUsageAllowed
|| !uidNetworkConnected
|| !mSyncStorageEngine.getSyncAutomatically(
- op.account, op.authority))) {
+ op.account, op.userId, op.authority))) {
operationIterator.remove();
mSyncStorageEngine.deleteFromPending(op.pendingOperation);
continue;
@@ -1946,6 +1988,7 @@
}
if (activeOp.account.type.equals(candidate.account.type)
&& activeOp.authority.equals(candidate.authority)
+ && activeOp.userId == candidate.userId
&& (!activeOp.allowParallelSyncs
|| activeOp.account.name.equals(candidate.account.name))) {
conflict = activeSyncContext;
@@ -2033,7 +2076,7 @@
if (syncAdapterInfo == null) {
Log.d(TAG, "can't find a sync adapter for " + syncAdapterType
+ ", removing settings for it");
- mSyncStorageEngine.removeAuthority(op.account, op.authority);
+ mSyncStorageEngine.removeAuthority(op.account, op.userId, op.authority);
return false;
}
@@ -2074,7 +2117,7 @@
}
}
- private void cancelActiveSyncLocked(Account account, String authority) {
+ private void cancelActiveSyncLocked(Account account, int userId, String authority) {
ArrayList<ActiveSyncContext> activeSyncs =
new ArrayList<ActiveSyncContext>(mActiveSyncContexts);
for (ActiveSyncContext activeSyncContext : activeSyncs) {
@@ -2082,15 +2125,20 @@
// if an authority was specified then only cancel the sync if it matches
if (account != null) {
if (!account.equals(activeSyncContext.mSyncOperation.account)) {
- return;
+ continue;
}
}
// if an account was specified then only cancel the sync if it matches
if (authority != null) {
if (!authority.equals(activeSyncContext.mSyncOperation.authority)) {
- return;
+ continue;
}
}
+ // check if the userid matches
+ if (userId != UserId.USER_ALL
+ && userId != activeSyncContext.mSyncOperation.userId) {
+ continue;
+ }
runSyncFinishedOrCanceledLocked(null /* no result since this is a cancel */,
activeSyncContext);
}
@@ -2169,7 +2217,7 @@
}
if (syncResult != null && syncResult.fullSyncRequested) {
- scheduleSyncOperation(new SyncOperation(syncOperation.account,
+ scheduleSyncOperation(new SyncOperation(syncOperation.account, syncOperation.userId,
syncOperation.syncSource, syncOperation.authority, new Bundle(), 0,
syncOperation.backoff, syncOperation.delayUntil,
syncOperation.allowParallelSyncs));
@@ -2180,7 +2228,8 @@
private void closeActiveSyncContext(ActiveSyncContext activeSyncContext) {
activeSyncContext.close();
mActiveSyncContexts.remove(activeSyncContext);
- mSyncStorageEngine.removeActiveSync(activeSyncContext.mSyncInfo);
+ mSyncStorageEngine.removeActiveSync(activeSyncContext.mSyncInfo,
+ activeSyncContext.mSyncOperation.userId);
}
/**
@@ -2446,7 +2495,8 @@
syncOperation.account.name.hashCode());
return mSyncStorageEngine.insertStartSyncEvent(
- syncOperation.account, syncOperation.authority, now, source);
+ syncOperation.account, syncOperation.userId, syncOperation.authority,
+ now, source);
}
public void stopSyncEvent(long rowId, SyncOperation syncOperation, String resultMessage,
diff --git a/core/java/android/content/SyncOperation.java b/core/java/android/content/SyncOperation.java
index 94c2247..4e86ef8 100644
--- a/core/java/android/content/SyncOperation.java
+++ b/core/java/android/content/SyncOperation.java
@@ -26,6 +26,7 @@
*/
public class SyncOperation implements Comparable {
public final Account account;
+ public final int userId;
public int syncSource;
public String authority;
public final boolean allowParallelSyncs;
@@ -38,9 +39,10 @@
public long delayUntil;
public long effectiveRunTime;
- public SyncOperation(Account account, int source, String authority, Bundle extras,
+ public SyncOperation(Account account, int userId, int source, String authority, Bundle extras,
long delayInMs, long backoff, long delayUntil, boolean allowParallelSyncs) {
this.account = account;
+ this.userId = userId;
this.syncSource = source;
this.authority = authority;
this.allowParallelSyncs = allowParallelSyncs;
@@ -75,6 +77,7 @@
SyncOperation(SyncOperation other) {
this.account = other.account;
+ this.userId = other.userId;
this.syncSource = other.syncSource;
this.authority = other.authority;
this.extras = new Bundle(other.extras);
@@ -120,7 +123,8 @@
private String toKey() {
StringBuilder sb = new StringBuilder();
sb.append("authority: ").append(authority);
- sb.append(" account {name=" + account.name + ", type=" + account.type + "}");
+ sb.append(" account {name=" + account.name + ", user=" + userId + ", type=" + account.type
+ + "}");
sb.append(" extras: ");
extrasToStringBuilder(extras, sb);
return sb.toString();
diff --git a/core/java/android/content/SyncQueue.java b/core/java/android/content/SyncQueue.java
index bfdf4a1..06da6fa 100644
--- a/core/java/android/content/SyncQueue.java
+++ b/core/java/android/content/SyncQueue.java
@@ -49,7 +49,8 @@
final int N = ops.size();
for (int i=0; i<N; i++) {
SyncStorageEngine.PendingOperation op = ops.get(i);
- final Pair<Long, Long> backoff = syncStorageEngine.getBackoff(op.account, op.authority);
+ final Pair<Long, Long> backoff =
+ syncStorageEngine.getBackoff(op.account, op.userId, op.authority);
final RegisteredServicesCache.ServiceInfo<SyncAdapterType> syncAdapterInfo =
syncAdapters.getServiceInfo(
SyncAdapterType.newKey(op.authority, op.account.type));
@@ -57,9 +58,9 @@
continue;
}
SyncOperation syncOperation = new SyncOperation(
- op.account, op.syncSource, op.authority, op.extras, 0 /* delay */,
+ op.account, op.userId, op.syncSource, op.authority, op.extras, 0 /* delay */,
backoff != null ? backoff.first : 0,
- syncStorageEngine.getDelayUntilTime(op.account, op.authority),
+ syncStorageEngine.getDelayUntilTime(op.account, op.userId, op.authority),
syncAdapterInfo.type.allowParallelSyncs());
syncOperation.expedited = op.expedited;
syncOperation.pendingOperation = op;
@@ -102,8 +103,8 @@
operation.pendingOperation = pop;
if (operation.pendingOperation == null) {
pop = new SyncStorageEngine.PendingOperation(
- operation.account, operation.syncSource,
- operation.authority, operation.extras, operation.expedited);
+ operation.account, operation.userId, operation.syncSource,
+ operation.authority, operation.extras, operation.expedited);
pop = mSyncStorageEngine.insertIntoPending(pop);
if (pop == null) {
throw new IllegalStateException("error adding pending sync operation "
@@ -131,11 +132,12 @@
}
}
- public void onBackoffChanged(Account account, String providerName, long backoff) {
+ public void onBackoffChanged(Account account, int userId, String providerName, long backoff) {
// for each op that matches the account and provider update its
// backoff and effectiveStartTime
for (SyncOperation op : mOperationsMap.values()) {
- if (op.account.equals(account) && op.authority.equals(providerName)) {
+ if (op.account.equals(account) && op.authority.equals(providerName)
+ && op.userId == userId) {
op.backoff = backoff;
op.updateEffectiveRunTime();
}
@@ -153,7 +155,7 @@
}
}
- public void remove(Account account, String authority) {
+ public void remove(Account account, int userId, String authority) {
Iterator<Map.Entry<String, SyncOperation>> entries = mOperationsMap.entrySet().iterator();
while (entries.hasNext()) {
Map.Entry<String, SyncOperation> entry = entries.next();
@@ -164,6 +166,9 @@
if (authority != null && !syncOperation.authority.equals(authority)) {
continue;
}
+ if (userId != syncOperation.userId) {
+ continue;
+ }
entries.remove();
if (!mSyncStorageEngine.deleteFromPending(syncOperation.pendingOperation)) {
final String errorMessage = "unable to find pending row for " + syncOperation;
diff --git a/core/java/android/content/SyncStorageEngine.java b/core/java/android/content/SyncStorageEngine.java
index a1e174b..7bb9866 100644
--- a/core/java/android/content/SyncStorageEngine.java
+++ b/core/java/android/content/SyncStorageEngine.java
@@ -25,6 +25,7 @@
import org.xmlpull.v1.XmlSerializer;
import android.accounts.Account;
+import android.content.SyncManager.AccountAndUser;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
@@ -58,9 +59,16 @@
* @hide
*/
public class SyncStorageEngine extends Handler {
+
private static final String TAG = "SyncManager";
private static final boolean DEBUG_FILE = false;
+ private static final String XML_ATTR_NEXT_AUTHORITY_ID = "nextAuthorityId";
+ private static final String XML_ATTR_LISTEN_FOR_TICKLES = "listen-for-tickles";
+ private static final String XML_ATTR_ENABLED = "enabled";
+ private static final String XML_ATTR_USER = "user";
+ private static final String XML_TAG_LISTEN_FOR_TICKLES = "listenForTickles";
+
private static final long DEFAULT_POLL_FREQUENCY_SECONDS = 60 * 60 * 24; // One day
// @VisibleForTesting
@@ -133,6 +141,7 @@
public static class PendingOperation {
final Account account;
+ final int userId;
final int syncSource;
final String authority;
final Bundle extras; // note: read-only.
@@ -141,9 +150,10 @@
int authorityId;
byte[] flatExtras;
- PendingOperation(Account account, int source,
+ PendingOperation(Account account, int userId, int source,
String authority, Bundle extras, boolean expedited) {
this.account = account;
+ this.userId = userId;
this.syncSource = source;
this.authority = authority;
this.extras = extras != null ? new Bundle(extras) : extras;
@@ -153,6 +163,7 @@
PendingOperation(PendingOperation other) {
this.account = other.account;
+ this.userId = other.userId;
this.syncSource = other.syncSource;
this.authority = other.authority;
this.extras = other.extras;
@@ -162,17 +173,18 @@
}
static class AccountInfo {
- final Account account;
+ final AccountAndUser accountAndUser;
final HashMap<String, AuthorityInfo> authorities =
new HashMap<String, AuthorityInfo>();
- AccountInfo(Account account) {
- this.account = account;
+ AccountInfo(AccountAndUser accountAndUser) {
+ this.accountAndUser = accountAndUser;
}
}
public static class AuthorityInfo {
final Account account;
+ final int userId;
final String authority;
final int ident;
boolean enabled;
@@ -182,8 +194,9 @@
long delayUntil;
final ArrayList<Pair<Bundle, Long>> periodicSyncs;
- AuthorityInfo(Account account, String authority, int ident) {
+ AuthorityInfo(Account account, int userId, String authority, int ident) {
this.account = account;
+ this.userId = userId;
this.authority = authority;
this.ident = ident;
enabled = SYNC_ENABLED_DEFAULT;
@@ -219,17 +232,29 @@
}
}
+ interface OnSyncRequestListener {
+ /**
+ * Called when a sync is needed on an account(s) due to some change in state.
+ * @param account
+ * @param userId
+ * @param authority
+ * @param extras
+ */
+ public void onSyncRequest(Account account, int userId, String authority, Bundle extras);
+ }
+
// Primary list of all syncable authorities. Also our global lock.
private final SparseArray<AuthorityInfo> mAuthorities =
new SparseArray<AuthorityInfo>();
- private final HashMap<Account, AccountInfo> mAccounts =
- new HashMap<Account, AccountInfo>();
+ private final HashMap<AccountAndUser, AccountInfo> mAccounts
+ = new HashMap<AccountAndUser, AccountInfo>();
private final ArrayList<PendingOperation> mPendingOperations =
new ArrayList<PendingOperation>();
- private final ArrayList<SyncInfo> mCurrentSyncs = new ArrayList<SyncInfo>();
+ private final SparseArray<ArrayList<SyncInfo>> mCurrentSyncs
+ = new SparseArray<ArrayList<SyncInfo>>();
private final SparseArray<SyncStatusInfo> mSyncStatus =
new SparseArray<SyncStatusInfo>();
@@ -282,7 +307,9 @@
private int mNumPendingFinished = 0;
private int mNextHistoryId = 0;
- private boolean mMasterSyncAutomatically = true;
+ private SparseArray<Boolean> mMasterSyncAutomatically = new SparseArray<Boolean>();
+
+ private OnSyncRequestListener mSyncRequestListener;
private SyncStorageEngine(Context context, File dataDir) {
mContext = context;
@@ -330,6 +357,12 @@
return sSyncStorageEngine;
}
+ protected void setOnSyncRequestListener(OnSyncRequestListener listener) {
+ if (mSyncRequestListener == null) {
+ mSyncRequestListener = listener;
+ }
+ }
+
@Override public void handleMessage(Message msg) {
if (msg.what == MSG_WRITE_STATUS) {
synchronized (mAuthorities) {
@@ -389,10 +422,10 @@
}
}
- public boolean getSyncAutomatically(Account account, String providerName) {
+ public boolean getSyncAutomatically(Account account, int userId, String providerName) {
synchronized (mAuthorities) {
if (account != null) {
- AuthorityInfo authority = getAuthorityLocked(account, providerName,
+ AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
"getSyncAutomatically");
return authority != null && authority.enabled;
}
@@ -402,6 +435,7 @@
i--;
AuthorityInfo authority = mAuthorities.valueAt(i);
if (authority.authority.equals(providerName)
+ && authority.userId == userId
&& authority.enabled) {
return true;
}
@@ -410,11 +444,13 @@
}
}
- public void setSyncAutomatically(Account account, String providerName, boolean sync) {
- Log.d(TAG, "setSyncAutomatically: " + /*account +*/ ", provider " + providerName
- + " -> " + sync);
+ public void setSyncAutomatically(Account account, int userId, String providerName,
+ boolean sync) {
+ Log.d(TAG, "setSyncAutomatically: " + /* account + */" provider " + providerName
+ + ", user " + userId + " -> " + sync);
synchronized (mAuthorities) {
- AuthorityInfo authority = getOrCreateAuthorityLocked(account, providerName, -1, false);
+ AuthorityInfo authority = getOrCreateAuthorityLocked(account, userId, providerName, -1,
+ false);
if (authority.enabled == sync) {
Log.d(TAG, "setSyncAutomatically: already set to " + sync + ", doing nothing");
return;
@@ -424,15 +460,15 @@
}
if (sync) {
- ContentResolver.requestSync(account, providerName, new Bundle());
+ requestSync(account, userId, providerName, new Bundle());
}
reportChange(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS);
}
- public int getIsSyncable(Account account, String providerName) {
+ public int getIsSyncable(Account account, int userId, String providerName) {
synchronized (mAuthorities) {
if (account != null) {
- AuthorityInfo authority = getAuthorityLocked(account, providerName,
+ AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
"getIsSyncable");
if (authority == null) {
return -1;
@@ -452,15 +488,17 @@
}
}
- public void setIsSyncable(Account account, String providerName, int syncable) {
+ public void setIsSyncable(Account account, int userId, String providerName, int syncable) {
if (syncable > 1) {
syncable = 1;
} else if (syncable < -1) {
syncable = -1;
}
- Log.d(TAG, "setIsSyncable: " + account + ", provider " + providerName + " -> " + syncable);
+ Log.d(TAG, "setIsSyncable: " + account + ", provider " + providerName
+ + ", user " + userId + " -> " + syncable);
synchronized (mAuthorities) {
- AuthorityInfo authority = getOrCreateAuthorityLocked(account, providerName, -1, false);
+ AuthorityInfo authority = getOrCreateAuthorityLocked(account, userId, providerName, -1,
+ false);
if (authority.syncable == syncable) {
Log.d(TAG, "setIsSyncable: already set to " + syncable + ", doing nothing");
return;
@@ -470,14 +508,15 @@
}
if (syncable > 0) {
- ContentResolver.requestSync(account, providerName, new Bundle());
+ requestSync(account, userId, providerName, new Bundle());
}
reportChange(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS);
}
- public Pair<Long, Long> getBackoff(Account account, String providerName) {
+ public Pair<Long, Long> getBackoff(Account account, int userId, String providerName) {
synchronized (mAuthorities) {
- AuthorityInfo authority = getAuthorityLocked(account, providerName, "getBackoff");
+ AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
+ "getBackoff");
if (authority == null || authority.backoffTime < 0) {
return null;
}
@@ -485,17 +524,21 @@
}
}
- public void setBackoff(Account account, String providerName,
+ public void setBackoff(Account account, int userId, String providerName,
long nextSyncTime, long nextDelay) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "setBackoff: " + account + ", provider " + providerName
+ + ", user " + userId
+ " -> nextSyncTime " + nextSyncTime + ", nextDelay " + nextDelay);
}
boolean changed = false;
synchronized (mAuthorities) {
if (account == null || providerName == null) {
for (AccountInfo accountInfo : mAccounts.values()) {
- if (account != null && !account.equals(accountInfo.account)) continue;
+ if (account != null && !account.equals(accountInfo.accountAndUser.account)
+ && userId != accountInfo.accountAndUser.userId) {
+ continue;
+ }
for (AuthorityInfo authorityInfo : accountInfo.authorities.values()) {
if (providerName != null && !providerName.equals(authorityInfo.authority)) {
continue;
@@ -510,7 +553,8 @@
}
} else {
AuthorityInfo authority =
- getOrCreateAuthorityLocked(account, providerName, -1 /* ident */, true);
+ getOrCreateAuthorityLocked(account, userId, providerName, -1 /* ident */,
+ true);
if (authority.backoffTime == nextSyncTime && authority.backoffDelay == nextDelay) {
return;
}
@@ -535,13 +579,15 @@
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "clearAllBackoffs:"
+ " authority:" + authorityInfo.authority
- + " account:" + accountInfo.account.name
+ + " account:" + accountInfo.accountAndUser.account.name
+ + " user:" + accountInfo.accountAndUser.userId
+ " backoffTime was: " + authorityInfo.backoffTime
+ " backoffDelay was: " + authorityInfo.backoffDelay);
}
authorityInfo.backoffTime = NOT_IN_BACKOFF_MODE;
authorityInfo.backoffDelay = NOT_IN_BACKOFF_MODE;
- syncQueue.onBackoffChanged(accountInfo.account, authorityInfo.authority, 0);
+ syncQueue.onBackoffChanged(accountInfo.accountAndUser.account,
+ accountInfo.accountAndUser.userId, authorityInfo.authority, 0);
changed = true;
}
}
@@ -553,14 +599,15 @@
}
}
- public void setDelayUntilTime(Account account, String providerName, long delayUntil) {
+ public void setDelayUntilTime(Account account, int userId, String providerName,
+ long delayUntil) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "setDelayUntil: " + account + ", provider " + providerName
- + " -> delayUntil " + delayUntil);
+ + ", user " + userId + " -> delayUntil " + delayUntil);
}
synchronized (mAuthorities) {
AuthorityInfo authority = getOrCreateAuthorityLocked(
- account, providerName, -1 /* ident */, true);
+ account, userId, providerName, -1 /* ident */, true);
if (authority.delayUntil == delayUntil) {
return;
}
@@ -570,9 +617,10 @@
reportChange(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS);
}
- public long getDelayUntilTime(Account account, String providerName) {
+ public long getDelayUntilTime(Account account, int userId, String providerName) {
synchronized (mAuthorities) {
- AuthorityInfo authority = getAuthorityLocked(account, providerName, "getDelayUntil");
+ AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
+ "getDelayUntil");
if (authority == null) {
return 0;
}
@@ -580,7 +628,8 @@
}
}
- private void updateOrRemovePeriodicSync(Account account, String providerName, Bundle extras,
+ private void updateOrRemovePeriodicSync(Account account, int userId, String providerName,
+ Bundle extras,
long period, boolean add) {
if (period <= 0) {
period = 0;
@@ -589,13 +638,14 @@
extras = new Bundle();
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, "addOrRemovePeriodicSync: " + account + ", provider " + providerName
+ Log.v(TAG, "addOrRemovePeriodicSync: " + account + ", user " + userId
+ + ", provider " + providerName
+ " -> period " + period + ", extras " + extras);
}
synchronized (mAuthorities) {
try {
AuthorityInfo authority =
- getOrCreateAuthorityLocked(account, providerName, -1, false);
+ getOrCreateAuthorityLocked(account, userId, providerName, -1, false);
if (add) {
// add this periodic sync if one with the same extras doesn't already
// exist in the periodicSyncs array
@@ -652,61 +702,67 @@
reportChange(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS);
}
- public void addPeriodicSync(Account account, String providerName, Bundle extras,
+ public void addPeriodicSync(Account account, int userId, String providerName, Bundle extras,
long pollFrequency) {
- updateOrRemovePeriodicSync(account, providerName, extras, pollFrequency, true /* add */);
+ updateOrRemovePeriodicSync(account, userId, providerName, extras, pollFrequency,
+ true /* add */);
}
- public void removePeriodicSync(Account account, String providerName, Bundle extras) {
- updateOrRemovePeriodicSync(account, providerName, extras, 0 /* period, ignored */,
+ public void removePeriodicSync(Account account, int userId, String providerName,
+ Bundle extras) {
+ updateOrRemovePeriodicSync(account, userId, providerName, extras, 0 /* period, ignored */,
false /* remove */);
}
- public List<PeriodicSync> getPeriodicSyncs(Account account, String providerName) {
+ public List<PeriodicSync> getPeriodicSyncs(Account account, int userId, String providerName) {
ArrayList<PeriodicSync> syncs = new ArrayList<PeriodicSync>();
synchronized (mAuthorities) {
- AuthorityInfo authority = getAuthorityLocked(account, providerName, "getPeriodicSyncs");
+ AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
+ "getPeriodicSyncs");
if (authority != null) {
for (Pair<Bundle, Long> item : authority.periodicSyncs) {
- syncs.add(new PeriodicSync(account, providerName, item.first, item.second));
+ syncs.add(new PeriodicSync(account, providerName, item.first,
+ item.second));
}
}
}
return syncs;
}
- public void setMasterSyncAutomatically(boolean flag) {
+ public void setMasterSyncAutomatically(boolean flag, int userId) {
synchronized (mAuthorities) {
- if (mMasterSyncAutomatically == flag) {
+ Boolean auto = mMasterSyncAutomatically.get(userId);
+ if (auto != null && (boolean) auto == flag) {
return;
}
- mMasterSyncAutomatically = flag;
+ mMasterSyncAutomatically.put(userId, flag);
writeAccountInfoLocked();
}
if (flag) {
- ContentResolver.requestSync(null, null, new Bundle());
+ requestSync(null, userId, null, new Bundle());
}
reportChange(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS);
mContext.sendBroadcast(SYNC_CONNECTION_SETTING_CHANGED_INTENT);
}
- public boolean getMasterSyncAutomatically() {
+ public boolean getMasterSyncAutomatically(int userId) {
synchronized (mAuthorities) {
- return mMasterSyncAutomatically;
+ Boolean auto = mMasterSyncAutomatically.get(userId);
+ return auto == null ? true : auto;
}
}
- public AuthorityInfo getOrCreateAuthority(Account account, String authority) {
+ public AuthorityInfo getOrCreateAuthority(Account account, int userId, String authority) {
synchronized (mAuthorities) {
- return getOrCreateAuthorityLocked(account, authority,
+ return getOrCreateAuthorityLocked(account, userId, authority,
-1 /* assign a new identifier if creating a new authority */,
true /* write to storage if this results in a change */);
}
}
- public void removeAuthority(Account account, String authority) {
+ public void removeAuthority(Account account, int userId, String authority) {
synchronized (mAuthorities) {
- removeAuthorityLocked(account, authority, true /* doWrite */);
+ removeAuthorityLocked(account, userId, authority, true /* doWrite */);
}
}
@@ -720,12 +776,13 @@
* Returns true if there is currently a sync operation for the given
* account or authority actively being processed.
*/
- public boolean isSyncActive(Account account, String authority) {
+ public boolean isSyncActive(Account account, int userId, String authority) {
synchronized (mAuthorities) {
- for (SyncInfo syncInfo : mCurrentSyncs) {
+ for (SyncInfo syncInfo : getCurrentSyncs(userId)) {
AuthorityInfo ainfo = getAuthority(syncInfo.authorityId);
if (ainfo != null && ainfo.account.equals(account)
- && ainfo.authority.equals(authority)) {
+ && ainfo.authority.equals(authority)
+ && ainfo.userId == userId) {
return true;
}
}
@@ -738,12 +795,13 @@
synchronized (mAuthorities) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "insertIntoPending: account=" + op.account
- + " auth=" + op.authority
- + " src=" + op.syncSource
- + " extras=" + op.extras);
+ + " user=" + op.userId
+ + " auth=" + op.authority
+ + " src=" + op.syncSource
+ + " extras=" + op.extras);
}
- AuthorityInfo authority = getOrCreateAuthorityLocked(op.account,
+ AuthorityInfo authority = getOrCreateAuthorityLocked(op.account, op.userId,
op.authority,
-1 /* desired identifier */,
true /* write accounts to storage */);
@@ -769,6 +827,7 @@
synchronized (mAuthorities) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "deleteFromPending: account=" + op.account
+ + " user=" + op.userId
+ " auth=" + op.authority
+ " src=" + op.syncSource
+ " extras=" + op.extras);
@@ -782,7 +841,7 @@
mNumPendingFinished++;
}
- AuthorityInfo authority = getAuthorityLocked(op.account, op.authority,
+ AuthorityInfo authority = getAuthorityLocked(op.account, op.userId, op.authority,
"deleteFromPending");
if (authority != null) {
if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "removing - " + authority);
@@ -791,7 +850,8 @@
for (int i=0; i<N; i++) {
PendingOperation cur = mPendingOperations.get(i);
if (cur.account.equals(op.account)
- && cur.authority.equals(op.authority)) {
+ && cur.authority.equals(op.authority)
+ && cur.userId == op.userId) {
morePending = true;
break;
}
@@ -812,24 +872,6 @@
return res;
}
- public int clearPending() {
- int num;
- synchronized (mAuthorities) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, "clearPending");
- }
- num = mPendingOperations.size();
- mPendingOperations.clear();
- final int N = mSyncStatus.size();
- for (int i=0; i<N; i++) {
- mSyncStatus.valueAt(i).pending = false;
- }
- writePendingOperationsLocked();
- }
- reportChange(ContentResolver.SYNC_OBSERVER_TYPE_PENDING);
- return num;
- }
-
/**
* Return a copy of the current array of pending operations. The
* PendingOperation objects are the real objects stored inside, so that
@@ -854,17 +896,18 @@
* Called when the set of account has changed, given the new array of
* active accounts.
*/
- public void doDatabaseCleanup(Account[] accounts) {
+ public void doDatabaseCleanup(Account[] accounts, int userId) {
synchronized (mAuthorities) {
if (Log.isLoggable(TAG, Log.VERBOSE)) Log.w(TAG, "Updating for new accounts...");
SparseArray<AuthorityInfo> removing = new SparseArray<AuthorityInfo>();
Iterator<AccountInfo> accIt = mAccounts.values().iterator();
while (accIt.hasNext()) {
AccountInfo acc = accIt.next();
- if (!ArrayUtils.contains(accounts, acc.account)) {
+ if (!ArrayUtils.contains(accounts, acc.accountAndUser.account)
+ && acc.accountAndUser.userId == userId) {
// This account no longer exists...
if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.w(TAG, "Account removed: " + acc.account);
+ Log.w(TAG, "Account removed: " + acc.accountAndUser);
}
for (AuthorityInfo auth : acc.authorities.values()) {
removing.put(auth.ident, auth);
@@ -919,13 +962,14 @@
}
AuthorityInfo authority = getOrCreateAuthorityLocked(
activeSyncContext.mSyncOperation.account,
+ activeSyncContext.mSyncOperation.userId,
activeSyncContext.mSyncOperation.authority,
-1 /* assign a new identifier if creating a new authority */,
true /* write to storage if this results in a change */);
syncInfo = new SyncInfo(authority.ident,
authority.account, authority.authority,
activeSyncContext.mStartTime);
- mCurrentSyncs.add(syncInfo);
+ getCurrentSyncs(authority.userId).add(syncInfo);
}
reportActiveChange();
@@ -935,13 +979,14 @@
/**
* Called to indicate that a previously active sync is no longer active.
*/
- public void removeActiveSync(SyncInfo syncInfo) {
+ public void removeActiveSync(SyncInfo syncInfo, int userId) {
synchronized (mAuthorities) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, "removeActiveSync: account="
- + syncInfo.account + " auth=" + syncInfo.authority);
+ Log.v(TAG, "removeActiveSync: account=" + syncInfo.account
+ + " user=" + userId
+ + " auth=" + syncInfo.authority);
}
- mCurrentSyncs.remove(syncInfo);
+ getCurrentSyncs(userId).remove(syncInfo);
}
reportActiveChange();
@@ -957,15 +1002,15 @@
/**
* Note that sync has started for the given account and authority.
*/
- public long insertStartSyncEvent(Account accountName, String authorityName,
+ public long insertStartSyncEvent(Account accountName, int userId, String authorityName,
long now, int source) {
long id;
synchronized (mAuthorities) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, "insertStartSyncEvent: account=" + accountName
+ Log.v(TAG, "insertStartSyncEvent: account=" + accountName + "user=" + userId
+ " auth=" + authorityName + " source=" + source);
}
- AuthorityInfo authority = getAuthorityLocked(accountName, authorityName,
+ AuthorityInfo authority = getAuthorityLocked(accountName, userId, authorityName,
"insertStartSyncEvent");
if (authority == null) {
return -1;
@@ -1119,9 +1164,14 @@
* Return a list of the currently active syncs. Note that the returned items are the
* real, live active sync objects, so be careful what you do with it.
*/
- public List<SyncInfo> getCurrentSyncs() {
+ public List<SyncInfo> getCurrentSyncs(int userId) {
synchronized (mAuthorities) {
- return new ArrayList<SyncInfo>(mCurrentSyncs);
+ ArrayList<SyncInfo> syncs = mCurrentSyncs.get(userId);
+ if (syncs == null) {
+ syncs = new ArrayList<SyncInfo>();
+ mCurrentSyncs.put(userId, syncs);
+ }
+ return new ArrayList<SyncInfo>(syncs);
}
}
@@ -1164,7 +1214,8 @@
* @param authority the authority whose row should be selected
* @return the SyncStatusInfo for the authority
*/
- public SyncStatusInfo getStatusByAccountAndAuthority(Account account, String authority) {
+ public SyncStatusInfo getStatusByAccountAndAuthority(Account account, int userId,
+ String authority) {
if (account == null || authority == null) {
throw new IllegalArgumentException();
}
@@ -1174,8 +1225,9 @@
SyncStatusInfo cur = mSyncStatus.valueAt(i);
AuthorityInfo ainfo = mAuthorities.get(cur.authorityId);
- if (ainfo != null && ainfo.authority.equals(authority) &&
- account.equals(ainfo.account)) {
+ if (ainfo != null && ainfo.authority.equals(authority)
+ && ainfo.userId == userId
+ && account.equals(ainfo.account)) {
return cur;
}
}
@@ -1186,7 +1238,7 @@
/**
* Return true if the pending status is true of any matching authorities.
*/
- public boolean isSyncPending(Account account, String authority) {
+ public boolean isSyncPending(Account account, int userId, String authority) {
synchronized (mAuthorities) {
final int N = mSyncStatus.size();
for (int i=0; i<N; i++) {
@@ -1195,6 +1247,9 @@
if (ainfo == null) {
continue;
}
+ if (userId != ainfo.userId) {
+ continue;
+ }
if (account != null && !ainfo.account.equals(account)) {
continue;
}
@@ -1235,34 +1290,6 @@
}
}
- /**
- * If sync is failing for any of the provider/accounts then determine the time at which it
- * started failing and return the earliest time over all the provider/accounts. If none are
- * failing then return 0.
- */
- public long getInitialSyncFailureTime() {
- synchronized (mAuthorities) {
- if (!mMasterSyncAutomatically) {
- return 0;
- }
-
- long oldest = 0;
- int i = mSyncStatus.size();
- while (i > 0) {
- i--;
- SyncStatusInfo stats = mSyncStatus.valueAt(i);
- AuthorityInfo authority = mAuthorities.get(stats.authorityId);
- if (authority != null && authority.enabled) {
- if (oldest == 0 || stats.initialFailureTime < oldest) {
- oldest = stats.initialFailureTime;
- }
- }
- }
-
- return oldest;
- }
- }
-
private int getCurrentDayLocked() {
mCal.setTimeInMillis(System.currentTimeMillis());
final int dayOfYear = mCal.get(Calendar.DAY_OF_YEAR);
@@ -1283,18 +1310,19 @@
* @param tag If non-null, this will be used in a log message if the
* requested authority does not exist.
*/
- private AuthorityInfo getAuthorityLocked(Account accountName, String authorityName,
+ private AuthorityInfo getAuthorityLocked(Account accountName, int userId, String authorityName,
String tag) {
- AccountInfo account = mAccounts.get(accountName);
- if (account == null) {
+ AccountAndUser au = new AccountAndUser(accountName, userId);
+ AccountInfo accountInfo = mAccounts.get(au);
+ if (accountInfo == null) {
if (tag != null) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, tag + ": unknown account " + accountName);
+ Log.v(TAG, tag + ": unknown account " + au);
}
}
return null;
}
- AuthorityInfo authority = account.authorities.get(authorityName);
+ AuthorityInfo authority = accountInfo.authorities.get(authorityName);
if (authority == null) {
if (tag != null) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
@@ -1307,12 +1335,13 @@
return authority;
}
- private AuthorityInfo getOrCreateAuthorityLocked(Account accountName,
+ private AuthorityInfo getOrCreateAuthorityLocked(Account accountName, int userId,
String authorityName, int ident, boolean doWrite) {
- AccountInfo account = mAccounts.get(accountName);
+ AccountAndUser au = new AccountAndUser(accountName, userId);
+ AccountInfo account = mAccounts.get(au);
if (account == null) {
- account = new AccountInfo(accountName);
- mAccounts.put(accountName, account);
+ account = new AccountInfo(au);
+ mAccounts.put(au, account);
}
AuthorityInfo authority = account.authorities.get(authorityName);
if (authority == null) {
@@ -1323,9 +1352,10 @@
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "created a new AuthorityInfo for " + accountName
- + ", provider " + authorityName);
+ + ", user " + userId
+ + ", provider " + authorityName);
}
- authority = new AuthorityInfo(accountName, authorityName, ident);
+ authority = new AuthorityInfo(accountName, userId, authorityName, ident);
account.authorities.put(authorityName, authority);
mAuthorities.put(ident, authority);
if (doWrite) {
@@ -1336,8 +1366,9 @@
return authority;
}
- private void removeAuthorityLocked(Account account, String authorityName, boolean doWrite) {
- AccountInfo accountInfo = mAccounts.get(account);
+ private void removeAuthorityLocked(Account account, int userId, String authorityName,
+ boolean doWrite) {
+ AccountInfo accountInfo = mAccounts.get(new AccountAndUser(account, userId));
if (accountInfo != null) {
final AuthorityInfo authorityInfo = accountInfo.authorities.remove(authorityName);
if (authorityInfo != null) {
@@ -1419,8 +1450,7 @@
}
String tagName = parser.getName();
if ("accounts".equals(tagName)) {
- String listen = parser.getAttributeValue(
- null, "listen-for-tickles");
+ String listen = parser.getAttributeValue(null, XML_ATTR_LISTEN_FOR_TICKLES);
String versionString = parser.getAttributeValue(null, "version");
int version;
try {
@@ -1428,14 +1458,14 @@
} catch (NumberFormatException e) {
version = 0;
}
- String nextIdString = parser.getAttributeValue(null, "nextAuthorityId");
+ String nextIdString = parser.getAttributeValue(null, XML_ATTR_NEXT_AUTHORITY_ID);
try {
int id = (nextIdString == null) ? 0 : Integer.parseInt(nextIdString);
mNextAuthorityId = Math.max(mNextAuthorityId, id);
} catch (NumberFormatException e) {
// don't care
}
- mMasterSyncAutomatically = listen == null || Boolean.parseBoolean(listen);
+ mMasterSyncAutomatically.put(0, listen == null || Boolean.parseBoolean(listen));
eventType = parser.next();
AuthorityInfo authority = null;
Pair<Bundle, Long> periodicSync = null;
@@ -1449,6 +1479,8 @@
if (authority.ident > highestAuthorityId) {
highestAuthorityId = authority.ident;
}
+ } else if (XML_TAG_LISTEN_FOR_TICKLES.equals(tagName)) {
+ parseListenForTickles(parser);
}
} else if (parser.getDepth() == 3) {
if ("periodicSync".equals(tagName) && authority != null) {
@@ -1511,25 +1543,41 @@
}
// if we already have a record of this new authority then don't copy over the settings
- if (getAuthorityLocked(authority.account, newAuthorityName, "cleanup") != null) {
+ if (getAuthorityLocked(authority.account, authority.userId, newAuthorityName, "cleanup")
+ != null) {
continue;
}
AuthorityInfo newAuthority = getOrCreateAuthorityLocked(authority.account,
- newAuthorityName, -1 /* ident */, false /* doWrite */);
+ authority.userId, newAuthorityName, -1 /* ident */, false /* doWrite */);
newAuthority.enabled = true;
writeNeeded = true;
}
for (AuthorityInfo authorityInfo : authoritiesToRemove) {
- removeAuthorityLocked(authorityInfo.account, authorityInfo.authority,
- false /* doWrite */);
+ removeAuthorityLocked(authorityInfo.account, authorityInfo.userId,
+ authorityInfo.authority, false /* doWrite */);
writeNeeded = true;
}
return writeNeeded;
}
+ private void parseListenForTickles(XmlPullParser parser) {
+ String user = parser.getAttributeValue(null, XML_ATTR_USER);
+ int userId = 0;
+ try {
+ userId = Integer.parseInt(user);
+ } catch (NumberFormatException e) {
+ Log.e(TAG, "error parsing the user for listen-for-tickles", e);
+ } catch (NullPointerException e) {
+ Log.e(TAG, "the user in listen-for-tickles is null", e);
+ }
+ String enabled = parser.getAttributeValue(null, XML_ATTR_ENABLED);
+ boolean listen = enabled == null || Boolean.parseBoolean(enabled);
+ mMasterSyncAutomatically.put(userId, listen);
+ }
+
private AuthorityInfo parseAuthority(XmlPullParser parser, int version) {
AuthorityInfo authority = null;
int id = -1;
@@ -1543,10 +1591,12 @@
}
if (id >= 0) {
String authorityName = parser.getAttributeValue(null, "authority");
- String enabled = parser.getAttributeValue(null, "enabled");
+ String enabled = parser.getAttributeValue(null, XML_ATTR_ENABLED);
String syncable = parser.getAttributeValue(null, "syncable");
String accountName = parser.getAttributeValue(null, "account");
String accountType = parser.getAttributeValue(null, "type");
+ String user = parser.getAttributeValue(null, XML_ATTR_USER);
+ int userId = user == null ? 0 : Integer.parseInt(user);
if (accountType == null) {
accountType = "com.google";
syncable = "unknown";
@@ -1554,12 +1604,13 @@
authority = mAuthorities.get(id);
if (DEBUG_FILE) Log.v(TAG, "Adding authority: account="
+ accountName + " auth=" + authorityName
+ + " user=" + userId
+ " enabled=" + enabled
+ " syncable=" + syncable);
if (authority == null) {
if (DEBUG_FILE) Log.v(TAG, "Creating entry");
authority = getOrCreateAuthorityLocked(
- new Account(accountName, accountType), authorityName, id, false);
+ new Account(accountName, accountType), userId, authorityName, id, false);
// If the version is 0 then we are upgrading from a file format that did not
// know about periodic syncs. In that case don't clear the list since we
// want the default, which is a daily periodioc sync.
@@ -1653,9 +1704,17 @@
out.startTag(null, "accounts");
out.attribute(null, "version", Integer.toString(ACCOUNTS_VERSION));
- out.attribute(null, "nextAuthorityId", Integer.toString(mNextAuthorityId));
- if (!mMasterSyncAutomatically) {
- out.attribute(null, "listen-for-tickles", "false");
+ out.attribute(null, XML_ATTR_NEXT_AUTHORITY_ID, Integer.toString(mNextAuthorityId));
+
+ // Write the Sync Automatically flags for each user
+ final int M = mMasterSyncAutomatically.size();
+ for (int m = 0; m < M; m++) {
+ int userId = mMasterSyncAutomatically.keyAt(m);
+ Boolean listen = mMasterSyncAutomatically.valueAt(m);
+ out.startTag(null, XML_TAG_LISTEN_FOR_TICKLES);
+ out.attribute(null, XML_ATTR_USER, Integer.toString(userId));
+ out.attribute(null, XML_ATTR_ENABLED, Boolean.toString(listen));
+ out.endTag(null, XML_TAG_LISTEN_FOR_TICKLES);
}
final int N = mAuthorities.size();
@@ -1664,9 +1723,10 @@
out.startTag(null, "authority");
out.attribute(null, "id", Integer.toString(authority.ident));
out.attribute(null, "account", authority.account.name);
+ out.attribute(null, XML_ATTR_USER, Integer.toString(authority.userId));
out.attribute(null, "type", authority.account.type);
out.attribute(null, "authority", authority.authority);
- out.attribute(null, "enabled", Boolean.toString(authority.enabled));
+ out.attribute(null, XML_ATTR_ENABLED, Boolean.toString(authority.enabled));
if (authority.syncable < 0) {
out.attribute(null, "syncable", "unknown");
} else {
@@ -1788,7 +1848,7 @@
}
String authorityName = c.getString(c.getColumnIndex("authority"));
AuthorityInfo authority = this.getOrCreateAuthorityLocked(
- new Account(accountName, accountType),
+ new Account(accountName, accountType), 0 /* legacy is single-user */,
authorityName, -1, false);
if (authority != null) {
int i = mSyncStatus.size();
@@ -1833,7 +1893,7 @@
String value = c.getString(c.getColumnIndex("value"));
if (name == null) continue;
if (name.equals("listen_for_tickles")) {
- setMasterSyncAutomatically(value == null || Boolean.parseBoolean(value));
+ setMasterSyncAutomatically(value == null || Boolean.parseBoolean(value), 0);
} else if (name.startsWith("sync_provider_")) {
String provider = name.substring("sync_provider_".length(),
name.length());
@@ -1964,7 +2024,7 @@
extras = new Bundle();
}
PendingOperation op = new PendingOperation(
- authority.account, syncSource,
+ authority.account, authority.userId, syncSource,
authority.authority, extras, expedited);
op.authorityId = authorityId;
op.flatExtras = flatExtras;
@@ -2084,6 +2144,19 @@
return bundle;
}
+ private void requestSync(Account account, int userId, String authority, Bundle extras) {
+ // If this is happening in the system process, then call the syncrequest listener
+ // to make a request back to the SyncManager directly.
+ // If this is probably a test instance, then call back through the ContentResolver
+ // which will know which userId to apply based on the Binder id.
+ if (android.os.Process.myUid() == android.os.Process.SYSTEM_UID
+ && mSyncRequestListener != null) {
+ mSyncRequestListener.onSyncRequest(account, userId, authority, extras);
+ } else {
+ ContentResolver.requestSync(account, authority, extras);
+ }
+ }
+
public static final int STATISTICS_FILE_END = 0;
public static final int STATISTICS_FILE_ITEM_OLD = 100;
public static final int STATISTICS_FILE_ITEM = 101;
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index cca208a..573e6ea 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -36,7 +36,6 @@
import java.util.List;
import java.util.StringTokenizer;
-
/**
* The Camera class is used to set image capture settings, start/stop preview,
* snap pictures, and retrieve frames for encoding for video. This class is a
diff --git a/core/java/android/hardware/CameraSound.java b/core/java/android/hardware/CameraSound.java
deleted file mode 100644
index dc97ff09..0000000
--- a/core/java/android/hardware/CameraSound.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (C) 2011 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 android.hardware;
-
-import android.media.AudioManager;
-import android.media.MediaPlayer;
-import android.os.SystemProperties;
-import android.util.Log;
-
-import java.io.IOException;
-
-/**
- * <p>Use this class to play an appropriate sound when implementing a custom
- * still or video recording mechanism through the preview callbacks.</p>
- *
- * <p>There is no need to play sounds when using {@link #android.hardware.Camera#takePicture}
- * or {@link android.media.MediaRecorder} for still images or video,
- * respectively, as these play their own sounds when needed.</p>
- *
- * @hide
- */
-public class CameraSound {
- private static final String TAG = "CameraSound";
- /**
- * The sound used by {@link android.hardware.Camera#takePicture} to
- * indicate still image capture.
- */
- public static final int SHUTTER_CLICK = 0;
-
- /**
- * A sound to indicate that focusing has completed. Because deciding
- * when this occurs is application-dependent, this sound is not used by
- * any methods in the Camera class.
- */
- public static final int FOCUS_COMPLETE = 1;
-
- /**
- * The sound used by {@link android.media.MediaRecorder#start} to
- * indicate the start of video recording.
- */
- public static final int START_VIDEO_RECORDING = 2;
-
- /**
- * The sound used by {@link android.media.MediaRecorder#stop} to
- * indicate the end of video recording.
- */
- public static final int STOP_VIDEO_RECORDING = 3;
-
- private static final int NUM_SOUNDS = 4;
- private CameraSoundPlayer[] mCameraSoundPlayers;
-
- public CameraSound() {
- }
-
- /**
- * <p>Play one of the predefined platform sounds for camera actions.</p>
- *
- * <p>Use this method to play a platform-specific sound for various camera
- * actions. The sound playing is done asynchronously, with the same behavior
- * and content as the sounds played by {@link #takePicture takePicture},
- * {@link android.media.MediaRecorder#start MediaRecorder.start}, and
- * {@link android.media.MediaRecorder#stop MediaRecorder.stop}.</p>
- *
- * <p>Using this method makes it easy to match the default device sounds
- * when recording or capturing data through the preview callbacks.</p>
- *
- * @param soundId The type of sound to play, selected from SHUTTER_CLICK,
- * FOCUS_COMPLETE, START_VIDEO_RECORDING, or STOP_VIDEO_RECORDING.
- * @see android.hardware#takePicture
- * @see android.media.MediaRecorder
- * @see #SHUTTER_CLICK
- * @see #FOCUS_COMPLETE
- * @see #START_VIDEO_RECORDING
- * @see #STOP_VIDEO_RECORDING
- */
- public void playSound(int soundId) {
- if (mCameraSoundPlayers == null) {
- mCameraSoundPlayers = new CameraSoundPlayer[NUM_SOUNDS];
- }
- if (mCameraSoundPlayers[soundId] == null) {
- mCameraSoundPlayers[soundId] = new CameraSoundPlayer(soundId);
- }
- mCameraSoundPlayers[soundId].play();
- }
-
- public void release() {
- if (mCameraSoundPlayers != null) {
- for (CameraSoundPlayer csp: mCameraSoundPlayers) {
- if (csp != null) {
- csp.release();
- }
- }
- mCameraSoundPlayers = null;
- }
- }
-
- private static class CameraSoundPlayer implements Runnable {
- private int mSoundId;
- private MediaPlayer mPlayer;
- private Thread mThread;
- private boolean mExit;
- private int mPlayCount;
-
- private static final String mShutterSound =
- "/system/media/audio/ui/camera_click.ogg";
- private static final String mFocusSound =
- "/system/media/audio/ui/camera_focus.ogg";
- private static final String mVideoStartSound =
- "/system/media/audio/ui/VideoRecord.ogg";
- private static final String mVideoStopSound =
- "/system/media/audio/ui/VideoRecord.ogg";
-
- @Override
- public void run() {
- String soundFilePath;
- switch (mSoundId) {
- case SHUTTER_CLICK:
- soundFilePath = mShutterSound;
- break;
- case FOCUS_COMPLETE:
- soundFilePath = mFocusSound;
- break;
- case START_VIDEO_RECORDING:
- soundFilePath = mVideoStartSound;
- break;
- case STOP_VIDEO_RECORDING:
- soundFilePath = mVideoStopSound;
- break;
- default:
- Log.e(TAG, "Unknown sound " + mSoundId + " requested.");
- return;
- }
- mPlayer = new MediaPlayer();
- try {
- mPlayer.setAudioStreamType(AudioManager.STREAM_SYSTEM_ENFORCED);
- mPlayer.setDataSource(soundFilePath);
- mPlayer.setLooping(false);
- mPlayer.prepare();
- } catch(IOException e) {
- Log.e(TAG, "Error setting up sound " + mSoundId, e);
- return;
- }
-
- while(true) {
- try {
- synchronized (this) {
- while(true) {
- if (mExit) {
- return;
- } else if (mPlayCount <= 0) {
- wait();
- } else {
- mPlayCount--;
- break;
- }
- }
- }
- mPlayer.start();
- } catch (Exception e) {
- Log.e(TAG, "Error playing sound " + mSoundId, e);
- }
- }
- }
-
- public CameraSoundPlayer(int soundId) {
- mSoundId = soundId;
- }
-
- public void play() {
- if (mThread == null) {
- mThread = new Thread(this);
- mThread.start();
- }
- synchronized (this) {
- mPlayCount++;
- notifyAll();
- }
- }
-
- public void release() {
- if (mThread != null) {
- synchronized (this) {
- mExit = true;
- notifyAll();
- }
- try {
- mThread.join();
- } catch (InterruptedException e) {
- }
- mThread = null;
- }
- if (mPlayer != null) {
- mPlayer.release();
- mPlayer = null;
- }
- }
-
- @Override
- protected void finalize() {
- release();
- }
- }
-}
\ No newline at end of file
diff --git a/core/java/android/net/http/CertificateChainValidator.java b/core/java/android/net/http/CertificateChainValidator.java
index 06c6c6e..6ad8fe3 100644
--- a/core/java/android/net/http/CertificateChainValidator.java
+++ b/core/java/android/net/http/CertificateChainValidator.java
@@ -18,6 +18,8 @@
import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.KeyManagementException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
@@ -128,10 +130,13 @@
*/
public static void handleTrustStorageUpdate() {
- X509TrustManager x509TrustManager = SSLParametersImpl.getDefaultTrustManager();
- if( x509TrustManager instanceof TrustManagerImpl ) {
- TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
- trustManager.handleTrustStorageUpdate();
+ try {
+ X509TrustManager x509TrustManager = SSLParametersImpl.getDefaultTrustManager();
+ if( x509TrustManager instanceof TrustManagerImpl ) {
+ TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
+ trustManager.handleTrustStorageUpdate();
+ }
+ } catch (KeyManagementException ignored) {
}
}
@@ -165,7 +170,7 @@
try {
SSLParametersImpl.getDefaultTrustManager().checkServerTrusted(chain, authType);
return null; // No errors.
- } catch (CertificateException e) {
+ } catch (GeneralSecurityException e) {
if (HttpLog.LOGV) {
HttpLog.v("failed to validate the certificate chain, error: " +
e.getMessage());
diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java
index 215e836..6c1445d 100644
--- a/core/java/android/os/FileUtils.java
+++ b/core/java/android/os/FileUtils.java
@@ -28,6 +28,8 @@
import java.util.zip.CRC32;
import java.util.zip.CheckedInputStream;
+import libcore.io.Os;
+import libcore.io.StructStat;
/**
* Tools for managing files. Not for public consumption.
@@ -52,8 +54,10 @@
/**
* File status information. This class maps directly to the POSIX stat structure.
+ * @deprecated use {@link StructStat} instead.
* @hide
*/
+ @Deprecated
public static final class FileStatus {
public int dev;
public int ino;
@@ -77,7 +81,9 @@
* exists.
* @return true if the file exists and false if it does not exist. If you do not have
* permission to stat the file, then this method will return false.
+ * @deprecated use {@link Os#stat(String)} instead.
*/
+ @Deprecated
public static boolean getFileStatus(String path, FileStatus status) {
StrictMode.noteDiskRead();
return getFileStatusNative(path, status);
@@ -90,6 +96,10 @@
public static native int setPermissions(String file, int mode, int uid, int gid);
+ /**
+ * @deprecated use {@link Os#stat(String)} instead.
+ */
+ @Deprecated
public static native int getPermissions(String file, int[] outPermissions);
public static native int setUMask(int mask);
diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java
index a0ad9c0..759be91 100644
--- a/core/java/android/os/StrictMode.java
+++ b/core/java/android/os/StrictMode.java
@@ -109,7 +109,7 @@
* effort mechanism. Notably, disk or network access from JNI calls
* won't necessarily trigger it. Future versions of Android may catch
* more (or fewer) operations, so you should never leave StrictMode
- * enabled in shipping applications on the Android Market.
+ * enabled in applications distributed on Google Play.
*/
public final class StrictMode {
private static final String TAG = "StrictMode";
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index b42417a..bc6594b 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2644,10 +2644,10 @@
/**
* Whether the package installer should allow installation of apps downloaded from
- * sources other than the Android Market (vending machine).
+ * sources other than Google Play.
*
* 1 = allow installing from other sources
- * 0 = only allow installing from the Android Market
+ * 0 = only allow installing from Google Play
*/
public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
diff --git a/core/java/android/view/Choreographer.java b/core/java/android/view/Choreographer.java
index f4d7af9..10edc06 100644
--- a/core/java/android/view/Choreographer.java
+++ b/core/java/android/view/Choreographer.java
@@ -81,8 +81,8 @@
private static final int MSG_DO_ANIMATION = 0;
private static final int MSG_DO_DRAW = 1;
private static final int MSG_DO_SCHEDULE_VSYNC = 2;
- private static final int MSG_POST_DELAYED_ANIMATION = 3;
- private static final int MSG_POST_DELAYED_DRAW = 4;
+ private static final int MSG_DO_SCHEDULE_ANIMATION = 3;
+ private static final int MSG_DO_SCHEDULE_DRAW = 4;
private final Object mLock = new Object();
@@ -152,134 +152,158 @@
}
/**
+ * Subtracts typical frame delay time from a delay interval in milliseconds.
+ *
+ * This method can be used to compensate for animation delay times that have baked
+ * in assumptions about the frame delay. For example, it's quite common for code to
+ * assume a 60Hz frame time and bake in a 16ms delay. When we call
+ * {@link #postAnimationCallbackDelayed} we want to know how long to wait before
+ * posting the animation callback but let the animation timer take care of the remaining
+ * frame delay time.
+ *
+ * This method is somewhat conservative about how much of the frame delay it
+ * subtracts. It uses the same value returned by {@link #getFrameDelay} which by
+ * default is 10ms even though many parts of the system assume 16ms. Consequently,
+ * we might still wait 6ms before posting an animation callback that we want to run
+ * on the next frame, but this is much better than waiting a whole 16ms and likely
+ * missing the deadline.
+ *
+ * @param delayMillis The original delay time including an assumed frame delay.
+ * @return The adjusted delay time with the assumed frame delay subtracted out.
+ */
+ public static long subtractFrameDelay(long delayMillis) {
+ final long frameDelay = sFrameDelay;
+ return delayMillis <= frameDelay ? 0 : delayMillis - frameDelay;
+ }
+
+ /**
* Posts a callback to run on the next animation cycle.
* The callback only runs once and then is automatically removed.
*
- * @param runnable The callback to run during the next animation cycle.
+ * @param action The callback action to run during the next animation cycle.
+ * @param token The callback token, or null if none.
*
* @see #removeAnimationCallback
*/
- public void postAnimationCallback(Runnable runnable) {
- if (runnable == null) {
- throw new IllegalArgumentException("runnable must not be null");
- }
- postAnimationCallbackUnchecked(runnable);
- }
-
- private void postAnimationCallbackUnchecked(Runnable runnable) {
- synchronized (mLock) {
- mAnimationCallbacks = addCallbackLocked(mAnimationCallbacks, runnable);
- scheduleAnimationLocked();
- }
+ public void postAnimationCallback(Runnable action, Object token) {
+ postAnimationCallbackDelayed(action, token, 0);
}
/**
* Posts a callback to run on the next animation cycle following the specified delay.
* The callback only runs once and then is automatically removed.
*
- * @param runnable The callback to run during the next animation cycle following
+ * @param action The callback action to run during the next animation cycle after
* the specified delay.
+ * @param token The callback token, or null if none.
* @param delayMillis The delay time in milliseconds.
*
* @see #removeAnimationCallback
*/
- public void postAnimationCallbackDelayed(Runnable runnable, long delayMillis) {
- if (runnable == null) {
- throw new IllegalArgumentException("runnable must not be null");
+ public void postAnimationCallbackDelayed(Runnable action, Object token, long delayMillis) {
+ if (action == null) {
+ throw new IllegalArgumentException("action must not be null");
}
- if (delayMillis <= 0) {
- postAnimationCallbackUnchecked(runnable);
- } else {
- Message msg = mHandler.obtainMessage(MSG_POST_DELAYED_ANIMATION, runnable);
- mHandler.sendMessageDelayed(msg, delayMillis);
+
+ synchronized (mLock) {
+ final long now = SystemClock.uptimeMillis();
+ final long dueTime = now + delayMillis;
+ mAnimationCallbacks = addCallbackLocked(mAnimationCallbacks, dueTime, action, token);
+
+ if (dueTime <= now) {
+ scheduleAnimationLocked(now);
+ } else {
+ Message msg = mHandler.obtainMessage(MSG_DO_SCHEDULE_ANIMATION, action);
+ mHandler.sendMessageAtTime(msg, dueTime);
+ }
}
}
/**
- * Removes animation callbacks for the specified runnable.
- * Does nothing if the specified animation callback has not been posted or has already
- * been removed.
+ * Removes animation callbacks that have the specified action and token.
*
- * @param runnable The animation callback to remove.
+ * @param action The action property of the callbacks to remove, or null to remove
+ * callbacks with any action.
+ * @param token The token property of the callbacks to remove, or null to remove
+ * callbacks with any token.
*
* @see #postAnimationCallback
* @see #postAnimationCallbackDelayed
*/
- public void removeAnimationCallbacks(Runnable runnable) {
- if (runnable == null) {
- throw new IllegalArgumentException("runnable must not be null");
- }
+ public void removeAnimationCallbacks(Runnable action, Object token) {
synchronized (mLock) {
- mAnimationCallbacks = removeCallbacksLocked(mAnimationCallbacks, runnable);
+ mAnimationCallbacks = removeCallbacksLocked(mAnimationCallbacks, action, token);
+ if (action != null && token == null) {
+ mHandler.removeMessages(MSG_DO_SCHEDULE_ANIMATION, action);
+ }
}
- mHandler.removeMessages(MSG_POST_DELAYED_ANIMATION, runnable);
}
/**
* Posts a callback to run on the next draw cycle.
* The callback only runs once and then is automatically removed.
*
- * @param runnable The callback to run during the next draw cycle.
+ * @param action The callback action to run during the next draw cycle.
+ * @param token The callback token, or null if none.
*
* @see #removeDrawCallback
*/
- public void postDrawCallback(Runnable runnable) {
- if (runnable == null) {
- throw new IllegalArgumentException("runnable must not be null");
- }
- postDrawCallbackUnchecked(runnable);
- }
-
- private void postDrawCallbackUnchecked(Runnable runnable) {
- synchronized (mLock) {
- mDrawCallbacks = addCallbackLocked(mDrawCallbacks, runnable);
- scheduleDrawLocked();
- }
+ public void postDrawCallback(Runnable action, Object token) {
+ postDrawCallbackDelayed(action, token, 0);
}
/**
* Posts a callback to run on the next draw cycle following the specified delay.
* The callback only runs once and then is automatically removed.
*
- * @param runnable The callback to run during the next draw cycle following
+ * @param action The callback action to run during the next animation cycle after
* the specified delay.
+ * @param token The callback token, or null if none.
* @param delayMillis The delay time in milliseconds.
*
* @see #removeDrawCallback
*/
- public void postDrawCallbackDelayed(Runnable runnable, long delayMillis) {
- if (runnable == null) {
- throw new IllegalArgumentException("runnable must not be null");
+ public void postDrawCallbackDelayed(Runnable action, Object token, long delayMillis) {
+ if (action == null) {
+ throw new IllegalArgumentException("action must not be null");
}
- if (delayMillis <= 0) {
- postDrawCallbackUnchecked(runnable);
- } else {
- Message msg = mHandler.obtainMessage(MSG_POST_DELAYED_DRAW, runnable);
- mHandler.sendMessageDelayed(msg, delayMillis);
+
+ synchronized (mLock) {
+ final long now = SystemClock.uptimeMillis();
+ final long dueTime = now + delayMillis;
+ mDrawCallbacks = addCallbackLocked(mDrawCallbacks, dueTime, action, token);
+ scheduleDrawLocked(now);
+
+ if (dueTime <= now) {
+ scheduleDrawLocked(now);
+ } else {
+ Message msg = mHandler.obtainMessage(MSG_DO_SCHEDULE_DRAW, action);
+ mHandler.sendMessageAtTime(msg, dueTime);
+ }
}
}
/**
- * Removes draw callbacks for the specified runnable.
- * Does nothing if the specified draw callback has not been posted or has already
- * been removed.
+ * Removes draw callbacks that have the specified action and token.
*
- * @param runnable The draw callback to remove.
+ * @param action The action property of the callbacks to remove, or null to remove
+ * callbacks with any action.
+ * @param token The token property of the callbacks to remove, or null to remove
+ * callbacks with any token.
*
* @see #postDrawCallback
* @see #postDrawCallbackDelayed
*/
- public void removeDrawCallbacks(Runnable runnable) {
- if (runnable == null) {
- throw new IllegalArgumentException("runnable must not be null");
- }
+ public void removeDrawCallbacks(Runnable action, Object token) {
synchronized (mLock) {
- mDrawCallbacks = removeCallbacksLocked(mDrawCallbacks, runnable);
+ mDrawCallbacks = removeCallbacksLocked(mDrawCallbacks, action, token);
+ if (action != null && token == null) {
+ mHandler.removeMessages(MSG_DO_SCHEDULE_DRAW, action);
+ }
}
- mHandler.removeMessages(MSG_POST_DELAYED_DRAW, runnable);
}
- private void scheduleAnimationLocked() {
+ private void scheduleAnimationLocked(long now) {
if (!mAnimationScheduled) {
mAnimationScheduled = true;
if (USE_VSYNC) {
@@ -291,14 +315,13 @@
// otherwise post a message to schedule the vsync from the UI thread
// as soon as possible.
if (isRunningOnLooperThreadLocked()) {
- doScheduleVsyncLocked();
+ scheduleVsyncLocked();
} else {
Message msg = mHandler.obtainMessage(MSG_DO_SCHEDULE_VSYNC);
msg.setAsynchronous(true);
mHandler.sendMessageAtFrontOfQueue(msg);
}
} else {
- final long now = SystemClock.uptimeMillis();
final long nextAnimationTime = Math.max(mLastAnimationTime + sFrameDelay, now);
if (DEBUG) {
Log.d(TAG, "Scheduling animation in " + (nextAnimationTime - now) + " ms.");
@@ -310,18 +333,18 @@
}
}
- private void scheduleDrawLocked() {
+ private void scheduleDrawLocked(long now) {
if (!mDrawScheduled) {
mDrawScheduled = true;
if (USE_ANIMATION_TIMER_FOR_DRAW) {
- scheduleAnimationLocked();
+ scheduleAnimationLocked(now);
} else {
if (DEBUG) {
Log.d(TAG, "Scheduling draw immediately.");
}
Message msg = mHandler.obtainMessage(MSG_DO_DRAW);
msg.setAsynchronous(true);
- mHandler.sendMessage(msg);
+ mHandler.sendMessageAtTime(msg, now);
}
}
}
@@ -336,7 +359,7 @@
void doAnimationInner() {
final long start;
- final Callback callbacks;
+ Callback callbacks;
synchronized (mLock) {
if (!mAnimationScheduled) {
return; // no work to do
@@ -351,7 +374,23 @@
mLastAnimationTime = start;
callbacks = mAnimationCallbacks;
- mAnimationCallbacks = null;
+ if (callbacks != null) {
+ if (callbacks.dueTime > start) {
+ callbacks = null;
+ } else {
+ Callback predecessor = callbacks;
+ Callback successor = predecessor.next;
+ while (successor != null) {
+ if (successor.dueTime > start) {
+ predecessor.next = null;
+ break;
+ }
+ predecessor = successor;
+ successor = successor.next;
+ }
+ mAnimationCallbacks = successor;
+ }
+ }
}
if (callbacks != null) {
@@ -368,7 +407,7 @@
void doDraw() {
final long start;
- final Callback callbacks;
+ Callback callbacks;
synchronized (mLock) {
if (!mDrawScheduled) {
return; // no work to do
@@ -383,7 +422,23 @@
mLastDrawTime = start;
callbacks = mDrawCallbacks;
- mDrawCallbacks = null;
+ if (callbacks != null) {
+ if (callbacks.dueTime > start) {
+ callbacks = null;
+ } else {
+ Callback predecessor = callbacks;
+ Callback successor = predecessor.next;
+ while (successor != null) {
+ if (successor.dueTime > start) {
+ predecessor.next = null;
+ break;
+ }
+ predecessor = successor;
+ successor = successor.next;
+ }
+ mDrawCallbacks = successor;
+ }
+ }
}
if (callbacks != null) {
@@ -400,38 +455,66 @@
void doScheduleVsync() {
synchronized (mLock) {
- doScheduleVsyncLocked();
+ if (mAnimationScheduled) {
+ scheduleVsyncLocked();
+ }
}
}
- private void doScheduleVsyncLocked() {
- if (mAnimationScheduled) {
- mDisplayEventReceiver.scheduleVsync();
+ void doScheduleAnimation() {
+ synchronized (mLock) {
+ final long now = SystemClock.uptimeMillis();
+ if (mAnimationCallbacks != null && mAnimationCallbacks.dueTime <= now) {
+ scheduleAnimationLocked(now);
+ }
}
}
+ void doScheduleDraw() {
+ synchronized (mLock) {
+ final long now = SystemClock.uptimeMillis();
+ if (mDrawCallbacks != null && mDrawCallbacks.dueTime <= now) {
+ scheduleDrawLocked(now);
+ }
+ }
+ }
+
+ private void scheduleVsyncLocked() {
+ mDisplayEventReceiver.scheduleVsync();
+ }
+
private boolean isRunningOnLooperThreadLocked() {
return Looper.myLooper() == mLooper;
}
- private Callback addCallbackLocked(Callback head, Runnable runnable) {
- Callback callback = obtainCallbackLocked(runnable);
+ private Callback addCallbackLocked(Callback head,
+ long dueTime, Runnable action, Object token) {
+ Callback callback = obtainCallbackLocked(dueTime, action, token);
if (head == null) {
return callback;
}
- Callback tail = head;
- while (tail.next != null) {
- tail = tail.next;
+ Callback entry = head;
+ if (dueTime < entry.dueTime) {
+ callback.next = entry;
+ return callback;
}
- tail.next = callback;
+ while (entry.next != null) {
+ if (dueTime < entry.next.dueTime) {
+ callback.next = entry.next;
+ break;
+ }
+ entry = entry.next;
+ }
+ entry.next = callback;
return head;
}
- private Callback removeCallbacksLocked(Callback head, Runnable runnable) {
+ private Callback removeCallbacksLocked(Callback head, Runnable action, Object token) {
Callback predecessor = null;
for (Callback callback = head; callback != null;) {
final Callback next = callback.next;
- if (callback.runnable == runnable) {
+ if ((action == null || callback.action == action)
+ && (token == null || callback.token == token)) {
if (predecessor != null) {
predecessor.next = next;
} else {
@@ -448,7 +531,7 @@
private void runCallbacks(Callback head) {
while (head != null) {
- head.runnable.run();
+ head.action.run();
head = head.next;
}
}
@@ -461,7 +544,7 @@
}
}
- private Callback obtainCallbackLocked(Runnable runnable) {
+ private Callback obtainCallbackLocked(long dueTime, Runnable action, Object token) {
Callback callback = mCallbackPool;
if (callback == null) {
callback = new Callback();
@@ -469,12 +552,15 @@
mCallbackPool = callback.next;
callback.next = null;
}
- callback.runnable = runnable;
+ callback.dueTime = dueTime;
+ callback.action = action;
+ callback.token = token;
return callback;
}
private void recycleCallbackLocked(Callback callback) {
- callback.runnable = null;
+ callback.action = null;
+ callback.token = null;
callback.next = mCallbackPool;
mCallbackPool = callback;
}
@@ -496,11 +582,11 @@
case MSG_DO_SCHEDULE_VSYNC:
doScheduleVsync();
break;
- case MSG_POST_DELAYED_ANIMATION:
- postAnimationCallbackUnchecked((Runnable)msg.obj);
+ case MSG_DO_SCHEDULE_ANIMATION:
+ doScheduleAnimation();
break;
- case MSG_POST_DELAYED_DRAW:
- postDrawCallbackUnchecked((Runnable)msg.obj);
+ case MSG_DO_SCHEDULE_DRAW:
+ doScheduleDraw();
break;
}
}
@@ -519,6 +605,8 @@
private static final class Callback {
public Callback next;
- public Runnable runnable;
+ public long dueTime;
+ public Runnable action;
+ public Object token;
}
}
diff --git a/core/java/android/view/IWindow.aidl b/core/java/android/view/IWindow.aidl
index 715fa7b..497bc90b 100644
--- a/core/java/android/view/IWindow.aidl
+++ b/core/java/android/view/IWindow.aidl
@@ -49,6 +49,7 @@
boolean reportDraw, in Configuration newConfig);
void dispatchAppVisibility(boolean visible);
void dispatchGetNewSurface();
+ void dispatchScreenState(boolean on);
/**
* Tell the window that it is either gaining or losing focus. Keep it up
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 9457067..a651362 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1994,6 +1994,20 @@
public static final int FIND_VIEWS_WITH_ACCESSIBILITY_NODE_PROVIDERS = 0x00000004;
/**
+ * Indicates that the screen has changed state and is now off.
+ *
+ * @see #onScreenStateChanged(int)
+ */
+ public static final int SCREEN_STATE_OFF = 0x0;
+
+ /**
+ * Indicates that the screen has changed state and is now on.
+ *
+ * @see #onScreenStateChanged(int)
+ */
+ public static final int SCREEN_STATE_ON = 0x1;
+
+ /**
* Controls the over-scroll mode for this view.
* See {@link #overScrollBy(int, int, int, int, int, int, int, int, boolean)},
* {@link #OVER_SCROLL_ALWAYS}, {@link #OVER_SCROLL_IF_CONTENT_SCROLLS},
@@ -3093,13 +3107,13 @@
setBackgroundDrawable(background);
}
- mUserPaddingRelative = (startPadding >= 0 || endPadding >= 0);
-
// Cache user padding as we cannot fully resolve padding here (we dont have yet the resolved
// layout direction). Those cached values will be used later during padding resolution.
mUserPaddingStart = startPadding;
mUserPaddingEnd = endPadding;
+ updateUserPaddingRelative();
+
if (padding >= 0) {
leftPadding = padding;
topPadding = padding;
@@ -3146,6 +3160,10 @@
computeOpaqueFlags();
}
+ private void updateUserPaddingRelative() {
+ mUserPaddingRelative = (mUserPaddingStart >= 0 || mUserPaddingEnd >= 0);
+ }
+
/**
* Non-public constructor for use in testing
*/
@@ -8775,6 +8793,52 @@
}
/**
+ * <p>Causes the Runnable to execute on the next animation time step.
+ * The runnable will be run on the user interface thread.</p>
+ *
+ * <p>This method can be invoked from outside of the UI thread
+ * only when this View is attached to a window.</p>
+ *
+ * @param action The Runnable that will be executed.
+ *
+ * @hide
+ */
+ public void postOnAnimation(Runnable action) {
+ final AttachInfo attachInfo = mAttachInfo;
+ if (attachInfo != null) {
+ attachInfo.mViewRootImpl.mChoreographer.postAnimationCallback(action, null);
+ } else {
+ // Assume that post will succeed later
+ ViewRootImpl.getRunQueue().post(action);
+ }
+ }
+
+ /**
+ * <p>Causes the Runnable to execute on the next animation time step,
+ * after the specified amount of time elapses.
+ * The runnable will be run on the user interface thread.</p>
+ *
+ * <p>This method can be invoked from outside of the UI thread
+ * only when this View is attached to a window.</p>
+ *
+ * @param action The Runnable that will be executed.
+ * @param delayMillis The delay (in milliseconds) until the Runnable
+ * will be executed.
+ *
+ * @hide
+ */
+ public void postOnAnimationDelayed(Runnable action, long delayMillis) {
+ final AttachInfo attachInfo = mAttachInfo;
+ if (attachInfo != null) {
+ attachInfo.mViewRootImpl.mChoreographer.postAnimationCallbackDelayed(
+ action, null, delayMillis);
+ } else {
+ // Assume that post will succeed later
+ ViewRootImpl.getRunQueue().postDelayed(action, delayMillis);
+ }
+ }
+
+ /**
* <p>Removes the specified Runnable from the message queue.</p>
*
* <p>This method can be invoked from outside of the UI thread
@@ -8791,6 +8855,7 @@
final AttachInfo attachInfo = mAttachInfo;
if (attachInfo != null) {
attachInfo.mHandler.removeCallbacks(action);
+ attachInfo.mViewRootImpl.mChoreographer.removeAnimationCallbacks(action, null);
} else {
// Assume that post will succeed later
ViewRootImpl.getRunQueue().removeCallbacks(action);
@@ -9600,6 +9665,25 @@
}
/**
+ * @see #onScreenStateChanged(int)
+ */
+ void dispatchScreenStateChanged(int screenState) {
+ onScreenStateChanged(screenState);
+ }
+
+ /**
+ * This method is called whenever the state of the screen this view is
+ * attached to changes. A state change will usually occurs when the screen
+ * turns on or off (whether it happens automatically or the user does it
+ * manually.)
+ *
+ * @param screenState The new state of the screen. Can be either
+ * {@link #SCREEN_STATE_ON} or {@link #SCREEN_STATE_OFF}
+ */
+ public void onScreenStateChanged(int screenState) {
+ }
+
+ /**
* Resolve and cache the layout direction. LTR is set initially. This is implicitly supposing
* that the parent directionality can and will be resolved before its children.
*/
@@ -9644,6 +9728,8 @@
// Set to resolved
mPrivateFlags2 |= LAYOUT_DIRECTION_RESOLVED;
onResolvedLayoutDirectionChanged();
+ // Resolve padding
+ resolvePadding();
}
/**
@@ -9698,7 +9784,11 @@
mUserPaddingBottom = (mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
- recomputePadding();
+ if(isPaddingRelative()) {
+ setPaddingRelative(mUserPaddingStart, mPaddingTop, mUserPaddingEnd, mUserPaddingBottom);
+ } else {
+ recomputePadding();
+ }
onPaddingChanged(resolvedLayoutDirection);
}
@@ -11837,10 +11927,12 @@
*/
public void scheduleDrawable(Drawable who, Runnable what, long when) {
if (verifyDrawable(who) && what != null) {
+ final long delay = when - SystemClock.uptimeMillis();
if (mAttachInfo != null) {
- mAttachInfo.mHandler.postAtTime(what, who, when);
+ mAttachInfo.mViewRootImpl.mChoreographer.postAnimationCallbackDelayed(
+ what, who, Choreographer.subtractFrameDelay(delay));
} else {
- ViewRootImpl.getRunQueue().postDelayed(what, when - SystemClock.uptimeMillis());
+ ViewRootImpl.getRunQueue().postDelayed(what, delay);
}
}
}
@@ -11854,7 +11946,7 @@
public void unscheduleDrawable(Drawable who, Runnable what) {
if (verifyDrawable(who) && what != null) {
if (mAttachInfo != null) {
- mAttachInfo.mHandler.removeCallbacks(what, who);
+ mAttachInfo.mViewRootImpl.mChoreographer.removeAnimationCallbacks(what, who);
} else {
ViewRootImpl.getRunQueue().removeCallbacks(what);
}
@@ -11872,7 +11964,7 @@
*/
public void unscheduleDrawable(Drawable who) {
if (mAttachInfo != null) {
- mAttachInfo.mHandler.removeCallbacksAndMessages(who);
+ mAttachInfo.mViewRootImpl.mChoreographer.removeAnimationCallbacks(null, who);
}
}
@@ -12233,15 +12325,20 @@
* @param bottom the bottom padding in pixels
*/
public void setPadding(int left, int top, int right, int bottom) {
- boolean changed = false;
-
+ mUserPaddingStart = -1;
+ mUserPaddingEnd = -1;
mUserPaddingRelative = false;
+ internalSetPadding(left, top, right, bottom);
+ }
+
+ private void internalSetPadding(int left, int top, int right, int bottom) {
mUserPaddingLeft = left;
mUserPaddingRight = right;
mUserPaddingBottom = bottom;
final int viewFlags = mViewFlags;
+ boolean changed = false;
// Common case is there are no scroll bars.
if ((viewFlags & (SCROLLBARS_VERTICAL|SCROLLBARS_HORIZONTAL)) != 0) {
@@ -12310,18 +12407,17 @@
* @param bottom the bottom padding in pixels
*/
public void setPaddingRelative(int start, int top, int end, int bottom) {
- mUserPaddingRelative = true;
-
mUserPaddingStart = start;
mUserPaddingEnd = end;
+ mUserPaddingRelative = true;
switch(getResolvedLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
- setPadding(end, top, start, bottom);
+ internalSetPadding(end, top, start, bottom);
break;
case LAYOUT_DIRECTION_LTR:
default:
- setPadding(start, top, end, bottom);
+ internalSetPadding(start, top, end, bottom);
}
}
@@ -14871,6 +14967,8 @@
boolean mHardwareAccelerationRequested;
HardwareRenderer mHardwareRenderer;
+ boolean mScreenOn;
+
/**
* Scale factor used by the compatibility mode
*/
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 0c63286..c9e0242 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -2254,6 +2254,17 @@
}
@Override
+ void dispatchScreenStateChanged(int screenState) {
+ super.dispatchScreenStateChanged(screenState);
+
+ final int count = mChildrenCount;
+ final View[] children = mChildren;
+ for (int i = 0; i < count; i++) {
+ children[i].dispatchScreenStateChanged(screenState);
+ }
+ }
+
+ @Override
boolean dispatchPopulateAccessibilityEventInternal(AccessibilityEvent event) {
boolean handled = super.dispatchPopulateAccessibilityEventInternal(event);
if (handled) {
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 80d4c53..72365c7 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -46,6 +46,7 @@
import android.os.Looper;
import android.os.Message;
import android.os.ParcelFileDescriptor;
+import android.os.PowerManager;
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
@@ -390,6 +391,9 @@
mProfileRendering = Boolean.parseBoolean(
SystemProperties.get(PROPERTY_PROFILE_RENDERING, "false"));
mChoreographer = Choreographer.getInstance();
+
+ PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
+ mAttachInfo.mScreenOn = powerManager.isScreenOn();
}
/**
@@ -757,6 +761,19 @@
scheduleTraversals();
}
+ void handleScreenStateChange(boolean on) {
+ if (on != mAttachInfo.mScreenOn) {
+ mAttachInfo.mScreenOn = on;
+ if (mView != null) {
+ mView.dispatchScreenStateChanged(on ? View.SCREEN_STATE_ON : View.SCREEN_STATE_OFF);
+ }
+ if (on) {
+ mFullRedrawNeeded = true;
+ scheduleTraversals();
+ }
+ }
+ }
+
/**
* {@inheritDoc}
*/
@@ -867,7 +884,7 @@
void scheduleFrame() {
if (!mFrameScheduled) {
mFrameScheduled = true;
- mChoreographer.postDrawCallback(mFrameRunnable);
+ mChoreographer.postDrawCallback(mFrameRunnable, null);
}
}
@@ -876,7 +893,7 @@
if (mFrameScheduled) {
mFrameScheduled = false;
- mChoreographer.removeDrawCallbacks(mFrameRunnable);
+ mChoreographer.removeDrawCallbacks(mFrameRunnable, null);
}
}
@@ -1886,6 +1903,8 @@
}
private void performDraw() {
+ if (!mAttachInfo.mScreenOn) return;
+
final long drawStartTime;
if (ViewDebug.DEBUG_LATENCY) {
drawStartTime = System.nanoTime();
@@ -2018,8 +2037,7 @@
}
if (!dirty.isEmpty() || mIsAnimating) {
- if (mAttachInfo.mHardwareRenderer != null
- && mAttachInfo.mHardwareRenderer.isEnabled()) {
+ if (mAttachInfo.mHardwareRenderer != null && mAttachInfo.mHardwareRenderer.isEnabled()) {
// Draw with hardware renderer.
mIsAnimating = false;
mHardwareYOffset = yoff;
@@ -2485,6 +2503,7 @@
private final static int MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_VIEW_ID = 21;
private final static int MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_TEXT = 22;
private final static int MSG_PROCESS_INPUT_EVENTS = 23;
+ private final static int MSG_DISPATCH_SCREEN_STATE = 24;
final class ViewRootHandler extends Handler {
@Override
@@ -2741,6 +2760,11 @@
.findAccessibilityNodeInfosByTextUiThread(msg);
}
} break;
+ case MSG_DISPATCH_SCREEN_STATE: {
+ if (mView != null) {
+ handleScreenStateChange(msg.arg1 == 1);
+ }
+ } break;
}
}
}
@@ -4027,7 +4051,7 @@
}
if (mPosted && mViews.isEmpty() && mViewRects.isEmpty()) {
- mChoreographer.removeAnimationCallbacks(this);
+ mChoreographer.removeAnimationCallbacks(this, null);
mPosted = false;
}
}
@@ -4068,7 +4092,7 @@
private void postIfNeededLocked() {
if (!mPosted) {
- mChoreographer.postAnimationCallback(this);
+ mChoreographer.postAnimationCallback(this, null);
mPosted = true;
}
}
@@ -4121,6 +4145,12 @@
mHandler.sendMessage(msg);
}
+ public void dispatchScreenStateChange(boolean on) {
+ Message msg = mHandler.obtainMessage(MSG_DISPATCH_SCREEN_STATE);
+ msg.arg1 = on ? 1 : 0;
+ mHandler.sendMessage(msg);
+ }
+
public void dispatchGetNewSurface() {
Message msg = mHandler.obtainMessage(MSG_DISPATCH_GET_NEW_SURFACE);
mHandler.sendMessage(msg);
@@ -4322,6 +4352,13 @@
}
}
+ public void dispatchScreenState(boolean on) {
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
+ if (viewAncestor != null) {
+ viewAncestor.dispatchScreenStateChange(on);
+ }
+ }
+
public void dispatchGetNewSurface() {
final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
diff --git a/core/java/android/view/textservice/SpellCheckerSession.java b/core/java/android/view/textservice/SpellCheckerSession.java
index 9105f19..6ff3b9b 100644
--- a/core/java/android/view/textservice/SpellCheckerSession.java
+++ b/core/java/android/view/textservice/SpellCheckerSession.java
@@ -281,9 +281,6 @@
if (DBG) {
Log.w(TAG, "Get suggestions from the spell checker.");
}
- if (scp.mTextInfos.length != 1) {
- throw new IllegalArgumentException();
- }
try {
session.onGetSentenceSuggestionsMultiple(
scp.mTextInfos, scp.mSuggestionsLimit);
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java
index 04a698f..72aed4b 100644
--- a/core/java/android/webkit/WebViewClassic.java
+++ b/core/java/android/webkit/WebViewClassic.java
@@ -1357,14 +1357,7 @@
}
/**
- * Construct a new WebView with layout parameters, a default style and a set
- * of custom Javscript interfaces to be added to the WebView at initialization
- * time. This guarantees that these interfaces will be available when the JS
- * context is initialized.
- * @param javaScriptInterfaces is a Map of interface names, as keys, and
- * object implementing those interfaces, as values.
- * @param privateBrowsing If true the web view will be initialized in private mode.
- * @hide This is an implementation detail.
+ * See {@link WebViewProvider#init(Map, boolean)}
*/
@Override
public void init(Map<String, Object> javaScriptInterfaces, boolean privateBrowsing) {
@@ -1867,36 +1860,36 @@
}
/**
- * Specify whether the horizontal scrollbar has overlay style.
- * @param overlay TRUE if horizontal scrollbar should have overlay style.
+ * See {@link WebView#setHorizontalScrollbarOverlay(boolean)}
*/
+ @Override
public void setHorizontalScrollbarOverlay(boolean overlay) {
checkThread();
mOverlayHorizontalScrollbar = overlay;
}
/**
- * Specify whether the vertical scrollbar has overlay style.
- * @param overlay TRUE if vertical scrollbar should have overlay style.
+ * See {@link WebView#setVerticalScrollbarOverlay(boolean)
*/
+ @Override
public void setVerticalScrollbarOverlay(boolean overlay) {
checkThread();
mOverlayVerticalScrollbar = overlay;
}
/**
- * Return whether horizontal scrollbar has overlay style
- * @return TRUE if horizontal scrollbar has overlay style.
+ * See {@link WebView#overlayHorizontalScrollbar()}
*/
+ @Override
public boolean overlayHorizontalScrollbar() {
checkThread();
return mOverlayHorizontalScrollbar;
}
/**
- * Return whether vertical scrollbar has overlay style
- * @return TRUE if vertical scrollbar has overlay style.
+ * See {@link WebView#overlayVerticalScrollbar()}
*/
+ @Override
public boolean overlayVerticalScrollbar() {
checkThread();
return mOverlayVerticalScrollbar;
@@ -1934,11 +1927,9 @@
}
/**
- * Return the visible height (in pixels) of the embedded title bar (if any).
- *
- * @return This method is obsolete and always returns 0.
- * @deprecated This method is now obsolete.
+ * See {@link WebView#getVisibleTitleHeight()}
*/
+ @Override
@Deprecated
public int getVisibleTitleHeight() {
// Actually, this method returns the height of the embedded title bar if one is set via the
@@ -1985,17 +1976,18 @@
}
/**
- * @return The SSL certificate for the main top-level page or null if
- * there is no certificate (the site is not secure).
+ * See {@link WebView#getCertificate()}
*/
+ @Override
public SslCertificate getCertificate() {
checkThread();
return mCertificate;
}
/**
- * Sets the SSL certificate for the main top-level page.
+ * See {@link WebView#setCertificate(SslCertificate)}
*/
+ @Override
public void setCertificate(SslCertificate certificate) {
checkThread();
if (DebugFlags.WEB_VIEW) {
@@ -2010,26 +2002,18 @@
//-------------------------------------------------------------------------
/**
- * Save the username and password for a particular host in the WebView's
- * internal database.
- * @param host The host that required the credentials.
- * @param username The username for the given host.
- * @param password The password for the given host.
+ * See {@link WebView#savePassword(String, String, String)}
*/
+ @Override
public void savePassword(String host, String username, String password) {
checkThread();
mDatabase.setUsernamePassword(host, username, password);
}
/**
- * Set the HTTP authentication credentials for a given host and realm.
- *
- * @param host The host for the credentials.
- * @param realm The realm for the credentials.
- * @param username The username for the password. If it is null, it means
- * password can't be saved.
- * @param password The password
+ * See {@link WebView#setHttpAuthUsernamePassword(String, String, String, String)}
*/
+ @Override
public void setHttpAuthUsernamePassword(String host, String realm,
String username, String password) {
checkThread();
@@ -2037,14 +2021,9 @@
}
/**
- * Retrieve the HTTP authentication username and password for a given
- * host & realm pair
- *
- * @param host The host for which the credentials apply.
- * @param realm The realm for which the credentials apply.
- * @return String[] if found, String[0] is username, which can be null and
- * String[1] is password. Return null if it can't find anything.
+ * See {@link WebView#getHttpAuthUsernamePassword(String, String)}
*/
+ @Override
public String[] getHttpAuthUsernamePassword(String host, String realm) {
checkThread();
return mDatabase.getHttpAuthUsernamePassword(host, realm);
@@ -2082,10 +2061,9 @@
}
/**
- * Destroy the internal state of the WebView. This method should be called
- * after the WebView has been removed from the view system. No other
- * methods may be called on a WebView after destroy.
+ * See {@link WebView#destroy()}
*/
+ @Override
public void destroy() {
checkThread();
destroyImpl();
@@ -2115,10 +2093,7 @@
}
/**
- * Enables platform notifications of data state and proxy changes.
- * Notifications are enabled by default.
- *
- * @deprecated This method is now obsolete.
+ * See {@link WebView#enablePlatformNotifications()}
*/
@Deprecated
public static void enablePlatformNotifications() {
@@ -2132,10 +2107,7 @@
}
/**
- * Disables platform notifications of data state and proxy changes.
- * Notifications are enabled by default.
- *
- * @deprecated This method is now obsolete.
+ * See {@link WebView#disablePlatformNotifications()}
*/
@Deprecated
public static void disablePlatformNotifications() {
@@ -2161,11 +2133,9 @@
}
/**
- * Inform WebView of the network state. This is used to set
- * the JavaScript property window.navigator.isOnline and
- * generates the online/offline event as specified in HTML5, sec. 5.7.7
- * @param networkUp boolean indicating if network is available
+ * See {@link WebView#setNetworkAvailable(boolean)}
*/
+ @Override
public void setNetworkAvailable(boolean networkUp) {
checkThread();
mWebViewCore.sendMessage(EventHub.SET_NETWORK_STATE,
@@ -2183,19 +2153,11 @@
map.put("subtype", subtype);
mWebViewCore.sendMessage(EventHub.SET_NETWORK_TYPE, map);
}
+
/**
- * Save the state of this WebView used in
- * {@link android.app.Activity#onSaveInstanceState}. Please note that this
- * method no longer stores the display data for this WebView. The previous
- * behavior could potentially leak files if {@link #restoreState} was never
- * called. See {@link #savePicture} and {@link #restorePicture} for saving
- * and restoring the display data.
- * @param outState The Bundle to store the WebView state.
- * @return The same copy of the back/forward list used to save the state. If
- * saveState fails, the returned list will be null.
- * @see #savePicture
- * @see #restorePicture
+ * See {@link WebView#saveState(Bundle)}
*/
+ @Override
public WebBackForwardList saveState(Bundle outState) {
checkThread();
if (outState == null) {
@@ -2244,14 +2206,9 @@
}
/**
- * Save the current display data to the Bundle given. Used in conjunction
- * with {@link #saveState}.
- * @param b A Bundle to store the display data.
- * @param dest The file to store the serialized picture data. Will be
- * overwritten with this WebView's picture data.
- * @return True if the picture was successfully saved.
- * @deprecated This method is now obsolete.
+ * See {@link WebView#savePicture(Bundle, File)}
*/
+ @Override
@Deprecated
public boolean savePicture(Bundle b, final File dest) {
checkThread();
@@ -2311,15 +2268,9 @@
}
/**
- * Restore the display data that was save in {@link #savePicture}. Used in
- * conjunction with {@link #restoreState}.
- *
- * Note that this will not work if the WebView is hardware accelerated.
- * @param b A Bundle containing the saved display data.
- * @param src The file where the picture data was stored.
- * @return True if the picture was successfully restored.
- * @deprecated This method is now obsolete.
+ * See {@link WebView#restorePicture(Bundle, File)};
*/
+ @Override
@Deprecated
public boolean restorePicture(Bundle b, File src) {
checkThread();
@@ -2402,7 +2353,6 @@
/**
* Clears the view state set with {@link #loadViewState(InputStream)}.
* This WebView will then switch to showing the content from webkit
- * @hide
*/
public void clearViewState() {
mBlockWebkitViewMessages = false;
@@ -2411,19 +2361,9 @@
}
/**
- * Restore the state of this WebView from the given map used in
- * {@link android.app.Activity#onRestoreInstanceState}. This method should
- * be called to restore the state of the WebView before using the object. If
- * it is called after the WebView has had a chance to build state (load
- * pages, create a back/forward list, etc.) there may be undesirable
- * side-effects. Please note that this method no longer restores the
- * display data for this WebView. See {@link #savePicture} and {@link
- * #restorePicture} for saving and restoring the display data.
- * @param inState The incoming Bundle of state.
- * @return The restored back/forward list or null if restoreState failed.
- * @see #savePicture
- * @see #restorePicture
+ * See {@link WebView#restoreState(Bundle)}
*/
+ @Override
public WebBackForwardList restoreState(Bundle inState) {
checkThread();
WebBackForwardList returnList = null;
@@ -2478,15 +2418,9 @@
}
/**
- * Load the given URL with the specified additional HTTP headers.
- * @param url The URL of the resource to load.
- * @param additionalHttpHeaders The additional headers to be used in the
- * HTTP request for this URL, specified as a map from name to
- * value. Note that if this map contains any of the headers
- * that are set by default by the WebView, such as those
- * controlling caching, accept types or the User-Agent, their
- * values may be overriden by the WebView's defaults.
+ * See {@link WebView#loadUrl(String, Map)}
*/
+ @Override
public void loadUrl(String url, Map<String, String> additionalHttpHeaders) {
checkThread();
loadUrlImpl(url, additionalHttpHeaders);
@@ -2502,9 +2436,9 @@
}
/**
- * Load the given URL.
- * @param url The URL of the resource to load.
+ * See {@link WebView#loadUrl(String)}
*/
+ @Override
public void loadUrl(String url) {
checkThread();
loadUrlImpl(url);
@@ -2518,13 +2452,9 @@
}
/**
- * Load the url with postData using "POST" method into the WebView. If url
- * is not a network url, it will be loaded with {link
- * {@link #loadUrl(String)} instead.
- *
- * @param url The url of the resource to load.
- * @param postData The data will be passed to "POST" request.
+ * See {@link WebView#postUrl(String, byte[])}
*/
+ @Override
public void postUrl(String url, byte[] postData) {
checkThread();
if (URLUtil.isNetworkUrl(url)) {
@@ -2540,31 +2470,9 @@
}
/**
- * Load the given data into the WebView using a 'data' scheme URL.
- * <p>
- * Note that JavaScript's same origin policy means that script running in a
- * page loaded using this method will be unable to access content loaded
- * using any scheme other than 'data', including 'http(s)'. To avoid this
- * restriction, use {@link
- * #loadDataWithBaseURL(String,String,String,String,String)
- * loadDataWithBaseURL()} with an appropriate base URL.
- * <p>
- * If the value of the encoding parameter is 'base64', then the data must
- * be encoded as base64. Otherwise, the data must use ASCII encoding for
- * octets inside the range of safe URL characters and use the standard %xx
- * hex encoding of URLs for octets outside that range. For example,
- * '#', '%', '\', '?' should be replaced by %23, %25, %27, %3f respectively.
- * <p>
- * The 'data' scheme URL formed by this method uses the default US-ASCII
- * charset. If you need need to set a different charset, you should form a
- * 'data' scheme URL which explicitly specifies a charset parameter in the
- * mediatype portion of the URL and call {@link #loadUrl(String)} instead.
- * Note that the charset obtained from the mediatype portion of a data URL
- * always overrides that specified in the HTML or XML document itself.
- * @param data A String of data in the given encoding.
- * @param mimeType The MIME type of the data, e.g. 'text/html'.
- * @param encoding The encoding of the data.
+ * See {@link WebView#loadData(String, String, String)}
*/
+ @Override
public void loadData(String data, String mimeType, String encoding) {
checkThread();
loadDataImpl(data, mimeType, encoding);
@@ -2582,27 +2490,9 @@
}
/**
- * Load the given data into the WebView, using baseUrl as the base URL for
- * the content. The base URL is used both to resolve relative URLs and when
- * applying JavaScript's same origin policy. The historyUrl is used for the
- * history entry.
- * <p>
- * Note that content specified in this way can access local device files
- * (via 'file' scheme URLs) only if baseUrl specifies a scheme other than
- * 'http', 'https', 'ftp', 'ftps', 'about' or 'javascript'.
- * <p>
- * If the base URL uses the data scheme, this method is equivalent to
- * calling {@link #loadData(String,String,String) loadData()} and the
- * historyUrl is ignored.
- * @param baseUrl URL to use as the page's base URL. If null defaults to
- * 'about:blank'
- * @param data A String of data in the given encoding.
- * @param mimeType The MIMEType of the data, e.g. 'text/html'. If null,
- * defaults to 'text/html'.
- * @param encoding The encoding of the data.
- * @param historyUrl URL to use as the history entry, if null defaults to
- * 'about:blank'.
+ * See {@link WebView#loadDataWithBaseURL(String, String, String, String, String)}
*/
+ @Override
public void loadDataWithBaseURL(String baseUrl, String data,
String mimeType, String encoding, String historyUrl) {
checkThread();
@@ -2623,10 +2513,9 @@
}
/**
- * Saves the current view as a web archive.
- *
- * @param filename The filename where the archive should be placed.
+ * See {@link WebView#saveWebArchive(String)}
*/
+ @Override
public void saveWebArchive(String filename) {
checkThread();
saveWebArchiveImpl(filename, false, null);
@@ -2646,17 +2535,9 @@
}
/**
- * Saves the current view as a web archive.
- *
- * @param basename The filename where the archive should be placed.
- * @param autoname If false, takes basename to be a file. If true, basename
- * is assumed to be a directory in which a filename will be
- * chosen according to the url of the current page.
- * @param callback Called after the web archive has been saved. The
- * parameter for onReceiveValue will either be the filename
- * under which the file was saved, or null if saving the
- * file failed.
+ * See {@link WebView#saveWebArchive(String, boolean, ValueCallback)}
*/
+ @Override
public void saveWebArchive(String basename, boolean autoname, ValueCallback<String> callback) {
checkThread();
saveWebArchiveImpl(basename, autoname, callback);
@@ -2669,8 +2550,9 @@
}
/**
- * Stop the current load.
+ * See {@link WebView#stopLoading()}
*/
+ @Override
public void stopLoading() {
checkThread();
// TODO: should we clear all the messages in the queue before sending
@@ -2680,8 +2562,9 @@
}
/**
- * Reload the current url.
+ * See {@link WebView#reload()}
*/
+ @Override
public void reload() {
checkThread();
clearHelpers();
@@ -2690,9 +2573,9 @@
}
/**
- * Return true if this WebView has a back history item.
- * @return True iff this WebView has a back history item.
+ * See {@link WebView#canGoBack()}
*/
+ @Override
public boolean canGoBack() {
checkThread();
WebBackForwardList l = mCallbackProxy.getBackForwardList();
@@ -2706,17 +2589,18 @@
}
/**
- * Go back in the history of this WebView.
+ * See {@link WebView#goBack()}
*/
+ @Override
public void goBack() {
checkThread();
goBackOrForwardImpl(-1);
}
/**
- * Return true if this WebView has a forward history item.
- * @return True iff this Webview has a forward history item.
+ * See {@link WebView#canGoForward()}
*/
+ @Override
public boolean canGoForward() {
checkThread();
WebBackForwardList l = mCallbackProxy.getBackForwardList();
@@ -2730,19 +2614,18 @@
}
/**
- * Go forward in the history of this WebView.
+ * See {@link WebView#goForward()}
*/
+ @Override
public void goForward() {
checkThread();
goBackOrForwardImpl(1);
}
/**
- * Return true if the page can go back or forward the given
- * number of steps.
- * @param steps The negative or positive number of steps to move the
- * history.
+ * See {@link WebView#canGoBackOrForward(int)}
*/
+ @Override
public boolean canGoBackOrForward(int steps) {
checkThread();
WebBackForwardList l = mCallbackProxy.getBackForwardList();
@@ -2757,12 +2640,9 @@
}
/**
- * Go to the history item that is the number of steps away from
- * the current item. Steps is negative if backward and positive
- * if forward.
- * @param steps The number of steps to take back or forward in the back
- * forward list.
+ * See {@link WebView#goBackOrForward(int)}
*/
+ @Override
public void goBackOrForward(int steps) {
checkThread();
goBackOrForwardImpl(steps);
@@ -2781,8 +2661,9 @@
}
/**
- * Returns true if private browsing is enabled in this WebView.
+ * See {@link WebView#isPrivateBrowsingEnabled()}
*/
+ @Override
public boolean isPrivateBrowsingEnabled() {
checkThread();
return getSettings().isPrivateBrowsingEnabled();
@@ -2802,10 +2683,9 @@
}
/**
- * Scroll the contents of the view up by half the view size
- * @param top true to jump to the top of the page
- * @return true if the page was scrolled
+ * See {@link WebView#pageUp(boolean)}
*/
+ @Override
public boolean pageUp(boolean top) {
checkThread();
if (mNativeClass == 0) {
@@ -2828,10 +2708,9 @@
}
/**
- * Scroll the contents of the view down by half the page size
- * @param bottom true to jump to bottom of page
- * @return true if the page was scrolled
+ * See {@link WebView#pageDown(boolean)}
*/
+ @Override
public boolean pageDown(boolean bottom) {
checkThread();
if (mNativeClass == 0) {
@@ -2853,9 +2732,9 @@
}
/**
- * Clear the view so that onDraw() will draw nothing but white background,
- * and onMeasure() will return 0 if MeasureSpec is not MeasureSpec.EXACTLY
+ * See {@link WebView#clearView()}
*/
+ @Override
public void clearView() {
checkThread();
mContentWidth = 0;
@@ -2865,14 +2744,9 @@
}
/**
- * Return a new picture that captures the current display of the webview.
- * This is a copy of the display, and will be unaffected if the webview
- * later loads a different URL.
- *
- * @return a picture containing the current contents of the view. Note this
- * picture is of the entire document, and is not restricted to the
- * bounds of the view.
+ * See {@link WebView#capturePicture()}
*/
+ @Override
public Picture capturePicture() {
checkThread();
if (mNativeClass == 0) return null;
@@ -2882,9 +2756,9 @@
}
/**
- * Return the current scale of the WebView
- * @return The current scale.
+ * See {@link WebView#getScale()}
*/
+ @Override
public float getScale() {
checkThread();
return mZoomManager.getScale();
@@ -2900,25 +2774,18 @@
}
/**
- * Set the initial scale for the WebView. 0 means default. If
- * {@link WebSettings#getUseWideViewPort()} is true, it zooms out all the
- * way. Otherwise it starts with 100%. If initial scale is greater than 0,
- * WebView starts with this value as initial scale.
- * Please note that unlike the scale properties in the viewport meta tag,
- * this method doesn't take the screen density into account.
- *
- * @param scaleInPercent The initial scale in percent.
+ * See {@link WebView#setInitialScale(int)}
*/
+ @Override
public void setInitialScale(int scaleInPercent) {
checkThread();
mZoomManager.setInitialScaleInPercent(scaleInPercent);
}
/**
- * Invoke the graphical zoom picker widget for this WebView. This will
- * result in the zoom widget appearing on the screen to control the zoom
- * level of this WebView.
+ * See {@link WebView#invokeZoomPicker()}
*/
+ @Override
public void invokeZoomPicker() {
checkThread();
if (!getSettings().supportZoom()) {
@@ -2930,23 +2797,9 @@
}
/**
- * Return a HitTestResult based on the current cursor node. If a HTML::a tag
- * is found and the anchor has a non-JavaScript url, the HitTestResult type
- * is set to SRC_ANCHOR_TYPE and the url is set in the "extra" field. If the
- * anchor does not have a url or if it is a JavaScript url, the type will
- * be UNKNOWN_TYPE and the url has to be retrieved through
- * {@link #requestFocusNodeHref} asynchronously. If a HTML::img tag is
- * found, the HitTestResult type is set to IMAGE_TYPE and the url is set in
- * the "extra" field. A type of
- * SRC_IMAGE_ANCHOR_TYPE indicates an anchor with a url that has an image as
- * a child node. If a phone number is found, the HitTestResult type is set
- * to PHONE_TYPE and the phone number is set in the "extra" field of
- * HitTestResult. If a map address is found, the HitTestResult type is set
- * to GEO_TYPE and the address is set in the "extra" field of HitTestResult.
- * If an email address is found, the HitTestResult type is set to EMAIL_TYPE
- * and the email is set in the "extra" field of HitTestResult. Otherwise,
- * HitTestResult type is set to UNKNOWN_TYPE.
+ * See {@link WebView#getHitTestResult()}
*/
+ @Override
public HitTestResult getHitTestResult() {
checkThread();
return mInitialHitTestResult;
@@ -2980,19 +2833,9 @@
}
/**
- * Request the anchor or image element URL at the last tapped point.
- * If hrefMsg is null, this method returns immediately and does not
- * dispatch hrefMsg to its target. If the tapped point hits an image,
- * an anchor, or an image in an anchor, the message associates
- * strings in named keys in its data. The value paired with the key
- * may be an empty string.
- *
- * @param hrefMsg This message will be dispatched with the result of the
- * request. The message data contains three keys:
- * - "url" returns the anchor's href attribute.
- * - "title" returns the anchor's text.
- * - "src" returns the image's src attribute.
+ * See {@link WebView#requestFocusNodeHref(Message)}
*/
+ @Override
public void requestFocusNodeHref(Message hrefMsg) {
checkThread();
if (hrefMsg == null) {
@@ -3013,12 +2856,9 @@
}
/**
- * Request the url of the image last touched by the user. msg will be sent
- * to its target with a String representing the url as its object.
- *
- * @param msg This message will be dispatched with the result of the request
- * as the data member with "url" as key. The result can be null.
+ * See {@link WebView#requestImageRef(Message)}
*/
+ @Override
public void requestImageRef(Message msg) {
checkThread();
if (0 == mNativeClass) return; // client isn't initialized
@@ -3521,11 +3361,9 @@
}
/**
- * Get the url for the current page. This is not always the same as the url
- * passed to WebViewClient.onPageStarted because although the load for
- * that url has begun, the current page may not have changed.
- * @return The url for the current page.
+ * See {@link WebView#getUrl()}
*/
+ @Override
public String getUrl() {
checkThread();
WebHistoryItem h = mCallbackProxy.getBackForwardList().getCurrentItem();
@@ -3533,13 +3371,9 @@
}
/**
- * Get the original url for the current page. This is not always the same
- * as the url passed to WebViewClient.onPageStarted because although the
- * load for that url has begun, the current page may not have changed.
- * Also, there may have been redirects resulting in a different url to that
- * originally requested.
- * @return The url that was originally requested for the current page.
+ * See {@link WebView#getOriginalUrl()}
*/
+ @Override
public String getOriginalUrl() {
checkThread();
WebHistoryItem h = mCallbackProxy.getBackForwardList().getCurrentItem();
@@ -3547,10 +3381,9 @@
}
/**
- * Get the title for the current page. This is the title of the current page
- * until WebViewClient.onReceivedTitle is called.
- * @return The title for the current page.
+ * See {@link WebView#getTitle()}
*/
+ @Override
public String getTitle() {
checkThread();
WebHistoryItem h = mCallbackProxy.getBackForwardList().getCurrentItem();
@@ -3558,10 +3391,9 @@
}
/**
- * Get the favicon for the current page. This is the favicon of the current
- * page until WebViewClient.onReceivedIcon is called.
- * @return The favicon for the current page.
+ * See {@link WebView#getFavicon()}
*/
+ @Override
public Bitmap getFavicon() {
checkThread();
WebHistoryItem h = mCallbackProxy.getBackForwardList().getCurrentItem();
@@ -3569,37 +3401,36 @@
}
/**
- * Get the touch icon url for the apple-touch-icon <link> element, or
- * a URL on this site's server pointing to the standard location of a
- * touch icon.
- * @hide
+ * See {@link WebView#getTouchIconUrl()}
*/
+ @Override
public String getTouchIconUrl() {
WebHistoryItem h = mCallbackProxy.getBackForwardList().getCurrentItem();
return h != null ? h.getTouchIconUrl() : null;
}
/**
- * Get the progress for the current page.
- * @return The progress for the current page between 0 and 100.
+ * See {@link WebView#getProgress()}
*/
+ @Override
public int getProgress() {
checkThread();
return mCallbackProxy.getProgress();
}
/**
- * @return the height of the HTML content.
+ * See {@link WebView#getContentHeight()}
*/
+ @Override
public int getContentHeight() {
checkThread();
return mContentHeight;
}
/**
- * @return the width of the HTML content.
- * @hide
+ * See {@link WebView#getContentWidth()}
*/
+ @Override
public int getContentWidth() {
return mContentWidth;
}
@@ -3612,32 +3443,27 @@
}
/**
- * Pause all layout, parsing, and JavaScript timers for all webviews. This
- * is a global requests, not restricted to just this webview. This can be
- * useful if the application has been paused.
+ * See {@link WebView#pauseTimers()}
*/
+ @Override
public void pauseTimers() {
checkThread();
mWebViewCore.sendMessage(EventHub.PAUSE_TIMERS);
}
/**
- * Resume all layout, parsing, and JavaScript timers for all webviews.
- * This will resume dispatching all timers.
+ * See {@link WebView#resumeTimers()}
*/
+ @Override
public void resumeTimers() {
checkThread();
mWebViewCore.sendMessage(EventHub.RESUME_TIMERS);
}
/**
- * Call this to pause any extra processing associated with this WebView and
- * its associated DOM, plugins, JavaScript etc. For example, if the WebView
- * is taken offscreen, this could be called to reduce unnecessary CPU or
- * network traffic. When the WebView is again "active", call onResume().
- *
- * Note that this differs from pauseTimers(), which affects all WebViews.
+ * See {@link WebView#onPause()}
*/
+ @Override
public void onPause() {
checkThread();
if (!mIsPaused) {
@@ -3674,8 +3500,9 @@
}
/**
- * Call this to resume a WebView after a previous call to onPause().
+ * See {@link WebView#onResume()}
*/
+ @Override
public void onResume() {
checkThread();
if (mIsPaused) {
@@ -3697,29 +3524,26 @@
}
/**
- * Returns true if the view is paused, meaning onPause() was called. Calling
- * onResume() sets the paused state back to false.
- * @hide
+ * See {@link WebView#isPaused()}
*/
+ @Override
public boolean isPaused() {
return mIsPaused;
}
/**
- * Call this to inform the view that memory is low so that it can
- * free any available memory.
+ * See {@link WebView#freeMemory()}
*/
+ @Override
public void freeMemory() {
checkThread();
mWebViewCore.sendMessage(EventHub.FREE_MEMORY);
}
/**
- * Clear the resource cache. Note that the cache is per-application, so
- * this will clear the cache for all WebViews used.
- *
- * @param includeDiskFiles If false, only the RAM cache is cleared.
+ * See {@link WebView#clearCache(boolean)}
*/
+ @Override
public void clearCache(boolean includeDiskFiles) {
checkThread();
// Note: this really needs to be a static method as it clears cache for all
@@ -3730,17 +3554,18 @@
}
/**
- * Make sure that clearing the form data removes the adapter from the
- * currently focused textfield if there is one.
+ * See {@link WebView#clearFormData()}
*/
+ @Override
public void clearFormData() {
checkThread();
// TODO: Implement b/6083041
}
/**
- * Tell the WebView to clear its internal back/forward list.
+ * See {@link WebView#clearHistory()}
*/
+ @Override
public void clearHistory() {
checkThread();
mCallbackProxy.getBackForwardList().setClearPending();
@@ -3748,46 +3573,37 @@
}
/**
- * Clear the SSL preferences table stored in response to proceeding with SSL
- * certificate errors.
+ * See {@link WebView#clearSslPreferences()}
*/
+ @Override
public void clearSslPreferences() {
checkThread();
mWebViewCore.sendMessage(EventHub.CLEAR_SSL_PREF_TABLE);
}
/**
- * Return the WebBackForwardList for this WebView. This contains the
- * back/forward list for use in querying each item in the history stack.
- * This is a copy of the private WebBackForwardList so it contains only a
- * snapshot of the current state. Multiple calls to this method may return
- * different objects. The object returned from this method will not be
- * updated to reflect any new state.
+ * See {@link WebView#copyBackForwardList()}
*/
+ @Override
public WebBackForwardList copyBackForwardList() {
checkThread();
return mCallbackProxy.getBackForwardList().clone();
}
- /*
- * Highlight and scroll to the next occurance of String in findAll.
- * Wraps the page infinitely, and scrolls. Must be called after
- * calling findAll.
- *
- * @param forward Direction to search.
+ /**
+ * See {@link WebView#findNext(boolean)}
*/
+ @Override
public void findNext(boolean forward) {
checkThread();
if (0 == mNativeClass) return; // client isn't initialized
mWebViewCore.sendMessage(EventHub.FIND_NEXT, forward ? 1 : 0);
}
- /*
- * Find all instances of find on the page and highlight them.
- * @param find String to find.
- * @return int The number of occurances of the String "find"
- * that were found.
+ /**
+ * See {@link WebView#findAll(String)}
*/
+ @Override
public int findAll(String find) {
return findAllBody(find, false);
}
@@ -3935,9 +3751,10 @@
return WebViewCore.nativeFindAddress(addr, caseInsensitive);
}
- /*
- * Clear the highlighting surrounding text matches created by findAll.
+ /**
+ * See {@link WebView#clearMatches()}
*/
+ @Override
public void clearMatches() {
checkThread();
if (mNativeClass == 0)
@@ -3965,11 +3782,9 @@
}
/**
- * Query the document to see if it contains any image references. The
- * message object will be dispatched with arg1 being set to 1 if images
- * were found and 0 if the document does not reference any images.
- * @param response The message that will be dispatched with the result.
+ * See {@link WebView#documentHasImages(Message)}
*/
+ @Override
public void documentHasImages(Message response) {
checkThread();
if (response == null) {
@@ -4396,10 +4211,9 @@
}
/**
- * Set the WebViewClient that will receive various notifications and
- * requests. This will replace the current handler.
- * @param client An implementation of WebViewClient.
+ * See {@link WebView#setWebViewClient(WebViewClient)}
*/
+ @Override
public void setWebViewClient(WebViewClient client) {
checkThread();
mCallbackProxy.setWebViewClient(client);
@@ -4416,22 +4230,18 @@
}
/**
- * Register the interface to be used when content can not be handled by
- * the rendering engine, and should be downloaded instead. This will replace
- * the current handler.
- * @param listener An implementation of DownloadListener.
+ * See {@link WebView#setDownloadListener(DownloadListener)}
*/
+ @Override
public void setDownloadListener(DownloadListener listener) {
checkThread();
mCallbackProxy.setDownloadListener(listener);
}
/**
- * Set the chrome handler. This is an implementation of WebChromeClient for
- * use in handling JavaScript dialogs, favicons, titles, and the progress.
- * This will replace the current handler.
- * @param client An implementation of WebChromeClient.
+ * See {@link WebView#setWebChromeClient(WebChromeClient)}
*/
+ @Override
public void setWebChromeClient(WebChromeClient client) {
checkThread();
mCallbackProxy.setWebChromeClient(client);
@@ -4467,11 +4277,9 @@
}
/**
- * Set the Picture listener. This is an interface used to receive
- * notifications of a new Picture.
- * @param listener An implementation of WebView.PictureListener.
- * @deprecated This method is now obsolete.
+ * See {@link WebView#setPictureListener(PictureListener)}
*/
+ @Override
@Deprecated
public void setPictureListener(PictureListener listener) {
checkThread();
@@ -4495,31 +4303,9 @@
}
/**
- * This method injects the supplied Java object into the WebView. The
- * object is injected into the JavaScript context of the main frame, using
- * the supplied name. This allows the Java object to be accessed from
- * JavaScript. Note that that injected objects will not appear in
- * JavaScript until the page is next (re)loaded. For example:
- * <pre> webView.addJavascriptInterface(new Object(), "injectedObject");
- * webView.loadData("<!DOCTYPE html><title></title>", "text/html", null);
- * webView.loadUrl("javascript:alert(injectedObject.toString())");</pre>
- * <p><strong>IMPORTANT:</strong>
- * <ul>
- * <li> addJavascriptInterface() can be used to allow JavaScript to control
- * the host application. This is a powerful feature, but also presents a
- * security risk. Use of this method in a WebView containing untrusted
- * content could allow an attacker to manipulate the host application in
- * unintended ways, executing Java code with the permissions of the host
- * application. Use extreme care when using this method in a WebView which
- * could contain untrusted content.
- * <li> JavaScript interacts with Java object on a private, background
- * thread of the WebView. Care is therefore required to maintain thread
- * safety.</li>
- * </ul></p>
- * @param object The Java object to inject into the WebView's JavaScript
- * context. Null values are ignored.
- * @param name The name used to expose the instance in JavaScript.
+ * See {@link WebView#addJavascriptInterface(Object, String)}
*/
+ @Override
public void addJavascriptInterface(Object object, String name) {
checkThread();
if (object == null) {
@@ -4532,9 +4318,9 @@
}
/**
- * Removes a previously added JavaScript interface with the given name.
- * @param interfaceName The name of the interface to remove.
+ * See {@link WebView#removeJavascriptInterface(String)}
*/
+ @Override
public void removeJavascriptInterface(String interfaceName) {
checkThread();
if (mWebViewCore != null) {
@@ -4545,33 +4331,28 @@
}
/**
- * Return the WebSettings object used to control the settings for this
- * WebView.
- * @return A WebSettings object that can be used to control this WebView's
- * settings.
+ * See {@link WebView#getSettings()}
+ * Note this returns WebSettingsClassic, a sub-class of WebSettings, which can be used
+ * to access extension APIs.
*/
+ @Override
public WebSettingsClassic getSettings() {
checkThread();
return (mWebViewCore != null) ? mWebViewCore.getSettings() : null;
}
- /**
- * Return the list of currently loaded plugins.
- * @return The list of currently loaded plugins.
- *
- * @hide
- * @deprecated This was used for Gears, which has been deprecated.
- */
+ /**
+ * See {@link WebView#getPluginList()}
+ */
@Deprecated
public static synchronized PluginList getPluginList() {
checkThread();
return new PluginList();
}
- /**
- * @hide
- * @deprecated This was used for Gears, which has been deprecated.
- */
+ /**
+ * See {@link WebView#refreshPlugins(boolean)}
+ */
@Deprecated
public void refreshPlugins(boolean reloadOpenPages) {
checkThread();
@@ -4925,9 +4706,7 @@
if (layer == 0 || isPictureAfterFirstLayout) {
mWebViewCore.resumeWebKitDraw();
} else if (queueFull) {
- // temporarily disable webkit draw throttling
- // TODO: re-enable
- // mWebViewCore.pauseWebKitDraw();
+ mWebViewCore.pauseWebKitDraw();
}
if (mHTML5VideoViewProxy != null) {
@@ -5503,10 +5282,9 @@
}
/**
- * Use this method to put the WebView into text selection mode.
- * Do not rely on this functionality; it will be deprecated in the future.
- * @deprecated This method is now obsolete.
+ * See {@link WebView#emulateShiftHeld()}
*/
+ @Override
@Deprecated
public void emulateShiftHeld() {
checkThread();
@@ -5749,6 +5527,9 @@
setFocusControllerActive(false);
mKeysPressed.clear();
}
+ if (!mTouchHighlightRegion.isEmpty()) {
+ mWebView.invalidate(mTouchHighlightRegion.getBounds());
+ }
}
void setGLRectViewport() {
@@ -5960,6 +5741,10 @@
return false;
}
+ if (!mWebView.isFocused()) {
+ mWebView.requestFocus();
+ }
+
if (DebugFlags.WEB_VIEW) {
Log.v(LOGTAG, ev + " at " + ev.getEventTime()
+ " mTouchMode=" + mTouchMode
@@ -6349,7 +6134,6 @@
break;
}
case MotionEvent.ACTION_UP: {
- if (!mWebView.isFocused()) mWebView.requestFocus();
// pass the touch events from UI thread to WebCore thread
if (shouldForwardTouchEvent()) {
TouchEventData ted = new TouchEventData();
@@ -7171,18 +6955,9 @@
}
/**
- * Returns a view containing zoom controls i.e. +/- buttons. The caller is
- * in charge of installing this view to the view hierarchy. This view will
- * become visible when the user starts scrolling via touch and fade away if
- * the user does not interact with it.
- * <p/>
- * API version 3 introduces a built-in zoom mechanism that is shown
- * automatically by the MapView. This is the preferred approach for
- * showing the zoom UI.
- *
- * @deprecated The built-in zoom mechanism is preferred, see
- * {@link WebSettings#setBuiltInZoomControls(boolean)}.
+ * See {@link WebView#getZoomControls()}
*/
+ @Override
@Deprecated
public View getZoomControls() {
checkThread();
@@ -7210,34 +6985,36 @@
}
/**
- * @return TRUE if the WebView can be zoomed in.
+ * See {@link WebView#canZoomIn()}
*/
+ @Override
public boolean canZoomIn() {
checkThread();
return mZoomManager.canZoomIn();
}
/**
- * @return TRUE if the WebView can be zoomed out.
+ * See {@link WebView#canZoomOut()}
*/
+ @Override
public boolean canZoomOut() {
checkThread();
return mZoomManager.canZoomOut();
}
/**
- * Perform zoom in in the webview
- * @return TRUE if zoom in succeeds. FALSE if no zoom changes.
+ * See {@link WebView#zoomIn()}
*/
+ @Override
public boolean zoomIn() {
checkThread();
return mZoomManager.zoomIn();
}
/**
- * Perform zoom out in the webview
- * @return TRUE if zoom out succeeds. FALSE if no zoom changes.
+ * See {@link WebView#zoomOut()}
*/
+ @Override
public boolean zoomOut() {
checkThread();
return mZoomManager.zoomOut();
@@ -8521,7 +8298,7 @@
return false;
}
if (mFocusedNode.mHasFocus && !mWebView.isInTouchMode()) {
- return !mFocusedNode.mEditable;
+ return mDrawCursorRing && !mFocusedNode.mEditable;
}
if (mFocusedNode.mHasFocus && mFocusedNode.mEditable) {
return false;
@@ -9182,9 +8959,7 @@
}
/**
- * Set the background color. It's white by default. Pass
- * zero to make the view transparent.
- * @param color the ARGB color described by Color.java
+ * See {@link WebView#setBackgroundColor(int)}
*/
@Override
public void setBackgroundColor(int color) {
@@ -9193,8 +8968,9 @@
}
/**
- * @deprecated This method is now obsolete.
+ * See {@link WebView#debugDump()}
*/
+ @Override
@Deprecated
public void debugDump() {
}
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 603cea1..19fb7b1 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -161,6 +161,12 @@
}
@Override
+ public void setPaddingRelative(int start, int top, int end, int bottom) {
+ super.setPaddingRelative(start, top, end, bottom);
+ mBasePadding = getPaddingEnd();
+ }
+
+ @Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
diff --git a/core/java/android/widget/ListPopupWindow.java b/core/java/android/widget/ListPopupWindow.java
index 5c97593..f4d5d74 100644
--- a/core/java/android/widget/ListPopupWindow.java
+++ b/core/java/android/widget/ListPopupWindow.java
@@ -1080,6 +1080,8 @@
if (!mDropDownVerticalOffsetSet) {
mDropDownVerticalOffset = -mTempRect.top;
}
+ } else {
+ mTempRect.setEmpty();
}
// Max height available on the screen for a popup.
@@ -1092,7 +1094,25 @@
return maxHeight + padding;
}
- final int listContent = mDropDownList.measureHeightOfChildren(MeasureSpec.UNSPECIFIED,
+ final int childWidthSpec;
+ switch (mDropDownWidth) {
+ case ViewGroup.LayoutParams.WRAP_CONTENT:
+ childWidthSpec = MeasureSpec.makeMeasureSpec(
+ mContext.getResources().getDisplayMetrics().widthPixels -
+ (mTempRect.left + mTempRect.right),
+ MeasureSpec.AT_MOST);
+ break;
+ case ViewGroup.LayoutParams.MATCH_PARENT:
+ childWidthSpec = MeasureSpec.makeMeasureSpec(
+ mContext.getResources().getDisplayMetrics().widthPixels -
+ (mTempRect.left + mTempRect.right),
+ MeasureSpec.EXACTLY);
+ break;
+ default:
+ childWidthSpec = MeasureSpec.makeMeasureSpec(mDropDownWidth, MeasureSpec.EXACTLY);
+ break;
+ }
+ final int listContent = mDropDownList.measureHeightOfChildren(childWidthSpec,
0, ListView.NO_POSITION, maxHeight - otherHeights, -1);
// add padding only if the list has items in it, that way we don't show
// the popup if it is not needed
diff --git a/core/java/android/widget/SpellChecker.java b/core/java/android/widget/SpellChecker.java
index df2996c..9afaee3 100644
--- a/core/java/android/widget/SpellChecker.java
+++ b/core/java/android/widget/SpellChecker.java
@@ -290,7 +290,7 @@
private SpellCheckSpan onGetSuggestionsInternal(
SuggestionsInfo suggestionsInfo, int offset, int length) {
- if (suggestionsInfo.getCookie() != mCookie) {
+ if (suggestionsInfo == null || suggestionsInfo.getCookie() != mCookie) {
return null;
}
final Editable editable = (Editable) mTextView.getText();
@@ -335,9 +335,15 @@
for (int i = 0; i < results.length; ++i) {
final SentenceSuggestionsInfo ssi = results[i];
+ if (ssi == null) {
+ continue;
+ }
SpellCheckSpan spellCheckSpan = null;
for (int j = 0; j < ssi.getSuggestionsCount(); ++j) {
final SuggestionsInfo suggestionsInfo = ssi.getSuggestionsInfoAt(j);
+ if (suggestionsInfo == null) {
+ continue;
+ }
final int offset = ssi.getOffsetAt(j);
final int length = ssi.getLengthAt(j);
final SpellCheckSpan scs = onGetSuggestionsInternal(
@@ -488,11 +494,15 @@
editable.removeSpan(mRange);
return;
}
+ // Stop spell checking when there are no characters in the range.
+ if (wordEnd < start) {
+ return;
+ }
wordStart = regionEnd;
// TODO: Find the start position of the sentence.
// Set span with the context
- final int spellCheckStart = Math.min(
- start, Math.max(wordStart, regionEnd - WORD_ITERATOR_INTERVAL));
+ final int spellCheckStart = Math.max(
+ 0, Math.min(wordStart, regionEnd - WORD_ITERATOR_INTERVAL));
if (regionEnd <= spellCheckStart) {
return;
}
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index 89c506f..6540613 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -26,7 +26,6 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
-import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index 334b9c4..23e55e2 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -169,6 +169,8 @@
/**
* Sets the switch text color, size, style, hint color, and highlight color
* from the specified TextAppearance resource.
+ *
+ * @attr ref android.R.styleable#Switch_switchTextAppearance
*/
public void setSwitchTextAppearance(Context context, int resid) {
TypedArray appearance =
@@ -274,7 +276,128 @@
}
/**
+ * Set the amount of horizontal padding between the switch and the associated text.
+ *
+ * @param pixels Amount of padding in pixels
+ *
+ * @attr ref android.R.styleable#Switch_switchPadding
+ */
+ public void setSwitchPadding(int pixels) {
+ mSwitchPadding = pixels;
+ requestLayout();
+ }
+
+ /**
+ * Get the amount of horizontal padding between the switch and the associated text.
+ *
+ * @return Amount of padding in pixels
+ *
+ * @attr ref android.R.styleable#Switch_switchPadding
+ */
+ public int getSwitchPadding() {
+ return mSwitchPadding;
+ }
+
+ /**
+ * Set the minimum width of the switch in pixels. The switch's width will be the maximum
+ * of this value and its measured width as determined by the switch drawables and text used.
+ *
+ * @param pixels Minimum width of the switch in pixels
+ *
+ * @attr ref android.R.styleable#Switch_switchMinWidth
+ */
+ public void setSwitchMinWidth(int pixels) {
+ mSwitchMinWidth = pixels;
+ requestLayout();
+ }
+
+ /**
+ * Get the minimum width of the switch in pixels. The switch's width will be the maximum
+ * of this value and its measured width as determined by the switch drawables and text used.
+ *
+ * @return Minimum width of the switch in pixels
+ *
+ * @attr ref android.R.styleable#Switch_switchMinWidth
+ */
+ public int getSwitchMinWidth() {
+ return mSwitchMinWidth;
+ }
+
+ /**
+ * Set the horizontal padding around the text drawn on the switch itself.
+ *
+ * @param pixels Horizontal padding for switch thumb text in pixels
+ *
+ * @attr ref android.R.styleable#Switch_thumbTextPadding
+ */
+ public void setThumbTextPadding(int pixels) {
+ mThumbTextPadding = pixels;
+ requestLayout();
+ }
+
+ /**
+ * Get the horizontal padding around the text drawn on the switch itself.
+ *
+ * @return Horizontal padding for switch thumb text in pixels
+ *
+ * @attr ref android.R.styleable#Switch_thumbTextPadding
+ */
+ public int getThumbTextPadding() {
+ return mThumbTextPadding;
+ }
+
+ /**
+ * Set the drawable used for the track that the switch slides within.
+ *
+ * @param track Track drawable
+ *
+ * @attr ref android.R.styleable#Switch_track
+ */
+ public void setTrackDrawable(Drawable track) {
+ mTrackDrawable = track;
+ requestLayout();
+ }
+
+ /**
+ * Get the drawable used for the track that the switch slides within.
+ *
+ * @return Track drawable
+ *
+ * @attr ref android.R.styleable#Switch_track
+ */
+ public Drawable getTrackDrawable() {
+ return mTrackDrawable;
+ }
+
+ /**
+ * Set the drawable used for the switch "thumb" - the piece that the user
+ * can physically touch and drag along the track.
+ *
+ * @param thumb Thumb drawable
+ *
+ * @attr ref android.R.styleable#Switch_thumb
+ */
+ public void setThumbDrawable(Drawable thumb) {
+ mThumbDrawable = thumb;
+ requestLayout();
+ }
+
+ /**
+ * Get the drawable used for the switch "thumb" - the piece that the user
+ * can physically touch and drag along the track.
+ *
+ * @return Thumb drawable
+ *
+ * @attr ref android.R.styleable#Switch_thumb
+ */
+ public Drawable getThumbDrawable() {
+ return mThumbDrawable;
+ }
+
+ /**
* Returns the text displayed when the button is in the checked state.
+ *
+ * @attr ref android.R.styleable#Switch_textOn
*/
public CharSequence getTextOn() {
return mTextOn;
@@ -282,6 +405,8 @@
/**
* Sets the text displayed when the button is in the checked state.
+ *
+ * @attr ref android.R.styleable#Switch_textOn
*/
public void setTextOn(CharSequence textOn) {
mTextOn = textOn;
@@ -290,6 +415,8 @@
/**
* Returns the text displayed when the button is not in the checked state.
+ *
+ * @attr ref android.R.styleable#Switch_textOff
*/
public CharSequence getTextOff() {
return mTextOff;
@@ -297,6 +424,8 @@
/**
* Sets the text displayed when the button is not in the checked state.
+ *
+ * @attr ref android.R.styleable#Switch_textOff
*/
public void setTextOff(CharSequence textOff) {
mTextOff = textOff;
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 4719010..4c89218 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -216,6 +216,8 @@
* @attr ref android.R.styleable#TextView_drawableBottom
* @attr ref android.R.styleable#TextView_drawableRight
* @attr ref android.R.styleable#TextView_drawableLeft
+ * @attr ref android.R.styleable#TextView_drawableStart
+ * @attr ref android.R.styleable#TextView_drawableEnd
* @attr ref android.R.styleable#TextView_drawablePadding
* @attr ref android.R.styleable#TextView_lineSpacingExtra
* @attr ref android.R.styleable#TextView_lineSpacingMultiplier
@@ -1520,8 +1522,6 @@
/**
* Returns the start padding of the view, plus space for the start
* Drawable if any.
- *
- * @hide
*/
public int getCompoundPaddingStart() {
resolveDrawables();
@@ -1537,8 +1537,6 @@
/**
* Returns the end padding of the view, plus space for the end
* Drawable if any.
- *
- * @hide
*/
public int getCompoundPaddingEnd() {
resolveDrawables();
@@ -1636,8 +1634,6 @@
/**
* Returns the total start padding of the view, including the start
* Drawable if any.
- *
- * @hide
*/
public int getTotalPaddingStart() {
return getCompoundPaddingStart();
@@ -1646,8 +1642,6 @@
/**
* Returns the total end padding of the view, including the end
* Drawable if any.
- *
- * @hide
*/
public int getTotalPaddingEnd() {
return getCompoundPaddingEnd();
@@ -1849,8 +1843,6 @@
* @attr ref android.R.styleable#TextView_drawableTop
* @attr ref android.R.styleable#TextView_drawableEnd
* @attr ref android.R.styleable#TextView_drawableBottom
- *
- * @hide
*/
public void setCompoundDrawablesRelative(Drawable start, Drawable top,
Drawable end, Drawable bottom) {
@@ -1972,8 +1964,6 @@
* @attr ref android.R.styleable#TextView_drawableTop
* @attr ref android.R.styleable#TextView_drawableEnd
* @attr ref android.R.styleable#TextView_drawableBottom
- *
- * @hide
*/
public void setCompoundDrawablesRelativeWithIntrinsicBounds(int start, int top, int end,
int bottom) {
@@ -1996,8 +1986,6 @@
* @attr ref android.R.styleable#TextView_drawableTop
* @attr ref android.R.styleable#TextView_drawableEnd
* @attr ref android.R.styleable#TextView_drawableBottom
- *
- * @hide
*/
public void setCompoundDrawablesRelativeWithIntrinsicBounds(Drawable start, Drawable top,
Drawable end, Drawable bottom) {
@@ -2034,8 +2022,6 @@
/**
* Returns drawables for the start, top, end, and bottom borders.
- *
- * @hide
*/
public Drawable[] getCompoundDrawablesRelative() {
final Drawables dr = mDrawables;
@@ -2093,6 +2079,20 @@
invalidate();
}
+ @Override
+ public void setPaddingRelative(int start, int top, int end, int bottom) {
+ if (start != getPaddingStart() ||
+ end != getPaddingEnd() ||
+ top != mPaddingTop ||
+ bottom != mPaddingBottom) {
+ nullLayouts();
+ }
+
+ // the super call will requestLayout()
+ super.setPaddingRelative(start, top, end, bottom);
+ invalidate();
+ }
+
/**
* Gets the autolink mask of the text. See {@link
* android.text.util.Linkify#ALL Linkify.ALL} and peers for
@@ -4280,6 +4280,12 @@
}
@Override
+ public void onScreenStateChanged(int screenState) {
+ super.onScreenStateChanged(screenState);
+ if (mEditor != null) getEditor().onScreenStateChanged(screenState);
+ }
+
+ @Override
protected boolean isPaddingOffsetRequired() {
return mShadowRadius != 0 || mDrawables != null;
}
@@ -11400,6 +11406,30 @@
hideControllers();
}
+ void onScreenStateChanged(int screenState) {
+ switch (screenState) {
+ case SCREEN_STATE_ON:
+ resumeBlink();
+ break;
+ case SCREEN_STATE_OFF:
+ suspendBlink();
+ break;
+ }
+ }
+
+ private void suspendBlink() {
+ if (mBlink != null) {
+ mBlink.cancel();
+ }
+ }
+
+ private void resumeBlink() {
+ if (mBlink != null) {
+ mBlink.uncancel();
+ makeBlink();
+ }
+ }
+
void adjustInputType(boolean password, boolean passwordInputType,
boolean webPasswordInputType, boolean numberPasswordInputType) {
// mInputType has been set from inputType, possibly modified by mInputMethod.
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 6a99a2b..998c037 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -348,6 +348,7 @@
TypedArray ar = mResources.obtainTypedArray(
com.android.internal.R.array.preloaded_drawables);
int N = preloadDrawables(runtime, ar);
+ ar.recycle();
Log.i(TAG, "...preloaded " + N + " resources in "
+ (SystemClock.uptimeMillis()-startTime) + "ms.");
@@ -355,6 +356,7 @@
ar = mResources.obtainTypedArray(
com.android.internal.R.array.preloaded_color_state_lists);
N = preloadColorStateLists(runtime, ar);
+ ar.recycle();
Log.i(TAG, "...preloaded " + N + " resources in "
+ (SystemClock.uptimeMillis()-startTime) + "ms.");
}
diff --git a/core/java/com/android/internal/view/BaseIWindow.java b/core/java/com/android/internal/view/BaseIWindow.java
index b227700..15d11d8 100644
--- a/core/java/com/android/internal/view/BaseIWindow.java
+++ b/core/java/com/android/internal/view/BaseIWindow.java
@@ -49,6 +49,9 @@
public void dispatchGetNewSurface() {
}
+ public void dispatchScreenState(boolean on) {
+ }
+
public void windowFocusChanged(boolean hasFocus, boolean touchEnabled) {
}
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index c6d3cee..c389cf7 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -159,12 +159,10 @@
$(JNI_H_INCLUDE) \
$(LOCAL_PATH)/android/graphics \
$(LOCAL_PATH)/../../libs/hwui \
- $(LOCAL_PATH)/../../opengl/libs \
+ $(LOCAL_PATH)/../../../native/opengl/libs \
$(call include-path-for, bluedroid) \
$(call include-path-for, libhardware)/hardware \
$(call include-path-for, libhardware_legacy)/hardware_legacy \
- $(LOCAL_PATH)/../../include/ui \
- $(LOCAL_PATH)/../../include/utils \
external/skia/include/core \
external/skia/include/effects \
external/skia/include/images \
diff --git a/core/res/res/layout/webview_select_singlechoice.xml b/core/res/res/layout/webview_select_singlechoice.xml
index c0753a8..d3c3c15 100644
--- a/core/res/res/layout/webview_select_singlechoice.xml
+++ b/core/res/res/layout/webview_select_singlechoice.xml
@@ -17,13 +17,7 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:textColor="?android:attr/textColorAlertDialogListItem"
- android:gravity="center_vertical"
- android:paddingLeft="12dip"
- android:paddingRight="7dip"
+ android:layout_height="?android:attr/dropdownListPreferredItemHeight"
android:ellipsize="marquee"
style="?android:attr/spinnerDropDownItemStyle"
android:background="?android:attr/activatedBackgroundIndicator"
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 4900a5d..9ac20fa 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"GB"</string>
<string name="terabyteShort" msgid="231613018159186962">"TB"</string>
<string name="petabyteShort" msgid="5637816680144990219">"PB"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="UNIT">%2$s</xliff:g><xliff:g id="NUMBER">%1$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<Titelloos>"</string>
<string name="ellipsis" msgid="7899829516048813237">"…"</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"‥"</string>
@@ -314,8 +313,8 @@
<string name="permlab_changeComponentState" msgid="6335576775711095931">"aktiveer of deaktiveer programkomponente"</string>
<string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"Laat die program toe om te verander of \'n komponent van ander program geaktiveer is of nie. Kwaadwillige programme kan dit dalk gebruik om belangrike tabletvermoëns te deaktiveer. Wees versigtig met hierdie toestemming, want dit kan programkomponente tot \'n onbruikbare, inkonsekwente of onstabiele toestand bring."</string>
<string name="permdesc_changeComponentState" product="default" msgid="1827232484416505615">"Laat die program toe om te verander of \'n komponent van ander program geaktiveer is of nie. Kwaadwillige programme kan dit gebruik om belangrike foonvermoëns te deaktiveer. Wees versigtig met hierdie toestemming, want dit kan programkomponente tot \'n onbruikbare, inkonsekwente of onstabiele toestand bring."</string>
- <string name="permlab_grantRevokePermissions" msgid="4627315351093508795">"toestemmings te verleen of te herroep"</string>
- <string name="permdesc_grantRevokePermissions" msgid="4088642654085850662">"Laat \'n program toe om spesifieke toestemmings te verleen of te herroep vir die betrokke program of ander programme. Skadelike programme kan dit gebruik om toegang te verkry tot kenmerke waarvoor jy nie toestemming verleen het nie."</string>
+ <string name="permlab_grantRevokePermissions" msgid="4627315351093508795">"verleen of herroep toestemmings"</string>
+ <string name="permdesc_grantRevokePermissions" msgid="4088642654085850662">"Laat \'n program toe om spesifieke toestemmings te verleen of te herroep vir die betrokke program of ander programme. Kwaadwillige programme kan dit gebruik om toegang te verkry tot kenmerke waarvoor jy nie toestemming verleen het nie."</string>
<string name="permlab_setPreferredApplications" msgid="8463181628695396391">"stel voorkeurprogramme"</string>
<string name="permdesc_setPreferredApplications" msgid="4973986762241783712">"Laat die program toe om jou voorkeur-programme te verander. Kwaadwillige programme kan stilweg die programme wat loop, verander, wat jou bestaande programme bedrieg om private data oor jou in te samel."</string>
<string name="permlab_writeSettings" msgid="1365523497395143704">"verander globale stelselinstellings"</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Maksimum gesigontsluit-pogings oorskry"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Laai, (<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Gehef."</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Koppel jou herlaaier."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Geen SIM-kaart."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Geen SIM-kaart in tablet nie."</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"Fabriektoets het gefaal"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"Die FACTORY_TEST-handeling word net ondersteun vir pakkette wat in /system/app geïnstalleer is."</string>
<string name="factorytest_no_action" msgid="872991874799998561">"Geen pakket is gevind wat die FACTORY_TEST-handeling bied nie."</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"Wenk: Dubbeltik om in en uit te zoem."</string>
<string name="autofill_this_form" msgid="4616758841157816676">"Outovul"</string>
<string name="setup_autofill" msgid="7103495070180590814">"Stel outovul op"</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index f2538c6..dc74d94 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -341,7 +341,7 @@
<string name="permdesc_writeProfile" product="default" msgid="4637366723793045603">"ልክ እንደ አንተ ስም እና የዕውቂያ መረጃ ፣ ባንተ መሳሪያ ወስጥ የተከማቹ የግል መገለጫ መረጃ ለመለወጥ ወይም ለማከል ለመተግበሪያው ይፈቅዳሉ፡፡ይሄም ማለት ሌሎች መተግበሪያዎች ሊለዩህ ይችላሉ እና ለሌሎች የመገለጫ መረጃህን ይልካሉ፡፡"</string>
<string name="permlab_readSocialStream" product="default" msgid="1268920956152419170">"የአንተን ማህበራዊ የውይይት ክፍሎች አንብብ"</string>
<string name="permdesc_readSocialStream" product="default" msgid="3419050808547335320">" ከአንተ ጓደኞች ማህበራዊ ዝማኔዎችን እንዲደርስባቸው እና እንዲያመሳስል ለመተግበሪያውይፈቅዳሉ፡፡ ተንኮል አዘል መተግበሪያዎች ይህን መዳረሻ ባንተና በጓደኞችህ መካከል በማህበራዊ አውታረመረቦች ያሉ የግል ተግባቦቶችን ለመዳረስ ሊጠቀሙበት ይችላሉ፡፡"</string>
- <string name="permlab_writeSocialStream" product="default" msgid="3504179222493235645">"ወደ ያንተ ማህበራዊ የውይይት ክፍሎች ጻፍ"</string>
+ <string name="permlab_writeSocialStream" product="default" msgid="3504179222493235645">"ወደ የአንተ ማህበራዊ የውይይት ክፍሎች ጻፍ"</string>
<string name="permdesc_writeSocialStream" product="default" msgid="3496277176955721451">" የጓደኞችህን ማህበራዊ ዝማኔዎችን ለማሳየት ለመተግበሪያው ይፈቅዳሉ፡፡ ተንኮል አዘል መተግበሪያዎች ይህን መዳረሻ ጓደኛ መስለው ለመቅረብ እና የይለፍ ቃልና ሌላ ምስጢራዊ መረጃ እንድትሰጥ ለማድረግ ሊጠቀሙበት ይችላሉ፡፡"</string>
<string name="permlab_readCalendar" msgid="5972727560257612398">"የቀን መቁጠሪያ ክስተቶች ተጨማሪ ሚስጥራዊ መረጃ አንብብ"</string>
<string name="permdesc_readCalendar" product="tablet" msgid="2338414551004122687">"በጡባዊ ተኮህ ላይ የተከማቹ ሁሉንም የቀን መቁጠሪያ ክስተቶች መተግበሪያዎቹ እንዲያነቡ ይፈቅዳሉ፡፡ ያለ ባለቤቱ እውቅና ከነዚህ የቀን መቁጠሪያዎች የግል መረጃዎችን ጎጂ መተግበሪያዎች ያወጣሉ፡፡"</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 3daf33a..c277ee9 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"ГБ"</string>
<string name="terabyteShort" msgid="231613018159186962">"ТБ"</string>
<string name="petabyteShort" msgid="5637816680144990219">"ПБ"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g> <xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<Без заглавие>"</string>
<string name="ellipsis" msgid="7899829516048813237">"…"</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">".."</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Максималният брой опити за отключване с лице е надвишен"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Зарежда се, <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Зареден."</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Свържете зарядното си устройство."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Няма SIM карта."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"В таблета няма SIM карта."</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"АБВ"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"Фабричният тест не бе успешен"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"Действието FACTORY_TEST се поддържа само за пакети, инсталирани в /system/app."</string>
<string name="factorytest_no_action" msgid="872991874799998561">"Не бе намерен пакет, предоставящ действието FACTORY_TEST."</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"Съвет: Докоснете двукратно, за да увеличите или намалите мащаба."</string>
<string name="autofill_this_form" msgid="4616758841157816676">"Автопоп."</string>
<string name="setup_autofill" msgid="7103495070180590814">"Автопоп.: Настройка"</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
@@ -773,10 +768,8 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"Разрешава на притежателя достъп до серийни портове посредством приложния програмен интерфейс (API) SerialManager."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"външен достъп до доставчиците на съдърж."</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Разрешава на притежателя достъп до доставчиците на съдържание от командния ред. Нормалните приложения би трябвало никога да не се нуждаят от това."</string>
- <!-- no translation found for permlab_updateLock (3527558366616680889) -->
- <skip />
- <!-- no translation found for permdesc_updateLock (1655625832166778492) -->
- <skip />
+ <string name="permlab_updateLock" msgid="3527558366616680889">"без авт. актуализации на устройството"</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"Разрешава на притежателя да предложи на системата информация за това, кога ще е възможно неинтерактивно рестартиране за надстройване на устройството."</string>
<string name="save_password_message" msgid="767344687139195790">"Искате ли браузърът да запомни тази парола?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Не сега"</string>
<string name="save_password_remember" msgid="6491879678996749466">"Запомняне"</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index 8ea7711..389a672 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -768,7 +768,7 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"Umožňuje držiteli přístup k sériovým portům pomocí rozhraní SerialManager API."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"externí přístup k poskytovatelům obsahu"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Umožňuje držiteli získat z příkazového řádku přístup k poskytovatelům obsahu. Běžné aplikace by toto oprávnění neměly nikdy požadovat."</string>
- <string name="permlab_updateLock" msgid="3527558366616680889">"varování před automatickou aktualizací"</string>
+ <string name="permlab_updateLock" msgid="3527558366616680889">"varovat před automatickou aktualizací"</string>
<string name="permdesc_updateLock" msgid="1655625832166778492">"Umožňuje držiteli navrhnout systému informace o vhodné době pro upgrade zařízení neinteraktivním restartováním."</string>
<string name="save_password_message" msgid="767344687139195790">"Chcete, aby si prohlížeč zapamatoval toto heslo?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Nyní ne"</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 6fd4543..3ca0534 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -769,7 +769,7 @@
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"adgang til indholdsleverandører eksternt"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Giver indehaveren adgang til indholdsleverandører fra startsiden. Bør aldrig være nødvendigt for normale apps."</string>
<string name="permlab_updateLock" msgid="3527558366616680889">"undgå automatiske enhedsopdateringer"</string>
- <string name="permdesc_updateLock" msgid="1655625832166778492">"Giver indehaveren ret til at give systemet oplysninger om, hvornår det vil være et godt tidspunkt for en ikke-interaktiv genstart at opgradere enheden."</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"Giver indehaveren ret til at give systemet oplysninger om, hvornår det vil være et godt tidspunkt for en ikke-interaktiv genstart for at opgradere enheden."</string>
<string name="save_password_message" msgid="767344687139195790">"Ønsker du, at browseren skal huske denne adgangskode?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Ikke nu"</string>
<string name="save_password_remember" msgid="6491879678996749466">"Husk"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 1a0d479..8e36948 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -671,7 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Se superó el máximo de intentos permitido para el desbloqueo facial del dispositivo."</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Cargando <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Cargada."</string>
- <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g> <xliff:g id="PERCENT">%%</xliff:g>"</string>
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Conecta tu cargador."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"No hay tarjeta SIM."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"No hay tarjeta SIM en el tablet."</string>
@@ -768,8 +768,8 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"Permite acceder a puertos serie a través de la API SerialManager."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"acceder a proveedores externamente"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Permite acceder a los proveedores de contenido desde la interfaz. Las aplicaciones normales nunca deberían necesitarlo."</string>
- <string name="permlab_updateLock" msgid="3527558366616680889">"desalentar a las actualizaciones automáticas de dispositivos"</string>
- <string name="permdesc_updateLock" msgid="1655625832166778492">"Permite a su titular a ofrecer información al sistema acerca de cuándo sería un buen momento para reiniciar el sistema no interactivo para actualizar el dispositivo."</string>
+ <string name="permlab_updateLock" msgid="3527558366616680889">"no realizar actualizaciones automáticas"</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"Permite a su propietario ofrecer información al sistema acerca de cuándo sería adecuado reiniciar el sistema de forma no interactiva y actualizar el dispositivo."</string>
<string name="save_password_message" msgid="767344687139195790">"¿Quieres recordar esta contraseña en el navegador?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Ahora no."</string>
<string name="save_password_remember" msgid="6491879678996749466">"Recuerda"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 3b7bd0f..a4a9bff 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -768,10 +768,8 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"به دارنده اجازه میدهد با استفاده از SerialManager API به درگاههای سریال دسترسی داشته باشد."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"دسترسی خارجی به ارائهدهندگان محتوا"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"به دارنده اجازه میدهد تا از خارج برنامه به ارائهدهندگان محتوا دسترسی داشته باشد. هرگز برای برنامههای معمولی به آن نیازی نیست."</string>
- <!-- no translation found for permlab_updateLock (3527558366616680889) -->
- <skip />
- <!-- no translation found for permdesc_updateLock (1655625832166778492) -->
- <skip />
+ <string name="permlab_updateLock" msgid="3527558366616680889">"ترغیب به انجام ندادن بهروزرسانیهای خودکار دستگاه"</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"به دارنده اجازه میدهد اطلاعاتی در مورد زمان مناسب برای یک راهاندازی مجدد غیرتعاملی جهت ارتقای دستگاه را به سیستم ارائه دهد."</string>
<string name="save_password_message" msgid="767344687139195790">"می خواهید مرورگر این رمز ورود را به خاطر داشته باشد؟"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"اکنون خیر"</string>
<string name="save_password_remember" msgid="6491879678996749466">"به خاطر سپردن"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index e59cb22..b19a7de 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"Go"</string>
<string name="terabyteShort" msgid="231613018159186962">"To"</string>
<string name="petabyteShort" msgid="5637816680144990219">"Po"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g> <xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<Sans nom>"</string>
<string name="ellipsis" msgid="7899829516048813237">"…"</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"‥"</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Nombre maximal autorisé de tentatives Face Unlock atteint."</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"En charge (<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>)"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Chargé"</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g> <xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Branchez votre chargeur."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Aucune carte SIM n\'a été trouvée."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Aucune carte SIM n\'est insérée dans la tablette."</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"Échec du test usine"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"L\'action FACTORY_TEST est uniquement prise en charge pour les paquets de données installés dans in/system/app."</string>
<string name="factorytest_no_action" msgid="872991874799998561">"Impossible de trouver un paquet proposant l\'action FACTORY_TEST."</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"Conseil : Appuyez deux fois pour faire un zoom avant ou arrière."</string>
<string name="autofill_this_form" msgid="4616758841157816676">"Saisie auto"</string>
<string name="setup_autofill" msgid="7103495070180590814">"Conf. saisie auto"</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
@@ -870,8 +865,8 @@
<string name="days" msgid="4774547661021344602">"jours"</string>
<string name="hour" msgid="2126771916426189481">"heure"</string>
<string name="hours" msgid="894424005266852993">"heures"</string>
- <string name="minute" msgid="9148878657703769868">"mn"</string>
- <string name="minutes" msgid="5646001005827034509">"mn"</string>
+ <string name="minute" msgid="9148878657703769868">"min"</string>
+ <string name="minutes" msgid="5646001005827034509">"min"</string>
<string name="second" msgid="3184235808021478">"s"</string>
<string name="seconds" msgid="3161515347216589235">"s"</string>
<string name="week" msgid="5617961537173061583">"semaine"</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 5343e04..fbd3a3d 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -769,7 +769,7 @@
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"pristup pružateljima sadržaja izvana"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Omogućuje vlasniku pristup pružateljima sadržaja iz programske ovojnice. Ne bi trebalo biti potrebno za normalne aplikacije."</string>
<string name="permlab_updateLock" msgid="3527558366616680889">"odvratiti automatska ažuriranja uređaja"</string>
- <string name="permdesc_updateLock" msgid="1655625832166778492">"Omogućuje vlasniku davanje informacija sustavu o pogodnom trenutku za nadogradnju uređaja putem ponovnog pokretanja bez interakcije."</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"Omogućuje vlasniku davanje informacija sustavu o pogodnom trenutku za nadogradnju uređaja ponovnim pokretanjem bez interakcije."</string>
<string name="save_password_message" msgid="767344687139195790">"Želite li da preglednik zapamti ovu zaporku?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Ne sada"</string>
<string name="save_password_remember" msgid="6491879678996749466">"Zapamti"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 603a7be..7d08048 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -68,7 +68,7 @@
<string name="CLIRDefaultOffNextCallOn" msgid="6179425182856418465">"Nomor penelepon bawaan tidak dibatasi. Panggilan selanjutnya: Dibatasi"</string>
<string name="CLIRDefaultOffNextCallOff" msgid="2567998633124408552">"Nomor penelepon bawaan tidak dibatasi. Panggilan selanjutnya: Tidak dibatasi"</string>
<string name="serviceNotProvisioned" msgid="8614830180508686666">"Layanan tidak diperlengkapi."</string>
- <string name="CLIRPermanent" msgid="3377371145926835671">"Anda tidak dapat mengubah setelan nomor penelepon."</string>
+ <string name="CLIRPermanent" msgid="3377371145926835671">"Anda tidak dapat mengubah pengaturan nomor penelepon."</string>
<string name="RestrictedChangedTitle" msgid="5592189398956187498">"Akses terbatas berubah"</string>
<string name="RestrictedOnData" msgid="8653794784690065540">"Layanan data dicekal."</string>
<string name="RestrictedOnEmergency" msgid="6581163779072833665">"Layanan darurat dicekal."</string>
@@ -120,15 +120,15 @@
<string name="httpErrorUnsupportedScheme" msgid="5015730812906192208">"Protokol tidak didukung."</string>
<string name="httpErrorFailedSslHandshake" msgid="96549606000658641">"Tidak dapat membuat sambungan aman."</string>
<string name="httpErrorBadUrl" msgid="3636929722728881972">"Tidak dapat membuka laman karena URL tidak valid."</string>
- <string name="httpErrorFile" msgid="2170788515052558676">"Tidak dapat mengakses berkas."</string>
- <string name="httpErrorFileNotFound" msgid="6203856612042655084">"Tidak dapat menemukan berkas yang diminta."</string>
+ <string name="httpErrorFile" msgid="2170788515052558676">"Tidak dapat mengakses file."</string>
+ <string name="httpErrorFileNotFound" msgid="6203856612042655084">"Tidak dapat menemukan file yang diminta."</string>
<string name="httpErrorTooManyRequests" msgid="1235396927087188253">"Terlalu banyak permintaan yang diproses. Coba lagi nanti."</string>
<string name="notification_title" msgid="8967710025036163822">"Galat saat masuk untuk <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
<string name="contentServiceSync" msgid="8353523060269335667">"Sinkron"</string>
<string name="contentServiceSyncNotificationTitle" msgid="397743349191901458">"Sinkron"</string>
<string name="contentServiceTooManyDeletesNotificationDesc" msgid="8100981435080696431">"Terlalu banyak <xliff:g id="CONTENT_TYPE">%s</xliff:g> penghapusan."</string>
- <string name="low_memory" product="tablet" msgid="6494019234102154896">"Penyimpanan tablet penuh. Hapus beberapa berkas untuk mengosongkan ruang."</string>
- <string name="low_memory" product="default" msgid="3475999286680000541">"Penyimpanan di ponsel penuh. Hapus sebagian berkas untuk mengosongkan ruang."</string>
+ <string name="low_memory" product="tablet" msgid="6494019234102154896">"Penyimpanan tablet penuh. Hapus beberapa file untuk mengosongkan ruang."</string>
+ <string name="low_memory" product="default" msgid="3475999286680000541">"Penyimpanan di ponsel penuh. Hapus sebagian file untuk mengosongkan ruang."</string>
<string name="me" msgid="6545696007631404292">"Saya"</string>
<string name="power_dialog" product="tablet" msgid="8545351420865202853">"Opsi tablet"</string>
<string name="power_dialog" product="default" msgid="1319919075463988638">"Opsi telepon"</string>
@@ -219,7 +219,7 @@
<string name="permdesc_setScreenCompatibility" msgid="692043618693917374">"Memungkinkan apl mengontrol mode kompatibilitas layar aplikasi lain. Aplikasi berbahaya dapat merusak perilaku aplikasi lain."</string>
<string name="permlab_setDebugApp" msgid="3022107198686584052">"mengaktifkan debugging apl"</string>
<string name="permdesc_setDebugApp" msgid="4474512416299013256">"Mengizinkan apl mengaktifkan debugging untuk apl lain. Apl berbahaya dapat menggunakan cara ini untuk menutup apl lain."</string>
- <string name="permlab_changeConfiguration" msgid="8214475779521218295">"ubah setelan UI Anda"</string>
+ <string name="permlab_changeConfiguration" msgid="8214475779521218295">"ubah pengaturan UI Anda"</string>
<string name="permdesc_changeConfiguration" msgid="4372223873154296076">"Mengizinkan apl mengubah konfigurasi saat ini, misalnya lokal atau ukuran fon keseluruhan."</string>
<string name="permlab_enableCarMode" msgid="5684504058192921098">"aktifkan mode mobil"</string>
<string name="permdesc_enableCarMode" msgid="4853187425751419467">"Mengizinkan apl mengaktifkan mode mobil."</string>
@@ -293,23 +293,23 @@
<string name="permlab_clearAppUserData" msgid="274109191845842756">"menghapus data apl lainnya"</string>
<string name="permdesc_clearAppUserData" msgid="4625323684125459488">"Mengizinkan apl menghapus data pengguna."</string>
<string name="permlab_deleteCacheFiles" msgid="3128665571837408675">"menghapus tembolok apl lainnya"</string>
- <string name="permdesc_deleteCacheFiles" msgid="3812998599006730196">"Mengizinkan apl menghapus berkas tembolok."</string>
+ <string name="permdesc_deleteCacheFiles" msgid="3812998599006730196">"Mengizinkan apl menghapus file tembolok."</string>
<string name="permlab_getPackageSize" msgid="7472921768357981986">"mengukur ruang penyimpanan apl"</string>
<string name="permdesc_getPackageSize" msgid="3921068154420738296">"Mengizinkan apl mengambil kode, data, dan ukuran temboloknya"</string>
<string name="permlab_installPackages" msgid="2199128482820306924">"langsung memasang apl"</string>
<string name="permdesc_installPackages" msgid="5628530972548071284">"Mengizinkan apl memasang paket Android yang baru atau diperbarui. Apl berbahaya dapat menggunakan ini untuk menambahkan apl baru dengan sembarang izin yang kuat."</string>
<string name="permlab_clearAppCache" msgid="7487279391723526815">"menghapus semua data tembolok apl"</string>
- <string name="permdesc_clearAppCache" product="tablet" msgid="3523396284474042284">"Mengizinkan apl mengosongkan penyimpanan tablet dengan menghapus berkas dalam direktori tembolok apl. Akses biasanya sangat terbatas dan hanya diberikan bagi proses sistem."</string>
- <string name="permdesc_clearAppCache" product="default" msgid="5067988373366292186">"Mengizinkan apl mengosongkan penyimpanan ponsel dengan menghapus berkas dalam direktori tembolok apl. Akses biasanya sangat terbatas dan hanya diberikan bagi proses sistem."</string>
+ <string name="permdesc_clearAppCache" product="tablet" msgid="3523396284474042284">"Mengizinkan apl mengosongkan penyimpanan tablet dengan menghapus file dalam direktori tembolok apl. Akses biasanya sangat terbatas dan hanya diberikan bagi proses sistem."</string>
+ <string name="permdesc_clearAppCache" product="default" msgid="5067988373366292186">"Mengizinkan apl mengosongkan penyimpanan ponsel dengan menghapus file dalam direktori tembolok apl. Akses biasanya sangat terbatas dan hanya diberikan bagi proses sistem."</string>
<string name="permlab_movePackage" msgid="3289890271645921411">"memindahkan sumber daya apl"</string>
<string name="permdesc_movePackage" msgid="319562217778244524">"Mengizinkan apl memindahkan sumber daya apl dari media internal ke eksternal dan sebaliknya."</string>
<string name="permlab_readLogs" msgid="6615778543198967614">"baca data log sensitif"</string>
- <string name="permdesc_readLogs" product="tablet" msgid="82061313293455151">"Mengizinkan apl membaca dari berbagai berkas log sistem. Izin ini memungkinkan apl menemukan informasi umum tentang hal-hal yang Anda lakukan dengan tablet, kemungkinan termasuk informasi pribadi."</string>
- <string name="permdesc_readLogs" product="default" msgid="2063438140241560443">"Mengizinkan apl membaca dari berbagai berkas log sistem. Izin ini memungkinkan apl menemukan informasi umum tentang hal-hal yang Anda lakukan di ponsel, kemungkinan termasuk informasi pribadi."</string>
+ <string name="permdesc_readLogs" product="tablet" msgid="82061313293455151">"Mengizinkan apl membaca dari berbagai file log sistem. Izin ini memungkinkan apl menemukan informasi umum tentang hal-hal yang Anda lakukan dengan tablet, kemungkinan termasuk informasi pribadi."</string>
+ <string name="permdesc_readLogs" product="default" msgid="2063438140241560443">"Mengizinkan apl membaca dari berbagai file log sistem. Izin ini memungkinkan apl menemukan informasi umum tentang hal-hal yang Anda lakukan di ponsel, kemungkinan termasuk informasi pribadi."</string>
<string name="permlab_anyCodecForPlayback" msgid="715805555823881818">"menggunakan media pengawasandi apa pun untuk pemutaran"</string>
<string name="permdesc_anyCodecForPlayback" msgid="8283912488433189010">"Mengizinkan apl menggunakan pengawasandi media apa pun yang terpasang guna mengawasandikan media untuk diputar."</string>
<string name="permlab_diagnostic" msgid="8076743953908000342">"baca/tulis ke sumber daya yang dimiliki oleh diag"</string>
- <string name="permdesc_diagnostic" msgid="6608295692002452283">"Mengizinkan apl membaca dan menulis ke sumber daya apa pun yang dimiliki oleh grup diag; misalnya, berkas dalam /dev. Izin ini berpotensi mempengaruhi kestabilan dan keamanan sistem. Sebaiknya ini HANYA digunakan untuk diagnostik khusus perangkat keras oleh pabrikan atau operator."</string>
+ <string name="permdesc_diagnostic" msgid="6608295692002452283">"Mengizinkan apl membaca dan menulis ke sumber daya apa pun yang dimiliki oleh grup diag; misalnya, file dalam /dev. Izin ini berpotensi mempengaruhi kestabilan dan keamanan sistem. Sebaiknya ini HANYA digunakan untuk diagnostik khusus perangkat keras oleh pabrikan atau operator."</string>
<string name="permlab_changeComponentState" msgid="6335576775711095931">"mengaktifkan atau menonaktifkan komponen apl"</string>
<string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"Mengizinkan apl mengubah apakah komponen apl lain diaktifkan atau tidak. Apl berbahaya dapat menggunakan ini untuk menonaktifkan kemampuan tablet yang penting. Izin ini harus digunakan dengan hati-hati karena dapat menjadikan komponen apl tidak dapat digunakan, tidak konsisten, atau tidak stabil."</string>
<string name="permdesc_changeComponentState" product="default" msgid="1827232484416505615">"Mengizinkan apl mengubah apakah komponen apl lain diaktifkan atau tidak. Apl berbahaya dapat menggunakan izin ini untuk menonaktifkan kemampuan ponsel yang penting. Izin ini harus digunakan dengan hati-hati, karena mungkin saja menjadikan komponen apl tidak dapat digunakan, tidak konsisten, atau tidak stabil."</string>
@@ -317,10 +317,10 @@
<string name="permdesc_grantRevokePermissions" msgid="4088642654085850662">"Memungkinkan aplikasi memberikan atau mencabut izin khusus untuk aplikasi tersebut atau aplikasi lainnya. Aplikasi berbahaya dapat menggunakannya untuk mengakses fitur yang tidak Anda beri izin."</string>
<string name="permlab_setPreferredApplications" msgid="8463181628695396391">"menyetel apl yang disukai"</string>
<string name="permdesc_setPreferredApplications" msgid="4973986762241783712">"Mengizinkan apl memodifikasi apl pilihan Anda. Apl berbahaya dapat diam-diam mengubah apl yang berjalan, menipu apl yang ada untuk mengumpulkan data pribadi dari Anda."</string>
- <string name="permlab_writeSettings" msgid="1365523497395143704">"ubah setelan sistem global"</string>
- <string name="permdesc_writeSettings" msgid="7775723441558907181">"Mengizinkan apl memodifikasi data setelan sistem. Apl berbahaya dapat merusak konfigurasi sistem anda."</string>
- <string name="permlab_writeSecureSettings" msgid="204676251876718288">"ubah setelan sistem aman"</string>
- <string name="permdesc_writeSecureSettings" msgid="8159535613020137391">"Mengizinkan apl memodifikasi data setelan aman sistem. Tidak untuk digunakan oleh apl normal."</string>
+ <string name="permlab_writeSettings" msgid="1365523497395143704">"ubah pengaturan sistem global"</string>
+ <string name="permdesc_writeSettings" msgid="7775723441558907181">"Mengizinkan apl memodifikasi data pengaturan sistem. Apl berbahaya dapat merusak konfigurasi sistem anda."</string>
+ <string name="permlab_writeSecureSettings" msgid="204676251876718288">"ubah pengaturan sistem aman"</string>
+ <string name="permdesc_writeSecureSettings" msgid="8159535613020137391">"Mengizinkan apl memodifikasi data pengaturan aman sistem. Tidak untuk digunakan oleh apl normal."</string>
<string name="permlab_writeGservices" msgid="2149426664226152185">"ubah peta layanan Google"</string>
<string name="permdesc_writeGservices" msgid="1287309437638380229">"Mengizinkan apl memodifikasi peta layanan Google. Tidak untuk digunakan oleh apl normal."</string>
<string name="permlab_receiveBootCompleted" msgid="7776779842866993377">"mulai secara otomatis pada saat boot"</string>
@@ -364,8 +364,8 @@
<string name="permdesc_accessSurfaceFlinger" msgid="1041619516733293551">"Mengizinkan apl menggunakan fitur tingkat rendah SurfaceFlinger."</string>
<string name="permlab_readFrameBuffer" msgid="6690504248178498136">"baca buffer frame"</string>
<string name="permdesc_readFrameBuffer" msgid="4937405521809454680">"Mengizinkan apl membaca konten penyangga frame."</string>
- <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"ubah setelan audio Anda"</string>
- <string name="permdesc_modifyAudioSettings" msgid="7343951185408396919">"Mengizinkan apl memodifikasi setelan audio global, misalnya volume dan perutean."</string>
+ <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"ubah pengaturan audio Anda"</string>
+ <string name="permdesc_modifyAudioSettings" msgid="7343951185408396919">"Mengizinkan apl memodifikasi pengaturan audio global, misalnya volume dan perutean."</string>
<string name="permlab_recordAudio" msgid="3876049771427466323">"rekam audio"</string>
<string name="permdesc_recordAudio" msgid="2387462233976248635">"Mengizinkan apl mengakses jalur rekaman audio."</string>
<string name="permlab_camera" msgid="3616391919559751192">"ambil gambar dan video"</string>
@@ -379,7 +379,7 @@
<string name="permdesc_reboot" product="tablet" msgid="8172056180063700741">"Mengizinkan apl memaksa tablet melakukan reboot."</string>
<string name="permdesc_reboot" product="default" msgid="5326008124289989969">"Mengizinkan apl memaksa ponsel melakukan reboot."</string>
<string name="permlab_mount_unmount_filesystems" msgid="1761023272170956541">"pasang dan lepas filesystem"</string>
- <string name="permdesc_mount_unmount_filesystems" msgid="1829290701658992347">"Mengizinkan apl memasang dan melepas sistem berkas untuk penyimpanan yang dapat dicopot."</string>
+ <string name="permdesc_mount_unmount_filesystems" msgid="1829290701658992347">"Mengizinkan apl memasang dan melepas sistem file untuk penyimpanan yang dapat dicopot."</string>
<string name="permlab_mount_format_filesystems" msgid="5523285143576718981">"format penyimpanan eksternal"</string>
<string name="permdesc_mount_format_filesystems" msgid="8784268246779198627">"Mengizinkan apl memformat penyimpanan yang dapat dicopot."</string>
<string name="permlab_asec_access" msgid="3411338632002193846">"dapatkan informasi pada penyimpanan internal"</string>
@@ -434,8 +434,8 @@
<string name="permdesc_setWallpaper" msgid="7373447920977624745">"Mengizinkan apl menyetel wallpaper sistem."</string>
<string name="permlab_setWallpaperHints" msgid="3600721069353106851">"atur petunjuk ukuran wallpaper"</string>
<string name="permdesc_setWallpaperHints" msgid="8235784384223730091">"Mengizinkan apl menyetel petunjuk ukuran wallpaper sistem."</string>
- <string name="permlab_masterClear" msgid="2315750423139697397">"setel ulang sistem ke setelan bawaan pabrik"</string>
- <string name="permdesc_masterClear" msgid="3665380492633910226">"Mengizinkan apl menyetel ulang sistem ke setelan pabrik sepenuhnya, menghapus semua data, konfigurasi, dan apl yang terpasang."</string>
+ <string name="permlab_masterClear" msgid="2315750423139697397">"setel ulang sistem ke pengaturan bawaan pabrik"</string>
+ <string name="permdesc_masterClear" msgid="3665380492633910226">"Mengizinkan apl menyetel ulang sistem ke pengaturan pabrik sepenuhnya, menghapus semua data, konfigurasi, dan apl yang terpasang."</string>
<string name="permlab_setTime" msgid="2021614829591775646">"atur waktu"</string>
<string name="permdesc_setTime" product="tablet" msgid="1896341438151152881">"Mengizinkan apl mengubah waktu pada jam tablet."</string>
<string name="permdesc_setTime" product="default" msgid="1855702730738020">"Mengizinkan apl mengubah waktu pada jam ponsel."</string>
@@ -457,14 +457,14 @@
<string name="permdesc_accessNetworkState" msgid="479772796952547198">"Mengizinkan apl melihat keadaan semua jaringan."</string>
<string name="permlab_createNetworkSockets" msgid="9121633680349549585">"akses internet penuh"</string>
<string name="permdesc_createNetworkSockets" msgid="5963922297444265950">"Mengizinkan apl membuat soket jaringan."</string>
- <string name="permlab_writeApnSettings" msgid="505660159675751896">"mengubah/mencegat lalu lintas dan setelan jaringan"</string>
- <string name="permdesc_writeApnSettings" msgid="5333798886412714193">"Mengizinkan apl mengubah setelan jaringan dan mencegat serta memeriksa semua lalu lintas jaringan, misalnya mengubah proxy dan port APN apa saja. Apl berbahaya dapat memantau, mengalihkan, atau mengubah paket jaringan tanpa sepengetahuan Anda."</string>
+ <string name="permlab_writeApnSettings" msgid="505660159675751896">"mengubah/mencegat lalu lintas dan pengaturan jaringan"</string>
+ <string name="permdesc_writeApnSettings" msgid="5333798886412714193">"Mengizinkan apl mengubah pengaturan jaringan dan mencegat serta memeriksa semua lalu lintas jaringan, misalnya mengubah proxy dan port APN apa saja. Apl berbahaya dapat memantau, mengalihkan, atau mengubah paket jaringan tanpa sepengetahuan Anda."</string>
<string name="permlab_changeNetworkState" msgid="958884291454327309">"ubah konektivitas jaringan"</string>
<string name="permdesc_changeNetworkState" msgid="6789123912476416214">"Mengizinkan apl mengubah keadaan konektivitas jaringan."</string>
<string name="permlab_changeTetherState" msgid="5952584964373017960">"mengubah konektivitas yang tertambat"</string>
<string name="permdesc_changeTetherState" msgid="1524441344412319780">"Mengizinkan apl mengubah status konektivitas jaringan yang tertambat."</string>
- <string name="permlab_changeBackgroundDataSetting" msgid="1400666012671648741">"mengubah setelan penggunaan data latar belakang"</string>
- <string name="permdesc_changeBackgroundDataSetting" msgid="5347729578468744379">"Mengizinkan apl mengubah setelan penggunaan data latar belakang."</string>
+ <string name="permlab_changeBackgroundDataSetting" msgid="1400666012671648741">"mengubah pengaturan penggunaan data latar belakang"</string>
+ <string name="permdesc_changeBackgroundDataSetting" msgid="5347729578468744379">"Mengizinkan apl mengubah pengaturan penggunaan data latar belakang."</string>
<string name="permlab_accessWifiState" msgid="8100926650211034400">"lihat kondisi Wi-Fi"</string>
<string name="permdesc_accessWifiState" msgid="7770452658226256831">"Mengizinkan apl melihat informasi tentang keadaan Wi-Fi."</string>
<string name="permlab_changeWifiState" msgid="7280632711057112137">"ubah status Wi-Fi"</string>
@@ -485,10 +485,10 @@
<string name="permdesc_nfc" msgid="7120611819401789907">"Mengizinkan apl berkomunikasi dengan tag, kartu, dan alat pembaca Komunikasi Nirkabel Jarak Dekat (NFC)."</string>
<string name="permlab_disableKeyguard" msgid="4977406164311535092">"nonaktifkan kunci tombol"</string>
<string name="permdesc_disableKeyguard" msgid="6231611286892232626">"Mengizinkan apl menonaktifkan kunci tombol dan segala keamanan sandi yang terkait. Contoh nyata dari hal ini adalah ponsel menonaktifkan kunci tombol saat menerima panggilan telepon masuk, kemudian mengaktifkan kembali kunci tombol ketika panggilan selesai."</string>
- <string name="permlab_readSyncSettings" msgid="6201810008230503052">"baca setelan sinkron"</string>
- <string name="permdesc_readSyncSettings" msgid="5464056785274229278">"Mengizinkan apl membaca setelan sinkronisasi, misalnya apakah sinkronisasi untuk apl Orang diaktifkan atau tidak."</string>
- <string name="permlab_writeSyncSettings" msgid="6297138566442486462">"tuliskan setelan sinkronisasi"</string>
- <string name="permdesc_writeSyncSettings" msgid="1466056564502117130">"Mengizinkan apl memodifikasi setelan sinkronisasi, seperti apakah sinkronisasi untuk apl Orang diaktifkan atau tidak."</string>
+ <string name="permlab_readSyncSettings" msgid="6201810008230503052">"baca pengaturan sinkron"</string>
+ <string name="permdesc_readSyncSettings" msgid="5464056785274229278">"Mengizinkan apl membaca pengaturan sinkronisasi, misalnya apakah sinkronisasi untuk apl Orang diaktifkan atau tidak."</string>
+ <string name="permlab_writeSyncSettings" msgid="6297138566442486462">"tuliskan pengaturan sinkronisasi"</string>
+ <string name="permdesc_writeSyncSettings" msgid="1466056564502117130">"Mengizinkan apl memodifikasi pengaturan sinkronisasi, seperti apakah sinkronisasi untuk apl Orang diaktifkan atau tidak."</string>
<string name="permlab_readSyncStats" msgid="7396577451360202448">"statistika baca sinkron"</string>
<string name="permdesc_readSyncStats" msgid="3801971839939951678">"Mengizinkan apl membaca statistik sinkronisasi; mis., riwayat sinkronisasi yang telah terjadi."</string>
<string name="permlab_subscribedFeedsRead" msgid="4756609637053353318">"baca umpan langganan"</string>
@@ -505,8 +505,8 @@
<string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Memungkinkan apl menulis ke kartu SD."</string>
<string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"ubah/hapus konten penyimpanan media internal"</string>
<string name="permdesc_mediaStorageWrite" product="default" msgid="8189160597698529185">"Mengizinkan apl memodifikasi konten penyimpanan media internal."</string>
- <string name="permlab_cache_filesystem" msgid="5656487264819669824">"akses sistem berkas tembolok."</string>
- <string name="permdesc_cache_filesystem" msgid="5578967642265550955">"Mengizinkan apl membaca dan menulis pada sistem berkas tembolok."</string>
+ <string name="permlab_cache_filesystem" msgid="5656487264819669824">"akses sistem file tembolok."</string>
+ <string name="permdesc_cache_filesystem" msgid="5578967642265550955">"Mengizinkan apl membaca dan menulis pada sistem file tembolok."</string>
<string name="permlab_use_sip" msgid="5986952362795870502">"lakukan//terima panggilan internet"</string>
<string name="permdesc_use_sip" msgid="4717632000062674294">"Mengizinkan apl menggunakan layanan SIP untuk melakukan/menerima panggilan internet."</string>
<string name="permlab_readNetworkUsageHistory" msgid="7862593283611493232">"baca riwayat penggunaan jaringan"</string>
@@ -695,10 +695,10 @@
<string name="lockscreen_too_many_failed_pin_attempts_dialog_message" msgid="6216672706545696955">"Anda telah <xliff:g id="NUMBER_0">%d</xliff:g> kali salah mengetik PIN. "\n\n"Coba lagi dalam <xliff:g id="NUMBER_1">%d</xliff:g> detik."</string>
<string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="9191611984625460820">"Anda telah <xliff:g id="NUMBER_0">%d</xliff:g> kali salah menggambar pola pembuka kunci. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> lagi upaya gagal, Anda akan diminta membuka kunci tablet menggunakan info masuk Google."\n\n"Coba lagi dalam <xliff:g id="NUMBER_2">%d</xliff:g> detik."</string>
<string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="2590227559763762751">"Anda telah <xliff:g id="NUMBER_0">%d</xliff:g> kali salah menggambar pola pembuka kunci. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> lagi upaya gagal, Anda akan diminta membuka kunci ponsel menggunakan info masuk Google."\n\n"Coba lagi dalam <xliff:g id="NUMBER_2">%d</xliff:g> detik."</string>
- <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"Anda telah gagal mencoba membuka gembok tablet sebanyak <xliff:g id="NUMBER_0">%d</xliff:g> kali. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> upaya gagal lagi, tablet akan disetel ulang ke setelan bawaan pabrik dan semua data pengguna hilang."</string>
- <string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"Anda telah gagal mencoba membuka gembok ponsel sebanyak <xliff:g id="NUMBER_0">%d</xliff:g> kali. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> upaya gagal lagi, ponsel akan disetel ulang ke setelan bawaan pabrik dan semua data pengguna hilang."</string>
- <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"Anda telah gagal mencoba membuka gembok tablet sebanyak <xliff:g id="NUMBER">%d</xliff:g> kali. Kini tablet akan disetel ulang ke setelan bawaan pabrik."</string>
- <string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="3025504721764922246">"Anda telah gagal mencoba membuka gembok ponsel sebanyak <xliff:g id="NUMBER">%d</xliff:g> kali. Kini ponsel akan disetel ulang ke setelan bawaan pabrik."</string>
+ <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"Anda telah gagal mencoba membuka gembok tablet sebanyak <xliff:g id="NUMBER_0">%d</xliff:g> kali. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> upaya gagal lagi, tablet akan disetel ulang ke pengaturan bawaan pabrik dan semua data pengguna hilang."</string>
+ <string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"Anda telah gagal mencoba membuka gembok ponsel sebanyak <xliff:g id="NUMBER_0">%d</xliff:g> kali. Setelah <xliff:g id="NUMBER_1">%d</xliff:g> upaya gagal lagi, ponsel akan disetel ulang ke pengaturan bawaan pabrik dan semua data pengguna hilang."</string>
+ <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"Anda telah gagal mencoba membuka gembok tablet sebanyak <xliff:g id="NUMBER">%d</xliff:g> kali. Kini tablet akan disetel ulang ke pengaturan bawaan pabrik."</string>
+ <string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="3025504721764922246">"Anda telah gagal mencoba membuka gembok ponsel sebanyak <xliff:g id="NUMBER">%d</xliff:g> kali. Kini ponsel akan disetel ulang ke pengaturan bawaan pabrik."</string>
<string name="lockscreen_too_many_failed_attempts_countdown" msgid="6251480343394389665">"Coba lagi dalam <xliff:g id="NUMBER">%d</xliff:g> detik."</string>
<string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"Lupa pola?"</string>
<string name="lockscreen_glogin_forgot_pattern" msgid="2588521501166032747">"Pembuka kunci akun"</string>
@@ -749,17 +749,17 @@
<string name="autofill_parish" msgid="8202206105468820057">"Kampung"</string>
<string name="autofill_area" msgid="3547409050889952423">"Area"</string>
<string name="autofill_emirate" msgid="2893880978835698818">"Emirat"</string>
- <string name="permlab_readHistoryBookmarks" msgid="1284843728203412135">"baca riwayat dan bookmark Peramban"</string>
- <string name="permdesc_readHistoryBookmarks" msgid="4577476392604595921">"Mengizinkan apl membaca semua URL yang telah dikunjungi Peramban dan semua bookmark Peramban."</string>
- <string name="permlab_writeHistoryBookmarks" msgid="9009434109836280374">"tuliskan riwayat dan bookmark Peramban"</string>
- <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="1757103804824209530">"Mengizinkan apl memodifikasi riwayat Peramban atau bookmark yang tersimpan di tablet. Apl berbahaya dapat menggunakan izin ini untuk menghapus atau memodifikasi data Peramban Anda."</string>
- <string name="permdesc_writeHistoryBookmarks" product="default" msgid="6693764355720719197">"Mengizinkan apl memodifikasi riwayat Peramban atau bookmark yang tersimpan di ponsel Anda. Apl berbahaya dapat menggunakannya untuk menghapus atau memodifikasi data Peramban Anda."</string>
+ <string name="permlab_readHistoryBookmarks" msgid="1284843728203412135">"baca riwayat dan bookmark Browser"</string>
+ <string name="permdesc_readHistoryBookmarks" msgid="4577476392604595921">"Mengizinkan apl membaca semua URL yang telah dikunjungi Browser dan semua bookmark Browser."</string>
+ <string name="permlab_writeHistoryBookmarks" msgid="9009434109836280374">"tuliskan riwayat dan bookmark Browser"</string>
+ <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="1757103804824209530">"Mengizinkan apl memodifikasi riwayat Browser atau bookmark yang tersimpan di tablet. Apl berbahaya dapat menggunakan izin ini untuk menghapus atau memodifikasi data Browser Anda."</string>
+ <string name="permdesc_writeHistoryBookmarks" product="default" msgid="6693764355720719197">"Mengizinkan apl memodifikasi riwayat Browser atau bookmark yang tersimpan di ponsel Anda. Apl berbahaya dapat menggunakannya untuk menghapus atau memodifikasi data Browser Anda."</string>
<string name="permlab_setAlarm" msgid="5924401328803615165">"setel alarm di jam alarm"</string>
<string name="permdesc_setAlarm" msgid="316392039157473848">"Mengizinkan apl menyetel alarm di apl jam alarm yang terpasang. Beberapa apl jam alarm mungkin tidak menerapkan fitur ini."</string>
<string name="permlab_addVoicemail" msgid="5525660026090959044">"tambahkan kotak pesan"</string>
<string name="permdesc_addVoicemail" msgid="6604508651428252437">"Mengizinkan apl menambahkan pesan ke kotak masuk untuk pesan suara Anda."</string>
- <string name="permlab_writeGeolocationPermissions" msgid="5962224158955273932">"memodifikasi izin geolokasi Peramban"</string>
- <string name="permdesc_writeGeolocationPermissions" msgid="1083743234522638747">"Mengizinkan apl memodifikasi izin geolokasi Peramban. Apl berbahaya dapat menggunakan izin ini untuk memungkinkan pengiriman informasi lokasi ke sembarang situs web."</string>
+ <string name="permlab_writeGeolocationPermissions" msgid="5962224158955273932">"memodifikasi izin geolokasi Browser"</string>
+ <string name="permdesc_writeGeolocationPermissions" msgid="1083743234522638747">"Mengizinkan apl memodifikasi izin geolokasi Browser. Apl berbahaya dapat menggunakan izin ini untuk memungkinkan pengiriman informasi lokasi ke sembarang situs web."</string>
<string name="permlab_packageVerificationAgent" msgid="5568139100645829117">"verifikasi paket"</string>
<string name="permdesc_packageVerificationAgent" msgid="8437590190990843381">"Mengizinkan apl memverifikasi bahwa suatu paket dapat dipasang."</string>
<string name="permlab_bindPackageVerifier" msgid="4187786793360326654">"mengikat ke pemverifikasi paket"</string>
@@ -768,11 +768,9 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"Memungkinkan pemegangnya mengakses port serial menggunakan API SerialManager."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"mengakses penyedia konten dari luar"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Memungkinkan pemegang mengakses penyedia konten dari cangkang. Tidak pernah diperlukan untuk apl normal."</string>
- <!-- no translation found for permlab_updateLock (3527558366616680889) -->
- <skip />
- <!-- no translation found for permdesc_updateLock (1655625832166778492) -->
- <skip />
- <string name="save_password_message" msgid="767344687139195790">"Apakah Anda ingin peramban menyimpan sandi ini?"</string>
+ <string name="permlab_updateLock" msgid="3527558366616680889">"menghindari pembaruan perangkat otomatis"</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"Memungkinkan pemegang untuk menawarkan informasi ke sistem mengenai kapan waktu yang baik bagi pemulaian ulang non-interaktif untuk meningkatkan versi perangkat."</string>
+ <string name="save_password_message" msgid="767344687139195790">"Apakah Anda ingin browser menyimpan sandi ini?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Tidak sekarang"</string>
<string name="save_password_remember" msgid="6491879678996749466">"Ingat"</string>
<string name="save_password_never" msgid="8274330296785855105">"Jangan"</string>
@@ -912,7 +910,7 @@
<string name="capital_off" msgid="6815870386972805832">"MATI"</string>
<string name="whichApplication" msgid="4533185947064773386">"Tindakan lengkap menggunakan"</string>
<string name="alwaysUse" msgid="4583018368000610438">"Gunakan secara bawaan untuk tindakan ini."</string>
- <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Menghapus bawaan di Setelan sistem > Apl > Terunduh."</string>
+ <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Menghapus bawaan di Pengaturan sistem > Apl > Terunduh."</string>
<string name="chooseActivity" msgid="7486876147751803333">"Pilih tindakan"</string>
<string name="chooseUsbActivity" msgid="6894748416073583509">"Pilih apl untuk perangkat USB"</string>
<string name="noApplications" msgid="2991814273936504689">"Tidak ada apl yang dapat melakukan tindakan ini."</string>
@@ -933,7 +931,7 @@
<string name="launch_warning_original" msgid="188102023021668683">"<xliff:g id="APP_NAME">%1$s</xliff:g> telah diluncurkan aslinya."</string>
<string name="screen_compat_mode_scale" msgid="3202955667675944499">"Skala"</string>
<string name="screen_compat_mode_show" msgid="4013878876486655892">"Selalu tampilkan"</string>
- <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Aktifkan kembali dialog ini di Setelan sistem > Apl > Terunduh."</string>
+ <string name="screen_compat_mode_hint" msgid="1064524084543304459">"Aktifkan kembali dialog ini di Pengaturan sistem > Apl > Terunduh."</string>
<string name="smv_application" msgid="3307209192155442829">"Apl <xliff:g id="APPLICATION">%1$s</xliff:g> (proses <xliff:g id="PROCESS">%2$s</xliff:g>) telah melanggar kebijakan StrictMode yang diberlakukannya sendiri."</string>
<string name="smv_process" msgid="5120397012047462446">"Proses <xliff:g id="PROCESS">%1$s</xliff:g> telah melanggar kebijakan StrictMode yang diberlakukan secara otomatis."</string>
<string name="android_upgrading_title" msgid="1584192285441405746">"Android sedang meningkatkan versi..."</string>
@@ -985,7 +983,7 @@
<string name="wifi_p2p_turnon_message" msgid="2909250942299627244">"Memulai Wi-Fi Langsung. Opsi ini akan mematikan hotspot/klien Wi-Fi."</string>
<string name="wifi_p2p_failed_message" msgid="3763669677935623084">"Tidak dapat memulai Wi-Fi Langsung."</string>
<string name="wifi_p2p_enabled_notification_title" msgid="2068321881673734886">"Wi-Fi Langsung aktif"</string>
- <string name="wifi_p2p_enabled_notification_message" msgid="1638949953993894335">"Sentuh untuk setelan"</string>
+ <string name="wifi_p2p_enabled_notification_message" msgid="1638949953993894335">"Sentuh untuk pengaturan"</string>
<string name="accept" msgid="1645267259272829559">"Terima"</string>
<string name="decline" msgid="2112225451706137894">"Tolak"</string>
<string name="wifi_p2p_invitation_sent_title" msgid="1318975185112070734">"Undangan terkirim"</string>
@@ -1016,13 +1014,13 @@
<string name="perms_show_all" msgid="2671791163933091180"><b>"Tampilkan semua"</b></string>
<string name="usb_storage_activity_title" msgid="4465055157209648641">"Penyimpanan massal USB"</string>
<string name="usb_storage_title" msgid="5901459041398751495">"USB terhubung"</string>
- <string name="usb_storage_message" product="nosdcard" msgid="3308538094316477839">"Anda telah tersambung ke komputer melalui USB. Sentuh tombol di bawah jika Anda ingin menyalin berkas antara komputer dan penyimpanan USB Android Anda."</string>
- <string name="usb_storage_message" product="default" msgid="805351000446037811">"Anda telah tersambung ke komputer melalui USB. Sentuh tombol di bawah jika Anda ingin menyalin berkas antara komputer dan kartu SD Android Anda."</string>
+ <string name="usb_storage_message" product="nosdcard" msgid="3308538094316477839">"Anda telah tersambung ke komputer melalui USB. Sentuh tombol di bawah jika Anda ingin menyalin file antara komputer dan penyimpanan USB Android Anda."</string>
+ <string name="usb_storage_message" product="default" msgid="805351000446037811">"Anda telah tersambung ke komputer melalui USB. Sentuh tombol di bawah jika Anda ingin menyalin file antara komputer dan kartu SD Android Anda."</string>
<string name="usb_storage_button_mount" msgid="1052259930369508235">"Hidupkan penyimpanan USB"</string>
<string name="usb_storage_error_message" product="nosdcard" msgid="3017045217365540658">"Terjadi masalah saat menggunakan penyimpanan USB Anda untuk penyimpanan massal USB."</string>
<string name="usb_storage_error_message" product="default" msgid="2876018512716970313">"Terjadi masalah saat menggunakan kartu SD Anda untuk penyimpanan massal USB."</string>
<string name="usb_storage_notification_title" msgid="8175892554757216525">"USB terhubung"</string>
- <string name="usb_storage_notification_message" msgid="939822783828183763">"Sentuh untuk menyalin berkas ke/dari komputer Anda."</string>
+ <string name="usb_storage_notification_message" msgid="939822783828183763">"Sentuh untuk menyalin file ke/dari komputer Anda."</string>
<string name="usb_storage_stop_notification_title" msgid="2336058396663516017">"Matikan penyimpanan USB"</string>
<string name="usb_storage_stop_notification_message" msgid="1656852098555623822">"Sentuh untuk mematikan penyimpanan USB."</string>
<string name="usb_storage_stop_title" msgid="660129851708775853">"Penyimpanan USB sedang digunakan"</string>
@@ -1041,7 +1039,7 @@
<string name="usb_notification_message" msgid="2290859399983720271">"Sentuh untuk opsi USB lainnya."</string>
<string name="extmedia_format_title" product="nosdcard" msgid="9020092196061007262">"Format penyimpanan USB?"</string>
<string name="extmedia_format_title" product="default" msgid="3648415921526526069">"Format kartu SD?"</string>
- <string name="extmedia_format_message" product="nosdcard" msgid="3934016853425761078">"Semua berkas yang tersimpan dalam penyimpanan USB Anda akan dihapus. Tindakan ini tidak dapat diurungkan!"</string>
+ <string name="extmedia_format_message" product="nosdcard" msgid="3934016853425761078">"Semua file yang tersimpan dalam penyimpanan USB Anda akan dihapus. Tindakan ini tidak dapat diurungkan!"</string>
<string name="extmedia_format_message" product="default" msgid="14131895027543830">"Semua data di kartu Anda akan hilang."</string>
<string name="extmedia_format_button_format" msgid="4131064560127478695">"Format"</string>
<string name="adb_active_notification_title" msgid="6729044778949189918">"Debugging USB terhubung"</string>
@@ -1057,7 +1055,7 @@
<string name="ext_media_nofs_notification_title" product="nosdcard" msgid="7788040745686229307">"Penyimpanan USB kosong"</string>
<string name="ext_media_nofs_notification_title" product="default" msgid="780477838241212997">"Kartu SD kosong"</string>
<string name="ext_media_nofs_notification_message" product="nosdcard" msgid="7840121067427269500">"Penyimpanan USB kosong atau sistem berkasnya tidak didukung."</string>
- <string name="ext_media_nofs_notification_message" product="default" msgid="8641065641786923604">"Kartu SD kosong atau memiliki sistem berkas yang tidak didukung."</string>
+ <string name="ext_media_nofs_notification_message" product="default" msgid="8641065641786923604">"Kartu SD kosong atau memiliki sistem file yang tidak didukung."</string>
<string name="ext_media_unmountable_notification_title" product="nosdcard" msgid="2090046769532713563">"Penyimpanan USB rusak"</string>
<string name="ext_media_unmountable_notification_title" product="default" msgid="6410723906019100189">"Kartu SD rusak"</string>
<string name="ext_media_unmountable_notification_message" product="nosdcard" msgid="1795917578395333280">"Penyimpanan USB rusak. Coba diformat ulang."</string>
@@ -1106,8 +1104,8 @@
<string name="vpn_title_long" msgid="6400714798049252294">"VPN diaktifkan oleh <xliff:g id="APP">%s</xliff:g>"</string>
<string name="vpn_text" msgid="3011306607126450322">"Sentuh untuk mengelola jaringan."</string>
<string name="vpn_text_long" msgid="6407351006249174473">"Tersambung ke <xliff:g id="SESSION">%s</xliff:g>. Sentuh untuk mengelola jaringan."</string>
- <string name="upload_file" msgid="2897957172366730416">"Pilih berkas"</string>
- <string name="no_file_chosen" msgid="6363648562170759465">"Tidak ada berkas yang dipilih"</string>
+ <string name="upload_file" msgid="2897957172366730416">"Pilih file"</string>
+ <string name="no_file_chosen" msgid="6363648562170759465">"Tidak ada file yang dipilih"</string>
<string name="reset" msgid="2448168080964209908">"Setel ulang"</string>
<string name="submit" msgid="1602335572089911941">"Kirim"</string>
<string name="car_mode_disable_notification_title" msgid="3164768212003864316">"Mode mobil diaktifkan"</string>
@@ -1245,6 +1243,6 @@
<string name="status_bar_device_locked" msgid="3092703448690669768">"Perangkat tergembok."</string>
<string name="list_delimeter" msgid="3975117572185494152">", "</string>
<string name="sending" msgid="3245653681008218030">"Mengirim..."</string>
- <string name="launchBrowserDefault" msgid="2057951947297614725">"Luncurkan Peramban?"</string>
+ <string name="launchBrowserDefault" msgid="2057951947297614725">"Luncurkan Browser?"</string>
<string name="SetupCallDefault" msgid="5834948469253758575">"Terima panggilan?"</string>
</resources>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index b28bfdd..bc9840d 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"GB"</string>
<string name="terabyteShort" msgid="231613018159186962">"TB"</string>
<string name="petabyteShort" msgid="5637816680144990219">"PB"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g><xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<新規>"</string>
<string name="ellipsis" msgid="7899829516048813237">"..."</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"‥"</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"フェイスアンロックの最大試行回数を超えました"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"充電しています: <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"充電完了"</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"充電してください"</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"SIMカードが挿入されていません"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"タブレット内にSIMカードがありません。"</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"出荷時試験が失敗"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"FACTORY_TEST操作は、/system/appにインストールされたパッケージのみが対象です。"</string>
<string name="factorytest_no_action" msgid="872991874799998561">"FACTORY_TEST操作を行うパッケージは見つかりませんでした。"</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"ヒント: ダブルタップで拡大/縮小できます。"</string>
<string name="autofill_this_form" msgid="4616758841157816676">"自動入力"</string>
<string name="setup_autofill" msgid="7103495070180590814">"自動入力を設定"</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$3$2$1"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">"、 "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
@@ -773,10 +768,8 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"SerialManager APIを使用してシリアルポートにアクセスすることを所有者に許可します。"</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"コンテンツプロバイダへの外部アクセス"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"シェルからコンテンツプロバイダにアクセスすることを権利所有者に許可します。通常のアプリでは必要ありません。"</string>
- <!-- no translation found for permlab_updateLock (3527558366616680889) -->
- <skip />
- <!-- no translation found for permdesc_updateLock (1655625832166778492) -->
- <skip />
+ <string name="permlab_updateLock" msgid="3527558366616680889">"端末の自動更新の抑制"</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"非対話型の再起動により端末をアップグレードするのに適したタイミングについて、システムに情報を提供することを権利所有者に許可します。"</string>
<string name="save_password_message" msgid="767344687139195790">"このパスワードをブラウザで保存しますか?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"今は保存しない"</string>
<string name="save_password_remember" msgid="6491879678996749466">"保存"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 00f34ec..c9801a3 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -769,7 +769,7 @@
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"외부에서 콘텐츠 제공자에 액세스"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"권한을 가진 프로그램이 셸에서 콘텐츠 제공자에 액세스하도록 허용합니다. 일반 앱에서는 필요하지 않습니다."</string>
<string name="permlab_updateLock" msgid="3527558366616680889">"지금은 자동 기기 업데이트를 권장하지 않음"</string>
- <string name="permdesc_updateLock" msgid="1655625832166778492">"기기를 스스로 다시 부팅하여 업그레이드해도 괜찮은 시간에 대한 정보를 사용자가 시스템에 제공할 수 있도록 허용합니다."</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"기기를 자동으로 다시 부팅하여 업그레이드해도 괜찮은 시간에 대한 정보를 사용자가 시스템에 제공할 수 있도록 허용합니다."</string>
<string name="save_password_message" msgid="767344687139195790">"브라우저에 이 비밀번호를 저장하시겠습니까?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"나중에"</string>
<string name="save_password_remember" msgid="6491879678996749466">"저장"</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index 13ccc2e..4424ad5 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -768,7 +768,7 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"Leidžiama savininkui pasiekti nuosekliuosius prievadus naudojant „SerialManager“ API."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"pasiekti turinio teikėjus iš išorės"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Leidžiama savininkui pasiekti turinio teikėjus naudojant apvalkalą. To niekada neturėtų prireikti naudojant įprastas programas."</string>
- <string name="permlab_updateLock" msgid="3527558366616680889">"Atsisakyti automatinių įrenginio atnaujinimų"</string>
+ <string name="permlab_updateLock" msgid="3527558366616680889">"Atsisakyti autom. įrenginio atnaujinimų"</string>
<string name="permdesc_updateLock" msgid="1655625832166778492">"Leidžia savininkui pateikti pasiūlymą sistemai dėl tinkamo laiko iš naujo neinteraktyviai įkelti programą, kad būtų naujovinamas įrenginys."</string>
<string name="save_password_message" msgid="767344687139195790">"Ar norite, kad naršyklė atsimintų šį slaptažodį?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Ne dabar"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 2c8ca30..385bebb 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"GB"</string>
<string name="terabyteShort" msgid="231613018159186962">"TB"</string>
<string name="petabyteShort" msgid="5637816680144990219">"PB"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g><xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<Tidak bertajuk>"</string>
<string name="ellipsis" msgid="7899829516048813237">"..."</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"‥"</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Telah melepasi had cubaan Buka Kunci Wajah"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Mengecas, (<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>)"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Sudah dicas."</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Sambungkan pengecas anda."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Tiada kad SIM."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Tiada kad SIM dalam tablet."</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"Ujian kilang gagal"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"Tindakan FACTORY_TEST hanya disokong untuk pakej yang dipasangkan dalam /system/app."</string>
<string name="factorytest_no_action" msgid="872991874799998561">"Tiada pakej yang menyediakan tindakan FACTORY_TEST ditemui."</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"Petua: Ketik dua kali untuk mengezum masuk dan keluar."</string>
<string name="autofill_this_form" msgid="4616758841157816676">"Auto isi"</string>
<string name="setup_autofill" msgid="7103495070180590814">"Sediakan Autoisi"</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
@@ -773,10 +768,8 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"Membenarkan pemegang mengakses port bersiri menggunakan API SerialManager."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"akses pembekal kandungan secara luaran"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Membolehkan pemegang mengakses pembekal kandungan dari luar. Tidak akan sekali-kali diperlukan untuk apl biasa."</string>
- <!-- no translation found for permlab_updateLock (3527558366616680889) -->
- <skip />
- <!-- no translation found for permdesc_updateLock (1655625832166778492) -->
- <skip />
+ <string name="permlab_updateLock" msgid="3527558366616680889">"tidak menggalakkan kemas kini peranti automatik"</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"Membenarkan aplikasi untuk menawarkan maklumat kepada sistem tentang bila akan menjadi masa yang baik untuk but semula bukan interaktif untuk menaik taraf peranti."</string>
<string name="save_password_message" msgid="767344687139195790">"Adakah anda mahu penyemak imbas mengingati kata laluan ini?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Bukan sekarang"</string>
<string name="save_password_remember" msgid="6491879678996749466">"Ingat"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 0973624..e70a664 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -671,7 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Du har overskredet grensen for opplåsingsforsøk med Ansiktslås"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Lader, <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Fullt ladet"</string>
- <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g> <xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Koble til en batterilader."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Mangler SIM-kort."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Nettbrettet mangler SIM-kort."</string>
@@ -1088,7 +1088,7 @@
<string name="ime_action_default" msgid="2840921885558045721">"Utfør"</string>
<string name="dial_number_using" msgid="5789176425167573586">"Ring nummeret"\n"<xliff:g id="NUMBER">%s</xliff:g>"</string>
<string name="create_contact_using" msgid="4947405226788104538">"Lag kontakt"\n"med nummeret <xliff:g id="NUMBER">%s</xliff:g>"</string>
- <string name="grant_credentials_permission_message_header" msgid="2106103817937859662">"Én eller flere av de følgende appene ber om tillatelse til å få tilgang til kontoen din fra nå av."</string>
+ <string name="grant_credentials_permission_message_header" msgid="2106103817937859662">"Følgende app(er) ber om tilgang til kontoen din fra nå av."</string>
<string name="grant_credentials_permission_message_footer" msgid="3125211343379376561">"Vil du tillate dette?"</string>
<string name="grant_permissions_header_text" msgid="6874497408201826708">"Tilgangsforespørsel"</string>
<string name="allow" msgid="7225948811296386551">"Tillat"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index d77970d..96dcfa0 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"GB"</string>
<string name="terabyteShort" msgid="231613018159186962">"TB"</string>
<string name="petabyteShort" msgid="5637816680144990219">"PB"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g> <xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<Bez nazwy>"</string>
<string name="ellipsis" msgid="7899829516048813237">"…"</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"‥"</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Przekroczono maksymalną liczbę prób odblokowania Face Unlock."</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Ładowanie (<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>)"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Naładowany."</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Podłącz ładowarkę."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Brak karty SIM."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Brak karty SIM w tablecie."</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"Nieudany test fabryczny"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"Czynność FACTORY_TEST jest obsługiwana tylko dla pakietów zainstalowanych w katalogu /system/app."</string>
<string name="factorytest_no_action" msgid="872991874799998561">"Nie znaleziono żadnego pakietu, który zapewnia działanie FACTORY_TEST."</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"Wskazówka: dotknij dwukrotnie, aby powiększyć lub pomniejszyć."</string>
<string name="autofill_this_form" msgid="4616758841157816676">"Autouzupełnianie"</string>
<string name="setup_autofill" msgid="7103495070180590814">"Ustaw autouzupełnianie"</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
@@ -773,8 +768,8 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"Umożliwia posiadaczowi dostęp do portów szeregowych przy użyciu interfejsu API narzędzia SerialManager."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"Dostęp do dostawców treści z zewnątrz"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Pozwala na dostęp do dostawców treści z powłoki. To uprawnienie nie powinno być potrzebne zwykłym aplikacjom."</string>
- <string name="permlab_updateLock" msgid="3527558366616680889">"odradź automatyczne aktualizacje urządzenia"</string>
- <string name="permdesc_updateLock" msgid="1655625832166778492">"Umożliwia posiadaczowi poinformowanie systemu, kiedy będzie dobry moment na nieinteraktywne uruchomienie ponowne wymagane do uaktualnienia urządzenia."</string>
+ <string name="permlab_updateLock" msgid="3527558366616680889">"odradzanie automatycznych aktualizacji urządzenia"</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"Umożliwia posiadaczowi poinformowanie systemu, kiedy będzie dobry moment na ponowne uruchomienie wymagane do uaktualnienia urządzenia."</string>
<string name="save_password_message" msgid="767344687139195790">"Czy chcesz, aby zapamiętać to hasło w przeglądarce?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Nie teraz"</string>
<string name="save_password_remember" msgid="6491879678996749466">"Zapamiętaj"</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index 6a084c0..cac586e 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"GO"</string>
<string name="terabyteShort" msgid="231613018159186962">"TO"</string>
<string name="petabyteShort" msgid="5637816680144990219">"PO"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g> <xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<Fără titlu>"</string>
<string name="ellipsis" msgid="7899829516048813237">"…"</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"‥"</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"S-a depăşit numărul maxim de încercări pentru Deblocare facială"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Se încarcă, <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Încărcată."</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g> <xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Conectaţi încărcătorul."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Niciun card SIM."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Nu există card SIM în computerul tablet PC."</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"Testarea de fabrică nu a reuşit"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"Acţiunea FACTORY_TEST este acceptată doar pentru pachetele instalate în /system/app."</string>
<string name="factorytest_no_action" msgid="872991874799998561">"Nu s-a găsit niciun pachet care să ofere acţiunea FACTORY_TEST."</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"Sfat: măriţi şi micşoraţi prin dublă atingere."</string>
<string name="autofill_this_form" msgid="4616758841157816676">"Automat"</string>
<string name="setup_autofill" msgid="7103495070180590814">"Conf.Compl.auto."</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
@@ -773,10 +768,8 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"Permite posesorului accesul la porturile serial utilizând API-ul SerialManager."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"accesaţi furniz. de conţin. din exterior"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Permite deţinătorului să acceseze furnizorii de conţinut din interfaţă. Nu ar trebui să fie necesară pentru aplicaţiile normale."</string>
- <!-- no translation found for permlab_updateLock (3527558366616680889) -->
- <skip />
- <!-- no translation found for permdesc_updateLock (1655625832166778492) -->
- <skip />
+ <string name="permlab_updateLock" msgid="3527558366616680889">"descuraj. actual. autom. ale dispozitiv."</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"Permite proprietarului să ofere sistemului informaţii cu privire la momentul oportun pentru o repornire noninteractivă în scopul trecerii dispozitivului la o versiune superioară."</string>
<string name="save_password_message" msgid="767344687139195790">"Doriţi ca browserul să reţină această parolă?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Nu acum"</string>
<string name="save_password_remember" msgid="6491879678996749466">"Reţineţi"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index deb810f..3a554d6 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"ГБ"</string>
<string name="terabyteShort" msgid="231613018159186962">"TБ"</string>
<string name="petabyteShort" msgid="5637816680144990219">"ПБ"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g> <xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<Без названия>"</string>
<string name="ellipsis" msgid="7899829516048813237">"…"</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"..."</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Все попытки войти с помощью Фейсконтроля использованы"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Идет зарядка (<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>)"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Батарея заряжена"</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Подключите зарядное устройство."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Нет SIM-карты"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"SIM-карта не установлена."</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"АБВ"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"Не удалось провести стандартный тест"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"Действие FACTORY_TEST поддерживается только для пакетов, установленных в /system/app."</string>
<string name="factorytest_no_action" msgid="872991874799998561">"Пакет, обеспечивающий действие FACTORY_TEST, не найден."</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"Совет: нажмите дважды, чтобы увеличить и уменьшить масштаб."</string>
<string name="autofill_this_form" msgid="4616758841157816676">"Автозаполнение"</string>
<string name="setup_autofill" msgid="7103495070180590814">"Настроить автозаполнение"</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 4d4c9cd..daa321d 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"GB"</string>
<string name="terabyteShort" msgid="231613018159186962">"TB"</string>
<string name="petabyteShort" msgid="5637816680144990219">"PB"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g> <xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<Bez mena>"</string>
<string name="ellipsis" msgid="7899829516048813237">"…"</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"‥"</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Prekročili ste maximálny povolený počet pokusov o odomknutie tvárou"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Prebieha nabíjanie, <xliff:g id="NUMBER">%d</xliff:g> <xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Nabité."</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g> <xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Pripojte nabíjačku."</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Nie je vložená karta SIM."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"V tablete nie je žiadna karta SIM."</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g> <xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"Továrenský test zlyhal"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"Test FACTORY_TEST je možné uskutočniť iba pri balíčkoch nainštalovaných v priečinku /system/app."</string>
<string name="factorytest_no_action" msgid="872991874799998561">"Nebol nájdený žiadny balíček umožňujúci test FACTORY_TEST."</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"Tip: Dvojitým klepnutím môžete zobrazenie priblížiť alebo oddialiť."</string>
<string name="autofill_this_form" msgid="4616758841157816676">"Aut.dop."</string>
<string name="setup_autofill" msgid="7103495070180590814">"Nast. Aut. dop."</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 2ed2ad6..13053ab 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"GB"</string>
<string name="terabyteShort" msgid="231613018159186962">"TB"</string>
<string name="petabyteShort" msgid="5637816680144990219">"PB"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g><xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<Haina jina>"</string>
<string name="ellipsis" msgid="7899829516048813237">"…"</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"‥"</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Majaribio ya Juu ya Kufungua Uso yamezidishwa"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Inachaji <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Imechajiwa."</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Unganisha chaja yako"</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Hakuna SIM kadi."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Hakuna SIM kadi katika kompyuta ndogo."</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%P</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="HOUR">%-l</xliff:g><xliff:g id="AMPM">%p</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"Jaribio la kiwanda limeshindikana"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"Tendo la JARIBIO_LA KIWANDA linahimiliwa tu kwa furushi zilizosakinishwa katika /system/app."</string>
<string name="factorytest_no_action" msgid="872991874799998561">"Hakuna furushi lililopatikana ambalo linatoa tendo la JARIBIO_LA KIWANDA."</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"Kidokezo: Gonga mara mbili ili kukuza ndani na nje."</string>
<string name="autofill_this_form" msgid="4616758841157816676">"Mjazo-otomatiki"</string>
<string name="setup_autofill" msgid="7103495070180590814">"Sanidi Mjazo-otomati"</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
@@ -773,10 +768,8 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"Inaruhusu mmiliki kufikia vituo tambulishi kwa kutumia KisimamiziTambulishi cha API."</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"fikia watoa huduma nje"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"Inaruhusu mmiliki kufikia watoa huduma kutoka kwa onyesho. Haifai kuhitajika kamwe kwa programu za kawaida."</string>
- <!-- no translation found for permlab_updateLock (3527558366616680889) -->
- <skip />
- <!-- no translation found for permdesc_updateLock (1655625832166778492) -->
- <skip />
+ <string name="permlab_updateLock" msgid="3527558366616680889">"pinga usasishaji kifaa kiotomatiki"</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"Inaruhusu mmiliki kutoa maelezo kwa mfumo kuhusu ni lini itakuwa wakati mzuri wa uwashaji upya usiotagusana ili kupandisha gredi kifaa."</string>
<string name="save_password_message" msgid="767344687139195790">"Unataka kuvinjari ili ukumbuke nenosiri hili?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"Si Sasa"</string>
<string name="save_password_remember" msgid="6491879678996749466">"Kumbuka"</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index 4aba67c..2664ad3 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -26,8 +26,7 @@
<string name="gigabyteShort" msgid="3259882455212193214">"GB"</string>
<string name="terabyteShort" msgid="231613018159186962">"TB"</string>
<string name="petabyteShort" msgid="5637816680144990219">"PB"</string>
- <!-- no translation found for fileSizeSuffix (9164292791500531949) -->
- <skip />
+ <string name="fileSizeSuffix" msgid="9164292791500531949">"<xliff:g id="NUMBER">%1$s</xliff:g> <xliff:g id="UNIT">%2$s</xliff:g>"</string>
<string name="untitled" msgid="4638956954852782576">"<未命名>"</string>
<string name="ellipsis" msgid="7899829516048813237">"..."</string>
<string name="ellipsis_two_dots" msgid="1228078994866030736">"‥"</string>
@@ -672,8 +671,7 @@
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"已超过“人脸解锁”尝试次数上限"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"正在充电,<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"已充满。"</string>
- <!-- no translation found for lockscreen_battery_short (4477264849386850266) -->
- <skip />
+ <string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"连接您的充电器。"</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"没有 SIM 卡"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"平板电脑中没有 SIM 卡。"</string>
@@ -722,10 +720,8 @@
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
- <!-- no translation found for hour_ampm (4584338083529355982) -->
- <skip />
- <!-- no translation found for hour_cap_ampm (2083465992940444366) -->
- <skip />
+ <string name="hour_ampm" msgid="4584338083529355982">"<xliff:g id="AMPM">%P</xliff:g> <xliff:g id="HOUR">%-l</xliff:g>"</string>
+ <string name="hour_cap_ampm" msgid="2083465992940444366">"<xliff:g id="AMPM">%p</xliff:g> <xliff:g id="HOUR">%-l</xliff:g>"</string>
<string name="factorytest_failed" msgid="5410270329114212041">"出厂测试失败"</string>
<string name="factorytest_not_system" msgid="4435201656767276723">"只有在 /system/app 中安装的包支持 FACTORY_TEST 操作。"</string>
<string name="factorytest_no_action" msgid="872991874799998561">"未发现支持 FACTORY_TEST 操作的包。"</string>
@@ -737,8 +733,7 @@
<string name="double_tap_toast" msgid="4595046515400268881">"提示:点按两次可放大或缩小。"</string>
<string name="autofill_this_form" msgid="4616758841157816676">"自动填充"</string>
<string name="setup_autofill" msgid="7103495070180590814">"设置自动填充"</string>
- <!-- no translation found for autofill_address_name_separator (6350145154779706772) -->
- <skip />
+ <string name="autofill_address_name_separator" msgid="6350145154779706772">" "</string>
<string name="autofill_address_summary_name_format" msgid="3268041054899214945">"$1$2$3"</string>
<string name="autofill_address_summary_separator" msgid="7483307893170324129">", "</string>
<string name="autofill_address_summary_format" msgid="4874459455786827344">"$1$2$3"</string>
@@ -773,10 +768,8 @@
<string name="permdesc_serialPort" msgid="2991639985224598193">"允许持有人使用 SerialManager API 访问串行端口。"</string>
<string name="permlab_accessContentProvidersExternally" msgid="5077774297943409285">"从外部访问内容提供程序"</string>
<string name="permdesc_accessContentProvidersExternally" msgid="4544346486697853685">"允许持有者通过界面访问内容提供程序。普通应用绝不需要此权限。"</string>
- <!-- no translation found for permlab_updateLock (3527558366616680889) -->
- <skip />
- <!-- no translation found for permdesc_updateLock (1655625832166778492) -->
- <skip />
+ <string name="permlab_updateLock" msgid="3527558366616680889">"阻止自动设备更新"</string>
+ <string name="permdesc_updateLock" msgid="1655625832166778492">"允许应用向系统提供相关信息,以确定何时适合执行非交互式重启以升级设备。"</string>
<string name="save_password_message" msgid="767344687139195790">"是否希望浏览器记住此密码?"</string>
<string name="save_password_notnow" msgid="6389675316706699758">"暂不保存"</string>
<string name="save_password_remember" msgid="6491879678996749466">"记住"</string>
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 9e7b17c..a51f3f9 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -826,6 +826,10 @@
<style name="TextAppearance.Widget.IconMenu.Item" parent="TextAppearance.Small">
<item name="android:textColor">?textColorPrimary</item>
+ <!-- dp is used on purpose here instead of sp; there is not space
+ for larger font sizes based on the user setting. Newer apps
+ should not receive the legacy icon menu panel. -->
+ <item name="android:textSize">14dp</item>
</style>
<style name="TextAppearance.Widget.EditText">
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
index 259f15f..19aa77b 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
@@ -241,6 +241,7 @@
mCM = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
// Get an instance of WifiManager
mWifiManager =(WifiManager)getSystemService(Context.WIFI_SERVICE);
+ mContext = this;
mChannel = mWifiManager.initialize(mContext, mContext.getMainLooper(), null);
initializeNetworkStates();
diff --git a/core/tests/benchmarks/README b/core/tests/benchmarks/README
new file mode 100644
index 0000000..0a41bcc
--- /dev/null
+++ b/core/tests/benchmarks/README
@@ -0,0 +1,8 @@
+
+These benchmarks use the Caliper benchmark framework, and can be
+run on a remote device using Vogar:
+
+http://code.google.com/p/caliper/
+http://code.google.com/p/vogar/
+
+$ vogar --benchmark path/to/Benchmark.java
diff --git a/core/tests/benchmarks/src/android/os/ParcelArrayBenchmark.java b/core/tests/benchmarks/src/android/os/ParcelArrayBenchmark.java
new file mode 100644
index 0000000..21cfb09
--- /dev/null
+++ b/core/tests/benchmarks/src/android/os/ParcelArrayBenchmark.java
@@ -0,0 +1,122 @@
+/*
+ * 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 android.os;
+
+import com.google.caliper.Param;
+import com.google.caliper.SimpleBenchmark;
+
+public class ParcelArrayBenchmark extends SimpleBenchmark {
+
+ @Param({ "1", "10", "100", "1000" })
+ private int mSize;
+
+ private Parcel mWriteParcel;
+
+ private byte[] mByteArray;
+ private int[] mIntArray;
+ private long[] mLongArray;
+
+ private Parcel mByteParcel;
+ private Parcel mIntParcel;
+ private Parcel mLongParcel;
+
+ @Override
+ protected void setUp() {
+ mWriteParcel = Parcel.obtain();
+
+ mByteArray = new byte[mSize];
+ mIntArray = new int[mSize];
+ mLongArray = new long[mSize];
+
+ mByteParcel = Parcel.obtain();
+ mByteParcel.writeByteArray(mByteArray);
+ mIntParcel = Parcel.obtain();
+ mIntParcel.writeIntArray(mIntArray);
+ mLongParcel = Parcel.obtain();
+ mLongParcel.writeLongArray(mLongArray);
+ }
+
+ @Override
+ protected void tearDown() {
+ mWriteParcel.recycle();
+ mWriteParcel = null;
+ }
+
+ public void timeWriteByteArray(int reps) {
+ for (int i = 0; i < reps; i++) {
+ mWriteParcel.setDataPosition(0);
+ mWriteParcel.writeByteArray(mByteArray);
+ }
+ }
+
+ public void timeCreateByteArray(int reps) {
+ for (int i = 0; i < reps; i++) {
+ mByteParcel.setDataPosition(0);
+ mByteParcel.createByteArray();
+ }
+ }
+
+ public void timeReadByteArray(int reps) {
+ for (int i = 0; i < reps; i++) {
+ mByteParcel.setDataPosition(0);
+ mByteParcel.readByteArray(mByteArray);
+ }
+ }
+
+ public void timeWriteIntArray(int reps) {
+ for (int i = 0; i < reps; i++) {
+ mWriteParcel.setDataPosition(0);
+ mWriteParcel.writeIntArray(mIntArray);
+ }
+ }
+
+ public void timeCreateIntArray(int reps) {
+ for (int i = 0; i < reps; i++) {
+ mIntParcel.setDataPosition(0);
+ mIntParcel.createIntArray();
+ }
+ }
+
+ public void timeReadIntArray(int reps) {
+ for (int i = 0; i < reps; i++) {
+ mIntParcel.setDataPosition(0);
+ mIntParcel.readIntArray(mIntArray);
+ }
+ }
+
+ public void timeWriteLongArray(int reps) {
+ for (int i = 0; i < reps; i++) {
+ mWriteParcel.setDataPosition(0);
+ mWriteParcel.writeLongArray(mLongArray);
+ }
+ }
+
+ public void timeCreateLongArray(int reps) {
+ for (int i = 0; i < reps; i++) {
+ mLongParcel.setDataPosition(0);
+ mLongParcel.createLongArray();
+ }
+ }
+
+ public void timeReadLongArray(int reps) {
+ for (int i = 0; i < reps; i++) {
+ mLongParcel.setDataPosition(0);
+ mLongParcel.readLongArray(mLongArray);
+ }
+ }
+
+}
diff --git a/core/tests/benchmarks/src/android/os/ParcelBenchmark.java b/core/tests/benchmarks/src/android/os/ParcelBenchmark.java
new file mode 100644
index 0000000..6a7b7c8
--- /dev/null
+++ b/core/tests/benchmarks/src/android/os/ParcelBenchmark.java
@@ -0,0 +1,77 @@
+/*
+ * 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 android.os;
+
+import com.google.caliper.SimpleBenchmark;
+
+public class ParcelBenchmark extends SimpleBenchmark {
+
+ private Parcel mParcel;
+
+ @Override
+ protected void setUp() {
+ mParcel = Parcel.obtain();
+ }
+
+ @Override
+ protected void tearDown() {
+ mParcel.recycle();
+ mParcel = null;
+ }
+
+ public void timeWriteByte(int reps) {
+ final byte val = 0xF;
+ for (int i = 0; i < reps; i++) {
+ mParcel.writeByte(val);
+ }
+ }
+
+ public void timeReadByte(int reps) {
+ mParcel.setDataCapacity(reps);
+ for (int i = 0; i < reps; i++) {
+ mParcel.readByte();
+ }
+ }
+
+ public void timeWriteInt(int reps) {
+ final int val = 0xF;
+ for (int i = 0; i < reps; i++) {
+ mParcel.writeInt(val);
+ }
+ }
+
+ public void timeReadInt(int reps) {
+ mParcel.setDataCapacity(reps << 2);
+ for (int i = 0; i < reps; i++) {
+ mParcel.readInt();
+ }
+ }
+
+ public void timeWriteLong(int reps) {
+ final long val = 0xF;
+ for (int i = 0; i < reps; i++) {
+ mParcel.writeLong(val);
+ }
+ }
+
+ public void timeReadLong(int reps) {
+ mParcel.setDataCapacity(reps << 3);
+ for (int i = 0; i < reps; i++) {
+ mParcel.readLong();
+ }
+ }
+}
diff --git a/core/tests/coretests/src/android/content/SyncOperationTest.java b/core/tests/coretests/src/android/content/SyncOperationTest.java
index 37e948d..910c721 100644
--- a/core/tests/coretests/src/android/content/SyncOperationTest.java
+++ b/core/tests/coretests/src/android/content/SyncOperationTest.java
@@ -41,7 +41,7 @@
Bundle b2 = new Bundle();
b2.putBoolean("b2", true);
- SyncOperation op1 = new SyncOperation(account1,
+ SyncOperation op1 = new SyncOperation(account1, 0,
1,
"authority1",
b1,
@@ -51,7 +51,7 @@
false);
// Same as op1 but different time infos
- SyncOperation op2 = new SyncOperation(account1,
+ SyncOperation op2 = new SyncOperation(account1, 0,
1,
"authority1",
b1,
@@ -61,7 +61,7 @@
false);
// Same as op1 but different authority
- SyncOperation op3 = new SyncOperation(account1,
+ SyncOperation op3 = new SyncOperation(account1, 0,
1,
"authority2",
b1,
@@ -71,7 +71,7 @@
false);
// Same as op1 but different account
- SyncOperation op4 = new SyncOperation(account2,
+ SyncOperation op4 = new SyncOperation(account2, 0,
1,
"authority1",
b1,
@@ -81,7 +81,7 @@
false);
// Same as op1 but different bundle
- SyncOperation op5 = new SyncOperation(account1,
+ SyncOperation op5 = new SyncOperation(account1, 0,
1,
"authority1",
b2,
diff --git a/core/tests/coretests/src/android/content/SyncStorageEngineTest.java b/core/tests/coretests/src/android/content/SyncStorageEngineTest.java
index ae41409..96f313a 100644
--- a/core/tests/coretests/src/android/content/SyncStorageEngineTest.java
+++ b/core/tests/coretests/src/android/content/SyncStorageEngineTest.java
@@ -20,6 +20,7 @@
import android.accounts.Account;
import android.os.Bundle;
+import android.os.Debug;
import android.test.AndroidTestCase;
import android.test.RenamingDelegatingContext;
import android.test.mock.MockContentResolver;
@@ -34,6 +35,10 @@
public class SyncStorageEngineTest extends AndroidTestCase {
+ private File getSyncDir() {
+ return new File(new File(getContext().getFilesDir(), "system"), "sync");
+ }
+
/**
* Test that we handle the case of a history row being old enough to purge before the
* correcponding sync is finished. This can happen if the clock changes while we are syncing.
@@ -52,7 +57,7 @@
long time0 = 1000;
long historyId = engine.insertStartSyncEvent(
- account, authority, time0, SyncStorageEngine.SOURCE_LOCAL);
+ account, 0, authority, time0, SyncStorageEngine.SOURCE_LOCAL);
long time1 = time0 + SyncStorageEngine.MILLIS_IN_4WEEKS * 2;
engine.stopSyncEvent(historyId, time1 - time0, "yay", 0, 0);
}
@@ -82,38 +87,47 @@
SyncStorageEngine engine = SyncStorageEngine.newTestInstance(
new TestContext(mockResolver, getContext()));
- removePeriodicSyncs(engine, account1, authority);
- removePeriodicSyncs(engine, account2, authority);
+ removePeriodicSyncs(engine, account1, 0, authority);
+ removePeriodicSyncs(engine, account2, 0, authority);
+ removePeriodicSyncs(engine, account1, 1, authority);
// this should add two distinct periodic syncs for account1 and one for account2
- engine.addPeriodicSync(sync1.account, sync1.authority, sync1.extras, sync1.period);
- engine.addPeriodicSync(sync2.account, sync2.authority, sync2.extras, sync2.period);
- engine.addPeriodicSync(sync3.account, sync3.authority, sync3.extras, sync3.period);
- engine.addPeriodicSync(sync4.account, sync4.authority, sync4.extras, sync4.period);
+ engine.addPeriodicSync(sync1.account, 0, sync1.authority, sync1.extras, sync1.period);
+ engine.addPeriodicSync(sync2.account, 0, sync2.authority, sync2.extras, sync2.period);
+ engine.addPeriodicSync(sync3.account, 0, sync3.authority, sync3.extras, sync3.period);
+ engine.addPeriodicSync(sync4.account, 0, sync4.authority, sync4.extras, sync4.period);
+ // add a second user
+ engine.addPeriodicSync(sync2.account, 1, sync2.authority, sync2.extras, sync2.period);
- List<PeriodicSync> syncs = engine.getPeriodicSyncs(account1, authority);
+ List<PeriodicSync> syncs = engine.getPeriodicSyncs(account1, 0, authority);
assertEquals(2, syncs.size());
assertEquals(sync1, syncs.get(0));
assertEquals(sync3, syncs.get(1));
- engine.removePeriodicSync(sync1.account, sync1.authority, sync1.extras);
+ engine.removePeriodicSync(sync1.account, 0, sync1.authority, sync1.extras);
- syncs = engine.getPeriodicSyncs(account1, authority);
+ syncs = engine.getPeriodicSyncs(account1, 0, authority);
assertEquals(1, syncs.size());
assertEquals(sync3, syncs.get(0));
- syncs = engine.getPeriodicSyncs(account2, authority);
+ syncs = engine.getPeriodicSyncs(account2, 0, authority);
assertEquals(1, syncs.size());
assertEquals(sync4, syncs.get(0));
+
+ syncs = engine.getPeriodicSyncs(sync2.account, 1, sync2.authority);
+ assertEquals(1, syncs.size());
+ assertEquals(sync2, syncs.get(0));
}
- private void removePeriodicSyncs(SyncStorageEngine engine, Account account, String authority) {
- engine.setIsSyncable(account, authority, engine.getIsSyncable(account, authority));
- List<PeriodicSync> syncs = engine.getPeriodicSyncs(account, authority);
+ private void removePeriodicSyncs(SyncStorageEngine engine, Account account, int userId,
+ String authority) {
+ engine.setIsSyncable(account, userId, authority,
+ engine.getIsSyncable(account, 0, authority));
+ List<PeriodicSync> syncs = engine.getPeriodicSyncs(account, userId, authority);
for (PeriodicSync sync : syncs) {
- engine.removePeriodicSync(sync.account, sync.authority, sync.extras);
+ engine.removePeriodicSync(sync.account, userId, sync.authority, sync.extras);
}
}
@@ -147,57 +161,57 @@
SyncStorageEngine engine = SyncStorageEngine.newTestInstance(
new TestContext(mockResolver, getContext()));
- removePeriodicSyncs(engine, account1, authority1);
- removePeriodicSyncs(engine, account2, authority1);
- removePeriodicSyncs(engine, account1, authority2);
- removePeriodicSyncs(engine, account2, authority2);
+ removePeriodicSyncs(engine, account1, 0, authority1);
+ removePeriodicSyncs(engine, account2, 0, authority1);
+ removePeriodicSyncs(engine, account1, 0, authority2);
+ removePeriodicSyncs(engine, account2, 0, authority2);
- engine.setMasterSyncAutomatically(false);
+ engine.setMasterSyncAutomatically(false, 0);
- engine.setIsSyncable(account1, authority1, 1);
- engine.setSyncAutomatically(account1, authority1, true);
+ engine.setIsSyncable(account1, 0, authority1, 1);
+ engine.setSyncAutomatically(account1, 0, authority1, true);
- engine.setIsSyncable(account2, authority1, 1);
- engine.setSyncAutomatically(account2, authority1, true);
+ engine.setIsSyncable(account2, 0, authority1, 1);
+ engine.setSyncAutomatically(account2, 0, authority1, true);
- engine.setIsSyncable(account1, authority2, 1);
- engine.setSyncAutomatically(account1, authority2, false);
+ engine.setIsSyncable(account1, 0, authority2, 1);
+ engine.setSyncAutomatically(account1, 0, authority2, false);
- engine.setIsSyncable(account2, authority2, 0);
- engine.setSyncAutomatically(account2, authority2, true);
+ engine.setIsSyncable(account2, 0, authority2, 0);
+ engine.setSyncAutomatically(account2, 0, authority2, true);
- engine.addPeriodicSync(sync1.account, sync1.authority, sync1.extras, sync1.period);
- engine.addPeriodicSync(sync2.account, sync2.authority, sync2.extras, sync2.period);
- engine.addPeriodicSync(sync3.account, sync3.authority, sync3.extras, sync3.period);
- engine.addPeriodicSync(sync4.account, sync4.authority, sync4.extras, sync4.period);
- engine.addPeriodicSync(sync5.account, sync5.authority, sync5.extras, sync5.period);
+ engine.addPeriodicSync(sync1.account, 0, sync1.authority, sync1.extras, sync1.period);
+ engine.addPeriodicSync(sync2.account, 0, sync2.authority, sync2.extras, sync2.period);
+ engine.addPeriodicSync(sync3.account, 0, sync3.authority, sync3.extras, sync3.period);
+ engine.addPeriodicSync(sync4.account, 0, sync4.authority, sync4.extras, sync4.period);
+ engine.addPeriodicSync(sync5.account, 0, sync5.authority, sync5.extras, sync5.period);
engine.writeAllState();
engine.clearAndReadState();
- List<PeriodicSync> syncs = engine.getPeriodicSyncs(account1, authority1);
+ List<PeriodicSync> syncs = engine.getPeriodicSyncs(account1, 0, authority1);
assertEquals(2, syncs.size());
assertEquals(sync1, syncs.get(0));
assertEquals(sync2, syncs.get(1));
- syncs = engine.getPeriodicSyncs(account1, authority2);
+ syncs = engine.getPeriodicSyncs(account1, 0, authority2);
assertEquals(2, syncs.size());
assertEquals(sync3, syncs.get(0));
assertEquals(sync4, syncs.get(1));
- syncs = engine.getPeriodicSyncs(account2, authority1);
+ syncs = engine.getPeriodicSyncs(account2, 0, authority1);
assertEquals(1, syncs.size());
assertEquals(sync5, syncs.get(0));
- assertEquals(true, engine.getSyncAutomatically(account1, authority1));
- assertEquals(true, engine.getSyncAutomatically(account2, authority1));
- assertEquals(false, engine.getSyncAutomatically(account1, authority2));
- assertEquals(true, engine.getSyncAutomatically(account2, authority2));
+ assertEquals(true, engine.getSyncAutomatically(account1, 0, authority1));
+ assertEquals(true, engine.getSyncAutomatically(account2, 0, authority1));
+ assertEquals(false, engine.getSyncAutomatically(account1, 0, authority2));
+ assertEquals(true, engine.getSyncAutomatically(account2, 0, authority2));
- assertEquals(1, engine.getIsSyncable(account1, authority1));
- assertEquals(1, engine.getIsSyncable(account2, authority1));
- assertEquals(1, engine.getIsSyncable(account1, authority2));
- assertEquals(0, engine.getIsSyncable(account2, authority2));
+ assertEquals(1, engine.getIsSyncable(account1, 0, authority1));
+ assertEquals(1, engine.getIsSyncable(account2, 0, authority1));
+ assertEquals(1, engine.getIsSyncable(account1, 0, authority2));
+ assertEquals(0, engine.getIsSyncable(account2, 0, authority2));
}
@MediumTest
@@ -220,12 +234,13 @@
byte[] accountsFileData = ("<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n"
+ "<accounts>\n"
- + "<authority id=\"0\" account=\"account1\" type=\"type1\" authority=\"auth1\" />\n"
- + "<authority id=\"1\" account=\"account1\" type=\"type1\" authority=\"auth2\" />\n"
- + "<authority id=\"2\" account=\"account1\" type=\"type1\" authority=\"auth3\" />\n"
+ + "<authority id=\"0\" user=\"0\" account=\"account1\" type=\"type1\" authority=\"auth1\" />\n"
+ + "<authority id=\"1\" user=\"0\" account=\"account1\" type=\"type1\" authority=\"auth2\" />\n"
+ + "<authority id=\"2\" account=\"account1\" type=\"type1\" authority=\"auth3\" />\n"
+ + "<authority id=\"3\" user=\"1\" account=\"account1\" type=\"type1\" authority=\"auth3\" />\n"
+ "</accounts>\n").getBytes();
- File syncDir = new File(new File(testContext.getFilesDir(), "system"), "sync");
+ File syncDir = getSyncDir();
syncDir.mkdirs();
AtomicFile accountInfoFile = new AtomicFile(new File(syncDir, "accounts.xml"));
FileOutputStream fos = accountInfoFile.startWrite();
@@ -234,15 +249,19 @@
SyncStorageEngine engine = SyncStorageEngine.newTestInstance(testContext);
- List<PeriodicSync> syncs = engine.getPeriodicSyncs(account, authority1);
+ List<PeriodicSync> syncs = engine.getPeriodicSyncs(account, 0, authority1);
assertEquals(1, syncs.size());
assertEquals(sync1, syncs.get(0));
- syncs = engine.getPeriodicSyncs(account, authority2);
+ syncs = engine.getPeriodicSyncs(account, 0, authority2);
assertEquals(1, syncs.size());
assertEquals(sync2, syncs.get(0));
- syncs = engine.getPeriodicSyncs(account, authority3);
+ syncs = engine.getPeriodicSyncs(account, 0, authority3);
+ assertEquals(1, syncs.size());
+ assertEquals(sync3, syncs.get(0));
+
+ syncs = engine.getPeriodicSyncs(account, 1, authority3);
assertEquals(1, syncs.size());
assertEquals(sync3, syncs.get(0));
@@ -260,13 +279,13 @@
engine.clearAndReadState();
- syncs = engine.getPeriodicSyncs(account, authority1);
+ syncs = engine.getPeriodicSyncs(account, 0, authority1);
assertEquals(0, syncs.size());
- syncs = engine.getPeriodicSyncs(account, authority2);
+ syncs = engine.getPeriodicSyncs(account, 0, authority2);
assertEquals(0, syncs.size());
- syncs = engine.getPeriodicSyncs(account, authority3);
+ syncs = engine.getPeriodicSyncs(account, 0, authority3);
assertEquals(0, syncs.size());
accountsFileData = ("<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n"
@@ -289,20 +308,48 @@
engine.clearAndReadState();
- syncs = engine.getPeriodicSyncs(account, authority1);
+ syncs = engine.getPeriodicSyncs(account, 0, authority1);
assertEquals(1, syncs.size());
assertEquals(sync1s, syncs.get(0));
- syncs = engine.getPeriodicSyncs(account, authority2);
+ syncs = engine.getPeriodicSyncs(account, 0, authority2);
assertEquals(1, syncs.size());
assertEquals(sync2s, syncs.get(0));
- syncs = engine.getPeriodicSyncs(account, authority3);
+ syncs = engine.getPeriodicSyncs(account, 0, authority3);
assertEquals(1, syncs.size());
assertEquals(sync3s, syncs.get(0));
}
@MediumTest
+ public void testListenForTicklesParsing() throws Exception {
+ byte[] accountsFileData = ("<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n"
+ + "<accounts>\n"
+ + "<listenForTickles user=\"0\" enabled=\"false\" />"
+ + "<listenForTickles user=\"1\" enabled=\"true\" />"
+ + "<authority id=\"0\" user=\"0\" account=\"account1\" type=\"type1\" authority=\"auth1\" />\n"
+ + "<authority id=\"1\" user=\"1\" account=\"account1\" type=\"type1\" authority=\"auth1\" />\n"
+ + "</accounts>\n").getBytes();
+
+ MockContentResolver mockResolver = new MockContentResolver();
+ final TestContext testContext = new TestContext(mockResolver, getContext());
+
+ File syncDir = getSyncDir();
+ syncDir.mkdirs();
+ AtomicFile accountInfoFile = new AtomicFile(new File(syncDir, "accounts.xml"));
+ FileOutputStream fos = accountInfoFile.startWrite();
+ fos.write(accountsFileData);
+ accountInfoFile.finishWrite(fos);
+
+ SyncStorageEngine engine = SyncStorageEngine.newTestInstance(testContext);
+
+ assertEquals(false, engine.getMasterSyncAutomatically(0));
+ assertEquals(true, engine.getMasterSyncAutomatically(1));
+ assertEquals(true, engine.getMasterSyncAutomatically(2));
+
+ }
+
+ @MediumTest
public void testAuthorityRenaming() throws Exception {
final Account account1 = new Account("acc1", "type1");
final Account account2 = new Account("acc2", "type2");
@@ -339,17 +386,17 @@
SyncStorageEngine engine = SyncStorageEngine.newTestInstance(testContext);
- assertEquals(false, engine.getSyncAutomatically(account1, authorityContacts));
- assertEquals(false, engine.getSyncAutomatically(account1, authorityCalendar));
- assertEquals(true, engine.getSyncAutomatically(account1, authorityOther));
- assertEquals(true, engine.getSyncAutomatically(account1, authorityContactsNew));
- assertEquals(true, engine.getSyncAutomatically(account1, authorityCalendarNew));
+ assertEquals(false, engine.getSyncAutomatically(account1, 0, authorityContacts));
+ assertEquals(false, engine.getSyncAutomatically(account1, 0, authorityCalendar));
+ assertEquals(true, engine.getSyncAutomatically(account1, 0, authorityOther));
+ assertEquals(true, engine.getSyncAutomatically(account1, 0, authorityContactsNew));
+ assertEquals(true, engine.getSyncAutomatically(account1, 0, authorityCalendarNew));
- assertEquals(false, engine.getSyncAutomatically(account2, authorityContacts));
- assertEquals(false, engine.getSyncAutomatically(account2, authorityCalendar));
- assertEquals(true, engine.getSyncAutomatically(account2, authorityOther));
- assertEquals(false, engine.getSyncAutomatically(account2, authorityContactsNew));
- assertEquals(false, engine.getSyncAutomatically(account2, authorityCalendarNew));
+ assertEquals(false, engine.getSyncAutomatically(account2, 0, authorityContacts));
+ assertEquals(false, engine.getSyncAutomatically(account2, 0, authorityCalendar));
+ assertEquals(true, engine.getSyncAutomatically(account2, 0, authorityOther));
+ assertEquals(false, engine.getSyncAutomatically(account2, 0, authorityContactsNew));
+ assertEquals(false, engine.getSyncAutomatically(account2, 0, authorityCalendarNew));
}
@SmallTest
@@ -379,10 +426,10 @@
SyncStorageEngine engine = SyncStorageEngine.newTestInstance(testContext);
- assertEquals(-1, engine.getIsSyncable(account, "other1"));
- assertEquals(1, engine.getIsSyncable(account, "other2"));
- assertEquals(0, engine.getIsSyncable(account, "other3"));
- assertEquals(1, engine.getIsSyncable(account, "other4"));
+ assertEquals(-1, engine.getIsSyncable(account, 0, "other1"));
+ assertEquals(1, engine.getIsSyncable(account, 0, "other2"));
+ assertEquals(0, engine.getIsSyncable(account, 0, "other3"));
+ assertEquals(1, engine.getIsSyncable(account, 0, "other4"));
}
}
diff --git a/docs/html/design/building-blocks/buttons.html b/docs/html/design/building-blocks/buttons.html
deleted file mode 100644
index 9f9652f9..0000000
--- a/docs/html/design/building-blocks/buttons.html
+++ /dev/null
@@ -1,197 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Buttons
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Buttons</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>A button consists of text and/or an image that clearly communicates what action will occur when the
-user touches it. Android supports two different types of buttons: <em>basic buttons</em> and <em>borderless
-buttons</em>. Both can contain text labels and/or images.</p>
-
-<div style="text-align: center">
- <img src="../static/content/buttons_basic.png">
-</div>
-
-<h2 id="basic">Basic Buttons</h2>
-
-<p>Basic buttons are traditional buttons with borders and background. Android supports two styles for
-basic buttons: default and small. Default buttons have slightly larger font size and are optimized
-for display outside of form content. Small buttons are intended for display alongside other content.
-They have a smaller font and smaller minimum height. Use small buttons in forms where they need to
-align with other UI elements.</p>
-
-<img src="../static/content/buttons_default_small.png">
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
- <div class="figure-caption">
- Default buttons in Holo Dark & Light.
- </div>
- </div>
- <div class="layout-content-col span-6">
- <div class="figure-caption">
- Small buttons in Holo Dark & Light.
- </div>
- </div>
-</div>
-
-<h2 id="borderless">Borderless Buttons</h2>
-
-<p>Borderless buttons resemble basic buttons except that they have no borders or background. You can
-use borderless buttons with both icons and text. Borderless buttons are visually more lightweight
-than basic buttons and integrate nicely with other content.</p>
-
-<img src="../static/content/buttons_borderless.png">
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/buttons.jd b/docs/html/design/building-blocks/buttons.jd
new file mode 100644
index 0000000..18beab0
--- /dev/null
+++ b/docs/html/design/building-blocks/buttons.jd
@@ -0,0 +1,40 @@
+page.title=Buttons
+@jd:body
+
+<p>A button consists of text and/or an image that clearly communicates what action will occur when the
+user touches it. Android supports two different types of buttons: <em>basic buttons</em> and <em>borderless
+buttons</em>. Both can contain text labels and/or images.</p>
+
+<div style="text-align: center">
+ <img src="{@docRoot}design/media/buttons_basic.png">
+</div>
+
+<h2 id="basic">Basic Buttons</h2>
+
+<p>Basic buttons are traditional buttons with borders and background. Android supports two styles for
+basic buttons: default and small. Default buttons have slightly larger font size and are optimized
+for display outside of form content. Small buttons are intended for display alongside other content.
+They have a smaller font and smaller minimum height. Use small buttons in forms where they need to
+align with other UI elements.</p>
+
+<img src="{@docRoot}design/media/buttons_default_small.png">
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+ <div class="figure-caption">
+ Default buttons in Holo Dark & Light.
+ </div>
+ </div>
+ <div class="layout-content-col span-6">
+ <div class="figure-caption">
+ Small buttons in Holo Dark & Light.
+ </div>
+ </div>
+</div>
+
+<h2 id="borderless">Borderless Buttons</h2>
+
+<p>Borderless buttons resemble basic buttons except that they have no borders or background. You can
+use borderless buttons with both icons and text. Borderless buttons are visually more lightweight
+than basic buttons and integrate nicely with other content.</p>
+
+<img src="{@docRoot}design/media/buttons_borderless.png">
diff --git a/docs/html/design/building-blocks/dialogs.html b/docs/html/design/building-blocks/dialogs.html
deleted file mode 100644
index f03a57a..0000000
--- a/docs/html/design/building-blocks/dialogs.html
+++ /dev/null
@@ -1,269 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Dialogs
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Dialogs</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Dialogs prompt the user for decisions or additional information required by the app to continue a
-task. Such requests can range from simple Cancel/OK decisions to more complex layouts asking the
-user to adjust settings or enter text.</p>
-
-<img src="../static/content/dialogs_main.png">
-
-<div class="with-callouts">
-
-<ol>
-<li>
-<h4>Optional title region</h4>
-<p>The title introduces the content of your dialog. It can, for example, identify the name of a
- setting that the user is about to change, or request a decision.</p>
-</li>
-<li>
-<h4>Content area</h4>
-<p>Dialog content varies widely. For settings dialogs, a dialog may contain UI elements such as
- sliders, text fields, checkboxes, or radio buttons that allow the user to change app or system
- settings. In other cases, such as alerts, the content may consist solely of text that provides
- further context for a user decision.</p>
-</li>
-<li>
-<h4>Action buttons</h4>
-<p>Action buttons are typically Cancel and/or OK, with OK indicating the preferred or most likely
- action. However, if the options consist of specific actions such as Close or Wait rather than
- a confirmation or cancellation of the action described in the content, then all the buttons
- should be active verbs. As a rule, the dismissive action of a dialog is always on the left
- whereas the affirmative actions are on the right.</p>
-</li>
-</ol>
-
-</div>
-
-<img src="../static/content/dialogs_examples.png">
-<div class="figure-caption">
- Samples of typical dialog use in Android.
-</div>
-
-<h2 id="alerts">Alerts</h2>
-
-<p>Alerts inform the user about a situation that requires their confirmation or acknowledgement before
-proceeding. They differ slightly in appearance based upon the severity and impact of the message
-conveyed.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8">
-
- <img src="../static/content/dialogs_w_no_title.png">
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Alerts without title bars</h4>
-<p>Most alerts don't need titles. Usually the decision doesn't have a severe impact and can be summed
-up succinctly in a sentence or two. The content area should either ask a question (such as "Delete
-this conversation?") or make a clear statement whose relationship to the action buttons is obvious.</p>
-
- </div>
-</div>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8">
-
- <img src="../static/content/dialogs_w_title.png">
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Alerts with title bars</h4>
-<p>Use alerts with title bars sparingly. They are appropriate only when a high-risk operation involving
-potential loss of data, connectivity, extra charges, and so on requires a clear question or
-statement (the title) and some additional explanation (in the content area).</p>
-<p>Keep the question or statement short: for example, "Erase USB storage?" Avoid apologies. A user
-should be able to skip the content completely and still have a clear idea of what choices are
-available based on the title and the text of the action buttons.</p>
-
- </div>
-</div>
-
-
-<h2 id="popups">Popups</h2>
-
-<p>Popups are lightweight version of dialogs that require a single selection from the user. Popups
-don't have have explicit buttons that accept or cancel the operation. Instead, making a selection
-advances the workflow, and simply touching outside the popup dismisses it.</p>
-
-<img src="../static/content/dialogs_popups_example.png">
-
-
-<h2 id="toasts">Toasts</h2>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
- <div class="vspace size-6"></div>
-
-<p>Toasts provide lightweight feedback about an operation in a small popup. For example, navigating
-away from an email before you send it triggers a "Draft saved" toast to let you know that you can
-continue editing later. Toasts automatically disappear after a timeout.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/dialogs_toasts.png">
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/dialogs.jd b/docs/html/design/building-blocks/dialogs.jd
new file mode 100644
index 0000000..9b653ee
--- /dev/null
+++ b/docs/html/design/building-blocks/dialogs.jd
@@ -0,0 +1,112 @@
+page.title=Dialogs
+@jd:body
+
+<p>Dialogs prompt the user for decisions or additional information required by the app to continue a
+task. Such requests can range from simple Cancel/OK decisions to more complex layouts asking the
+user to adjust settings or enter text.</p>
+
+<img src="{@docRoot}design/media/dialogs_main.png">
+
+<div class="with-callouts">
+
+<ol>
+<li>
+<h4>Optional title region</h4>
+<p>The title introduces the content of your dialog. It can, for example, identify the name of a
+ setting that the user is about to change, or request a decision.</p>
+</li>
+<li>
+<h4>Content area</h4>
+<p>Dialog content varies widely. For settings dialogs, a dialog may contain UI elements such as
+ sliders, text fields, checkboxes, or radio buttons that allow the user to change app or system
+ settings. In other cases, such as alerts, the content may consist solely of text that provides
+ further context for a user decision.</p>
+</li>
+<li>
+<h4>Action buttons</h4>
+<p>Action buttons are typically Cancel and/or OK, with OK indicating the preferred or most likely
+ action. However, if the options consist of specific actions such as Close or Wait rather than
+ a confirmation or cancellation of the action described in the content, then all the buttons
+ should be active verbs. As a rule, the dismissive action of a dialog is always on the left
+ whereas the affirmative actions are on the right.</p>
+</li>
+</ol>
+
+</div>
+
+<img src="{@docRoot}design/media/dialogs_examples.png">
+<div class="figure-caption">
+ Samples of typical dialog use in Android.
+</div>
+
+<h2 id="alerts">Alerts</h2>
+
+<p>Alerts inform the user about a situation that requires their confirmation or acknowledgement before
+proceeding. They differ slightly in appearance based upon the severity and impact of the message
+conveyed.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/dialogs_w_no_title.png">
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Alerts without title bars</h4>
+<p>Most alerts don't need titles. Usually the decision doesn't have a severe impact and can be summed
+up succinctly in a sentence or two. The content area should either ask a question (such as "Delete
+this conversation?") or make a clear statement whose relationship to the action buttons is obvious.</p>
+
+ </div>
+</div>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/dialogs_w_title.png">
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Alerts with title bars</h4>
+<p>Use alerts with title bars sparingly. They are appropriate only when a high-risk operation involving
+potential loss of data, connectivity, extra charges, and so on requires a clear question or
+statement (the title) and some additional explanation (in the content area).</p>
+<p>Keep the question or statement short: for example, "Erase USB storage?" Avoid apologies. A user
+should be able to skip the content completely and still have a clear idea of what choices are
+available based on the title and the text of the action buttons.</p>
+
+ </div>
+</div>
+
+
+<h2 id="popups">Popups</h2>
+
+<p>Popups are lightweight version of dialogs that require a single selection from the user. Popups
+don't have have explicit buttons that accept or cancel the operation. Instead, making a selection
+advances the workflow, and simply touching outside the popup dismisses it.</p>
+
+<img src="{@docRoot}design/media/dialogs_popups_example.png">
+
+
+<h2 id="toasts">Toasts</h2>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+ <div class="vspace size-6"></div>
+
+<p>Toasts provide lightweight feedback about an operation in a small popup. For example, navigating
+away from an email before you send it triggers a "Draft saved" toast to let you know that you can
+continue editing later. Toasts automatically disappear after a timeout.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/dialogs_toasts.png">
+
+ </div>
+</div>
diff --git a/docs/html/design/building-blocks/grid-lists.html b/docs/html/design/building-blocks/grid-lists.html
deleted file mode 100644
index 3f60216..0000000
--- a/docs/html/design/building-blocks/grid-lists.html
+++ /dev/null
@@ -1,237 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Grid Lists
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Grid Lists</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<img src="../static/content/gridview_overview.png">
-
-<p>Grid lists are an alternative to standard list views. They are best suited for showing data sets
-that represent themselves through images. In contrast to simple lists, grid lists may scroll either
-vertically or horizontally.</p>
-
-
-
-<h2 id="generic_grid">Generic Grids</h2>
-
-
-<p>The items in a grid list are arranged in two dimensions, one of which is fixed when scrolling
-content. The scrolling direction dictates the ordering of the items within the grid list. Since the
-scrolling direction is not deterministic, make it easy for the user to determine the orientation by
-cutting off grid items to communicate where the overflow is located.</p>
-<p>Avoid creating grid lists that scroll in two dimensions.</p>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
- <img src="../static/content/gridview_vertical.png">
-
- </div>
- <div class="layout-content-col span-6">
-
-<h4>Vertical scrolling</h4>
-<p>Vertically scrolling grid list items are sorted in traditional western reading direction:
-left-to-right and top-down. When displaying the list, cut off the items in the bottom row to
-communicate that the user can scroll the list down to show additional items. Be sure to retain this
-scheme when the user rotates the screen.</p>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
- <img src="../static/content/gridview_horizontal.png">
-
- </div>
- <div class="layout-content-col span-6">
-
-<h4>Horizontal scrolling</h4>
-<p>Horizontally scrolling lists fix the vertical axis of the item grid. Compared to vertically
-scrolling lists, the sorting changes slightly to a top-down and left-to-right arrangement. Employ
-the same technique of cutting off the items in the rightmost column to indicate the scrolling
-direction.</p>
-<p>Don't use scrolling tabs as a means to switch views in conjunction with horizontally scrolling grid
-lists, because the horizontal gesture for view and content navigation will conflict. If you show
-scrolling tabs for view navigation together with a grid list, use vertical grid scrolling for list
-navigation.</p>
-
- </div>
-</div>
-
-
-<h2 id="with-labels">Grid List with Labels</h2>
-
-<p>Use labels to display additional contextual information for your grid list items.</p>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
- <img src="../static/content/gridview_style.png">
-
- </div>
- <div class="layout-content-col span-6">
-
-<h4>Style</h4>
-<p>Use semi-transparent panels on top of the grid list items to display your labels. This allows you to
-control the contrast and ensures legibility of the labels while letting the content "shine through".</p>
-
- </div>
-</div>
-
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/grid-lists.jd b/docs/html/design/building-blocks/grid-lists.jd
new file mode 100644
index 0000000..775ebcc
--- /dev/null
+++ b/docs/html/design/building-blocks/grid-lists.jd
@@ -0,0 +1,79 @@
+page.title=Grid Lists
+@jd:body
+
+<img src="{@docRoot}design/media/gridview_overview.png">
+
+<p>Grid lists are an alternative to standard list views. They are best suited for showing data sets
+that represent themselves through images. In contrast to simple lists, grid lists may scroll either
+vertically or horizontally.</p>
+
+
+
+<h2 id="generic_grid">Generic Grids</h2>
+
+
+<p>The items in a grid list are arranged in two dimensions, one of which is fixed when scrolling
+content. The scrolling direction dictates the ordering of the items within the grid list. Since the
+scrolling direction is not deterministic, make it easy for the user to determine the orientation by
+cutting off grid items to communicate where the overflow is located.</p>
+<p>Avoid creating grid lists that scroll in two dimensions.</p>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/gridview_vertical.png">
+
+ </div>
+ <div class="layout-content-col span-6">
+
+<h4>Vertical scrolling</h4>
+<p>Vertically scrolling grid list items are sorted in traditional western reading direction:
+left-to-right and top-down. When displaying the list, cut off the items in the bottom row to
+communicate that the user can scroll the list down to show additional items. Be sure to retain this
+scheme when the user rotates the screen.</p>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/gridview_horizontal.png">
+
+ </div>
+ <div class="layout-content-col span-6">
+
+<h4>Horizontal scrolling</h4>
+<p>Horizontally scrolling lists fix the vertical axis of the item grid. Compared to vertically
+scrolling lists, the sorting changes slightly to a top-down and left-to-right arrangement. Employ
+the same technique of cutting off the items in the rightmost column to indicate the scrolling
+direction.</p>
+<p>Don't use scrolling tabs as a means to switch views in conjunction with horizontally scrolling grid
+lists, because the horizontal gesture for view and content navigation will conflict. If you show
+scrolling tabs for view navigation together with a grid list, use vertical grid scrolling for list
+navigation.</p>
+
+ </div>
+</div>
+
+
+<h2 id="with-labels">Grid List with Labels</h2>
+
+<p>Use labels to display additional contextual information for your grid list items.</p>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/gridview_style.png">
+
+ </div>
+ <div class="layout-content-col span-6">
+
+<h4>Style</h4>
+<p>Use semi-transparent panels on top of the grid list items to display your labels. This allows you to
+control the contrast and ensures legibility of the labels while letting the content "shine through".</p>
+
+ </div>
+</div>
diff --git a/docs/html/design/building-blocks/index.html b/docs/html/design/building-blocks/index.html
deleted file mode 100644
index 029cabf..0000000
--- a/docs/html/design/building-blocks/index.html
+++ /dev/null
@@ -1,175 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Building Blocks
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
-<style>
-#landing-graphic-container {
- position: relative;
-}
-
-#text-overlay {
- position: absolute;
- left: 10px;
- top: 472px;
- width: 450px;
-}
-</style>
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
-<div class="layout-content-row content-header just-links">
- <div class="layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
-</div>
-
-
-
-
-<div id="landing-graphic-container">
- <div id="text-overlay">
- Your inventory of ready-to-use elements for creating outstanding apps.
- <br><br>
- <a href="../building-blocks/tabs.html" class="landing-page-link">Tabs</a>
- </div>
-
- <a href="../building-blocks/tabs.html">
- <img src="../static/content/building_blocks_landing.png">
- </a>
-</div>
-
-
-
-
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/index.jd b/docs/html/design/building-blocks/index.jd
new file mode 100644
index 0000000..52b4915
--- /dev/null
+++ b/docs/html/design/building-blocks/index.jd
@@ -0,0 +1,29 @@
+page.title=Building Blocks
+header.justLinks=1
+footer.hide=1
+@jd:body
+
+<style>
+#landing-graphic-container {
+ position: relative;
+}
+
+#text-overlay {
+ position: absolute;
+ left: 10px;
+ top: 472px;
+ width: 450px;
+}
+</style>
+
+<div id="landing-graphic-container">
+ <div id="text-overlay">
+ Your inventory of ready-to-use elements for creating outstanding apps.
+ <br><br>
+ <a href="{@docRoot}design/building-blocks/tabs.html" class="landing-page-link">Tabs</a>
+ </div>
+
+ <a href="{@docRoot}design/building-blocks/tabs.html">
+ <img src="{@docRoot}design/media/building_blocks_landing.png">
+ </a>
+</div>
diff --git a/docs/html/design/building-blocks/lists.html b/docs/html/design/building-blocks/lists.html
deleted file mode 100644
index dfd13d9..0000000
--- a/docs/html/design/building-blocks/lists.html
+++ /dev/null
@@ -1,188 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Lists
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Lists</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Lists present multiple line items in a vertical arrangement. They can be used for data selection as
-well as drilldown navigation.</p>
-
-<div class="vspace size-1"> </div>
-
-<div class="layout-content-row clearfix">
- <div class="layout-content-col span-9">
-
- <img src="../static/content/lists_main.png">
-
- </div>
- <div class="layout-content-col span-4 with-callouts">
-
-<ol>
-<li>
-<h4>Section Divider</h4>
-<p>Use section dividers to organize the content of your list into groups and facilitate scanning.</p>
-</li>
-<li>
-<h4>Line Items</h4>
-<p>List items can accommodate a wide range of data types in different arrangements, including
- simple single-line items, multi-line items, and custom items with icons, checkboxes, and action
- buttons.</p>
-</li>
-</ol>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/lists.jd b/docs/html/design/building-blocks/lists.jd
new file mode 100644
index 0000000..aaa86b8
--- /dev/null
+++ b/docs/html/design/building-blocks/lists.jd
@@ -0,0 +1,31 @@
+page.title=Lists
+@jd:body
+
+<p>Lists present multiple line items in a vertical arrangement. They can be used for data selection as
+well as drilldown navigation.</p>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row clearfix">
+ <div class="layout-content-col span-9">
+
+ <img src="{@docRoot}design/media/lists_main.png">
+
+ </div>
+ <div class="layout-content-col span-4 with-callouts">
+
+<ol>
+<li>
+<h4>Section Divider</h4>
+<p>Use section dividers to organize the content of your list into groups and facilitate scanning.</p>
+</li>
+<li>
+<h4>Line Items</h4>
+<p>List items can accommodate a wide range of data types in different arrangements, including
+ simple single-line items, multi-line items, and custom items with icons, checkboxes, and action
+ buttons.</p>
+</li>
+</ol>
+
+ </div>
+</div>
diff --git a/docs/html/design/building-blocks/pickers.html b/docs/html/design/building-blocks/pickers.html
deleted file mode 100644
index fc9989c..0000000
--- a/docs/html/design/building-blocks/pickers.html
+++ /dev/null
@@ -1,191 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Pickers
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Pickers</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Pickers provide a simple way to select a single value from a set. In addition to touching the
-up/down arrow buttons, it's possible to set the desired value from the keyboard or via a swipe
-gesture.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-2"> </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/picker_space.png">
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Space considerations</h4>
-<p>Pickers can be used inline on a form, but their relatively large footprint is best suited for
-display in a dialog. For inline display, consider using more compact controls such as text fields or
-spinners.</p>
-
- </div>
-</div>
-
-<h2 id="date-time">Date and time pickers</h2>
-
-<p>Android provides these as ready-to-use dialogs. Each picker is a dialog with a set of controls for
-entering the parts of the date (month, day, year) or time (hour, minute, AM/PM). Using these in your
-app helps ensure that a user's specification of a data or time input is valid and formatted
-correctly. The format of a time and date picker adjusts automatically to the locale.</p>
-
-<img src="../static/content/picker_datetime.png">
-
-
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/pickers.jd b/docs/html/design/building-blocks/pickers.jd
new file mode 100644
index 0000000..85f2187
--- /dev/null
+++ b/docs/html/design/building-blocks/pickers.jd
@@ -0,0 +1,32 @@
+page.title=Pickers
+@jd:body
+
+<p>Pickers provide a simple way to select a single value from a set. In addition to touching the
+up/down arrow buttons, it's possible to set the desired value from the keyboard or via a swipe
+gesture.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-2"> </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/picker_space.png">
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Space considerations</h4>
+<p>Pickers can be used inline on a form, but their relatively large footprint is best suited for
+display in a dialog. For inline display, consider using more compact controls such as text fields or
+spinners.</p>
+
+ </div>
+</div>
+
+<h2 id="date-time">Date and time pickers</h2>
+
+<p>Android provides these as ready-to-use dialogs. Each picker is a dialog with a set of controls for
+entering the parts of the date (month, day, year) or time (hour, minute, AM/PM). Using these in your
+app helps ensure that a user's specification of a data or time input is valid and formatted
+correctly. The format of a time and date picker adjusts automatically to the locale.</p>
+
+<img src="{@docRoot}design/media/picker_datetime.png">
diff --git a/docs/html/design/building-blocks/progress.html b/docs/html/design/building-blocks/progress.html
deleted file mode 100644
index 32183bc..0000000
--- a/docs/html/design/building-blocks/progress.html
+++ /dev/null
@@ -1,238 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Progress and Activity
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
-
-
-
-
-<div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2 id="system">Feedback</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
-</div>
-
-<p>When an operation of interest to the user is taking place over a relatively long period of time,
-provide visual feedback that it's still happening and in the process of being completed.</p>
-<h2 id="progress">Progress</h2>
-
-<p>If you know the percentage of the operation that has been completed, use a determinate progress bar
-to give the user a sense of how much longer it will take.</p>
-
-<img src="../static/content/progress_download.png">
-
-<p>The progress bar should always travel from 0% to 100% completion. Avoid setting the bar to a lower
-value than a previous value, or using the same progress bar to represent the progress of multiple
-events, since doing so makes the display meaningless. If you're not sure how long a particular
-operation will take, use an indeterminate progress indicator.</p>
-
-<div class="vspace size-2"> </div>
-
-<img src="../static/content/progress_themes.png">
-<div class="figure-caption">
- Progress bar in Holo Dark and Holo Light.
-</div>
-
-<h2 id="activity">Activity</h2>
-
-<p>If you don't know how much longer an operation will continue, use an indeterminate progress
-indicator. There are two styles available: a flat bar and a circle. Use the one that best fits the
-available space.</p>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
- <img src="../static/content/progress_activity.png">
-
- </div>
- <div class="layout-content-col span-7 with-callouts">
-
- <ol>
- <li class="value-1"><h4>Activity bar (shown with the Holo Dark theme)</h4>
- <p>
-
-An indeterminate activity bar is used at the start of an application download because Market hasn't
-been able to contact the server yet, and it's not possible to determine how long it will take for
-the download to begin.
-
- </p>
- </li>
- </ol>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
- <img src="../static/content/progress_activity2.png">
-
- </div>
- <div class="layout-content-col span-7 with-callouts">
-
- <ol>
- <li class="value-2"><h4>Activity circle (shown with the Holo Light theme)</h4>
- <p>
-
-An indeterminate activity circle is used in the Gmail application when a message is being
-loaded because it's not possible to determine how long it will take to download the email.
-
- </p>
- </li>
- </ol>
-
- </div>
-</div>
-
-<p>You should only use one activity indicator on screen per activity, and it should appropriately sized
-for the surrounding context. For example, the largest activity circle works well when displayed in a
-blank content area, but not in a smaller dialog box.</p>
-
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/progress.jd b/docs/html/design/building-blocks/progress.jd
new file mode 100644
index 0000000..dc3ded1
--- /dev/null
+++ b/docs/html/design/building-blocks/progress.jd
@@ -0,0 +1,80 @@
+page.title=Progress and Activity
+header.title=Feedback
+@jd:body
+
+<p>When an operation of interest to the user is taking place over a relatively long period of time,
+provide visual feedback that it's still happening and in the process of being completed.</p>
+<h2 id="progress">Progress</h2>
+
+<p>If you know the percentage of the operation that has been completed, use a determinate progress bar
+to give the user a sense of how much longer it will take.</p>
+
+<img src="{@docRoot}design/media/progress_download.png">
+
+<p>The progress bar should always travel from 0% to 100% completion. Avoid setting the bar to a lower
+value than a previous value, or using the same progress bar to represent the progress of multiple
+events, since doing so makes the display meaningless. If you're not sure how long a particular
+operation will take, use an indeterminate progress indicator.</p>
+
+<div class="vspace size-2"> </div>
+
+<img src="{@docRoot}design/media/progress_themes.png">
+<div class="figure-caption">
+ Progress bar in Holo Dark and Holo Light.
+</div>
+
+<h2 id="activity">Activity</h2>
+
+<p>If you don't know how much longer an operation will continue, use an indeterminate progress
+indicator. There are two styles available: a flat bar and a circle. Use the one that best fits the
+available space.</p>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/progress_activity.png">
+
+ </div>
+ <div class="layout-content-col span-7 with-callouts">
+
+ <ol>
+ <li class="value-1"><h4>Activity bar (shown with the Holo Dark theme)</h4>
+ <p>
+
+An indeterminate activity bar is used at the start of an application download because Google Play hasn't
+been able to contact the server yet, and it's not possible to determine how long it will take for
+the download to begin.
+
+ </p>
+ </li>
+ </ol>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/progress_activity2.png">
+
+ </div>
+ <div class="layout-content-col span-7 with-callouts">
+
+ <ol>
+ <li class="value-2"><h4>Activity circle (shown with the Holo Light theme)</h4>
+ <p>
+
+An indeterminate activity circle is used in the Gmail application when a message is being
+loaded because it's not possible to determine how long it will take to download the email.
+
+ </p>
+ </li>
+ </ol>
+
+ </div>
+</div>
+
+<p>You should only use one activity indicator on screen per activity, and it should appropriately sized
+for the surrounding context. For example, the largest activity circle works well when displayed in a
+blank content area, but not in a smaller dialog box.</p>
diff --git a/docs/html/design/building-blocks/scrolling.html b/docs/html/design/building-blocks/scrolling.html
deleted file mode 100644
index 3599a97..0000000
--- a/docs/html/design/building-blocks/scrolling.html
+++ /dev/null
@@ -1,194 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Scrolling
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Scrolling</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Scrolling allows the user to navigate to content in the overflow using a swipe gesture. The
-scrolling speed is proportional to the speed of the gesture.</p>
-<h2 id="indicator">Scroll Indicator</h2>
-
-<p>Appears during scrolling to indicate what portion of the content is currently in view.</p>
-
-<div class="framed-galaxynexus-land-span-13">
- <video class="play-on-hover" autoplay>
- <source src="../static/content/scroll_indicator.mp4" type="video/mp4">
- <source src="../static/content/scroll_indicator.webm" type="video/webm">
- <source src="../static/content/scroll_indicator.ogv" type="video/ogg">
- </video>
-</div>
-<div class="figure-caption">
- <div class="video-instructions"> </div>
-</div>
-
-<h2 id="index-scrolling">Index Scrolling</h2>
-
-<p>In addition to traditional scrolling, a long alphabetical list can also offer index scrolling: a way
-to quickly navigate to the items that begin with a particular letter. With index scrolling, a scroll
-indicator appears even when the user isn't scrolling. Touching or dragging it causes the current
-letter to pop up in a prominent way.</p>
-
-<div class="framed-galaxynexus-land-span-13">
- <video class="play-on-hover" autoplay>
- <source src="../static/content/scroll_index.mp4" type="video/mp4">
- <source src="../static/content/scroll_index.webm" type="video/webm">
- <source src="../static/content/scroll_index.ogv" type="video/ogg">
- </video>
-</div>
-<div class="figure-caption">
- <div class="video-instructions"> </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/scrolling.jd b/docs/html/design/building-blocks/scrolling.jd
new file mode 100644
index 0000000..7695157
--- /dev/null
+++ b/docs/html/design/building-blocks/scrolling.jd
@@ -0,0 +1,37 @@
+page.title=Scrolling
+@jd:body
+
+<p>Scrolling allows the user to navigate to content in the overflow using a swipe gesture. The
+scrolling speed is proportional to the speed of the gesture.</p>
+<h2 id="indicator">Scroll Indicator</h2>
+
+<p>Appears during scrolling to indicate what portion of the content is currently in view.</p>
+
+<div class="framed-galaxynexus-land-span-13">
+ <video class="play-on-hover" autoplay>
+ <source src="{@docRoot}design/media/scroll_indicator.mp4" type="video/mp4">
+ <source src="{@docRoot}design/media/scroll_indicator.webm" type="video/webm">
+ <source src="{@docRoot}design/media/scroll_indicator.ogv" type="video/ogg">
+ </video>
+</div>
+<div class="figure-caption">
+ <div class="video-instructions"> </div>
+</div>
+
+<h2 id="index-scrolling">Index Scrolling</h2>
+
+<p>In addition to traditional scrolling, a long alphabetical list can also offer index scrolling: a way
+to quickly navigate to the items that begin with a particular letter. With index scrolling, a scroll
+indicator appears even when the user isn't scrolling. Touching or dragging it causes the current
+letter to pop up in a prominent way.</p>
+
+<div class="framed-galaxynexus-land-span-13">
+ <video class="play-on-hover" autoplay>
+ <source src="{@docRoot}design/media/scroll_index.mp4" type="video/mp4">
+ <source src="{@docRoot}design/media/scroll_index.webm" type="video/webm">
+ <source src="{@docRoot}design/media/scroll_index.ogv" type="video/ogg">
+ </video>
+</div>
+<div class="figure-caption">
+ <div class="video-instructions"> </div>
+</div>
diff --git a/docs/html/design/building-blocks/seek-bars.html b/docs/html/design/building-blocks/seek-bars.html
deleted file mode 100644
index aef1823..0000000
--- a/docs/html/design/building-blocks/seek-bars.html
+++ /dev/null
@@ -1,194 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Seek Bars and Sliders
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Seek Bars and Sliders</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Interactive sliders make it possible to select a value from a continuous or discrete range of values
-by moving the slider thumb. The smallest value is to the left, the largest to the right. The
-interactive nature of the slider makes it a great choice for settings that reflect intensity levels,
-such as volume, brightness, or color saturation.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-9">
-
- <img src="../static/content/seekbar_example.png">
-
- </div>
- <div class="layout-content-col span-4">
-
-<div class="vspace size-2"> </div>
-
-<h4>Example</h4>
-<p>Interactive slider to set the ringer volume. The value can either be set through the hardware volume controls or interactively via a gesture.</p>
-
- </div>
-</div>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-9">
-
- <img src="../static/content/seekbar_style.png">
- <div class="figure-caption">
- Seek bars in Holo Light & Dark
- </div>
-
- </div>
- <div class="layout-content-col span-4"> </div>
-</div>
-
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/seek-bars.jd b/docs/html/design/building-blocks/seek-bars.jd
new file mode 100644
index 0000000..3407ddd
--- /dev/null
+++ b/docs/html/design/building-blocks/seek-bars.jd
@@ -0,0 +1,36 @@
+page.title=Seek Bars and Sliders
+@jd:body
+
+<p>Interactive sliders make it possible to select a value from a continuous or discrete range of values
+by moving the slider thumb. The smallest value is to the left, the largest to the right. The
+interactive nature of the slider makes it a great choice for settings that reflect intensity levels,
+such as volume, brightness, or color saturation.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-9">
+
+ <img src="{@docRoot}design/media/seekbar_example.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<div class="vspace size-2"> </div>
+
+<h4>Example</h4>
+<p>Interactive slider to set the ringer volume. The value can either be set through the hardware volume controls or interactively via a gesture.</p>
+
+ </div>
+</div>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-9">
+
+ <img src="{@docRoot}design/media/seekbar_style.png">
+ <div class="figure-caption">
+ Seek bars in Holo Light & Dark
+ </div>
+
+ </div>
+ <div class="layout-content-col span-4"> </div>
+</div>
diff --git a/docs/html/design/building-blocks/spinners.html b/docs/html/design/building-blocks/spinners.html
deleted file mode 100644
index 5ef9d04..0000000
--- a/docs/html/design/building-blocks/spinners.html
+++ /dev/null
@@ -1,194 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Spinners
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Spinners</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Spinners provide a quick way to select one value from a set. In the default state, a spinner shows
-its currently selected value. Touching the spinner displays a dropdown menu with all other available
-values, from which the user can select a new one.</p>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
- <img src="../static/content/spinners_form.png">
-
-<h4>Spinners in forms</h4>
-<p>Spinners are useful for data picking in forms. They are compact and integrate nicely with other
-components. Use spinners in forms for both simple data input and in combination with other input
-fields. For example, a text field might let you edit an email address for a contact, while its
-associated spinner allows you to select whether it's a Home or Work address.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/spinners_actionbar.png">
-
-<h4>Spinners in action bars</h4>
-<p>Use spinners in action bars to switch views. For example, Gmail uses a spinner to permit switching
-between accounts or commonly used labels. Spinners are useful when changing the view is important to
-your app, but not necessarily a frequent occurrence. In cases where view switching is frequent, use
-tabs.</p>
-
- </div>
-</div>
-
-<img src="../static/content/spinners_hololightanddark.png">
-<div class="figure-caption">
- Spinners in the Holo Dark and Holo Light themes, in various states.
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/spinners.jd b/docs/html/design/building-blocks/spinners.jd
new file mode 100644
index 0000000..621a57c
--- /dev/null
+++ b/docs/html/design/building-blocks/spinners.jd
@@ -0,0 +1,37 @@
+page.title=Spinners
+@jd:body
+
+<p>Spinners provide a quick way to select one value from a set. In the default state, a spinner shows
+its currently selected value. Touching the spinner displays a dropdown menu with all other available
+values, from which the user can select a new one.</p>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/spinners_form.png">
+
+<h4>Spinners in forms</h4>
+<p>Spinners are useful for data picking in forms. They are compact and integrate nicely with other
+components. Use spinners in forms for both simple data input and in combination with other input
+fields. For example, a text field might let you edit an email address for a contact, while its
+associated spinner allows you to select whether it's a Home or Work address.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/spinners_actionbar.png">
+
+<h4>Spinners in action bars</h4>
+<p>Use spinners in action bars to switch views. For example, Gmail uses a spinner to permit switching
+between accounts or commonly used labels. Spinners are useful when changing the view is important to
+your app, but not necessarily a frequent occurrence. In cases where view switching is frequent, use
+tabs.</p>
+
+ </div>
+</div>
+
+<img src="{@docRoot}design/media/spinners_hololightanddark.png">
+<div class="figure-caption">
+ Spinners in the Holo Dark and Holo Light themes, in various states.
+</div>
diff --git a/docs/html/design/building-blocks/switches.html b/docs/html/design/building-blocks/switches.html
deleted file mode 100644
index 09af540..0000000
--- a/docs/html/design/building-blocks/switches.html
+++ /dev/null
@@ -1,188 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Switches
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Switches</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Switches allow the user to select options. There are three kinds of switches: checkboxes, radio
-buttons, and on/off switches.</p>
-<h2 id="checkboxes">Checkboxes</h2>
-
-<p>Checkboxes allow the user to select multiple options from a set. Avoid using a single checkbox to
-turn an option off or on. Instead, use an on/off switch.</p>
-
-<div style="text-align: center">
- <img src="../static/content/switches_checkboxes.png">
-</div>
-
-<h2 id="radio-buttons">Radio Buttons</h2>
-
-<p>Radio buttons allow the user to select one option from a set. Use radio buttons for exclusive
-selection if you think that the user needs to see all available options side-by-side. Otherwise,
-consider a spinner, which uses less space.</p>
-
-<div style="text-align: center">
- <img src="../static/content/switches_radios.png">
-</div>
-
-<h2 id="switches">On/off Switches</h2>
-
-<p>On/off switches toggle the state of a single settings option.</p>
-
-<div style="text-align: center">
- <img src="../static/content/switches_switches.png">
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/switches.jd b/docs/html/design/building-blocks/switches.jd
new file mode 100644
index 0000000..607e0b6
--- /dev/null
+++ b/docs/html/design/building-blocks/switches.jd
@@ -0,0 +1,31 @@
+page.title=Switches
+@jd:body
+
+<p>Switches allow the user to select options. There are three kinds of switches: checkboxes, radio
+buttons, and on/off switches.</p>
+<h2 id="checkboxes">Checkboxes</h2>
+
+<p>Checkboxes allow the user to select multiple options from a set. Avoid using a single checkbox to
+turn an option off or on. Instead, use an on/off switch.</p>
+
+<div style="text-align: center">
+ <img src="{@docRoot}design/media/switches_checkboxes.png">
+</div>
+
+<h2 id="radio-buttons">Radio Buttons</h2>
+
+<p>Radio buttons allow the user to select one option from a set. Use radio buttons for exclusive
+selection if you think that the user needs to see all available options side-by-side. Otherwise,
+consider a spinner, which uses less space.</p>
+
+<div style="text-align: center">
+ <img src="{@docRoot}design/media/switches_radios.png">
+</div>
+
+<h2 id="switches">On/off Switches</h2>
+
+<p>On/off switches toggle the state of a single settings option.</p>
+
+<div style="text-align: center">
+ <img src="{@docRoot}design/media/switches_switches.png">
+</div>
diff --git a/docs/html/design/building-blocks/tabs.html b/docs/html/design/building-blocks/tabs.html
deleted file mode 100644
index d4b0e52..0000000
--- a/docs/html/design/building-blocks/tabs.html
+++ /dev/null
@@ -1,217 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Tabs
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Tabs</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<img src="../static/content/tabs_overview.png">
-
-<p>Tabs in the action bar make it easy to explore and switch between different views or functional
-aspects of your app, or to browse categorized data sets.</p>
-
-
-<h2 id="scrollable">Scrollable Tabs</h2>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<p>Scrolling tab controls can contain a larger number of items than a standard tab control. To navigate
-to the next/previous view, swipe left or right.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <video width="400" class="with-shadow play-on-hover" autoplay>
- <source src="../static/content/tabs_scrolly.mp4" type="video/mp4">
- <source src="../static/content/tabs_scrolly.webm" type="video/webm">
- <source src="../static/content/tabs_scrolly.ogv" type="video/ogg">
- </video>
- <div class="figure-caption">
- Scrolling tabs in Android Market.
- <div class="video-instructions"> </div>
- </div>
-
- </div>
-</div>
-
-
-<h2 id="fixed">Fixed Tabs</h2>
-
-
-<p>Fixed tabs display all items concurrently. To navigate to a different view, touch the tab.</p>
-
-<img src="../static/content/tabs_standard.png">
-<div class="figure-caption">
- Tabs in Holo Dark & Light.
-</div>
-
-<img src="../static/content/tabs_youtube.png">
-<div class="figure-caption">
- Tabs in the YouTube app.
-</div>
-
-
-
-<h2 id="stacked">Stacked Tabs</h2>
-
-
-<p>If view navigation is essential to your app, you can break out tabs into a separate action bar. This
-permits fast view switching even on narrower screens.</p>
-
-<img src="../static/content/tabs_stacked.png">
-
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/tabs.jd b/docs/html/design/building-blocks/tabs.jd
new file mode 100644
index 0000000..2c854d3
--- /dev/null
+++ b/docs/html/design/building-blocks/tabs.jd
@@ -0,0 +1,59 @@
+page.title=Tabs
+@jd:body
+
+<img src="{@docRoot}design/media/tabs_overview.png">
+
+<p>Tabs in the action bar make it easy to explore and switch between different views or functional
+aspects of your app, or to browse categorized data sets.</p>
+
+
+<h2 id="scrollable">Scrollable Tabs</h2>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<p>Scrolling tab controls can contain a larger number of items than a standard tab control. To navigate
+to the next/previous view, swipe left or right.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <video width="400" class="with-shadow play-on-hover" autoplay>
+ <source src="{@docRoot}design/media/tabs_scrolly.mp4" type="video/mp4">
+ <source src="{@docRoot}design/media/tabs_scrolly.webm" type="video/webm">
+ <source src="{@docRoot}design/media/tabs_scrolly.ogv" type="video/ogg">
+ </video>
+ <div class="figure-caption">
+ Scrolling tabs in Google Play.
+ <div class="video-instructions"> </div>
+ </div>
+
+ </div>
+</div>
+
+
+<h2 id="fixed">Fixed Tabs</h2>
+
+
+<p>Fixed tabs display all items concurrently. To navigate to a different view, touch the tab.</p>
+
+<img src="{@docRoot}design/media/tabs_standard.png">
+<div class="figure-caption">
+ Tabs in Holo Dark & Light.
+</div>
+
+<img src="{@docRoot}design/media/tabs_youtube.png">
+<div class="figure-caption">
+ Tabs in the YouTube app.
+</div>
+
+
+
+<h2 id="stacked">Stacked Tabs</h2>
+
+
+<p>If view navigation is essential to your app, you can break out tabs into a separate action bar. This
+permits fast view switching even on narrower screens.</p>
+
+<img src="{@docRoot}design/media/tabs_stacked.png">
diff --git a/docs/html/design/building-blocks/text-fields.html b/docs/html/design/building-blocks/text-fields.html
deleted file mode 100644
index b9ec42d..0000000
--- a/docs/html/design/building-blocks/text-fields.html
+++ /dev/null
@@ -1,227 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Text Fields
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Text Fields</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Text fields allow the user to type text into your app. They can be either single line or multi-line.
-Touching a text field places the cursor and automatically displays the keyboard. In addition to
-typing, text fields allow for a variety of other activities, such as text selection (cut, copy,
-paste) and data lookup via auto-completion.</p>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-12">
-
- <img src="../static/content/text_input_singlevsmultiline.png">
-
- </div>
-</div>
-
-<h4>Single line and multi line</h4>
-<p>Single-line fields automatically scroll their content to the left as the text input cursor reaches
-the right edge of the input field. Multi-line text fields automatically break to a new line for
-overflow text and scroll vertically when the cursor reaches the lower edge.</p>
-
-<img src="../static/content/text_input_typesandtypedown.png">
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Text field types</h4>
-<p>Text fields can have different types, such as number, message, or email address. The type determines
-what kind of characters are allowed inside the field, and may prompt the virtual keyboard to
-optimize its layout for frequently used characters.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
-<h4>Auto-complete text fields</h4>
-<p>Use auto-complete text fields to present real-time completions or search results in popups, so users
-can enter information more accurately and efficiently.</p>
-
- </div>
-</div>
-
-<h2 id="text-selection">Text Selection</h2>
-
-<p>Users can select any word in a text field with a long press. This action triggers a text selection
-mode that facilitates extending the selection or choosing an action to perform on the selected text.
-Selection mode includes:</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-9">
-
- <img src="../static/content/text_input_textselection.png">
-
- </div>
- <div class="layout-content-col span-4 with-callouts">
-
-<ol>
-<li>
-<h4>Contextual action bar</h4>
-<p>A contextual action bar (CAB) displays the actions available to perform on the selection:
- typically cut, copy, and paste, but apps can insert additional commands as needed.</p>
-</li>
-<li>
-<h4>Selection handles</h4>
-<p>Selection handles can be dragged to select more or less text while remaining in selection mode.</p>
-</li>
-</ol>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/building-blocks/text-fields.jd b/docs/html/design/building-blocks/text-fields.jd
new file mode 100644
index 0000000..1b10420
--- /dev/null
+++ b/docs/html/design/building-blocks/text-fields.jd
@@ -0,0 +1,70 @@
+page.title=Text Fields
+@jd:body
+
+<p>Text fields allow the user to type text into your app. They can be either single line or multi-line.
+Touching a text field places the cursor and automatically displays the keyboard. In addition to
+typing, text fields allow for a variety of other activities, such as text selection (cut, copy,
+paste) and data lookup via auto-completion.</p>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-12">
+
+ <img src="{@docRoot}design/media/text_input_singlevsmultiline.png">
+
+ </div>
+</div>
+
+<h4>Single line and multi line</h4>
+<p>Single-line fields automatically scroll their content to the left as the text input cursor reaches
+the right edge of the input field. Multi-line text fields automatically break to a new line for
+overflow text and scroll vertically when the cursor reaches the lower edge.</p>
+
+<img src="{@docRoot}design/media/text_input_typesandtypedown.png">
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Text field types</h4>
+<p>Text fields can have different types, such as number, message, or email address. The type determines
+what kind of characters are allowed inside the field, and may prompt the virtual keyboard to
+optimize its layout for frequently used characters.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+<h4>Auto-complete text fields</h4>
+<p>Use auto-complete text fields to present real-time completions or search results in popups, so users
+can enter information more accurately and efficiently.</p>
+
+ </div>
+</div>
+
+<h2 id="text-selection">Text Selection</h2>
+
+<p>Users can select any word in a text field with a long press. This action triggers a text selection
+mode that facilitates extending the selection or choosing an action to perform on the selected text.
+Selection mode includes:</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-9">
+
+ <img src="{@docRoot}design/media/text_input_textselection.png">
+
+ </div>
+ <div class="layout-content-col span-4 with-callouts">
+
+<ol>
+<li>
+<h4>Contextual action bar</h4>
+<p>A contextual action bar (CAB) displays the actions available to perform on the selection:
+ typically cut, copy, and paste, but apps can insert additional commands as needed.</p>
+</li>
+<li>
+<h4>Selection handles</h4>
+<p>Selection handles can be dragged to select more or less text while remaining in selection mode.</p>
+</li>
+</ol>
+
+ </div>
+</div>
diff --git a/docs/html/design/design_toc.cs b/docs/html/design/design_toc.cs
new file mode 100644
index 0000000..19b58d9
--- /dev/null
+++ b/docs/html/design/design_toc.cs
@@ -0,0 +1,69 @@
+<ul id="nav">
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>design/index.html">Get Started</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>design/get-started/creative-vision.html">Creative Vision</a></li>
+ <li><a href="<?cs var:toroot ?>design/get-started/principles.html">Design Principles</a></li>
+ <li><a href="<?cs var:toroot ?>design/get-started/ui-overview.html">UI Overview</a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>design/style/index.html">Style</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>design/style/devices-displays.html">Devices and Displays</a></li>
+ <li><a href="<?cs var:toroot ?>design/style/themes.html">Themes</a></li>
+ <li><a href="<?cs var:toroot ?>design/style/touch-feedback.html">Touch Feedback</a></li>
+ <li><a href="<?cs var:toroot ?>design/style/metrics-grids.html">Metrics and Grids</a></li>
+ <li><a href="<?cs var:toroot ?>design/style/typography.html">Typography</a></li>
+ <li><a href="<?cs var:toroot ?>design/style/color.html">Color</a></li>
+ <li><a href="<?cs var:toroot ?>design/style/iconography.html">Iconography</a></li>
+ <li><a href="<?cs var:toroot ?>design/style/writing.html">Writing Style</a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>design/patterns/index.html">Patterns</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>design/patterns/new-4-0.html">New in Android 4.0</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/gestures.html">Gestures</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/app-structure.html">App Structure</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/navigation.html">Navigation</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/actionbar.html">Action Bar</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/swipe-views.html">Swipe Views</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/selection.html">Selection</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/notifications.html">Notifications</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/compatibility.html">Compatibility</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/pure-android.html">Pure Android</a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>design/building-blocks/index.html">Building Blocks</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/tabs.html">Tabs</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/lists.html">Lists</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/grid-lists.html">Grid Lists</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/scrolling.html">Scrolling</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/spinners.html">Spinners</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/buttons.html">Buttons</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/text-fields.html">Text Fields</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/seek-bars.html">Seek Bars</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/progress.html">Progress & Activity</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/switches.html">Switches</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/dialogs.html">Dialogs</a></li>
+ <li><a href="<?cs var:toroot ?>design/building-blocks/pickers.html">Pickers</a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>design/downloads/index.html">Downloads</a></div>
+ </li>
+
+ <li>
+ <div id="back-dac-section"><a href="<?cs var:toroot ?>index.html">Developers</a></div>
+ </li>
+
+</ul>
\ No newline at end of file
diff --git a/docs/html/design/downloads/index.html b/docs/html/design/downloads/index.html
deleted file mode 100644
index f910b29..0000000
--- a/docs/html/design/downloads/index.html
+++ /dev/null
@@ -1,278 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Downloads
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Downloads</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-9">
-
-<p>Want everything? We've bundled all the downloads available on Android Design into a single ZIP file.
-You can also download individual files listed below.</p>
-<p>You may use these materials without restriction in your apps and to develop your apps.</p>
-
- </div>
- <div class="layout-content-col span-4">
-
-<p>
- <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Downloads_20120229.zip">Download All</a>
-</p>
-
- </div>
-</div>
-
-<h2 id="stencils">Stencils and Sources</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<p>Drag and drop your way to beautifully designed Ice Cream Sandwich apps. The stencils feature the
-rich typography, colors, interactive controls, and icons found throughout Android 4.0, along with
-phone and tablet outlines to frame your creations. Source files for icons and controls are also
-available.</p>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/downloads_stencils.png">
-
- </div>
- <div class="layout-content-col span-4">
-
-<p>
- <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Fireworks_Stencil_20120229.png">Adobe® Fireworks® PNG Stencil</a>
- <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_OmniGraffle_Stencil_20120229.graffle">Omni® OmniGraffle® Stencil</a>
- <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Holo_Widgets_20120229.zip">Adobe® Photoshop® Sources</a>
-</p>
-
- </div>
-</div>
-
-<h2 id="action-bar-icon-pack">Action Bar Icon Pack</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<p>Action bar icons are graphic buttons that represent the most important actions people can take
-within your app. <a href="../style/iconography.html">More on Action Bar Iconography</a></p>
-<p>The download package includes icons that are scaled for various screen densities and suitable for
-use with the Holo Light and Holo Dark themes. The package also includes unstyled icons that you can
-modify to match your theme, plus source files.</p>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_actionbar_style.png">
-
- </div>
- <div class="layout-content-col span-4">
-
-<p>
- <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Icons_20120229.zip">Action Bar Icon Pack</a>
-</p>
-
- </div>
-</div>
-
-<h2 id="style">Style</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Roboto</h4>
-<p>Ice Cream Sandwich introduced a new type family named Roboto, created specifically for the
-requirements of UI and high-resolution screens.</p>
-<p><a href="../style/typography.html#actionbar">More on Roboto</a></p>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/downloads_roboto_specimen_preview.png">
-
- </div>
- <div class="layout-content-col span-4">
-
-<p>
- <a class="download-button" href="https://dl-ssl.google.com/android/design/Roboto_Hinted_20111129.zip">Roboto</a>
- <a class="download-button" href="https://dl-ssl.google.com/android/design/Roboto_Specimen_Book_20111129.pdf">Specimen Book</a>
-</p>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Color</h4>
-<p>Blue is the standard accent color in Android's color palette. Each color has a corresponding darker
-shade that can be used as a complement when needed.</p>
-<p><a href="../style/color.html">More on Color</a></p>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/downloads_color_swatches.png">
-
- </div>
- <div class="layout-content-col span-4">
-
-<p>
- <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Color_Swatches_20120229.zip">Color Swatches</a>
-</p>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/downloads/index.jd b/docs/html/design/downloads/index.jd
new file mode 100644
index 0000000..618c44b
--- /dev/null
+++ b/docs/html/design/downloads/index.jd
@@ -0,0 +1,121 @@
+page.title=Downloads
+@jd:body
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-9">
+
+<p>Want everything? We've bundled all the downloads available on Android Design into a single ZIP file.
+You can also download individual files listed below.</p>
+<p>You may use these materials without restriction in your apps and to develop your apps.</p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<p>
+ <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Downloads_20120229.zip">Download All</a>
+</p>
+
+ </div>
+</div>
+
+<h2 id="stencils">Stencils and Sources</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<p>Drag and drop your way to beautifully designed Ice Cream Sandwich apps. The stencils feature the
+rich typography, colors, interactive controls, and icons found throughout Android 4.0, along with
+phone and tablet outlines to frame your creations. Source files for icons and controls are also
+available.</p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/downloads_stencils.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<p>
+ <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Fireworks_Stencil_20120229.png">Adobe® Fireworks® PNG Stencil</a>
+ <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_OmniGraffle_Stencil_20120229.graffle">Omni® OmniGraffle® Stencil</a>
+ <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Holo_Widgets_20120229.zip">Adobe® Photoshop® Sources</a>
+</p>
+
+ </div>
+</div>
+
+<h2 id="action-bar-icon-pack">Action Bar Icon Pack</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<p>Action bar icons are graphic buttons that represent the most important actions people can take
+within your app. <a href="{@docRoot}design/style/iconography.html">More on Action Bar Iconography</a></p>
+<p>The download package includes icons that are scaled for various screen densities and suitable for
+use with the Holo Light and Holo Dark themes. The package also includes unstyled icons that you can
+modify to match your theme, plus source files.</p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_actionbar_style.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<p>
+ <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Icons_20120229.zip">Action Bar Icon Pack</a>
+</p>
+
+ </div>
+</div>
+
+<h2 id="style">Style</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Roboto</h4>
+<p>Ice Cream Sandwich introduced a new type family named Roboto, created specifically for the
+requirements of UI and high-resolution screens.</p>
+<p><a href="{@docRoot}design/style/typography.html#actionbar">More on Roboto</a></p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/downloads_roboto_specimen_preview.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<p>
+ <a class="download-button" href="https://dl-ssl.google.com/android/design/Roboto_Hinted_20111129.zip">Roboto</a>
+ <a class="download-button" href="https://dl-ssl.google.com/android/design/Roboto_Specimen_Book_20111129.pdf">Specimen Book</a>
+</p>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Color</h4>
+<p>Blue is the standard accent color in Android's color palette. Each color has a corresponding darker
+shade that can be used as a complement when needed.</p>
+<p><a href="{@docRoot}design/style/color.html">More on Color</a></p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/downloads_color_swatches.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<p>
+ <a class="download-button" href="https://dl-ssl.google.com/android/design/Android_Design_Color_Swatches_20120229.zip">Color Swatches</a>
+</p>
+
+ </div>
+</div>
diff --git a/docs/html/design/get-started/creative-vision.html b/docs/html/design/get-started/creative-vision.html
deleted file mode 100644
index 154f8d0..0000000
--- a/docs/html/design/get-started/creative-vision.html
+++ /dev/null
@@ -1,205 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Creative Vision
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Creative Vision</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<img src="../static/content/creative_vision_main.png">
-
-<div class="vspace size-1"> </div>
-
-<p>Ice Cream Sandwich (Android 4.0) marks a major milestone for Android design. We touched nearly every
-pixel of the system as we expanded the new design approaches introduced in Honeycomb tablets to all
-types of mobile devices. Starting with the most basic elements, we introduced a new font, Roboto,
-designed for high-resolution displays. Other big changes include framework-level action bars on
-phones and support for new phones without physical buttons.</p>
-<p>We focused the design work with three overarching goals for our core apps and the system at large.
-As you design apps to work with Android, consider these goals:</p>
-
-<div class="vspace size-1"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
-<h4>Enchant me</h4>
-<p>Beauty is more than skin deep. Android apps are sleek and aesthetically pleasing on multiple levels.
-Transitions are fast and clear; layout and typography are crisp and meaningful. App icons are works
-of art in their own right. Just like a well-made tool, your app should strive to combine beauty,
-simplicity and purpose to create a magical experience that is effortless and powerful.</p>
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Simplify my life</h4>
-<p>Android apps make life easier and are easy to understand. When people use your app for the first
-time, they should intuitively grasp the most important features. The design work doesn't stop at the
-first use, though. Android apps remove ongoing chores like file management and syncing. Simple tasks
-never require complex procedures, and complex tasks are tailored to the human hand and mind. People
-of all ages and cultures feel firmly in control, and are never overwhelmed by too many choices or
-irrelevant flash.</p>
-
- </div>
- <div class="layout-content-col span-4">
-
-<h4>Make me amazing</h4>
-<p>It's not enough to make an app that is easy to use. Android apps empower people to try new things
-and to use apps in inventive new ways. Android lets people combine applications into new workflows
-through multitasking, notifications, and sharing across apps. At the same time, your app should feel
-personal, giving people access to superb technology with clarity and grace.</p>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/get-started/creative-vision.jd b/docs/html/design/get-started/creative-vision.jd
new file mode 100644
index 0000000..792b97d
--- /dev/null
+++ b/docs/html/design/get-started/creative-vision.jd
@@ -0,0 +1,48 @@
+page.title=Creative Vision
+@jd:body
+
+<img src="{@docRoot}design/media/creative_vision_main.png">
+
+<div class="vspace size-1"> </div>
+
+<p>Ice Cream Sandwich (Android 4.0) marks a major milestone for Android design. We touched nearly every
+pixel of the system as we expanded the new design approaches introduced in Honeycomb tablets to all
+types of mobile devices. Starting with the most basic elements, we introduced a new font, Roboto,
+designed for high-resolution displays. Other big changes include framework-level action bars on
+phones and support for new phones without physical buttons.</p>
+<p>We focused the design work with three overarching goals for our core apps and the system at large.
+As you design apps to work with Android, consider these goals:</p>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+<h4>Enchant me</h4>
+<p>Beauty is more than skin deep. Android apps are sleek and aesthetically pleasing on multiple levels.
+Transitions are fast and clear; layout and typography are crisp and meaningful. App icons are works
+of art in their own right. Just like a well-made tool, your app should strive to combine beauty,
+simplicity and purpose to create a magical experience that is effortless and powerful.</p>
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Simplify my life</h4>
+<p>Android apps make life easier and are easy to understand. When people use your app for the first
+time, they should intuitively grasp the most important features. The design work doesn't stop at the
+first use, though. Android apps remove ongoing chores like file management and syncing. Simple tasks
+never require complex procedures, and complex tasks are tailored to the human hand and mind. People
+of all ages and cultures feel firmly in control, and are never overwhelmed by too many choices or
+irrelevant flash.</p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<h4>Make me amazing</h4>
+<p>It's not enough to make an app that is easy to use. Android apps empower people to try new things
+and to use apps in inventive new ways. Android lets people combine applications into new workflows
+through multitasking, notifications, and sharing across apps. At the same time, your app should feel
+personal, giving people access to superb technology with clarity and grace.</p>
+
+ </div>
+</div>
diff --git a/docs/html/design/get-started/principles.html b/docs/html/design/get-started/principles.html
deleted file mode 100644
index f10a90d..0000000
--- a/docs/html/design/get-started/principles.html
+++ /dev/null
@@ -1,457 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Design Principles
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Design Principles</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>These design principles were developed by and for the Android User Experience Team to keep users'
-best interests in mind. Consider them as you apply your own creativity and design thinking. Deviate
-with purpose.</p>
-
-<h2 id="enchant-me">Enchant Me</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Delight me in surprising ways</h4>
-<p>A beautiful surface, a carefully-placed animation, or a well-timed sound effect is a joy to
-experience. Subtle effects contribute to a feeling of effortlessness and a sense that a powerful
-force is at hand.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_delight.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Real objects are more fun than buttons and menus</h4>
-<p>Allow people to directly touch and manipulate objects in your app. It reduces the cognitive effort
-needed to perform a task while making it more emotionally satisfying.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_real_objects.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Let me make it mine</h4>
-<p>People love to add personal touches because it helps them feel at home and in control. Provide
-sensible, beautiful defaults, but also consider fun, optional customizations that don't hinder
-primary tasks.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_make_it_mine.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Get to know me</h4>
-<p>Learn peoples' preferences over time. Rather than asking them to make the same choices over and
-over, place previous choices within easy reach.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_get_to_know_me.png">
-
- </div>
-</div>
-
-<h2 id="simplify-my-life">Simplify My Life</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Keep it brief</h4>
-<p>Use short phrases with simple words. People are likely to skip sentences if they're long.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_keep_it_brief.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Pictures are faster than words</h4>
-<p>Consider using pictures to explain ideas. They get people's attention and can be much more efficient
-than words.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_pictures.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Decide for me but let me have the final say</h4>
-<p>Take your best guess and act rather than asking first. Too many choices and decisions make people
-unhappy. Just in case you get it wrong, allow for 'undo'.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_decide_for_me.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Only show what I need when I need it</h4>
-<p>People get overwhelmed when they see too much at once. Break tasks and information into small,
-digestible chunks. Hide options that aren't essential at the moment, and teach people as they go.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_information_when_need_it.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>I should always know where I am</h4>
-<p>Give people confidence that they know their way around. Make places in your app look distinct and
-use transitions to show relationships among screens. Provide feedback on tasks in progress.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_navigation.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Never lose my stuff</h4>
-<p>Save what people took time to create and let them access it from anywhere. Remember settings,
-personal touches, and creations across phones, tablets, and computers. It makes upgrading the
-easiest thing in the world.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_never_lose_stuff.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>If it looks the same, it should act the same</h4>
-<p>Help people discern functional differences by making them visually distinct rather than subtle.
-Avoid modes, which are places that look similar but act differently on the same input.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_looks_same.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Only interrupt me if it's important</h4>
-<p>Like a good personal assistant, shield people from unimportant minutiae. People want to stay
-focused, and unless it's critical and time-sensitive, an interruption can be taxing and frustrating.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_important_interruption.png">
-
- </div>
-</div>
-
-<h2 id="make-me-amazing">Make Me Amazing</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Give me tricks that work everywhere</h4>
-<p>People feel great when they figure things out for themselves. Make your app easier to learn by
-leveraging visual patterns and muscle memory from other Android apps. For example, the swipe gesture
-may be a good navigational shortcut.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_tricks.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>It's not my fault</h4>
-<p>Be gentle in how you prompt people to make corrections. They want to feel smart when they use your
-app. If something goes wrong, give clear recovery instructions but spare them the technical details.
-If you can fix it behind the scenes, even better.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_error.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Sprinkle encouragement</h4>
-<p>Break complex tasks into smaller steps that can be easily accomplished. Give feedback on actions,
-even if it's just a subtle glow.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_sprinkle_encouragement.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Do the heavy lifting for me</h4>
-<p>Make novices feel like experts by enabling them to do things they never thought they could. For
-example, shortcuts that combine multiple photo effects can make amateur photographs look amazing in
-only a few steps.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_heavy_lifting.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Make important things fast</h4>
-<p>Not all actions are equal. Decide what's most important in your app and make it easy to find and
-fast to use, like the shutter button in a camera, or the pause button in a music player.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/principles_make_important_fast.png">
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/get-started/principles.jd b/docs/html/design/get-started/principles.jd
new file mode 100644
index 0000000..8f5b446
--- /dev/null
+++ b/docs/html/design/get-started/principles.jd
@@ -0,0 +1,300 @@
+page.title=Design Principles
+@jd:body
+
+<p>These design principles were developed by and for the Android User Experience Team to keep users'
+best interests in mind. Consider them as you apply your own creativity and design thinking. Deviate
+with purpose.</p>
+
+<h2 id="enchant-me">Enchant Me</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Delight me in surprising ways</h4>
+<p>A beautiful surface, a carefully-placed animation, or a well-timed sound effect is a joy to
+experience. Subtle effects contribute to a feeling of effortlessness and a sense that a powerful
+force is at hand.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_delight.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Real objects are more fun than buttons and menus</h4>
+<p>Allow people to directly touch and manipulate objects in your app. It reduces the cognitive effort
+needed to perform a task while making it more emotionally satisfying.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_real_objects.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Let me make it mine</h4>
+<p>People love to add personal touches because it helps them feel at home and in control. Provide
+sensible, beautiful defaults, but also consider fun, optional customizations that don't hinder
+primary tasks.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_make_it_mine.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Get to know me</h4>
+<p>Learn peoples' preferences over time. Rather than asking them to make the same choices over and
+over, place previous choices within easy reach.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_get_to_know_me.png">
+
+ </div>
+</div>
+
+<h2 id="simplify-my-life">Simplify My Life</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Keep it brief</h4>
+<p>Use short phrases with simple words. People are likely to skip sentences if they're long.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_keep_it_brief.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Pictures are faster than words</h4>
+<p>Consider using pictures to explain ideas. They get people's attention and can be much more efficient
+than words.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_pictures.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Decide for me but let me have the final say</h4>
+<p>Take your best guess and act rather than asking first. Too many choices and decisions make people
+unhappy. Just in case you get it wrong, allow for 'undo'.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_decide_for_me.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Only show what I need when I need it</h4>
+<p>People get overwhelmed when they see too much at once. Break tasks and information into small,
+digestible chunks. Hide options that aren't essential at the moment, and teach people as they go.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_information_when_need_it.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>I should always know where I am</h4>
+<p>Give people confidence that they know their way around. Make places in your app look distinct and
+use transitions to show relationships among screens. Provide feedback on tasks in progress.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_navigation.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Never lose my stuff</h4>
+<p>Save what people took time to create and let them access it from anywhere. Remember settings,
+personal touches, and creations across phones, tablets, and computers. It makes upgrading the
+easiest thing in the world.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_never_lose_stuff.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>If it looks the same, it should act the same</h4>
+<p>Help people discern functional differences by making them visually distinct rather than subtle.
+Avoid modes, which are places that look similar but act differently on the same input.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_looks_same.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Only interrupt me if it's important</h4>
+<p>Like a good personal assistant, shield people from unimportant minutiae. People want to stay
+focused, and unless it's critical and time-sensitive, an interruption can be taxing and frustrating.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_important_interruption.png">
+
+ </div>
+</div>
+
+<h2 id="make-me-amazing">Make Me Amazing</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Give me tricks that work everywhere</h4>
+<p>People feel great when they figure things out for themselves. Make your app easier to learn by
+leveraging visual patterns and muscle memory from other Android apps. For example, the swipe gesture
+may be a good navigational shortcut.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_tricks.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>It's not my fault</h4>
+<p>Be gentle in how you prompt people to make corrections. They want to feel smart when they use your
+app. If something goes wrong, give clear recovery instructions but spare them the technical details.
+If you can fix it behind the scenes, even better.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_error.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Sprinkle encouragement</h4>
+<p>Break complex tasks into smaller steps that can be easily accomplished. Give feedback on actions,
+even if it's just a subtle glow.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_sprinkle_encouragement.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Do the heavy lifting for me</h4>
+<p>Make novices feel like experts by enabling them to do things they never thought they could. For
+example, shortcuts that combine multiple photo effects can make amateur photographs look amazing in
+only a few steps.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_heavy_lifting.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Make important things fast</h4>
+<p>Not all actions are equal. Decide what's most important in your app and make it easy to find and
+fast to use, like the shutter button in a camera, or the pause button in a music player.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/principles_make_important_fast.png">
+
+ </div>
+</div>
diff --git a/docs/html/design/get-started/ui-overview.html b/docs/html/design/get-started/ui-overview.html
deleted file mode 100644
index a4881d5..0000000
--- a/docs/html/design/get-started/ui-overview.html
+++ /dev/null
@@ -1,306 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - UI Overview
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>UI Overview</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Android's system UI provides the framework on top of which you build your app. Important aspects
-include the Home screen experience, global device navigation, and notifications.</p>
-<p>Your app will play an important part in keeping the overall Android experience consistent and
-enjoyable to use. At the end of this chapter we introduce the main elements for achieving this goal
-in your app.</p>
-<p>Read on for a quick overview of the most important aspects of the Android user interface.</p>
-
-<h2 id="home-all-apps-recents">Home, All Apps, and Recents</h2>
-
-<div class="vspace size-1"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/ui_overview_home_screen.png">
-
-<h4>Home screen</h4>
-<p>Home is a customizable space that houses app shortcuts, folders and widgets. Navigate between
-different home screen panels by swiping left and right.</p>
-<p>The Favorites Tray at the bottom always keeps your most important shortcuts and folders in view
-regardless of which panel is currently showing.</p>
-<p>Access the entire collection of apps and widgets by touching the All Apps button at the center of
-the Favorites Tray.</p>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/ui_overview_all_apps.png">
-
-<h4>All apps screen</h4>
-<p>The All Apps screen lets you browse the entire set of apps and widgets that are installed on your
-device.</p>
-<p>Users can drag an app or widget icon from the All Apps screen and place it in any empty location on
-any Home screen.</p>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/ui_overview_recents.png">
-
-<h4>Recents screen</h4>
-<p>Recents provides an efficient way of switching between recently used applications. It provides a
-clear navigation path between multiple ongoing tasks.</p>
-<p>The Recents button at the right side of the navigation bar displays the apps that the user has
-interacted with most recently. They are organized in reverse chronological order with the most
-recently used app at the bottom.</p>
-<p>Switch to an app by touching it. Remove an item by swiping left or right.</p>
-
- </div>
-</div>
-
-<h2 id="system-bars">System Bars</h2>
-
-<p>The system bars are screen areas dedicated to the display of notifications, communication of device
-status, and device navigation. Typically the system bars are displayed concurrently with your app.
-Apps that display immersive content, such as movies or images, can temporarily hide the system bars
-to allow the user to enjoy full screen content without distraction.</p>
-
-<img src="../static/content/ui_overview_system_ui.png">
-
-<div class="with-callouts">
-
-<ol>
-<li>
-<h4>Status Bar</h4>
-<p>Displays pending notifications on the left and status, such as time, battery level, or signal
- strength, on the right. Swipe down from the status bar to show notification details.</p>
-</li>
-<li>
-<h4>Navigation Bar</h4>
-<p>New for phones in Android 4.0, the navigation bar is present only on devices that don't have
- the traditional hardware keys. It houses the device navigation controls Back, Home, and
- Recents, and also displays a menu for apps written for Android 2.3 or earlier.</p>
-</li>
-<li>
-<h4>Combined Bar</h4>
-<p>On tablet form factors the status and navigation bars are combined into a single bar at the
- bottom of the screen.</p>
-</li>
-</ol>
-
-</div>
-
-<h2 id="notifications">Notifications</h2>
-
-<p>Notifications are brief messages that users can access at any time from the status bar. They
-provide updates, reminders, or information that's important, but not critical enough to warrant
-interrupting the user. Open the notifications drawer by swiping down on the status bar. Touching a
-notification opens the associated app. <a href="../patterns/notifications.html">More on Notifications</a></p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/ui_overview_notifications.png">
-
- </div>
- <div class="layout-content-col span-9">
-
- <img src="../static/content/notifications_dismiss.png">
-
-<p>Most notifications have a one-line title and a one-line message. The recommended layout for a
-notification includes two lines. If necessary, you can add a third line. Timestamps are optional.</p>
-<p>Swiping a notification right or left removes it from the notification drawer.</p>
-
- </div>
-</div>
-
-
-<h2 id="app">Common App UI</h2>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
- <img src="../static/content/ui_overview_app_ui.png">
-
- </div>
- <div class="layout-content-col span-6 with-callouts">
-
-<p>A typical Android app consists of action bars and the app content area.</p>
-<ol>
-<li>
-<h4>Main Action Bar</h4>
-<p>The command and control center for your app. The main action bar includes elements for
- navigating your app's hierarchy and views, and also surfaces the most important actions.</p>
-<p><a href="../patterns/actionbar.html">More on the Action Bar</a></p>
-</li>
-<li>
-<h4>View Control</h4>
-<p>Allows users to switch between the different views that your app provides. Views typically
- consist of different arrangements of your data or different functional aspects of your app.</p>
-</li>
-<li>
-<h4>Content Area</h4>
-<p>The space where the content of your app is displayed.</p>
-</li>
-<li>
-<h4>Split Action Bar</h4>
-<p>Split action bars provide a way to distribute actions across additional bars located below
- the main action bar or at the bottom of the screen. In this example, a split action bar moves
- important actions that won't fit in the main bar to the bottom.</p>
-</li>
-</ol>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/get-started/ui-overview.jd b/docs/html/design/get-started/ui-overview.jd
new file mode 100644
index 0000000..34cdd06
--- /dev/null
+++ b/docs/html/design/get-started/ui-overview.jd
@@ -0,0 +1,149 @@
+page.title=UI Overview
+@jd:body
+
+<p>Android's system UI provides the framework on top of which you build your app. Important aspects
+include the Home screen experience, global device navigation, and notifications.</p>
+<p>Your app will play an important part in keeping the overall Android experience consistent and
+enjoyable to use. At the end of this chapter we introduce the main elements for achieving this goal
+in your app.</p>
+<p>Read on for a quick overview of the most important aspects of the Android user interface.</p>
+
+<h2 id="home-all-apps-recents">Home, All Apps, and Recents</h2>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/ui_overview_home_screen.png">
+
+<h4>Home screen</h4>
+<p>Home is a customizable space that houses app shortcuts, folders and widgets. Navigate between
+different home screen panels by swiping left and right.</p>
+<p>The Favorites Tray at the bottom always keeps your most important shortcuts and folders in view
+regardless of which panel is currently showing.</p>
+<p>Access the entire collection of apps and widgets by touching the All Apps button at the center of
+the Favorites Tray.</p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/ui_overview_all_apps.png">
+
+<h4>All apps screen</h4>
+<p>The All Apps screen lets you browse the entire set of apps and widgets that are installed on your
+device.</p>
+<p>Users can drag an app or widget icon from the All Apps screen and place it in any empty location on
+any Home screen.</p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/ui_overview_recents.png">
+
+<h4>Recents screen</h4>
+<p>Recents provides an efficient way of switching between recently used applications. It provides a
+clear navigation path between multiple ongoing tasks.</p>
+<p>The Recents button at the right side of the navigation bar displays the apps that the user has
+interacted with most recently. They are organized in reverse chronological order with the most
+recently used app at the bottom.</p>
+<p>Switch to an app by touching it. Remove an item by swiping left or right.</p>
+
+ </div>
+</div>
+
+<h2 id="system-bars">System Bars</h2>
+
+<p>The system bars are screen areas dedicated to the display of notifications, communication of device
+status, and device navigation. Typically the system bars are displayed concurrently with your app.
+Apps that display immersive content, such as movies or images, can temporarily hide the system bars
+to allow the user to enjoy full screen content without distraction.</p>
+
+<img src="{@docRoot}design/media/ui_overview_system_ui.png">
+
+<div class="with-callouts">
+
+<ol>
+<li>
+<h4>Status Bar</h4>
+<p>Displays pending notifications on the left and status, such as time, battery level, or signal
+ strength, on the right. Swipe down from the status bar to show notification details.</p>
+</li>
+<li>
+<h4>Navigation Bar</h4>
+<p>New for phones in Android 4.0, the navigation bar is present only on devices that don't have
+ the traditional hardware keys. It houses the device navigation controls Back, Home, and
+ Recents, and also displays a menu for apps written for Android 2.3 or earlier.</p>
+</li>
+<li>
+<h4>Combined Bar</h4>
+<p>On tablet form factors the status and navigation bars are combined into a single bar at the
+ bottom of the screen.</p>
+</li>
+</ol>
+
+</div>
+
+<h2 id="notifications">Notifications</h2>
+
+<p>Notifications are brief messages that users can access at any time from the status bar. They
+provide updates, reminders, or information that's important, but not critical enough to warrant
+interrupting the user. Open the notifications drawer by swiping down on the status bar. Touching a
+notification opens the associated app. <a href="{@docRoot}design/patterns/notifications.html">More on Notifications</a></p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/ui_overview_notifications.png">
+
+ </div>
+ <div class="layout-content-col span-9">
+
+ <img src="{@docRoot}design/media/notifications_dismiss.png">
+
+<p>Most notifications have a one-line title and a one-line message. The recommended layout for a
+notification includes two lines. If necessary, you can add a third line. Timestamps are optional.</p>
+<p>Swiping a notification right or left removes it from the notification drawer.</p>
+
+ </div>
+</div>
+
+
+<h2 id="app">Common App UI</h2>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/ui_overview_app_ui.png">
+
+ </div>
+ <div class="layout-content-col span-6 with-callouts">
+
+<p>A typical Android app consists of action bars and the app content area.</p>
+<ol>
+<li>
+<h4>Main Action Bar</h4>
+<p>The command and control center for your app. The main action bar includes elements for
+ navigating your app's hierarchy and views, and also surfaces the most important actions.</p>
+<p><a href="{@docRoot}design/patterns/actionbar.html">More on the Action Bar</a></p>
+</li>
+<li>
+<h4>View Control</h4>
+<p>Allows users to switch between the different views that your app provides. Views typically
+ consist of different arrangements of your data or different functional aspects of your app.</p>
+</li>
+<li>
+<h4>Content Area</h4>
+<p>The space where the content of your app is displayed.</p>
+</li>
+<li>
+<h4>Split Action Bar</h4>
+<p>Split action bars provide a way to distribute actions across additional bars located below
+ the main action bar or at the bottom of the screen. In this example, a split action bar moves
+ important actions that won't fit in the main bar to the bottom.</p>
+</li>
+</ol>
+
+ </div>
+</div>
diff --git a/docs/html/design/index.html b/docs/html/design/index.html
deleted file mode 100644
index 8583aa4..0000000
--- a/docs/html/design/index.html
+++ /dev/null
@@ -1,168 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Welcome
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="static/default.css">
-
-<style>
-#landing-graphic-container {
- position: relative;
-}
-
-#text-overlay {
- position: absolute;
- left: 10px;
- top: 472px;
- width: 280px;
-}
-</style>
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="index.html">Get Started</a></div>
- <ul>
- <li><a href="get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="get-started/principles.html">Design Principles</a></li>
- <li><a href="get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="style/index.html">Style</a></div>
- <ul>
- <li><a href="style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="style/themes.html">Themes</a></li>
- <li><a href="style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="style/typography.html">Typography</a></li>
- <li><a href="style/color.html">Color</a></li>
- <li><a href="style/iconography.html">Iconography</a></li>
- <li><a href="style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="patterns/gestures.html">Gestures</a></li>
- <li><a href="patterns/app-structure.html">App Structure</a></li>
- <li><a href="patterns/navigation.html">Navigation</a></li>
- <li><a href="patterns/actionbar.html">Action Bar</a></li>
- <li><a href="patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="patterns/selection.html">Selection</a></li>
- <li><a href="patterns/notifications.html">Notifications</a></li>
- <li><a href="patterns/compatibility.html">Compatibility</a></li>
- <li><a href="patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="building-blocks/tabs.html">Tabs</a></li>
- <li><a href="building-blocks/lists.html">Lists</a></li>
- <li><a href="building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="building-blocks/spinners.html">Spinners</a></li>
- <li><a href="building-blocks/buttons.html">Buttons</a></li>
- <li><a href="building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="building-blocks/switches.html">Switches</a></li>
- <li><a href="building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
-
-
-
-
-<div id="landing-graphic-container">
- <div id="text-overlay">
- Welcome to <strong>Android Design</strong>, your place for learning how to design exceptional Android apps.
- <br><br>
- <a href="get-started/creative-vision.html" class="landing-page-link">Creative Vision</a>
- </div>
-
- <a href="get-started/creative-vision.html">
- <img src="static/content/index_landing_page.png">
- </a>
-</div>
-
-
-
-
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '';
- </script>
- <script src="static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/index.jd b/docs/html/design/index.jd
new file mode 100644
index 0000000..d404aa6
--- /dev/null
+++ b/docs/html/design/index.jd
@@ -0,0 +1,29 @@
+page.title=
+header.hide=1
+footer.hide=1
+@jd:body
+
+<style>
+#landing-graphic-container {
+ position: relative;
+}
+
+#text-overlay {
+ position: absolute;
+ left: 10px;
+ top: 472px;
+ width: 280px;
+}
+</style>
+
+<div id="landing-graphic-container">
+ <div id="text-overlay">
+ Welcome to <strong>Android Design</strong>, your place for learning how to design exceptional Android apps.
+ <br><br>
+ <a href="{@docRoot}design/get-started/creative-vision.html" class="landing-page-link">Creative Vision</a>
+ </div>
+
+ <a href="{@docRoot}design/get-started/creative-vision.html">
+ <img src="{@docRoot}design/media/index_landing_page.png">
+ </a>
+</div>
diff --git a/docs/html/design/static/content/action_bar_basics.png b/docs/html/design/media/action_bar_basics.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_basics.png
rename to docs/html/design/media/action_bar_basics.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_cab.png b/docs/html/design/media/action_bar_cab.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_cab.png
rename to docs/html/design/media/action_bar_cab.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_action_icons.png b/docs/html/design/media/action_bar_pattern_action_icons.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_action_icons.png
rename to docs/html/design/media/action_bar_pattern_action_icons.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_considerations.png b/docs/html/design/media/action_bar_pattern_considerations.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_considerations.png
rename to docs/html/design/media/action_bar_pattern_considerations.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_default_tabs.png b/docs/html/design/media/action_bar_pattern_default_tabs.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_default_tabs.png
rename to docs/html/design/media/action_bar_pattern_default_tabs.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_overflow.png b/docs/html/design/media/action_bar_pattern_overflow.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_overflow.png
rename to docs/html/design/media/action_bar_pattern_overflow.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_overview.png b/docs/html/design/media/action_bar_pattern_overview.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_overview.png
rename to docs/html/design/media/action_bar_pattern_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_rotation.png b/docs/html/design/media/action_bar_pattern_rotation.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_rotation.png
rename to docs/html/design/media/action_bar_pattern_rotation.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_share_pack.png b/docs/html/design/media/action_bar_pattern_share_pack.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_share_pack.png
rename to docs/html/design/media/action_bar_pattern_share_pack.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_spinner.png b/docs/html/design/media/action_bar_pattern_spinner.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_spinner.png
rename to docs/html/design/media/action_bar_pattern_spinner.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_table.png b/docs/html/design/media/action_bar_pattern_table.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_table.png
rename to docs/html/design/media/action_bar_pattern_table.png
Binary files differ
diff --git a/docs/html/design/static/content/action_bar_pattern_up_app_icon.png b/docs/html/design/media/action_bar_pattern_up_app_icon.png
similarity index 100%
rename from docs/html/design/static/content/action_bar_pattern_up_app_icon.png
rename to docs/html/design/media/action_bar_pattern_up_app_icon.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_book_detail_page_flip.png b/docs/html/design/media/app_structure_book_detail_page_flip.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_book_detail_page_flip.png
rename to docs/html/design/media/app_structure_book_detail_page_flip.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_fixedtabs.png b/docs/html/design/media/app_structure_fixedtabs.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_fixedtabs.png
rename to docs/html/design/media/app_structure_fixedtabs.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_gallery_filmstrip.png b/docs/html/design/media/app_structure_gallery_filmstrip.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_gallery_filmstrip.png
rename to docs/html/design/media/app_structure_gallery_filmstrip.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_gmail.png b/docs/html/design/media/app_structure_gmail.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_gmail.png
rename to docs/html/design/media/app_structure_gmail.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_gmail_swipe.png b/docs/html/design/media/app_structure_gmail_swipe.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_gmail_swipe.png
rename to docs/html/design/media/app_structure_gmail_swipe.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_market.png b/docs/html/design/media/app_structure_market.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_market.png
rename to docs/html/design/media/app_structure_market.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_music_lndscp.png b/docs/html/design/media/app_structure_music_lndscp.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_music_lndscp.png
rename to docs/html/design/media/app_structure_music_lndscp.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_overview.png b/docs/html/design/media/app_structure_overview.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_overview.png
rename to docs/html/design/media/app_structure_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_people_detail.png b/docs/html/design/media/app_structure_people_detail.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_people_detail.png
rename to docs/html/design/media/app_structure_people_detail.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_scrolltabs.png b/docs/html/design/media/app_structure_scrolltabs.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_scrolltabs.png
rename to docs/html/design/media/app_structure_scrolltabs.png
Binary files differ
diff --git a/docs/html/design/static/content/app_structure_shortcut_on_item.png b/docs/html/design/media/app_structure_shortcut_on_item.png
similarity index 100%
rename from docs/html/design/static/content/app_structure_shortcut_on_item.png
rename to docs/html/design/media/app_structure_shortcut_on_item.png
Binary files differ
diff --git a/docs/html/design/static/content/building_blocks_landing.png b/docs/html/design/media/building_blocks_landing.png
similarity index 100%
rename from docs/html/design/static/content/building_blocks_landing.png
rename to docs/html/design/media/building_blocks_landing.png
Binary files differ
diff --git a/docs/html/design/static/content/buttons_basic.png b/docs/html/design/media/buttons_basic.png
similarity index 100%
rename from docs/html/design/static/content/buttons_basic.png
rename to docs/html/design/media/buttons_basic.png
Binary files differ
diff --git a/docs/html/design/static/content/buttons_borderless.png b/docs/html/design/media/buttons_borderless.png
similarity index 100%
rename from docs/html/design/static/content/buttons_borderless.png
rename to docs/html/design/media/buttons_borderless.png
Binary files differ
diff --git a/docs/html/design/static/content/buttons_default_small.png b/docs/html/design/media/buttons_default_small.png
similarity index 100%
rename from docs/html/design/static/content/buttons_default_small.png
rename to docs/html/design/media/buttons_default_small.png
Binary files differ
diff --git a/docs/html/design/static/content/color_spectrum.png b/docs/html/design/media/color_spectrum.png
similarity index 100%
rename from docs/html/design/static/content/color_spectrum.png
rename to docs/html/design/media/color_spectrum.png
Binary files differ
diff --git a/docs/html/design/static/content/compatibility_legacy_apps.png b/docs/html/design/media/compatibility_legacy_apps.png
similarity index 100%
rename from docs/html/design/static/content/compatibility_legacy_apps.png
rename to docs/html/design/media/compatibility_legacy_apps.png
Binary files differ
diff --git a/docs/html/design/static/content/compatibility_physical_buttons.png b/docs/html/design/media/compatibility_physical_buttons.png
similarity index 100%
rename from docs/html/design/static/content/compatibility_physical_buttons.png
rename to docs/html/design/media/compatibility_physical_buttons.png
Binary files differ
diff --git a/docs/html/design/static/content/compatibility_virtual_nav.png b/docs/html/design/media/compatibility_virtual_nav.png
similarity index 100%
rename from docs/html/design/static/content/compatibility_virtual_nav.png
rename to docs/html/design/media/compatibility_virtual_nav.png
Binary files differ
diff --git a/docs/html/design/static/content/creative_vision_main.png b/docs/html/design/media/creative_vision_main.png
similarity index 100%
rename from docs/html/design/static/content/creative_vision_main.png
rename to docs/html/design/media/creative_vision_main.png
Binary files differ
diff --git a/docs/html/design/static/content/design_elements_landing.png b/docs/html/design/media/design_elements_landing.png
similarity index 100%
rename from docs/html/design/static/content/design_elements_landing.png
rename to docs/html/design/media/design_elements_landing.png
Binary files differ
diff --git a/docs/html/design/static/content/devices_displays_density.png b/docs/html/design/media/devices_displays_density.png
similarity index 100%
rename from docs/html/design/static/content/devices_displays_density.png
rename to docs/html/design/media/devices_displays_density.png
Binary files differ
diff --git a/docs/html/design/static/content/devices_displays_main.png b/docs/html/design/media/devices_displays_main.png
similarity index 100%
rename from docs/html/design/static/content/devices_displays_main.png
rename to docs/html/design/media/devices_displays_main.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_examples.png b/docs/html/design/media/dialogs_examples.png
similarity index 100%
rename from docs/html/design/static/content/dialogs_examples.png
rename to docs/html/design/media/dialogs_examples.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_main.png b/docs/html/design/media/dialogs_main.png
similarity index 100%
rename from docs/html/design/static/content/dialogs_main.png
rename to docs/html/design/media/dialogs_main.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_popups_example.png b/docs/html/design/media/dialogs_popups_example.png
similarity index 100%
rename from docs/html/design/static/content/dialogs_popups_example.png
rename to docs/html/design/media/dialogs_popups_example.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_toasts.png b/docs/html/design/media/dialogs_toasts.png
similarity index 100%
rename from docs/html/design/static/content/dialogs_toasts.png
rename to docs/html/design/media/dialogs_toasts.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_w_no_title.png b/docs/html/design/media/dialogs_w_no_title.png
similarity index 100%
rename from docs/html/design/static/content/dialogs_w_no_title.png
rename to docs/html/design/media/dialogs_w_no_title.png
Binary files differ
diff --git a/docs/html/design/static/content/dialogs_w_title.png b/docs/html/design/media/dialogs_w_title.png
similarity index 100%
rename from docs/html/design/static/content/dialogs_w_title.png
rename to docs/html/design/media/dialogs_w_title.png
Binary files differ
diff --git a/docs/html/design/static/content/downloads_color_swatches.png b/docs/html/design/media/downloads_color_swatches.png
similarity index 100%
rename from docs/html/design/static/content/downloads_color_swatches.png
rename to docs/html/design/media/downloads_color_swatches.png
Binary files differ
diff --git a/docs/html/design/static/content/downloads_roboto_specimen_preview.png b/docs/html/design/media/downloads_roboto_specimen_preview.png
similarity index 100%
rename from docs/html/design/static/content/downloads_roboto_specimen_preview.png
rename to docs/html/design/media/downloads_roboto_specimen_preview.png
Binary files differ
diff --git a/docs/html/design/static/content/downloads_stencils.png b/docs/html/design/media/downloads_stencils.png
similarity index 100%
rename from docs/html/design/static/content/downloads_stencils.png
rename to docs/html/design/media/downloads_stencils.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_doubletouch.png b/docs/html/design/media/gesture_doubletouch.png
similarity index 100%
rename from docs/html/design/static/content/gesture_doubletouch.png
rename to docs/html/design/media/gesture_doubletouch.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_drag.png b/docs/html/design/media/gesture_drag.png
similarity index 100%
rename from docs/html/design/static/content/gesture_drag.png
rename to docs/html/design/media/gesture_drag.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_longtouch.png b/docs/html/design/media/gesture_longtouch.png
similarity index 100%
rename from docs/html/design/static/content/gesture_longtouch.png
rename to docs/html/design/media/gesture_longtouch.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_pinchclose.png b/docs/html/design/media/gesture_pinchclose.png
similarity index 100%
rename from docs/html/design/static/content/gesture_pinchclose.png
rename to docs/html/design/media/gesture_pinchclose.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_pinchopen.png b/docs/html/design/media/gesture_pinchopen.png
similarity index 100%
rename from docs/html/design/static/content/gesture_pinchopen.png
rename to docs/html/design/media/gesture_pinchopen.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_swipe.png b/docs/html/design/media/gesture_swipe.png
similarity index 100%
rename from docs/html/design/static/content/gesture_swipe.png
rename to docs/html/design/media/gesture_swipe.png
Binary files differ
diff --git a/docs/html/design/static/content/gesture_touch.png b/docs/html/design/media/gesture_touch.png
similarity index 100%
rename from docs/html/design/static/content/gesture_touch.png
rename to docs/html/design/media/gesture_touch.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_example.png b/docs/html/design/media/gridview_example.png
similarity index 100%
rename from docs/html/design/static/content/gridview_example.png
rename to docs/html/design/media/gridview_example.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_horizontal.png b/docs/html/design/media/gridview_horizontal.png
similarity index 100%
rename from docs/html/design/static/content/gridview_horizontal.png
rename to docs/html/design/media/gridview_horizontal.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_overview.png b/docs/html/design/media/gridview_overview.png
similarity index 100%
rename from docs/html/design/static/content/gridview_overview.png
rename to docs/html/design/media/gridview_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_style.png b/docs/html/design/media/gridview_style.png
similarity index 100%
rename from docs/html/design/static/content/gridview_style.png
rename to docs/html/design/media/gridview_style.png
Binary files differ
diff --git a/docs/html/design/static/content/gridview_vertical.png b/docs/html/design/media/gridview_vertical.png
similarity index 100%
rename from docs/html/design/static/content/gridview_vertical.png
rename to docs/html/design/media/gridview_vertical.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_actionbar_colors.png b/docs/html/design/media/iconography_actionbar_colors.png
similarity index 100%
rename from docs/html/design/static/content/iconography_actionbar_colors.png
rename to docs/html/design/media/iconography_actionbar_colors.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_actionbar_focal.png b/docs/html/design/media/iconography_actionbar_focal.png
similarity index 100%
rename from docs/html/design/static/content/iconography_actionbar_focal.png
rename to docs/html/design/media/iconography_actionbar_focal.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_actionbar_size.png b/docs/html/design/media/iconography_actionbar_size.png
similarity index 100%
rename from docs/html/design/static/content/iconography_actionbar_size.png
rename to docs/html/design/media/iconography_actionbar_size.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_actionbar_style.png b/docs/html/design/media/iconography_actionbar_style.png
similarity index 100%
rename from docs/html/design/static/content/iconography_actionbar_style.png
rename to docs/html/design/media/iconography_actionbar_style.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_example.png b/docs/html/design/media/iconography_launcher_example.png
similarity index 100%
rename from docs/html/design/static/content/iconography_launcher_example.png
rename to docs/html/design/media/iconography_launcher_example.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_example2.png b/docs/html/design/media/iconography_launcher_example2.png
similarity index 100%
rename from docs/html/design/static/content/iconography_launcher_example2.png
rename to docs/html/design/media/iconography_launcher_example2.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_focal.png b/docs/html/design/media/iconography_launcher_focal.png
similarity index 100%
rename from docs/html/design/static/content/iconography_launcher_focal.png
rename to docs/html/design/media/iconography_launcher_focal.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_size.png b/docs/html/design/media/iconography_launcher_size.png
similarity index 100%
rename from docs/html/design/static/content/iconography_launcher_size.png
rename to docs/html/design/media/iconography_launcher_size.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_launcher_style.png b/docs/html/design/media/iconography_launcher_style.png
similarity index 100%
rename from docs/html/design/static/content/iconography_launcher_style.png
rename to docs/html/design/media/iconography_launcher_style.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_notification_example.png b/docs/html/design/media/iconography_notification_example.png
similarity index 100%
rename from docs/html/design/static/content/iconography_notification_example.png
rename to docs/html/design/media/iconography_notification_example.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_notification_focal.png b/docs/html/design/media/iconography_notification_focal.png
similarity index 100%
rename from docs/html/design/static/content/iconography_notification_focal.png
rename to docs/html/design/media/iconography_notification_focal.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_notification_size.png b/docs/html/design/media/iconography_notification_size.png
similarity index 100%
rename from docs/html/design/static/content/iconography_notification_size.png
rename to docs/html/design/media/iconography_notification_size.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_notification_style.png b/docs/html/design/media/iconography_notification_style.png
similarity index 100%
rename from docs/html/design/static/content/iconography_notification_style.png
rename to docs/html/design/media/iconography_notification_style.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_overview.png b/docs/html/design/media/iconography_overview.png
similarity index 100%
rename from docs/html/design/static/content/iconography_overview.png
rename to docs/html/design/media/iconography_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_colors.png b/docs/html/design/media/iconography_small_colors.png
similarity index 100%
rename from docs/html/design/static/content/iconography_small_colors.png
rename to docs/html/design/media/iconography_small_colors.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_example.png b/docs/html/design/media/iconography_small_example.png
similarity index 100%
rename from docs/html/design/static/content/iconography_small_example.png
rename to docs/html/design/media/iconography_small_example.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_focal.png b/docs/html/design/media/iconography_small_focal.png
similarity index 100%
rename from docs/html/design/static/content/iconography_small_focal.png
rename to docs/html/design/media/iconography_small_focal.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_size.png b/docs/html/design/media/iconography_small_size.png
similarity index 100%
rename from docs/html/design/static/content/iconography_small_size.png
rename to docs/html/design/media/iconography_small_size.png
Binary files differ
diff --git a/docs/html/design/static/content/iconography_small_style.png b/docs/html/design/media/iconography_small_style.png
similarity index 100%
rename from docs/html/design/static/content/iconography_small_style.png
rename to docs/html/design/media/iconography_small_style.png
Binary files differ
diff --git a/docs/html/design/static/content/index_landing_page.png b/docs/html/design/media/index_landing_page.png
similarity index 100%
rename from docs/html/design/static/content/index_landing_page.png
rename to docs/html/design/media/index_landing_page.png
Binary files differ
diff --git a/docs/html/design/static/content/lists_main.png b/docs/html/design/media/lists_main.png
similarity index 100%
rename from docs/html/design/static/content/lists_main.png
rename to docs/html/design/media/lists_main.png
Binary files differ
diff --git a/docs/html/design/static/content/metrics_48.png b/docs/html/design/media/metrics_48.png
similarity index 100%
rename from docs/html/design/static/content/metrics_48.png
rename to docs/html/design/media/metrics_48.png
Binary files differ
diff --git a/docs/html/design/static/content/metrics_closeup.png b/docs/html/design/media/metrics_closeup.png
similarity index 100%
rename from docs/html/design/static/content/metrics_closeup.png
rename to docs/html/design/media/metrics_closeup.png
Binary files differ
diff --git a/docs/html/design/static/content/metrics_diagram.png b/docs/html/design/media/metrics_diagram.png
similarity index 100%
rename from docs/html/design/static/content/metrics_diagram.png
rename to docs/html/design/media/metrics_diagram.png
Binary files differ
diff --git a/docs/html/design/static/content/metrics_forms.png b/docs/html/design/media/metrics_forms.png
similarity index 100%
rename from docs/html/design/static/content/metrics_forms.png
rename to docs/html/design/media/metrics_forms.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_icons.png b/docs/html/design/media/migrating_icons.png
similarity index 100%
rename from docs/html/design/static/content/migrating_icons.png
rename to docs/html/design/media/migrating_icons.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_ios_dialers.png b/docs/html/design/media/migrating_ios_dialers.png
similarity index 100%
rename from docs/html/design/static/content/migrating_ios_dialers.png
rename to docs/html/design/media/migrating_ios_dialers.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_ios_galleries.png b/docs/html/design/media/migrating_ios_galleries.png
similarity index 100%
rename from docs/html/design/static/content/migrating_ios_galleries.png
rename to docs/html/design/media/migrating_ios_galleries.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_ios_settings.png b/docs/html/design/media/migrating_ios_settings.png
similarity index 100%
rename from docs/html/design/static/content/migrating_ios_settings.png
rename to docs/html/design/media/migrating_ios_settings.png
Binary files differ
diff --git a/docs/html/design/static/content/migrating_ui_elements.png b/docs/html/design/media/migrating_ui_elements.png
similarity index 100%
rename from docs/html/design/static/content/migrating_ui_elements.png
rename to docs/html/design/media/migrating_ui_elements.png
Binary files differ
diff --git a/docs/html/design/static/content/misc_full_galaxynexus_blank_land_span13.png b/docs/html/design/media/misc_full_galaxynexus_blank_land_span13.png
similarity index 100%
rename from docs/html/design/static/content/misc_full_galaxynexus_blank_land_span13.png
rename to docs/html/design/media/misc_full_galaxynexus_blank_land_span13.png
Binary files differ
diff --git a/docs/html/design/static/content/misc_full_galaxynexus_blank_port_span5.png b/docs/html/design/media/misc_full_galaxynexus_blank_port_span5.png
similarity index 100%
rename from docs/html/design/static/content/misc_full_galaxynexus_blank_port_span5.png
rename to docs/html/design/media/misc_full_galaxynexus_blank_port_span5.png
Binary files differ
diff --git a/docs/html/design/static/content/misc_full_galaxynexus_blank_port_span9.png b/docs/html/design/media/misc_full_galaxynexus_blank_port_span9.png
similarity index 100%
rename from docs/html/design/static/content/misc_full_galaxynexus_blank_port_span9.png
rename to docs/html/design/media/misc_full_galaxynexus_blank_port_span9.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_expand.png b/docs/html/design/media/multipane_expand.png
similarity index 100%
rename from docs/html/design/static/content/multipane_expand.png
rename to docs/html/design/media/multipane_expand.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_show.png b/docs/html/design/media/multipane_show.png
similarity index 100%
rename from docs/html/design/static/content/multipane_show.png
rename to docs/html/design/media/multipane_show.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_stack.png b/docs/html/design/media/multipane_stack.png
similarity index 100%
rename from docs/html/design/static/content/multipane_stack.png
rename to docs/html/design/media/multipane_stack.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_stretch.png b/docs/html/design/media/multipane_stretch.png
similarity index 100%
rename from docs/html/design/static/content/multipane_stretch.png
rename to docs/html/design/media/multipane_stretch.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_view_tablet.png b/docs/html/design/media/multipane_view_tablet.png
similarity index 100%
rename from docs/html/design/static/content/multipane_view_tablet.png
rename to docs/html/design/media/multipane_view_tablet.png
Binary files differ
diff --git a/docs/html/design/static/content/multipane_views.png b/docs/html/design/media/multipane_views.png
similarity index 100%
rename from docs/html/design/static/content/multipane_views.png
rename to docs/html/design/media/multipane_views.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_between_siblings_gmail.png b/docs/html/design/media/navigation_between_siblings_gmail.png
similarity index 100%
rename from docs/html/design/static/content/navigation_between_siblings_gmail.png
rename to docs/html/design/media/navigation_between_siblings_gmail.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_between_siblings_market1.png b/docs/html/design/media/navigation_between_siblings_market1.png
similarity index 100%
rename from docs/html/design/static/content/navigation_between_siblings_market1.png
rename to docs/html/design/media/navigation_between_siblings_market1.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_between_siblings_market2.png b/docs/html/design/media/navigation_between_siblings_market2.png
similarity index 100%
rename from docs/html/design/static/content/navigation_between_siblings_market2.png
rename to docs/html/design/media/navigation_between_siblings_market2.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_from_outside_back.png b/docs/html/design/media/navigation_from_outside_back.png
similarity index 100%
rename from docs/html/design/static/content/navigation_from_outside_back.png
rename to docs/html/design/media/navigation_from_outside_back.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_from_outside_up.png b/docs/html/design/media/navigation_from_outside_up.png
similarity index 100%
rename from docs/html/design/static/content/navigation_from_outside_up.png
rename to docs/html/design/media/navigation_from_outside_up.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_up_vs_back_gmail.png b/docs/html/design/media/navigation_up_vs_back_gmail.png
similarity index 100%
rename from docs/html/design/static/content/navigation_up_vs_back_gmail.png
rename to docs/html/design/media/navigation_up_vs_back_gmail.png
Binary files differ
diff --git a/docs/html/design/static/content/navigation_with_back_and_up.png b/docs/html/design/media/navigation_with_back_and_up.png
similarity index 100%
rename from docs/html/design/static/content/navigation_with_back_and_up.png
rename to docs/html/design/media/navigation_with_back_and_up.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_dismiss.png b/docs/html/design/media/notifications_dismiss.png
similarity index 100%
rename from docs/html/design/static/content/notifications_dismiss.png
rename to docs/html/design/media/notifications_dismiss.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_additional_fail.png b/docs/html/design/media/notifications_pattern_additional_fail.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_additional_fail.png
rename to docs/html/design/media/notifications_pattern_additional_fail.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_additional_win.png b/docs/html/design/media/notifications_pattern_additional_win.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_additional_win.png
rename to docs/html/design/media/notifications_pattern_additional_win.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_anatomy.png b/docs/html/design/media/notifications_pattern_anatomy.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_anatomy.png
rename to docs/html/design/media/notifications_pattern_anatomy.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_dialog_toast.png b/docs/html/design/media/notifications_pattern_dialog_toast.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_dialog_toast.png
rename to docs/html/design/media/notifications_pattern_dialog_toast.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_ongoing_music.png b/docs/html/design/media/notifications_pattern_ongoing_music.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_ongoing_music.png
rename to docs/html/design/media/notifications_pattern_ongoing_music.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_phone_icons.png b/docs/html/design/media/notifications_pattern_phone_icons.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_phone_icons.png
rename to docs/html/design/media/notifications_pattern_phone_icons.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_phone_ticker.png b/docs/html/design/media/notifications_pattern_phone_ticker.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_phone_ticker.png
rename to docs/html/design/media/notifications_pattern_phone_ticker.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_real_time_people.png b/docs/html/design/media/notifications_pattern_real_time_people.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_real_time_people.png
rename to docs/html/design/media/notifications_pattern_real_time_people.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_social_fail.png b/docs/html/design/media/notifications_pattern_social_fail.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_social_fail.png
rename to docs/html/design/media/notifications_pattern_social_fail.png
Binary files differ
diff --git a/docs/html/design/static/content/notifications_pattern_tablet.png b/docs/html/design/media/notifications_pattern_tablet.png
similarity index 100%
rename from docs/html/design/static/content/notifications_pattern_tablet.png
rename to docs/html/design/media/notifications_pattern_tablet.png
Binary files differ
diff --git a/docs/html/design/static/content/patterns_landing.png b/docs/html/design/media/patterns_landing.png
similarity index 100%
rename from docs/html/design/static/content/patterns_landing.png
rename to docs/html/design/media/patterns_landing.png
Binary files differ
diff --git a/docs/html/design/static/content/picker_datetime.png b/docs/html/design/media/picker_datetime.png
similarity index 100%
rename from docs/html/design/static/content/picker_datetime.png
rename to docs/html/design/media/picker_datetime.png
Binary files differ
diff --git a/docs/html/design/static/content/picker_space.png b/docs/html/design/media/picker_space.png
similarity index 100%
rename from docs/html/design/static/content/picker_space.png
rename to docs/html/design/media/picker_space.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_decide_for_me.png b/docs/html/design/media/principles_decide_for_me.png
similarity index 100%
rename from docs/html/design/static/content/principles_decide_for_me.png
rename to docs/html/design/media/principles_decide_for_me.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_delight.png b/docs/html/design/media/principles_delight.png
similarity index 100%
rename from docs/html/design/static/content/principles_delight.png
rename to docs/html/design/media/principles_delight.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_error.png b/docs/html/design/media/principles_error.png
similarity index 100%
rename from docs/html/design/static/content/principles_error.png
rename to docs/html/design/media/principles_error.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_get_to_know_me.png b/docs/html/design/media/principles_get_to_know_me.png
similarity index 100%
rename from docs/html/design/static/content/principles_get_to_know_me.png
rename to docs/html/design/media/principles_get_to_know_me.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_heavy_lifting.png b/docs/html/design/media/principles_heavy_lifting.png
similarity index 100%
rename from docs/html/design/static/content/principles_heavy_lifting.png
rename to docs/html/design/media/principles_heavy_lifting.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_important_interruption.png b/docs/html/design/media/principles_important_interruption.png
similarity index 100%
rename from docs/html/design/static/content/principles_important_interruption.png
rename to docs/html/design/media/principles_important_interruption.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_information_when_need_it.png b/docs/html/design/media/principles_information_when_need_it.png
similarity index 100%
rename from docs/html/design/static/content/principles_information_when_need_it.png
rename to docs/html/design/media/principles_information_when_need_it.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_keep_it_brief.png b/docs/html/design/media/principles_keep_it_brief.png
similarity index 100%
rename from docs/html/design/static/content/principles_keep_it_brief.png
rename to docs/html/design/media/principles_keep_it_brief.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_looks_same.png b/docs/html/design/media/principles_looks_same.png
similarity index 100%
rename from docs/html/design/static/content/principles_looks_same.png
rename to docs/html/design/media/principles_looks_same.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_make_important_fast.png b/docs/html/design/media/principles_make_important_fast.png
similarity index 100%
rename from docs/html/design/static/content/principles_make_important_fast.png
rename to docs/html/design/media/principles_make_important_fast.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_make_it_mine.png b/docs/html/design/media/principles_make_it_mine.png
similarity index 100%
rename from docs/html/design/static/content/principles_make_it_mine.png
rename to docs/html/design/media/principles_make_it_mine.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_navigation.png b/docs/html/design/media/principles_navigation.png
similarity index 100%
rename from docs/html/design/static/content/principles_navigation.png
rename to docs/html/design/media/principles_navigation.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_never_lose_stuff.png b/docs/html/design/media/principles_never_lose_stuff.png
similarity index 100%
rename from docs/html/design/static/content/principles_never_lose_stuff.png
rename to docs/html/design/media/principles_never_lose_stuff.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_pictures.png b/docs/html/design/media/principles_pictures.png
similarity index 100%
rename from docs/html/design/static/content/principles_pictures.png
rename to docs/html/design/media/principles_pictures.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_real_objects.png b/docs/html/design/media/principles_real_objects.png
similarity index 100%
rename from docs/html/design/static/content/principles_real_objects.png
rename to docs/html/design/media/principles_real_objects.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_sprinkle_encouragement.png b/docs/html/design/media/principles_sprinkle_encouragement.png
similarity index 100%
rename from docs/html/design/static/content/principles_sprinkle_encouragement.png
rename to docs/html/design/media/principles_sprinkle_encouragement.png
Binary files differ
diff --git a/docs/html/design/static/content/principles_tricks.png b/docs/html/design/media/principles_tricks.png
similarity index 100%
rename from docs/html/design/static/content/principles_tricks.png
rename to docs/html/design/media/principles_tricks.png
Binary files differ
diff --git a/docs/html/design/static/content/progress_activity.png b/docs/html/design/media/progress_activity.png
similarity index 100%
rename from docs/html/design/static/content/progress_activity.png
rename to docs/html/design/media/progress_activity.png
Binary files differ
diff --git a/docs/html/design/static/content/progress_activity2.png b/docs/html/design/media/progress_activity2.png
similarity index 100%
rename from docs/html/design/static/content/progress_activity2.png
rename to docs/html/design/media/progress_activity2.png
Binary files differ
diff --git a/docs/html/design/static/content/progress_download.png b/docs/html/design/media/progress_download.png
similarity index 100%
rename from docs/html/design/static/content/progress_download.png
rename to docs/html/design/media/progress_download.png
Binary files differ
diff --git a/docs/html/design/static/content/progress_themes.png b/docs/html/design/media/progress_themes.png
similarity index 100%
rename from docs/html/design/static/content/progress_themes.png
rename to docs/html/design/media/progress_themes.png
Binary files differ
diff --git a/docs/html/design/static/content/scroll_index.mp4 b/docs/html/design/media/scroll_index.mp4
similarity index 100%
rename from docs/html/design/static/content/scroll_index.mp4
rename to docs/html/design/media/scroll_index.mp4
Binary files differ
diff --git a/docs/html/design/static/content/scroll_index.ogv b/docs/html/design/media/scroll_index.ogv
similarity index 100%
rename from docs/html/design/static/content/scroll_index.ogv
rename to docs/html/design/media/scroll_index.ogv
Binary files differ
diff --git a/docs/html/design/static/content/scroll_index.webm b/docs/html/design/media/scroll_index.webm
similarity index 100%
rename from docs/html/design/static/content/scroll_index.webm
rename to docs/html/design/media/scroll_index.webm
Binary files differ
diff --git a/docs/html/design/static/content/scroll_indicator.mp4 b/docs/html/design/media/scroll_indicator.mp4
similarity index 100%
rename from docs/html/design/static/content/scroll_indicator.mp4
rename to docs/html/design/media/scroll_indicator.mp4
Binary files differ
diff --git a/docs/html/design/static/content/scroll_indicator.ogv b/docs/html/design/media/scroll_indicator.ogv
similarity index 100%
rename from docs/html/design/static/content/scroll_indicator.ogv
rename to docs/html/design/media/scroll_indicator.ogv
Binary files differ
diff --git a/docs/html/design/static/content/scroll_indicator.webm b/docs/html/design/media/scroll_indicator.webm
similarity index 100%
rename from docs/html/design/static/content/scroll_indicator.webm
rename to docs/html/design/media/scroll_indicator.webm
Binary files differ
diff --git a/docs/html/design/static/content/seekbar_example.png b/docs/html/design/media/seekbar_example.png
similarity index 100%
rename from docs/html/design/static/content/seekbar_example.png
rename to docs/html/design/media/seekbar_example.png
Binary files differ
diff --git a/docs/html/design/static/content/seekbar_style.png b/docs/html/design/media/seekbar_style.png
similarity index 100%
rename from docs/html/design/static/content/seekbar_style.png
rename to docs/html/design/media/seekbar_style.png
Binary files differ
diff --git a/docs/html/design/static/content/selection_adjusting_actions.png b/docs/html/design/media/selection_adjusting_actions.png
similarity index 100%
rename from docs/html/design/static/content/selection_adjusting_actions.png
rename to docs/html/design/media/selection_adjusting_actions.png
Binary files differ
diff --git a/docs/html/design/static/content/selection_cab_big.png b/docs/html/design/media/selection_cab_big.png
similarity index 100%
rename from docs/html/design/static/content/selection_cab_big.png
rename to docs/html/design/media/selection_cab_big.png
Binary files differ
diff --git a/docs/html/design/static/content/selection_cab_example.png b/docs/html/design/media/selection_cab_example.png
similarity index 100%
rename from docs/html/design/static/content/selection_cab_example.png
rename to docs/html/design/media/selection_cab_example.png
Binary files differ
diff --git a/docs/html/design/static/content/selection_context_menu.png b/docs/html/design/media/selection_context_menu.png
similarity index 100%
rename from docs/html/design/static/content/selection_context_menu.png
rename to docs/html/design/media/selection_context_menu.png
Binary files differ
diff --git a/docs/html/design/static/content/spinners_actionbar.png b/docs/html/design/media/spinners_actionbar.png
similarity index 100%
rename from docs/html/design/static/content/spinners_actionbar.png
rename to docs/html/design/media/spinners_actionbar.png
Binary files differ
diff --git a/docs/html/design/static/content/spinners_form.png b/docs/html/design/media/spinners_form.png
similarity index 100%
rename from docs/html/design/static/content/spinners_form.png
rename to docs/html/design/media/spinners_form.png
Binary files differ
diff --git a/docs/html/design/static/content/spinners_hololightanddark.png b/docs/html/design/media/spinners_hololightanddark.png
similarity index 100%
rename from docs/html/design/static/content/spinners_hololightanddark.png
rename to docs/html/design/media/spinners_hololightanddark.png
Binary files differ
diff --git a/docs/html/design/static/content/swipe_tabs.mp4 b/docs/html/design/media/swipe_tabs.mp4
similarity index 100%
rename from docs/html/design/static/content/swipe_tabs.mp4
rename to docs/html/design/media/swipe_tabs.mp4
Binary files differ
diff --git a/docs/html/design/static/content/swipe_tabs.ogv b/docs/html/design/media/swipe_tabs.ogv
similarity index 100%
rename from docs/html/design/static/content/swipe_tabs.ogv
rename to docs/html/design/media/swipe_tabs.ogv
Binary files differ
diff --git a/docs/html/design/static/content/swipe_tabs.png b/docs/html/design/media/swipe_tabs.png
similarity index 100%
rename from docs/html/design/static/content/swipe_tabs.png
rename to docs/html/design/media/swipe_tabs.png
Binary files differ
diff --git a/docs/html/design/static/content/swipe_tabs.webm b/docs/html/design/media/swipe_tabs.webm
similarity index 100%
rename from docs/html/design/static/content/swipe_tabs.webm
rename to docs/html/design/media/swipe_tabs.webm
Binary files differ
diff --git a/docs/html/design/static/content/swipe_views.png b/docs/html/design/media/swipe_views.png
similarity index 100%
rename from docs/html/design/static/content/swipe_views.png
rename to docs/html/design/media/swipe_views.png
Binary files differ
diff --git a/docs/html/design/static/content/swipe_views2.png b/docs/html/design/media/swipe_views2.png
similarity index 100%
rename from docs/html/design/static/content/swipe_views2.png
rename to docs/html/design/media/swipe_views2.png
Binary files differ
diff --git a/docs/html/design/static/content/switches_checkboxes.png b/docs/html/design/media/switches_checkboxes.png
similarity index 100%
rename from docs/html/design/static/content/switches_checkboxes.png
rename to docs/html/design/media/switches_checkboxes.png
Binary files differ
diff --git a/docs/html/design/static/content/switches_radios.png b/docs/html/design/media/switches_radios.png
similarity index 100%
rename from docs/html/design/static/content/switches_radios.png
rename to docs/html/design/media/switches_radios.png
Binary files differ
diff --git a/docs/html/design/static/content/switches_switches.png b/docs/html/design/media/switches_switches.png
similarity index 100%
rename from docs/html/design/static/content/switches_switches.png
rename to docs/html/design/media/switches_switches.png
Binary files differ
diff --git a/docs/html/design/static/content/system_ui_landing.png b/docs/html/design/media/system_ui_landing.png
similarity index 100%
rename from docs/html/design/static/content/system_ui_landing.png
rename to docs/html/design/media/system_ui_landing.png
Binary files differ
diff --git a/docs/html/design/static/content/tabs_overview.png b/docs/html/design/media/tabs_overview.png
similarity index 100%
rename from docs/html/design/static/content/tabs_overview.png
rename to docs/html/design/media/tabs_overview.png
Binary files differ
diff --git a/docs/html/design/static/content/tabs_scrolly.mp4 b/docs/html/design/media/tabs_scrolly.mp4
similarity index 100%
rename from docs/html/design/static/content/tabs_scrolly.mp4
rename to docs/html/design/media/tabs_scrolly.mp4
Binary files differ
diff --git a/docs/html/design/static/content/tabs_scrolly.ogv b/docs/html/design/media/tabs_scrolly.ogv
similarity index 100%
rename from docs/html/design/static/content/tabs_scrolly.ogv
rename to docs/html/design/media/tabs_scrolly.ogv
Binary files differ
diff --git a/docs/html/design/static/content/tabs_scrolly.webm b/docs/html/design/media/tabs_scrolly.webm
similarity index 100%
rename from docs/html/design/static/content/tabs_scrolly.webm
rename to docs/html/design/media/tabs_scrolly.webm
Binary files differ
diff --git a/docs/html/design/static/content/tabs_stacked.png b/docs/html/design/media/tabs_stacked.png
similarity index 100%
rename from docs/html/design/static/content/tabs_stacked.png
rename to docs/html/design/media/tabs_stacked.png
Binary files differ
diff --git a/docs/html/design/static/content/tabs_standard.png b/docs/html/design/media/tabs_standard.png
similarity index 100%
rename from docs/html/design/static/content/tabs_standard.png
rename to docs/html/design/media/tabs_standard.png
Binary files differ
diff --git a/docs/html/design/static/content/tabs_youtube.png b/docs/html/design/media/tabs_youtube.png
similarity index 100%
rename from docs/html/design/static/content/tabs_youtube.png
rename to docs/html/design/media/tabs_youtube.png
Binary files differ
diff --git a/docs/html/design/static/content/text_input_holodarkandlight.png b/docs/html/design/media/text_input_holodarkandlight.png
similarity index 100%
rename from docs/html/design/static/content/text_input_holodarkandlight.png
rename to docs/html/design/media/text_input_holodarkandlight.png
Binary files differ
diff --git a/docs/html/design/static/content/text_input_singlevsmultiline.png b/docs/html/design/media/text_input_singlevsmultiline.png
similarity index 100%
rename from docs/html/design/static/content/text_input_singlevsmultiline.png
rename to docs/html/design/media/text_input_singlevsmultiline.png
Binary files differ
diff --git a/docs/html/design/static/content/text_input_textselection.png b/docs/html/design/media/text_input_textselection.png
similarity index 100%
rename from docs/html/design/static/content/text_input_textselection.png
rename to docs/html/design/media/text_input_textselection.png
Binary files differ
diff --git a/docs/html/design/static/content/text_input_typesandtypedown.png b/docs/html/design/media/text_input_typesandtypedown.png
similarity index 100%
rename from docs/html/design/static/content/text_input_typesandtypedown.png
rename to docs/html/design/media/text_input_typesandtypedown.png
Binary files differ
diff --git a/docs/html/design/static/content/themes_holo_dark.png b/docs/html/design/media/themes_holo_dark.png
similarity index 100%
rename from docs/html/design/static/content/themes_holo_dark.png
rename to docs/html/design/media/themes_holo_dark.png
Binary files differ
diff --git a/docs/html/design/static/content/themes_holo_inverse.png b/docs/html/design/media/themes_holo_inverse.png
similarity index 100%
rename from docs/html/design/static/content/themes_holo_inverse.png
rename to docs/html/design/media/themes_holo_inverse.png
Binary files differ
diff --git a/docs/html/design/static/content/themes_holo_light.png b/docs/html/design/media/themes_holo_light.png
similarity index 100%
rename from docs/html/design/static/content/themes_holo_light.png
rename to docs/html/design/media/themes_holo_light.png
Binary files differ
diff --git a/docs/html/design/static/content/touch_feedback_communication.png b/docs/html/design/media/touch_feedback_communication.png
similarity index 100%
rename from docs/html/design/static/content/touch_feedback_communication.png
rename to docs/html/design/media/touch_feedback_communication.png
Binary files differ
diff --git a/docs/html/design/static/content/touch_feedback_manipulation.png b/docs/html/design/media/touch_feedback_manipulation.png
similarity index 100%
rename from docs/html/design/static/content/touch_feedback_manipulation.png
rename to docs/html/design/media/touch_feedback_manipulation.png
Binary files differ
diff --git a/docs/html/design/static/content/touch_feedback_reaction_response.png b/docs/html/design/media/touch_feedback_reaction_response.png
similarity index 100%
rename from docs/html/design/static/content/touch_feedback_reaction_response.png
rename to docs/html/design/media/touch_feedback_reaction_response.png
Binary files differ
diff --git a/docs/html/design/static/content/touch_feedback_states.png b/docs/html/design/media/touch_feedback_states.png
similarity index 100%
rename from docs/html/design/static/content/touch_feedback_states.png
rename to docs/html/design/media/touch_feedback_states.png
Binary files differ
diff --git a/docs/html/design/static/content/typography_alphas.png b/docs/html/design/media/typography_alphas.png
similarity index 100%
rename from docs/html/design/static/content/typography_alphas.png
rename to docs/html/design/media/typography_alphas.png
Binary files differ
diff --git a/docs/html/design/static/content/typography_defaults.png b/docs/html/design/media/typography_defaults.png
similarity index 100%
rename from docs/html/design/static/content/typography_defaults.png
rename to docs/html/design/media/typography_defaults.png
Binary files differ
diff --git a/docs/html/design/static/content/typography_main.png b/docs/html/design/media/typography_main.png
similarity index 100%
rename from docs/html/design/static/content/typography_main.png
rename to docs/html/design/media/typography_main.png
Binary files differ
diff --git a/docs/html/design/static/content/typography_sizes.png b/docs/html/design/media/typography_sizes.png
similarity index 100%
rename from docs/html/design/static/content/typography_sizes.png
rename to docs/html/design/media/typography_sizes.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_all_apps.png b/docs/html/design/media/ui_overview_all_apps.png
similarity index 100%
rename from docs/html/design/static/content/ui_overview_all_apps.png
rename to docs/html/design/media/ui_overview_all_apps.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_app_ui.png b/docs/html/design/media/ui_overview_app_ui.png
similarity index 100%
rename from docs/html/design/static/content/ui_overview_app_ui.png
rename to docs/html/design/media/ui_overview_app_ui.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_home_screen.png b/docs/html/design/media/ui_overview_home_screen.png
similarity index 100%
rename from docs/html/design/static/content/ui_overview_home_screen.png
rename to docs/html/design/media/ui_overview_home_screen.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_notifications.png b/docs/html/design/media/ui_overview_notifications.png
similarity index 100%
rename from docs/html/design/static/content/ui_overview_notifications.png
rename to docs/html/design/media/ui_overview_notifications.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_recents.png b/docs/html/design/media/ui_overview_recents.png
similarity index 100%
rename from docs/html/design/static/content/ui_overview_recents.png
rename to docs/html/design/media/ui_overview_recents.png
Binary files differ
diff --git a/docs/html/design/static/content/ui_overview_system_ui.png b/docs/html/design/media/ui_overview_system_ui.png
similarity index 100%
rename from docs/html/design/static/content/ui_overview_system_ui.png
rename to docs/html/design/media/ui_overview_system_ui.png
Binary files differ
diff --git a/docs/html/design/static/content/whats_new_action_bar.png b/docs/html/design/media/whats_new_action_bar.png
similarity index 100%
rename from docs/html/design/static/content/whats_new_action_bar.png
rename to docs/html/design/media/whats_new_action_bar.png
Binary files differ
diff --git a/docs/html/design/static/content/whats_new_multipanel.png b/docs/html/design/media/whats_new_multipanel.png
similarity index 100%
rename from docs/html/design/static/content/whats_new_multipanel.png
rename to docs/html/design/media/whats_new_multipanel.png
Binary files differ
diff --git a/docs/html/design/static/content/whats_new_multiselect.png b/docs/html/design/media/whats_new_multiselect.png
similarity index 100%
rename from docs/html/design/static/content/whats_new_multiselect.png
rename to docs/html/design/media/whats_new_multiselect.png
Binary files differ
diff --git a/docs/html/design/static/content/whats_new_nav_bar.png b/docs/html/design/media/whats_new_nav_bar.png
similarity index 100%
rename from docs/html/design/static/content/whats_new_nav_bar.png
rename to docs/html/design/media/whats_new_nav_bar.png
Binary files differ
diff --git a/docs/html/design/patterns/actionbar.html b/docs/html/design/patterns/actionbar.html
deleted file mode 100644
index 1566d04..0000000
--- a/docs/html/design/patterns/actionbar.html
+++ /dev/null
@@ -1,511 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Action Bar
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Action Bar</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<img src="../static/content/action_bar_pattern_overview.png">
-
-<p>The <em>action bar</em> is arguably the most important structural element of an Android app. It's a
-dedicated piece of real estate at the top of each screen that is generally persistent throughout the
-app.</p>
-<p><strong>The main purpose of the action bar is to</strong>:</p>
-<ul>
-<li>Make important actions (such as <em>New</em> or <em>Search</em>, etc) prominent and accessible in a predictable
- way.</li>
-<li>Support consistent navigation and view switching within apps.</li>
-<li>Reduce clutter by providing an action overflow for rarely used actions.</li>
-<li>Provide a dedicated space for giving your app an identity.</li>
-</ul>
-<p>If you're new to writing Android apps, note that the action bar is one of the most important design
-elements you can implement. Following the guidelines described here will go a long way toward making
-your app's interface consistent with the core Android apps.</p>
-<h2 id="organization">General Organization</h2>
-
-<p>The action bar is split into four different functional areas that apply to most apps.</p>
-<img src="../static/content/action_bar_basics.png">
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7 with-callouts">
-
- <ol>
- <li class="value-1"><h4>App icon</h4>
- <p>
-
-The app icon establishes your app's identity. It can be replaced with a different logo or branding
-if you wish.
-Important: If the app is currently not displaying the top-level screen, be sure to display the Up
-caret to the left of the app icon, so the user can navigate up the hierarchy. For more discussion of
-Up navigation, see the <a href="../patterns/navigation.html">Navigation</a> pattern.
-
-<div class="figure">
- <img src="../static/content/action_bar_pattern_up_app_icon.png">
- <div class="figure-caption">
- App icon with and without "up" affordance.
- </div>
-</div>
-
- </p>
- </li>
- </ol>
-
- </div>
- <div class="layout-content-col span-6 with-callouts">
-
- <ol>
- <li class="value-2"><h4>View control</h4>
- <p>
-
-If your app displays data in different views, this segment of the action bar allows users to switch
-views. Examples of view-switching controls are drop-down menus or tab controls.
-
- </p>
- <p>
-
-If your app doesn't support different views, you can also use this space to display non-interactive
-content, such as an app title or longer branding information.
-
- </p>
- </li>
- <li class="value-3"><h4>Action buttons</h4>
- <p>
-
-Show the most important actions of your app in the actions section. Actions that don't fit in the
-action bar are moved automatically to the action overflow.
-
- </p>
- </li>
- <li class="value-4"><h4>Action overflow</h4>
- <p>
-
-Move less often used actions to the action overflow.
-
- </p>
- </li>
- </ol>
- </div>
-</div>
-
-<h2 id="adapting-rotation">Adapting to Rotation and Different Screen Sizes</h2>
-
-<p>One of the most important UI issues to consider when creating an app is how to adjust to screen
-rotation on different screen sizes.</p>
-<p>You can adapt to such changes by using <em>split action bars</em>, which allow you to distribute action bar
-content across multiple bars located below the main action bar or at the bottom of the screen.</p>
-
-<img src="../static/content/action_bar_pattern_rotation.png">
-<div class="figure-caption">
- Split action bar showing action buttons at the bottom of the screen in vertical orientation.
-</div>
-
-<h2 id="considerations-split-action-bars">Layout Considerations for Split Action Bars</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8 with-callouts">
-
-<p>When splitting up content across multiple action bars, you generally have three possible locations
-for action bar content:</p>
-<ol>
-<li><strong>Main action bar</strong></li>
-<li><strong>Top bar</strong></li>
-<li><strong>Bottom bar</strong></li>
-</ol>
-<p>If the user can navigate up the hierarchy from a given screen, the main action bar contains the up
-caret, at a minimum.</p>
-<p>To allow the user to quickly switch between the views your app provides, use tabs or a spinner in
-the top bar.</p>
-<p>To display actions and, if necessary, the action overflow, use the bottom bar.</p>
-
- </div>
- <div class="layout-content-col span-3">
-
- <img src="../static/content/action_bar_pattern_considerations.png">
-
- </div>
-</div>
-
-<h2 id="contextual">Contextual Action Bars</h2>
-
-<p>A <em>contextual action bar (CAB)</em> is a temporary action bar that overlays the app's action bar for the
-duration of a particular sub-task. CABs are most typically used for tasks that involve acting on
-selected data or text.</p>
-
-<img src="../static/content/action_bar_cab.png">
-<div class="figure-caption">
- Contextual action bar shown in Browser and Gmail
-</div>
-
-<p>The selection CAB appears after a long press on a selectable data item triggers selection mode.</p>
-<p><strong>From here the user can</strong>:</p>
-<ul>
-<li>Select additional elements by touching them.</li>
-<li>Trigger an action from the CAB that applies to all selected data items. The CAB then
- automatically dismisses itself.</li>
-<li>Dismiss the CAB via the navigation bar's Back button or the CAB's checkmark button. This removes
- the CAB along with all selection highlights.</li>
-</ul>
-<p>Use CABs whenever you allow the user to select data via long press. You can control the action
-content of a CAB in order to insert the actions you would like the user to be able to perform.</p>
-<p>For more information, refer to the "Selection" pattern.</p>
-<h2 id="elements">Action Bar Elements</h2>
-
-<h4>Tabs</h4>
-<p><em>Tabs</em> display app views concurrently and make it easy to explore and switch between them. Use tabs
-if you expect your users to switch views frequently.</p>
-
-<img src="../static/content/tabs_youtube.png">
-
-<p>There are two types of tabs: fixed and scrollable.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Scrollable tabs</h4>
-<p><em>Scrollable tabs</em> always take up the entire width of the bar, with the currently active view item in
-the center, and therefore need to live in a dedicated bar. Scrollable tabs can themselves be
-scrolled horizontally to bring more tabs into view.</p>
-<p>Use scrollable tabs if you have a large number of views or if you're unsure how many views will be
-displayed because your app inserts views dynamically (for example, open chats in a messaging app
-that the user can navigate between). Scrollable tabs should always allow the user to navigate
-between the views by swiping left or right on the content area as well as swiping the tabs
-themselves.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <video width="400" class="with-shadow play-on-hover" autoplay>
- <source src="../static/content/tabs_scrolly.mp4" type="video/mp4">
- <source src="../static/content/tabs_scrolly.webm" type="video/webm">
- <source src="../static/content/tabs_scrolly.ogv" type="video/ogg">
- </video>
- <div class="figure-caption">
- Scrolling tabs in Android Market.
- <div class="video-instructions"> </div>
- </div>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Fixed tabs</h4>
-<p><em>Fixed tabs</em> are always visible on the screen, and can't be moved out of the way like scrollable
-tabs. Fixed tabs in the main action bar can move to the top bar when the screen orientation changes.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/action_bar_pattern_default_tabs.png">
- <div class="figure-caption">
- Default fixed tabs shown in Holo Dark & Light.
- </div>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Spinners</h4>
-<p>A <em>spinner</em> is a drop-down menu that allows users to switch between views of your app. </p>
-<p><strong>Use spinners rather than tabs in the main action bar if</strong>:</p>
-<ul>
-<li>You don't want to give up the vertical screen real estate for a dedicated tab bar.</li>
-<li>You expect your app's users to switch views infrequently.</li>
-</ul>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/action_bar_pattern_spinner.png">
- <div class="figure-caption">
- Action bar spinner from Calendar application.
- </div>
-
- </div>
-</div>
-
-<h4>Action buttons</h4>
-<p><em>Action buttons</em> on the action bar surface your app's most important activities. Think about which
-buttons will get used most often, and order them accordingly. Depending on available screen real
-estate, the system shows your most important actions as action buttons and moves the rest to the
-action overflow. The action bar and the action overflow should only present actions to the user that
-are available. If an action is unavailable in the current context, hide it. Do not show it as
-disabled.</p>
-
-<img src="../static/content/action_bar_pattern_action_icons.png">
-<div class="figure-caption">
- A sampling of action buttons used throughout the Gmail application.
-</div>
-
-<p>For guidance on prioritizing actions, use the FIT scheme.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
-<p><strong>F — Frequent</strong></p>
-<ul>
-<li>Will people use this action at least 7 out of 10 times they visit the screen?</li>
-<li>Will they typically use it several times in a row?</li>
-<li>Would taking an extra step every time truly be burdensome?</li>
-</ul>
-
- </div>
- <div class="layout-content-col span-4">
-
-<p><strong>I — Important</strong></p>
-<ul>
-<li>Do you want everyone to discover this action because it's especially cool or a selling point?</li>
-<li>Is it something that needs to be effortless in the rare cases it's needed?</li>
-</ul>
-
- </div>
- <div class="layout-content-col span-4">
-
-<p><strong>T — Typical</strong></p>
-<ul>
-<li>Is it typically presented as a first-class action in similar apps?</li>
-<li>Given the context, would people be surprised if it were buried in the action overflow?</li>
-</ul>
-
- </div>
-</div>
-
-<p>If either F, I, or T apply, then it's appropriate for the action bar. Otherwise, it belongs in the
-action overflow.</p>
-
-<p>
-
-Pre-defined glyphs should be used for certain common actions such as "refresh" and "share." The
-download link below provides a package with icons that are scaled for various screen densities and
-are suitable for use with the Holo Light and Holo Dark themes. The package also includes unstyled
-icons that you can modify to match your theme, in addition to Adobe® Illustrator® source
-files for further customization.
-
-</p>
-<p>
-
-<a href="https://dl-ssl.google.com/android/design/Android_Design_Icons_20120229.zip">Download the Action Bar Icon Pack</a>
-
-</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Action overflow</h4>
-<p>The action overflow in the action bar provides access to your app's less frequently used actions.
-The overflow icon only appears on phones that have no menu hardware keys. Phones with menu keys
-display the action overflow when the user presses the key.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/action_bar_pattern_overflow.png">
- <div class="figure-caption">
- Action overflow is pinned to the right side.
- </div>
-
- </div>
-</div>
-
-<p>How many actions will fit in the main action bar? Action bar capacity is controlled by the following
-rules:</p>
-<ul>
-<li>Action buttons in the main action bar may not occupy more than 50% of the bar's width. Action
- buttons on bottom action bars can use the entire width.</li>
-<li>The screen width in density-independent pixels
- (<acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym>)
- determine the number of items that will fit in the main action bar:<ul>
-<li>smaller than 360 dp = 2 icons</li>
-<li>360-499 dp = 3 icons</li>
-<li>500-599 dp = 4 icons</li>
-<li>600 dp and larger = 5 icons</li>
-</ul>
-</li>
-</ul>
-
-<img src="../static/content/action_bar_pattern_table.png">
-<div class="figure-caption">
- In the above table "o" denotes an action bar item and "=" an overflow icon.
-</div>
-
-<h4>Sharing data</h4>
-<p>Whenever your app permits sharing of data, such as images or movie clips, use a <em>share action
-provider</em> in your action bar. The share action provider is designed to speed up sharing by
-displaying the most recently used sharing service next to a spinner button that contains other
-sharing options.</p>
-
-<img src="../static/content/action_bar_pattern_share_pack.png">
-<div class="figure-caption">
- The Gallery app's share action provider with extended spinner for additional sharing options.
-</div>
-
-<h2 id="checklist">Action Bar Checklist</h2>
-
-<p>When planning your split action bars, ask yourself questions like these:</p>
-<h4>How important is view navigation to the task?</h4>
-<p>If view navigation is very important to your app, use tabs (for fastest view-switching) or spinners.</p>
-<h4>Which of the app's actions need to be consistently available directly from the action bar, and which can be moved to the action overflow?</h4>
-<p>Use the <acronym title="Frequent, Important or Typical">FIT</acronym> scheme to decide if actions
-are displayed at the top-level or can be moved to the action overflow. If the number of top-level
-actions exceeds the capacity of the main action bar, display them separately in a bottom action bar.</p>
-<h4>What else is important enough to warrant continuous display?</h4>
-<p>Sometimes it is important to display contextual information for your app that's always visible.
-Examples are the number of unread messages in a messaging inbox view or the Now Playing information
-in a music player. Carefully plan which important information you would like to display and
-structure your action bars accordingly.</p>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/actionbar.jd b/docs/html/design/patterns/actionbar.jd
new file mode 100644
index 0000000..9e3f48c
--- /dev/null
+++ b/docs/html/design/patterns/actionbar.jd
@@ -0,0 +1,354 @@
+page.title=Action Bar
+@jd:body
+
+<img src="{@docRoot}design/media/action_bar_pattern_overview.png">
+
+<p>The <em>action bar</em> is arguably the most important structural element of an Android app. It's a
+dedicated piece of real estate at the top of each screen that is generally persistent throughout the
+app.</p>
+<p><strong>The main purpose of the action bar is to</strong>:</p>
+<ul>
+<li>Make important actions (such as <em>New</em> or <em>Search</em>, etc) prominent and accessible in a predictable
+ way.</li>
+<li>Support consistent navigation and view switching within apps.</li>
+<li>Reduce clutter by providing an action overflow for rarely used actions.</li>
+<li>Provide a dedicated space for giving your app an identity.</li>
+</ul>
+<p>If you're new to writing Android apps, note that the action bar is one of the most important design
+elements you can implement. Following the guidelines described here will go a long way toward making
+your app's interface consistent with the core Android apps.</p>
+<h2 id="organization">General Organization</h2>
+
+<p>The action bar is split into four different functional areas that apply to most apps.</p>
+<img src="{@docRoot}design/media/action_bar_basics.png">
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7 with-callouts">
+
+ <ol>
+ <li class="value-1"><h4>App icon</h4>
+ <p>
+
+The app icon establishes your app's identity. It can be replaced with a different logo or branding
+if you wish.
+Important: If the app is currently not displaying the top-level screen, be sure to display the Up
+caret to the left of the app icon, so the user can navigate up the hierarchy. For more discussion of
+Up navigation, see the <a href="{@docRoot}design/patterns/navigation.html">Navigation</a> pattern.
+
+<div class="figure">
+ <img src="{@docRoot}design/media/action_bar_pattern_up_app_icon.png">
+ <div class="figure-caption">
+ App icon with and without "up" affordance.
+ </div>
+</div>
+
+ </p>
+ </li>
+ </ol>
+
+ </div>
+ <div class="layout-content-col span-6 with-callouts">
+
+ <ol>
+ <li class="value-2"><h4>View control</h4>
+ <p>
+
+If your app displays data in different views, this segment of the action bar allows users to switch
+views. Examples of view-switching controls are drop-down menus or tab controls.
+
+ </p>
+ <p>
+
+If your app doesn't support different views, you can also use this space to display non-interactive
+content, such as an app title or longer branding information.
+
+ </p>
+ </li>
+ <li class="value-3"><h4>Action buttons</h4>
+ <p>
+
+Show the most important actions of your app in the actions section. Actions that don't fit in the
+action bar are moved automatically to the action overflow.
+
+ </p>
+ </li>
+ <li class="value-4"><h4>Action overflow</h4>
+ <p>
+
+Move less often used actions to the action overflow.
+
+ </p>
+ </li>
+ </ol>
+ </div>
+</div>
+
+<h2 id="adapting-rotation">Adapting to Rotation and Different Screen Sizes</h2>
+
+<p>One of the most important UI issues to consider when creating an app is how to adjust to screen
+rotation on different screen sizes.</p>
+<p>You can adapt to such changes by using <em>split action bars</em>, which allow you to distribute action bar
+content across multiple bars located below the main action bar or at the bottom of the screen.</p>
+
+<img src="{@docRoot}design/media/action_bar_pattern_rotation.png">
+<div class="figure-caption">
+ Split action bar showing action buttons at the bottom of the screen in vertical orientation.
+</div>
+
+<h2 id="considerations-split-action-bars">Layout Considerations for Split Action Bars</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8 with-callouts">
+
+<p>When splitting up content across multiple action bars, you generally have three possible locations
+for action bar content:</p>
+<ol>
+<li><strong>Main action bar</strong></li>
+<li><strong>Top bar</strong></li>
+<li><strong>Bottom bar</strong></li>
+</ol>
+<p>If the user can navigate up the hierarchy from a given screen, the main action bar contains the up
+caret, at a minimum.</p>
+<p>To allow the user to quickly switch between the views your app provides, use tabs or a spinner in
+the top bar.</p>
+<p>To display actions and, if necessary, the action overflow, use the bottom bar.</p>
+
+ </div>
+ <div class="layout-content-col span-3">
+
+ <img src="{@docRoot}design/media/action_bar_pattern_considerations.png">
+
+ </div>
+</div>
+
+<h2 id="contextual">Contextual Action Bars</h2>
+
+<p>A <em>contextual action bar (CAB)</em> is a temporary action bar that overlays the app's action bar for the
+duration of a particular sub-task. CABs are most typically used for tasks that involve acting on
+selected data or text.</p>
+
+<img src="{@docRoot}design/media/action_bar_cab.png">
+<div class="figure-caption">
+ Contextual action bar shown in Browser and Gmail
+</div>
+
+<p>The selection CAB appears after a long press on a selectable data item triggers selection mode.</p>
+<p><strong>From here the user can</strong>:</p>
+<ul>
+<li>Select additional elements by touching them.</li>
+<li>Trigger an action from the CAB that applies to all selected data items. The CAB then
+ automatically dismisses itself.</li>
+<li>Dismiss the CAB via the navigation bar's Back button or the CAB's checkmark button. This removes
+ the CAB along with all selection highlights.</li>
+</ul>
+<p>Use CABs whenever you allow the user to select data via long press. You can control the action
+content of a CAB in order to insert the actions you would like the user to be able to perform.</p>
+<p>For more information, refer to the "Selection" pattern.</p>
+<h2 id="elements">Action Bar Elements</h2>
+
+<h4>Tabs</h4>
+<p><em>Tabs</em> display app views concurrently and make it easy to explore and switch between them. Use tabs
+if you expect your users to switch views frequently.</p>
+
+<img src="{@docRoot}design/media/tabs_youtube.png">
+
+<p>There are two types of tabs: fixed and scrollable.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Scrollable tabs</h4>
+<p><em>Scrollable tabs</em> always take up the entire width of the bar, with the currently active view item in
+the center, and therefore need to live in a dedicated bar. Scrollable tabs can themselves be
+scrolled horizontally to bring more tabs into view.</p>
+<p>Use scrollable tabs if you have a large number of views or if you're unsure how many views will be
+displayed because your app inserts views dynamically (for example, open chats in a messaging app
+that the user can navigate between). Scrollable tabs should always allow the user to navigate
+between the views by swiping left or right on the content area as well as swiping the tabs
+themselves.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <video width="400" class="with-shadow play-on-hover" autoplay>
+ <source src="{@docRoot}design/media/tabs_scrolly.mp4" type="video/mp4">
+ <source src="{@docRoot}design/media/tabs_scrolly.webm" type="video/webm">
+ <source src="{@docRoot}design/media/tabs_scrolly.ogv" type="video/ogg">
+ </video>
+ <div class="figure-caption">
+ Scrolling tabs in Google Play.
+ <div class="video-instructions"> </div>
+ </div>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Fixed tabs</h4>
+<p><em>Fixed tabs</em> are always visible on the screen, and can't be moved out of the way like scrollable
+tabs. Fixed tabs in the main action bar can move to the top bar when the screen orientation changes.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/action_bar_pattern_default_tabs.png">
+ <div class="figure-caption">
+ Default fixed tabs shown in Holo Dark & Light.
+ </div>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Spinners</h4>
+<p>A <em>spinner</em> is a drop-down menu that allows users to switch between views of your app. </p>
+<p><strong>Use spinners rather than tabs in the main action bar if</strong>:</p>
+<ul>
+<li>You don't want to give up the vertical screen real estate for a dedicated tab bar.</li>
+<li>You expect your app's users to switch views infrequently.</li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/action_bar_pattern_spinner.png">
+ <div class="figure-caption">
+ Action bar spinner from Calendar application.
+ </div>
+
+ </div>
+</div>
+
+<h4>Action buttons</h4>
+<p><em>Action buttons</em> on the action bar surface your app's most important activities. Think about which
+buttons will get used most often, and order them accordingly. Depending on available screen real
+estate, the system shows your most important actions as action buttons and moves the rest to the
+action overflow. The action bar and the action overflow should only present actions to the user that
+are available. If an action is unavailable in the current context, hide it. Do not show it as
+disabled.</p>
+
+<img src="{@docRoot}design/media/action_bar_pattern_action_icons.png">
+<div class="figure-caption">
+ A sampling of action buttons used throughout the Gmail application.
+</div>
+
+<p>For guidance on prioritizing actions, use the FIT scheme.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+<p><strong>F — Frequent</strong></p>
+<ul>
+<li>Will people use this action at least 7 out of 10 times they visit the screen?</li>
+<li>Will they typically use it several times in a row?</li>
+<li>Would taking an extra step every time truly be burdensome?</li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<p><strong>I — Important</strong></p>
+<ul>
+<li>Do you want everyone to discover this action because it's especially cool or a selling point?</li>
+<li>Is it something that needs to be effortless in the rare cases it's needed?</li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<p><strong>T — Typical</strong></p>
+<ul>
+<li>Is it typically presented as a first-class action in similar apps?</li>
+<li>Given the context, would people be surprised if it were buried in the action overflow?</li>
+</ul>
+
+ </div>
+</div>
+
+<p>If either F, I, or T apply, then it's appropriate for the action bar. Otherwise, it belongs in the
+action overflow.</p>
+
+<p>
+
+Pre-defined glyphs should be used for certain common actions such as "refresh" and "share." The
+download link below provides a package with icons that are scaled for various screen densities and
+are suitable for use with the Holo Light and Holo Dark themes. The package also includes unstyled
+icons that you can modify to match your theme, in addition to Adobe® Illustrator® source
+files for further customization.
+
+</p>
+<p>
+
+<a href="https://dl-ssl.google.com/android/design/Android_Design_Icons_20120229.zip">Download the Action Bar Icon Pack</a>
+
+</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Action overflow</h4>
+<p>The action overflow in the action bar provides access to your app's less frequently used actions.
+The overflow icon only appears on phones that have no menu hardware keys. Phones with menu keys
+display the action overflow when the user presses the key.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/action_bar_pattern_overflow.png">
+ <div class="figure-caption">
+ Action overflow is pinned to the right side.
+ </div>
+
+ </div>
+</div>
+
+<p>How many actions will fit in the main action bar? Action bar capacity is controlled by the following
+rules:</p>
+<ul>
+<li>Action buttons in the main action bar may not occupy more than 50% of the bar's width. Action
+ buttons on bottom action bars can use the entire width.</li>
+<li>The screen width in density-independent pixels
+ (<acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym>)
+ determine the number of items that will fit in the main action bar:<ul>
+<li>smaller than 360 dp = 2 icons</li>
+<li>360-499 dp = 3 icons</li>
+<li>500-599 dp = 4 icons</li>
+<li>600 dp and larger = 5 icons</li>
+</ul>
+</li>
+</ul>
+
+<img src="{@docRoot}design/media/action_bar_pattern_table.png">
+<div class="figure-caption">
+ In the above table "o" denotes an action bar item and "=" an overflow icon.
+</div>
+
+<h4>Sharing data</h4>
+<p>Whenever your app permits sharing of data, such as images or movie clips, use a <em>share action
+provider</em> in your action bar. The share action provider is designed to speed up sharing by
+displaying the most recently used sharing service next to a spinner button that contains other
+sharing options.</p>
+
+<img src="{@docRoot}design/media/action_bar_pattern_share_pack.png">
+<div class="figure-caption">
+ The Gallery app's share action provider with extended spinner for additional sharing options.
+</div>
+
+<h2 id="checklist">Action Bar Checklist</h2>
+
+<p>When planning your split action bars, ask yourself questions like these:</p>
+<h4>How important is view navigation to the task?</h4>
+<p>If view navigation is very important to your app, use tabs (for fastest view-switching) or spinners.</p>
+<h4>Which of the app's actions need to be consistently available directly from the action bar, and which can be moved to the action overflow?</h4>
+<p>Use the <acronym title="Frequent, Important or Typical">FIT</acronym> scheme to decide if actions
+are displayed at the top-level or can be moved to the action overflow. If the number of top-level
+actions exceeds the capacity of the main action bar, display them separately in a bottom action bar.</p>
+<h4>What else is important enough to warrant continuous display?</h4>
+<p>Sometimes it is important to display contextual information for your app that's always visible.
+Examples are the number of unread messages in a messaging inbox view or the Now Playing information
+in a music player. Carefully plan which important information you would like to display and
+structure your action bars accordingly.</p>
diff --git a/docs/html/design/patterns/app-structure.html b/docs/html/design/patterns/app-structure.html
deleted file mode 100644
index 1b48280..0000000
--- a/docs/html/design/patterns/app-structure.html
+++ /dev/null
@@ -1,411 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Application Structure
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Application Structure</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Apps come in many varieties that address very different needs. For example:</p>
-<ul>
-<li>Apps such as Calculator or Camera that are built around a single focused activity handled from a
- single screen</li>
-<li>Apps such as Phone whose main purpose is to switch between different activities without deeper
- navigation</li>
-<li>Apps such as Gmail or Market that combine a broad set of data views with deep navigation</li>
-</ul>
-<p>Your app's structure depends largely on the content and tasks you want to surface for your users.</p>
-<h2 id="general-structure">General Structure</h2>
-
-<p>A typical Android app consists of top level and detail/edit views. If the navigation hierarchy is
-deep and complex, category views connect top level and detail views.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-9">
-
- <img src="../static/content/app_structure_overview.png">
-
- </div>
- <div class="layout-content-col span-4">
-
-<h4>Top level views</h4>
-<p>The top level of the app typically consists of the different views that your app supports. The views
-either show different representations of the same data or expose an altogether different functional
-facet of your app.</p>
-<div class="vspace size-3"> </div>
-
-<h4>Category views</h4>
-<p>Category views allow you to drill deeper into your data.</p>
-<div class="vspace size-11"> </div>
-
-<h4>Detail/edit view</h4>
-<p>The detail/edit view is where you consume or create data.</p>
-
- </div>
-</div>
-
-<h2 id="top-level">Top Level</h2>
-
-<p>The layout of your start screen requires special attention. This is the first screen people see
-after launching your app, so it should be an equally rewarding experience for new and frequent
-visitors alike.</p>
-<p>Ask yourself: "What are my typical users most likely going to want to do in my app?", and structure
-your start screen experience accordingly.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Put content forward</h4>
-<p>Many apps focus on the content display. Avoid navigation-only screens and instead let people get to
-the meat of your app right away by making content the centerpiece of your start screen. Choose
-layouts that are visually engaging and appropriate for the data type and screen size.</p>
-
- </div>
- <div class="layout-content-col span-8">
-
- <img src="../static/content/app_structure_market.png">
- <div class="figure-caption">
- Market's start screen primarily allows navigation into the stores for Apps, Music, Books,
- Movies and Games. It is also enriched with tailored recommendations and promotions that
- surface content of interest to the user. Search is readily available from the action bar.
- </div>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Set up action bars for navigation and actions</h4>
-<p>All screens in your app should display action bars to provide consistent navigation and surface
-important actions.</p>
-<p>At the top level, special considerations apply to the action bar:</p>
-<ul>
-<li>Use the action bar to display your app's icon or title.</li>
-<li>If your top level consists of multiple views, or if switching between data from different user
- accounts is a significant use case, make sure that it's easy for the user to navigate between them
- by adding view controls to your action bar.</li>
-<li>If your app allows people to create content, consider making the content accessible right from the
- top level.</li>
-<li>If your content is searchable, include the Search action in the action bar so people can cut
- through the navigation hierarchy.</li>
-</ul>
-
- </div>
- <div class="layout-content-col span-8">
-
- <img src="../static/content/app_structure_gmail.png">
- <div class="figure-caption">
- Email is about productivity, so an efficient, easy-to-skim list with higher data density works
- well. Navigation supports switching between accounts and recent labels. Icons for creating a
- new message or searching are prominent in the split action bar at the bottom.
- </div>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Create an identity for your app</h4>
-<p>Creating an identity for your app goes beyond the action bar. Your app communicates its identity
-through its data, the way that data is arranged, and how people interact with it. Especially for
-media-rich applications, try to create unique layouts that showcase your data and go beyond the
-monotony of simple list views.</p>
-
- </div>
- <div class="layout-content-col span-8">
-
- <img src="../static/content/app_structure_music_lndscp.png">
- <div class="figure-caption">
- The 3D carousel celebrates cover art and establishes a unique identity for the Music app.
- Defaulting to the Recent view keeps the focus on music the user has been listening to lately.
- </div>
-
- </div>
-</div>
-
-<h2 id="categories">Categories</h2>
-
-<p>Generally, the purpose of a deep, data-driven app is to navigate through organizational categories
-to the detail level, where data can be viewed and managed. Minimize perceived navigation effort by
-keeping your apps shallow.</p>
-<p>Even though the number of vertical navigation steps from the top level down to the detail views is
-typically dictated by the structure of your app's content, there are several ways you can cut down
-on the perception of onerous navigation.</p>
-<h4>Use tabs to combine category selection and data display</h4>
-<p>This can be successful if the categories are familiar or the number of categories is small. It has
-the advantage that a level of hierarchy is removed and data remains at the center of the user's
-attention. Navigating laterally between data-rich categories is more akin to a casual browsing
-experience than to an explicit navigation step.</p>
-
-<div class="vspace size-1"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8">
-
-<p>If the categories are familiar, predictable, or closely related, use scrolling tabs (where not all
-items are in view simultaneously). Keep the number of scrolling tabs at a manageable level to
-minimize navigational effort. Rule of thumb: no more than 5–7 tabs.</p>
-
- <img src="../static/content/app_structure_scrolltabs.png">
- <div class="figure-caption">
- Market uses tabs to simultaneously show category choice and content. To navigate between
- categories, users can swipe left/right on the content.
- </div>
-
- </div>
- <div class="layout-content-col span-5">
-
-<p>If the categories in the tabs are not closely related, favor fixed tabs, so that all categories are
-in view at the same time.</p>
-
- <img src="../static/content/app_structure_fixedtabs.png">
- <div class="figure-caption">
- YouTube uses fixed tabs to switch between different, relatively unrelated functional areas.
- </div>
-
-
- </div>
-</div>
-
-<h4>Allow cutting through hierarchies</h4>
-<p>Take advantage of shortcuts that allow people to reach their goals quicker. To allow top-level
-invocation of actions for a data item from within list or grid views, display prominent actions
-directly on list view items using drop-downs or split list items. This lets people invoke actions on
-data without having to navigate all the way down the hierarchy.</p>
-
-<img src="../static/content/app_structure_shortcut_on_item.png">
-<div class="figure-caption">
- Music allows the user to act upon a data item (song) from within the category view (album),
- thereby removing the need to navigate all the way down to the song's detail view.
-</div>
-
-<h4>Acting upon multiple data items</h4>
-<p>Even though category views mostly serve to guide people to content detail, keep in mind that there
-are often good reasons to act on collections of data as well.</p>
-<p>For example, if you allow people to delete an item in a detail view, you should also allow them to
-delete multiple items in the category view. Analyze which detail view actions are applicable to
-collections of items. Then use multi-select to allow application of those actions to multiple items
-in a category view.</p>
-<h2 id="details">Details</h2>
-
-<p>The detail view allows you to view and act on your data. The layout of the detail view depends on
-the data type being displayed, and therefore differs widely among apps.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
-<h4>Layout</h4>
-<p>Consider the activities people will perform in the detail view and arrange the layout accordingly.
-For immersive content, make use of the lights-out mode to allow for distraction-free viewing of
-full-screen content.</p>
-
- <img src="../static/content/app_structure_people_detail.png">
-
- </div>
- <div class="layout-content-col span-9">
-
- <img src="../static/content/app_structure_book_detail_page_flip.png">
- <div class="figure-caption">
- Google Books' detail view is all about replicating the experience of reading an actual book.
- The page-flip animation reinforces that notion. To create an immersive experience the app
- enters lights-out mode, which hides all system UI affordances.
- </div>
-
- <div class="figure-caption">
- The purpose of the People app's detail view is to surface communication options. The list view
- allows for efficient scanning and quick access of phone numbers, email addresses and other
- information items. Split items are used to combine calling and messaging into one compact line
- item.
- </div>
- </div>
-</div>
-
-<h4>Make navigation between detail views efficient</h4>
-<p>If your users are likely to want to look at multiple items in sequence, allow them to navigate
-between items from within the detail view. Use swipe views or other techniques, such as filmstrips,
-to achieve this.</p>
-
-<img src="../static/content/app_structure_gmail_swipe.png">
-<div class="figure-caption">
- Gmail using swipe views to navigate from detail view to detail view.
-</div>
-
-<img src="../static/content/app_structure_gallery_filmstrip.png">
-<div class="figure-caption">
- In addition to supporting swipe gestures to move left or right through images, Gallery provides a
- filmstrip control that lets people quickly jump to specific images.
-</div>
-
-<h2 id="checklist">Checklist</h2>
-
-<ul>
-<li>
-<p>Find ways to display useful content on your start screen.</p>
-</li>
-<li>
-<p>Use action bars to provide consistent navigation.</p>
-</li>
-<li>
-<p>Keep your hierarchies shallow by using horizontal navigation and shortcuts.</p>
-</li>
-<li>
-<p>Use multi-select to allow the user to act on collections of data.</p>
-</li>
-<li>
-<p>Allow for quick navigation between detail items with swipe views.</p>
-</li>
-</ul>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/app-structure.jd b/docs/html/design/patterns/app-structure.jd
new file mode 100644
index 0000000..b54b12f
--- /dev/null
+++ b/docs/html/design/patterns/app-structure.jd
@@ -0,0 +1,254 @@
+page.title=Application Structure
+@jd:body
+
+<p>Apps come in many varieties that address very different needs. For example:</p>
+<ul>
+<li>Apps such as Calculator or Camera that are built around a single focused activity handled from a
+ single screen</li>
+<li>Apps such as Phone whose main purpose is to switch between different activities without deeper
+ navigation</li>
+<li>Apps such as Gmail or Google Play that combine a broad set of data views with deep navigation</li>
+</ul>
+<p>Your app's structure depends largely on the content and tasks you want to surface for your users.</p>
+<h2 id="general-structure">General Structure</h2>
+
+<p>A typical Android app consists of top level and detail/edit views. If the navigation hierarchy is
+deep and complex, category views connect top level and detail views.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-9">
+
+ <img src="{@docRoot}design/media/app_structure_overview.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<h4>Top level views</h4>
+<p>The top level of the app typically consists of the different views that your app supports. The views
+either show different representations of the same data or expose an altogether different functional
+facet of your app.</p>
+<div class="vspace size-3"> </div>
+
+<h4>Category views</h4>
+<p>Category views allow you to drill deeper into your data.</p>
+<div class="vspace size-11"> </div>
+
+<h4>Detail/edit view</h4>
+<p>The detail/edit view is where you consume or create data.</p>
+
+ </div>
+</div>
+
+<h2 id="top-level">Top Level</h2>
+
+<p>The layout of your start screen requires special attention. This is the first screen people see
+after launching your app, so it should be an equally rewarding experience for new and frequent
+visitors alike.</p>
+<p>Ask yourself: "What are my typical users most likely going to want to do in my app?", and structure
+your start screen experience accordingly.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Put content forward</h4>
+<p>Many apps focus on the content display. Avoid navigation-only screens and instead let people get to
+the meat of your app right away by making content the centerpiece of your start screen. Choose
+layouts that are visually engaging and appropriate for the data type and screen size.</p>
+
+ </div>
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/app_structure_market.png">
+ <div class="figure-caption">
+ The Google Play app's start screen primarily allows navigation into the stores for Apps, Music, Books,
+ Movies and Games. It is also enriched with tailored recommendations and promotions that
+ surface content of interest to the user. Search is readily available from the action bar.
+ </div>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Set up action bars for navigation and actions</h4>
+<p>All screens in your app should display action bars to provide consistent navigation and surface
+important actions.</p>
+<p>At the top level, special considerations apply to the action bar:</p>
+<ul>
+<li>Use the action bar to display your app's icon or title.</li>
+<li>If your top level consists of multiple views, or if switching between data from different user
+ accounts is a significant use case, make sure that it's easy for the user to navigate between them
+ by adding view controls to your action bar.</li>
+<li>If your app allows people to create content, consider making the content accessible right from the
+ top level.</li>
+<li>If your content is searchable, include the Search action in the action bar so people can cut
+ through the navigation hierarchy.</li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/app_structure_gmail.png">
+ <div class="figure-caption">
+ Email is about productivity, so an efficient, easy-to-skim list with higher data density works
+ well. Navigation supports switching between accounts and recent labels. Icons for creating a
+ new message or searching are prominent in the split action bar at the bottom.
+ </div>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Create an identity for your app</h4>
+<p>Creating an identity for your app goes beyond the action bar. Your app communicates its identity
+through its data, the way that data is arranged, and how people interact with it. Especially for
+media-rich applications, try to create unique layouts that showcase your data and go beyond the
+monotony of simple list views.</p>
+
+ </div>
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/app_structure_music_lndscp.png">
+ <div class="figure-caption">
+ The 3D carousel celebrates cover art and establishes a unique identity for the Music app.
+ Defaulting to the Recent view keeps the focus on music the user has been listening to lately.
+ </div>
+
+ </div>
+</div>
+
+<h2 id="categories">Categories</h2>
+
+<p>Generally, the purpose of a deep, data-driven app is to navigate through organizational categories
+to the detail level, where data can be viewed and managed. Minimize perceived navigation effort by
+keeping your apps shallow.</p>
+<p>Even though the number of vertical navigation steps from the top level down to the detail views is
+typically dictated by the structure of your app's content, there are several ways you can cut down
+on the perception of onerous navigation.</p>
+<h4>Use tabs to combine category selection and data display</h4>
+<p>This can be successful if the categories are familiar or the number of categories is small. It has
+the advantage that a level of hierarchy is removed and data remains at the center of the user's
+attention. Navigating laterally between data-rich categories is more akin to a casual browsing
+experience than to an explicit navigation step.</p>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8">
+
+<p>If the categories are familiar, predictable, or closely related, use scrolling tabs (where not all
+items are in view simultaneously). Keep the number of scrolling tabs at a manageable level to
+minimize navigational effort. Rule of thumb: no more than 5–7 tabs.</p>
+
+ <img src="{@docRoot}design/media/app_structure_scrolltabs.png">
+ <div class="figure-caption">
+ Google Play uses tabs to simultaneously show category choice and content. To navigate between
+ categories, users can swipe left/right on the content.
+ </div>
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<p>If the categories in the tabs are not closely related, favor fixed tabs, so that all categories are
+in view at the same time.</p>
+
+ <img src="{@docRoot}design/media/app_structure_fixedtabs.png">
+ <div class="figure-caption">
+ YouTube uses fixed tabs to switch between different, relatively unrelated functional areas.
+ </div>
+
+
+ </div>
+</div>
+
+<h4>Allow cutting through hierarchies</h4>
+<p>Take advantage of shortcuts that allow people to reach their goals quicker. To allow top-level
+invocation of actions for a data item from within list or grid views, display prominent actions
+directly on list view items using drop-downs or split list items. This lets people invoke actions on
+data without having to navigate all the way down the hierarchy.</p>
+
+<img src="{@docRoot}design/media/app_structure_shortcut_on_item.png">
+<div class="figure-caption">
+ Music allows the user to act upon a data item (song) from within the category view (album),
+ thereby removing the need to navigate all the way down to the song's detail view.
+</div>
+
+<h4>Acting upon multiple data items</h4>
+<p>Even though category views mostly serve to guide people to content detail, keep in mind that there
+are often good reasons to act on collections of data as well.</p>
+<p>For example, if you allow people to delete an item in a detail view, you should also allow them to
+delete multiple items in the category view. Analyze which detail view actions are applicable to
+collections of items. Then use multi-select to allow application of those actions to multiple items
+in a category view.</p>
+<h2 id="details">Details</h2>
+
+<p>The detail view allows you to view and act on your data. The layout of the detail view depends on
+the data type being displayed, and therefore differs widely among apps.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+<h4>Layout</h4>
+<p>Consider the activities people will perform in the detail view and arrange the layout accordingly.
+For immersive content, make use of the lights-out mode to allow for distraction-free viewing of
+full-screen content.</p>
+
+ <img src="{@docRoot}design/media/app_structure_people_detail.png">
+
+ </div>
+ <div class="layout-content-col span-9">
+
+ <img src="{@docRoot}design/media/app_structure_book_detail_page_flip.png">
+ <div class="figure-caption">
+ Google Books' detail view is all about replicating the experience of reading an actual book.
+ The page-flip animation reinforces that notion. To create an immersive experience the app
+ enters lights-out mode, which hides all system UI affordances.
+ </div>
+
+ <div class="figure-caption">
+ The purpose of the People app's detail view is to surface communication options. The list view
+ allows for efficient scanning and quick access of phone numbers, email addresses and other
+ information items. Split items are used to combine calling and messaging into one compact line
+ item.
+ </div>
+ </div>
+</div>
+
+<h4>Make navigation between detail views efficient</h4>
+<p>If your users are likely to want to look at multiple items in sequence, allow them to navigate
+between items from within the detail view. Use swipe views or other techniques, such as filmstrips,
+to achieve this.</p>
+
+<img src="{@docRoot}design/media/app_structure_gmail_swipe.png">
+<div class="figure-caption">
+ Gmail using swipe views to navigate from detail view to detail view.
+</div>
+
+<img src="{@docRoot}design/media/app_structure_gallery_filmstrip.png">
+<div class="figure-caption">
+ In addition to supporting swipe gestures to move left or right through images, Gallery provides a
+ filmstrip control that lets people quickly jump to specific images.
+</div>
+
+<h2 id="checklist">Checklist</h2>
+
+<ul>
+<li>
+<p>Find ways to display useful content on your start screen.</p>
+</li>
+<li>
+<p>Use action bars to provide consistent navigation.</p>
+</li>
+<li>
+<p>Keep your hierarchies shallow by using horizontal navigation and shortcuts.</p>
+</li>
+<li>
+<p>Use multi-select to allow the user to act on collections of data.</p>
+</li>
+<li>
+<p>Allow for quick navigation between detail items with swipe views.</p>
+</li>
+</ul>
diff --git a/docs/html/design/patterns/compatibility.html b/docs/html/design/patterns/compatibility.html
deleted file mode 100644
index d6e59f5..0000000
--- a/docs/html/design/patterns/compatibility.html
+++ /dev/null
@@ -1,218 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Backwards Compatibility
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Backwards Compatibility</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Significant changes in Android 3.0 included:</p>
-<ul>
-<li>Deprecation of navigation hardware keys (Back, Menu, Search, Home) in favor of handling navigation
- via virtual controls (Back, Home, Recents).</li>
-<li>Robust pattern for the use of menus in action bars.</li>
-</ul>
-<p>Android 4.0 brings these changes for tablets to the phone platform.</p>
-
-<h2 id="older-hardware">Adapting Android 4.0 to Older Hardware and Apps</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Phones with virtual navigation controls</h4>
-<p>Android apps written for Android 3.0 and later display actions in the action bar. Actions that don't
-fit in the action bar or aren't important enough to be displayed at the top level appear in the
-action overflow.</p>
-<p>Users access the action overflow by touching it in the action bar.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/compatibility_virtual_nav.png">
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Phones with physical navigation keys</h4>
-<p>Android phones with traditional navigation hardware keys don't display the virtual navigation bar at
-the bottom of the screen. Instead, the action overflow is available from the menu hardware key. The
-resulting actions popup has the same style as in the previous example, but is displayed at the bottom of the screen.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/compatibility_physical_buttons.png">
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Legacy apps on phones with virtual navigation controls</h4>
-<p>When you run an app that was built for Android 2.3 or earlier on a phone with virtual navigation
-controls, an action overflow control appears at the right side of the virtual navigation bar. You
-can touch the control to display the app's actions in the traditional Android menu styling.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/compatibility_legacy_apps.png">
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/compatibility.jd b/docs/html/design/patterns/compatibility.jd
new file mode 100644
index 0000000..84ae337
--- /dev/null
+++ b/docs/html/design/patterns/compatibility.jd
@@ -0,0 +1,61 @@
+page.title=Backwards Compatibility
+@jd:body
+
+<p>Significant changes in Android 3.0 included:</p>
+<ul>
+<li>Deprecation of navigation hardware keys (Back, Menu, Search, Home) in favor of handling navigation
+ via virtual controls (Back, Home, Recents).</li>
+<li>Robust pattern for the use of menus in action bars.</li>
+</ul>
+<p>Android 4.0 brings these changes for tablets to the phone platform.</p>
+
+<h2 id="older-hardware">Adapting Android 4.0 to Older Hardware and Apps</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Phones with virtual navigation controls</h4>
+<p>Android apps written for Android 3.0 and later display actions in the action bar. Actions that don't
+fit in the action bar or aren't important enough to be displayed at the top level appear in the
+action overflow.</p>
+<p>Users access the action overflow by touching it in the action bar.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/compatibility_virtual_nav.png">
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Phones with physical navigation keys</h4>
+<p>Android phones with traditional navigation hardware keys don't display the virtual navigation bar at
+the bottom of the screen. Instead, the action overflow is available from the menu hardware key. The
+resulting actions popup has the same style as in the previous example, but is displayed at the bottom of the screen.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/compatibility_physical_buttons.png">
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Legacy apps on phones with virtual navigation controls</h4>
+<p>When you run an app that was built for Android 2.3 or earlier on a phone with virtual navigation
+controls, an action overflow control appears at the right side of the virtual navigation bar. You
+can touch the control to display the app's actions in the traditional Android menu styling.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/compatibility_legacy_apps.png">
+
+ </div>
+</div>
diff --git a/docs/html/design/patterns/gestures.html b/docs/html/design/patterns/gestures.html
deleted file mode 100644
index c88817f..0000000
--- a/docs/html/design/patterns/gestures.html
+++ /dev/null
@@ -1,272 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Gestures
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Gestures</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Gestures allow users to interact with your app by manipulating the screen objects you provide. The
-following table shows the core gesture set that is supported in Android.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/gesture_touch.png">
-
-<h4>Touch</h4>
-<p>Triggers the default functionality for a given item.</p>
-
-<ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Press, lift</p></li>
-</ul>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/gesture_longtouch.png">
-
-<h4>Long press</h4>
-<p>Enters data selection mode. Allows you to select one or more items in a view and act upon
- the data using a contextual action bar. Avoid using long press for showing contextual menus.</p>
-
-<ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Press, wait, lift</p></li>
-</ul>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/gesture_swipe.png">
-
-<h4>Swipe</h4>
-<p>Scrolls overflowing content, or navigates between views in the same hierarchy.</p>
-
-<ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Press, move, lift</p></li>
-</ul>
-
- </div>
-</div>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/gesture_drag.png">
-
-<h4>Drag</h4>
-<p>Rearranges data within a view, or moves data into a container (e.g. folders on Home Screen).</p>
-
-<ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Long press, move, lift</p></li>
-</ul>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/gesture_doubletouch.png">
-
-<h4>Double touch</h4>
-<p>Zooms into content. Also used as a secondary gesture for text selection.</p>
-
-<ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Two touches in quick succession</p></li>
-</ul>
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/gesture_pinchopen.png">
-
-<h4>Pinch open</h4>
-<p>Zooms into content.</p>
-
-<ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>2-finger press, move outwards, lift</p></li>
-</ul>
-
- </div>
-</div>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/gesture_pinchclose.png">
-
-<h4>Pinch close</h4>
-<p>Zooms out of content.</p>
-
-<ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>2-finger press, move inwards, lift</p></li>
-</ul>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/gestures.jd b/docs/html/design/patterns/gestures.jd
new file mode 100644
index 0000000..9868df2
--- /dev/null
+++ b/docs/html/design/patterns/gestures.jd
@@ -0,0 +1,115 @@
+page.title=Gestures
+@jd:body
+
+<p>Gestures allow users to interact with your app by manipulating the screen objects you provide. The
+following table shows the core gesture set that is supported in Android.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/gesture_touch.png">
+
+<h4>Touch</h4>
+<p>Triggers the default functionality for a given item.</p>
+
+<ul>
+ <li class="no-bullet with-icon action">
+ <h4>Action</h4>
+ <p>Press, lift</p></li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/gesture_longtouch.png">
+
+<h4>Long press</h4>
+<p>Enters data selection mode. Allows you to select one or more items in a view and act upon
+ the data using a contextual action bar. Avoid using long press for showing contextual menus.</p>
+
+<ul>
+ <li class="no-bullet with-icon action">
+ <h4>Action</h4>
+ <p>Press, wait, lift</p></li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/gesture_swipe.png">
+
+<h4>Swipe</h4>
+<p>Scrolls overflowing content, or navigates between views in the same hierarchy.</p>
+
+<ul>
+ <li class="no-bullet with-icon action">
+ <h4>Action</h4>
+ <p>Press, move, lift</p></li>
+</ul>
+
+ </div>
+</div>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/gesture_drag.png">
+
+<h4>Drag</h4>
+<p>Rearranges data within a view, or moves data into a container (e.g. folders on Home Screen).</p>
+
+<ul>
+ <li class="no-bullet with-icon action">
+ <h4>Action</h4>
+ <p>Long press, move, lift</p></li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/gesture_doubletouch.png">
+
+<h4>Double touch</h4>
+<p>Zooms into content. Also used as a secondary gesture for text selection.</p>
+
+<ul>
+ <li class="no-bullet with-icon action">
+ <h4>Action</h4>
+ <p>Two touches in quick succession</p></li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/gesture_pinchopen.png">
+
+<h4>Pinch open</h4>
+<p>Zooms into content.</p>
+
+<ul>
+ <li class="no-bullet with-icon action">
+ <h4>Action</h4>
+ <p>2-finger press, move outwards, lift</p></li>
+</ul>
+
+ </div>
+</div>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/gesture_pinchclose.png">
+
+<h4>Pinch close</h4>
+<p>Zooms out of content.</p>
+
+<ul>
+ <li class="no-bullet with-icon action">
+ <h4>Action</h4>
+ <p>2-finger press, move inwards, lift</p></li>
+</ul>
+
+ </div>
+</div>
diff --git a/docs/html/design/patterns/index.html b/docs/html/design/patterns/index.html
deleted file mode 100644
index 863baa9..0000000
--- a/docs/html/design/patterns/index.html
+++ /dev/null
@@ -1,175 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Design Patterns
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
-<style>
-#landing-graphic-container {
- position: relative;
-}
-
-#text-overlay {
- position: absolute;
- left: 10px;
- top: 492px;
- width: 200px;
-}
-</style>
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
-<div class="layout-content-row content-header just-links">
- <div class="layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
-</div>
-
-
-
-
-<div id="landing-graphic-container">
- <div id="text-overlay">
- Design apps that behave in a consistent, predictable fashion.
- <br><br>
- <a href="../patterns/new-4-0.html" class="landing-page-link">New in Android 4.0</a>
- </div>
-
- <a href="../patterns/new-4-0.html">
- <img src="../static/content/patterns_landing.png">
- </a>
-</div>
-
-
-
-
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/index.jd b/docs/html/design/patterns/index.jd
new file mode 100644
index 0000000..732e4db
--- /dev/null
+++ b/docs/html/design/patterns/index.jd
@@ -0,0 +1,29 @@
+page.title=Patterns
+header.justLinks=1
+footer.hide=1
+@jd:body
+
+<style>
+#landing-graphic-container {
+ position: relative;
+}
+
+#text-overlay {
+ position: absolute;
+ left: 10px;
+ top: 492px;
+ width: 200px;
+}
+</style>
+
+<div id="landing-graphic-container">
+ <div id="text-overlay">
+ Design apps that behave in a consistent, predictable fashion.
+ <br><br>
+ <a href="{@docRoot}design/patterns/new-4-0.html" class="landing-page-link">New in Android 4.0</a>
+ </div>
+
+ <a href="{@docRoot}design/patterns/new-4-0.html">
+ <img src="{@docRoot}design/media/patterns_landing.png">
+ </a>
+</div>
diff --git a/docs/html/design/patterns/multi-pane-layouts.html b/docs/html/design/patterns/multi-pane-layouts.html
deleted file mode 100644
index 7925c98..0000000
--- a/docs/html/design/patterns/multi-pane-layouts.html
+++ /dev/null
@@ -1,267 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Multi-pane Layouts
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Multi-pane Layouts</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>When writing an app for Android, keep in mind that Android devices come in many different screen
-sizes and types. Make sure that your app consistently provides a balanced and aesthetically pleasing
-layout by adjusting its content to varying screen sizes and orientations.</p>
-<p><em>Panels</em> are a great way for your app to achieve this. They allow you to combine multiple views into
-one compound view when a lot of horizontal screen real estate is available and by splitting them up
-when less space is available.</p>
-<h2 id="combining-views">Combining Multiple Views Into One</h2>
-
-<p>On smaller devices your content is typically divided into a master grid or list view and a detail
-view. Touching an item in the master view opens a different screen showing that item's detail
-information.</p>
-
-<img src="../static/content/multipane_views.png">
-
-<p>Because tablets have more screen real estate than phones, you can use panels to combine the related
-list and detail views into a single compound view. This uses the additional space more efficiently
-and makes navigating the app easier. </p>
-
-<img src="../static/content/multipane_view_tablet.png">
-
-<p>In general, use the pane on the right to present more information about the item you selected in the
-left pane. Make sure to keep the item in the left pane selected in order to establish the
-relationship between the panels.</p>
-<h2 id="orientation">Compound Views and Orientation Changes</h2>
-
-<p>Screens should have the same functionality regardless of orientation. If you use a compound view in
-one orientation, don't split it up when the user rotates the screen. There are several techniques
-you can use to adjust the layout after orientation change while keeping functional parity intact.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8">
-
- <img src="../static/content/multipane_stretch.png">
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Stretch/compress</h4>
-<p>Adjust the column width of your left pane to achieve a balanced layout in both orientations.</p>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8">
-
- <img src="../static/content/multipane_stack.png">
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Stack</h4>
-<p>Rearrange the panels on your screen to match the orientation.</p>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8">
-
- <img src="../static/content/multipane_expand.png">
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Expand/collapse</h4>
-<p>When the device rotates, collapse the left pane view to only show the most important information.
-Provide an <em>expand</em> control that allows the user to bring the left pane content back to its original
-width and vice versa.</p>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8">
-
- <img src="../static/content/multipane_show.png">
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Show/hide</h4>
-<p>After rotating the device, show the right pane in fullscreen view. Use the Up icon in the action bar
-to show the left panel and allow navigation to a different email. Hide the left panel by touching
-the content in the detail panel.</p>
-
- </div>
-</div>
-
-<h2 id="checklist">Checklist</h2>
-
-<ul>
-<li>
-<p>Plan in advance on how your app scales to different screen sizes and screen orientations.</p>
-</li>
-<li>
-<p>Identify the most appropriate method for the panels in your compound views to reorganize
- themselves when screen orientation changes.</p>
-</li>
-<li>
-<p>Look for opportunities to consolidate your views into multi-panel compound views.</p>
-</li>
-<li>
-<p>Make sure that your screens provide functional parity after the screen orientation
- changes.</p>
-</li>
-</ul>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/multi-pane-layouts.jd b/docs/html/design/patterns/multi-pane-layouts.jd
new file mode 100644
index 0000000..0e63e32
--- /dev/null
+++ b/docs/html/design/patterns/multi-pane-layouts.jd
@@ -0,0 +1,110 @@
+page.title=Multi-pane Layouts
+@jd:body
+
+<p>When writing an app for Android, keep in mind that Android devices come in many different screen
+sizes and types. Make sure that your app consistently provides a balanced and aesthetically pleasing
+layout by adjusting its content to varying screen sizes and orientations.</p>
+<p><em>Panels</em> are a great way for your app to achieve this. They allow you to combine multiple views into
+one compound view when a lot of horizontal screen real estate is available and by splitting them up
+when less space is available.</p>
+<h2 id="combining-views">Combining Multiple Views Into One</h2>
+
+<p>On smaller devices your content is typically divided into a master grid or list view and a detail
+view. Touching an item in the master view opens a different screen showing that item's detail
+information.</p>
+
+<img src="{@docRoot}design/media/multipane_views.png">
+
+<p>Because tablets have more screen real estate than phones, you can use panels to combine the related
+list and detail views into a single compound view. This uses the additional space more efficiently
+and makes navigating the app easier. </p>
+
+<img src="{@docRoot}design/media/multipane_view_tablet.png">
+
+<p>In general, use the pane on the right to present more information about the item you selected in the
+left pane. Make sure to keep the item in the left pane selected in order to establish the
+relationship between the panels.</p>
+<h2 id="orientation">Compound Views and Orientation Changes</h2>
+
+<p>Screens should have the same functionality regardless of orientation. If you use a compound view in
+one orientation, don't split it up when the user rotates the screen. There are several techniques
+you can use to adjust the layout after orientation change while keeping functional parity intact.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/multipane_stretch.png">
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Stretch/compress</h4>
+<p>Adjust the column width of your left pane to achieve a balanced layout in both orientations.</p>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/multipane_stack.png">
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Stack</h4>
+<p>Rearrange the panels on your screen to match the orientation.</p>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/multipane_expand.png">
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Expand/collapse</h4>
+<p>When the device rotates, collapse the left pane view to only show the most important information.
+Provide an <em>expand</em> control that allows the user to bring the left pane content back to its original
+width and vice versa.</p>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/multipane_show.png">
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Show/hide</h4>
+<p>After rotating the device, show the right pane in fullscreen view. Use the Up icon in the action bar
+to show the left panel and allow navigation to a different email. Hide the left panel by touching
+the content in the detail panel.</p>
+
+ </div>
+</div>
+
+<h2 id="checklist">Checklist</h2>
+
+<ul>
+<li>
+<p>Plan in advance on how your app scales to different screen sizes and screen orientations.</p>
+</li>
+<li>
+<p>Identify the most appropriate method for the panels in your compound views to reorganize
+ themselves when screen orientation changes.</p>
+</li>
+<li>
+<p>Look for opportunities to consolidate your views into multi-panel compound views.</p>
+</li>
+<li>
+<p>Make sure that your screens provide functional parity after the screen orientation
+ changes.</p>
+</li>
+</ul>
diff --git a/docs/html/design/patterns/navigation.html b/docs/html/design/patterns/navigation.html
deleted file mode 100644
index 6287b5e..0000000
--- a/docs/html/design/patterns/navigation.html
+++ /dev/null
@@ -1,275 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Navigation with Back and Up
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Navigation with Back and Up</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Consistent navigation is an essential component of the overall user experience. Few things frustrate
-users more than basic navigation that behaves in inconsistent and unexpected ways. Android 3.0
-introduced significant changes to the global navigation behavior. Thoughtfully following the
-guidelines for Back and Up will make your app's navigation predictable and reliable for your users.</p>
-<p>Android 2.3 and earlier relied upon the system <em>Back</em> button for supporting navigation within an
-app. With the introduction of action bars in Android 3.0, a second navigation mechanism appeared:
-the <em>Up</em> button, consisting of the app icon and a left-point caret.</p>
-
-<img src="../static/content/navigation_with_back_and_up.png">
-
-<h2 id="up-vs-back">Up vs. Back</h2>
-
-<p>The Up button is used to navigate within an application based on the hierarchical relationships
-between screens. For instance, if screen A displays a list of items, and selecting an item leads to
-screen B (which presents that item in more detail), then screen B should offer an Up button that
-returns to screen A.</p>
-<p>If a screen is the topmost one in an app (i.e. the home of the app), it should not present an Up
-button.</p>
-<p>The system Back key is used to navigate based on the history of screens the user has recently seen,
-in reverse chronological order—in effect, the temporal relationships between screens.</p>
-<p>When the previously viewed screen is also the hierarchical parent of the current screen, pressing
-the Back key will have the same result as pressing an Up button -- this is a common occurrence.
-However, unlike the Up button, which ensures the user remains within your app, the Back key can
-return the user to the Home screen, or even to a different application.</p>
-
-<img src="../static/content/navigation_up_vs_back_gmail.png">
-
-<p>The Back key also supports a few behaviors not directly tied to screen-to-screen navigation:</p>
-<ul>
-<li>Back dismisses floating windows (dialogs, popups)</li>
-<li>Back dismisses contextual action bars, and removes the highlight from the selected items</li>
-<li>Back hides the onscreen keyboard (IME)</li>
-</ul>
-<h2 id="within-app">Navigation Within Your App</h2>
-
-<h4>Navigating to screens with multiple entry points</h4>
-<p>Sometimes a screen doesn't have a strict position within the app's hierarchy, and can be reached
-from multiple entry points—e.g., a settings screen which can be navigated to from any screen
-in your app. In this case, the Up button should choose to return to the referring screen, behaving
-identically to Back.</p>
-<h4>Changing view within a screen</h4>
-<p>Changing view options for a screen does not change the behavior of Up or Back: the screen is still
-in the same place within the app's hierarchy, and no new navigation history is created.</p>
-<p>Examples of such view changes are:</p>
-<ul>
-<li>Switching views using tabs and/or left-and-right swipes</li>
-<li>Switching views using a dropdown (aka collapsed tabs)</li>
-<li>Filtering a list</li>
-<li>Sorting a list</li>
-<li>Changing display characteristics (e.g. zooming)</li>
-</ul>
-<h4>Navigating between sibling screens</h4>
-<p>When your app supports navigation from a list of items to a detail view of one of those items, it's
-often desirable to support direction navigation from that item to another one which precedes or
-follows it in the list. For example, in Gmail, it's easy to swipe left or right from a conversation
-to view a newer or older one in the same Inbox. Just as when changing view within a screen, such
-navigation does not change the behavior of Up or Back.</p>
-
-<img src="../static/content/navigation_between_siblings_gmail.png">
-
-<p>However, a notable exception to this occurs when browsing between "related" detail views not tied
-together by the referring list—for example, when browsing in the Market between apps from
-the same developer, or albums by the same artist. In these cases, following each link does create
-history, causing the Back button to step through each screen of related content which has been
-viewed. Up should continue to bypass these related screens and navigate to the most recently viewed
-container screen.</p>
-
-<img src="../static/content/navigation_between_siblings_market1.png">
-
-<p>You have the ability to make the Up behavior even smarter based on your knowledge of detail
-view. If we extend our Market sample from above, imagine the user has navigated from the last Book
-viewed to the details for the Movie adaptation. In that case, Up can return to a container (Movies)
-which the user had not previously navigated through.</p>
-
-<img src="../static/content/navigation_between_siblings_market2.png">
-
-<h2 id="from-outside">Navigation From Outside Your App</h2>
-
-<p>There are two categories of navigation from outside your app to screens deep within the app's
-hierarchy:</p>
-<ul>
-<li>App-to-app navigation, such as via intent completion.</li>
-<li>System-to-app navigation, such as via notifications and home screen widgets.</li>
-</ul>
-<p>Gmail provides examples of each of these. For app-to-app navigation, a "Share" intent goes directly
-to the compose screen. For system-to-app navigation, both a new message notification and a home
-screen widget can bypass the Inbox screen, taking the user directly to a conversation view.</p>
-<h4>App-to-app navigation</h4>
-<p>When navigating deep into your app's hierarchy directly from another app via an intent, Back will
-return to the referring app.</p>
-<p>The Up button is handled as follows:
-- If the destination screen is typically reached from one particular screen within your app, Up
- should navigate to that screen.
-- Otherwise, Up should navigate to the topmost ("Home") screen of your app.</p>
-<p>For example, after choosing to share a book being viewed in Market, the user navigates directly to
-Gmail's compose screen. From there, Up returns to the Inbox (which happens to be both the
-typical referrer to compose, as well as the topmost screen of the app), while Back returns to
-Market.</p>
-
-<img src="../static/content/navigation_from_outside_up.png">
-
-<h4>System-to-app navigation</h4>
-<p>If your app was reached via the system mechanisms of notifications or home screen widgets, Up
-behaves as described for app-to-app navigation, above.</p>
-<p>For the Back key, you should make navigation more predictably by inserting into the task's back
-stack the complete upward navigation path to the app's topmost screen. This way, a user who has
-forgotten how they entered your app can safely navigate to the app's topmost screen before exiting
-it.</p>
-<p>For example, Gmail's Home screen widget has a button for diving directly to its compose screen.
-After following that path, the Back key first returns to the Inbox, and from there continues to
-Home.</p>
-
-<img src="../static/content/navigation_from_outside_back.png">
-
-
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/navigation.jd b/docs/html/design/patterns/navigation.jd
new file mode 100644
index 0000000..d35cd82
--- /dev/null
+++ b/docs/html/design/patterns/navigation.jd
@@ -0,0 +1,116 @@
+page.title=Navigation with Back and Up
+@jd:body
+
+<p>Consistent navigation is an essential component of the overall user experience. Few things frustrate
+users more than basic navigation that behaves in inconsistent and unexpected ways. Android 3.0
+introduced significant changes to the global navigation behavior. Thoughtfully following the
+guidelines for Back and Up will make your app's navigation predictable and reliable for your users.</p>
+<p>Android 2.3 and earlier relied upon the system <em>Back</em> button for supporting navigation within an
+app. With the introduction of action bars in Android 3.0, a second navigation mechanism appeared:
+the <em>Up</em> button, consisting of the app icon and a left-point caret.</p>
+
+<img src="{@docRoot}design/media/navigation_with_back_and_up.png">
+
+<h2 id="up-vs-back">Up vs. Back</h2>
+
+<p>The Up button is used to navigate within an application based on the hierarchical relationships
+between screens. For instance, if screen A displays a list of items, and selecting an item leads to
+screen B (which presents that item in more detail), then screen B should offer an Up button that
+returns to screen A.</p>
+<p>If a screen is the topmost one in an app (i.e. the home of the app), it should not present an Up
+button.</p>
+<p>The system Back key is used to navigate based on the history of screens the user has recently seen,
+in reverse chronological order—in effect, the temporal relationships between screens.</p>
+<p>When the previously viewed screen is also the hierarchical parent of the current screen, pressing
+the Back key will have the same result as pressing an Up button -- this is a common occurrence.
+However, unlike the Up button, which ensures the user remains within your app, the Back key can
+return the user to the Home screen, or even to a different application.</p>
+
+<img src="{@docRoot}design/media/navigation_up_vs_back_gmail.png">
+
+<p>The Back key also supports a few behaviors not directly tied to screen-to-screen navigation:</p>
+<ul>
+<li>Back dismisses floating windows (dialogs, popups)</li>
+<li>Back dismisses contextual action bars, and removes the highlight from the selected items</li>
+<li>Back hides the onscreen keyboard (IME)</li>
+</ul>
+<h2 id="within-app">Navigation Within Your App</h2>
+
+<h4>Navigating to screens with multiple entry points</h4>
+<p>Sometimes a screen doesn't have a strict position within the app's hierarchy, and can be reached
+from multiple entry points—e.g., a settings screen which can be navigated to from any screen
+in your app. In this case, the Up button should choose to return to the referring screen, behaving
+identically to Back.</p>
+<h4>Changing view within a screen</h4>
+<p>Changing view options for a screen does not change the behavior of Up or Back: the screen is still
+in the same place within the app's hierarchy, and no new navigation history is created.</p>
+<p>Examples of such view changes are:</p>
+<ul>
+<li>Switching views using tabs and/or left-and-right swipes</li>
+<li>Switching views using a dropdown (aka collapsed tabs)</li>
+<li>Filtering a list</li>
+<li>Sorting a list</li>
+<li>Changing display characteristics (e.g. zooming)</li>
+</ul>
+<h4>Navigating between sibling screens</h4>
+<p>When your app supports navigation from a list of items to a detail view of one of those items, it's
+often desirable to support direction navigation from that item to another one which precedes or
+follows it in the list. For example, in Gmail, it's easy to swipe left or right from a conversation
+to view a newer or older one in the same Inbox. Just as when changing view within a screen, such
+navigation does not change the behavior of Up or Back.</p>
+
+<img src="{@docRoot}design/media/navigation_between_siblings_gmail.png">
+
+<p>However, a notable exception to this occurs when browsing between "related" detail views not tied
+together by the referring list—for example, when browsing on Google Play between apps from
+the same developer, or albums by the same artist. In these cases, following each link does create
+history, causing the Back button to step through each screen of related content which has been
+viewed. Up should continue to bypass these related screens and navigate to the most recently viewed
+container screen.</p>
+
+<img src="{@docRoot}design/media/navigation_between_siblings_market1.png">
+
+<p>You have the ability to make the Up behavior even smarter based on your knowledge of detail
+view. If we extend our Google Play sample from above, imagine the user has navigated from the last Book
+viewed to the details for the Movie adaptation. In that case, Up can return to a container (Movies)
+which the user had not previously navigated through.</p>
+
+<img src="{@docRoot}design/media/navigation_between_siblings_market2.png">
+
+<h2 id="from-outside">Navigation From Outside Your App</h2>
+
+<p>There are two categories of navigation from outside your app to screens deep within the app's
+hierarchy:</p>
+<ul>
+<li>App-to-app navigation, such as via intent completion.</li>
+<li>System-to-app navigation, such as via notifications and home screen widgets.</li>
+</ul>
+<p>Gmail provides examples of each of these. For app-to-app navigation, a "Share" intent goes directly
+to the compose screen. For system-to-app navigation, both a new message notification and a home
+screen widget can bypass the Inbox screen, taking the user directly to a conversation view.</p>
+<h4>App-to-app navigation</h4>
+<p>When navigating deep into your app's hierarchy directly from another app via an intent, Back will
+return to the referring app.</p>
+<p>The Up button is handled as follows:
+- If the destination screen is typically reached from one particular screen within your app, Up
+ should navigate to that screen.
+- Otherwise, Up should navigate to the topmost ("Home") screen of your app.</p>
+<p>For example, after choosing to share a book being viewed on Google Play, the user navigates directly to
+Gmail's compose screen. From there, Up returns to the Inbox (which happens to be both the
+typical referrer to compose, as well as the topmost screen of the app), while Back returns to
+Google Play.</p>
+
+<img src="{@docRoot}design/media/navigation_from_outside_up.png">
+
+<h4>System-to-app navigation</h4>
+<p>If your app was reached via the system mechanisms of notifications or home screen widgets, Up
+behaves as described for app-to-app navigation, above.</p>
+<p>For the Back key, you should make navigation more predictably by inserting into the task's back
+stack the complete upward navigation path to the app's topmost screen. This way, a user who has
+forgotten how they entered your app can safely navigate to the app's topmost screen before exiting
+it.</p>
+<p>For example, Gmail's Home screen widget has a button for diving directly to its compose screen.
+After following that path, the Back key first returns to the Inbox, and from there continues to
+Home.</p>
+
+<img src="{@docRoot}design/media/navigation_from_outside_back.png">
diff --git a/docs/html/design/patterns/new-4-0.html b/docs/html/design/patterns/new-4-0.html
deleted file mode 100644
index 2e2cbc2..0000000
--- a/docs/html/design/patterns/new-4-0.html
+++ /dev/null
@@ -1,228 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - New in Android 4.0
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>New in Android 4.0</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Navigation bar</h4>
-<p>Android 4.0 removes the need for traditional hardware keys on phones by replacing them with a
-virtual navigation bar that houses the Back, Home and Recents buttons. Read the
-<a href="../patterns/compatibility.html">Compatibility</a> pattern to learn how the OS adapts to
-phones with hardware buttons and how pre-Android 3.0 apps that rely on menu keys are supported.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/whats_new_nav_bar.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Action bar</h4>
-<p>The action bar is the most important structural element of an Android app. It provides consistent
-navigation across the platform and allows your app to surface actions.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/whats_new_action_bar.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Multi-pane layouts</h4>
-<p>Creating apps that scale well across different form factors and screen sizes is important in the
-Android world. Multi-pane layouts allow you to combine different activities that show separately on
-smaller devices into richer compound views for tablets.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/whats_new_multipanel.png">
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Selection</h4>
-<p>The long press gesture which was traditionally used to show contextual actions for objects is now
-used for data selection. When selecting data, contextual action bars allow you to surface actions.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/whats_new_multiselect.png">
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/new-4-0.jd b/docs/html/design/patterns/new-4-0.jd
new file mode 100644
index 0000000..91ebba7
--- /dev/null
+++ b/docs/html/design/patterns/new-4-0.jd
@@ -0,0 +1,71 @@
+page.title=New in Android 4.0
+@jd:body
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Navigation bar</h4>
+<p>Android 4.0 removes the need for traditional hardware keys on phones by replacing them with a
+virtual navigation bar that houses the Back, Home and Recents buttons. Read the
+<a href="{@docRoot}design/patterns/compatibility.html">Compatibility</a> pattern to learn how the OS adapts to
+phones with hardware buttons and how pre-Android 3.0 apps that rely on menu keys are supported.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/whats_new_nav_bar.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Action bar</h4>
+<p>The action bar is the most important structural element of an Android app. It provides consistent
+navigation across the platform and allows your app to surface actions.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/whats_new_action_bar.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Multi-pane layouts</h4>
+<p>Creating apps that scale well across different form factors and screen sizes is important in the
+Android world. Multi-pane layouts allow you to combine different activities that show separately on
+smaller devices into richer compound views for tablets.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/whats_new_multipanel.png">
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Selection</h4>
+<p>The long press gesture which was traditionally used to show contextual actions for objects is now
+used for data selection. When selecting data, contextual action bars allow you to surface actions.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/whats_new_multiselect.png">
+
+ </div>
+</div>
diff --git a/docs/html/design/patterns/notifications.html b/docs/html/design/patterns/notifications.html
deleted file mode 100644
index 99af418..0000000
--- a/docs/html/design/patterns/notifications.html
+++ /dev/null
@@ -1,394 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Notifications
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Notifications</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>The notification system allows your app to keep the user informed about important events, such as
-new messages in a chat app or a calendar event.</p>
-<p>To create an app that feels streamlined, pleasant, and respectful, it is important to design your
-notifications carefully. Notifications embody your app's voice, and contribute to your app's
-personality. Unwanted or unimportant notifications can annoy the user, so use them judiciously.</p>
-<h4>When to display a notification</h4>
-<p>To create an application that people love, it's important to recognize that the user's attention and
-focus is a resource that must be protected. To use an analogy that might resonate with software
-developers, the user is not a method that can be invoked to return a value. The user's focus is a
-resource more akin to a thread, and creating a notification momentarily blocks the user thread as
-they process and then dismiss the interruptive notification.</p>
-<p>Android's notification system has been designed to quickly inform users of events while they focus
-on a task, but it is nonetheless still important to be conscientious when deciding to create a
-notification.</p>
-<p>While well behaved apps generally only speak when spoken to, there are some limited cases where an
-app actually should interrupt the user with an unprompted notification.</p>
-<p>Notifications should be used primarily for <strong>time sensitive events</strong>, and especially if these
-synchronous events <strong>involve other people</strong>. For instance, an incoming chat is a real time and
-synchronous form of communication: there is another user actively waiting on you to respond.
-Calendar events are another good example of when to use a notification and grab the user's
-attention, because the event is imminent, and calendar events often involve other people.</p>
-
-<img src="../static/content/notifications_pattern_real_time_people.png">
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>When not to display a notification</h4>
-<p>There are however many other cases where notifications should not be used:</p>
-<ul>
-<li>
-<p>Don't notify the user of information that is not directed specifically at them, or information
-that is not truly time sensitive. For instance the asynchronous and undirected updates flowing
-through a social network do not warrant a real time interruption.</p>
-</li>
-<li>
-<p>Don't create a notification if the relevant new information is currently on screen. Instead, use
-the UI of the application itself to notify the user of new information directly in context. For
-instance, a chat application should not create system notifications while the user is actively
-chatting with another user.</p>
-</li>
-<li>
-<p>Don't interrupt the user for low level technical operations, like saving or syncing information,
-or updating an application, if it is possible for the system to simply take care of itself without
-involving the user.</p>
-</li>
-<li>
-<p>Don't interrupt the user to inform them of an error if it is possible for the application to
-quickly recover from the error on its own without the user taking any action.</p>
-</li>
-<li>
-<p>Don't use notifications for services that the user cannot manually start or stop.</p>
-</li>
-<li>
-<p>Don't create superfluous notifications just to get your brand in front of users. Such
-notifications will only frustrate and likely alienate your audience. The best way to provide the
-user with a small amount of updated information and to keep them engaged with your application is to
-develop a widget that they can choose to place on their home screen.</p>
-</li>
-</ul>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/notifications_pattern_social_fail.png">
-
- </div>
-</div>
-
-<h2 id="design-guidelines">Design Guidelines</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
- <img src="../static/content/notifications_pattern_anatomy.png">
-
- </div>
- <div class="layout-content-col span-6">
-
-<h4>Make it personal</h4>
-<p>For notifications of items sent by another user (such as a message or status update), include that
-person's image.</p>
-<p>Remember to include the app icon as a secondary icon in the notification, so that the user can
-still identify which app posted it.</p>
-
- </div>
-</div>
-
-<h4>Navigate to the right place</h4>
-<p>When the user touches a notification, be open your app to the place where the user can consume and
-act upon the data referenced in the notification. In most cases this will be the detail view of a
-single data item (e.g. a message), but it might also be a summary view if the notification is
-stacked (see <em>Stacked notifications</em> below) and references multiple items. If in any of those cases
-the user is taken to a hierarchy level below your app's top-level, insert navigation into your app's
-back stack to allow them to navigate to your app's top level using the system back key. For more
-information, see the chapter on <em>System-to-app navigation</em> in the
-<a href="../patterns/navigation.html">Navigation</a> design pattern.</p>
-<h4>Timestamps for time sensitive events</h4>
-<p>By default, standard Android notifications include a timestamp in the upper right corner. Consider
-whether the timestamp is valuable in the context of your notification. If the timestamp is not
-valuable, consider if the event is important enough to warrant grabbing the user's attention with a
-notification. If the notification is important enough, decide if you would like to opt out of
-displaying the timestamp.</p>
-<p>Include a timestamp if the user likely needs to know how long ago the notification occurred. Good
-candidates for timestamps include communication notifications (email, messaging, chat, voicemail)
-where the user may need the timestamp information to understand the context of a message or to
-tailor a response.</p>
-<h4>Stack your notifications</h4>
-<p>If your app creates a notification while another of the same type is still pending, avoid creating
-an altogether new notification object. Instead, stack the notification.</p>
-<p>A stacked notification builds a summary description and allows the user to understand how many
-notifications of a particular kind are pending.</p>
-<p><strong>Don't</strong>:</p>
-
-<img src="../static/content/notifications_pattern_additional_fail.png">
-
-<p><strong>Do</strong>:</p>
-
-<img src="../static/content/notifications_pattern_additional_win.png">
-
-<p>If you keep the summary and detail information on different screens, a stacked notification may need
-to open to a different place in the app than a single notification.</p>
-<p>For example, a single email notification should always open to the content of the email, whereas a
-stacked email notification opens to the Inbox view.</p>
-<h4>Clean up after yourself</h4>
-<p>Just like calendar events, some notifications alert the user to an event that happens at a
-particular point in time. After that moment has passed, the notification is likely not important to
-the user anymore, and you should consider removing it automatically. The same is true for active
-chat conversations or voicemail messages the user has listened to, users should not have to manually
-dismiss notifications independently from taking action on them.</p>
-
-<div class="vspace size-1"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-7">
-
-<h4>Provide a peek into your notification</h4>
-<p>You can provide a short preview of your notification's content by providing optional ticker text.
-The ticker text is shown for a short amount of time when the notification enters the system and then
-hides automatically.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/notifications_pattern_phone_ticker.png">
-
- </div>
-</div>
-
-<h4>Make notifications optional</h4>
-<p>Users should always be in control of notifications. Allow the user to silence the notifications from
-your app by adding a notification settings item to your application settings.</p>
-<h4>Use distinct icons</h4>
-<p>By glancing at the notification area, the user should be able to discern what notification types are
-currently pending.</p>
-<p><strong>Do</strong>:</p>
-<ul>
-<li>Look at the notification icons the Android apps already provide and create notification icons for
- your app that are sufficiently distinct in appearance.</li>
-</ul>
-<p><strong>Don't</strong>:</p>
-<ul>
-<li>Use color to distinguish your app from others. Notification icons should generally be monochrome.</li>
-</ul>
-
-<h2 id="interacting-with-notifications">Interacting With Notifications</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
- <img src="../static/content/notifications_pattern_phone_icons.png">
-
- </div>
- <div class="layout-content-col span-6">
-
-<p>Notifications are indicated by icons in the notification area and can be accessed by opening the
-notification drawer.</p>
-<p>Inside the drawer, notifications are chronologically sorted with the latest one on top. Touching a
-notification opens the associated app to detailed content matching the notification. Swiping left or
-right on a notification removes it from the drawer.</p>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<p>On tablets, the notification area is integrated with the system bar at the bottom of the screen. The
-notification drawer is opened by touching anywhere inside the notification area.</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/notifications_pattern_tablet.png">
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
- <img src="../static/content/notifications_pattern_ongoing_music.png">
-
- </div>
- <div class="layout-content-col span-6">
-
-<h4>Ongoing notifications</h4>
-<p>Ongoing notifications keep users informed about an ongoing process in the background. For example,
-music players announce the currently playing track in the notification system and continue to do so
-until the user stops the playback. They can also be used to show the user feedback for longer tasks
-like downloading a file, or encoding a video. Ongoing notifications cannot be manually removed from
-the notification drawer.</p>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-12">
-
-<h4>Dialogs and toasts are for feedback not notification</h4>
-<p>Your app should not create a dialog or toast if it is not currently on screen. Dialogs and Toasts
-should only be displayed as the immediate response to the user taking an action inside of your app.
-For instance, dialogs can be used to confirm that the user understands the severity of an action,
-and toasts can echo back that an action has been successfully taken.</p>
-
- </div>
-</div>
-
-<div class="vspace size-1"> </div>
-
-<img src="../static/content/notifications_pattern_dialog_toast.png">
-
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/notifications.jd b/docs/html/design/patterns/notifications.jd
new file mode 100644
index 0000000..ad88a01
--- /dev/null
+++ b/docs/html/design/patterns/notifications.jd
@@ -0,0 +1,236 @@
+page.title=Notifications
+@jd:body
+
+<p>The notification system allows your app to keep the user informed about important events, such as
+new messages in a chat app or a calendar event.</p>
+<p>To create an app that feels streamlined, pleasant, and respectful, it is important to design your
+notifications carefully. Notifications embody your app's voice, and contribute to your app's
+personality. Unwanted or unimportant notifications can annoy the user, so use them judiciously.</p>
+<h4>When to display a notification</h4>
+<p>To create an application that people love, it's important to recognize that the user's attention and
+focus is a resource that must be protected. To use an analogy that might resonate with software
+developers, the user is not a method that can be invoked to return a value. The user's focus is a
+resource more akin to a thread, and creating a notification momentarily blocks the user thread as
+they process and then dismiss the interruptive notification.</p>
+<p>Android's notification system has been designed to quickly inform users of events while they focus
+on a task, but it is nonetheless still important to be conscientious when deciding to create a
+notification.</p>
+<p>While well behaved apps generally only speak when spoken to, there are some limited cases where an
+app actually should interrupt the user with an unprompted notification.</p>
+<p>Notifications should be used primarily for <strong>time sensitive events</strong>, and especially if these
+synchronous events <strong>involve other people</strong>. For instance, an incoming chat is a real time and
+synchronous form of communication: there is another user actively waiting on you to respond.
+Calendar events are another good example of when to use a notification and grab the user's
+attention, because the event is imminent, and calendar events often involve other people.</p>
+
+<img src="{@docRoot}design/media/notifications_pattern_real_time_people.png">
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>When not to display a notification</h4>
+<p>There are however many other cases where notifications should not be used:</p>
+<ul>
+<li>
+<p>Don't notify the user of information that is not directed specifically at them, or information
+that is not truly time sensitive. For instance the asynchronous and undirected updates flowing
+through a social network do not warrant a real time interruption.</p>
+</li>
+<li>
+<p>Don't create a notification if the relevant new information is currently on screen. Instead, use
+the UI of the application itself to notify the user of new information directly in context. For
+instance, a chat application should not create system notifications while the user is actively
+chatting with another user.</p>
+</li>
+<li>
+<p>Don't interrupt the user for low level technical operations, like saving or syncing information,
+or updating an application, if it is possible for the system to simply take care of itself without
+involving the user.</p>
+</li>
+<li>
+<p>Don't interrupt the user to inform them of an error if it is possible for the application to
+quickly recover from the error on its own without the user taking any action.</p>
+</li>
+<li>
+<p>Don't use notifications for services that the user cannot manually start or stop.</p>
+</li>
+<li>
+<p>Don't create superfluous notifications just to get your brand in front of users. Such
+notifications will only frustrate and likely alienate your audience. The best way to provide the
+user with a small amount of updated information and to keep them engaged with your application is to
+develop a widget that they can choose to place on their home screen.</p>
+</li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/notifications_pattern_social_fail.png">
+
+ </div>
+</div>
+
+<h2 id="design-guidelines">Design Guidelines</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/notifications_pattern_anatomy.png">
+
+ </div>
+ <div class="layout-content-col span-6">
+
+<h4>Make it personal</h4>
+<p>For notifications of items sent by another user (such as a message or status update), include that
+person's image.</p>
+<p>Remember to include the app icon as a secondary icon in the notification, so that the user can
+still identify which app posted it.</p>
+
+ </div>
+</div>
+
+<h4>Navigate to the right place</h4>
+<p>When the user touches a notification, be open your app to the place where the user can consume and
+act upon the data referenced in the notification. In most cases this will be the detail view of a
+single data item (e.g. a message), but it might also be a summary view if the notification is
+stacked (see <em>Stacked notifications</em> below) and references multiple items. If in any of those cases
+the user is taken to a hierarchy level below your app's top-level, insert navigation into your app's
+back stack to allow them to navigate to your app's top level using the system back key. For more
+information, see the chapter on <em>System-to-app navigation</em> in the
+<a href="{@docRoot}design/patterns/navigation.html">Navigation</a> design pattern.</p>
+<h4>Timestamps for time sensitive events</h4>
+<p>By default, standard Android notifications include a timestamp in the upper right corner. Consider
+whether the timestamp is valuable in the context of your notification. If the timestamp is not
+valuable, consider if the event is important enough to warrant grabbing the user's attention with a
+notification. If the notification is important enough, decide if you would like to opt out of
+displaying the timestamp.</p>
+<p>Include a timestamp if the user likely needs to know how long ago the notification occurred. Good
+candidates for timestamps include communication notifications (email, messaging, chat, voicemail)
+where the user may need the timestamp information to understand the context of a message or to
+tailor a response.</p>
+<h4>Stack your notifications</h4>
+<p>If your app creates a notification while another of the same type is still pending, avoid creating
+an altogether new notification object. Instead, stack the notification.</p>
+<p>A stacked notification builds a summary description and allows the user to understand how many
+notifications of a particular kind are pending.</p>
+<p><strong>Don't</strong>:</p>
+
+<img src="{@docRoot}design/media/notifications_pattern_additional_fail.png">
+
+<p><strong>Do</strong>:</p>
+
+<img src="{@docRoot}design/media/notifications_pattern_additional_win.png">
+
+<p>If you keep the summary and detail information on different screens, a stacked notification may need
+to open to a different place in the app than a single notification.</p>
+<p>For example, a single email notification should always open to the content of the email, whereas a
+stacked email notification opens to the Inbox view.</p>
+<h4>Clean up after yourself</h4>
+<p>Just like calendar events, some notifications alert the user to an event that happens at a
+particular point in time. After that moment has passed, the notification is likely not important to
+the user anymore, and you should consider removing it automatically. The same is true for active
+chat conversations or voicemail messages the user has listened to, users should not have to manually
+dismiss notifications independently from taking action on them.</p>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-7">
+
+<h4>Provide a peek into your notification</h4>
+<p>You can provide a short preview of your notification's content by providing optional ticker text.
+The ticker text is shown for a short amount of time when the notification enters the system and then
+hides automatically.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/notifications_pattern_phone_ticker.png">
+
+ </div>
+</div>
+
+<h4>Make notifications optional</h4>
+<p>Users should always be in control of notifications. Allow the user to silence the notifications from
+your app by adding a notification settings item to your application settings.</p>
+<h4>Use distinct icons</h4>
+<p>By glancing at the notification area, the user should be able to discern what notification types are
+currently pending.</p>
+<p><strong>Do</strong>:</p>
+<ul>
+<li>Look at the notification icons the Android apps already provide and create notification icons for
+ your app that are sufficiently distinct in appearance.</li>
+</ul>
+<p><strong>Don't</strong>:</p>
+<ul>
+<li>Use color to distinguish your app from others. Notification icons should generally be monochrome.</li>
+</ul>
+
+<h2 id="interacting-with-notifications">Interacting With Notifications</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/notifications_pattern_phone_icons.png">
+
+ </div>
+ <div class="layout-content-col span-6">
+
+<p>Notifications are indicated by icons in the notification area and can be accessed by opening the
+notification drawer.</p>
+<p>Inside the drawer, notifications are chronologically sorted with the latest one on top. Touching a
+notification opens the associated app to detailed content matching the notification. Swiping left or
+right on a notification removes it from the drawer.</p>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<p>On tablets, the notification area is integrated with the system bar at the bottom of the screen. The
+notification drawer is opened by touching anywhere inside the notification area.</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/notifications_pattern_tablet.png">
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/notifications_pattern_ongoing_music.png">
+
+ </div>
+ <div class="layout-content-col span-6">
+
+<h4>Ongoing notifications</h4>
+<p>Ongoing notifications keep users informed about an ongoing process in the background. For example,
+music players announce the currently playing track in the notification system and continue to do so
+until the user stops the playback. They can also be used to show the user feedback for longer tasks
+like downloading a file, or encoding a video. Ongoing notifications cannot be manually removed from
+the notification drawer.</p>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-12">
+
+<h4>Dialogs and toasts are for feedback not notification</h4>
+<p>Your app should not create a dialog or toast if it is not currently on screen. Dialogs and Toasts
+should only be displayed as the immediate response to the user taking an action inside of your app.
+For instance, dialogs can be used to confirm that the user understands the severity of an action,
+and toasts can echo back that an action has been successfully taken.</p>
+
+ </div>
+</div>
+
+<div class="vspace size-1"> </div>
+
+<img src="{@docRoot}design/media/notifications_pattern_dialog_toast.png">
diff --git a/docs/html/design/patterns/pure-android.html b/docs/html/design/patterns/pure-android.html
deleted file mode 100644
index f5a8042..0000000
--- a/docs/html/design/patterns/pure-android.html
+++ /dev/null
@@ -1,292 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Pure Android
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Pure Android</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Most developers want to distribute their apps on multiple platforms. As you plan your app for
-Android, keep in mind that different platforms play by different rules and conventions. Design
-decisions that make perfect sense on one platform will look and feel misplaced in the context of a
-different platform. While a "design once, ship anywhere" approach might save you time up-front, you
-run the very real risk of creating inconsistent apps that alienate users. Consider the following
-guidelines to avoid the most common traps and pitfalls.</p>
-
-<div class="vspace size-1"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Don't mimic UI elements from other platforms</h4>
-<p>Platforms typically provide a carefully designed set of UI elements that are themed in a very
-distinctive fashion. For example, some platforms advocate rounded corners for their buttons, others
-use gradients in their title bars. In some cases, elements may have the same purpose, but are
-designed to work a bit differently.</p>
-<p>As you build your app for Android, don't carry over themed UI elements from other platforms and
-don't mimic their specific behaviors. Review the <a href="../building-
-blocks/index.html">Building Blocks</a> section in this styleguide to learn about Android's most important UI elements
-and the way they look in the system default themes. Also examine Android's platform apps to get a
-sense of how elements are applied in the context of an app. If you want to customize the theme of UI
-elements, customize carefully according to your specific branding - and not according to the
-conventions of a different platform.</p>
-
- </div>
- <div class="layout-content-col span-8">
-
- <img src="../static/content/migrating_ui_elements.png">
- <div class="figure-caption">
- Sampling of UI elements from Android, iOS and Windows Phone 7.
- </div>
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Don't carry over platform-specific icons</h4>
-<p>Platforms typically provide sets of icons for common functionality, such as sharing, creating a new
-document or deleting.</p>
-<p>As you are migrating your app to Android, please swap out platform-specific icons with their Android
-counterparts.</p>
-<p>You can find a wide variety of icons for use in your app in the Android SDK.</p>
-
- </div>
- <div class="layout-content-col span-8">
-
- <img src="../static/content/migrating_icons.png">
- <div class="figure-caption">
- Sampling of icons from Android, iOS and Windows Phone 7.
- </div>
-
- </div>
-</div>
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Don't use bottom tab bars</h4>
-<p>Other platforms use the bottom tab bar to switch between the app's views. Per platform convention,
-Android's tabs for view control are shown in action bars at the top of the screen instead. In
-addition, Android apps may use a bottom bar to display actions on a split action bar.</p>
-<p>You should follow this guideline to create a consistent experience with other apps on the Android
-platform and to avoid confusion between actions and view switching on Android.</p>
-<p>For more information on how to properly use action bars for view control, see
-<a href="../patterns/actionbar.html">Action Bars</a>.</p>
-
- </div>
- <div class="layout-content-col span-8">
-
- <img src="../static/content/migrating_ios_dialers.png">
- <div class="figure-caption">
- Android dialer with tabs in an action bar vs. bottom tabs in iOS.
- </div>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Don't use labeled back buttons on action bars</h4>
-<p>Other platforms use an explicit back button with label to allow the user to navigate up the
-application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical
-navigation and the navigation bar's back button for temporal navigation. For more information,
-please review the <a href="../patterns/navigation.html">Navigation</a> pattern.</p>
-<p>Follow this guideline to provide a consistent navigation experience across the platform.</p>
-
- </div>
- <div class="layout-content-col span-8">
-
- <img src="../static/content/migrating_ios_galleries.png">
- <div class="figure-caption">
- Android action bar with up caret vs. iOS labeled "Back" button.
- </div>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
-<h4>Don't use right-pointing carets on line items</h4>
-<p>A common pattern on other platforms is the display of right-pointing carets on line items that allow
-the user to drill deeper into additional content.</p>
-<p>Android does not use such indicators on drill-down line items. Avoid them to stay consistent with
-the platform and in order to not have the user guess as to what the meaning of those carets may be.</p>
-
- </div>
- <div class="layout-content-col span-8">
-
- <img src="../static/content/migrating_ios_settings.png">
- <div class="figure-caption">
- Android settings without right-pointing carets in line items vs. iOS settings.
- </div>
-
- </div>
-</div>
-
-<h2 id="device-independence">Device Independence</h2>
-
-<p>Remember that your app will run on a wide variety of different screen sizes. Create visual assets
-for different screen sizes and densities and make use of concepts such as multi-pane layouts to
-appropriately scale your UI on different device form factors.</p>
-<p>For more information, read <a href="../style/devices-displays.html">Devices and Displays</a> as
-well as <a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a> in this design guide.</p>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/pure-android.jd b/docs/html/design/patterns/pure-android.jd
new file mode 100644
index 0000000..8ed1347
--- /dev/null
+++ b/docs/html/design/patterns/pure-android.jd
@@ -0,0 +1,136 @@
+page.title=Pure Android
+@jd:body
+
+<p>Most developers want to distribute their apps on multiple platforms. As you plan your app for
+Android, keep in mind that different platforms play by different rules and conventions. Design
+decisions that make perfect sense on one platform will look and feel misplaced in the context of a
+different platform. While a "design once, ship anywhere" approach might save you time up-front, you
+run the very real risk of creating inconsistent apps that alienate users. Consider the following
+guidelines to avoid the most common traps and pitfalls.</p>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Don't mimic UI elements from other platforms</h4>
+<p>Platforms typically provide a carefully designed set of UI elements that are themed in a very
+distinctive fashion. For example, some platforms advocate rounded corners for their buttons, others
+use gradients in their title bars. In some cases, elements may have the same purpose, but are
+designed to work a bit differently.</p>
+<p>As you build your app for Android, don't carry over themed UI elements from other platforms and
+don't mimic their specific behaviors. Review the
+<a href="{@docRoot}design/building-blocks/index.html">Building Blocks</a>
+section in this styleguide to learn about Android's most important UI elements
+and the way they look in the system default themes. Also examine Android's platform apps to get a
+sense of how elements are applied in the context of an app. If you want to customize the theme of UI
+elements, customize carefully according to your specific branding - and not according to the
+conventions of a different platform.</p>
+
+ </div>
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/migrating_ui_elements.png">
+ <div class="figure-caption">
+ Sampling of UI elements from Android, iOS and Windows Phone 7.
+ </div>
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Don't carry over platform-specific icons</h4>
+<p>Platforms typically provide sets of icons for common functionality, such as sharing, creating a new
+document or deleting.</p>
+<p>As you are migrating your app to Android, please swap out platform-specific icons with their Android
+counterparts.</p>
+<p>You can find a wide variety of icons for use in your app in the Android SDK.</p>
+
+ </div>
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/migrating_icons.png">
+ <div class="figure-caption">
+ Sampling of icons from Android, iOS and Windows Phone 7.
+ </div>
+
+ </div>
+</div>
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Don't use bottom tab bars</h4>
+<p>Other platforms use the bottom tab bar to switch between the app's views. Per platform convention,
+Android's tabs for view control are shown in action bars at the top of the screen instead. In
+addition, Android apps may use a bottom bar to display actions on a split action bar.</p>
+<p>You should follow this guideline to create a consistent experience with other apps on the Android
+platform and to avoid confusion between actions and view switching on Android.</p>
+<p>For more information on how to properly use action bars for view control, see
+<a href="{@docRoot}design/patterns/actionbar.html">Action Bars</a>.</p>
+
+ </div>
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/migrating_ios_dialers.png">
+ <div class="figure-caption">
+ Android dialer with tabs in an action bar vs. bottom tabs in iOS.
+ </div>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Don't use labeled back buttons on action bars</h4>
+<p>Other platforms use an explicit back button with label to allow the user to navigate up the
+application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical
+navigation and the navigation bar's back button for temporal navigation. For more information,
+please review the <a href="{@docRoot}design/patterns/navigation.html">Navigation</a> pattern.</p>
+<p>Follow this guideline to provide a consistent navigation experience across the platform.</p>
+
+ </div>
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/migrating_ios_galleries.png">
+ <div class="figure-caption">
+ Android action bar with up caret vs. iOS labeled "Back" button.
+ </div>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+<h4>Don't use right-pointing carets on line items</h4>
+<p>A common pattern on other platforms is the display of right-pointing carets on line items that allow
+the user to drill deeper into additional content.</p>
+<p>Android does not use such indicators on drill-down line items. Avoid them to stay consistent with
+the platform and in order to not have the user guess as to what the meaning of those carets may be.</p>
+
+ </div>
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/migrating_ios_settings.png">
+ <div class="figure-caption">
+ Android settings without right-pointing carets in line items vs. iOS settings.
+ </div>
+
+ </div>
+</div>
+
+<h2 id="device-independence">Device Independence</h2>
+
+<p>Remember that your app will run on a wide variety of different screen sizes. Create visual assets
+for different screen sizes and densities and make use of concepts such as multi-pane layouts to
+appropriately scale your UI on different device form factors.</p>
+<p>For more information, read <a href="{@docRoot}design/style/devices-displays.html">Devices and Displays</a> as
+well as <a href="{@docRoot}design/patterns/multi-pane-layouts.html">Multi-pane Layouts</a> in this design guide.</p>
diff --git a/docs/html/design/patterns/selection.html b/docs/html/design/patterns/selection.html
deleted file mode 100644
index 44c6a84..0000000
--- a/docs/html/design/patterns/selection.html
+++ /dev/null
@@ -1,257 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Selection
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Selection</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Android 3.0 introduced the <em>long press</em> gesture—that is, a touch that's held in the same
-position for a moment—as the global gesture to select data. This affects the way you should
-handle multi-select and contextual actions in your apps.</p>
-
-<div class="vspace size-1"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>What has changed?</h4>
-<p>In previous versions of Android, the long press gesture was universally used to display contextual
-actions for a given data item in a contextual menu.</p>
-<p>This pattern changed with Android 3.0. The long press gesture is now used to select data, combining
-contextual actions and selection management functions for selected data into a new element called
-the contextual action bar (CAB).</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/selection_context_menu.png">
- <div class="figure-caption">
- Traditional use of the long press gesture to show contextual menus.
- </div>
-
- </div>
-</div>
-
-<h4>Using the contextual action bar (CAB)</h4>
-<p>The selection CAB is a temporary action bar that overlays your app's current action bar while data
-is selected. It appears after the user long presses on a selectable data item.</p>
-
-<img src="../static/content/selection_cab_big.png">
-
-<div class="vspace size-1"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<p>From here the user can:</p>
-<ul>
-<li>Select additional data items by touching them.</li>
-<li>Trigger an action from the CAB that applies to all highlighted data items. The CAB then
- automatically dismisses itself.</li>
-<li>Dismiss the CAB via the navigation bar's Back button or the CAB's checkmark button. This removes
- the CAB along with all selection highlights.</li>
-</ul>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/selection_cab_example.png">
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Selecting CAB actions</h4>
-<p>You can decide which actions and elements appear in the CAB. Use the guidelines in the <a href="actionbar.html">Action Bar
-pattern</a> to decide which items to surface at the top level and which to move to the
-action overflow.</p>
-<h4>Dynamically adjust CAB actions</h4>
-<p>In most cases you need to adjust the actions in the CAB dynamically as the user adds more items to
-the selection. Actions that apply to a single selected data item don't necessarily apply to multiple
-selected data items of the same kind.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/selection_adjusting_actions.png">
- <div class="figure-caption">
- Adjusting actions in the CAB as additional items are selected.
- </div>
-
- </div>
-</div>
-
-<h2 id="checklist">Checklist</h2>
-
-<ul>
-<li>
-<p>Whenever your app supports the selection of multiple data items, make use of the contextual action
- bar (CAB).</p>
-</li>
-<li>
-<p>Reserve the long press gesture for selection exclusively. Don't use it to display traditional
- contextual menus.</p>
-</li>
-<li>
-<p>If you don't support multi-selection within a list, long press should do nothing.</p>
-</li>
-<li>
-<p>Plan the actions you want to display inside of a CAB in the same way you would plan the actions
- inside your app's action bar.</p>
-</li>
-</ul>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/selection.jd b/docs/html/design/patterns/selection.jd
new file mode 100644
index 0000000..e3ee90e
--- /dev/null
+++ b/docs/html/design/patterns/selection.jd
@@ -0,0 +1,100 @@
+page.title=Selection
+@jd:body
+
+<p>Android 3.0 introduced the <em>long press</em> gesture—that is, a touch that's held in the same
+position for a moment—as the global gesture to select data. This affects the way you should
+handle multi-select and contextual actions in your apps.</p>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>What has changed?</h4>
+<p>In previous versions of Android, the long press gesture was universally used to display contextual
+actions for a given data item in a contextual menu.</p>
+<p>This pattern changed with Android 3.0. The long press gesture is now used to select data, combining
+contextual actions and selection management functions for selected data into a new element called
+the contextual action bar (CAB).</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/selection_context_menu.png">
+ <div class="figure-caption">
+ Traditional use of the long press gesture to show contextual menus.
+ </div>
+
+ </div>
+</div>
+
+<h4>Using the contextual action bar (CAB)</h4>
+<p>The selection CAB is a temporary action bar that overlays your app's current action bar while data
+is selected. It appears after the user long presses on a selectable data item.</p>
+
+<img src="{@docRoot}design/media/selection_cab_big.png">
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<p>From here the user can:</p>
+<ul>
+<li>Select additional data items by touching them.</li>
+<li>Trigger an action from the CAB that applies to all highlighted data items. The CAB then
+ automatically dismisses itself.</li>
+<li>Dismiss the CAB via the navigation bar's Back button or the CAB's checkmark button. This removes
+ the CAB along with all selection highlights.</li>
+</ul>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/selection_cab_example.png">
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Selecting CAB actions</h4>
+<p>You can decide which actions and elements appear in the CAB. Use the guidelines in the <a href="actionbar.html">Action Bar
+pattern</a> to decide which items to surface at the top level and which to move to the
+action overflow.</p>
+<h4>Dynamically adjust CAB actions</h4>
+<p>In most cases you need to adjust the actions in the CAB dynamically as the user adds more items to
+the selection. Actions that apply to a single selected data item don't necessarily apply to multiple
+selected data items of the same kind.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/selection_adjusting_actions.png">
+ <div class="figure-caption">
+ Adjusting actions in the CAB as additional items are selected.
+ </div>
+
+ </div>
+</div>
+
+<h2 id="checklist">Checklist</h2>
+
+<ul>
+<li>
+<p>Whenever your app supports the selection of multiple data items, make use of the contextual action
+ bar (CAB).</p>
+</li>
+<li>
+<p>Reserve the long press gesture for selection exclusively. Don't use it to display traditional
+ contextual menus.</p>
+</li>
+<li>
+<p>If you don't support multi-selection within a list, long press should do nothing.</p>
+</li>
+<li>
+<p>Plan the actions you want to display inside of a CAB in the same way you would plan the actions
+ inside your app's action bar.</p>
+</li>
+</ul>
diff --git a/docs/html/design/patterns/swipe-views.html b/docs/html/design/patterns/swipe-views.html
deleted file mode 100644
index acc9f39..0000000
--- a/docs/html/design/patterns/swipe-views.html
+++ /dev/null
@@ -1,231 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Swipe Views
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Swipe Views</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Efficient navigation is one of the cornerstones of a well-designed app. While apps are generally
-built in a hierarchical fashion, there are instances where horizontal navigation can flatten
-vertical hierarchies and make access to related data items faster and more enjoyable. Swipe views
-allow the user to efficiently move from item to item using a simple gesture and thereby make
-browsing and consuming data a more fluent experience.</p>
-<h2 id="detail-views">Swiping Between Detail Views</h2>
-
-<p>An app's data is often organized in a master/detail relationship: The user can view a list of
-related data items, such as images, chats, or emails, and then pick one of the items to see the
-detail contents in a separate screen.</p>
-
-<img src="../static/content/swipe_views.png">
-<div class="figure-caption">
- Master (left) and detail (right) views.
-</div>
-
-<p>On a phone, since the master and detail are on separate screens, this typically requires the user to
-jump back and forth between the list and the detail view, aka "pogo-sticking".</p>
-<p>In cases where users will want to view multiple detail items in succession, avoid pogo-sticking by
-using the swipe gesture to navigate to the next/previous detail view.</p>
-
-<img src="../static/content/swipe_views2.png">
-<div class="figure-caption">
- Navigating between consecutive Email messages using the swipe gesture.
-</div>
-
-<h2 id="between-tabs">Swiping Between Tabs</h2>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
- <div class="framed-galaxynexus-port-span-5">
- <video class="play-on-hover" autoplay>
- <source src="../static/content/swipe_tabs.mp4" type="video/mp4">
- <source src="../static/content/swipe_tabs.webm" type="video/webm">
- <source src="../static/content/swipe_tabs.ogv" type="video/ogg">
- </video>
- </div>
- <div class="figure-caption">
- People app with swipe gesture navigation between top-level screens.
- <div class="video-instructions"> </div>
- </div>
-
- </div>
- <div class="layout-content-col span-8">
-
-<p>If your app uses action bar tabs, use swipe to navigate between the different views.</p>
-<div class="vspace size-2"> </div>
-
-<h2 id="checklist">Checklist</h2>
-
-<ul>
-<li>
-<p>Use swipe to quickly navigate between detail views or tabs.</p>
-</li>
-<li>
-<p>Transition between the views as the user performs the swipe gesture. Do not wait for the
- gesture to complete and then transition between views.</p>
-</li>
-<li>
-<p>If you used buttons in the past for previous/next navigation, replace them with
- the swipe gesture.</p>
-</li>
-<li>
-<p>Consider adding contextual information in your detail view that informs the user about the
- relative list position of the currently visible item.</p>
-</li>
-</ul>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/patterns/swipe-views.jd b/docs/html/design/patterns/swipe-views.jd
new file mode 100644
index 0000000..95d65dd
--- /dev/null
+++ b/docs/html/design/patterns/swipe-views.jd
@@ -0,0 +1,74 @@
+page.title=Swipe Views
+@jd:body
+
+<p>Efficient navigation is one of the cornerstones of a well-designed app. While apps are generally
+built in a hierarchical fashion, there are instances where horizontal navigation can flatten
+vertical hierarchies and make access to related data items faster and more enjoyable. Swipe views
+allow the user to efficiently move from item to item using a simple gesture and thereby make
+browsing and consuming data a more fluent experience.</p>
+<h2 id="detail-views">Swiping Between Detail Views</h2>
+
+<p>An app's data is often organized in a master/detail relationship: The user can view a list of
+related data items, such as images, chats, or emails, and then pick one of the items to see the
+detail contents in a separate screen.</p>
+
+<img src="{@docRoot}design/media/swipe_views.png">
+<div class="figure-caption">
+ Master (left) and detail (right) views.
+</div>
+
+<p>On a phone, since the master and detail are on separate screens, this typically requires the user to
+jump back and forth between the list and the detail view, aka "pogo-sticking".</p>
+<p>In cases where users will want to view multiple detail items in succession, avoid pogo-sticking by
+using the swipe gesture to navigate to the next/previous detail view.</p>
+
+<img src="{@docRoot}design/media/swipe_views2.png">
+<div class="figure-caption">
+ Navigating between consecutive Email messages using the swipe gesture.
+</div>
+
+<h2 id="between-tabs">Swiping Between Tabs</h2>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+ <div class="framed-galaxynexus-port-span-5">
+ <video class="play-on-hover" autoplay>
+ <source src="{@docRoot}design/media/swipe_tabs.mp4" type="video/mp4">
+ <source src="{@docRoot}design/media/swipe_tabs.webm" type="video/webm">
+ <source src="{@docRoot}design/media/swipe_tabs.ogv" type="video/ogg">
+ </video>
+ </div>
+ <div class="figure-caption">
+ People app with swipe gesture navigation between top-level screens.
+ <div class="video-instructions"> </div>
+ </div>
+
+ </div>
+ <div class="layout-content-col span-8">
+
+<p>If your app uses action bar tabs, use swipe to navigate between the different views.</p>
+<div class="vspace size-2"> </div>
+
+<h2 id="checklist">Checklist</h2>
+
+<ul>
+<li>
+<p>Use swipe to quickly navigate between detail views or tabs.</p>
+</li>
+<li>
+<p>Transition between the views as the user performs the swipe gesture. Do not wait for the
+ gesture to complete and then transition between views.</p>
+</li>
+<li>
+<p>If you used buttons in the past for previous/next navigation, replace them with
+ the swipe gesture.</p>
+</li>
+<li>
+<p>Consider adding contextual information in your detail view that informs the user about the
+ relative list position of the currently visible item.</p>
+</li>
+</ul>
+
+ </div>
+</div>
diff --git a/docs/html/design/static/callout.png b/docs/html/design/static/callout.png
deleted file mode 100644
index 5d49f34..0000000
--- a/docs/html/design/static/callout.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/default.css b/docs/html/design/static/default.css
deleted file mode 100644
index 3aa1db3..0000000
--- a/docs/html/design/static/default.css
+++ /dev/null
@@ -1,633 +0,0 @@
-/* color definitions */
-/* 16 column layout */
-/* clearfix idiom */
-/* common mixins */
-/* page layout + top-level styles */
-::-webkit-selection,
-::-moz-selection,
-::selection {
- background-color: #0099cc;
- color: #fff; }
-
-html, body {
- height: 100%;
- margin: 0;
- padding: 0;
- background: #eee none no-repeat fixed top left;
- background-image: -webkit-gradient(linear, 100% 0%, 100% 100%, from(#dddddd), color-stop(25%, #f2f2f2), color-stop(75%, #f2f2f2), to(#dddddd));
- background-image: -moz-linear-gradient(top, #dddddd, #f2f2f2, #f2f2f2, #dddddd);
- -webkit-font-smoothing: antialiased;
- /* prevent subpixel antialiasing, which thickens the text */
- text-rendering: optimizeLegibility;
- /* opentype ftw */ }
-
-body {
- color: #555555;
- font: 14px/20px Roboto, sans-serif;
- font-weight: 400; }
-
-#page-container {
- width: 940px;
- margin: 0 40px; }
-
-#page-header {
- height: 80px;
- margin-bottom: 20px;
- font-size: 48px;
- line-height: 48px;
- font-weight: 100;
- padding-left: 10px; }
- #page-header a {
- display: block;
- position: relative;
- top: 20px;
- text-decoration: none;
- color: #555555 !important; }
-
-#main-row {
- display: inline-block; }
- #main-row:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden; }
- * html #main-row {
- height: 1px; }
-
-#page-footer {
- margin-left: 190px;
- margin-top: 80px;
- color: #999999;
- padding-bottom: 40px;
- font-size: 12px;
- line-height: 15px; }
- #page-footer a {
- color: #777777; }
- #page-footer #copyright {
- margin-bottom: 10px; }
-
-#nav {
- width: 160px;
- margin-right: 20px;
- float: left; }
-
-#content {
- width: 760px;
- float: left; }
-
-a,
-a:visited {
- color: #333333; }
-
-a:hover,
-acronym:hover {
- color: #7aa1b0 !important; }
-
-a:focus,
-a:active {
- color: #33b5e5 !important; }
-
-img {
- border: none; }
-
-ul {
- margin: 0;
- padding: 0; }
-
-strong {
- font-weight: 500; }
-
-em {
- font-style: italic; }
-
-code {
- font-family: Courier New, monospace; }
-
-acronym {
- border-bottom: 1px dotted #555555;
- cursor: help; }
-
-acronym:hover {
- border-bottom-color: #7aa1b0; }
-
-img.with-shadow,
-video.with-shadow {
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); }
-
-/* disclosures mixin */
-/* content layout */
-.layout-content-row {
- display: inline-block;
- margin-bottom: 10px; }
- .layout-content-row:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden; }
- * html .layout-content-row {
- height: 1px; }
-
-.layout-content-col {
- float: left;
- margin-left: 20px; }
- .layout-content-col:first-child {
- margin-left: 0; }
-
-.layout-content-col.span-1 {
- width: 40px; }
-
-.layout-content-col.span-2 {
- width: 100px; }
-
-.layout-content-col.span-3 {
- width: 160px; }
-
-.layout-content-col.span-4 {
- width: 220px; }
-
-.layout-content-col.span-5 {
- width: 280px; }
-
-.layout-content-col.span-6 {
- width: 340px; }
-
-.layout-content-col.span-7 {
- width: 400px; }
-
-.layout-content-col.span-8 {
- width: 460px; }
-
-.layout-content-col.span-9 {
- width: 520px; }
-
-.layout-content-col.span-10 {
- width: 580px; }
-
-.layout-content-col.span-11 {
- width: 640px; }
-
-.layout-content-col.span-12 {
- width: 700px; }
-
-.layout-content-col.span-13 {
- width: 760px; }
-
-.vspace.size-1 {
- height: 10px; }
-
-.vspace.size-2 {
- height: 20px; }
-
-.vspace.size-3 {
- height: 30px; }
-
-.vspace.size-4 {
- height: 40px; }
-
-.vspace.size-5 {
- height: 50px; }
-
-.vspace.size-6 {
- height: 60px; }
-
-.vspace.size-7 {
- height: 70px; }
-
-.vspace.size-8 {
- height: 80px; }
-
-.vspace.size-9 {
- height: 90px; }
-
-.vspace.size-10 {
- height: 100px; }
-
-.vspace.size-11 {
- height: 110px; }
-
-.vspace.size-12 {
- height: 120px; }
-
-.vspace.size-13 {
- height: 130px; }
-
-.vspace.size-14 {
- height: 140px; }
-
-.vspace.size-15 {
- height: 150px; }
-
-.vspace.size-16 {
- height: 160px; }
-
-/* nav */
-#nav {
- /* section header divs */
- /* expanded section header divs */
- /* sublinks */ }
- #nav li {
- list-style-type: none;
- font-size: 14px;
- line-height: 10px; }
- #nav a {
- color: #555555;
- text-decoration: none; }
- #nav li.selected > a,
- #nav li.selected .nav-section-header a {
- font-weight: 500;
- color: #0099cc !important; }
- #nav .nav-section-header {
- position: relative;
- padding: 10px;
- margin-bottom: 1px;
- /* section header links */ }
- #nav .nav-section-header a {
- color: #333333;
- font-weight: 500;
- text-transform: uppercase; }
- #nav .nav-section-header:after {
- content: '';
- background: transparent url(disclosure_down.png) no-repeat scroll top left;
- width: 10px;
- height: 10px;
- display: block;
- position: absolute;
- top: 10px;
- right: 10px; }
- #nav .nav-section-header.empty:after {
- display: none; }
- #nav li.expanded .nav-section-header {
- background: rgba(0, 0, 0, 0.05); }
- #nav li.expanded .nav-section-header:after {
- content: '';
- background: transparent url(disclosure_up.png) no-repeat scroll top left;
- width: 10px;
- height: 10px; }
- #nav > li > ul {
- height: 0;
- overflow: hidden;
- margin-bottom: 0; }
- #nav > li > ul.animate-height {
- -webkit-transition: height 0.25s ease-in;
- -moz-transition: height 0.25s ease-in;
- transition: height 0.25s ease-in; }
- #nav > li > ul li {
- padding: 10px 10px 11px 10px; }
- #nav > li.expanded > ul {
- height: auto; }
- #nav > li.expanded > ul li {
- background: rgba(0, 0, 0, 0.03); }
- #nav #back-dac-section {
- padding: 10px;
- border-top: 1px solid #ddd; }
- #nav #back-dac-section a {
- color: #333333;
- font-weight: 500;
- text-transform: uppercase; }
-
-/* content header */
-.content-header {
- border-bottom: 1px solid #33b5e5;
- height: 30px; }
- .content-header h2 {
- border-bottom: 0; }
- .content-header.just-links {
- border-bottom: 0; }
-
-.content-footer {
- border-top: 1px solid #33b5e5;
- margin-top: 10px;
- height: 30px; }
-
-.paging-links {
- position: relative; }
- .paging-links a {
- position: absolute;
- font-size: 14px;
- line-height: 30px;
- color: #555555;
- text-decoration: none;
- text-transform: uppercase; }
- .paging-links .prev-page-link {
- display: none;
- left: -5px; }
- .paging-links .prev-page-link:before {
- content: '';
- background: transparent url(disclosure_left.png) no-repeat scroll top left;
- width: 10px;
- height: 10px;
- display: inline-block;
- margin-right: 5px; }
- .paging-links .next-page-link {
- display: none;
- right: 10px; }
- .paging-links .next-page-link:after {
- content: '';
- background: transparent url(disclosure_right.png) no-repeat scroll top left;
- width: 10px;
- height: 10px;
- display: inline-block;
- margin-left: 5px; }
-
-/* content body */
-@-webkit-keyframes glowheader {
- from {
- background-color: #33b5e5;
- color: #000;
- border-bottom-color: #000; }
-
- to {
- background-color: transparent;
- color: #33b5e5;
- border-bottom-color: #33b5e5; } }
-
-@-moz-keyframes glowheader {
- from {
- background-color: #33b5e5;
- color: #000;
- border-bottom-color: #000; }
-
- to {
- background-color: transparent;
- color: #33b5e5;
- border-bottom-color: #33b5e5; } }
-
-@keyframes glowheader {
- from {
- background-color: #33b5e5;
- color: #000;
- border-bottom-color: #000; }
-
- to {
- background-color: transparent;
- color: #33b5e5;
- border-bottom-color: #33b5e5; } }
-
-#content p,
-#content ul,
-#content ol,
-#content h3 {
- margin: 0 10px 10px 10px; }
-#content h2 {
- padding-left: 10px;
- padding-right: 10px;
- margin-bottom: 10px;
- font-size: 16px;
- line-height: 30px;
- font-weight: 500;
- color: #33b5e5;
- border-bottom: 1px solid #33b5e5;
- height: 30px; }
- #content h2:target {
- -webkit-animation-name: glowheader;
- -moz-animation-name: glowheader;
- animation-name: glowheader;
- -webkit-animation-duration: 0.7s;
- -moz-animation-duration: 0.7s;
- animation-duration: 0.7s;
- -webkit-animation-timing-function: ease-out;
- -moz-animation-timing-function: ease-out;
- animation-timing-function: ease-out; }
-#content hr {
- border: 0;
- border-bottom: 1px solid #33b5e5;
- margin-bottom: 20px; }
-#content h3 {
- color: #33b5e5;
- text-transform: uppercase;
- font-size: 14px;
- line-height: 20px;
- font-weight: 500; }
-#content h4 {
- margin: 0 10px;
- color: #333333;
- font-weight: 500;
- font-size: 14px;
- line-height: 20px; }
-#content strong {
- color: #333333; }
-#content ul li,
-#content ol li {
- margin-left: 20px; }
- #content ul li h4,
- #content ol li h4 {
- margin: 0; }
- #content ul li p,
- #content ol li p {
- margin-left: 0; }
-#content ul li {
- list-style-type: square;
- list-style-type: none;
- position: relative; }
- #content ul li:before {
- content: '\2022';
- font-family: verdana;
- font-size: 14px;
- line-height: 20px;
- position: absolute;
- left: -20px;
- top: -1px; }
-#content ol {
- counter-reset: item; }
- #content ol li {
- font-size: 14px;
- line-height: 20px;
- list-style-type: none;
- position: relative; }
- #content ol li:before {
- content: counter(item) ". ";
- counter-increment: item;
- position: absolute;
- left: -20px;
- top: 0; }
- #content ol li.value-1:before {
- content: "1. "; }
- #content ol li.value-2:before {
- content: "2. "; }
- #content ol li.value-3:before {
- content: "3. "; }
- #content ol li.value-4:before {
- content: "4. "; }
- #content ol li.value-5:before {
- content: "5. "; }
- #content ol li.value-6:before {
- content: "6. "; }
- #content ol li.value-7:before {
- content: "7. "; }
- #content ol li.value-8:before {
- content: "8. "; }
- #content ol li.value-9:before {
- content: "9. "; }
- #content ol li.value-10:before {
- content: "10. "; }
-#content .with-callouts ol li {
- list-style-position: inside;
- margin-left: 0; }
- #content .with-callouts ol li:before {
- position: static;
- display: inline;
- left: 0;
- float: left;
- width: 17px;
- color: #33b5e5;
- font-weight: 500; }
-
-/* special list items */
-li.no-bullet {
- list-style-type: none !important; }
-
-#content li.with-icon {
- position: relative;
- margin-left: 40px;
- min-height: 30px; }
- #content li.with-icon p {
- margin-left: 0 !important; }
- #content li.with-icon:before {
- position: absolute;
- left: -40px;
- top: 0;
- content: '';
- width: 30px;
- height: 30px; }
- #content li.with-icon.tablet:before {
- background-image: url(ico_phone_tablet.png); }
- #content li.with-icon.web:before {
- background-image: url(ico_web.png); }
- #content li.with-icon.checklist:before {
- background-image: url(ico_checklist.png); }
- #content li.with-icon.action:before {
- background-image: url(ico_action.png); }
- #content li.with-icon.use:before {
- background-image: url(ico_use.png); }
-
-/* figures and callouts */
-.figure {
- position: relative; }
- .figure.pad-below {
- margin-bottom: 20px; }
- .figure .figure-callout {
- position: absolute;
- color: #fff;
- font-weight: 500;
- font-size: 16px;
- line-height: 23px;
- text-align: center;
- background: transparent url(callout.png) no-repeat scroll 50% 50%;
- padding-right: 2px;
- width: 30px;
- height: 29px;
- z-index: 1000; }
- .figure .figure-callout.top {
- top: -9px; }
- .figure .figure-callout.right {
- right: -5px; }
-
-.figure-caption {
- margin: 0 10px 20px 10px;
- font-size: 14px;
- line-height: 20px;
- font-style: italic; }
-
-/* rows of figures */
-.figure-row {
- font-size: 0;
- line-height: 0;
- /* to prevent space between figures */ }
- .figure-row .figure {
- display: inline-block;
- vertical-align: top; }
- .figure-row .figure + .figure {
- margin-left: 10px;
- /* reintroduce space between figures */ }
-
-/* video containers */
-.framed-galaxynexus-land-span-13 {
- background: transparent url(content/misc_full_galaxynexus_blank_land_span13.png) no-repeat scroll top left;
- padding: 42px 122px 62px 126px;
- overflow: hidden; }
- .framed-galaxynexus-land-span-13, .framed-galaxynexus-land-span-13 video, .framed-galaxynexus-land-span-13 img {
- width: 512px;
- height: 286px; }
-
-.framed-galaxynexus-port-span-9 {
- background: transparent url(content/misc_full_galaxynexus_blank_port_span9.png) no-repeat scroll top left;
- padding: 95px 122px 107px 124px;
- overflow: hidden; }
- .framed-galaxynexus-port-span-9, .framed-galaxynexus-port-span-9 video, .framed-galaxynexus-port-span-9 img {
- width: 274px;
- height: 488px; }
-
-.framed-galaxynexus-port-span-5 {
- background: transparent url(content/misc_full_galaxynexus_blank_port_span5.png) no-repeat scroll top left;
- padding: 75px 31px 76px 33px;
- overflow: hidden; }
- .framed-galaxynexus-port-span-5, .framed-galaxynexus-port-span-5 video, .framed-galaxynexus-port-span-5 img {
- width: 216px;
- height: 384px; }
-
-/* landing page disclosures */
-.landing-page-link {
- text-decoration: none;
- font-weight: 500;
- color: #333333; }
- .landing-page-link:after {
- content: '';
- background: transparent url(disclosure_right.png) no-repeat scroll top left;
- width: 10px;
- height: 10px;
- display: inline-block;
- margin-left: 5px; }
-
-/* tooltips */
-.tooltip-box {
- position: absolute;
- background-color: rgba(0, 0, 0, 0.9);
- border-radius: 2px;
- font-size: 14px;
- line-height: 20px;
- color: #fff;
- padding: 6px 10px;
- max-width: 250px;
- z-index: 10000; }
- .tooltip-box.below:after {
- position: absolute;
- content: '';
- line-height: 0;
- display: block;
- top: -10px;
- left: 5px;
- border: 5px solid transparent;
- border-bottom-color: rgba(0, 0, 0, 0.9); }
-
-/* video note */
-.video-instructions {
- margin-top: 10px;
- margin-bottom: 10px; }
- .video-instructions:before {
- content: '';
- background: transparent url(ico_movie_inline.png) no-repeat scroll top left;
- display: inline-block;
- width: 12px;
- height: 12px;
- margin-right: 8px; }
- .video-instructions:after {
- content: 'Click to replay movie.'; }
-
-/* download buttons */
-.download-button {
- display: block;
- margin-bottom: 5px;
- text-decoration: none;
- background-color: #33b5e5;
- color: #fff !important;
- font-weight: 500;
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
- padding: 6px 12px;
- border-radius: 2px; }
- .download-button:hover, .download-button:focus {
- background-color: #0099cc;
- color: #fff !important; }
- .download-button:active {
- background-color: #006699; }
diff --git a/docs/html/design/static/default.js b/docs/html/design/static/default.js
deleted file mode 100644
index b213dd9..0000000
--- a/docs/html/design/static/default.js
+++ /dev/null
@@ -1,169 +0,0 @@
-$(document).ready(function() {
- // prep nav expandos
- var pagePath = document.location.pathname;
- if (pagePath.indexOf(SITE_ROOT) == 0) {
- pagePath = pagePath.substr(SITE_ROOT.length);
- if (pagePath == '' || pagePath.charAt(pagePath.length - 1) == '/') {
- pagePath += 'index.html';
- }
- }
-
- if (SITE_ROOT.match(/\.\.\//) || SITE_ROOT == '') {
- // If running locally, SITE_ROOT will be a relative path, so account for that by
- // finding the relative URL to this page. This will allow us to find links on the page
- // leading back to this page.
- var pathParts = pagePath.split('/');
- var relativePagePathParts = [];
- var upDirs = (SITE_ROOT.match(/(\.\.\/)+/) || [''])[0].length / 3;
- for (var i = 0; i < upDirs; i++) {
- relativePagePathParts.push('..');
- }
- for (var i = 0; i < upDirs; i++) {
- relativePagePathParts.push(pathParts[pathParts.length - (upDirs - i) - 1]);
- }
- relativePagePathParts.push(pathParts[pathParts.length - 1]);
- pagePath = relativePagePathParts.join('/');
- } else {
- // Otherwise the page path should be an absolute URL.
- pagePath = SITE_ROOT + pagePath;
- }
-
- // select current page in sidenav and set up prev/next links if they exist
- var $selNavLink = $('#nav').find('a[href="' + pagePath + '"]');
- if ($selNavLink.length) {
- $selListItem = $selNavLink.closest('li');
-
- $selListItem.addClass('selected');
- $selListItem.closest('li.nav-section').addClass('expanded');
-
- // set up prev links
- var $prevLink = [];
- var $prevListItem = $selListItem.prev('li');
- if ($prevListItem.length) {
- if ($prevListItem.hasClass('nav-section')) {
- // jump to last topic of previous section
- $prevLink = $prevListItem.find('a:last');
- } else {
- // jump to previous topic in this section
- $prevLink = $prevListItem.find('a:eq(0)');
- }
- } else {
- // jump to this section's index page (if it exists)
- $prevLink = $selListItem.parents('li').find('a');
- }
-
- if ($prevLink.length) {
- var prevHref = $prevLink.attr('href');
- if (prevHref == SITE_ROOT + 'index.html') {
- // Don't show Previous when it leads to the homepage
- $('.prev-page-link').hide();
- } else {
- $('.prev-page-link').attr('href', prevHref).show();
- }
- } else {
- $('.prev-page-link').hide();
- }
-
- // set up next links
- var $nextLink = [];
- if ($selListItem.hasClass('nav-section')) {
- // we're on an index page, jump to the first topic
- $nextLink = $selListItem.find('ul').find('a:eq(0)')
- } else {
- // jump to the next topic in this section (if it exists)
- $nextLink = $selListItem.next('li').find('a:eq(0)');
- if (!$nextLink.length) {
- // no more topics in this section, jump to the first topic in the next section
- $nextLink = $selListItem.parents('li').next('li.nav-section').find('a:eq(0)');
- }
- }
- if ($nextLink.length) {
- $('.next-page-link').attr('href', $nextLink.attr('href')).show();
- } else {
- $('.next-page-link').hide();
- }
- }
-
- // Set up expand/collapse behavior
- $('#nav li.nav-section').click(function() {
- if ($(this).hasClass('expanded')) {
- return;
- }
-
- // hide other
- var $old = $('#nav li.nav-section.expanded');
- if ($old.length) {
- var $oldUl = $old.children('ul');
- $oldUl.css('height', $oldUl.height() + 'px');
- window.setTimeout(function() {
- $oldUl
- .addClass('animate-height')
- .css('height', '');
- }, 0);
- $old.removeClass('expanded');
- }
-
- // show me
- $(this).addClass('expanded');
- var $ul = $(this).children('ul');
- var expandedHeight = $ul.height();
- $ul
- .removeClass('animate-height')
- .css('height', 0);
- window.setTimeout(function() {
- $ul
- .addClass('animate-height')
- .css('height', expandedHeight + 'px');
- }, 0);
- });
-
- // Stop expand/collapse behavior when clicking on nav section links (since we're navigating away
- // from the page)
- $('.nav-section-header').find('a:eq(0)').click(function(evt) {
- window.location.href = $(this).attr('href');
- return false;
- });
-
- // Set up play-on-hover <video> tags.
- $('video.play-on-hover').bind('click', function(){
- $(this).get(0).load(); // in case the video isn't seekable
- $(this).get(0).play();
- });
-
- // Set up tooltips
- var TOOLTIP_MARGIN = 10;
- $('acronym').each(function() {
- var $target = $(this);
- var $tooltip = $('<div>')
- .addClass('tooltip-box')
- .text($target.attr('title'))
- .hide()
- .appendTo('body');
- $target.removeAttr('title');
-
- $target.hover(function() {
- // in
- var targetRect = $target.offset();
- targetRect.width = $target.width();
- targetRect.height = $target.height();
-
- $tooltip.css({
- left: targetRect.left,
- top: targetRect.top + targetRect.height + TOOLTIP_MARGIN
- });
- $tooltip.addClass('below');
- $tooltip.show();
- }, function() {
- // out
- $tooltip.hide();
- });
- });
-
- // Set up <h2> deeplinks
- $('h2').click(function() {
- var id = $(this).attr('id');
- if (id) {
- document.location.hash = id;
- }
- });
-});
\ No newline at end of file
diff --git a/docs/html/design/static/disclosure_down.png b/docs/html/design/static/disclosure_down.png
deleted file mode 100644
index 4b3ff4d..0000000
--- a/docs/html/design/static/disclosure_down.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/disclosure_left.png b/docs/html/design/static/disclosure_left.png
deleted file mode 100644
index 607845e..0000000
--- a/docs/html/design/static/disclosure_left.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/disclosure_right.png b/docs/html/design/static/disclosure_right.png
deleted file mode 100644
index f3bceb1..0000000
--- a/docs/html/design/static/disclosure_right.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/disclosure_up.png b/docs/html/design/static/disclosure_up.png
deleted file mode 100644
index 5ff6d9d..0000000
--- a/docs/html/design/static/disclosure_up.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/ico_action.png b/docs/html/design/static/ico_action.png
deleted file mode 100644
index 30e4cc7..0000000
--- a/docs/html/design/static/ico_action.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/ico_good.png b/docs/html/design/static/ico_good.png
deleted file mode 100644
index afebe1c..0000000
--- a/docs/html/design/static/ico_good.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/ico_movie_inline.png b/docs/html/design/static/ico_movie_inline.png
deleted file mode 100644
index 7cfb5c5..0000000
--- a/docs/html/design/static/ico_movie_inline.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/ico_phone_tablet.png b/docs/html/design/static/ico_phone_tablet.png
deleted file mode 100644
index 003b876..0000000
--- a/docs/html/design/static/ico_phone_tablet.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/ico_use.png b/docs/html/design/static/ico_use.png
deleted file mode 100644
index 9d868b3..0000000
--- a/docs/html/design/static/ico_use.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/ico_web.png b/docs/html/design/static/ico_web.png
deleted file mode 100644
index 0848e3c..0000000
--- a/docs/html/design/static/ico_web.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/ico_wrong.png b/docs/html/design/static/ico_wrong.png
deleted file mode 100644
index b7d04ce..0000000
--- a/docs/html/design/static/ico_wrong.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/jquery-1.6.2.min.js b/docs/html/design/static/jquery-1.6.2.min.js
deleted file mode 100644
index 8cdc80e..0000000
--- a/docs/html/design/static/jquery-1.6.2.min.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.6.2
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Thu Jun 30 14:16:56 2011 -0400
- */
-(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.
-shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j
-)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cr("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
\ No newline at end of file
diff --git a/docs/html/design/static/open_new_page.png b/docs/html/design/static/open_new_page.png
deleted file mode 100644
index 6197e3a..0000000
--- a/docs/html/design/static/open_new_page.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/design/static/yui-3.3.0-reset-min.css b/docs/html/design/static/yui-3.3.0-reset-min.css
deleted file mode 100644
index 00c3892..0000000
--- a/docs/html/design/static/yui-3.3.0-reset-min.css
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
-Copyright (c) 2010, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.com/yui/license.html
-version: 3.3.0
-build: 3167
-*/
-html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
\ No newline at end of file
diff --git a/docs/html/design/style/color.html b/docs/html/design/style/color.html
deleted file mode 100644
index bca3c45..0000000
--- a/docs/html/design/style/color.html
+++ /dev/null
@@ -1,296 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Color
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
-<style>
- .color-row {
- width: 740px;
- margin-left: 10px !important;
- margin-right: 10px !important;
-
- display: box;
- display: -webkit-box;
- display: -moz-box;
-
- box-orient: horizontal;
- -webkit-box-orient: horizontal;
- -moz-box-orient: horizontal;
-
- cursor: pointer;
-
- user-select: none;
- -webkit-user-select: none;
- /* nested user-select in FF is broken as of Jan 2012, don't use it */
- }
-
- .color-row-container {
- line-height: 0; /* to remove more top space in FF for -moz-box elements */
- }
-
- .color-row-container + .color-row-container {
- margin-top: -10px !important;
- }
-
- .color-row li {
- margin-left: 0 !important;
- position: relative;
- list-style-type: none;
- height: 80px;
- display: block;
-
- box-flex: 1;
- -webkit-box-flex: 1;
- -moz-box-flex: 1;
- }
-
- .color-row li:before {
- display: none;
- }
-
- .color-row li.thin {
- height: 40px;
- }
-
- .color-row li span {
- display: none;
- position: absolute;
- top: -30px;
- left: 50%;
- margin-left: -2.5em;
- width: 5em;
- background-color: #fff;
- padding: 10px;
- font-weight: 600;
- line-height: 20px;
- text-align: center;
- box-shadow: 0 5px 5px rgba(0,0,0,0.1);
- cursor: text;
-
- user-select: text;
- -webkit-user-select: text;
- /* nested user-select in FF is broken as of Jan 2012, don't use it */
- }
-
- .color-row li:hover span {
- display: block;
- }
-
- /*.color-row li span:before {
- color: #999;
- content: 'copy ';
- }*/
-
- /* triangle callout */
- .color-row li span:after {
- content: '';
- display: block;
- position: absolute;
- left: 50%;
- bottom: -16px;
- border: 8px solid transparent;
- border-top-color: #fff;
- width: 0;
- height: 0;
- margin-left: -8px;
- }
-</style>
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Color</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Use color primarily for emphasis. Choose colors that fit with your brand and provide good contrast
-between visual components. Note that red and green may be indistinguishable to color-blind users.</p>
-
- <div class="color-row-container">
- <ul class="color-row">
- <li><span>#33b5e5</span></li>
- <li><span>#aa66cc</span></li>
- <li><span>#99cc00</span></li>
- <li><span>#ffbb33</span></li>
- <li><span>#ff4444</span></li>
- </ul>
- </div>
-
- <div class="color-row-container">
- <ul class="color-row">
- <li class="thin"><span>#0099cc</span></li>
- <li class="thin"><span>#9933cc</span></li>
- <li class="thin"><span>#669900</span></li>
- <li class="thin"><span>#ff8800</span></li>
- <li class="thin"><span>#cc0000</span></li>
- </ul>
- </div>
-
-<h2 id="palette">Palette</h2>
-
-<p>Blue is the standard accent color in Android's color palette. Each color has a corresponding darker
-shade that can be used as a complement when needed.</p>
-<p><a href="https://dl-ssl.google.com/android/design/Android_Design_Color_Swatches_20120229.zip">Download the swatches</a></p>
-
-<img src="../static/content/color_spectrum.png">
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-<script>
- $(document).ready(function() {
- $('.color-row li').each(function() {
- var color = $(this).text();
- $(this).css('background-color', color);
- $(this).find('span')
- .css('color', color)
- .text(color.toUpperCase());
- });
-
- });
-</script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/style/color.jd b/docs/html/design/style/color.jd
new file mode 100644
index 0000000..e25f7c6
--- /dev/null
+++ b/docs/html/design/style/color.jd
@@ -0,0 +1,134 @@
+page.title=Color
+@jd:body
+
+<style>
+ .color-row {
+ width: 740px;
+ margin-left: 10px !important;
+ margin-right: 10px !important;
+
+ display: -webkit-box;
+ display: -moz-box;
+ display: box;
+
+ -webkit-box-orient: horizontal;
+ -moz-box-orient: horizontal;
+ box-orient: horizontal;
+
+ cursor: pointer;
+
+ -webkit-user-select: none;
+ user-select: none;
+ /* nested user-select in FF is broken as of Jan 2012, don't use it */
+ }
+
+ .color-row-container {
+ line-height: 0; /* to remove more top space in FF for -moz-box elements */
+ }
+
+ .color-row-container + .color-row-container {
+ margin-top: -10px !important;
+ }
+
+ .color-row li {
+ margin-left: 0 !important;
+ position: relative;
+ list-style-type: none;
+ height: 80px;
+ display: block;
+
+ -webkit-box-flex: 1;
+ -moz-box-flex: 1;
+ box-flex: 1;
+ }
+
+ .color-row li:before {
+ display: none;
+ }
+
+ .color-row li.thin {
+ height: 40px;
+ }
+
+ .color-row li span {
+ display: none;
+ position: absolute;
+ top: -30px;
+ left: 50%;
+ margin-left: -2.5em;
+ width: 5em;
+ background-color: #fff;
+ padding: 10px;
+ font-weight: 600;
+ line-height: 20px;
+ text-align: center;
+ box-shadow: 0 5px 5px rgba(0,0,0,0.1);
+ cursor: text;
+
+ -webkit-user-select: text;
+ user-select: text;
+ /* nested user-select in FF is broken as of Jan 2012, don't use it */
+ }
+
+ .color-row li:hover span {
+ display: block;
+ }
+
+ /* triangle callout */
+ .color-row li span:after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 50%;
+ bottom: -16px;
+ border: 8px solid transparent;
+ border-top-color: #fff;
+ width: 0;
+ height: 0;
+ margin-left: -8px;
+ }
+</style>
+
+<p>Use color primarily for emphasis. Choose colors that fit with your brand and provide good contrast
+between visual components. Note that red and green may be indistinguishable to color-blind users.</p>
+
+ <div class="color-row-container">
+ <ul class="color-row">
+ <li><span>#33b5e5</span></li>
+ <li><span>#aa66cc</span></li>
+ <li><span>#99cc00</span></li>
+ <li><span>#ffbb33</span></li>
+ <li><span>#ff4444</span></li>
+ </ul>
+ </div>
+
+ <div class="color-row-container">
+ <ul class="color-row">
+ <li class="thin"><span>#0099cc</span></li>
+ <li class="thin"><span>#9933cc</span></li>
+ <li class="thin"><span>#669900</span></li>
+ <li class="thin"><span>#ff8800</span></li>
+ <li class="thin"><span>#cc0000</span></li>
+ </ul>
+ </div>
+
+<h2 id="palette">Palette</h2>
+
+<p>Blue is the standard accent color in Android's color palette. Each color has a corresponding darker
+shade that can be used as a complement when needed.</p>
+<p><a href="https://dl-ssl.google.com/android/design/Android_Design_Color_Swatches_20120229.zip">Download the swatches</a></p>
+
+<img src="{@docRoot}design/media/color_spectrum.png">
+
+<script>
+ $(document).ready(function() {
+ $('.color-row li').each(function() {
+ var color = $(this).text();
+ $(this).css('background-color', color);
+ $(this).find('span')
+ .css('color', color)
+ .text(color.toUpperCase());
+ });
+
+ });
+</script>
diff --git a/docs/html/design/style/devices-displays.html b/docs/html/design/style/devices-displays.html
deleted file mode 100644
index 89e0876..0000000
--- a/docs/html/design/style/devices-displays.html
+++ /dev/null
@@ -1,202 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Devices and Displays
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Devices and Displays</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Android powers millions of phones, tablets, and other devices in a wide variety of screen sizes and
-form factors. By taking advantage of Android's flexible layout system, you can create apps that
-gracefully scale from large tablets to smaller phones.</p>
-
-<img src="../static/content/devices_displays_main.png">
-
-<div class="vspace size-2"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
-<h4>Be flexible</h4>
-<p>Stretch and compress your layouts to accommodate various heights and widths.</p>
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Optimize layouts</h4>
-<p>On larger devices, take advantage of extra screen real estate. Create compound views that combine
-multiple views to reveal more content and ease navigation.</p>
-
- </div>
- <div class="layout-content-col span-4">
-
-<h4>Assets for all</h4>
-<p>Provide resources for different screen densities (<acronym title="Dots per inch">DPI</acronym>) to
-ensure that your app looks great on any device.</p>
-
- </div>
-</div>
-
-<div style="text-align:center">
- <img src="../static/content/devices_displays_density.png">
-</div>
-
-<h4>Strategies</h4>
-<p>So where do you begin when designing for multiple screens? One approach is to work in the base
-standard (medium size, <acronym title="Medium density (160 dpi)">MDPI</acronym>) and scale it up or
-down for the other buckets. Another approach is to start with the device with the largest screen
-size, and then scale down and figure out the UI compromises you'll need to make on smaller screens.</p>
-<p>For more detailed information on this topic, please visit <a href="http://developer.android.com/guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/style/devices-displays.jd b/docs/html/design/style/devices-displays.jd
new file mode 100644
index 0000000..e5fe26d
--- /dev/null
+++ b/docs/html/design/style/devices-displays.jd
@@ -0,0 +1,45 @@
+page.title=Devices and Displays
+@jd:body
+
+<p>Android powers millions of phones, tablets, and other devices in a wide variety of screen sizes and
+form factors. By taking advantage of Android's flexible layout system, you can create apps that
+gracefully scale from large tablets to smaller phones.</p>
+
+<img src="{@docRoot}design/media/devices_displays_main.png">
+
+<div class="vspace size-2"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+<h4>Be flexible</h4>
+<p>Stretch and compress your layouts to accommodate various heights and widths.</p>
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Optimize layouts</h4>
+<p>On larger devices, take advantage of extra screen real estate. Create compound views that combine
+multiple views to reveal more content and ease navigation.</p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<h4>Assets for all</h4>
+<p>Provide resources for different screen densities (<acronym title="Dots per inch">DPI</acronym>) to
+ensure that your app looks great on any device.</p>
+
+ </div>
+</div>
+
+<div style="text-align:center">
+ <img src="{@docRoot}design/media/devices_displays_density.png">
+</div>
+
+<h4>Strategies</h4>
+<p>So where do you begin when designing for multiple screens? One approach is to work in the base
+standard (medium size, <acronym title="Medium density (160 dpi)">MDPI</acronym>) and scale it up or
+down for the other buckets. Another approach is to start with the device with the largest screen
+size, and then scale down and figure out the UI compromises you'll need to make on smaller screens.</p>
+<p>For more detailed information on this topic, please visit <a href="http://developer.android.com/guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</p>
diff --git a/docs/html/design/style/iconography.html b/docs/html/design/style/iconography.html
deleted file mode 100644
index 96954de..0000000
--- a/docs/html/design/style/iconography.html
+++ /dev/null
@@ -1,497 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Iconography
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Iconography</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<img src="../static/content/iconography_overview.png">
-
-<p>An icon is a graphic that takes up a small portion of screen real estate and provides a quick,
-intuitive representation of an action, a status, or an app.</p>
-
-
-
-<h2 id="launcher">Launcher</h2>
-
-<p>The launcher icon is the visual representation of your app on the Home or All Apps screen. Since the
-user can change the Home screen's wallpaper, make sure that your launcher icon is clearly visible on
-any type of background.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_launcher_size.png">
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_launcher_focal.png">
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_launcher_style.png">
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <h4>Sizes & scale</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Launcher icons on a mobile device must be <strong>48x48 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
- <li class="no-bullet with-icon web">
- <p>Launcher icons for display in Market must be <strong>512x512 pixels</strong>.</p></li>
- </ul>
-
- </div>
- <div class="layout-content-col span-4">
-
- <h4>Proportions</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Full asset, <strong>48x48 dp</strong></p>
- </li>
- </ul>
-
- </div>
- <div class="layout-content-col span-4">
-
-<h4>Style</h4>
-<p>Use a distinct silhouette. Three-dimensional, front view, with a slight perspective as if viewed
-from above, so that users perceive some depth.</p>
-
- </div>
-</div>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/iconography_launcher_example.png">
-
- </div>
- <!-- 2 free columns -->
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-12">
-
- <img src="../static/content/iconography_launcher_example2.png">
-
- <div class="vspace size-2"> </div>
-
- </div>
- <!-- 1 free columns -->
-</div>
-
-
-<h2 id="action-bar">Action Bar</h2>
-
-<p>
-
-Action bar icons are graphic buttons that represent the most important actions people can take
-within your app. Each one should employ a simple metaphor representing a single concept that most
-people can grasp at a glance.
-
-</p>
-<p>
-
-Pre-defined glyphs should be used for certain common actions such as "refresh" and "share." The
-download link below provides a package with icons that are scaled for various screen densities and
-are suitable for use with the Holo Light and Holo Dark themes. The package also includes unstyled
-icons that you can modify to match your theme, in addition to Adobe® Illustrator® source
-files for further customization.
-
-</p>
-<p>
-
-<a href="https://dl-ssl.google.com/android/design/Android_Design_Icons_20120229.zip">Download the Action Bar Icon Pack</a>
-
-</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_actionbar_size.png">
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_actionbar_focal.png">
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_actionbar_style.png">
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <h4>Sizes & scale</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Action bar icons for phones should be <strong>32x32 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
- </ul>
-
- </div>
- <div class="layout-content-col span-4">
-
- <h4>Focal area & proportions</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Full asset, <strong>32x32 dp</strong></p>
- <p>Optical square, <strong>24x24 dp</strong></p>
- </li>
- </ul>
-
- </div>
- <div class="layout-content-col span-4">
-
-<h4>Style</h4>
-<p>Pictographic, flat, not too detailed, with smooth curves or sharp shapes. If the graphic is thin,
-rotate it 45° left or right to fill the focal space. The thickness of the strokes and negative
-spaces should be a minimum of 2 dp.</p>
-
- </div>
-</div>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-3">
-
-<h4>Colors</h4>
-<p>Colors: <strong>#333333</strong><br />
-Enabled: <strong>60%</strong> opacity<br />
-Disabled: <strong>30%</strong> opacity</p>
-<div class="vspace size-1"> </div>
-
-<p>Colors: <strong>#FFFFFF</strong><br />
-Enabled: <strong>80%</strong> opacity<br />
-Disabled: <strong>30%</strong> opacity</p>
-
- </div>
- <div class="layout-content-col span-9">
-
- <img src="../static/content/iconography_actionbar_colors.png">
-
- </div>
-</div>
-
-
-<h2 id="small-contextual">Small / Contextual Icons</h2>
-
-<p>Within the body of your app, use small icons to surface actions and/or provide status for specific
-items. For example, in the Gmail app, each message has a star icon that marks the message as
-important.</p>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_small_size.png">
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_small_focal.png">
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_small_style.png">
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <h4>Sizes & scale</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Small icons should be <strong>16x16 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
- </ul>
-
- </div>
- <div class="layout-content-col span-4">
-
- <h4>Focal area & proportions</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Full asset, <strong>16x16 dp</strong></p>
- <p>Optical square, <strong>12x12 dp</strong></p>
- </li>
- </ul>
-
- </div>
- <div class="layout-content-col span-4">
-
-<h4>Style</h4>
-<p>Neutral, flat, and simple. Filled shapes are easier to see than thin strokes. Use a single visual
-metaphor so that a user can easily recognize and understand its purpose.</p>
-
- </div>
-</div>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_small_colors.png">
-
- <div class="vspace size-2"> </div>
-
-<h4>Colors</h4>
-<p>Use non-neutral colors sparingly and with purpose. For example, Gmail uses yellow in the star icon
-to indicate a bookmarked message. If an icon is actionable, choose a color that contrasts well with
-the background.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/iconography_small_example.png">
-
- </div>
- <!-- 2 free columns -->
-</div>
-
-
-<h2 id="notification">Notification Icons</h2>
-
-<p>If your app generates notifications, provide an icon that the system can display in the status bar
-whenever a new notification is available.</p>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_notification_size.png">
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_notification_focal.png">
-
- </div>
- <div class="layout-content-col span-4">
-
- <img src="../static/content/iconography_notification_style.png">
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
- <h4>Sizes & scale</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Notification icons must be <strong>24x24 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
- </ul>
-
- </div>
- <div class="layout-content-col span-4">
-
- <h4>Focal area & proportions</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Full asset, <strong>24x24 dp</strong></p>
- <p>Optical square, <strong>22x22 dp</strong></p>
- </li>
- </ul>
-
- </div>
- <div class="layout-content-col span-4">
-
-<h4>Style</h4>
-<p>Keep the style flat and simple, using the same single, visual metaphor as your launcher icon.</p>
-
- </div>
-</div>
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
-<h4>Colors</h4>
-<p>Notification icons must be entirely white. Also, the system may scale down and/or darken the icons.</p>
-
- </div>
- <div class="layout-content-col span-7">
-
- <img src="../static/content/iconography_notification_example.png">
-
- </div>
- <!-- 2 free columns -->
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/style/iconography.jd b/docs/html/design/style/iconography.jd
new file mode 100644
index 0000000..775e45d
--- /dev/null
+++ b/docs/html/design/style/iconography.jd
@@ -0,0 +1,340 @@
+page.title=Iconography
+@jd:body
+
+<img src="{@docRoot}design/media/iconography_overview.png">
+
+<p>An icon is a graphic that takes up a small portion of screen real estate and provides a quick,
+intuitive representation of an action, a status, or an app.</p>
+
+
+
+<h2 id="launcher">Launcher</h2>
+
+<p>The launcher icon is the visual representation of your app on the Home or All Apps screen. Since the
+user can change the Home screen's wallpaper, make sure that your launcher icon is clearly visible on
+any type of background.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_launcher_size.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_launcher_focal.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_launcher_style.png">
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <h4>Sizes & scale</h4>
+
+ <ul>
+ <li class="no-bullet with-icon tablet">
+ <p>Launcher icons on a mobile device must be <strong>48x48 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
+ <li class="no-bullet with-icon web">
+ <p>Launcher icons for display on Google Play must be <strong>512x512 pixels</strong>.</p></li>
+ </ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <h4>Proportions</h4>
+
+ <ul>
+ <li class="no-bullet with-icon tablet">
+ <p>Full asset, <strong>48x48 dp</strong></p>
+ </li>
+ </ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<h4>Style</h4>
+<p>Use a distinct silhouette. Three-dimensional, front view, with a slight perspective as if viewed
+from above, so that users perceive some depth.</p>
+
+ </div>
+</div>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/iconography_launcher_example.png">
+
+ </div>
+ <!-- 2 free columns -->
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-12">
+
+ <img src="{@docRoot}design/media/iconography_launcher_example2.png">
+
+ <div class="vspace size-2"> </div>
+
+ </div>
+ <!-- 1 free columns -->
+</div>
+
+
+<h2 id="action-bar">Action Bar</h2>
+
+<p>
+
+Action bar icons are graphic buttons that represent the most important actions people can take
+within your app. Each one should employ a simple metaphor representing a single concept that most
+people can grasp at a glance.
+
+</p>
+<p>
+
+Pre-defined glyphs should be used for certain common actions such as "refresh" and "share." The
+download link below provides a package with icons that are scaled for various screen densities and
+are suitable for use with the Holo Light and Holo Dark themes. The package also includes unstyled
+icons that you can modify to match your theme, in addition to Adobe® Illustrator® source
+files for further customization.
+
+</p>
+<p>
+
+<a href="https://dl-ssl.google.com/android/design/Android_Design_Icons_20120229.zip">Download the Action Bar Icon Pack</a>
+
+</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_actionbar_size.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_actionbar_focal.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_actionbar_style.png">
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <h4>Sizes & scale</h4>
+
+ <ul>
+ <li class="no-bullet with-icon tablet">
+ <p>Action bar icons for phones should be <strong>32x32 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
+ </ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <h4>Focal area & proportions</h4>
+
+ <ul>
+ <li class="no-bullet with-icon tablet">
+ <p>Full asset, <strong>32x32 dp</strong></p>
+ <p>Optical square, <strong>24x24 dp</strong></p>
+ </li>
+ </ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<h4>Style</h4>
+<p>Pictographic, flat, not too detailed, with smooth curves or sharp shapes. If the graphic is thin,
+rotate it 45° left or right to fill the focal space. The thickness of the strokes and negative
+spaces should be a minimum of 2 dp.</p>
+
+ </div>
+</div>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-3">
+
+<h4>Colors</h4>
+<p>Colors: <strong>#333333</strong><br />
+Enabled: <strong>60%</strong> opacity<br />
+Disabled: <strong>30%</strong> opacity</p>
+<div class="vspace size-1"> </div>
+
+<p>Colors: <strong>#FFFFFF</strong><br />
+Enabled: <strong>80%</strong> opacity<br />
+Disabled: <strong>30%</strong> opacity</p>
+
+ </div>
+ <div class="layout-content-col span-9">
+
+ <img src="{@docRoot}design/media/iconography_actionbar_colors.png">
+
+ </div>
+</div>
+
+
+<h2 id="small-contextual">Small / Contextual Icons</h2>
+
+<p>Within the body of your app, use small icons to surface actions and/or provide status for specific
+items. For example, in the Gmail app, each message has a star icon that marks the message as
+important.</p>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_small_size.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_small_focal.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_small_style.png">
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <h4>Sizes & scale</h4>
+
+ <ul>
+ <li class="no-bullet with-icon tablet">
+ <p>Small icons should be <strong>16x16 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
+ </ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <h4>Focal area & proportions</h4>
+
+ <ul>
+ <li class="no-bullet with-icon tablet">
+ <p>Full asset, <strong>16x16 dp</strong></p>
+ <p>Optical square, <strong>12x12 dp</strong></p>
+ </li>
+ </ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<h4>Style</h4>
+<p>Neutral, flat, and simple. Filled shapes are easier to see than thin strokes. Use a single visual
+metaphor so that a user can easily recognize and understand its purpose.</p>
+
+ </div>
+</div>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_small_colors.png">
+
+ <div class="vspace size-2"> </div>
+
+<h4>Colors</h4>
+<p>Use non-neutral colors sparingly and with purpose. For example, Gmail uses yellow in the star icon
+to indicate a bookmarked message. If an icon is actionable, choose a color that contrasts well with
+the background.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/iconography_small_example.png">
+
+ </div>
+ <!-- 2 free columns -->
+</div>
+
+
+<h2 id="notification">Notification Icons</h2>
+
+<p>If your app generates notifications, provide an icon that the system can display in the status bar
+whenever a new notification is available.</p>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_notification_size.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_notification_focal.png">
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <img src="{@docRoot}design/media/iconography_notification_style.png">
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+ <h4>Sizes & scale</h4>
+
+ <ul>
+ <li class="no-bullet with-icon tablet">
+ <p>Notification icons must be <strong>24x24 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
+ </ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+ <h4>Focal area & proportions</h4>
+
+ <ul>
+ <li class="no-bullet with-icon tablet">
+ <p>Full asset, <strong>24x24 dp</strong></p>
+ <p>Optical square, <strong>22x22 dp</strong></p>
+ </li>
+ </ul>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<h4>Style</h4>
+<p>Keep the style flat and simple, using the same single, visual metaphor as your launcher icon.</p>
+
+ </div>
+</div>
+
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+<h4>Colors</h4>
+<p>Notification icons must be entirely white. Also, the system may scale down and/or darken the icons.</p>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+ <img src="{@docRoot}design/media/iconography_notification_example.png">
+
+ </div>
+ <!-- 2 free columns -->
+</div>
diff --git a/docs/html/design/style/index.html b/docs/html/design/style/index.html
deleted file mode 100644
index c7ac58f..0000000
--- a/docs/html/design/style/index.html
+++ /dev/null
@@ -1,175 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Design Elements
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
-<style>
-#landing-graphic-container {
- position: relative;
-}
-
-#text-overlay {
- position: absolute;
- left: 10px;
- top: 402px;
- width: 220px;
-}
-</style>
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
-<div class="layout-content-row content-header just-links">
- <div class="layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
-</div>
-
-
-
-
-<div id="landing-graphic-container">
- <div id="text-overlay">
- Build visually compelling apps that look great on any device.
- <br><br>
- <a href="../style/devices-displays.html" class="landing-page-link">Devices and Displays</a>
- </div>
-
- <a href="../style/devices-displays.html">
- <img src="../static/content/design_elements_landing.png">
- </a>
-</div>
-
-
-
-
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/style/index.jd b/docs/html/design/style/index.jd
new file mode 100644
index 0000000..d346aea
--- /dev/null
+++ b/docs/html/design/style/index.jd
@@ -0,0 +1,29 @@
+page.title=Style
+header.justLinks=1
+footer.hide=1
+@jd:body
+
+<style>
+#landing-graphic-container {
+ position: relative;
+}
+
+#text-overlay {
+ position: absolute;
+ left: 10px;
+ top: 402px;
+ width: 220px;
+}
+</style>
+
+<div id="landing-graphic-container">
+ <div id="text-overlay">
+ Build visually compelling apps that look great on any device.
+ <br><br>
+ <a href="{@docRoot}design/style/devices-displays.html" class="landing-page-link">Devices and Displays</a>
+ </div>
+
+ <a href="{@docRoot}design/style/devices-displays.html">
+ <img src="{@docRoot}design/media/design_elements_landing.png">
+ </a>
+</div>
diff --git a/docs/html/design/style/metrics-grids.html b/docs/html/design/style/metrics-grids.html
deleted file mode 100644
index 7bb9dd0..0000000
--- a/docs/html/design/style/metrics-grids.html
+++ /dev/null
@@ -1,218 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Metrics and Grids
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Metrics and Grids</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>Devices vary not only in physical size, but also in screen density (<acronym title="Dots per
-inch">DPI</acronym>). To simplify the way you design for multiple screens, think of each device as
-falling into a particular size bucket and density bucket. The size buckets are <em>handset</em> (smaller than
-600<acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi
-screen.">dp</acronym>) and <em>tablet</em> (larger than or equal 600dp). The density buckets are <acronym
-title="Low density (120 dpi)">LDPI</acronym>, <acronym title="Medium density (160
-dpi)">MDPI</acronym>, <acronym title="High density (240 dpi)">HDPI</acronym>, and <acronym title
-="Extra-high density (320 dpi)">XHDPI</acronym>. Optimize your application's UI by designing
-alternative layouts for some of the different size buckets, and provide alternative bitmap images
-for different density buckets.</p>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8">
-
- <img src="../static/content/metrics_diagram.png">
-
- </div>
- <div class="layout-content-col span-5">
-
-<h4>Space considerations</h4>
-<p>Devices vary in the amount of density-independent pixels (dp) they can display.</p>
-<p>To see more, visit the
-<a href="http://developer.android.com/resources/dashboard/screens.html" target="_blank">
-Screen Sizes and Densities Device Dashboard</a>.</p>
-
- </div>
-</div>
-
-<h2 id="48dp-rhythm">48dp Rhythm</h2>
-
-<p>Touchable UI components are generally laid out along 48dp units.</p>
-
-<img src="../static/content/metrics_48.png">
-
-<div class="vspace size-2"> </div>
-
-<h4>Why 48dp?</h4>
-<p>On average, 48dp translate to a physical size of about 9mm (with some variability). This is
-comfortably in the range of recommended target sizes (7-10 mm) for touchscreen objects and users
-will be able to reliably and accurately target them with their fingers.</p>
-<p>If you design your elements to be at least 48dp high and wide you can guarantee that:</p>
-<ul>
-<li>your targets will never be smaller than the minimum recommended target size of 7mm regardless of
- what screen they are displayed on.</li>
-<li>you strike a good compromise between overall information density on the one hand, and
- targetability of UI elements on the other.</li>
-</ul>
-
-<img src="../static/content/metrics_closeup.png">
-
-<div class="vspace size-2"> </div>
-
-<h4>Mind the gaps</h4>
-<p>Spacing between each UI element is 8dp.</p>
-
-<h2 id="examples">Examples</h2>
-
-<img src="../static/content/metrics_forms.png">
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/style/metrics-grids.jd b/docs/html/design/style/metrics-grids.jd
new file mode 100644
index 0000000..e2b9ab5
--- /dev/null
+++ b/docs/html/design/style/metrics-grids.jd
@@ -0,0 +1,61 @@
+page.title=Metrics and Grids
+@jd:body
+
+<p>Devices vary not only in physical size, but also in screen density (<acronym title="Dots per
+inch">DPI</acronym>). To simplify the way you design for multiple screens, think of each device as
+falling into a particular size bucket and density bucket. The size buckets are <em>handset</em> (smaller than
+600<acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi
+screen.">dp</acronym>) and <em>tablet</em> (larger than or equal 600dp). The density buckets are <acronym
+title="Low density (120 dpi)">LDPI</acronym>, <acronym title="Medium density (160
+dpi)">MDPI</acronym>, <acronym title="High density (240 dpi)">HDPI</acronym>, and <acronym title
+="Extra-high density (320 dpi)">XHDPI</acronym>. Optimize your application's UI by designing
+alternative layouts for some of the different size buckets, and provide alternative bitmap images
+for different density buckets.</p>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/metrics_diagram.png">
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<h4>Space considerations</h4>
+<p>Devices vary in the amount of density-independent pixels (dp) they can display.</p>
+<p>To see more, visit the
+<a href="http://developer.android.com/resources/dashboard/screens.html" target="_blank">
+Screen Sizes and Densities Device Dashboard</a>.</p>
+
+ </div>
+</div>
+
+<h2 id="48dp-rhythm">48dp Rhythm</h2>
+
+<p>Touchable UI components are generally laid out along 48dp units.</p>
+
+<img src="{@docRoot}design/media/metrics_48.png">
+
+<div class="vspace size-2"> </div>
+
+<h4>Why 48dp?</h4>
+<p>On average, 48dp translate to a physical size of about 9mm (with some variability). This is
+comfortably in the range of recommended target sizes (7-10 mm) for touchscreen objects and users
+will be able to reliably and accurately target them with their fingers.</p>
+<p>If you design your elements to be at least 48dp high and wide you can guarantee that:</p>
+<ul>
+<li>your targets will never be smaller than the minimum recommended target size of 7mm regardless of
+ what screen they are displayed on.</li>
+<li>you strike a good compromise between overall information density on the one hand, and
+ targetability of UI elements on the other.</li>
+</ul>
+
+<img src="{@docRoot}design/media/metrics_closeup.png">
+
+<div class="vspace size-2"> </div>
+
+<h4>Mind the gaps</h4>
+<p>Spacing between each UI element is 8dp.</p>
+
+<h2 id="examples">Examples</h2>
+
+<img src="{@docRoot}design/media/metrics_forms.png">
diff --git a/docs/html/design/style/themes.html b/docs/html/design/style/themes.html
deleted file mode 100644
index a629978..0000000
--- a/docs/html/design/style/themes.html
+++ /dev/null
@@ -1,199 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Themes
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Themes</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-5">
-
- <img src="../static/content/themes_holo_light.png">
- <div class="figure-caption">
- Gmail in Holo Light.
- </div>
-
- <img src="../static/content/themes_holo_dark.png">
- <div class="figure-caption">
- Settings in Holo Dark.
- </div>
-
- <img src="../static/content/themes_holo_inverse.png">
- <div class="figure-caption">
- Talk in Holo Light with dark action bar.
- </div>
-
- </div>
- <div class="layout-content-col span-7">
-
-<p>Themes are Android's mechanism for applying a consistent style to an app or activity. The style
-specifies the visual properties of the elements that make up your user interface, such as color,
-height, padding and font size. To promote greater cohesion between all apps on the platform, Android
-provides three system themes that you can choose from when building apps for Ice Cream Sandwich:</p>
-<ul>
-<li>Holo Light</li>
-<li>Holo Dark</li>
-<li>Holo Light with dark action bars</li>
-</ul>
-<p>Applying these themes will go a long way in helping you to build apps that fit right into the
-general visual language of Android.</p>
-<p>Pick the system theme that best matches the needs and design aesthetics for your app. If your
-desire is to have a more distinct look for your app, using one of the system themes as a starting
-point for your customizations is a good idea. The system themes provide a solid foundation on top
-of which you can selectively implement your own visual stylings.</p>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/style/themes.jd b/docs/html/design/style/themes.jd
new file mode 100644
index 0000000..d4a6acf
--- /dev/null
+++ b/docs/html/design/style/themes.jd
@@ -0,0 +1,42 @@
+page.title=Themes
+@jd:body
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-5">
+
+ <img src="{@docRoot}design/media/themes_holo_light.png">
+ <div class="figure-caption">
+ Gmail in Holo Light.
+ </div>
+
+ <img src="{@docRoot}design/media/themes_holo_dark.png">
+ <div class="figure-caption">
+ Settings in Holo Dark.
+ </div>
+
+ <img src="{@docRoot}design/media/themes_holo_inverse.png">
+ <div class="figure-caption">
+ Talk in Holo Light with dark action bar.
+ </div>
+
+ </div>
+ <div class="layout-content-col span-7">
+
+<p>Themes are Android's mechanism for applying a consistent style to an app or activity. The style
+specifies the visual properties of the elements that make up your user interface, such as color,
+height, padding and font size. To promote greater cohesion between all apps on the platform, Android
+provides three system themes that you can choose from when building apps for Ice Cream Sandwich:</p>
+<ul>
+<li>Holo Light</li>
+<li>Holo Dark</li>
+<li>Holo Light with dark action bars</li>
+</ul>
+<p>Applying these themes will go a long way in helping you to build apps that fit right into the
+general visual language of Android.</p>
+<p>Pick the system theme that best matches the needs and design aesthetics for your app. If your
+desire is to have a more distinct look for your app, using one of the system themes as a starting
+point for your customizations is a good idea. The system themes provide a solid foundation on top
+of which you can selectively implement your own visual stylings.</p>
+
+ </div>
+</div>
diff --git a/docs/html/design/style/touch-feedback.html b/docs/html/design/style/touch-feedback.html
deleted file mode 100644
index d1c08f8..0000000
--- a/docs/html/design/style/touch-feedback.html
+++ /dev/null
@@ -1,224 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Touch Feedback
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Touch Feedback</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<div class="layout-content-row" style="margin-bottom: -100px">
- <div class="layout-content-col span-7">
-
-<p>Use color and illumination to respond to touches, reinforce the resulting behaviors of gestures, and
-indicate what actions are enabled and disabled.</p>
-<p>Whenever a user touches an actionable area in your app, provide a visual response. This lets the
-user know which object was touched and that your app is "listening".</p>
-
- </div>
- <div class="layout-content-col span-6">
-
- <img src="../static/content/touch_feedback_reaction_response.png">
-
- </div>
-</div>
-
-<h4>States</h4>
-
-<div class="vspace size-1"> </div>
-
-<img src="../static/content/touch_feedback_states.png">
-<div class="figure-caption">
- Most of Android's UI elements have touch-feedback built in, including states that indicate
- whether touching the element will have any effect.
-</div>
-
-<div class="vspace size-4"> </div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
-
-<h4>Communication</h4>
-<p>When your objects react to more complex gestures, help users understand what the outcome of the
-operation will be. For example, in Recents, when you start swiping a thumbnail left or right, it
-starts to dim. This helps the user understand that swiping will cause the item to be removed.</p>
-
- </div>
- <div class="layout-content-col span-9">
-
- <img src="../static/content/touch_feedback_manipulation.png">
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
- <img src="../static/content/touch_feedback_communication.png">
-
- </div>
- <div class="layout-content-col span-6">
-
-<div class="vspace size-3"> </div>
-
-<h4>Boundaries</h4>
-<p>When users try to scroll past the upper or lower limit of a scrollable area, communicate the
-boundary with a visual cue. For example, if a user attempts to scroll past the first home screen
-panel, the screen content tilts to the right to indicate that further navigation in this direction
-is not possible. Many of Android's scrollable UI widgets (e.g. lists or grid lists) already have
-support for boundary feedback built in. If you are building custom, keep boundary feedback in mind
-and provide it from within your app.</p>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/style/touch-feedback.jd b/docs/html/design/style/touch-feedback.jd
new file mode 100644
index 0000000..5fe72a7
--- /dev/null
+++ b/docs/html/design/style/touch-feedback.jd
@@ -0,0 +1,67 @@
+page.title=Touch Feedback
+@jd:body
+
+<div class="layout-content-row" style="margin-bottom: -100px">
+ <div class="layout-content-col span-7">
+
+<p>Use color and illumination to respond to touches, reinforce the resulting behaviors of gestures, and
+indicate what actions are enabled and disabled.</p>
+<p>Whenever a user touches an actionable area in your app, provide a visual response. This lets the
+user know which object was touched and that your app is "listening".</p>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/touch_feedback_reaction_response.png">
+
+ </div>
+</div>
+
+<h4>States</h4>
+
+<div class="vspace size-1"> </div>
+
+<img src="{@docRoot}design/media/touch_feedback_states.png">
+<div class="figure-caption">
+ Most of Android's UI elements have touch-feedback built in, including states that indicate
+ whether touching the element will have any effect.
+</div>
+
+<div class="vspace size-4"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+<h4>Communication</h4>
+<p>When your objects react to more complex gestures, help users understand what the outcome of the
+operation will be. For example, in Recents, when you start swiping a thumbnail left or right, it
+starts to dim. This helps the user understand that swiping will cause the item to be removed.</p>
+
+ </div>
+ <div class="layout-content-col span-9">
+
+ <img src="{@docRoot}design/media/touch_feedback_manipulation.png">
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+ <img src="{@docRoot}design/media/touch_feedback_communication.png">
+
+ </div>
+ <div class="layout-content-col span-6">
+
+<div class="vspace size-3"> </div>
+
+<h4>Boundaries</h4>
+<p>When users try to scroll past the upper or lower limit of a scrollable area, communicate the
+boundary with a visual cue. For example, if a user attempts to scroll past the first home screen
+panel, the screen content tilts to the right to indicate that further navigation in this direction
+is not possible. Many of Android's scrollable UI widgets (e.g. lists or grid lists) already have
+support for boundary feedback built in. If you are building custom, keep boundary feedback in mind
+and provide it from within your app.</p>
+
+ </div>
+</div>
diff --git a/docs/html/design/style/typography.html b/docs/html/design/style/typography.html
deleted file mode 100644
index d9b6d4b..0000000
--- a/docs/html/design/style/typography.html
+++ /dev/null
@@ -1,214 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Typography
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Typography</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<div class="layout-content-row">
- <div class="layout-content-col span-8">
-
- <img src="../static/content/typography_main.png">
-
- </div>
- <div class="layout-content-col span-5">
-
-<p>The Android design language relies on traditional typographic tools such as scale, space, rhythm,
-and alignment with an underlying grid. Successful deployment of these tools is essential to help
-users quickly understand a screen of information. To support such use of typography, Ice Cream
-Sandwich introduced a new type family named Roboto, created specifically for the requirements of UI
-and high-resolution screens. The current TextView framework supports regular, bold, italic, and bold
-italic weights by default.</p>
-
- <img src="../static/content/typography_alphas.png">
-
-<p><a href="https://dl-ssl.google.com/android/design/Roboto_Hinted_20111129.zip">Download Roboto</a></p>
-<p><a href="https://dl-ssl.google.com/android/design/Roboto_Specimen_Book_20111129.pdf">Specimen Book</a></p>
-
- </div>
-</div>
-
-<hr>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6">
-
-<h4>Default type colors</h4>
-<p>The Android UI uses the following default color styles: <code>textColorPrimary</code> and
-<code>textColorSecondary</code>. For light themes use <code>textColorPrimaryInverse</code> and
-<code>textColorSecondaryInverse</code>. The framework text color styles also support variants for
-touch feedback states when used inside UI elements.</p>
-
- <img src="../static/content/typography_defaults.png">
-
- </div>
- <div class="layout-content-col span-6">
-
-<h4>Typographic Scale</h4>
-<p>Contrast in type sizes can go a long way to create ordered, understandable layouts. However, too
-many different sizes in the same UI can be messy. The Android framework uses the following limited
-set of type sizes:</p>
-
-<img src="../static/content/typography_sizes.png">
-
-<p>Users can select a system-wide scaling factor for text in the Settings app. In order to support
-these accessibility features, type should be specified in scale-independent pixels
-(<acronym title="Scale-independent pixels. One sp is one pixel on a 160 dpi screen if the user's global text scale is set to 100%.">sp</acronym>)
-wherever possible. Layouts supporting scalable types should be tested against these settings.</p>
-
- </div>
-</div>
-
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/style/typography.jd b/docs/html/design/style/typography.jd
new file mode 100644
index 0000000..db2fb5f
--- /dev/null
+++ b/docs/html/design/style/typography.jd
@@ -0,0 +1,56 @@
+page.title=Typography
+@jd:body
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-8">
+
+ <img src="{@docRoot}design/media/typography_main.png">
+
+ </div>
+ <div class="layout-content-col span-5">
+
+<p>The Android design language relies on traditional typographic tools such as scale, space, rhythm,
+and alignment with an underlying grid. Successful deployment of these tools is essential to help
+users quickly understand a screen of information. To support such use of typography, Ice Cream
+Sandwich introduced a new type family named Roboto, created specifically for the requirements of UI
+and high-resolution screens. The current TextView framework supports regular, bold, italic, and bold
+italic weights by default.</p>
+
+ <img src="{@docRoot}design/media/typography_alphas.png">
+
+<p><a href="https://dl-ssl.google.com/android/design/Roboto_Hinted_20111129.zip">Download Roboto</a></p>
+<p><a href="https://dl-ssl.google.com/android/design/Roboto_Specimen_Book_20111129.pdf">Specimen Book</a></p>
+
+ </div>
+</div>
+
+<hr>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+
+<h4>Default type colors</h4>
+<p>The Android UI uses the following default color styles: <code>textColorPrimary</code> and
+<code>textColorSecondary</code>. For light themes use <code>textColorPrimaryInverse</code> and
+<code>textColorSecondaryInverse</code>. The framework text color styles also support variants for
+touch feedback states when used inside UI elements.</p>
+
+ <img src="{@docRoot}design/media/typography_defaults.png">
+
+ </div>
+ <div class="layout-content-col span-6">
+
+<h4>Typographic Scale</h4>
+<p>Contrast in type sizes can go a long way to create ordered, understandable layouts. However, too
+many different sizes in the same UI can be messy. The Android framework uses the following limited
+set of type sizes:</p>
+
+<img src="{@docRoot}design/media/typography_sizes.png">
+
+<p>Users can select a system-wide scaling factor for text in the Settings app. In order to support
+these accessibility features, type should be specified in scale-independent pixels
+(<acronym title="Scale-independent pixels. One sp is one pixel on a 160 dpi screen if the user's global text scale is set to 100%.">sp</acronym>)
+wherever possible. Layouts supporting scalable types should be tested against these settings.</p>
+
+ </div>
+</div>
diff --git a/docs/html/design/style/writing.html b/docs/html/design/style/writing.html
deleted file mode 100644
index 146ce88..0000000
--- a/docs/html/design/style/writing.html
+++ /dev/null
@@ -1,487 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>
-
-Android Design - Writing Style
- </title>
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
- <link rel="stylesheet" href="../static/yui-3.3.0-reset-min.css">
- <link rel="stylesheet" href="../static/default.css">
-
-<style>
-
-/* UI tables */
-
-.ui_table {
- width: 100%;
- background: #282828;
- color: #fff;
- border-radius: 2px;
- box-shadow: 0 2px 4px rgba(0,0,0,0.25);
- border-collapse: separate;
-}
-
-.ui_table th,
-.ui_table td {
- padding: 5px 10px;
-}
-
-.ui_table thead th {
- font-weight: 600;
-}
-
-.ui_table tfoot td {
- border-top: 1px solid #494949;
- border-right: 1px solid #494949;
- text-align: center;
-}
-
-.ui_table tfoot td:last-child {
- border-right: 0;
-}
-
-.list_item_margins {
- margin-left: 30px !important;
-}
-
-.example_label {
- margin-bottom: 10px;
- padding-left: 20px;
- background: transparent none no-repeat scroll 0px 3px;
-}
-
-.example_label.bad {
- background-image: url(../static/ico_wrong.png);
-}
-
-.example_label.good {
- background-image: url(../static/ico_good.png);
-}
-
-</style>
-
- </head>
- <body>
-
- <div id="page-container">
-
- <div id="page-header"><a href="../index.html">Android Design</a></div>
-
- <div id="main-row">
-
- <ul id="nav">
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../index.html">Get Started</a></div>
- <ul>
- <li><a href="../get-started/creative-vision.html">Creative Vision</a></li>
- <li><a href="../get-started/principles.html">Design Principles</a></li>
- <li><a href="../get-started/ui-overview.html">UI Overview</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../style/index.html">Style</a></div>
- <ul>
- <li><a href="../style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="../style/themes.html">Themes</a></li>
- <li><a href="../style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="../style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="../style/typography.html">Typography</a></li>
- <li><a href="../style/color.html">Color</a></li>
- <li><a href="../style/iconography.html">Iconography</a></li>
- <li><a href="../style/writing.html">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="../patterns/new-4-0.html">New in Android 4.0</a></li>
- <li><a href="../patterns/gestures.html">Gestures</a></li>
- <li><a href="../patterns/app-structure.html">App Structure</a></li>
- <li><a href="../patterns/navigation.html">Navigation</a></li>
- <li><a href="../patterns/actionbar.html">Action Bar</a></li>
- <li><a href="../patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
- <li><a href="../patterns/swipe-views.html">Swipe Views</a></li>
- <li><a href="../patterns/selection.html">Selection</a></li>
- <li><a href="../patterns/notifications.html">Notifications</a></li>
- <li><a href="../patterns/compatibility.html">Compatibility</a></li>
- <li><a href="../patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="../building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="../building-blocks/tabs.html">Tabs</a></li>
- <li><a href="../building-blocks/lists.html">Lists</a></li>
- <li><a href="../building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="../building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="../building-blocks/spinners.html">Spinners</a></li>
- <li><a href="../building-blocks/buttons.html">Buttons</a></li>
- <li><a href="../building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="../building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="../building-blocks/progress.html">Progress & Activity</a></li>
- <li><a href="../building-blocks/switches.html">Switches</a></li>
- <li><a href="../building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="../building-blocks/pickers.html">Pickers</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header empty"><a href="../downloads/index.html">Downloads</a></div>
- </li>
-
- <li>
- <div id="back-dac-section"><a href="../../index.html">Developers</a></div>
- </li>
-
- </ul>
-
- <div id="content">
-
-
- <div class="layout-content-row content-header">
- <div class="layout-content-col span-9">
- <h2>Writing Style</h2>
- </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
-
-
-
-<p>When choosing words for your app:</p>
-<ol>
-<li>
-<p><strong>Keep it brief.</strong> Be concise, simple and precise. Start with a 30 character limit (including
- spaces), and don't use more unless absolutely necessary.</p>
-</li>
-<li>
-<p><strong>Keep it simple.</strong> Pretend you're speaking to someone who's smart and competent, but doesn't
- know technical jargon and may not speak English very well. Use short words, active verbs, and
- common nouns.</p>
-</li>
-<li>
-<p><strong>Be friendly.</strong> Use contractions. Talk directly to the reader using second person ("you"). If
- your text doesn't read the way you'd say it in casual conversation, it's probably not the way
- you should write it. Don't be abrupt or annoying and make the user feel safe, happy and
- energized.</p>
-</li>
-<li>
-<p><strong>Put the most important thing first.</strong> The first two words (around 11 characters, including
- spaces) should include at least a taste of the most important information in the string. If they
- don't, start over.</p>
-</li>
-<li>
-<p><strong>Describe only what's necessary, and no more.</strong> Don't try to explain subtle differences. They
- will be lost on most users.</p>
-</li>
-<li>
-<p><strong>Avoid repetition.</strong> If a significant term gets repeated within a screen or block of text, find
- a way to use it just once.</p>
-</li>
-</ol>
-
-<h2 id="examples">Examples</h2>
-
-<ol><li class="value-1"><strong>Keep it brief.</strong> From the setup wizard:</ol>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6 list_item_margins">
-
- <div class="example_label bad">Too formal</div>
-
- <table class="ui_table good"><tbody><tr><td>
- Consult the documentation that came with your phone for further instructions.
- </td></tr></tbody></table>
-
- </div>
- <div class="layout-content-col span-6">
-
- <div class="example_label good">Better</div>
-
- <table class="ui_table good"><tbody><tr><td>
- Read the instructions that came with your phone.
- </td></tr></tbody></table>
-
- </div>
-</div>
-
-<div class="vspace size-1"> </div>
-
-<ol><li class="value-2"><strong>Keep it simple.</strong> From the Location settings screen:</ol>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6 list_item_margins">
-
- <div class="example_label bad">Confusing</div>
-
- <table class="ui_table bad">
- <thead>
- <tr>
- <th>
- Use GPS satellites
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- When locating, accurate to street level.
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="layout-content-col span-6">
-
- <div class="example_label good">Better</div>
-
- <table class="ui_table good">
- <thead>
- <tr>
- <th>
- GPS
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Let apps use satellites to pinpoint your location.
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
-</div>
-
-<div class="vspace size-1"> </div>
-
-<ol><li class="value-3"><strong>Be friendly.</strong> Dialog that appears when an application
-crashes:</ol>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6 list_item_margins">
-
- <div class="example_label bad">Confusing and annoying—"Sorry" just rubs salt in the
- wound.</div>
-
- <table class="ui_table bad">
- <thead>
- <tr>
- <th colspan="3">
- Sorry!
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td colspan="3">
- Activity MyAppActivity (in application MyApp)
- is not responding.
- </td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td width="33%">Force close</td>
- <td width="33%">Wait</td>
- <td width="33%">Report</td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="layout-content-col span-6">
-
- <div class="example_label good">Shorter, more direct, no faux-apologetic title:<br><br></div>
-
- <table class="ui_table good">
- <thead>
- <tr>
- <th colspan="3">
- MyApp isn't responding.
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td colspan="3">
- Do you want to close it?
- </td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td width="33%">Wait</td>
- <td width="33%">Report</td>
- <td width="33%">Close</td>
- </tr>
- </tbody>
- </table>
-
- </div>
-</div>
-
-<div class="vspace size-1"> </div>
-
-<ol><li class="value-4"><strong>Put the most important thing first.</strong></ol>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6 list_item_margins">
-
- <div class="example_label bad">Top news last</div>
-
- <table class="ui_table bad"><tbody><tr><td>
- 77 other people +1'd this, including Larry Page.
- </td></tr></tbody></table>
-
- </div>
- <div class="layout-content-col span-6">
-
- <div class="example_label good">Top news first</div>
-
- <table class="ui_table good"><tbody><tr><td>
- Larry Page and 77 others +1'd this.
- </td></tr></tbody></table>
-
- </div>
-</div>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6 list_item_margins">
-
- <div class="example_label bad">Task last</div>
-
- <table class="ui_table bad"><tbody><tr><td>
- Touch Next to complete setup using a Wi-Fi connection.
- </td></tr></tbody></table>
-
- </div>
- <div class="layout-content-col span-6">
-
- <div class="example_label good">Task first</div>
-
- <table class="ui_table good"><tbody><tr><td>
- To finish setup using Wi-Fi, touch Next.
- </td></tr></tbody></table>
-
- </div>
-</div>
-
-<div class="vspace size-1"> </div>
-
-<ol><li class="value-5"><strong>Describe only what's necessary, and no more.</strong></ol>
-
-<div class="layout-content-row">
- <div class="layout-content-col span-6 list_item_margins">
-
- <div class="example_label bad">From a Setup Wizard screen</div>
-
- <table class="ui_table bad">
- <thead>
- <tr>
- <th>
- Signing in...
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Your phone needs to communicate with<br>
- Google servers to sign in to your account.<br>
- This may take up to five minutes.
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="layout-content-col span-6">
-
- <div class="example_label good">From a Setup Wizard screen</div>
-
- <table class="ui_table good">
- <thead>
- <tr>
- <th>
- Signing in...
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Your phone is contacting Google.<br>
- This can take up to 5 minutes.
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
-</div>
-
-
-
-
- <div class="layout-content-row content-footer">
- <div class="paging-links layout-content-col span-9"> </div>
- <div class="paging-links layout-content-col span-4">
- <a href="#" class="prev-page-link">Previous</a>
- <a href="#" class="next-page-link">Next</a>
- </div>
- </div>
-
- </div>
-
- </div>
-
- <div id="page-footer">
-
- <p id="copyright">
- Except as noted, this content is licensed under
- <a href="http://creativecommons.org/licenses/by/2.5/">
- Creative Commons Attribution 2.5</a>.<br>
- For details and restrictions, see the
- <a href="http://developer.android.com/license.html">Content License</a>.
- </p>
-
- <p>
- <a href="http://www.android.com/terms.html">Site Terms of Service</a> –
- <a href="http://www.android.com/privacy.html">Privacy Policy</a> –
- <a href="http://www.android.com/branding.html">Brand Guidelines</a>
- </p>
-
- </div>
- </div>
-
- <script src="../static/jquery-1.6.2.min.js"></script>
- <script>
- var SITE_ROOT = '../';
- </script>
- <script src="../static/default.js"></script>
-
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- var pageTracker = _gat._getTracker("UA-5831155-1");
- pageTracker._trackPageview();
- </script>
- </body>
-</html>
diff --git a/docs/html/design/style/writing.jd b/docs/html/design/style/writing.jd
new file mode 100644
index 0000000..80fd03e
--- /dev/null
+++ b/docs/html/design/style/writing.jd
@@ -0,0 +1,330 @@
+page.title=Writing Style
+@jd:body
+
+<style>
+
+/* UI tables */
+
+.ui_table {
+ width: 100%;
+ background: #282828;
+ color: #fff;
+ border-radius: 2px;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.25);
+ border-collapse: separate;
+}
+
+.ui_table th,
+.ui_table td {
+ padding: 5px 10px;
+}
+
+.ui_table thead th {
+ font-weight: 600;
+}
+
+.ui_table tfoot td {
+ border-top: 1px solid #494949;
+ border-right: 1px solid #494949;
+ text-align: center;
+}
+
+.ui_table tfoot td:last-child {
+ border-right: 0;
+}
+
+.list_item_margins {
+ margin-left: 30px !important;
+}
+
+.example_label {
+ margin-bottom: 10px;
+ padding-left: 20px;
+ background: transparent none no-repeat scroll 0px 3px;
+}
+
+.example_label.bad {
+ background-image: url({@docRoot}assets/design/ico_wrong.png);
+}
+
+.example_label.good {
+ background-image: url({@docRoot}assets/design/ico_good.png);
+}
+
+</style>
+
+<p>When choosing words for your app:</p>
+<ol>
+<li>
+<p><strong>Keep it brief.</strong> Be concise, simple and precise. Start with a 30 character limit (including
+ spaces), and don't use more unless absolutely necessary.</p>
+</li>
+<li>
+<p><strong>Keep it simple.</strong> Pretend you're speaking to someone who's smart and competent, but doesn't
+ know technical jargon and may not speak English very well. Use short words, active verbs, and
+ common nouns.</p>
+</li>
+<li>
+<p><strong>Be friendly.</strong> Use contractions. Talk directly to the reader using second person ("you"). If
+ your text doesn't read the way you'd say it in casual conversation, it's probably not the way
+ you should write it. Don't be abrupt or annoying and make the user feel safe, happy and
+ energized.</p>
+</li>
+<li>
+<p><strong>Put the most important thing first.</strong> The first two words (around 11 characters, including
+ spaces) should include at least a taste of the most important information in the string. If they
+ don't, start over.</p>
+</li>
+<li>
+<p><strong>Describe only what's necessary, and no more.</strong> Don't try to explain subtle differences. They
+ will be lost on most users.</p>
+</li>
+<li>
+<p><strong>Avoid repetition.</strong> If a significant term gets repeated within a screen or block of text, find
+ a way to use it just once.</p>
+</li>
+</ol>
+
+<h2 id="examples">Examples</h2>
+
+<ol><li class="value-1"><strong>Keep it brief.</strong> From the setup wizard:</ol>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6 list_item_margins">
+
+ <div class="example_label bad">Too formal</div>
+
+ <table class="ui_table good"><tbody><tr><td>
+ Consult the documentation that came with your phone for further instructions.
+ </td></tr></tbody></table>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <div class="example_label good">Better</div>
+
+ <table class="ui_table good"><tbody><tr><td>
+ Read the instructions that came with your phone.
+ </td></tr></tbody></table>
+
+ </div>
+</div>
+
+<div class="vspace size-1"> </div>
+
+<ol><li class="value-2"><strong>Keep it simple.</strong> From the Location settings screen:</ol>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6 list_item_margins">
+
+ <div class="example_label bad">Confusing</div>
+
+ <table class="ui_table bad">
+ <thead>
+ <tr>
+ <th>
+ Use GPS satellites
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ When locating, accurate to street level.
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <div class="example_label good">Better</div>
+
+ <table class="ui_table good">
+ <thead>
+ <tr>
+ <th>
+ GPS
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ Let apps use satellites to pinpoint your location.
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ </div>
+</div>
+
+<div class="vspace size-1"> </div>
+
+<ol><li class="value-3"><strong>Be friendly.</strong> Dialog that appears when an application
+crashes:</ol>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6 list_item_margins">
+
+ <div class="example_label bad">Confusing and annoying—"Sorry" just rubs salt in the
+ wound.</div>
+
+ <table class="ui_table bad">
+ <thead>
+ <tr>
+ <th colspan="3">
+ Sorry!
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td colspan="3">
+ Activity MyAppActivity (in application MyApp)
+ is not responding.
+ </td>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <td width="33%">Force close</td>
+ <td width="33%">Wait</td>
+ <td width="33%">Report</td>
+ </tr>
+ </tbody>
+ </table>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <div class="example_label good">Shorter, more direct, no faux-apologetic title:<br><br></div>
+
+ <table class="ui_table good">
+ <thead>
+ <tr>
+ <th colspan="3">
+ MyApp isn't responding.
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td colspan="3">
+ Do you want to close it?
+ </td>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <td width="33%">Wait</td>
+ <td width="33%">Report</td>
+ <td width="33%">Close</td>
+ </tr>
+ </tbody>
+ </table>
+
+ </div>
+</div>
+
+<div class="vspace size-1"> </div>
+
+<ol><li class="value-4"><strong>Put the most important thing first.</strong></ol>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6 list_item_margins">
+
+ <div class="example_label bad">Top news last</div>
+
+ <table class="ui_table bad"><tbody><tr><td>
+ 77 other people +1'd this, including Larry Page.
+ </td></tr></tbody></table>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <div class="example_label good">Top news first</div>
+
+ <table class="ui_table good"><tbody><tr><td>
+ Larry Page and 77 others +1'd this.
+ </td></tr></tbody></table>
+
+ </div>
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6 list_item_margins">
+
+ <div class="example_label bad">Task last</div>
+
+ <table class="ui_table bad"><tbody><tr><td>
+ Touch Next to complete setup using a Wi-Fi connection.
+ </td></tr></tbody></table>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <div class="example_label good">Task first</div>
+
+ <table class="ui_table good"><tbody><tr><td>
+ To finish setup using Wi-Fi, touch Next.
+ </td></tr></tbody></table>
+
+ </div>
+</div>
+
+<div class="vspace size-1"> </div>
+
+<ol><li class="value-5"><strong>Describe only what's necessary, and no more.</strong></ol>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6 list_item_margins">
+
+ <div class="example_label bad">From a Setup Wizard screen</div>
+
+ <table class="ui_table bad">
+ <thead>
+ <tr>
+ <th>
+ Signing in...
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ Your phone needs to communicate with<br>
+ Google servers to sign in to your account.<br>
+ This may take up to five minutes.
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ </div>
+ <div class="layout-content-col span-6">
+
+ <div class="example_label good">From a Setup Wizard screen</div>
+
+ <table class="ui_table good">
+ <thead>
+ <tr>
+ <th>
+ Signing in...
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ Your phone is contacting Google.<br>
+ This can take up to 5 minutes.
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ </div>
+</div>
diff --git a/docs/html/guide/appendix/install-location.jd b/docs/html/guide/appendix/install-location.jd
index e5ed226..63a3817 100644
--- a/docs/html/guide/appendix/install-location.jd
+++ b/docs/html/guide/appendix/install-location.jd
@@ -172,9 +172,9 @@
before the external storage is mounted to the device. If your application is installed on the
external storage, it can never receive this broadcast.</dd>
<dt>Copy Protection</dt>
- <dd>Your application cannot be installed to a device's SD card if it uses Android Market's
- Copy Protection feature. However, if you use Android Market's
- <a href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> instead, your
+ <dd>Your application cannot be installed to a device's SD card if it uses Google Play's
+ Copy Protection feature. However, if you use Google Play's
+ <a href="{@docRoot}guide/market/licensing.html">Application Licensing</a> instead, your
application <em>can</em> be installed to internal or external storage, including SD cards.</dd>
</dl>
diff --git a/docs/html/guide/appendix/market-filters.jd b/docs/html/guide/appendix/market-filters.jd
index d9b2155..3e502d7 100644
--- a/docs/html/guide/appendix/market-filters.jd
+++ b/docs/html/guide/appendix/market-filters.jd
@@ -1,4 +1,4 @@
-page.title=Market Filters
+page.title=Filters on Google Play
@jd:body
<div id="qv-wrapper">
@@ -6,15 +6,15 @@
<h2>Quickview</h2>
<ul>
-<li>Android Market applies filters that control which Android-powered devices can access your
-application on Market.</li>
+<li>Google Play applies filters that control which Android-powered devices can access your
+application when the user is visiting the store.</li>
<li>Filtering is determined by comparing device configurations that you declare in you app's
manifest file to the configurations defined by the device, as well as other factors.</li> </ul>
<h2>In this document</h2>
<ol>
- <li><a href="#how-filters-work">How Filters Work in Android Market</a></li>
+ <li><a href="#how-filters-work">How Filters Work on Google Play</a></li>
<li><a href="#manifest-filters">Filtering based on Manifest Elements</a>
<ol>
<li><a href="#advanced-filters">Advanced manifest filters</a></li>
@@ -47,10 +47,10 @@
<div id="qv-extra">
<img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
<div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0 5px;">
- <h2 style="color:#669999;">Interested in publishing your app on Android Market?</h2>
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0 5px;">
+ <h2 style="color:#669999;padding-top:1em;">Interested in publishing your app on Google Play?</h2>
<p><a id="publish-link"
-href="http://market.android.com/publish">Go to Android Market</a> to create a publisher
+href="http://play.google.com/apps/publish">Go to Google Play</a> to create a publisher
account and upload your app.</p></div>
</div>
@@ -58,44 +58,44 @@
</div>
-<p>When a user searches or browses in Android Market on an Android device, the results are filtered
+<p>When a user searches or browses on Google Play on an Android device, the results are filtered
based on which applications are compatible with that device. For example, if an application
-requires a camera (as specified in the application manifest file), then Android Market will not show
+requires a camera (as specified in the application manifest file), then Google Play will not show
the app on any device that does not have a camera.</p>
<p>Declarations in the manifest file that are compared to the device's configuration is not the
only part of how applications are filtered. Filtering might also occur due to the user's country and
carrier, the presence or absence of a SIM card, and other factors. </p>
-<p>Changes to the Android Market filters are independent of changes to the Android platform itself.
-This document is updated periodically to reflect any changes that affect the way Android Market
+<p>Changes to the Google Play filters are independent of changes to the Android platform itself.
+This document is updated periodically to reflect any changes that affect the way Google Play
filters applications.</p>
-<h2 id="how-filters-work">How Filters Work in Android Market</h2>
+<h2 id="how-filters-work">How Filters Work on Google Play</h2>
-<p>Android Market uses the filter restrictions described below to determine
+<p>Google Play uses the filter restrictions described below to determine
whether to show your application to a user who is browsing or searching for
-applications from the Android Market app. When determining whether to display your app,
-Market checks the device's hardware and software configuration, as well as it's
+applications from the Google Play app. When determining whether to display your app,
+Google Play checks the device's hardware and software configuration, as well as it's
carrier, location, and other characteristics. It then compares those against the
restrictions and dependencies expressed by the application's
manifest file and publishing details. If the application is
-compatible with the device according to the filter rules, Market displays the
-application to the user. Otherwise, Market hides your application from search
+compatible with the device according to the filter rules, Google Play displays the
+application to the user. Otherwise, Google Play hides your application from search
results and category browsing, even if a user specifically requests
-the app by clicking a deep link that points directly to the app's ID within Market..</p>
+the app by clicking a deep link that points directly to the app's ID within Google Play..</p>
<p class="note"><strong>Note:</strong> When users browse the <a
-href="http://market.android.com">Android Market web site</a>, they can see all published
-applications. The Android Market web site compares the application requirements to each of the
+href="http://play.google.com/apps">Google Play web site</a>, they can see all published
+applications. The Google Play web site compares the application requirements to each of the
user's registered devices for compatibility, though, and only allows them to install the application
if it's compatible with their device.</p>
<p>You can use any combination of the available filters for your app. For example, you can set a
<code>minSdkVersion</code> requirement of <code>"4"</code> and set <code>smallScreens="false"</code>
-in the app, then when uploading the app to Market you could target European countries (carriers)
-only. Android Market's filters will thus prevent the application from being available on any device
+in the app, then when uploading the app to Google Play you could target European countries (carriers)
+only. Google Play's filters will thus prevent the application from being available on any device
that does not match all three of these requirements. </p>
<p>All filtering restrictions are associated with an application's version and can
@@ -106,15 +106,15 @@
<h2 id="manifest-filters">Filtering based on Manifest Elements</h2>
-<p>Most Market filters are triggered by elements within an application's
+<p>Most filters are triggered by elements within an application's
manifest file, <a
href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>
(although not everything in the manifest file can trigger filtering).
-Table 1 lists the manifest elements that you should use to trigger Android
-Market filtering, and explains how the filtering for each element works.</p>
+Table 1 lists the manifest elements that you should use to trigger
+filtering, and explains how the filtering for each element works.</p>
<p id="table1" class="table-caption"><strong>Table 1.</strong> Manifest elements that
-trigger filtering on Market.</p>
+trigger filtering on Google Play.</p>
<table>
<tr>
<th>Manifest Element</th>
@@ -129,19 +129,19 @@
<p>An application indicates the screen sizes that it is capable of supporting by
setting attributes of the <code><supports-screens></code> element. When
-the application is published, Market uses those attributes to determine whether
+the application is published, Google Play uses those attributes to determine whether
to show the application to users, based on the screen sizes of their
devices. </p>
-<p>As a general rule, Market assumes that the platform on the device can adapt
+<p>As a general rule, Google Play assumes that the platform on the device can adapt
smaller layouts to larger screens, but cannot adapt larger layouts to smaller
screens. Thus, if an application declares support for "normal" screen size only,
-Market makes the application available to both normal- and large-screen devices,
+Google Play makes the application available to both normal- and large-screen devices,
but filters the application so that it is not available to small-screen
devices.</p>
<p>If an application does not declare attributes for
-<code><supports-screens></code>, Market uses the default values for those
+<code><supports-screens></code>, Google Play uses the default values for those
attributes, which vary by API Level. Specifically: </p>
<ul>
@@ -150,7 +150,7 @@
minSdkVersion</a></code> or <code><a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">android:
targetSdkVersion</a></code> to 3 or lower, the <code><supports-screens></code> element itself
-is undefined and no attributes are available. In this case, Market assumes that
+is undefined and no attributes are available. In this case, Google Play assumes that
the application is designed for normal-size screens and shows the application to
devices that have normal or larger screens. </p>
@@ -166,19 +166,19 @@
<p><strong>Example 1</strong><br />
The manifest declares <code><uses-sdk android:minSdkVersion="3"></code>
and does not include a <code><supports-screens></code> element.
- <strong>Result</strong>: Android Market does not show the app to a user of a
- small-screen device, but does show it to users of normal and large-screen
- devices, unless other filters also exclude those devices. </p>
+ <strong>Result</strong>: Google Play will not show the app to a user of a
+ small-screen device, but will show it to users of normal and large-screen
+ devices, unless other filters apply. </p>
<p><strong>Example 2<br />
</strong>The manifest declares <code><uses-sdk android:minSdkVersion="3"
android:targetSdkVersion="4"></code> and does not include a
<code><supports-screens></code> element.
- <strong>Result</strong>: Android Market will show the app to users on all
+ <strong>Result</strong>: Google Play will show the app to users on all
devices, unless other filters apply. </p>
<p><strong>Example 3<br />
</strong>The manifest declares <code><uses-sdk android:minSdkVersion="4"></code>
and does not include a <code><supports-screens></code> element.
- <strong>Result</strong>: Android Market will show the app to all users,
+ <strong>Result</strong>: Google Play will show the app to all users,
unless other filters apply. </p>
<p>For more information on how to declare support for screen sizes in your
application, see <code><a
@@ -195,11 +195,11 @@
Configuration: <br />
keyboard, navigation, touch screen</td>
<td valign="top"><p>An application can
- request certain hardware features, and Android Market will show the app only on devices that have the required hardware.</p>
+ request certain hardware features, and Google Play will show the app only on devices that have the required hardware.</p>
<p><strong>Example 1<br />
- </strong>The manifest includes <code><uses-configuration android:reqFiveWayNav="true" /></code>, and a user is searching for apps on a device that does not have a five-way navigational control. <strong>Result</strong>: Android Market will not show the app to the user. </p>
+ </strong>The manifest includes <code><uses-configuration android:reqFiveWayNav="true" /></code>, and a user is searching for apps on a device that does not have a five-way navigational control. <strong>Result</strong>: Google Play will not show the app to the user. </p>
<p><strong>Example 2<br />
- </strong>The manifest does not include a <code><uses-configuration></code> element. <strong>Result</strong>: Android Market will show the app to all users, unless other filters apply.</p>
+ </strong>The manifest does not include a <code><uses-configuration></code> element. <strong>Result</strong>: Google Play will show the app to all users, unless other filters apply.</p>
<p>For more details, see <a
href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><code><uses-configuration></code></a>.</p></td>
</tr>
@@ -218,16 +218,16 @@
</strong>The manifest includes <code><uses-feature
android:name="android.hardware.sensor.light" /></code>, and a user
is searching for apps on a device that does not have a light sensor.
-<strong>Result</strong>: Android Market will not show the app to the user. </p>
+<strong>Result</strong>: Google Play will not show the app to the user. </p>
<p><strong>Example 2<br />
</strong>The manifest does not include a <code><uses-feature></code>
-element. <strong>Result</strong>: Android Market will show the app to all users,
+element. <strong>Result</strong>: Google Play will show the app to all users,
unless other filters apply.</p>
<p>For complete information, see <code><a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a>
</code>.</p>
- <p><em>Filtering based on implied features:</em> In some cases, Android
-Market interprets permissions requested through
+ <p><em>Filtering based on implied features:</em> In some cases, Google
+Play interprets permissions requested through
<code><uses-permission></code> elements as feature requirements equivalent
to those declared in <code><uses-feature></code> elements. See <a
href="#uses-permission-filtering"><code><uses-permission></code></a>,
@@ -245,19 +245,19 @@
<p><strong>Example 1<br />
</strong>An app
requests multiple OpenGL-ES versions by specifying <code>openGlEsVersion</code> multiple times in the
- manifest. <strong>Result</strong>: Market assumes that the app requires the highest of the indicated versions.</p>
+ manifest. <strong>Result</strong>: Google Play assumes that the app requires the highest of the indicated versions.</p>
<p><strong>Example 2<br />
</strong>An app
- requests OpenGL-ES version 1.1, and a user is searching for apps on a device that supports OpenGL-ES version 2.0. <strong>Result</strong>: Android Market will show the app to the user, unless other filters apply. If a
- device reports that it supports OpenGL-ES version <em>X</em>, Market assumes that it
+ requests OpenGL-ES version 1.1, and a user is searching for apps on a device that supports OpenGL-ES version 2.0. <strong>Result</strong>: Google Play will show the app to the user, unless other filters apply. If a
+ device reports that it supports OpenGL-ES version <em>X</em>, Google Play assumes that it
also supports any version earlier than <em>X</em>.
</p>
<p><strong>Example 3<br />
</strong>A user is searching for apps on a device that does not
- report an OpenGL-ES version (for example, a device running Android 1.5 or earlier). <strong>Result</strong>: Android Market assumes that the device
- supports only OpenGL-ES 1.0. Market will only show the user apps that do not specify <code>openGlEsVersion</code>, or apps that do not specify an OpenGL-ES version higher than 1.0. </p>
+ report an OpenGL-ES version (for example, a device running Android 1.5 or earlier). <strong>Result</strong>: Google Play assumes that the device
+ supports only OpenGL-ES 1.0. Google Play will only show the user apps that do not specify <code>openGlEsVersion</code>, or apps that do not specify an OpenGL-ES version higher than 1.0. </p>
<p><strong>Example 4<br />
- </strong>The manifest does not specify <code>openGlEsVersion</code>. <strong>Result</strong>: Android Market will show the app to all users, unless other filters apply. </p>
+ </strong>The manifest does not specify <code>openGlEsVersion</code>. <strong>Result</strong>: Google Play will show the app to all users, unless other filters apply. </p>
<p>For more details, see <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>.</p></td>
</tr>
@@ -268,28 +268,28 @@
<td valign="top"><p>An application can require specific
shared libraries to be present on the device. </p>
<p><strong>Example 1<br />
- </strong>An app requires the <code>com.google.android.maps</code> library, and a user is searching for apps on a device that does not have the <code>com.google.android.maps</code> library. <strong>Result</strong>: Android Market will not show the app to the user. </p>
+ </strong>An app requires the <code>com.google.android.maps</code> library, and a user is searching for apps on a device that does not have the <code>com.google.android.maps</code> library. <strong>Result</strong>: Google Play will not show the app to the user. </p>
<p><strong>Example 2</strong><br />
- The manifest does not include a <code><uses-library></code> element. <strong>Result</strong>: Android Market will show the app to all users, unless other filters apply.</p>
+ The manifest does not include a <code><uses-library></code> element. <strong>Result</strong>: Google Play will show the app to all users, unless other filters apply.</p>
<p>For more details, see <a
href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code><uses-library></code></a>.</p></td>
</tr>
<tr id="uses-permission-filtering">
<td valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code></td>
<td valign="top"> </td>
- <td valign="top">Strictly, Android Market does not filter based on
+ <td valign="top">Strictly, Google Play does not filter based on
<code><uses-permission></code> elements. However, it does read the
elements to determine whether the application has hardware feature requirements
that may not have been properly declared in <code><uses-feature></code>
elements. For example, if an application requests the <code>CAMERA</code>
permission but does not declare a <code><uses-feature></code> element for
-<code>android.hardware.camera</code>, Android Market considers that the
+<code>android.hardware.camera</code>, Google Play considers that the
application requires a camera and should not be shown to users whose devices do
not offer a camera.</p>
<p>In general, if an application requests hardware-related permissions,
-Android Market assumes that the application requires the underlying hardware
+Google Play assumes that the application requires the underlying hardware
features, even though there might be no corresponding to
-<code><uses-feature></code> declarations. Android Market then sets up
+<code><uses-feature></code> declarations. Google Play then sets up
filtering based on the features implied by the <code><uses-feature></code>
declarations.</p>
<p>For a list of permissions that imply hardware features, see
@@ -305,9 +305,9 @@
<td valign="top"><p>An application can require a minimum API level. </p>
<p><strong>Example 1</strong><br />
The manifest includes <code><uses-sdk
- android:minSdkVersion="3"></code>, and the app uses APIs that were introduced in API Level 3. A user is searching for apps on a device that has API Level 2. <strong>Result</strong>: Android Market will not show the app to the user. </p>
+ android:minSdkVersion="3"></code>, and the app uses APIs that were introduced in API Level 3. A user is searching for apps on a device that has API Level 2. <strong>Result</strong>: Google Play will not show the app to the user. </p>
<p><strong>Example 2</strong><br />
- The manifest does not include <code>minSdkVersion</code>, and the app uses APIs that were introduced in API Level 3. A user is searching for apps on a device that has API Level 2. <strong>Result</strong>: Android Market assumes that <code>minSdkVersion</code> is "1" and that the app is compatible with all versions of Android. Market shows the app to the user and allows the user to download the app. The app crashes at runtime. </p>
+ The manifest does not include <code>minSdkVersion</code>, and the app uses APIs that were introduced in API Level 3. A user is searching for apps on a device that has API Level 2. <strong>Result</strong>: Google Play assumes that <code>minSdkVersion</code> is "1" and that the app is compatible with all versions of Android. Google Play shows the app to the user and allows the user to download the app. The app crashes at runtime. </p>
<p>Because you want to avoid this second scenario, we recommend that you always declare a <code>minSdkVersion</code>. For details, see <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min"><code>android:minSdkVersion</code></a>.</p></td>
</tr>
@@ -316,7 +316,7 @@
<td valign="top"><p><em>Deprecated.</em> Android
2.1 and later do not check or enforce the <code>maxSdkVersion</code> attribute, and
the SDK will not compile if <code>maxSdkVersion</code> is set in an app's manifest. For devices already
- compiled with <code>maxSdkVersion</code>, Market will respect it and use it for
+ compiled with <code>maxSdkVersion</code>, Google Play will respect it and use it for
filtering.</p>
<p> Declaring <code>maxSdkVersion</code> is <em>not</em> recommended. For details, see <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#max"><code>android:maxSdkVersion</code></a>.</p></td>
@@ -327,7 +327,7 @@
<h3 id="advanced-filters">Advanced manifest filters</h3>
-<p>In addition to the manifest elements in <a href="#table1">table 1</a>, Android Market can also
+<p>In addition to the manifest elements in <a href="#table1">table 1</a>, Google Play can also
filter applications based on the advanced manifest elements in table 2.</p>
<p>These manifest elements and the filtering they trigger are for exceptional use-cases
@@ -336,14 +336,14 @@
these filters</strong>.</p>
<p id="table2" class="table-caption"><strong>Table 2.</strong> Advanced manifest elements for
-Android Market filtering.</p>
+Google Play filtering.</p>
<table>
<tr><th>Manifest Element</th><th>Summary</th></tr>
<tr>
<td><nobr><a href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
<compatible-screens>}</a></nobr></td>
<td>
- <p>Android Market filters the application if the device screen size and density does not match
+ <p>Google Play filters the application if the device screen size and density does not match
any of the screen configurations (declared by a {@code <screen>} element) in the {@code
<compatible-screens>} element.</p>
<p class="caution"><strong>Caution:</strong> Normally, <strong>you should not use
@@ -360,7 +360,7 @@
<td><nobr><a href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
<supports-gl-texture>}</a></nobr></td>
<td>
- <p>Android Market filters the application unless one or more of the GL texture compression
+ <p>Google Play filters the application unless one or more of the GL texture compression
formats supported by the application are also supported by the device. </p>
</td>
</tr>
@@ -370,16 +370,16 @@
<h2 id="other-filters">Other Filters</h2>
-<p>Android Market uses other application characteristics to determine whether to show or hide an application for a particular user on a given device, as described in the table below. </p>
+<p>Google Play uses other application characteristics to determine whether to show or hide an application for a particular user on a given device, as described in the table below. </p>
<p id="table3" class="table-caption"><strong>Table 3.</strong> Application and publishing
-characteristics that affect filtering on Market.</p>
+characteristics that affect filtering on Google Play.</p>
<table> <tr>
<th>Filter Name</th> <th>How It Works</th> </tr>
<tr>
<td valign="top">Publishing Status</td> <td valign="top"><p>Only published applications will appear in
- searches and browsing within Android Market.</p> <p>Even if an app is unpublished, it can
+ searches and browsing within Google Play.</p> <p>Even if an app is unpublished, it can
be installed if users can see it in their Downloads area among their purchased,
installed, or recently uninstalled apps.</p> <p>If an application has been
suspended, users will not be able to reinstall or update it, even if it appears in their Downloads.</p> </td></tr>
@@ -390,10 +390,10 @@
country (as determined by SIM carrier) in which paid apps are available.</p></td>
</tr> <tr>
<td valign="top">Country / Carrier Targeting</td> <td valign="top"> <p>When you upload your app to
- the Android Market, you can select specific countries to target. The app will only
+ Google Play, you can select specific countries to target. The app will only
be visible to the countries (carriers) that you select, as follows:</p>
<ul><li><p>A device's country is determined based on the carrier, if a carrier is
- available. If no carrier can be determined, the Market application tries to
+ available. If no carrier can be determined, Google Play tries to
determine the country based on IP.</p></li> <li><p>Carrier is determined based on
the device's SIM (for GSM devices), not the current roaming carrier.</p></li></ul>
</td> </tr> <tr>
@@ -404,22 +404,22 @@
Android NDK?</a></p> </tr> <tr>
<td valign="top">Copy-Protected Applications</td> <td valign="top"><p>To
copy protect an application, set copy protection to "On" when you configure publishing
-options for your application. Market will not show copy-protected applications on
+options for your application. Google Play will not show copy-protected applications on
developer devices or unreleased devices.</p></td> </tr> </table>
<h2 id="MultiApks">Publishing Multiple APKs with Different Filters</h2>
-<p>Some specific Android Market filters allow you to publish multiple APKs for the same
+<p>Some specific Google Play filters allow you to publish multiple APKs for the same
application in order to provide a different APK to different device configurations. For example, if
you're creating a video game that uses high-fidelity graphic assets, you might want to create
two APKs that each support different texture compression formats. This way, you can reduce the
size of the APK file by including only the textures that are required for each device
-configuration. Depending on each device's support for your texture compression formats, Android
-Market will deliver it the APK that you've declared to support that device.</p>
+configuration. Depending on each device's support for your texture compression formats, Google
+Play will deliver it the APK that you've declared to support that device.</p>
-<p>Currently, Android Market allows you to publish multiple APKs for the same application only
+<p>Currently, Google Play allows you to publish multiple APKs for the same application only
when each APK provides different filters based on the following configurations:</p>
<ul>
<li>OpenGL texture compression formats
@@ -440,7 +440,7 @@
</ul>
<p>All other filters still work the same as usual, but these three are the only filters that can
-distinguish one APK from another within the same application listing on Android Market. For example,
+distinguish one APK from another within the same application listing on Google Play. For example,
you <em>cannot</em> publish multiple APKs for the same application if the APKs differ only based on
whether the device has a camera.</p>
@@ -450,5 +450,5 @@
requires that you follow specific rules within your filters and that you pay extra attention to the
version codes for each APK to ensure proper update paths for each configuration.</p>
-<p>If you need more information about how to publish multiple APKs on Android Market, read <a
+<p>If you need more information about how to publish multiple APKs on Google Play, read <a
href="{@docRoot}guide/market/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
diff --git a/docs/html/guide/developing/building/index.jd b/docs/html/guide/developing/building/index.jd
index 59c4645..569cd28 100644
--- a/docs/html/guide/developing/building/index.jd
+++ b/docs/html/guide/developing/building/index.jd
@@ -27,8 +27,8 @@
<p>To run an application on an emulator or device, the application must be signed using debug or
release mode. You typically want to sign your application in debug mode when you develop and test
your application, because the build tools use a debug key with a known password so you do not have
- to enter it every time you build. When you are ready to release the application to Android
- Market, you must sign the application in release mode, using your own private key.</p>
+ to enter it every time you build. When you are ready to release the application to Google
+ Play, you must sign the application in release mode, using your own private key.</p>
<p>Fortunately, Eclipse or your Ant build script signs the application for you in debug mode
when you build your application. You can also easily setup Eclipse or your Ant build to sign your
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index fd2ec93..9d5064e 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -444,12 +444,12 @@
</li>
<li>
- <span class="heading">
- <span class="en">Android Market Topics</span>
- </span>
+ <h2>
+ <span class="en">Google Play Topics</span>
+ </h2>
<ul>
<li><a href="<?cs var:toroot ?>guide/publishing/publishing.html">
- <span class="en">Publishing on Android Market</span>
+ <span class="en">Publishing on Google Play</span>
</a></li>
<li class="toggle-list">
<div><a href="<?cs var:toroot ?>guide/market/licensing/index.html">
@@ -496,7 +496,7 @@
</ul>
</li>
<li><a href="<?cs var:toroot ?>guide/appendix/market-filters.html">
- <span class="en">Market Filters</span></a>
+ <span class="en">Filters on Google Play</span></a>
</li>
<li><a href="<?cs var:toroot ?>guide/market/publishing/multiple-apks.html">
<span class="en">Multiple APK Support</span></a>
diff --git a/docs/html/guide/index.jd b/docs/html/guide/index.jd
index 38f71c0..8378472 100644
--- a/docs/html/guide/index.jd
+++ b/docs/html/guide/index.jd
@@ -34,9 +34,9 @@
designing a user interface and setting up resources to storing
data and using permissions — as needed.</dd>
-<dt><b>Android Market Topics</b></dt>
-<dd>Documentation for topics that concern publishing and monetizing applications on Android
-Market, such as how to enforce licensing policies and implement in-app billing.</dd>
+<dt><b>Google Play Topics</b></dt>
+<dd>Documentation for topics that concern publishing and monetizing applications on Google Play,
+such as how to enforce licensing policies and implement in-app billing.</dd>
<dt><b>Developing</b></dt>
<dd>Directions for using Android's development and debugging tools,
diff --git a/docs/html/guide/market/billing/billing_admin.jd b/docs/html/guide/market/billing/billing_admin.jd
index a84eb4e..0f869ab 100755
--- a/docs/html/guide/market/billing/billing_admin.jd
+++ b/docs/html/guide/market/billing/billing_admin.jd
@@ -38,19 +38,19 @@
few administrative tasks, including setting up and maintaining your product list on the publisher
site, registering test accounts, and handling refunds when necessary.</p>
-<p>You must have an Android Market publisher account to register test accounts. And you must have a
+<p>You must have a Google Play publisher account to register test accounts. And you must have a
Google Checkout merchant account to create a product list and issue refunds to your users. If you
-already have a publisher account on Android Market, you can use your existing account. You do not
+already have a publisher account on Google Play, you can use your existing account. You do not
need to register for a new account to support in-app billing. If you do not have a publisher
-account, you can register as an Android Market developer and set up a publisher account at the
-Android Market <a href="http://market.android.com/publish">publisher site</a>. If you do not have a
+account, you can register as a Google Play developer and set up a publisher account at the
+Google Play <a href="http://play.google.com/apps/publish">publisher site</a>. If you do not have a
Google Checkout merchant account, you can register for one at the <a
href="http://checkout.google.com">Google Checkout site</a>.</p>
<h2 id="billing-list-setup">Creating a Product List</h2>
-<p>The Android Market publisher site provides a product list for each of your published
-applications. You can sell an item using Android Market's in-app billing feature only if the item is
+<p>The Google Play publisher site provides a product list for each of your published
+applications. You can sell an item using Google Play's in-app billing feature only if the item is
listed on an application's product list. Each application has its own product list; you cannot sell
items that are listed in another application's product list.</p>
@@ -77,7 +77,7 @@
</p>
<p>You can create a product list for any published application or any draft application that's been
-uploaded and saved to the Android Market site. However, you must have a Google Checkout merchant
+uploaded and saved to the Google Play site. However, you must have a Google Checkout merchant
account and the application's manifest must include the <code>com.android.vending.BILLING</code>
permission. If an application's manifest does not include this permission, you will be able to edit
existing items in the product list but you will not be able to add new items to the list. For more
@@ -104,8 +104,8 @@
<p>To add an item to a product list using the In-app Products UI, follow these steps:</p>
<ol>
- <li><a href="http://market.android.com/publish">Log in</a> to your publisher account.</li>
- <li>In the <strong>All Android Market listings</strong> panel, under the application name, click
+ <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
+ <li>In the <strong>All Google Play listings</strong> panel, under the application name, click
<strong>In-app Products</strong>.</li>
<li>On the In-app Products List page, click <strong>Add in-app product</strong>.</li>
<li>On the Create New In-app Product page (see figure 3), provide details about the item you are
@@ -137,7 +137,7 @@
<li><strong>Publishing State</strong>
<p>An item's publishing state can be <strong>Published</strong> or <strong>Unpublished
</strong>. To be visible to a user during checkout, an item's publishing state must be set to
- <strong>Published</strong> and the item's application must be published on Android Market.</p>
+ <strong>Published</strong> and the item's application must be published on Google Play.</p>
<p class="note"><strong>Note:</strong> This is not true for test accounts. An item is visible to
a test account if the application is not published and the item is published. See <a
href="{@docRoot}guide/market/billing/billing_testing.html#billing-testing-real">Testing In-app
@@ -167,9 +167,9 @@
<p>You must provide a default price in your home currency. You can also provide prices in other
currencies, but you can do this only if a currency's corresponding country is listed as a
target country for your application. You can specify target countries on the Edit Application
- page in the Android Market developer console.</p>
+ page in the Google Play developer console.</p>
<p>To specify prices in other currencies, you can manually enter the price for each
- currency or you can click <strong>Auto Fill</strong> and let Android Market do a one-time
+ currency or you can click <strong>Auto Fill</strong> and let Google Play do a one-time
conversion from your home currency to the currencies you are targeting (see figure 4).</p>
</li>
</ul>
@@ -357,8 +357,8 @@
<p>To import the items that are specified in your CSV file, do the following:</p>
<ol>
- <li><a href="http://market.android.com/publish">Log in</a> to your publisher account.</li>
- <li>In the <strong>All Android Market listings</strong> panel, under the application name, click
+ <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
+ <li>In the <strong>All Google Play listings</strong> panel, under the application name, click
<strong>In-app Products</strong>.</li>
<li>On the In-app Products List page, click <strong>Choose File</strong> and select your CSV
file.
@@ -381,17 +381,17 @@
<h3 id="billing-purchase-type">Choosing a Purchase Type</h3>
-<p>An item's purchase type controls how Android Market manages the purchase of the item. There are
+<p>An item's purchase type controls how Google Play manages the purchase of the item. There are
two purchase types: "managed per user account" and "unmanaged."</p>
<p>Items that are managed per user account can be purchased only once per user account. When an item
-is managed per user account, Android Market permanently stores the transaction information for each
-item on a per-user basis. This enables you to query Android Market with the
+is managed per user account, Google Play permanently stores the transaction information for each
+item on a per-user basis. This enables you to query Google Play with the
<code>RESTORE_TRANSACTIONS</code> request and restore the state of the items a specific user has
purchased.</p>
-<p>If a user attempts to purchase a managed item that has already been purchased, Android Market
-displays an "Item already purchased" error. This occurs during checkout, when Android Market
+<p>If a user attempts to purchase a managed item that has already been purchased, Google Play
+displays an "Item already purchased" error. This occurs during checkout, when Google Play
displays the price and description information on the checkout page. When the user dismisses the
error message, the checkout page disappears and the user returns to your user interface. As a best
practice, your application should prevent the user from seeing this error. The sample application
@@ -404,10 +404,10 @@
user reinstalls your application, wipes the data on their device, or installs your application on a
new device.</p>
-<p>Items that are unmanaged do not have their transaction information stored on Android Market,
-which means you cannot query Android Market to retrieve transaction information for items whose
+<p>Items that are unmanaged do not have their transaction information stored on Google Play,
+which means you cannot query Google Play to retrieve transaction information for items whose
purchase type is listed as unmanaged. You are responsible for managing the transaction information
-of unmanaged items. Also, unmanaged items can be purchased multiple times as far as Android Market
+of unmanaged items. Also, unmanaged items can be purchased multiple times as far as Google Play
is concerned, so it's also up to you to control how many times an unmanaged item can be
purchased.</p>
@@ -417,10 +417,10 @@
<h2 id="billing-refunds">Handling Refunds</h2>
-<p>In-app billing does not allow users to send a refund request to Android Market. Refunds for
+<p>In-app billing does not allow users to send a refund request to Google Play. Refunds for
in-app purchases must be directed to you (the application developer). You can then process the
-refund through your Google Checkout merchant account. When you do this, Android Market receives a
-refund notification from Google Checkout, and Android Market sends a refund message to your
+refund through your Google Checkout merchant account. When you do this, Google Play receives a
+refund notification from Google Checkout, and Google Play sends a refund message to your
application. For more information, see <a
href="{@docRoot}guide/market/billing/billing_overview.html#billing-action-notify">Handling
IN_APP_NOTIFY messages</a> and <a
@@ -434,9 +434,9 @@
<h2 id="billing-testing-setup">Setting Up Test Accounts</h2>
-<p>The Android Market publisher site lets you set up one or more test accounts. A test account is a
+<p>The Google Play publisher site lets you set up one or more test accounts. A test account is a
regular Google account that you register on the publisher site as a test account. Test accounts are
-authorized to make in-app purchases from applications that you have uploaded to the Android Market
+authorized to make in-app purchases from applications that you have uploaded to the Google Play
site but have not yet published.</p>
<p>You can use any Google account as a test account. Test accounts are useful if you want to let
@@ -458,7 +458,7 @@
<p>To add test accounts to your publisher account, follow these steps:</p>
<ol>
- <li><a href="http://market.android.com/publish">Log in</a> to your publisher account.</li>
+ <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
<li>On the upper left part of the page, under your name, click <strong>Edit profile</strong>.</li>
<li>On the Edit Profile page, scroll down to the Licensing & In-app Billing panel (see figure
5).</li>
@@ -480,7 +480,7 @@
correct forum, you can get the support you need more quickly.</p>
<p class="table-caption" id="support-table"><strong>Table 2.</strong> Developer support resources
-for Android Market in-app billing.</p>
+for Google Play in-app billing.</p>
<table>
@@ -502,8 +502,8 @@
android</a></td>
</tr>
<tr>
-<td>Market billing issue tracker</td>
-<td><a href="http://code.google.com/p/marketbilling/issues/">Market billing
+<td>Billing issue tracker</td>
+<td><a href="http://code.google.com/p/marketbilling/issues/">Billing
project issue tracker</a></td>
<td>Bug and issue reports related specifically to in-app billing sample code.</td>
</tr>
diff --git a/docs/html/guide/market/billing/billing_best_practices.jd b/docs/html/guide/market/billing/billing_best_practices.jd
index d9776af..e100ce5 100755
--- a/docs/html/guide/market/billing/billing_best_practices.jd
+++ b/docs/html/guide/market/billing/billing_best_practices.jd
@@ -32,7 +32,7 @@
<p>As you design your in-app billing implementation, be sure to follow the security and design
guidelines that are discussed in this document. These guidelines are recommended best practices for
-anyone who is using Android Market's in-app billing service.</p>
+anyone who is using Google Play's in-app billing service.</p>
<h2>Security Best Practices</h2>
@@ -92,7 +92,7 @@
nonces on the server.</p>
<h4>Take action against trademark and copyright infringement</h4>
-<p>If you see your content being redistributed on Android Market, act quickly and decisively. File a
+<p>If you see your content being redistributed on Google Play, act quickly and decisively. File a
<a href="http://market.android.com/support/bin/answer.py?hl=en&answer=141511">trademark notice
of infringement</a> or a <a href="http://www.google.com/android_dmca.html">copyright notice of
infringement</a>.</p>
@@ -102,7 +102,7 @@
purchase state of the unlocked content whenever a user accesses the content. This allows you to
revoke use when necessary and minimize piracy.</p>
-<h4>Protect your Android Market public key</h4>
+<h4>Protect your Google Play public key</h4>
<p>To keep your public key safe from malicious users and hackers, do not embed it in any code as a
literal string. Instead, construct the string at runtime from pieces or use bit manipulation (for
example, XOR with some other string) to hide the actual key. The key itself is not secret
diff --git a/docs/html/guide/market/billing/billing_integrate.jd b/docs/html/guide/market/billing/billing_integrate.jd
index 6017583..b49dc25 100755
--- a/docs/html/guide/market/billing/billing_integrate.jd
+++ b/docs/html/guide/market/billing/billing_integrate.jd
@@ -35,8 +35,8 @@
</div>
</div>
-<p>Android Market In-app Billing provides a straightforward, simple interface for sending in-app
-billing requests and managing in-app billing transactions using Android Market. This document helps
+<p>In-app Billing on Google Play provides a straightforward, simple interface for sending in-app
+billing requests and managing in-app billing transactions using Google Play. This document helps
you implement in-app billing by stepping through the primary implementation tasks, using the in-app
billing sample application as an example.</p>
@@ -53,23 +53,23 @@
<li><a href="#billing-permission">Update your AndroidManifest.xml file</a>.</li>
<li><a href="#billing-service">Create a Service</a> and bind it to the
<code>MarketBillingService</code> so your application can send billing requests and receive
- billing responses from the Android Market application.</li>
+ billing responses from Google Play.</li>
<li><a href="#billing-broadcast-receiver">Create a BroadcastReceiver</a> to handle broadcast
- intents from the Android Market application.</li>
+ intents from Google Play.</li>
<li><a href="#billing-signatures">Create a security processing component</a> to verify the
- integrity of the transaction messages that are sent by Android Market .</li>
+ integrity of the transaction messages that are sent by Google Play.</li>
<li><a href="#billing-implement">Modify your application code</a> to support in-app billing.</li>
</ol>
<h2 id="billing-download">Downloading the Sample Application</h2>
<p>The in-app billing sample application shows you how to perform several tasks that are common to
-all Android Market in-app billing implementations, including:</p>
+all in-app billing implementations, including:</p>
<ul>
- <li>Sending in-app billing requests to the Android Market application.</li>
- <li>Handling synchronous responses from the Android Market application.</li>
- <li>Handling broadcast intents (asynchronous responses) from the Android Market application.</li>
+ <li>Sending in-app billing requests to Google Play.</li>
+ <li>Handling synchronous responses from Google Play.</li>
+ <li>Handling broadcast intents (asynchronous responses) from Google Play.</li>
<li>Using in-app billing security mechanisms to verify the integrity of billing responses.</li>
<li>Creating a user interface that lets users select items for purchase.</li>
</ul>
@@ -91,8 +91,8 @@
<tr>
<td>IMarketBillingService.aidl</td>
-<td>Android Interface Definition Library (AIDL) file that defines the IPC interface to Android
-Market's in-app billing service (<code>MarketBillingService</code>).</td>
+<td>Android Interface Definition Library (AIDL) file that defines the IPC interface to Google
+Play's in-app billing service (<code>MarketBillingService</code>).</td>
</tr>
<tr>
@@ -109,12 +109,12 @@
<tr>
<td>BillingReceiver.java</td>
<td>A {@link android.content.BroadcastReceiver} that receives asynchronous response messages
- (broadcast intents) from Android Market. Forwards all messages to the
+ (broadcast intents) from Google Play. Forwards all messages to the
<code>BillingService</code>.</td>
</tr>
<tr>
<td>BillingService.java</td>
- <td>A {@link android.app.Service} that sends messages to Android Market on behalf of the
+ <td>A {@link android.app.Service} that sends messages to Google Play on behalf of the
application by connecting (binding) to the <code>MarketBillingService</code>.</td>
</tr>
@@ -136,8 +136,8 @@
<tr>
<td>Consts.java</td>
-<td>Defines various Android Market constants and sample application constants. All constants that
-are defined by Android Market must be defined the same way in your application.</td>
+<td>Defines various Google Play constants and sample application constants. All constants that
+are defined by Google Play must be defined the same way in your application.</td>
</tr>
<tr>
@@ -171,7 +171,7 @@
<ul>
<li>Configuring and building the sample application.</li>
- <li>Uploading the sample application to Android Market.</li>
+ <li>Uploading the sample application to Google Play.</li>
<li>Setting up test accounts and running the sample application.</li>
</ul>
@@ -186,12 +186,12 @@
following:</p>
<ol>
- <li><strong>Add your Android Market public key to the sample application code.</strong>
+ <li><strong>Add your Google Play public key to the sample application code.</strong>
<p>This enables the application to verify the signature of the transaction information that is
- returned from Android Market. To add your public key to the sample application code, do the
+ returned from Google Play. To add your public key to the sample application code, do the
following:</p>
<ol>
- <li>Log in to your Android Market <a href="http://market.android.com/publish">publisher
+ <li>Log in to your Google Play <a href="http://play.google.com/apps/publish">publisher
account</a>.</li>
<li>On the upper left part of the page, under your name, click <strong>Edit
Profile</strong>.</li>
@@ -208,7 +208,7 @@
</ol>
</li>
<li><strong>Change the package name of the sample application.</strong>
- <p>The current package name is <code>com.example.dungeons</code>. Android Market does not let
+ <p>The current package name is <code>com.example.dungeons</code>. Google Play does not let
you upload applications with package names that contain <code>com.example</code>, so you must
change the package name to something else.</p>
</li>
@@ -221,14 +221,14 @@
<h3>Uploading the sample application</h3>
<p>After you build a release version of the sample application and sign it, you need to upload it as
-a draft to the Android Market publisher site. You also need to create a product list for the in-app
+a draft to the Google Play publisher site. You also need to create a product list for the in-app
items that are available for purchase in the sample application. The following instructions show you
how to do this.</p>
<ol>
- <li><strong>Upload the release version of the sample application to Android Market.</strong>
+ <li><strong>Upload the release version of the sample application to Google Play.</strong>
<p>Do not publish the sample application; leave it as an unpublished draft application. The
sample application is for demonstration purposes only and should not be made publicly available
- on Android Market. To learn how to upload an application to Android Market, see <a
+ on Google Play. To learn how to upload an application to Google Play, see <a
href="http://market.android.com/support/bin/answer.py?answer=113469">Uploading
applications</a>.</p>
</li>
@@ -253,7 +253,7 @@
onto a device to run it. To run the sample application, do the following:</p>
<ol>
- <li><strong>Make sure you have at least one test account registered under your Android Market
+ <li><strong>Make sure you have at least one test account registered under your Google Play
publisher account.</strong>
<p>You cannot purchase items from yourself (Google Checkout prohibits this), so you need to
create at least one test account that you can use to purchase items in the sample application.
@@ -261,18 +261,18 @@
href="{@docRoot}guide/market/billing/billing_testing.html#billing-testing-setup">Setting up Test
Accounts</a>.</p>
</li>
- <li><strong>Verify that your device is running a supported version of the Android Market
+ <li><strong>Verify that your device is running a supported version of the Google Play
application or the MyApps application.</strong>
<p>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
the MyApps application. If your device is running any other version of Android, in-app billing
- requires version 2.3.4 (or higher) of the Android Market application. To learn how to check the
- version of the Android Market application, see <a
- href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Android
- Market</a>.</p>
+ requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the
+ version of the Google Play application, see <a
+ href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google
+ Play</a>.</p>
</li>
<li><strong>Install the application onto your device.</strong>
- <p>Even though you uploaded the application to Android Market, the application is not published,
- so you cannot download it from Android Market to a device. Instead, you must install the
+ <p>Even though you uploaded the application to Google Play, the application is not published,
+ so you cannot download it from Google Play to a device. Instead, you must install the
application onto your device. To learn how to install an application onto a device, see <a
href="{@docRoot}guide/developing/building/building-cmdline.html#RunningOnDevice">Running on a
device</a>.</p>
@@ -280,7 +280,7 @@
<li><strong>Make one of your test accounts the primary account on your device.</strong>
<p>The primary account on your device must be one of the <a
href="{@docRoot}guide/market/billing/billing_admin.html#billing-testing-setup">test accounts</a>
- that you registered on the Android Market site. If the primary account on your device is not a
+ that you registered on the Google Play publisher site. If the primary account on your device is not a
test account, you must do a factory reset of the device and then sign in with one of your test
accounts. To perform a factory reset, do the following:</p>
<ol>
@@ -306,7 +306,7 @@
<h2 id="billing-add-aidl">Adding the AIDL file to your project</h2>
<p>The sample application contains an Android Interface Definition Language (AIDL) file, which
-defines the interface to Android Market's in-app billing service
+defines the interface to Google Play's in-app billing service
(<code>MarketBillingService</code>). When you add this file to your project, the Android build
environment creates an interface file (<code>IMarketBillingService.java</code>). You can then use
this interface to make billing requests by invoking IPC method calls.</p>
@@ -333,29 +333,29 @@
<h2 id="billing-permission">Updating Your Application's Manifest</h2>
-<p>In-app billing relies on the Android Market application, which handles all communication between
-your application and the Android Market server. To use the Android Market application, your
+<p>In-app billing relies on the Google Play application, which handles all communication between
+your application and the Google Play server. To use the Google Play application, your
application must request the proper permission. You can do this by adding the
<code>com.android.vending.BILLING</code> permission to your AndroidManifest.xml file. If your
application does not declare the in-app billing permission, but attempts to send billing requests,
-Android Market will refuse the requests and respond with a <code>RESULT_DEVELOPER_ERROR</code>
+Google Play will refuse the requests and respond with a <code>RESULT_DEVELOPER_ERROR</code>
response code.</p>
<p>In addition to the billing permission, you need to declare the {@link
android.content.BroadcastReceiver} that you will use to receive asynchronous response messages
-(broadcast intents) from Android Market, and you need to declare the {@link android.app.Service}
-that you will use to bind with the <code>IMarketBillingService</code> and send messages to Android
-Market. You must also declare <a
+(broadcast intents) from Google Play, and you need to declare the {@link android.app.Service}
+that you will use to bind with the <code>IMarketBillingService</code> and send messages to Google
+Play. You must also declare <a
href="{@docRoot}guide/topics/manifest/intent-filter-element.html">intent filters</a> for the {@link
android.content.BroadcastReceiver} so that the Android system knows how to handle the broadcast
-intents that are sent from the Android Market application.</p>
+intents that are sent from the Google Play application.</p>
<p>For example, here is how the in-app billing sample application declares the billing permission,
the {@link android.content.BroadcastReceiver}, the {@link android.app.Service}, and the intent
filters. In the sample application, <code>BillingReceiver</code> is the {@link
-android.content.BroadcastReceiver} that handles broadcast intents from the Android Market
+android.content.BroadcastReceiver} that handles broadcast intents from the Google Play
application and <code>BillingService</code> is the {@link android.app.Service} that sends requests
-to the Android Market application.</p>
+to the Google Play application.</p>
<pre>
<?xml version="1.0" encoding="utf-8"?>
@@ -391,11 +391,11 @@
<h2 id="billing-service">Creating a Local Service</h2>
<p>Your application must have a local {@link android.app.Service} to facilitate messaging between
-your application and Android Market. At a minimum, this service must do the following:</p>
+your application and Google Play. At a minimum, this service must do the following:</p>
<ul>
<li>Bind to the <code>MarketBillingService</code>.
- <li>Send billing requests (as IPC method calls) to the Android Market application. The five types
+ <li>Send billing requests (as IPC method calls) to the Google Play application. The five types
of billing requests include:
<ul>
<li><code>CHECK_BILLING_SUPPORTED</code> requests</li>
@@ -474,7 +474,7 @@
key can have the following five values:</p>
<ul>
- <li><code>CHECK_BILLING_SUPPORTED</code>—verifies that the Android Market application
+ <li><code>CHECK_BILLING_SUPPORTED</code>—verifies that the Google Play application
supports in-app billing.</li>
<li><code>REQUEST_PURCHASE</code>—sends a purchase request for an in-app item.</li>
<li><code>GET_PURCHASE_INFORMATION</code>—retrieves transaction information for a purchase
@@ -510,7 +510,7 @@
<h4>Verifying that in-app billing is supported (CHECK_BILLING_SUPPPORTED)</h4>
-<p>The following code sample shows how to verify whether the Android Market application supports
+<p>The following code sample shows how to verify whether the Google Play application supports
in-app billing. In the sample, <code>mService</code> is an instance of the
<code>MarketBillingService</code> interface.</p>
@@ -533,7 +533,7 @@
<li><code>RESULT_BILLING_UNAVAILABLE</code>—in-app billing is not available because the API
version you specified is not recognized or the user is not eligible to make in-app purchases (for
example, the user resides in a country that prohibits in-app purchases).</li>
- <li><code>RESULT_ERROR</code>—there was an error connecting with the Android Market
+ <li><code>RESULT_ERROR</code>—there was an error connecting with the Google Play
application.</li>
<li><code>RESULT_DEVELOPER_ERROR</code>—the application is trying to make an in-app billing
request but the application has not declared the <code>com.android.vending.BILLING</code>
@@ -546,10 +546,10 @@
<p>We recommend that you invoke the <code>CHECK_BILLING_SUPPORTED</code> request within a
<code>RemoteException</code> block. When your code throws a <code>RemoteException</code> it
-indicates that the remote method call failed, which means that the Android Market application is out
+indicates that the remote method call failed, which means that the Google Play application is out
of date and needs to be updated. In this case, you can provide users with an error message that
contains a link to the <a
-href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Android Market</a>
+href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google Play</a>
Help topic.</p>
<p>The sample application demonstrates how you can handle this error condition (see
@@ -561,16 +561,16 @@
<ul>
<li>Send the <code>REQUEST_PURCHASE</code> request.</li>
- <li>Launch the {@link android.app.PendingIntent} that is returned from the Android Market
+ <li>Launch the {@link android.app.PendingIntent} that is returned from the Google Play
application.</li>
- <li>Handle the broadcast intents that are sent by the Android Market application.</li>
+ <li>Handle the broadcast intents that are sent by the Google Play application.</li>
</ul>
<h5>Making the request</h5>
<p>You must specify four keys in the request {@link android.os.Bundle}. The following code sample
shows how to set these keys and make a purchase request for a single in-app item. In the sample,
-<code>mProductId</code> is the Android Market product ID of an in-app item (which is listed in the
+<code>mProductId</code> is the Google Play product ID of an in-app item (which is listed in the
application's <a href="{@docRoot}guide/market/billing/billing_admin.html#billing-list-setup">product
list</a>), and <code>mService</code> is an instance of the <code>MarketBillingService</code>
interface.</p>
@@ -644,25 +644,25 @@
context and not an application context. Also, you cannot use the <code>singleTop</code> <a
href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">launch mode</a> to launch the
pending intent. If you do either of these, the Android system will not attach the pending intent to
-your application process. Instead, it will bring Android Market to the foreground, disrupting your
+your application process. Instead, it will bring Google Play to the foreground, disrupting your
application.</p>
<h5>Handling broadcast intents</h5>
<p>A <code>REQUEST_PURCHASE</code> request also triggers two asynchronous responses (broadcast
-intents). First, the Android Market application sends a <code>RESPONSE_CODE</code> broadcast intent,
+intents). First, the Google Play application sends a <code>RESPONSE_CODE</code> broadcast intent,
which provides error information about the request. If the request does not generate an
error, the <code>RESPONSE_CODE</code> broadcast intent returns <code>RESULT_OK</code>, which
indicates that the request was successfully sent. (To be clear, a <code>RESULT_OK</code> response
does not indicate that the requested purchase was successful; it indicates that the request was sent
-successfully to Android Market.)</p>
+successfully to Google Play.)</p>
<p>Next, when the requested transaction changes state (for example, the purchase is successfully
-charged to a credit card or the user cancels the purchase), the Android Market application sends an
+charged to a credit card or the user cancels the purchase), the Google Play application sends an
<code>IN_APP_NOTIFY</code> broadcast intent. This message contains a notification ID, which you can
use to retrieve the transaction details for the <code>REQUEST_PURCHASE</code> request.</p>
-<p class="note"><strong>Note:</strong> The Android Market application also sends
+<p class="note"><strong>Note:</strong> The Google Play application also sends
an <code>IN_APP_NOTIFY</code> for refunds. For more information, see <a
href="{@docRoot}guide/market/billing/billing_overview.html#billing-action-notify">Handling
IN_APP_NOTIFY messages</a>.</p>
@@ -670,7 +670,7 @@
<p>Because the purchase process is not instantaneous and can take several seconds (or more), you
must assume that a purchase request is pending from the time you receive a <code>RESULT_OK</code>
message until you receive an <code>IN_APP_NOTIFY</code> message for the transaction. While the
-transaction is pending, the Android Market checkout UI displays an "Authorizing purchase..."
+transaction is pending, the Google Play checkout UI displays an "Authorizing purchase..."
notification; however, this notification is dismissed after 60 seconds and you should not rely on
this notification as your primary means of conveying transaction status to users. Instead, we
recommend that you do the following:</p>
@@ -693,12 +693,12 @@
be sure that your pending status UI does not block your application. For example, you should avoid
using a hovering progress wheel to convey the status of a pending transaction because a pending
transaction could last a long time, particularly if a device loses network connectivity and cannot
-receive transaction updates from Android Market.</p>
+receive transaction updates from Google Play.</p>
<p class="caution"><strong>Important:</strong> If a user purchases a managed item, you must prevent
the user from purchasing the item again while the original transaction is pending. If a user
-attempts to purchase a managed item twice, and the first transaction is still pending, Android
-Market will display an error to the user; however, Android Market will not send an error to your
+attempts to purchase a managed item twice, and the first transaction is still pending, Google
+Play will display an error to the user; however, Google Play will not send an error to your
application notifying you that the second purchase request was canceled. This might cause your
application to get stuck in a pending state while it waits for an <code>IN_APP_NOTIFY</code> message
for the second purchase request.</p>
@@ -730,7 +730,7 @@
<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The additional keys are then added to the
bundle prior to invoking the <code>sendBillingRequest()</code> method. The
<code>REQUEST_NONCE</code> key contains a cryptographically secure nonce (number used once) that you
-must generate. The Android Market application returns this nonce with the
+must generate. The Google Play application returns this nonce with the
<code>PURCHASE_STATE_CHANGED</code> broadcast intent so you can verify the integrity of the
transaction information. The <code>NOTIFY_IDS</code> key contains an array of notification IDs,
which you received in the <code>IN_APP_NOTIFY</code> broadcast intent.</p>
@@ -741,9 +741,9 @@
request identifier for the request.</p>
<p>A <code>GET_PURCHASE_INFORMATION</code> request also triggers two asynchronous responses
-(broadcast intents). First, the Android Market application sends a <code>RESPONSE_CODE</code>
+(broadcast intents). First, the Google Play application sends a <code>RESPONSE_CODE</code>
broadcast intent, which provides status and error information about the request. Next, if the
-request was successful, the Android Market application sends a <code>PURCHASE_STATE_CHANGED</code>
+request was successful, the Google Play application sends a <code>PURCHASE_STATE_CHANGED</code>
broadcast intent. This message contains detailed transaction information. The transaction
information is contained in a signed JSON string (unencrypted). The message includes the signature
so you can verify the integrity of the signed string.</p>
@@ -783,8 +783,8 @@
<code>RESPONSE_CODE</code> broadcast intent. This broadcast intent provides status and error
information about the request.</p>
-<p>You must send a confirmation when you receive transaction information from Android Market. If you
-don't send a confirmation message, Android Market will continue sending
+<p>You must send a confirmation when you receive transaction information from Google Play. If you
+don't send a confirmation message, Google Play will continue sending
<code>IN_APP_NOTIFY</code> messages for the transactions you have not confirmed. Also,
your application must be able to handle <code>IN_APP_NOTIFY</code> messages that contain multiple
orders.</p>
@@ -792,7 +792,7 @@
<p>In addition, as a best practice, you should not send a <code>CONFIRM_NOTIFICATIONS</code> request
for a purchased item until you have delivered the item to the user. This way, if your application
crashes or something else prevents your application from delivering the product, your application
-will still receive an <code>IN_APP_NOTIFY</code> broadcast intent from Android Market indicating
+will still receive an <code>IN_APP_NOTIFY</code> broadcast intent from Google Play indicating
that you need to deliver the product.</p>
<h4>Restoring transaction information (RESTORE_TRANSACTIONS)</h4>
@@ -817,7 +817,7 @@
<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The additional <code>REQUEST_NONCE</code>
key is then added to the bundle prior to invoking the <code>sendBillingRequest()</code> method. The
<code>REQUEST_NONCE</code> key contains a cryptographically secure nonce (number used once) that you
-must generate. The Android Market application returns this nonce with the transactions information
+must generate. The Google Play application returns this nonce with the transactions information
contained in the <code>PURCHASE_STATE_CHANGED</code> broadcast intent so you can verify the
integrity of the transaction information.</p>
@@ -827,9 +827,9 @@
request identifier for the request.</p>
<p>A <code>RESTORE_TRANSACTIONS</code> request also triggers two asynchronous responses (broadcast
-intents). First, the Android Market application sends a <code>RESPONSE_CODE</code> broadcast intent,
+intents). First, the Google Play application sends a <code>RESPONSE_CODE</code> broadcast intent,
which provides status and error information about the request. Next, if the request was successful,
-the Android Market application sends a <code>PURCHASE_STATE_CHANGED</code> broadcast intent. This
+the Google Play application sends a <code>PURCHASE_STATE_CHANGED</code> broadcast intent. This
message contains the detailed transaction information. The transaction information is contained in a
signed JSON string (unencrypted). The message includes the signature so you can verify the integrity
of the signed string.</p>
@@ -842,7 +842,7 @@
<p>You may also want your {@link android.app.Service} to receive intent messages from your {@link
android.content.BroadcastReceiver}. You can use these intent messages to convey the information that
-was sent asynchronously from the Android Market application to your {@link
+was sent asynchronously from the Google Play application to your {@link
android.content.BroadcastReceiver}. To see an example of how you can send and receive these intent
messages, see the <code>BillingReceiver.java</code> and <code>BillingService.java</code> files in
the sample application. You can use these samples as a basis for your own implementation. However,
@@ -851,16 +851,16 @@
<h2 id="billing-broadcast-receiver">Creating a BroadcastReceiver</h2>
-<p>The Android Market application uses broadcast intents to send asynchronous billing responses to
+<p>The Google Play application uses broadcast intents to send asynchronous billing responses to
your application. To receive these intent messages, you need to create a {@link
android.content.BroadcastReceiver} that can handle the following intents:</p>
<ul>
<li>com.android.vending.billing.RESPONSE_CODE
- <p>This broadcast intent contains an Android Market response code, and is sent after you make an
+ <p>This broadcast intent contains a Google Play response code, and is sent after you make an
in-app billing request. For more information about the response codes that are sent with this
response, see <a
- href="{@docRoot}guide/market/billing/billing_reference.html#billing-codes">Android Market Response
+ href="{@docRoot}guide/market/billing/billing_reference.html#billing-codes">Google Play Response
Codes for In-app Billing</a>.</p>
</li>
<li>com.android.vending.billing.IN_APP_NOTIFY
@@ -895,18 +895,18 @@
<td><code>com.android.vending.billing.RESPONSE_CODE</code></td>
<td><code>request_id</code></td>
<td>A <code>long</code> representing a request ID. A request ID identifies a specific billing
- request and is returned by Android Market at the time a request is made.</td>
+ request and is returned by Google Play at the time a request is made.</td>
</tr>
<tr>
<td><code>com.android.vending.billing.RESPONSE_CODE</code></td>
<td><code>response_code</code></td>
- <td>An <code>int</code> representing the actual Android Market server response code.</td>
+ <td>An <code>int</code> representing the actual Google Play server response code.</td>
</tr>
<tr>
<td><code>com.android.vending.billing.IN_APP_NOTIFY</code></td>
<td><code>notification_id</code></td>
<td>A <code>String</code> representing the notification ID for a given purchase state change.
- Android Market notifies you when there is a purchase state change and the notification includes a
+ Google Play notifies you when there is a purchase state change and the notification includes a
unique notification ID. To get the details of the purchase state change, you send the notification
ID with the <code>GET_PURCHASE_INFORMATION</code> request.</td>
</tr>
@@ -933,16 +933,16 @@
private static final String TAG = "BillingReceiver";
- // Intent actions that we receive in the BillingReceiver from Android Market.
- // These are defined by Android Market and cannot be changed.
+ // Intent actions that we receive in the BillingReceiver from Google Play.
+ // These are defined by Google Play and cannot be changed.
// The sample application defines these in the Consts.java file.
public static final String ACTION_NOTIFY = "com.android.vending.billing.IN_APP_NOTIFY";
public static final String ACTION_RESPONSE_CODE = "com.android.vending.billing.RESPONSE_CODE";
public static final String ACTION_PURCHASE_STATE_CHANGED =
"com.android.vending.billing.PURCHASE_STATE_CHANGED";
- // The intent extras that are passed in an intent from Android Market.
- // These are defined by Android Market and cannot be changed.
+ // The intent extras that are passed in an intent from Google Play.
+ // These are defined by Google Play and cannot be changed.
// The sample application defines these in the Consts.java file.
public static final String NOTIFICATION_ID = "notification_id";
public static final String INAPP_SIGNED_DATA = "inapp_signed_data";
@@ -974,7 +974,7 @@
}
</pre>
-<p>In addition to receiving broadcast intents from the Android Market application, your {@link
+<p>In addition to receiving broadcast intents from the Google Play application, your {@link
android.content.BroadcastReceiver} must handle the information it received in the broadcast intents.
Usually, your {@link android.content.BroadcastReceiver} does this by sending the information to a
local service (discussed in the next section). The <code>BillingReceiver.java</code> file in the
@@ -985,8 +985,8 @@
<h2 id="billing-signatures">Verifying Signatures and Nonces</h2>
-<p>Android Market's in-app billing service uses two mechanisms to help verify the integrity of the
-transaction information you receive from Android Market: nonces and signatures. A nonce (number used
+<p>Google Play's in-app billing service uses two mechanisms to help verify the integrity of the
+transaction information you receive from Google Play: nonces and signatures. A nonce (number used
once) is a cryptographically secure number that your application generates and sends with every
<code>GET_PURCHASE_INFORMATION</code> and <code>RESTORE_TRANSACTIONS</code> request. The nonce is
returned with the <code>PURCHASE_STATE_CHANGED</code> broadcast intent, enabling you to verify that
@@ -1023,12 +1023,12 @@
href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and Design</a> and
obfuscate your code.</p>
-<p>You will need to use your Android Market public key to perform the signature verification. The
-following procedure shows you how to retrieve Base64-encoded public key from the Android Market
+<p>You will need to use your Google Play public key to perform the signature verification. The
+following procedure shows you how to retrieve Base64-encoded public key from the Google Play
publisher site.</p>
<ol>
- <li>Log in to your <a href="http://market.android.com/publish">publisher account</a>.</li>
+ <li>Log in to your <a href="http://play.google.com/apps/publish">publisher account</a>.</li>
<li>On the upper left part of the page, under your name, click <strong>Edit profile</strong>.</li>
<li>On the Edit Profile page, scroll down to the Licensing & In-app Billing panel (see figure
2).</li>
@@ -1080,8 +1080,8 @@
<h3>Creating a user interface for selecting items</h3>
-<p>You must provide users with a means for selecting items that they want to purchase. Android
-Market provides the checkout user interface (which is where the user provides a form of payment and
+<p>You must provide users with a means for selecting items that they want to purchase. Google
+Play provides the checkout user interface (which is where the user provides a form of payment and
approves the purchase), but your application must provide a control (widget) that invokes the
<code>sendBillingRequest()</code> method when a user selects an item for purchase.</p>
diff --git a/docs/html/guide/market/billing/billing_overview.jd b/docs/html/guide/market/billing/billing_overview.jd
index 8f9fd4c..b593811 100755
--- a/docs/html/guide/market/billing/billing_overview.jd
+++ b/docs/html/guide/market/billing/billing_overview.jd
@@ -38,24 +38,24 @@
</div>
</div>
-<p>Android Market In-app Billing is an Android Market service that provides checkout processing for
+<p>In-app Billing is a Google Play service that provides checkout processing for
in-app purchases. To use the service, your application sends a billing request for a specific in-app
product. The service then handles all of the checkout details for the transaction, including
requesting and validating the form of payment and processing the financial transaction. When the
checkout process is complete, the service sends your application the purchase details, such as the
order number, the order date and time, and the price paid. At no point does your application have to
-handle any financial transactions; that role is provided by Android Market's in-app billing
+handle any financial transactions; that role is provided by Google Play's in-app billing
service.</p>
<h2 id="billing-arch">In-app Billing Architecture</h2>
<p>In-app billing uses an asynchronous message loop to convey billing requests and billing responses
-between your application and the Android Market server. In practice, your application never directly
-communicates with the Android Market server (see figure 1). Instead, your application sends billing
-requests to the Android Market application over interprocess communication (IPC) and receives
-purchase responses from the Android Market application in the form of asynchronous broadcast
-intents. Your application does not manage any network connections between itself and the Android
-Market server or use any special APIs from the Android platform.</p>
+between your application and the Google Play server. In practice, your application never directly
+communicates with the Google Play server (see figure 1). Instead, your application sends billing
+requests to the Google Play application over interprocess communication (IPC) and receives
+purchase responses from the Google Play application in the form of asynchronous broadcast
+intents. Your application does not manage any network connections between itself and the Google
+Play server or use any special APIs from the Android platform.</p>
<p>Some in-app billing implementations may also use a private remote server to deliver content or
validate transactions, but a remote server is not required to implement in-app billing. A remote
@@ -70,16 +70,16 @@
<img src="{@docRoot}images/billing_arch.png" alt="" height="582" />
<p class="img-caption">
<strong>Figure 1.</strong> Your application sends and receives billing messages through the
- Android Market application, which handles all communication with the Android Market server.</p>
+ Google Play application, which handles all communication with the Google Play server.</p>
</div>
<p>A typical in-app billing implementation relies on three components:</p>
<ul>
<li>A {@link android.app.Service} (named <code>BillingService</code> in the sample application),
- which processes purchase messages from the application and sends billing requests to Android
- Market's in-app billing service.</li>
+ which processes purchase messages from the application and sends billing requests to the Google
+ Play in-app billing service.</li>
<li>A {@link android.content.BroadcastReceiver} (named <code>BillingReceiver</code> in the sample
- application), which receives all asynchronous billing responses from the Android Market
+ application), which receives all asynchronous billing responses from the Google Play
application.</li>
<li>A security component (named <code>Security</code> in the sample application), which performs
security-related tasks, such as signature verification and nonce generation. For more information
@@ -99,19 +99,19 @@
<p>In addition to these components, your application must provide a way to store information about
users' purchases and some sort of user interface that lets users select items to purchase. You do
-not need to provide a checkout user interface. When a user initiates an in-app purchase, the Android
-Market application presents the checkout user interface to your user. When the user completes the
+not need to provide a checkout user interface. When a user initiates an in-app purchase, the Google
+Play application presents the checkout user interface to your user. When the user completes the
checkout process, your application resumes.</p>
<h2 id="billing-msgs">In-app Billing Messages</h2>
-<p>When the user initiates a purchase, your application sends billing messages to Android Market's
+<p>When the user initiates a purchase, your application sends billing messages to Google Play's
in-app billing service (named <code>MarketBillingService</code>) using simple IPC method calls. The
-Android Market application responds to all billing requests synchronously, providing your
-application with status notifications and other information. The Android Market application also
+Google Play application responds to all billing requests synchronously, providing your
+application with status notifications and other information. The Google Play application also
responds to some billing requests asynchronously, providing your application with error messages and
detailed transaction information. The following section describes the basic request-response
-messaging that takes place between your application and the Android Market application.</p>
+messaging that takes place between your application and the Google Play application.</p>
<h3 id="billing-request">In-app billing requests</h3>
@@ -133,31 +133,31 @@
<p>One of the most important keys that every request Bundle must have is the
<code>BILLING_REQUEST</code> key. This key lets you specify the type of billing request you are
-making. Android Market's in-app billing service supports the following five types of billing
+making. Google Play's in-app billing service supports the following five types of billing
requests:</p>
<ul>
<li><code>CHECK_BILLING_SUPPORTED</code>
- <p>This request verifies that the Android Market application supports in-app billing. You
+ <p>This request verifies that the Google Play application supports in-app billing. You
usually send this request when your application first starts up. This request is useful if you
want to enable or disable certain UI features that are relevant only to in-app billing.</p>
</li>
<li><code>REQUEST_PURCHASE</code>
- <p>This request sends a purchase message to the Android Market application and is the foundation
+ <p>This request sends a purchase message to the Google Play application and is the foundation
of in-app billing. You send this request when a user indicates that he or she wants to purchase
- an item in your application. Android Market then handles the financial transaction by displaying
+ an item in your application. Google Play then handles the financial transaction by displaying
the checkout user interface.</p>
</li>
<li><code>GET_PURCHASE_INFORMATION</code>
<p>This request retrieves the details of a purchase state change. A purchase changes state when
a requested purchase is billed successfully or when a user cancels a transaction during
- checkout. It can also occur when a previous purchase is refunded. Android Market notifies your
+ checkout. It can also occur when a previous purchase is refunded. Google Play notifies your
application when a purchase changes state, so you only need to send this request when there is
transaction information to retrieve.</p>
</li>
<li><code>CONFIRM_NOTIFICATIONS</code>
<p>This request acknowledges that your application received the details of a purchase state
- change. Android Market sends purchase state change notifications to your application until you
+ change. Google Play sends purchase state change notifications to your application until you
confirm that you received them.</p>
</li>
<li><code>RESTORE_TRANSACTIONS</code>
@@ -171,7 +171,7 @@
<h3 id="billing-response">In-app Billing Responses</h3>
-<p>The Android Market application responds to in-app billing requests with both synchronous and
+<p>The Google Play application responds to in-app billing requests with both synchronous and
asynchronous responses. The synchronous response is a {@link android.os.Bundle} with the following
three keys:</p>
@@ -196,9 +196,9 @@
<ul>
<li><code>com.android.vending.billing.RESPONSE_CODE</code>
- <p>This response contains an Android Market server response code, and is sent after you make an
+ <p>This response contains a Google Play server response code, and is sent after you make an
in-app billing request. A server response code can indicate that a billing request was
- successfully sent to Android Market or it can indicate that some error occurred during a billing
+ successfully sent to Google Play or it can indicate that some error occurred during a billing
request. This response is <em>not</em> used to report any purchase state changes (such as refund
or purchase information). For more information about the response codes that are sent with this
response, see <a
@@ -253,7 +253,7 @@
<ol>
<li>Your application sends a purchase request (<code>REQUEST_PURCHASE</code> type), specifying a
product ID and other parameters.</li>
- <li>The Android Market application sends your application a Bundle with the following keys:
+ <li>The Google Play application sends your application a Bundle with the following keys:
<code>RESPONSE_CODE</code>, <code>PURCHASE_INTENT</code>, and <code>REQUEST_ID</code>. The
<code>PURCHASE_INTENT</code> key provides a {@link android.app.PendingIntent}, which your
application uses to start the checkout UI for the given product ID.</li>
@@ -262,20 +262,20 @@
context and not an application context.</p>
</li>
<li>When the checkout flow finishes (that is, the user successfully purchases the item or cancels
- the purchase), Android Market sends your application a notification message (an
+ the purchase), Google Play sends your application a notification message (an
<code>IN_APP_NOTIFY</code> broadcast intent). The notification message includes a notification ID,
which references the transaction.</li>
<li>Your application requests the transaction information by sending a
<code>GET_PURCHASE_STATE_CHANGED</code> request, specifying the notification ID for the
transaction.</li>
- <li>The Android Market application sends a Bundle with a <code>RESPONSE_CODE</code> key and a
+ <li>The Google Play application sends a Bundle with a <code>RESPONSE_CODE</code> key and a
<code>REQUEST_ID</code> key.
- <li>Android Market sends the transaction information to your application in a
+ <li>Google Play sends the transaction information to your application in a
<code>PURCHASE_STATE_CHANGED</code> broadcast intent.</li>
<li>Your application confirms that you received the transaction information for the given
notification ID by sending a confirmation message (<code>CONFIRM_NOTIFICATIONS</code> type),
specifying the notification ID for which you received transaction information.</li>
- <li>The Android Market application sends your application a Bundle with a
+ <li>The Google Play application sends your application a Bundle with a
<code>RESPONSE_CODE</code> key and a <code>REQUEST_ID</code> key.</li>
</ol>
@@ -284,13 +284,13 @@
<strong>Figure 2.</strong> Message sequence for a purchase request.
</p>
-<p>Keep in mind, you must send a confirmation when you receive transaction information from Android
-Market (step 8 in figure 2). If you don't send a confirmation message, Android Market will
+<p>Keep in mind, you must send a confirmation when you receive transaction information from Google
+Play (step 8 in figure 2). If you don't send a confirmation message, Google Play will
continue sending <code>IN_APP_NOTIFY</code> messages for the transactions you have not
confirmed. As a best practice, you should not send a <code>CONFIRM_NOTIFICATIONS</code> request for
a purchased item until you have delivered the item to the user. This way, if your application
crashes or something else prevents your application from delivering the product, your application
-will still receive an <code>IN_APP_NOTIFY</code> broadcast intent from Android Market indicating
+will still receive an <code>IN_APP_NOTIFY</code> broadcast intent from Google Play indicating
that you need to deliver the product. Also, as a best practice, your application must be able to
handle <code>IN_APP_NOTIFY</code> messages that contain multiple orders.</p>
@@ -307,7 +307,7 @@
</div>
<p>The request triggers three responses. The first is a {@link android.os.Bundle} with a
-<code>RESPONSE_CODE</code> key and a <code>REQUEST_ID</code> key. Next, the Android Market
+<code>RESPONSE_CODE</code> key and a <code>REQUEST_ID</code> key. Next, the Google Play
application sends a <code>RESPONSE_CODE</code> broadcast intent, which provides status information
or error information about the request. As always, the <code>RESPONSE_CODE</code> message references
a specific request ID, so you can determine which request a <code>RESPONSE_CODE</code> message
@@ -338,18 +338,18 @@
is unavailable because the API version you specified is unrecognized or the user is not eligible to
make in-app purchases (for example, the user resides in a country that does not allow in-app
billing). A <code>SERVER_ERROR</code> can also be returned, indicating that there was a problem with
-the Android Market server.</p>
+the Google Play server.</p>
<h3 id="billing-action-notify">Handling IN_APP_NOTIFY messages</h3>
-<p>Usually, your application receives an <code>IN_APP_NOTIFY</code> broadcast intent from Android
-Market in response to a <code>REQUEST_PURCHASE</code> message (see figure 2). The
+<p>Usually, your application receives an <code>IN_APP_NOTIFY</code> broadcast intent from Google
+Play in response to a <code>REQUEST_PURCHASE</code> message (see figure 2). The
<code>IN_APP_NOTIFY</code> broadcast intent informs your application that the state of a requested
purchase has changed. To retrieve the details of that purchase, your application sends a
-<code>GET_PURCHASE_INFORMATION</code> request. Android Market responds with a
+<code>GET_PURCHASE_INFORMATION</code> request. Google Play responds with a
<code>PURCHASE_STATE_CHANGED</code> broadcast intent, which contains the details of the purchase
state change. Your application then sends a <code>CONFIRM_NOTIFICATIONS</code> message, informing
-Android Market that you have received the purchase state change information.</p>
+Google Play that you have received the purchase state change information.</p>
<p>In some special cases, you may receive multiple <code>IN_APP_NOTIFY</code> messages even though
you have confirmed receipt of the purchase information, or you may receive
@@ -358,13 +358,13 @@
<h4>Handling multiple IN_APP_NOTIFY messages</h4>
-<p>When Android Market receives a <code>CONFIRM_NOTIFICATIONS</code> message for a given
+<p>When Google Play receives a <code>CONFIRM_NOTIFICATIONS</code> message for a given
<code>PURCHASE_STATE_CHANGED</code> message, it usually stops sending <code>IN_APP_NOTIFY</code>
-intents for that <code>PURCHASE_STATE_CHANGED</code> message. Sometimes, however, Android
-Market may send repeated <code>IN_APP_NOTIFY</code> intents for a
+intents for that <code>PURCHASE_STATE_CHANGED</code> message. Sometimes, however, Google
+Play may send repeated <code>IN_APP_NOTIFY</code> intents for a
<code>PURCHASE_STATE_CHANGED</code> message even though your application has sent a
<code>CONFIRM_NOTIFICATIONS</code> message. This can occur if a device loses network connectivity
-while you are sending the <code>CONFIRM_NOTIFICATIONS</code> message. In this case, Android Market
+while you are sending the <code>CONFIRM_NOTIFICATIONS</code> message. In this case, Google Play
might not receive your <code>CONFIRM_NOTIFICATIONS</code> message and it could send multiple
<code>IN_APP_NOTIFY</code> messages until it receives acknowledgement that you received the
transaction message. Therefore, your application must be able to recognize that the subsequent
@@ -390,7 +390,7 @@
<p>In the first case, your application may receive an <code>IN_APP_NOTIFY</code> broadcast intent
when a user has your application installed on two (or more) devices and the user makes an in-app
-purchase from one of the devices. In this case, Android Market sends an <code>IN_APP_NOTIFY</code>
+purchase from one of the devices. In this case, Google Play sends an <code>IN_APP_NOTIFY</code>
message to the second device, informing the application that there is a purchase state change. Your
application can handle this message the same way it handles the response from an
application-initiated <code>REQUEST_PURCHASE</code> message, so that ultimately your application
@@ -400,8 +400,8 @@
to "managed per user account."</p>
<p>In the second case, your application can receive an <code>IN_APP_NOTIFY</code> broadcast intent
-when Android Market receives a refund notification from Google Checkout. In this case, Android
-Market sends an <code>IN_APP_NOTIFY</code> message to your application. Your application can handle
+when Google Play receives a refund notification from Google Checkout. In this case, Google
+Play sends an <code>IN_APP_NOTIFY</code> message to your application. Your application can handle
this message the same way it handles responses from an application-initiated
<code>REQUEST_PURCHASE</code> message so that ultimately your application receives a
<code>PURCHASE_STATE_CHANGED</code> message that includes information about the item that has been
@@ -417,13 +417,13 @@
<h2 id="billing-security">Security Controls</h2>
<p>To help ensure the integrity of the transaction information that is sent to your application,
-Android Market signs the JSON string that is contained in the <code>PURCHASE_STATE_CHANGED</code>
-broadcast intent. Android Market uses the private key that is associated with your publisher account
+Google Play signs the JSON string that is contained in the <code>PURCHASE_STATE_CHANGED</code>
+broadcast intent. Google Play uses the private key that is associated with your publisher account
to create this signature. The publisher site generates an RSA key pair for each publisher account.
You can find the public key portion of this key pair on your account's profile page. It is the same
-public key that is used with Android Market licensing.</p>
+public key that is used with Google Play licensing.</p>
-<p>When Android Market signs a billing response, it includes the signed JSON string (unencrypted)
+<p>When Google Play signs a billing response, it includes the signed JSON string (unencrypted)
and the signature. When your application receives this signed response you can use the public key
portion of your RSA key pair to verify the signature. By performing signature verification you can
help detect responses that have been tampered with or that have been spoofed. You can perform this
@@ -431,9 +431,9 @@
remote server then we recommend that you perform the signature verification on that server.</p>
<p>In-app billing also uses nonces (a random number used once) to help verify the integrity of the
-purchase information that's returned from Android Market. Your application must generate a nonce and
+purchase information that's returned from Google Play. Your application must generate a nonce and
send it with a <code>GET_PURCHASE_INFORMATION</code> request and a <code>RESTORE_TRANSACTIONS</code>
-request. When Android Market receives the request, it adds the nonce to the JSON string that
+request. When Google Play receives the request, it adds the nonce to the JSON string that
contains the transaction information. The JSON string is then signed and returned to your
application. When your application receives the JSON string, you need to verify the nonce as well as
the signature of the JSON string.</p>
@@ -447,20 +447,20 @@
limitations.</p>
<ul>
- <li>In-app billing can be implemented only in applications that you publish through Android
- Market.</li>
- <li>You must have a Google Checkout Merchant account to use Android Market In-app Billing.</li>
+ <li>In-app billing can be implemented only in applications that you publish through Google
+ Play.</li>
+ <li>You must have a Google Checkout Merchant account to use Google Play In-app Billing.</li>
<li>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
the MyApps application. If your device is running any other version of Android, in-app billing
- requires version 2.3.4 (or higher) of the Android Market application.</li>
+ requires version 2.3.4 (or higher) of the Google Play application.</li>
<li>An application can use in-app billing only if the device is running Android 1.6 (API level 4)
or higher.</li>
<li>You can use in-app billing to sell only digital content. You cannot use in-app billing to sell
physical goods, personal services, or anything that requires physical delivery.</li>
- <li>Android Market does not provide any form of content delivery. You are responsible for
+ <li>Google Play does not provide any form of content delivery. You are responsible for
delivering the digital content that you sell in your applications.</li>
<li>You cannot implement in-app billing on a device that never connects to the network. To
- complete in-app purchase requests, a device must be able to access the Android Market server over
+ complete in-app purchase requests, a device must be able to access the Google Play server over
the network. </li>
</ul>
diff --git a/docs/html/guide/market/billing/billing_reference.jd b/docs/html/guide/market/billing/billing_reference.jd
index 5a7ba56..e8cf2ee 100755
--- a/docs/html/guide/market/billing/billing_reference.jd
+++ b/docs/html/guide/market/billing/billing_reference.jd
@@ -36,20 +36,20 @@
<p>The following document provides technical reference information for the following:</p>
<ul>
- <li><a href="#billing-codes">Android Market Server Response Codes for In-app Billing</a></li>
+ <li><a href="#billing-codes">Google Play Server Response Codes for In-app Billing</a></li>
<li><a href="#billing-interface">In-app Billing Interface Parameters</a></li>
<li><a href="#billing-intents">In-app Billing Broadcast Intents</a></li>
</ul>
-<h2 id="billing-codes">Android Market Server Response Codes for In-app Billing</h2>
+<h2 id="billing-codes">Google Play Server Response Codes for In-app Billing</h2>
-<p>The following table lists all of the server response codes that are sent from Android Market to
-your application. Android Market sends these response codes asynchronously as
+<p>The following table lists all of the server response codes that are sent from Google Play to
+your application. Google Play sends these response codes asynchronously as
<code>response_code</code> extras in the <code>com.android.vending.billing.RESPONSE_CODE</code>
broadcast intent. Your application must handle all of these response codes.</p>
<p class="table-caption" id="response-codes-table"><strong>Table 1.</strong> Summary of response
-codes returned by Android Market.</p>
+codes returned by Google Play.</p>
<table>
@@ -80,13 +80,13 @@
<td><code>RESULT_BILLING_UNAVAILABLE</code></td>
<td>3</td>
<td>Indicates that in-app billing is not available because the <code>API_VERSION</code> that you
- specified is not recognized by the Android Market application or the user is ineligible for in-app
+ specified is not recognized by the Google Play application or the user is ineligible for in-app
billing (for example, the user resides in a country that prohibits in-app purchases).</td>
</tr>
<tr>
<td><code>RESULT_ITEM_UNAVAILABLE</code></td>
<td>4</td>
- <td>Indicates that Android Market cannot find the requested item in the application's product
+ <td>Indicates that Google Play cannot find the requested item in the application's product
list. This can happen if the product ID is misspelled in your <code>REQUEST_PURCHASE</code>
request or if an item is unpublished in the application's product list.</td>
</tr>
@@ -108,7 +108,7 @@
<h2 id="billing-interface">In-app Billing Service Interface</h2>
-<p>The following section describes the interface for Android Market's in-app billing service. The
+<p>The following section describes the interface for Google Play's in-app billing service. The
interface is defined in the <code>IMarketBillingService.aidl</code> file, which is included with the
in-app billing <a
href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">sample
@@ -144,7 +144,7 @@
<td><code>int</code></td>
<td>1</td>
<td>Yes</td>
- <td>The version of Android Market's in-app billing service you are using. The current version is
+ <td>The version of Google Play's in-app billing service you are using. The current version is
1.</td>
</tr>
<tr>
@@ -160,8 +160,8 @@
<td>Any valid product identifier.</td>
<td>Required for <code>REQUEST_PURCHASE</code> requests.</td>
<td>The product ID of the item you are making a billing request for. Every in-app item that you
- sell using Android Market's in-app billing service must have a unique product ID, which you
- specify on the Android Market publisher site.</td>
+ sell using Google Play's in-app billing service must have a unique product ID, which you
+ specify on the Google Play publisher site.</td>
</tr>
<tr>
<td><code>NONCE</code></td>
@@ -172,7 +172,7 @@
<td>A number used once. Your application must generate and send a nonce with each
<code>GET_PURCHASE_INFORMATION</code> and <code>RESTORE_TRANSACTIONS</code> request. The nonce is
returned with the <code>PURCHASE_STATE_CHANGED</code> broadcast intent, so you can use this value
- to verify the integrity of transaction responses form Android Market.</td>
+ to verify the integrity of transaction responses form Google Play.</td>
</tr>
<tr>
<td><code>NOTIFY_IDS</code></td>
@@ -202,20 +202,20 @@
<ul>
<li><code>CHECK_BILLING_SUPPORTED</code>
- <p>This request verifies that the Android Market application supports in-app billing. You
+ <p>This request verifies that the Google Play application supports in-app billing. You
usually send this request when your application first starts up. This request is useful if you
want to enable or disable certain UI features that are relevant only to in-app billing.</p>
</li>
<li><code>REQUEST_PURCHASE</code>
- <p>This request sends a purchase message to the Android Market application and is the foundation
+ <p>This request sends a purchase message to the Google Play application and is the foundation
of in-app billing. You send this request when a user indicates that he or she wants to purchase
- an item in your application. Android Market then handles the financial transaction by displaying
+ an item in your application. Google Play then handles the financial transaction by displaying
the checkout user interface.</p>
</li>
<li><code>GET_PURCHASE_INFORMATION</code>
<p>This request retrieves the details of a purchase state change. A purchase state change can
occur when a purchase request is billed successfully or when a user cancels a transaction during
- checkout. It can also occur when a previous purchase is refunded. Android Market notifies your
+ checkout. It can also occur when a previous purchase is refunded. Google Play notifies your
application when a purchase changes state, so you only need to send this request when there is
transaction information to retrieve.</p>
</li>
@@ -294,8 +294,8 @@
<h2 id="billing-intents">In-app Billing Broadcast Intents</h2>
-<p>The following section describes the in-app billing broadcast intents that are sent by the Android
-Market application. These broadcast intents inform your application about in-app billing actions
+<p>The following section describes the in-app billing broadcast intents that are sent by the Google
+Play application. These broadcast intents inform your application about in-app billing actions
that have occurred. Your application must implement a {@link android.content.BroadcastReceiver} to
receive these broadcast intents, such as the <code>BillingReceiver</code> that's shown in the in-app
billing <a href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">sample
@@ -303,21 +303,21 @@
<h4>com.android.vending.billing.RESPONSE_CODE</h4>
-<p>This broadcast intent contains an Android Market response code, and is sent after you make an
+<p>This broadcast intent contains a Google Play response code, and is sent after you make an
in-app billing request. A server response code can indicate that a billing request was successfully
-sent to Android Market or it can indicate that some error occurred during a billing request. This
+sent to Google Play or it can indicate that some error occurred during a billing request. This
intent is not used to report any purchase state changes (such as refund or purchase information).
For more information about the response codes that are sent with this response, see <a
-href="#billing-codes">Android Market Response Codes for In-app Billing</a>. The sample application
+href="#billing-codes">Google Play Response Codes for In-app Billing</a>. The sample application
assigns this broadcast intent to a constant named <code>ACTION_RESPONSE_CODE</code>.</p>
<h5>Extras</h5>
<ul type="none">
<li><code>request_id</code>—a <code>long</code> representing a request ID. A request ID
- identifies a specific billing request and is returned by Android Market at the time a request is
+ identifies a specific billing request and is returned by Google Play at the time a request is
made.</li>
- <li><code>response_code</code>—an <code>int</code> representing the Android Market server
+ <li><code>response_code</code>—an <code>int</code> representing the Google Play server
response code.</li>
</ul>
@@ -335,7 +335,7 @@
<ul type="none">
<li><code>notification_id</code>—a <code>String</code> representing the notification ID for
- a given purchase state change. Android Market notifies you when there is a purchase state change
+ a given purchase state change. Google Play notifies you when there is a purchase state change
and the notification includes a unique notification ID. To get the details of the purchase state
change, you send the notification ID with the <code>GET_PURCHASE_INFORMATION</code> request.</li>
</ul>
@@ -375,15 +375,15 @@
<tr>
<td>nonce</td>
<td>A number used once. Your application generates the nonce and sends it with the
- <code>GET_PURCHASE_INFORMATION</code> request. Android Market sends the nonce back as part of the
+ <code>GET_PURCHASE_INFORMATION</code> request. Google Play sends the nonce back as part of the
JSON string so you can verify the integrity of the message.</td>
</tr>
<tr>
<td>notificationId</td>
<td>A unique identifier that is sent with an <code>IN_APP_NOTIFY</code> broadcast intent. Each
<code>notificationId</code> corresponds to a specify message that is waiting to be retrieved on
- the Android Market server. Your application sends back the <code>notificationId</code> with the
- <code>GET_PURCHASE_INFORMATION</code> message so Android Market can determine which messages you
+ the Google Play server. Your application sends back the <code>notificationId</code> with the
+ <code>GET_PURCHASE_INFORMATION</code> message so Google Play can determine which messages you
are retrieving.</td>
</tr>
<tr>
@@ -398,7 +398,7 @@
<tr>
<td>productId</td>
<td>The item's product identifier. Every item has a product ID, which you must specify in the
- application's product list on the Android Market publisher site.</td>
+ application's product list on the Google Play publisher site.</td>
</tr>
<tr>
<td>purchaseTime</td>
diff --git a/docs/html/guide/market/billing/billing_testing.jd b/docs/html/guide/market/billing/billing_testing.jd
index 5453047..77aa3ed 100755
--- a/docs/html/guide/market/billing/billing_testing.jd
+++ b/docs/html/guide/market/billing/billing_testing.jd
@@ -32,16 +32,16 @@
</div>
</div>
-<p>The Android Market publisher site provides several tools that help you test your in-app billing
+<p>The Google Play publisher site provides several tools that help you test your in-app billing
implementation before it is published. You can use these tools to create test accounts and purchase
special reserved items that send static billing responses to your application.</p>
<p>To test in-app billing in an application you must install the application on an Android-powered
device. You cannot use the Android emulator to test in-app billing. The device you use for testing
must run a standard version of the Android 1.6 or later platform (API level 4 or higher), and have
-the most current version of the Android Market application installed. If a device is not running the
-most current Android Market application, your application won't be able to send in-app billing
-requests to Android Market. For general information about how to set up a device for use in
+the most current version of the Google Play application installed. If a device is not running the
+most current Google Play application, your application won't be able to send in-app billing
+requests to Google Play. For general information about how to set up a device for use in
developing Android applications, see <a href="{@docRoot}guide/developing/device.html">Using Hardware
Devices</a>.</p>
@@ -50,12 +50,12 @@
<h2 id="billing-testing-static">Testing in-app purchases with static responses</h2>
<p>We recommend that you first test your in-app billing implementation using static responses from
-Android Market. This enables you to verify that your application is handling the primary Android
-Market responses correctly and that your application is able to verify signatures correctly.</p>
+Google Play. This enables you to verify that your application is handling the primary Google
+Play responses correctly and that your application is able to verify signatures correctly.</p>
<p>To test your implementation with static responses, you make an in-app billing request using a
special item that has a reserved product ID. Each reserved product ID returns a specific static
-response from Android Market. No money is transferred when you make in-app billing requests with the
+response from Google Play. No money is transferred when you make in-app billing requests with the
reserved product IDs. Also, you cannot specify the form of payment when you make a billing request
with a reserved product ID. Figure 1 shows the checkout flow for the reserved item that has the
product ID android.test.purchased.</p>
@@ -65,7 +65,7 @@
<strong>Figure 1.</strong> Checkout flow for the special reserved item android.test.purchased.
</p>
-<p>You do not need to list the reserved products in your application's product list. Android Market
+<p>You do not need to list the reserved products in your application's product list. Google Play
already knows about the reserved product IDs. Also, you do not need to upload your application to
the publisher site to perform static response tests with the reserved product IDs. You can simply
install your application on a device, log into the device, and make billing requests using the
@@ -75,24 +75,24 @@
<ul>
<li><strong>android.test.purchased</strong>
- <p>When you make an in-app billing request with this product ID, Android Market responds as
+ <p>When you make an in-app billing request with this product ID, Google Play responds as
though you successfully purchased an item. The response includes a JSON string, which contains
fake purchase information (for example, a fake order ID). In some cases, the JSON string is
signed and the response includes the signature so you can test your signature verification
implementation using these responses.</p>
</li>
<li><strong>android.test.canceled</strong>
- <p>When you make an in-app billing request with this product ID Android Market responds as
+ <p>When you make an in-app billing request with this product ID Google Play responds as
though the purchase was canceled. This can occur when an error is encountered in the order
process, such as an invalid credit card, or when you cancel a user's order before it is
charged.</p>
</li>
<li><strong>android.test.refunded</strong>
- <p>When you make an in-app billing request with this product ID, Android Market responds as
- though the purchase was refunded. Refunds cannot be initiated through Android Market's in-app
+ <p>When you make an in-app billing request with this product ID, Google Play responds as
+ though the purchase was refunded. Refunds cannot be initiated through Google Play's in-app
billing service. Refunds must be initiated by you (the merchant). After you process a refund
request through your Google Checkout account, a refund message is sent to your application by
- Android Market. This occurs only when Android Market gets notification from Google Checkout that
+ Google Play. This occurs only when Google Play gets notification from Google Checkout that
a refund has been made. For more information about refunds, see <a
href="{@docRoot}guide/market/billing/billing_overview.html#billing-action-notify">Handling
IN_APP_NOTIFY messages</a> and <a
@@ -100,7 +100,7 @@
Pricing</a>.</p>
</li>
<li><strong>android.test.item_unavailable</strong>
- <p>When you make an in-app billing request with this product ID, Android Market responds as
+ <p>When you make an in-app billing request with this product ID, Google Play responds as
though the item being purchased was not listed in your application's product list.</p>
</li>
</ul>
@@ -185,20 +185,20 @@
<p>You do not need to use a test account if you are testing only with the reserved product
IDs.</p>
</li>
- <li><strong>Verify that your device is running a supported version of the Android Market
+ <li><strong>Verify that your device is running a supported version of the Google Play
application or the MyApps application.</strong>
<p>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
the MyApps application. If your device is running any other version of Android, in-app billing
- requires version 2.3.4 (or higher) of the Android Market application. To learn how to check the
- version of the Android Market application, see <a
- href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Android
- Market</a>.</p>
+ requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the
+ version of the Google Play application, see <a
+ href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google
+ Play</a>.</p>
</li>
<li><strong>Run your application and purchase the reserved product IDs.</strong></li>
</ol>
<p class="note"><strong>Note</strong>: Making in-app billing requests with the reserved product IDs
-overrides the usual Android Market production system. When you send an in-app billing request for a
+overrides the usual Google Play production system. When you send an in-app billing request for a
reserved product ID, the quality of service will not be comparable to the production
environment.</p>
@@ -207,7 +207,7 @@
<p>After you finish your static response testing, and you verify that signature verification is
working in your application, you can test your in-app billing implementation by making actual in-app
purchases. Testing real in-app purchases enables you to test the end-to-end in-app billing
-experience, including the actual responses from Android Market and the actual checkout flow that
+experience, including the actual responses from Google Play and the actual checkout flow that
users will experience in your application.</p>
<p class="note"><strong>Note</strong>: You do not need to publish your application to do end-to-end
@@ -215,7 +215,7 @@
testing.</p>
<p>To test your in-app billing implementation with actual in-app purchases, you will need to
-register at least one test account on the Android Market publisher site. You cannot use your
+register at least one test account on the Google Play publisher site. You cannot use your
developer account to test the complete in-app purchase process because Google Checkout does not let
you buy items from yourself. If you have not set up test accounts before, see <a
href="{@docRoot}guide/market/billing/billing_admin.html#billing-testing-setup">Setting up test
@@ -237,7 +237,7 @@
IDs; you only need to upload your application as a draft application. However, you must sign
your application with your release key before you upload it as a draft application. Also, the
version number of the uploaded application must match the version number of the application you
- load to your device for testing. To learn how to upload an application to Android Market, see
+ load to your device for testing. To learn how to upload an application to Google Play, see
<a href="http://market.android.com/support/bin/answer.py?answer=113469">Uploading
applications</a>.</p>
</li>
@@ -257,7 +257,7 @@
<p>To perform end-to-end testing of in-app billing, the primary account on your device must be
one of the <a
href="{@docRoot}guide/market/billing/billing_admin.html#billing-testing-setup">test accounts</a>
- that you registered on the Android Market site. If the primary account on your device is not a
+ that you registered on the Google Play site. If the primary account on your device is not a
test account, you must do a factory reset of the device and then sign in with one of your test
accounts. To perform a factory reset, do the following:</p>
<ol>
@@ -269,14 +269,14 @@
device setup process.</li>
</ol>
</li>
- <li><strong>Verify that your device is running a supported version of the Android Market
+ <li><strong>Verify that your device is running a supported version of the Google Play
application or the MyApps application.</strong>
<p>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
the MyApps application. If your device is running any other version of Android, in-app billing
- requires version 2.3.4 (or higher) of the Android Market application. To learn how to check the
- version of the Android Market application, see <a
- href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Android
- Market</a>.</p>
+ requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the
+ version of the Google Play application, see <a
+ href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google
+ Play</a>.</p>
</li>
<li><strong>Make in-app purchases in your application.</strong></li>
</ol>
@@ -285,7 +285,7 @@
do a factory reset, making sure you log on with your primary account first.</p>
<p>When you are finished testing your in-app billing implementation, you are ready to
-publish your application on Android Market. You can follow the normal steps for <a
+publish your application on Google Play. You can follow the normal steps for <a
href="{@docRoot}guide/publishing/preparing.html">preparing</a>, <a
href="{@docRoot}guide/publishing/app-signing.html">signing</a>, and <a
href="{@docRoot}guide/publishing/publishing.html">publishing your application</a>.
diff --git a/docs/html/guide/market/billing/index.jd b/docs/html/guide/market/billing/index.jd
index fdfa6fa..036761f 100755
--- a/docs/html/guide/market/billing/index.jd
+++ b/docs/html/guide/market/billing/index.jd
@@ -30,18 +30,18 @@
</div>
</div>
-<p>Android Market In-app Billing is an Android Market service that lets you sell digital content in
+<p>Google Play In-app Billing is a Google Play service that lets you sell digital content in
your applications. You can use the service to sell a wide range of content, including downloadable
content such as media files or photos, and virtual content such as game levels or potions.</p>
-<p>When you use Android Market's in-app billing service to sell an item, Android Market handles all
+<p>When you use Google Play's in-app billing service to sell an item, Google Play handles all
checkout details so your application never has to directly process any financial transactions.
-Android Market uses the same checkout service that is used for application purchases, so your users
+Google Play uses the same checkout service that is used for application purchases, so your users
experience a consistent and familiar purchase flow (see figure 1). Also, the transaction fee for
in-app purchases is the same as the transaction fee for application purchases (30%).</p>
-<p>Any application that you publish through Android Market can implement in-app billing. No special
-account or registration is required other than an Android Market publisher account and a Google
+<p>Any application that you publish through Google Play can implement in-app billing. No special
+account or registration is required other than a Google Play app publisher account and a Google
Checkout Merchant account. Also, because the service uses no dedicated framework APIs, you can add
in-app billing to any application that uses a minimum API level of 4 or higher.</p>
@@ -59,11 +59,11 @@
<img src="{@docRoot}images/billing_checkout_flow.png" height="382" id="figure1" />
<p class="img-caption">
<strong>Figure 1.</strong> Applications initiate in-app billing requests through their own UI
- (first screen). Android Market responds to the request by providing the checkout user interface
+ (first screen). Google Play responds to the request by providing the checkout user interface
(middle screen). When checkout is complete, the application resumes.
</p>
-<p>To learn more about Android Market's in-app billing service and start integrating it into your
+<p>To learn more about Google Play's in-app billing service and start integrating it into your
applications, read the following documents:</p>
<dl>
@@ -88,7 +88,7 @@
<dd>Learn how to set up your product list, register test accounts, and handle refunds.</dd>
<dt><strong><a href="{@docRoot}guide/market/billing/billing_reference.html">In-app Billing
Reference</a></strong></dt>
- <dd>Get detailed information about Android Market response codes and the in-app billing
+ <dd>Get detailed information about Google Play response codes and the in-app billing
interface.</dd>
</dl>
diff --git a/docs/html/guide/market/expansion-files.jd b/docs/html/guide/market/expansion-files.jd
index cd9b57a..01acb33 100644
--- a/docs/html/guide/market/expansion-files.jd
+++ b/docs/html/guide/market/expansion-files.jd
@@ -8,7 +8,7 @@
<ul>
<li>Recommended for most apps that exceed the 50MB APK limit</li>
<li>You can provide up to 4GB of additional data for each APK</li>
- <li>Android Market hosts and serves the expansion files at no charge</li>
+ <li>Google Play hosts and serves the expansion files at no charge</li>
<li>The files can be any file type you want and are saved to the device's shared storage</li>
</ul>
@@ -61,28 +61,28 @@
-<p>Android Market currently requires that your APK file be no more than 50MB. For most
+<p>Google Play currently requires that your APK file be no more than 50MB. For most
applications, this is plenty of space for all the application's code and assets.
However, some apps need more space for high-fidelity graphics, media files, or other large assets.
Previously, if your app exceeded 50MB, you had to host and download the additional resources
yourself when the user opens the app. Hosting and serving the extra files can be costly, and the
user experience is often less than ideal. To make this process easier for you and more pleasant
-for users, Android Market allows you to attach two large expansion files that supplement your
+for users, Google Play allows you to attach two large expansion files that supplement your
APK.</p>
-<p>Android Market hosts the expansion files for your application and serves them to the device at
+<p>Google Play hosts the expansion files for your application and serves them to the device at
no cost to you. The expansion files are saved to the device's shared storage location (the
SD card or USB-mountable partition; also known as the "external" storage) where your app can access
-them. On most devices, Android Market downloads the expansion file(s) at the same time it
+them. On most devices, Google Play downloads the expansion file(s) at the same time it
downloads the APK, so your application has everything it needs when the user opens it for the
-first time. In some cases, however, your application must download the files from Android Market
+first time. In some cases, however, your application must download the files from Google Play
when your application starts.</p>
<h2 id="Overview">Overview</h2>
-<p>Each time you upload an APK using the Android Market Developer Console, you have the option to
+<p>Each time you upload an APK using the Google Play Android Developer Console, you have the option to
add one or two expansion files to the APK. Each file can be up to 2GB and it can be any format you
choose, but we recommend you use a compressed file to conserve bandwidth during the download.
Conceptually, each expansion file plays a different role:</p>
@@ -102,7 +102,7 @@
<p>However, even if your application update requires only a new patch expansion file, you still must
upload a new APK with an updated <a
href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code
-versionCode}</a> in the manifest. (The Android Market
+versionCode}</a> in the manifest. (The
Developer Console does not allow you to upload an expansion file to an existing APK.)</p>
<p class="note"><strong>Note:</strong> The patch expansion file is semantically the same as the
@@ -115,7 +115,7 @@
<h3 id="Filename">File name format</h3>
<p>Each expansion file you upload can be any format you choose (ZIP, PDF, MP4, etc.). Regardless of
-the file type, Android Market considers them opaque binary blobs and renames the files
+the file type, Google Play considers them opaque binary blobs and renames the files
using the following scheme:</p>
<pre class="classic no-pretty-print">
@@ -133,7 +133,7 @@
<em>first</em> associated (it matches the application's <a
href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code android:versionCode}</a>
value).
- <p>"First" is emphasized because although the Android Market Developer Console allows you to
+ <p>"First" is emphasized because although the Developer Console allows you to
re-use an uploaded expansion file with a new APK, the expansion file's name does not change—it
retains the version applied to it when you first uploaded the file.</p></dd>
<dt>{@code <package-name>}</dt>
@@ -147,9 +147,9 @@
<h3 id="StorageLocation">Storage location</h3>
-<p>When Android Market downloads your expansion files to a device, it saves them to the system's
+<p>When Google Play downloads your expansion files to a device, it saves them to the system's
shared storage location. To ensure proper behavior, you must not delete, move, or rename the
-expansion files. In the event that your application must perform the download from Android Market
+expansion files. In the event that your application must perform the download from Google Play
itself, you must save the files to the exact same location.</p>
<p>The specific location for your expansion files is:</p>
@@ -194,27 +194,27 @@
<h3 id="DownloadProcess">Download process</h3>
-<p>Most of the time, Android Market downloads and saves your expansion files at the same time it
-downloads the APK to the device. However, in some cases Android Market
+<p>Most of the time, Google Play downloads and saves your expansion files at the same time it
+downloads the APK to the device. However, in some cases Google Play
cannot download the expansion files or the user might have deleted previously downloaded expansion
files. To handle these situations, your app must be able to download the files
-itself when the main activity starts, using a URL provided by Android Market.</p>
+itself when the main activity starts, using a URL provided by Google Play.</p>
<p>The download process from a high level looks like this:</p>
<ol>
- <li>User selects to install your app from Android Market.</li>
- <li>If Android Market is able to download the expansion files (which is the case for most
+ <li>User selects to install your app from Google Play.</li>
+ <li>If Google Play is able to download the expansion files (which is the case for most
devices), it downloads them along with the APK.
- <p>If Android Market is unable to download the expansion files, it downloads the
+ <p>If Google Play is unable to download the expansion files, it downloads the
APK only.</p>
</li>
<li>When the user launches your application, your app must check whether the expansion files are
already saved on the device.
<ol>
<li>If yes, your app is ready to go.</li>
- <li>If no, your app must download the expansion files over HTTP from Android Market. Your app
-must send a request to the Android Market client using the Android Market's <a
+ <li>If no, your app must download the expansion files over HTTP from Google Play. Your app
+must send a request to the Google Play client using the Google Play's <a
href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> service, which
responds with the name, file size, and URL for each expansion file. With this information, you then
download the files and save them to the proper <a href="#StorageLocation">storage location</a>.</li>
@@ -223,7 +223,7 @@
</ol>
<p class="caution"><strong>Caution:</strong> It is critical that you include the necessary code to
-download the expansion files from Android Market in the event that the files are not already on the
+download the expansion files from Google Play in the event that the files are not already on the
device when your application starts. As discussed in the following section about <a
href="#Downloading">Downloading the Expansion Files</a>, we've made a library available to you that
greatly simplifies this process and performs the download from a service with a minimal amount of
@@ -258,7 +258,7 @@
Library</a>.</p>
</li>
<li>Add logic to your application's main activity that checks whether the expansion files
-are on the device upon start-up. If the files are not on the device, use Android Market's <a
+are on the device upon start-up. If the files are not on the device, use Google Play's <a
href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> service to request URLs
for the expansion files, then download and save them.
<p>To greatly reduce the amount of code you must write and ensure a good user experience
@@ -280,15 +280,15 @@
<h2 id="Rules">Rules and Limitations</h2>
<p>Adding APK expansion files is a feature available when you upload your application using the
-Android Market Developer Console. When uploading your application for the first time or updating an
+Developer Console. When uploading your application for the first time or updating an
application that uses expansion files, you must be aware of the following rules and limitations:</p>
<ol type="I">
<li>Each expansion file can be no more than 2GB.</li>
- <li>In order to download your expansion files from Android Market, <strong>the user must have
-acquired your application from Android Market</strong>. Android Market will not
+ <li>In order to download your expansion files from Google Play, <strong>the user must have
+acquired your application from Google Play</strong>. Google Play will not
provide the URLs for your expansion files if the application was installed by other means.</li>
- <li>When performing the download from within your application, the URL that Android Market
+ <li>When performing the download from within your application, the URL that Google Play
provides for each file is unique for every download and each one expires shortly after it is given
to your application.</li>
<li>If you update your application with a new APK or upload <a
@@ -313,7 +313,7 @@
directory</strong>. If you must unpack some data, save it into the location specified by {@link
android.content.Context#getExternalFilesDir getExternalFilesDir()}.</li>
<li><strong>Do not delete or rename the {@code .obb} expansion file</strong> (unless you're
-performing an update). Doing so will cause Android Market (or your app itself) to repeatedly
+performing an update). Doing so will cause Google Play (or your app itself) to repeatedly
download the expansion file.</li>
<li>When updating an expansion file manually, you must delete the previous expansion file.</li>
</ol>
@@ -328,11 +328,11 @@
<h2 id="Downloading">Downloading the Expansion Files</h2>
-<p>In most cases, Android Market downloads and saves your expansion files to the device at the same
+<p>In most cases, Google Play downloads and saves your expansion files to the device at the same
time it installs or updates the APK. This way, the expansion files are available when your
application launches for the first time. However, in some cases your app must download the
expansion files itself by requesting them from a URL provided to you in a response
-from Android Market's <a
+from Google Play's <a
href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> service.</p>
<p>The basic logic you need to download your expansion files is the following:</p>
@@ -345,15 +345,15 @@
<li>If the expansion files are there, you're all set and your application can continue.</li>
<li>If the expansion files are <em>not</em> there:
<ol>
- <li>Perform a request using Android Market's <a
+ <li>Perform a request using Google Play's <a
href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> to get your
app's expansion file names, sizes, and URLs.</li>
- <li>Use the URLs provided by Android Market to download the expansion files and save
+ <li>Use the URLs provided by Google Play to download the expansion files and save
the expansion files. You <strong>must</strong> save the files to the <a
href="#StorageLocation">shared storage location</a>
(<code>Android/obb/<package-name>/</code>) and use the exact file name provided
-by Android Market's response.
- <p class="note"><strong>Note:</strong> The URL that Android Market provides for your
+by Google Play's response.
+ <p class="note"><strong>Note:</strong> The URL that Google Play provides for your
expansion files is unique for every download and each one expires shortly after it is given to
your application.</p>
</li>
@@ -368,16 +368,16 @@
href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> service. It's primarily
designed for you to enforce
licensing policies for your application and ensure that the user has the right to
-use your app (he or she rightfully paid for it on Android Market). In order to facilitate the
+use your app (he or she rightfully paid for it on Google Play). In order to facilitate the
expansion file functionality, the licensing service has been enhanced to provide a response
to your application that includes the URL of your application's expansion files that are hosted
-on Android Market. So, even if your application is free for users, you need to include the Android
-Market License Verification Library (LVL) to use APK expansion files. Of course, if your application
+on Google Play. So, even if your application is free for users, you need to include the
+License Verification Library (LVL) to use APK expansion files. Of course, if your application
is free, you don't need to enforce license verification—you simply need the
library to perform the request that returns the URL of your expansion files.</p>
-<p class="note"><strong>Note:</strong> Whether your application is free or not, Android Market
-returns the expansion file URLs only if the user acquired your application from Android Market.</p>
+<p class="note"><strong>Note:</strong> Whether your application is free or not, Google Play
+returns the expansion file URLs only if the user acquired your application from Google Play.</p>
<p>In addition to the LVL, you need a set of code that downloads the expansion files
over an HTTP connection and saves them to the proper location on the device's shared storage.
@@ -408,8 +408,8 @@
download your expansion files. The information in the following sections explain how to integrate
the library into your application.</p>
-<p>If you'd rather develop your own solution to download the expansion files using the Android
-Market URLs, you must follow the <a href="{@docRoot}guide/market/licensing/index.html">Application
+<p>If you'd rather develop your own solution to download the expansion files using the Google
+Play URLs, you must follow the <a href="{@docRoot}guide/market/licensing/index.html">Application
Licensing</a> documentation to perform a license request, then retrieve the expansion file names,
sizes, and URLs from the response extras. You should use the <a href="#ExpansionPolicy">{@code
APKExpansionPolicy}</a> class (included in the License Verification Library) as your licensing
@@ -421,7 +421,7 @@
<p>To use APK expansion files with your application and provide the best user experience with
minimal effort on your behalf, we recommend you use the Downloader Library that's included in the
-Android Market APK Expansion Library package. This library downloads your expansion files in a
+Google Market Apk Expansion package. This library downloads your expansion files in a
background service, shows a user notification with the download status, handles network
connectivity loss, resumes the download when possible, and more.</p>
@@ -447,10 +447,11 @@
download two packages from the SDK Manager and add the appropriate libraries to your
application.</p>
-<p>First, open the Android SDK Manager, expand <em>Extras</em> and download:</p>
+<p>First, open the <a href="{@docRoot}sdk/adding-components.html">Android SDK Manager</a>, expand
+<em>Extras</em> and download:</p>
<ul>
<li><em>Google Market Licensing package</em></li>
- <li><em>Google Market APK Expansion Library package</em></li>
+ <li><em>Google Market Apk Expansion package</em></li>
</ul>
<p>If you're using Eclipse, create a project for each library and add it to your app:</p>
@@ -463,7 +464,7 @@
source</strong> and choose the library from the {@code <sdk>/extras/google/} directory
({@code market_licensing/} for the License Verification Library or {@code
market_apk_expansion/downloader_library/} for the Downloader Library).</li>
- <li>Specify a <em>Project Name</em> such as "Android Market License Library" and "Market
+ <li>Specify a <em>Project Name</em> such as "Google Play License Library" and "Google Play
Downloader
Library"</li>
<li>Click <strong>Finish</strong>.</li>
@@ -494,14 +495,14 @@
<p>With both the License Verification Library and Downloader Library added to your
application, you'll be able to quickly integrate the ability to download expansion files from
-Android Market. The format that you choose for the expansion files and how you read them
+Google Play. The format that you choose for the expansion files and how you read them
from the shared storage is a separate implementation that you should consider based on your
application needs.</p>
-<p class="note"><strong>Tip:</strong> The APK Expansion Library package includes a sample
+<p class="note"><strong>Tip:</strong> The Apk Expansion package includes a sample
application
that shows how to use the Downloader Library in an app. The sample uses a third library
-available in the APK Expansion Library package called the APK Expansion Zip Library. If
+available in the Apk Expansion package called the APK Expansion Zip Library. If
you plan on
using ZIP files for your expansion files, we suggest you also add the APK Expansion Zip Library to
your application. For more information, see the section below
@@ -517,10 +518,10 @@
<pre>
<manifest ...>
- <!-- Required to access Android Market Licensing -->
+ <!-- Required to access Google Play Licensing -->
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
- <!-- Required to download files from Android Market -->
+ <!-- Required to download files from Google Play -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required to keep CPU alive while downloading files (NOT to keep screen awake) -->
@@ -569,7 +570,7 @@
<dl>
<dt>{@code getPublicKey()}</dt>
<dd>This must return a string that is the Base64-encoded RSA public key for your publisher
-account, available from the profile page on the Android Market Developer Console (see <a
+account, available from the profile page on the Developer Console (see <a
href="{@docRoot}guide/market/licensing/setting-up.html">Setting Up for Licensing</a>).</dd>
<dt>{@code getSALT()}</dt>
<dd>This must return an array of random bytes that the licensing {@code Policy} uses to
@@ -588,7 +589,7 @@
<pre>
public class SampleDownloaderService extends DownloaderService {
// You must use the public key belonging to your publisher account
- public static final String BASE64_PUBLIC_KEY = "YourAndroidMarketLVLKey";
+ public static final String BASE64_PUBLIC_KEY = "YourLVLKey";
// You should also modify this salt
public static final byte[] SALT = new byte[] { 1, 42, -12, -1, 54, 98,
-100, -12, 43, 2, -8, -4, 9, 5, -106, -107, -33, 45, -1, 84
@@ -612,8 +613,8 @@
</pre>
<p class="caution"><strong>Notice:</strong> You must update the {@code BASE64_PUBLIC_KEY} value
-to be the public key belonging to your publisher account. You can find the key in the Android
-Market Developer Console under your profile information. This is necessary even when testing
+to be the public key belonging to your publisher account. You can find the key in the Developer
+Console under your profile information. This is necessary even when testing
your downloads.</p>
<p>Remember to declare the service in your manifest file:</p>
@@ -686,7 +687,7 @@
versionCode)}</li>
<li>{@code doesFileExist(Context c, String fileName, long fileSize)}</li>
</ul>
- <p>For example, the sample app provided in the APK Expansion Library package calls the
+ <p>For example, the sample app provided in the Apk Expansion package calls the
following method in the activity's {@link android.app.Activity#onCreate onCreate()} method to check
whether the expansion files already exist on the device:</p>
<pre>
@@ -872,7 +873,7 @@
</dl>
<p class="note"><strong>Tip:</strong> For examples of these callbacks that update the download
progress UI, see the {@code SampleDownloaderActivity} in the sample app provided with the
-APK Expansion Library package.</p>
+Apk Expansion package.</p>
<p>Some public methods for the {@code IDownloaderService} interface you might find useful are:</p>
@@ -898,11 +899,11 @@
<h2 id="ExpansionPolicy">Using APKExpansionPolicy</h2>
-<p>If you decide to build your own downloader service instead of using the Android Market
+<p>If you decide to build your own downloader service instead of using the Google Play
<a href="#AboutLibraries">Downloader Library</a>, you should still use the {@code
APKExpansionPolicy} that's provided in the License Verification Library. The {@code
APKExpansionPolicy} class is nearly identical to {@code ServerManagedPolicy} (available in the
-Android Market License Verification Library) but includes additional handling for the APK expansion
+Google Play License Verification Library) but includes additional handling for the APK expansion
file response extras.</p>
<p class="note"><strong>Note:</strong> If you <em>do use</em> the <a
@@ -1037,7 +1038,7 @@
</div>
</div>
-<p>The Android Market APK Expansion Library package includes a library called the APK
+<p>The Google Market Apk Expansion package includes a library called the APK
Expansion Zip Library (located in {@code
<sdk>/extras/google/google_market_apk_expansion/zip_file/}). This is an optional library that
helps you read your expansion
@@ -1089,7 +1090,7 @@
provider {@link android.net.Uri} in order to provide file access for certain Android APIs that
expect {@link android.net.Uri} access to media files.
<p>The sample application available in the
-APK Expansion Library package demonstrates a scenario in which this class is useful
+Apk Expansion package demonstrates a scenario in which this class is useful
to specify a video with {@link android.widget.VideoView#setVideoURI
VideoView.setVideoURI()}. See the sample app's class {@code SampleZipfileProvider} for an
example of how to extend this class to use in your application.</p></dd>
@@ -1143,21 +1144,21 @@
<h3 id="TestingReading">Testing file reads</h3>
-<p>Before you upload your application to Android Market, you
+<p>Before you upload your application to Google Play, you
should test your application's ability to read the files from the shared storage. All you need to do
is add the files to the appropriate location on the device shared storage and launch your
application:</p>
<ol>
- <li>On your device, create the appropriate directory on the shared storage where Android
-Market will save your files.
+ <li>On your device, create the appropriate directory on the shared storage where Google
+Play will save your files.
<p>For example, if your package name is {@code com.example.android}, you need to create
the directory {@code Android/obb/com.example.android/} on the shared storage space. (Plug in
your test device to your computer to mount the shared storage and manually create this
directory.)</p>
</li>
<li>Manually add the expansion files to that directory. Be sure that you rename your files to
-match the <a href="#Filename">file name format</a> that Android Market will use.
+match the <a href="#Filename">file name format</a> that Google Play will use.
<p>For example, regardless of the file type, the main expansion file for the {@code
com.example.android} application should be {@code main.0300110.com.example.android.obb}.
The version code can be whatever value you want. Just remember:</p>
@@ -1165,7 +1166,7 @@
<li>The main expansion file always starts with {@code main} and the patch file starts with
{@code patch}.</li>
<li>The package name always matches that of the APK to which the file is attached on
-Android Market.
+Google Play.
</ul>
</li>
<li>Now that the expansion file(s) are on the device, you can install and run your application to
@@ -1175,7 +1176,7 @@
<p>Here are some reminders about handling the expansion files:</p>
<ul>
<li><strong>Do not delete or rename</strong> the {@code .obb} expansion files (even if you unpack
-the data to a different location). Doing so will cause Android Market (or your app itself) to
+the data to a different location). Doing so will cause Google Play (or your app itself) to
repeatedly download the expansion file.</li>
<li><strong>Do not save other data into your <code>obb/</code>
directory</strong>. If you must unpack some data, save it into the location specified by {@link
@@ -1191,16 +1192,16 @@
for the URLs, download the files, and save them to the device.</p>
<p>To test your application's implementation of the manual download procedure, you must upload
-your application to Android Market as a "draft" to make your expansion files available for
+your application to Google Play as a "draft" to make your expansion files available for
download:</p>
<ol>
- <li>Upload your APK and corresponding expansion files using the Android Market Developer
+ <li>Upload your APK and corresponding expansion files using the Google Play Developer
Console.</li>
<li>Fill in the necessary application details (title, screenshots, etc.). You can come back and
finalize these details before publishing your application.
<p>Click the <strong>Save</strong> button. <em>Do not click Publish.</em> This saves
-the application as a draft, such that your application is not published for Android Market users,
+the application as a draft, such that your application is not published for Google Play users,
but the expansion files are available for you to test the download process.</p></li>
<li>Install the application on your test device using the Eclipse tools or <a
href="{@docRoot}guide/developing/tools/adb.html">{@code adb}</a>.</li>
@@ -1215,29 +1216,29 @@
<h2 id="Updating">Updating Your Application</h2>
-<p>One of the great benefits to using expansion files on Android Market is the ability to
-update your application without re-downloading all of the original assets. Because Android Market
+<p>One of the great benefits to using expansion files on Google Play is the ability to
+update your application without re-downloading all of the original assets. Because Google Play
allows you to provide two expansion files with each APK, you can use the second file as a "patch"
that provides updates and new assets. Doing so avoids the
need to re-download the main expansion file which could be large and expensive for users.</p>
<p>The patch expansion file is technically the same as the main expansion file and neither
-the Android system nor Android Market perform actual patching between your main and patch expansion
+the Android system nor Google Play perform actual patching between your main and patch expansion
files. Your application code must perform any necessary patches itself.</p>
<p>If you use ZIP files as your expansion files, the <a href="#ZipLib">APK Expansion Zip
-Library</a> that's included with the APK Expansion Library package includes the ability to merge
+Library</a> that's included with the Apk Expansion package includes the ability to merge
your
patch file with the main expansion file.</p>
<p class="note"><strong>Note:</strong> Even if you only need to make changes to the patch
-expansion file, you must still update the APK in order for Android Market to perform an update.
+expansion file, you must still update the APK in order for Google Play to perform an update.
If you don't require code changes in the application, you should simply update the <a
href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code versionCode}</a> in the
manifest.</p>
<p>As long as you don't change the main expansion file that's associated with the APK
-in the Android Market Developer Console, users who previously installed your application will not
+in the Developer Console, users who previously installed your application will not
download the main expansion file. Existing users receive only the updated APK and the new patch
expansion file (retaining the previous main expansion file).</p>
@@ -1245,11 +1246,11 @@
<ul>
<li>There can be only two expansion files for your application at a time. One main expansion
-file and one patch expansion file. During an update to a file, Android Market deletes the
+file and one patch expansion file. During an update to a file, Google Play deletes the
previous version (and so must your application when performing manual updates).</li>
<li>When adding a patch expansion file, the Android system does not actually patch your
application or main expansion file. You must design your application to support the patch data.
-However, the APK Expansion Library package includes a library for using ZIP files
+However, the Apk Expansion package includes a library for using ZIP files
as expansion files, which merges the data from the patch file into the main expansion file so
you can easily read all the expansion file data.</li>
</ul>
diff --git a/docs/html/guide/market/licensing/adding-licensing.jd b/docs/html/guide/market/licensing/adding-licensing.jd
index d1fe839..d4dd008 100644
--- a/docs/html/guide/market/licensing/adding-licensing.jd
+++ b/docs/html/guide/market/licensing/adding-licensing.jd
@@ -82,7 +82,7 @@
<h2 id="manifest-permission">Adding the Licensing Permission</h2>
-<p>To use the Android Market application for sending a license check to the
+<p>To use the Google Play application for sending a license check to the
server, your application must request the proper permission,
<code>com.android.vending.CHECK_LICENSE</code>. If your application does
not declare the licensing permission but attempts to initiate a license check,
@@ -101,7 +101,7 @@
<pre><?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" ...">
- <!-- Devices >= 3 have version of Android Market that supports licensing. -->
+ <!-- Devices >= 3 have version of Google Play that supports licensing. -->
<uses-sdk android:minSdkVersion="3" />
<!-- Required permission to check licensing. -->
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
@@ -123,7 +123,7 @@
<h2>ServerManagedPolicy</h2>
<p>The LVL includes a complete {@code Policy} implementation called ServerManagedPolicy
-that makes use of license-management settings provided by the Android Market
+that makes use of license-management settings provided by the Google Play
server. </p>
<p style="margin-top:.5em;">Use of ServerManagedPolicy as the basis for your
@@ -133,7 +133,7 @@
</div>
</div>
-<p>Android Market licensing service does not itself determine whether a
+<p>Google Play licensing service does not itself determine whether a
given user with a given license should be granted access to your application.
Rather, that responsibility is left to a {@code Policy} implementation that you provide
in your application.</p>
@@ -227,7 +227,7 @@
href="{@docRoot}guide/market/licensing/licensing-reference.html#extras">Server Response Extras</a>
for more information.</li>
<li>Uses an exponential backoff period, if retrying any requests the result in
-errors. Note that the Android Market client automatically retries failed
+errors. Note that the Google Play client automatically retries failed
requests, so in most cases there is no need for your {@code Policy} to retry them.</li>
<li>Provides for a "grace period" that allows the user to access your
application for a limited time or number of uses, while a license check is being
@@ -286,7 +286,7 @@
<p>Importantly, a key feature of ServerMangedPolicy is its use of
server-provided settings as the basis for managing licensing across an
application's refund period and through varying network and error conditions.
-When an application contacts the Android Market server for a license check, the
+When an application contacts the Google Play server for a license check, the
server appends several settings as key-value pairs in the extras field of certain
license response types. For example, the server provides recommended values for the
application's license validity period, retry grace period, and maximum allowable
@@ -298,7 +298,7 @@
Extras</a>.</p>
<p>For convenience, best performance, and the benefit of using license settings
-from the Android Market server, <strong>using ServerManagedPolicy as your
+from the Google Play server, <strong>using ServerManagedPolicy as your
licensing {@code Policy} is strongly recommended</strong>. </p>
<p>If you are concerned about the security of license response data that is
@@ -446,7 +446,7 @@
<p>Before requesting new permissions for the <em>sole purpose</em> of acquiring
device-specific information for use in your {@code Obfuscator}, consider
-how doing so might affect your application or its filtering on Android Market
+how doing so might affect your application or its filtering on Google Play
(since some permissions can cause the SDK build tools to add
the associated <code><uses-feature></code>).</p>
@@ -647,11 +647,11 @@
<li>Display a "Try again" dialog to the user, including a button to initiate a
new license check if the <code>reason</code> supplied is {@code Policy.RETRY}. </li>
<li>Display a "Purchase this application" dialog, including a button that
-deep-links the user to the application's details page on Market, from which the
+deep-links the user to the application's details page on Google Play, from which the
use can purchase the application. For more information on how to set up such
links, see <a
-href="{@docRoot}guide/publishing/publishing.html#marketintent">Using Intents to
-Launch the Market Application on a Device</a>. </li>
+href="{@docRoot}guide/publishing/publishing.html#marketintent">Linking to your apps
+on Google Play</a>. </li>
<li>Display a Toast notification that indicates that the features of the
application are limited because it is not licensed. </li>
</ul>
@@ -688,7 +688,7 @@
// Your response should always inform the user that the application
// is not licensed, but your behavior at that point can vary. You might
// provide the user a limited access version of your app or you can
- // take them to Android Market to purchase the app.
+ // take them to Google Play to purchase the app.
showDialog(DIALOG_GOTOMARKET);
}
}
@@ -707,16 +707,16 @@
<h3 id="thread-handler">Create a Handler for posting from LicenseCheckerCallback
to the UI thread</h3>
-<p>During a license check, the LVL passes the request to the Android Market
+<p>During a license check, the LVL passes the request to the Google Play
application, which handles communication with the licensing server. The LVL
passes the request over asynchronous IPC (using {@link android.os.Binder}) so
the actual processing and network communication do not take place on a thread
-managed by your application. Similarly, when the Android Market application
+managed by your application. Similarly, when the Google Play application
receives the result, it invokes a callback method over IPC, which in turn
executes in an IPC thread pool in your application's process.</p>
<p>The {@code LicenseChecker} class manages your application's IPC communication with
-the Android Market application, including the call that sends the request and
+the Google Play application, including the call that sends the request and
the callback that receives the response. {@code LicenseChecker} also tracks open license
requests and manages their timeouts. </p>
@@ -858,14 +858,14 @@
<h3 id="account-key">Embed your public key for licensing</h3>
-<p>For each publisher account, the Android Market service automatically
+<p>For each publisher account, the Google Play service automatically
generates a 2048-bit RSA public/private key pair that is used exclusively for
licensing. The key pair is uniquely associated with the publisher account and is
shared across all applications that are published through the account. Although
associated with a publisher account, the key pair is <em>not</em> the same as
the key that you use to sign your applications (or derived from it).</p>
-<p>The Android Market publisher site exposes the public key for licensing to any
+<p>The Google Play publisher site exposes the public key for licensing to any
developer signed in to the publisher account, but it keeps the private key
hidden from all users in a secure location. When an application requests a
license check for an application published in your account, the licensing server
@@ -878,8 +878,8 @@
your account's public key for licensing:</p>
<ol>
-<li>Go to the Android Market <a
-href="http://market.android.com/publish">publisher site</a> and sign in.
+<li>Go to the Google Play <a
+href="http://play.google.com/apps/publish">publisher site</a> and sign in.
Make sure that you sign in to the account from which the application you are
licensing is published (or will be published). </li>
<li>In the account home page, locate the "Edit profile" link and click it. </li>
@@ -907,7 +907,7 @@
{@link android.content.Context} changes, add a call to the {@code LicenseChecker}'s
<code>onDestroy()</code> method from your Activity's
{@link android.app.Activity#onDestroy()} implementation. The call causes the
-{@code LicenseChecker} to properly close any open IPC connection to the Android Market
+{@code LicenseChecker} to properly close any open IPC connection to the Google Play
application's ILicensingService and removes any local references to the service
and handler.</p>
@@ -992,13 +992,13 @@
<p>Several obfuscator programs are available for Android applications, including
<a href="http://proguard.sourceforge.net/">ProGuard</a>, which also offers
code-optimization features. The use of ProGuard or a similar program to obfuscate
-your code is <em>strongly recommended</em> for all applications that use Android
-Market Licensing. </p>
+your code is <em>strongly recommended</em> for all applications that use Google
+Play Licensing. </p>
<h2 id="app-publishing">Publishing a Licensed Application</h2>
<p>When you are finished testing your license implementation, you are ready to
-publish the application on Android Market. Follow the normal steps to <a
+publish the application on Google Play. Follow the normal steps to <a
href="{@docRoot}guide/publishing/preparing.html">prepare</a>, <a
href="{@docRoot}guide/publishing/app-signing.html">sign</a>, and then <a
href="{@docRoot}guide/publishing/publishing.html">publish the application</a>.
@@ -1021,7 +1021,7 @@
support you need more quickly. </p>
<p class="table-caption"><strong>Table 2.</strong> Developer support resources
-for Android Market Licensing Service.</p>
+for Google Play Licensing Service.</p>
<table>
@@ -1045,8 +1045,8 @@
</tr>
<tr>
<td rowspan="2">Accounts, publishing, and deployment issues</td>
-<td><a href="http://www.google.com/support/forum/p/Android+Market">Android
-Market Help Forum</a></td>
+<td><a href="http://www.google.com/support/forum/p/Android+Market">Google Play
+Help Forum</a></td>
<td rowspan="2">Publisher accounts, licensing key pair, test accounts, server
responses, test responses, application deployment and results</td>
</tr>
diff --git a/docs/html/guide/market/licensing/index.jd b/docs/html/guide/market/licensing/index.jd
index f08176d..1f15303 100644
--- a/docs/html/guide/market/licensing/index.jd
+++ b/docs/html/guide/market/licensing/index.jd
@@ -2,39 +2,39 @@
@jd:body
-<p>Android Market offers a licensing service that lets you enforce licensing policies for
-applications that you publish on Android Market. With Android Market Licensing, your application can
-query Android Market at run time to obtain the licensing status for the current user, then allow or
+<p>Google Play offers a licensing service that lets you enforce licensing policies for
+applications that you publish on Google Play. With Google Play Licensing, your application can
+query Google Play at run time to obtain the licensing status for the current user, then allow or
disallow further use as appropriate. </p>
<p>Using the service, you can apply a flexible licensing policy on an application-by-application
basis—each application can enforce licensing in the way most appropriate for it. If necessary,
-an application can apply custom constraints based on the licensing status obtained from Android
-Market. For example, an application can check the licensing status and then apply custom constraints
+an application can apply custom constraints based on the licensing status obtained from Google Play.
+For example, an application can check the licensing status and then apply custom constraints
that allow the user to run it unlicensed for a specific validity period. An application can also
restrict use of the application to a specific device, in addition to any other constraints. </p>
<p>The licensing service is a secure means of controlling access to your applications. When an
-application checks the licensing status, the Android Market server signs the licensing status
+application checks the licensing status, the Google Play server signs the licensing status
response using a key pair that is uniquely associated with the publisher account. Your application
stores the public key in its compiled <code>.apk</code> file and uses it to verify the licensing
status response.</p>
-<p>Any application that you publish through Android Market can use the Android Market Licensing
+<p>Any application that you publish through Google Play can use the Google Play Licensing
service. No special account or registration is needed. Additionally, because the service uses no
dedicated framework APIs, you can add licensing to any application that uses a minimum API level of
3 or higher.</p>
-<p class="note"><strong>Note:</strong> The Android Market Licensing service is primarily intended
+<p class="note"><strong>Note:</strong> The Google Play Licensing service is primarily intended
for paid applications that wish to verify that the current user did in fact pay for the application
-on Android Market. However, any application (including free apps) may use the licensing service
+on Google Play. However, any application (including free apps) may use the licensing service
to initiate the download of an APK expansion file. In which case, the request that your application
sends to the licensing service is not to check whether the user paid for the app, but to request the
URL of the expansion files. For information about downloading expansion files for your application,
read the guide to <a href="{@docRoot}guide/market/expansion-files.html">APK Expansion Files</a>.</p>
-<p>To learn more about Android Market's application licensing service and start integrating it into
+<p>To learn more about Google Play's application licensing service and start integrating it into
your applications, read the following documents:</p>
<dl>
@@ -44,7 +44,7 @@
like.</dd>
<dt><strong><a href="{@docRoot}guide/market/licensing/setting-up.html">Setting Up for
Licensing</a></strong></dt>
- <dd>Explains how to set up your Android Market account, development environment, and
+ <dd>Explains how to set up your Google Play account, development environment, and
testing environment in order to add licensing to your app.</dd>
<dt><strong><a href="{@docRoot}guide/market/licensing/adding-licensing.html">Adding
Licensing to Your App</a></strong></dt>
diff --git a/docs/html/guide/market/licensing/licensing-reference.jd b/docs/html/guide/market/licensing/licensing-reference.jd
index ac5d596..0a7e033 100644
--- a/docs/html/guide/market/licensing/licensing-reference.jd
+++ b/docs/html/guide/market/licensing/licensing-reference.jd
@@ -117,7 +117,7 @@
<tr>
<td><em>ILicensingService</em></td>
<td>One-way IPC interface over which a license check request is passed to the
-Android Market client.</td>
+Google Play client.</td>
</tr>
<tr>
<td><em>ILicenseResultListener</em></td>
@@ -137,7 +137,7 @@
necessary handling of these response codes for you. </p>
<p class="table-caption"><strong>Table 2.</strong> Summary of response codes
-returned by the Android Market server in a license response.</p>
+returned by the Google Play server in a license response.</p>
<table>
@@ -178,7 +178,7 @@
</tr>
<tr>
<td>{@code ERROR_CONTACTING_SERVER}</td>
-<td>Local error — the Android Market application was not able to reach the
+<td>Local error — the Google Play application was not able to reach the
licensing server, possibly because of network availability problems. </td>
<td>No</td>
<td></td>
@@ -217,12 +217,12 @@
<tr>
<td>{@code ERROR_NOT_MARKET_MANAGED}</td>
<td>Server error — the application (package name) was not recognized by
-Android Market. </td>
+Google Play. </td>
<td>No</td>
<td></td>
<td><em>Do not retry the license check.</em>
<p style="margin-top:.5em;">Can indicate that the application was not published
-through Android Market or that there is an development error in the licensing
+through Google Play or that there is an development error in the licensing
implementation.</p>
</td>
</tr>
@@ -233,7 +233,7 @@
href="{@docRoot}guide/market/licensing/setting-up.html#test-env">
Setting Up The Testing Environment</a>, the response code can be manually
overridden for the application developer and any registered test users via the
-Android Market publisher site.
+Google Play publisher site.
<br/><br/>
Additionally, as noted above, applications that are in draft mode (in other
words, applications that have been uploaded but have <em>never</em> been
@@ -263,7 +263,7 @@
settings. </p>
<p class="table-caption"><strong>Table 3.</strong> Summary of
-license-management settings supplied by the Android Market server in a license
+license-management settings supplied by the Google Play server in a license
response.</p>
<table>
@@ -329,7 +329,7 @@
<h4 id="VT">License validity period</h4>
-<p>The Android Market licensing server sets a license validity period for all
+<p>The Google Play licensing server sets a license validity period for all
downloaded applications. The period expresses the interval of time over which an
application's license status should be considered as unchanging and cacheable by
a licensing {@code Policy} in the application. The licensing server includes the
@@ -351,7 +351,7 @@
<p>The licensing server manages the validity period as a means of helping the
application properly enforce licensing across the refund period offered by
-Android Market for paid applications. It sets the validity period based on
+Google Play for paid applications. It sets the validity period based on
whether the application was purchased and, if so, how long ago. Specifically,
the server sets a validity period as follows:</p>
@@ -381,15 +381,15 @@
<p>In some cases, system or network conditions can prevent an application's
license check from reaching the licensing server, or prevent the server's
-response from reaching the Android Market client application. For example, the
+response from reaching the Google Play client application. For example, the
user might launch an application when there is no cell network or data
connection available—such as when on an airplane—or when the
network connection is unstable or the cell signal is weak. </p>
-<p>When network problems prevent or interrupt a license check, the Android
-Market client notifies the application by returning a {@code RETRY} response code to
+<p>When network problems prevent or interrupt a license check, the Google
+Play client notifies the application by returning a {@code RETRY} response code to
the {@code Policy}'s <code>processServerResponse()</code> method. In the case of system
-problems, such as when the application is unable to bind with Android Market's
+problems, such as when the application is unable to bind with Google Play's
{@code ILicensingService} implementation, the {@code LicenseChecker} library itself calls the
Policy <code>processServerResonse()</code> method with a {@code RETRY} response code.
</p>
@@ -397,7 +397,7 @@
<p>In general, the {@code RETRY} response code is a signal to the application that an
error has occurred that has prevented a license check from completing.
-<p>The Android Market server helps an application to manage licensing under
+<p>The Google Play server helps an application to manage licensing under
error conditions by setting a retry "grace period" and a recommended maximum
retries count. The server includes these values in all license check responses,
appending them as extras under the keys {@code GT} and {@code GR}. </p>
diff --git a/docs/html/guide/market/licensing/overview.jd b/docs/html/guide/market/licensing/overview.jd
index 3576e26..05a3a40 100644
--- a/docs/html/guide/market/licensing/overview.jd
+++ b/docs/html/guide/market/licensing/overview.jd
@@ -9,9 +9,9 @@
<h2>Quickview</h2>
<ul>
- <li>Licensing allows you to verify your app was purchased from Android Market</li>
+ <li>Licensing allows you to verify your app was purchased from Google Play</li>
<li>Your app maintains control of how it enforces its licensing status</li>
- <li>The service is free for all developers who publish on Android Market</li>
+ <li>The service is free for all developers who publish on Google Play</li>
</ul>
<h2>In this document</h2>
@@ -26,19 +26,19 @@
</div>
-<p>Android Market Licensing is a network-based service that lets an application query a trusted
-Android Market licensing server to determine whether the application is licensed to the current
-device user. The licensing service is based on the capability of the Android Market licensing server
-to determine whether a given user is licensed to use a given application. Android Market considers a
+<p>Google Play Licensing is a network-based service that lets an application query a trusted
+Google Play licensing server to determine whether the application is licensed to the current
+device user. The licensing service is based on the capability of the Google Play licensing server
+to determine whether a given user is licensed to use a given application. Google Play considers a
user to be licensed if the user is a recorded purchaser of the application.</p>
<p>The request starts when your application makes a request to a service hosted by
-the Android Market client application. The Android Market application then sends a request to
-the licensing server and receives the result. The Android Market application sends
+the Google Play client application. The Google Play application then sends a request to
+the licensing server and receives the result. The Google Play application sends
the result to your application, which can allow or disallow further use of the
application as needed.</p>
-<p class="note"><strong>Note:</strong> If a paid application has been uploaded to Android Market but
+<p class="note"><strong>Note:</strong> If a paid application has been uploaded to Google Play but
saved only as a draft application (the app is unpublished), the licensing server considers all users
to be licensed users of the application (because it's not even possible to purchase the app).
This exception is necessary in order for you to perform testing of your licensing
@@ -48,39 +48,39 @@
<div class="figure" style="width:469px">
<img src="{@docRoot}images/licensing_arch.png" alt=""/>
<p class="img-caption"><strong>Figure 1.</strong> Your application initiates a
-license check through the License Verification Library and the Android Market
-client, which handles communication with the Market server.</p>
+license check through the License Verification Library and the Google Play
+client, which handles communication with the Google Play server.</p>
</div>
<p>To properly identify the user and determine the license status, the licensing server requires
-information about the application and user—your application and the Android Market client work
-together to assemble the information and the Android Market client passes it to the server. </p>
+information about the application and user—your application and the Google Play client work
+together to assemble the information and the Google Play client passes it to the server. </p>
<p>To help you add licensing to your application, the Android SDK provides a downloadable set of
-library sources that you can include in your application project: the "Google Market Billing
+library sources that you can include in your application project: the "Google Market Licensing
package." The License Verification Library (LVL) is a library you can add to your application that
-handles all of the licensing-related communication with the Android Market licensing service. With
+handles all of the licensing-related communication with the Google Play licensing service. With
the LVL added to your application, your application can determine its licensing status for the
current user by simply calling a method and implementing a callback that receives the status
response.</p>
<p>Your application does not query the licensing server
-directly, but instead calls the Android Market client over remote IPC to
+directly, but instead calls the Google Play client over remote IPC to
initiate a license request. In the license request:</p>
<ul>
<li>Your application provides: its package name, a nonce that is later used to
validate any response from the server, and a callback over which the
response can be returned asynchronously.</li>
-<li>The Android Market client collects the necessary information about the user and the device,
+<li>The Google Play client collects the necessary information about the user and the device,
such as the device's primary Google account username, IMSI, and other
information. It then sends the license check request to the server on behalf of
your application.</li>
-<li>The Android Market server evaluates the request using all available information, attempting
+<li>The Google Play server evaluates the request using all available information, attempting
to establish the user's identity to a sufficient level of confidence. The server
then checks the user identity against purchase records for your application and
-returns a license response, which the Android Market client returns to your
+returns a license response, which the Google Play client returns to your
application over the IPC callback.</li>
</ul>
@@ -97,7 +97,7 @@
<h2 id="Secure">License Responses are Secure</h2>
<p>To ensure the integrity of each license query, the server signs the license
-response data using an RSA key pair that is shared exclusively between the Android Market
+response data using an RSA key pair that is shared exclusively between the Google Play
server and you.</p>
<p>The licensing service generates a single licensing key pair for each
@@ -120,7 +120,7 @@
which includes the License Verification Library (LVL). The LVL greatly simplifies the process of
adding licensing to your application and helps ensure a more secure, robust implementation for your
application. The LVL provides internal classes that handle most of the standard operations of a
-license query, such as contacting the Android Market client to initiate a license request and
+license query, such as contacting the Google Play client to initiate a license request and
verifying and validating the responses. It also exposes interfaces that let you easily plug in your
custom code for defining licensing policy and managing access as needed by your application. The key
LVL interfaces are: </p>
@@ -179,17 +179,17 @@
<h2 id="Reqs">Requirements and Limitations</h2>
-<p>Android Market Licensing is designed to let you apply license controls to
-applications that you publish through Android Market. The service is not
+<p>Google Play Licensing is designed to let you apply license controls to
+applications that you publish through Google Play. The service is not
designed to let you control access to applications that are not published
-through Android Market or that are run on devices that do not offer the Android
-Market client. </p>
+through Google Play or that are run on devices that do not offer the Google
+Play client. </p>
<p>Here are some points to keep in mind as you implement licensing in your
application: </p>
<ul>
-<li>An application can use the service only if the Android Market client is
+<li>An application can use the service only if the Google Play client is
installed on its host device and the device is running Android 1.5 (API level 3)
or higher.</li>
<li>To complete a license check, the licensing server must be accessible over
@@ -202,7 +202,7 @@
practices in the following documents, you can help ensure that your implementation will be
secure.</li>
<li>Adding licensing to an application does not affect the way the application
-functions when run on a device that does not offer Android Market.</li>
+functions when run on a device that does not offer Google Play.</li>
<li>You can implement licensing controls for a free app, but only if you're using the service to
provide <a
href="{@docRoot}guide/market/expansion-files.html">APK expansion files</a>.</li>
@@ -212,20 +212,20 @@
<h2 id="CopyProtection">Replacement for Copy Protection</h2>
-<p>Android Market Licensing is a flexible, secure mechanism for controlling
+<p>Google Play Licensing is a flexible, secure mechanism for controlling
access to your applications. It effectively replaces the Copy Protection
-mechanism offered on Android Market and gives you wider distribution
+mechanism offered on Google Play and gives you wider distribution
potential for your applications. </p>
<ul>
-<li>A limitation of the legacy Copy Protection mechanism on Android Market is
+<li>A limitation of the legacy Copy Protection mechanism on Google Play is
that applications using it can be installed only on compatible devices that
provide a secure internal storage environment. For example, a copy-protected
-application cannot be downloaded from Market to a device that provides root
+application cannot be downloaded from Google Play to a device that provides root
access, and the application cannot be installed to a device's SD card. </li>
-<li>With Android Market licensing, you can move to a license-based model in
+<li>With Google Play licensing, you can move to a license-based model in
which access is not bound to the characteristics of the host device, but to your
-publisher account on Android Market and the licensing policy that you define.
+publisher account on Google Play and the licensing policy that you define.
Your application can be installed and controlled on any compatible device on
any storage, including SD card.</li>
</ul>
diff --git a/docs/html/guide/market/licensing/setting-up.jd b/docs/html/guide/market/licensing/setting-up.jd
index c79f90b..15214d1 100644
--- a/docs/html/guide/market/licensing/setting-up.jd
+++ b/docs/html/guide/market/licensing/setting-up.jd
@@ -31,27 +31,27 @@
</div>
</div>
-<p>Before you start adding license verification to your application, you need to set up your Android
-Market publishing account, your development environment, and test accounts required to verify
+<p>Before you start adding license verification to your application, you need to set up your Google
+Play publishing account, your development environment, and test accounts required to verify
your implementation.</p>
<h2 id="account">Setting Up a Publisher Account</h2>
-<p>If you don't already have a publisher account for Android Market, you need to register for one
-using your Google account and agree to the terms of service on the Android Market publisher site:</p>
+<p>If you don't already have a publisher account for Google Play, you need to register for one
+using your Google account and agree to the terms of service on the Google Play publisher site:</p>
<p style="margin-left:2em;"><a
-href="http://market.android.com/publish">http://market.android.com/publish</a>
+href="http://play.google.com/apps/publish">http://play.google.com/apps/publish</a>
</p>
<p>For more information, see <a
-href="{@docRoot}guide/publishing/publishing.html">Publishing on Android Market</a>.</p>
+href="{@docRoot}guide/publishing/publishing.html">Publishing on Google Play</a>.</p>
-<p>If you already have a publisher account on Android Market, use your existing
+<p>If you already have a publisher account on Google Play, use your existing
account to set up licensing.</p>
-<p>Using your publisher account on Android Market, you can:</p>
+<p>Using your publisher account on Google Play, you can:</p>
<ul>
<li>Obtain a public key for licensing</li>
@@ -63,7 +63,7 @@
<h4>Administrative settings for licensing</h4>
<p>You can manage several
-administrative controls for Android Market licensing on the publisher site. The controls are available
+administrative controls for Google Play licensing on the publisher site. The controls are available
in the Edit Profile page, in the "Licensing" panel, shown in figure 1. The controls
let you: </p>
@@ -114,17 +114,17 @@
<p>As described earlier, applications check licensing status not by contacting
the licensing server directly, but by binding to a service provided by the
-Android Market application and initiating a license check request. The Android
-Market service then handles the direct communication with the licensing server
+Google Play application and initiating a license check request. The Google
+Play service then handles the direct communication with the licensing server
and finally routes the response back to your application. To debug and test
licensing in your application, you need to set up a runtime environment that
-includes the necessary Android Market service, so that your application is able
+includes the necessary Google Play service, so that your application is able
to send license check requests to the licensing server. </p>
<p>There are two types of runtime environment that you can use: </p>
<ul>
-<li>An Android-powered device that includes the Android Market application, or</li>
+<li>An Android-powered device that includes the Google Play application, or</li>
<li>An Android emulator running the Google APIs Add-on, API level 8 (release 2)
or higher</li>
</ul>
@@ -137,12 +137,12 @@
<ul>
<li>Run a compatible version of Android 1.5 or later (API level
3 or higher) platform, <em>and</em> </li>
-<li>Run a system image on which the Android Market client application
+<li>Run a system image on which the Google Play client application
is preinstalled. </li>
</ul>
-<p>If Android Market is not preinstalled in the system image, your application won't
-be able to communicate with the Android Market licensing server. </p>
+<p>If Google Play is not preinstalled in the system image, your application won't
+be able to communicate with the Google Play licensing server. </p>
<p>For general information about how to set up a device for use in developing
Android applications, see <a
@@ -154,16 +154,16 @@
licensing.</p>
<p>Because the Android platforms provided in the Android SDK <em>do
-not</em> include Android Market, you need to download the Google APIs Add-On
+not</em> include Google Play, you need to download the Google APIs Add-On
platform, API level 8 (or higher), from the SDK repository. After downloading
the add-on, you need to create an AVD configuration that uses that system image.
</p>
-<p>The Google APIs Add-On does not include the full Android Market client.
+<p>The Google APIs Add-On does not include the full Google Play client.
However, it does provide: </p>
<ul>
-<li>An Android Market background service that implements the
+<li>An Google Play background service that implements the
<code>ILicensingService</code> remote interface, so that your application can
send license checks over the network to the licensing server. </li>
<li>A set of underlying account services that let you add an a Google account on
@@ -174,8 +174,8 @@
</ul>
<p>Several versions of the add-on are available through the SDK Manager, but only
-<strong>Google APIs Add-On, API 8 (release 2) or higher</strong> includes the necessary Android
-Market services.</p>
+<strong>Google APIs Add-On, API 8 (release 2) or higher</strong> includes the necessary Google
+Play services.</p>
<img src="{@docRoot}images/licensing_gapis_8.png" alt=""/>
@@ -256,11 +256,11 @@
<p>To download the LVL component into your development environment, use the
Android SDK Manager. Launch the Android SDK Manager and then
-select the "Market Licensing" component, as shown in figure 3.
+select the "Google Market Licensing" component, as shown in figure 3.
Accept the terms and click <strong>Install Selected</strong> to begin the download. </p>
<img src="{@docRoot}images/licensing_package.png" alt=""/>
-<p class="img-caption"><strong>Figure 3.</strong> The Market Licensing package contains the LVL and
+<p class="img-caption"><strong>Figure 3.</strong> The Licensing package contains the LVL and
the LVL sample application.</p>
<p>When the download is complete, the Android SDK Manager installs both
@@ -297,7 +297,7 @@
than those in default location in the SDK. </p>
<p>Moving the library sources is important is because, when you later update the
-Market licensing package, the SDK installs the new files to the same location as
+Licensing package, the SDK installs the new files to the same location as
the older files. Moving your working library files to a safe location ensures
that your work won't be inadvertently overwritten should you download a new
version of the LVL.</p>
@@ -438,7 +438,7 @@
<h2 id="test-env">Setting Up the Testing Environment</h2>
-<p>The Android Market publisher site provides configuration tools that let you
+<p>The Google Play publisher site provides configuration tools that let you
and others test licensing on your application before it is published. As you are
implementing licensing, you can make use of the publisher site tools to test
your application's Policy and handling of different licensing responses and
@@ -454,7 +454,7 @@
<li>An optional set of test accounts that will receive the static test
response when they check the license of an application that you have uploaded
(regardless whether the application is published or not).</li>
-<li>A runtime environment for the application that includes the Android Market
+<li>A runtime environment for the application that includes the Google Play
application or Google APIs Add-On, on which the user is signed in to the
publisher account or one of the test accounts.</li>
</ul>
@@ -472,7 +472,7 @@
<h3 id="test-response">Setting test responses for license checks</h3>
-<p>Android Market provides a configuration setting in your publisher account
+<p>Google Play provides a configuration setting in your publisher account
that lets you override the normal processing of a license check and return a
specified static response code. The setting is for testing only and applies
<em>only</em> to license checks for applications that you have uploaded, made by
@@ -522,7 +522,7 @@
<p>In some cases, you might want to let multiple teams of developers test
licensing on applications that will ultimately be published through your
publisher account, but without giving them access to your publisher account's
-sign-in credentials. To meet that need, the Android Market publisher site lets
+sign-in credentials. To meet that need, the Google Play publisher site lets
you set up one or more optional <em>test accounts</em> — accounts that are
authorized to query the licensing server and receive static test responses from
your publisher account.</p>
@@ -632,11 +632,11 @@
environment</h3>
<p>The licensing service is designed to determine whether a given user is
-licensed to use a given application — during a license check, the Android
-Market application gathers the user ID from the primary account on the system
+licensed to use a given application — during a license check, the Google
+Play application gathers the user ID from the primary account on the system
and sends it to the server, together with the package name of the application
and other information. However, if there is no user information available, the
-license check cannot succeed, so the Android Market application terminates the
+license check cannot succeed, so the Google Play application terminates the
request and returns an error to the application. </p>
<p>During testing, to ensure that your application can successfully query the
diff --git a/docs/html/guide/market/publishing/multiple-apks.jd b/docs/html/guide/market/publishing/multiple-apks.jd
index ff70e85..e7cfa33 100644
--- a/docs/html/guide/market/publishing/multiple-apks.jd
+++ b/docs/html/guide/market/publishing/multiple-apks.jd
@@ -45,7 +45,7 @@
<h2>See also</h2>
<ol>
- <li><a href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a></li>
+ <li><a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a></li>
<li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
<li><a href="{@docRoot}sdk/compatibility-library.html">Compatibility
Package</a></li>
@@ -55,10 +55,10 @@
</div>
</div>
-<p>Multiple APK support is a feature in Android Market that allows you to publish different APKs
+<p>Multiple APK support is a feature on Google Play that allows you to publish different APKs
for your application that are each targeted to different device configurations. Each APK is a
complete and independent version of your application, but they share the same application listing on
-Android Market and must share the same package name and be signed with the same release key. This
+Google Play and must share the same package name and be signed with the same release key. This
feature is useful for cases in which your application cannot reach all desired devices with a single
APK.</p>
@@ -73,8 +73,8 @@
<p>Although <strong>we encourage you to develop and publish a single APK</strong> that supports as
many device configurations as possible, doing so is sometimes not possible. To help
-you publish your application for as many devices as possible, Android Market allows you to
-publish multiple APKs under the same application listing. Android Market then supplies each APK to
+you publish your application for as many devices as possible, Google Play allows you to
+publish multiple APKs under the same application listing. Google Play then supplies each APK to
the appropriate devices based on configuration support you've declared in the manifest file of each
APK.</p>
@@ -86,7 +86,7 @@
<li>Support different platform versions with each APK.</li>
</ul>
-<p>Currently, these are the only device characteristics that Android Market supports for publishing
+<p>Currently, these are the only device characteristics that Google Play supports for publishing
multiple APKs as the same application.</p>
<p class="note"><strong>Note:</strong> You should generally use multiple APKs to support
@@ -100,8 +100,8 @@
<h2 id="Concepts">Publishing Concepts</h2>
-<p>Before you start publishing multiple APKs on Android Market, you must understand a few
-concepts regarding how the Android Market publisher site works.</p>
+<p>Before you start publishing multiple APKs on Google Play, you must understand a few
+concepts regarding how the Google Play publisher site works.</p>
<h3 id="Active">Active APKs</h3>
@@ -111,20 +111,20 @@
<p>When editing your application, there are two buttons on the top-right side of the page. The
first button is either <strong>Publish</strong> or <strong>Unpublish</strong> and the second
button is always <strong>Save</strong> (but its behavior changes).</p>
- <p>When your application is new or you have unpublished it from Market, the first
+ <p>When your application is new or you have unpublished it from Google Play, the first
button says <strong>Publish</strong>. Clicking it will publish any APKs listed as
-Active, making them available on Android Market. Also while your application is new
+Active, making them available on Google Play. Also while your application is new
or unpublished, clicking <strong>Save</strong> will save any changes you've made, such
as information added to the Product details and APKs you've uploaded, but nothing is made visible on
-Android Market—this allows you to save your changes and sign out of the publisher site before
+Google Play—this allows you to save your changes and sign out of the publisher site before
deciding to publish.</p>
<p>Once you've published your application, the first button changes to
<strong>Unpublish</strong>. Clicking it in this state unpublishes your application so that none
-of the APKs are available on Android Market. Also while published, the behavior of the
+of the APKs are available on Google Play. Also while published, the behavior of the
<strong>Save</strong> button is different. In this state, clicking <strong>Save</strong> not
-only saves all your changes, but also publishes them to Android Market. For example, if you've
+only saves all your changes, but also publishes them to Google Play. For example, if you've
already published your application and then make changes to your product details or activate new
-APKs, clicking <strong>Save</strong> makes all those changes live on Android Market.</p>
+APKs, clicking <strong>Save</strong> makes all those changes live on Google Play.</p>
</div>
</div>
@@ -135,14 +135,14 @@
you're about to publish.</p>
<p>If there are no errors, any "active" APK will be published to
-Android Market when you click the <strong>Publish</strong> button (if the application is
+Google Play when you click the <strong>Publish</strong> button (if the application is
unpublished) or when you click the <strong>Save</strong> button (if the application is
already published).</p>
<h3 id="SimpleAndAdvanced">Simple mode and advanced mode</h3>
-<p>The Android Market publisher site provides two modes for managing the APKs associated with
+<p>The Google Play publisher site provides two modes for managing the APKs associated with
your application: <em>simple mode</em> and <em>advanced mode</em>. You can switch between these by
clicking the
link at the top-right corner of the <strong>APK files</strong> tab.</p>
@@ -164,21 +164,21 @@
<h2 id="HowItWorks">How Multiple APKs Work</h2>
-<p>The concept for using multiple APKs on Android Market is that you have just one entry in
-Android Market for your application, but different devices might download a different APK. This
+<p>The concept for using multiple APKs on Google Play is that you have just one entry in
+Google Play for your application, but different devices might download a different APK. This
means that:</p>
<ul>
<li>You maintain only one set of product details (app description, icons, screenshots, etc.).
This also means you <em>cannot</em> charge a different price for different APKs.</li>
- <li>All users see only one version of your application on Android Market, so they are not
+ <li>All users see only one version of your application on Google Play, so they are not
confused by different versions you may have published that are "for tablets" or
"for phones."</li>
<li>All user reviews are applied to the same application listing, even though users on different
devices may have different APKs.</li>
<li>If you publish different APKs for different versions of Android (for different API levels),
then when a user's device receives a system update that qualifies them for a different APK you've
-published, Android Market updates the user's application to the APK designed for the higher version
+published, Google Play updates the user's application to the APK designed for the higher version
of Android. Any system data associated with the application is retained (the same as with normal
application updates when using a single APK).</li>
</ul>
@@ -192,8 +192,8 @@
<h3 id="SupportedFilters">Supported filters</h3>
<p>Which devices receive each APK is determined by <a
-href="{@docRoot}guide/appendix/market-filters.html">Android Market filters</a> that are specified by
-elements in the manifest file of each APK. However, Android Market allows you to publish multiple
+href="{@docRoot}guide/appendix/market-filters.html">Google Play filters</a> that are specified by
+elements in the manifest file of each APK. However, Google Play allows you to publish multiple
APKs only when each APK uses filters to support a variation of the following
device characteristics:</p>
@@ -229,7 +229,7 @@
href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
<supports-screens>}</a> element are "true" if you do not declare them otherwise. However,
because the {@code android:xlargeScreens} attribute was added in Android 2.3 (API level
-9), Android Market will assume that it is "false" if your application does not set either <a
+9), Google Play will assume that it is "false" if your application does not set either <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
android:minSdkVersion}</a> or <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
@@ -266,7 +266,7 @@
android:minSdkVersion}</a> value must have a higher <a
href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code android:versionCode}</a>
value. This is also true if two APKs overlap their device support based on a different supported
-filter. This ensures that when a device receives a system update, Android Market can offer the user
+filter. This ensures that when a device receives a system update, Google Play can offer the user
an update for your application (because updates are based on an increase in the app version code).
This requirement is described further in the section below about <a href="#Rules">Rules for
multiple APKs</a>.</li>
@@ -286,8 +286,8 @@
</ul>
<p>Other manifest elements that enable <a
-href="{@docRoot}guide/appendix/market-filters.html">Android Market filters</a>—but are not
-listed above—are still applied for each APK as usual. However, Android Market does not allow
+href="{@docRoot}guide/appendix/market-filters.html">Google Play filters</a>—but are not
+listed above—are still applied for each APK as usual. However, Google Play does not allow
you to publish multiple APKs based on variations of them. Thus, you cannot publish
multiple APKs if the above listed filters are the same for each APK (but the APKs differ based on
other characteristics in the manifest file). For
@@ -312,7 +312,7 @@
<li>Each APK <strong>must not exactly match the configuration support of another APK</strong>.
<p>That is, each APK must declare slightly different support for at least one of
-the <a href="#MarketFiltersSupported">supported Market filters</a> (listed above).</p>
+the <a href="#SupportedFilters">supported Google Play filters</a> (listed above).</p>
<p>Usually, you will differentiate your APKs based on a specific characteristic (such as the
supported texture compression formats), and thus, each APK will declare support for different
devices. However, it's OK to publish multiple APKs that overlap their support slightly. When two
@@ -330,11 +330,11 @@
<li>An APK that requires a <strong>higher API level</strong> must have a <strong>higher
version code</strong>.
<p>This is true only when either: the APKs differ based <em>only</em> on the
-supported API levels (no other <a href="#SupportedMarketFilters">supported market filters</a>
+supported API levels (no other <a href="#SupportedFilters">supported filters</a>
distinguish the APKs from each other) <em>or</em> when the APKs do use another supported filter, but
there is an overlap between the APKs within that filter.</p>
<p>This is important because a user's device receives an application update from
-Android Market only if the version code for the APK on Android Market is higher than the version
+Google Play only if the version code for the APK on Google Play is higher than the version
code of the APK currently on the device. This ensures that if a device receives a system update that
then qualifies it to install the APK for higher API levels, the device receives an application
update because the version code increases.</p>
@@ -365,7 +365,7 @@
</ul>
-<p>Failure to abide by the above rules results in an error on the Android Market publisher site
+<p>Failure to abide by the above rules results in an error on the Google Play publisher site
when you activate your APKs—you will be unable to publish your application until you
resolve the error.</p>
@@ -377,7 +377,7 @@
APKs support the devices that then fall outside the supported range. For example, if an APK
currently supports small and normal size screens and you change it to support only small screens,
then you have shrunk the pool of supported devices and some devices will no longer see your
-application in Android Market. You can resolve this by adding another APK that supports normal size
+application on Google Play. You can resolve this by adding another APK that supports normal size
screens so that all previously-supported devices are still supported.</li>
<li>When there are "overlaps" between two or more APKs. For example, if an APK supports screen
@@ -467,8 +467,8 @@
href="{@docRoot}guide/topics/manifest/manifest-element.html#vname">{@code android:versionName}</a>),
so that it's easy for you to associate the version code and version name.</p>
-<p class="note"><strong>Note:</strong> When you increase the version code for an APK, Android
-Market will prompt users of the previous version to update the application. Thus, to avoid
+<p class="note"><strong>Note:</strong> When you increase the version code for an APK, Google
+Play will prompt users of the previous version to update the application. Thus, to avoid
unnecessary updates, you should not increase the version code for APKs that do not actually
include changes.</p>
@@ -507,7 +507,7 @@
<h2 id="SingleAPK">Using a Single APK Instead</h2>
<p><strong>Creating multiple APKs for your application is not the normal procedure</strong> for
-publishing an application on Android Market. In most cases, you should be able to publish your
+publishing an application on Google Play. In most cases, you should be able to publish your
application to most users with a single APK and we encourage that you do so. When you encounter
a situation in which using a single APK becomes difficult, you should carefully consider all your
options before deciding to publish multiple APKs.</p>
@@ -542,7 +542,7 @@
For example, on a new tablet, the user receives your application and it runs with your
tablet-optimized resources. This restore
process does not work across different APKs, because each APK can potentially have different
-permissions that the user has not agreed to, so Android Market may not restore the application at
+permissions that the user has not agreed to, so Google Play may not restore the application at
all. (If you use multiple APKs, the user receives either the exact same APK if it's compatible or
nothing at all and must manually download your application to get the APK designed for the new
device.)</p></li>
@@ -586,7 +586,7 @@
<h3 id="ScreenOptions">Supporting multiple screens</h3>
-<p>Unless your APK file exceeds the Android Market size limit of 50MB, supporting multiple screens
+<p>Unless your APK file exceeds the Google Play size limit of 50MB, supporting multiple screens
should always be done with a single APK. Since Android 1.6, the Android system manages most of the
work required for your application to run successfully on a variety of screen sizes and
densities.</p>
diff --git a/docs/html/guide/practices/compatibility.jd b/docs/html/guide/practices/compatibility.jd
index bb7a72e..5e514c4 100644
--- a/docs/html/guide/practices/compatibility.jd
+++ b/docs/html/guide/practices/compatibility.jd
@@ -7,7 +7,7 @@
<h2>See also</h2>
<ol>
<li><a
-href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a></li>
+href="{@docRoot}guide/appendix/market-filters.html">Filtering on Google Play</a></li>
<li><a
href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">Providing Alternative Resources</a></li>
<li><a
@@ -39,7 +39,7 @@
your apps to do that, while at the same time letting you maintain control of
what types of devices your app is available to. With a bit of forethought and
some minor changes in your app's manifest file, you can ensure that users
-whose devices can’t run your app will never see it in the Android Market, and
+whose devices can’t run your app will never see it on Google Play, and
will not get in trouble by downloading it. This page explains how you can
control which devices have access to your apps, and how to prepare your apps to
make sure they reach the right audience.</p>
@@ -64,7 +64,7 @@
corresponding hardware or feature. But that’s not a problem: we also designed
Android to prevent apps from being visible to devices which don’t have features
the apps require. We’ve built support for this right into the SDK tools, and
-it’s part of the Android platform itself, as well as Android Market.</p>
+it’s part of the Android platform itself, as well as part of Google Play.</p>
<p>As a developer, you have complete control of how and where your apps are
available. Android provides tools as a first-class part of the platform that let
@@ -79,9 +79,9 @@
<li>You state the features your app requires by declaring <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>
elements its manifest file.</li>
-<li>Devices are required to declare the features they include to Android
-Market.</li>
-<li>Android Market uses your app’s stated requirements to filter it from devices
+<li>Devices are required to declare the features they include to Google
+Play.</li>
+<li>Google Play uses your app’s stated requirements to filter it from devices
that don’t meet those requirements.</li>
</ol>
@@ -103,24 +103,24 @@
<div class="sidebox-wrapper">
<img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
<div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0;">
- <p style="color:#669999;">Filtering on Android Market</p>
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
+ <p style="color:#669999;">Filtering on Google Play</p>
- <p>Android Market filters the applications that are visible to users, so
+ <p>Google Play filters the applications that are visible to users, so
that users can see and download only those applications that are compatible with
their devices.</p>
- <p style="margin-top:1em;">One of the ways Market filters applications is by
-feature compatibility. To do this, Market checks the
+ <p style="margin-top:1em;">One of the ways Google Play filters applications is by
+feature compatibility. To do this, Google Play checks the
<code><uses-feature></code> elements in each application's manifest, to
-establish the app's feature needs. Market then shows or hides the application to
+establish the app's feature needs. Google Play then shows or hides the application to
each user, based on a comparison with the features available on the user's
device.
<p style="margin-top:1em;">For information about other filters that you can
use to control the availability of your apps, see the
-<a href="{@docRoot}guide/appendix/market-filters.html">Market
-Filters</a> document.</p>
+<a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>
+document.</p>
</div>
</div>
@@ -142,8 +142,8 @@
<p>When you write your application, you specify which features your app requires
by listing their feature IDs in <code><uses-feature></code> elements in
-the <code>AndroidManifest.xml</code> file. This is the information that Android
-Market uses to match your app to devices that can run it. For instance, if you
+the <code>AndroidManifest.xml</code> file. This is the information that Google
+Play uses to match your app to devices that can run it. For instance, if you
state that your app requires android.software.live_wallpapers, it won’t be shown
to devices that don’t support Live Wallpapers.</p>
@@ -170,12 +170,12 @@
business or legal reasons. For instance, an app that displays train schedules
for the London Underground is unlikely to be useful to users outside the United
Kingdom. Other apps might not be permitted in certain countries for business or
-legal reasons. For cases such as these, Android Market itself provides
+legal reasons. For cases such as these, Google Play itself provides
developers with filtering options that allow them control their app’s
availability for non-technical reasons.</p>
-<p>The help information for Android Market provides full details, but in a
-nutshell, developers can use the Market publisher UI to:</p>
+<p>The help information for Google Play provides full details, but in a
+nutshell, developers can use the Google Play publisher UI to:</p>
<ul>
<li>List the countries an app is available in.</li>
@@ -185,7 +185,7 @@
<p>Filtering for technical compatibility (such as required hardware components)
is always based on information contained within your <code>.apk</code> file. But
filtering for non-technical reasons (such as geographic restrictions) is always
-handled in the Market user interface.</p>
+handled in the Google Play user interface.</p>
<h3 id="futureproofing">Future-proofing</h3>
@@ -206,7 +206,7 @@
barcode scanners do not function as well with cameras that do not auto-focus. To
prevent users from having a bad experience with those apps, existing apps that
obtain permission to use the Camera were assumed by default to require
-auto-focus. This allowed Android Market to filter those apps from devices that
+auto-focus. This allowed Google Play to filter those apps from devices that
lack auto-focus.</li>
<li>Android 2.2, meanwhile, allowed the microphone to be optional on some
diff --git a/docs/html/guide/practices/design/accessibility.jd b/docs/html/guide/practices/design/accessibility.jd
index a66a974..72da04e 100644
--- a/docs/html/guide/practices/design/accessibility.jd
+++ b/docs/html/guide/practices/design/accessibility.jd
@@ -332,11 +332,10 @@
<p>You can simulate the experience for many users by enabling an accessibility service that speaks
as you move around the screen. One such service is <a
-href="https://market.android.com/details?id=com.google.android.marvin.talkback">TalkBack</a>, by the
+href="https://play.google.com/store/details?id=com.google.android.marvin.talkback">TalkBack</a>, by the
<a href="http://code.google.com/p/eyes-free/">Eyes-Free Project</a>. It comes preinstalled on many
-Android-powered devices, but is also available for free from <a
-href="https://market.android.com/details?id=com.google.android.marvin.talkback">Android
-Market</a>.</p>
+Android-powered devices, but is also available for free from the <a
+href="https://play.google.com/store/details?id=com.google.android.marvin.talkback">Google Play</a> store.</p>
<p>This service requires that you have a text-to-speech engine installed on your phone. You can
verify if you have one installed in the <strong>Text-to-speech</strong> settings menu by selecting
diff --git a/docs/html/guide/practices/optimizing-for-3.0.jd b/docs/html/guide/practices/optimizing-for-3.0.jd
index 39662f1..140c50c 100644
--- a/docs/html/guide/practices/optimizing-for-3.0.jd
+++ b/docs/html/guide/practices/optimizing-for-3.0.jd
@@ -481,7 +481,7 @@
configurations of screen size and density, you can instead choose to limit the distribution of your
application to certain types of screens, such as only tablets or only mobile devices. To do so, you
can add elements to your Android manifest file that enable filtering based on screen configuration
-by external services such as Android Market.</p>
+by external services such as Google Play.</p>
<p>However, before you decide to restrict your application to certain screen configurations, you
should understand the techniques for <a
@@ -517,14 +517,14 @@
</manifest>
</pre>
-<p>External services such as Android Market read this manifest element and use it to ensure that
+<p>External services such as Google Play read this manifest element and use it to ensure that
your application is available only to devices with an extra large screen.</p>
<p class="note"><strong>Note:</strong> If you use the <a
href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
<supports-screens>}</a> element for the reverse scenario (when your application is not compatible
with <em>larger</em> screens) and set the larger screen size attributes to {@code "false"}, then
-external services such as Android Market <strong>do not</strong> apply filtering. Your application
+external services such as Google Play <strong>do not</strong> apply filtering. Your application
will still be available to larger screens, but when it runs, it will not fill the screen—the
system will draw it in a "postage stamp" window that's the same relative size as the screen size
that your application does support. If you want to prevent your application from being downloaded on
@@ -541,7 +541,7 @@
use the <a href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
<compatible-screens>}</a> element to manage the distribution of your application based on the
combination of screen size and density. External services such as
-Android Market uses this information to apply filtering to your application, so that only devices
+Google Play uses this information to apply filtering to your application, so that only devices
that have a screen configuration with which you declare compatibility can download your
application.</p>
@@ -551,7 +551,7 @@
the {@code android:screenSize} and {@code android:screenDensity} attributes. Each {@code
<screen>} element <strong>must include both attributes</strong> to specify an individual
screen configuration—if either attribute is missing, then the element is invalid
-(external services such as Android Market will ignore it).</p>
+(external services such as Google Play will ignore it).</p>
<p>For example, if your application is compatible with only small and normal screens, regardless
of screen density, then you must specify eight different {@code <screen>} elements,
@@ -613,7 +613,7 @@
<li><a href="#Telephony">Not all devices have telephony or other features</a>
<p>If your application declares the {@code "android.hardware.telephony"} feature in the manifest,
then it will not be available to devices that do not offer telephony (such as tablets), based on
-Android Market filtering. If your application can function properly without telephony, you should
+Google Play filtering. If your application can function properly without telephony, you should
update your application to gracefully disable the telephony features when not available on a
device.</p></li>
</ul>
@@ -682,7 +682,7 @@
<pre><uses-feature android:name="android.hardware.telephony" /></pre>
<p>By default, this declares that your application <em>requires</em> telephony features. So,
-external services such as Android Market use this information to filter your application from
+external services such as Google Play use this information to filter your application from
devices that do not offer telephony.</p>
<p>If, however, your application uses, but does not require the feature, you should
diff --git a/docs/html/guide/practices/screens-distribution.jd b/docs/html/guide/practices/screens-distribution.jd
index 60c9c95..a7c4a8e 100644
--- a/docs/html/guide/practices/screens-distribution.jd
+++ b/docs/html/guide/practices/screens-distribution.jd
@@ -37,7 +37,7 @@
configurations of screen size and density, you can instead choose to limit the distribution of your
application to certain types of screens, such as only tablets and other large devices or only
handsets and similar-sized devices. To do so, you can enable filtering by external services such as
-Android Market by adding elements to your manifest file that specify the screen configurations your
+Google Play by adding elements to your manifest file that specify the screen configurations your
application supports.</p>
<p>However, before you decide to restrict your application to certain screen configurations, you
@@ -58,7 +58,7 @@
versions of your application for different screen configurations. In such a case, you can use the <a
href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
<compatible-screens>}</a> element to manage the distribution of your application based on
-combinations of screen size and density. External services such as Android Market use this
+combinations of screen size and density. External services such as Google Play use this
information to apply filtering to your application, so that only devices that have a screen
configuration with which you declare compatibility can download your application.</p>
@@ -68,7 +68,7 @@
compatible, using both the {@code android:screenSize} and {@code android:screenDensity} attributes.
Each {@code <screen>} element <strong>must include both attributes</strong> to specify an
individual screen configuration—if either attribute is missing, then the element is invalid
-(external services such as Android Market will ignore it).</p>
+(external services such as Google Play will ignore it).</p>
<p>For example, if your application is compatible with only small and normal size screens,
regardless of screen density, you must specify eight different {@code <screen>} elements,
@@ -173,7 +173,7 @@
href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
<supports-screens>}</a> element for the reverse scenario (when your application is not compatible
with <em>larger</em> screens) and set the larger screen size attributes to {@code "false"}, then
-external services such as Android Market <strong>do not</strong> apply filtering. Your application
+external services such as Google Play <strong>do not</strong> apply filtering. Your application
will still be available to larger screens, but when it runs, it will not resize to fit the screen.
Instead, the system will emulate a handset screen size (about 320dp x 480dp; see <a
href="{@docRoot}guide/practices/screen-compat-mode.html">Screen Compatibility Mode</a> for more
@@ -197,13 +197,13 @@
<h2 id="MultiApks">Publishing Multiple APKs for Different Screens</h2>
-<p>Although we recommend that you publish one APK for your application, Android Market allows
+<p>Although we recommend that you publish one APK for your application, Google Play allows
you to publish multiple APKs for the same
application when each APK supports a different set of screen configurations (as declared in
the manifest file). For example, if you want to publish both a handset version and a tablet
version of your application, but you're unable to make the same APK work for both screen sizes,
you can actually publish two APKs for the same application listing. Depending on each device's
-screen configuration, Android Market will deliver it the APK that you've declared to support that
+screen configuration, Google Play will deliver it the APK that you've declared to support that
device's screen.</p>
<p>Beware, however, that publishing multiple APKs for the same application is
@@ -212,5 +212,5 @@
sizes, especially, is within reason using a single APK, as long as you follow the guide to
<a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
-<p>If you need more information about how to publish multiple APKs on Android Market, read <a
+<p>If you need more information about how to publish multiple APKs on Google Play, read <a
href="{@docRoot}guide/market/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
diff --git a/docs/html/guide/practices/screens_support.jd b/docs/html/guide/practices/screens_support.jd
index fb121bd..29dff26 100644
--- a/docs/html/guide/practices/screens_support.jd
+++ b/docs/html/guide/practices/screens_support.jd
@@ -882,8 +882,8 @@
<p class="caution"><strong>Caution:</strong> The Android system does not pay attention to this
attribute, so it does not affect how your application behaves at runtime. Instead, it is used
-to enable filtering for your application on services such as Android Market. However,
-<strong>Android Market currently does not support this attribute for filtering</strong> (on Android
+to enable filtering for your application on services such as Google Play. However,
+<strong>Google Play currently does not support this attribute for filtering</strong> (on Android
3.2), so you should continue using the other size attributes if your application does not support
small screens.</p>
</dd>
diff --git a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
index 9be72ee..f8ca3f8 100644
--- a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
@@ -886,7 +886,7 @@
You can perform this test when initializing the user interface.
For instance, you could disable the user control that initiates
the Intent object, or display a message to the user that lets them go
- to a location, such as the Market, to download its application.
+ to a location, such as Google Play, to download its application.
In this way, your code can start the activity (using either startActivity()
or startActivityForResult()) only if the intent has tested to resolve
to an activity that is actually present.
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
index 6b686b1..4b6768f 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
@@ -49,9 +49,9 @@
href="{@docRoot}guide/practices/ui_guidelines/icon_design.html#design-tips">Tips for Designers</a>
for suggestions on how to work with multiple sets of icons.</p>
-<p>A high-resolution version of your application launcher icon is also required by Android Market
+<p>A high-resolution version of your application launcher icon is also required by Google Play
for use in application listings. For more details on this, see <a
-href="#icons_in_market">Application Icons in Android Market</a> below.</p>
+href="#icons_in_market">Application Icons on Google Play</a> below.</p>
<p class="note"><strong>Note:</strong>
@@ -81,7 +81,7 @@
<ol>
<li>Promote the brand and tell the story of the app.</li>
- <li>Help users discover the app in Android Market.</li>
+ <li>Help users discover the app on Google Play.</li>
<li>Function well in the Launcher.</li>
</ol>
@@ -100,19 +100,19 @@
</ul>
-<h3 id="help_users_discover">Help users discover the app in Android Market</h3>
+<h3 id="help_users_discover">Help users discover the app on Google Play</h3>
-<p>App launcher icons are the first look that prospective users will get of your app in Android
-Market. A high quality app icon can influence users to find out more as they scroll through lists of
+<p>App launcher icons are the first look that prospective users will get of your app on Google Play.
+A high quality app icon can influence users to find out more as they scroll through lists of
applications.</p>
<p>Quality matters here. A well-designed icon can be a strong signal that your app
is of similarly high quality. Consider working with an icon designer to develop the app’s launcher
icon.</p>
-<p class="note"><strong>Note:</strong> Android Market requires a high-resolution version of your
-icon; for more details on this, see <a href="#icons_in_market">Application Icons in Android
-Market</a> below.</p>
+<p class="note"><strong>Note:</strong> Google Play requires a high-resolution version of your
+icon; for more details on this, see <a href="#icons_in_market">Application Icons in Google
+Play</a> below.</p>
<h3 id="function_well_in_launcher">Function well in the Launcher</h3>
@@ -239,21 +239,21 @@
that launcher icons are legible across on any background color.</p>
-<h3 id="icons_in_market">Application Icons in Android Market</h3>
+<h3 id="icons_in_market">Application Icons on Google Play</h3>
<p>If you are <a href="{@docRoot}guide/publishing/publishing.html">publishing your application on
-Android Market</a>, you will also need to provide a 512 x 512 pixel, high-resolution application icon
-in the <a href="http://market.android.com/publish">developer console</a> at upload time. This icon
-will be used in various locations in Android Market and does not replace your launcher icon.</p>
+Google Play</a>, you will also need to provide a 512 x 512 pixel, high-resolution application icon
+in the <a href="http://play.google.com/apps/publish">developer console</a> at upload time. This icon
+will be used in various locations on Google Play and does not replace your launcher icon.</p>
<p>For tips and recommendations on creating high-resolution launcher icons that can easily be scaled
up to 512x512, see <a href="{@docRoot}guide/practices/ui_guidelines/icon_design.html#design-tips">
Tips for Designers</a>.</p>
-<p>For information and specifications about high-resolution application icons in Android Market, see
+<p>For information and specifications about high-resolution application icons on Google Play, see
the following article:</p>
<p style="margin-left:2em"><a href="http://market.android.com/support/bin/answer.py?answer=1078870">
-Graphic Assets for your Application (Android Market Help) »</a>
+Graphic Assets for your Application (Google Play Help) »</a>
<br><br>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
index ea036cd..85a3cc8 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
@@ -56,13 +56,13 @@
-<h2 id="market">Application Icons in Android Market</h2>
+<h2 id="market">Application Icons on Google Play</h2>
<p>If you are <a href="{@docRoot}guide/publishing/publishing.html">publishing
-your application on Android Market</a>, you will also need to provide a 512x512
+your application on Google Play</a>, you will also need to provide a 512x512
pixel, high-resolution application icon in the <a
-href="http://market.android.com/publish">developer console</a> at upload-time.
-This icon will be used in various locations in Android Market and does
+href="http://play.google.com/apps/publish">developer console</a> at upload-time.
+This icon will be used in various locations on Google Play and does
not replace your launcher icon.</p>
<p>For tips and recommendations on creating high-resolution launcher icons that
@@ -71,11 +71,11 @@
Tips for Designers</a>.</p>
<p>For information and specifications about high-resolution application
-icons in Android Market, see the following article:</p>
+icons on Google Play, see the following article:</p>
<p style="margin-left:2em"><a
href="http://market.android.com/support/bin/answer.py?answer=1078870">
- Graphic Assets for your Application (Android Market Help) »</a>
+ Graphic Assets for your Application (Google Play Help) »</a>
diff --git a/docs/html/guide/publishing/app-signing.jd b/docs/html/guide/publishing/app-signing.jd
index 9abcdf7..e86ec30 100644
--- a/docs/html/guide/publishing/app-signing.jd
+++ b/docs/html/guide/publishing/app-signing.jd
@@ -82,7 +82,7 @@
use to build your application. There are two build modes: <em>debug mode</em> and <em>release
mode</em>. You use debug mode when you are developing and testing your application. You use
release mode when you want to build a release version of your application that you can
-distribute directly to users or publish on an application marketplace such as Android Market.</p>
+distribute directly to users or publish on an application marketplace such as Google Play.</p>
<p>When you build in <em>debug mode</em> the Android SDK build tools use the Keytool utility
(included in the JDK) to create a debug key. Because the SDK build tools created the debug key,
@@ -158,10 +158,10 @@
lifespan of <em>all versions of all of the applications</em>, including
dependent applications that may be added to the suite in the future. </li>
-<li>If you plan to publish your application(s) on Android Market, the
+<li>If you plan to publish your application(s) on Google Play, the
key you use to sign the application(s) must have a validity period
-ending after 22 October 2033. The Market server enforces this requirement
-to ensure that users can seamlessly upgrade Market applications when
+ending after 22 October 2033. Google Play enforces this requirement
+to ensure that users can seamlessly upgrade applications when
new versions are available. </li>
</ul>
@@ -292,7 +292,7 @@
with the application</li>
<li>Has a validity period that exceeds the expected lifespan of the application
or application suite. A validity period of more than 25 years is recommended.
-<p>If you plan to publish your application(s) on Android Market, note that a
+<p>If you plan to publish your application(s) on Google Play, note that a
validity period ending after 22 October 2033 is a requirement. You can not upload an
application if it is signed with a key whose validity expires before that date.
</p></li>
diff --git a/docs/html/guide/publishing/preparing.jd b/docs/html/guide/publishing/preparing.jd
index c355479..fe56352 100644
--- a/docs/html/guide/publishing/preparing.jd
+++ b/docs/html/guide/publishing/preparing.jd
@@ -22,7 +22,7 @@
<ol>
<li><a href="{@docRoot}guide/publishing/publishing_overview.html">Publishing Overview</a></li>
<li><a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a></li>
- <li><a href="{@docRoot}guide/publishing/publishing.html">Publishing on Android Market</a></li>
+ <li><a href="{@docRoot}guide/publishing/publishing.html">Publishing on Google Play</a></li>
</ol>
</div>
</div>
@@ -39,13 +39,13 @@
tasks serve as a final check, ensuring that your application performs as expected under real-world
conditions. When you are finished preparing your application for release you have a signed
<code>.apk</code> file, which you can distribute directly to users or distribute through an
-application marketplace such as Android Market.</p>
+application marketplace such as Google Play.</p>
<p>This document summarizes the main tasks you need to perform to prepare your application for
release. The tasks that are described in this document apply to all Android applications regardless
-how they are released or distributed to users. If you are releasing your application through Android
-Market, you should also read <a href="{@docRoot}guide/publishing/publishing.html">Publishing on
-Android Market</a> to be sure your release-ready application satisfies all Android Market
+how they are released or distributed to users. If you are releasing your application through Google
+Play, you should also read <a href="{@docRoot}guide/publishing/publishing.html">Publishing on
+Google Play</a> to be sure your release-ready application satisfies all Google Play
requirements.</p>
<p class="note"><strong>Note:</strong> As a best practice, your application should meet all of your
@@ -89,9 +89,9 @@
<p>To prepare your application for release you typically perform five main tasks (see figure 2).
Each main task may include one or more smaller tasks depending on how you are releasing your
-application. For example, if you are releasing your application through Android Market you may want
+application. For example, if you are releasing your application through Google Play you may want
to add special filtering rules to your manifest while you are configuring your application for
-release. Similarly, to meet Android Market publishing guidelines you may have to prepare screenshots
+release. Similarly, to meet Google Play publishing guidelines you may have to prepare screenshots
and create promotional text while you are gathering materials for release.</p>
<p>You usually perform the tasks listed in figure 2 after you have throroughly debugged and tested
@@ -137,9 +137,9 @@
href="{@docRoot}guide/practices/ui_guidelines/icon_design_launcher.html">icon guidelines</a>. Your
application's icon helps users identify your application on a device's Home
screen and in the Launcher window. It also appears in Manage Applications, My Downloads, and
-elsewhere. In addition, publishing services such as Android Market display your icon to users.</p>
+elsewhere. In addition, publishing services such as Google Play display your icon to users.</p>
-<p class="note"><strong>Note:</strong> If you are releasing your application on Android Market, you
+<p class="note"><strong>Note:</strong> If you are releasing your application on Google Play, you
need to create a high resolution
version of your icon. See <a
href="https://www.google.com/support/androidmarket/developer/bin/answer.py?answer=1078870">Graphic
@@ -154,7 +154,7 @@
<h4>Miscellaneous Materials</h4>
<p>You might also have to prepare promotional and marketing materials to publicize your application.
-For example, if you are releasing your application on Android Market you will need to prepare some
+For example, if you are releasing your application on Google Play you will need to prepare some
promotional text and you will need to create screenshots of your application. For more
information, see
<a href="https://www.google.com/support/androidmarket/developer/bin/answer.py?answer=1078870">
@@ -242,11 +242,11 @@
</ul>
<p>There are several additional manifest elements that you can set if you are releasing your
-application on Android Market. For example, the <code>android:minSdkVersion</code> and
+application on Google Play. For example, the <code>android:minSdkVersion</code> and
<code>android:targetSdkVersion</code> attributes, which are located in the <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"> <uses-sdk></a> element. For more
-information about these and other Android Market settings, see <a
-href="{@docRoot}/guide//appendix/market-filters.html">Market Filters</a>.</p>
+information about these and other Google Play settings, see <a
+href="{@docRoot}/guide//appendix/market-filters.html">Filters on Google Play</a>.</p>
<h4>Address compatibility issues</h4>
@@ -283,16 +283,15 @@
<p>If your application accesses remote servers or services, make sure you are using the production
URL or path for the server or service and not a test URL or path.</p>
-<h4>Implement Licensing (if you are releasing on Android Market)</h4>
+<h4>Implement Licensing (if you are releasing on Google Play)</h4>
-<p>If you are releasing a paid application through Android Market, consider adding support for
-Android Market Licensing. Licensing lets you control access to your application based on whether the
-current user has purchased it. Using Android Market Licensing is optional even if you are
-releasing your app through Android Market.</p>
+<p>If you are releasing a paid application through Google Play, consider adding support for
+Google Play Licensing. Licensing lets you control access to your application based on whether the
+current user has purchased it. Using Google Play Licensing is optional even if you are
+releasing your app through Google Play.</p>
-<p>For more information about Android Market Licensing Service and how to use it in your
-application, see <a href="{@docRoot}guide/market/licensing/index.html">Application
-Licensing</a>.</p>
+<p>For more information about Google Play Licensing Service and how to use it in your
+application, see <a href="{@docRoot}guide/market/licensing.html">Application Licensing</a>.</p>
<h2 id="publishing-build">Building Your Application for Release</h2>
@@ -353,7 +352,7 @@
done testing and you are satisfied that the release version of your application
behaves correctly, you can release your application to users. For more information, see
<a href="{@docRoot}guide/publishing/publishing_overview.html#publishing-release">Releasing Your
-Application to Users</a>. If you are publishing your application on Android Market, see
-<a href="{@docRoot}guide/publishing/publishing.html">Publishing on Android Market</a>.</p>
+Application to Users</a>. If you are publishing your application on Google Play, see
+<a href="{@docRoot}guide/publishing/publishing.html">Publishing on Google Play</a>.</p>
diff --git a/docs/html/guide/publishing/publishing.jd b/docs/html/guide/publishing/publishing.jd
index 27a87f9..b9513ab 100644
--- a/docs/html/guide/publishing/publishing.jd
+++ b/docs/html/guide/publishing/publishing.jd
@@ -1,4 +1,4 @@
-page.title=Publishing on Android Market
+page.title=Publishing on Google Play
@jd:body
<div id="qv-wrapper">
@@ -7,25 +7,25 @@
<h2>Quickview</h2>
<ul>
-<li>Learn how to publish and update apps on Android Market.</li>
-<li>Find out how to create links to apps that are published on Android Market.</li>
-<li>Learn about Android Market features.</li>
+<li>Learn how to publish and update apps on Google Play.</li>
+<li>Find out how to create links to apps that are published on Google Play.</li>
+<li>Learn about Google Play features.</li>
</ul>
<h2>In this document</h2>
<ol>
-<li><a href="#overview">About Android Market</a>
-<li><A href="#marketpublish">Publishing Apps on Android Market</a></li>
-<li><a href="#marketupgrade">Publishing Updates on Android Market</a></li>
-<li><a href="#marketLicensing">Using Android Market Licensing Service</a></li>
-<li><a href="#marketinappbilling">Using Android Market In-app Billing</a></li>
-<li><a href="#marketintent">Linking to Your Apps on Android Market</a>
+<li><a href="#overview">About Google Play</a>
+<li><A href="#marketpublish">Publishing Apps on Google Play</a></li>
+<li><a href="#marketupgrade">Publishing Updates on Google Play</a></li>
+<li><a href="#marketLicensing">Using Google Play Licensing Service</a></li>
+<li><a href="#marketinappbilling">Using Google Play In-app Billing</a></li>
+<li><a href="#marketintent">Linking to Your Apps on Google Play</a>
<ol>
<li><a href="#OpeningDetails">Opening an app's details page</a></li>
<li><a href="#PerformingSearch">Performing a search</a></li>
- <li><a href="#BuildaButton">Build an Android Market button</a></li>
+ <li><a href="#BuildaButton">Build a Google Play button</a></li>
<li><a href="#UriSummary">Summary of URI formats</a></li>
</ol>
</li>
@@ -41,9 +41,9 @@
<div id="qv-extra">
<img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
<div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0 5px;">
- <h2 style="color:#669999;">Already know about Android Market and want to get started?</h2>
- <p>Go to <a href="http://market.android.com/publish">Android Market</a>, create a developer
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0 5px;">
+ <h2 style="color:#669999;">Already know about Google Play and want to get started?</h2>
+ <p>Go to <a href="http://play.google.com/apps/publish">Google Play</a>, create a developer
account, and upload your application. For more information about required assets, listing details,
and publishing options, see <a
href="http://market.android.com/support/bin/answer.py?answer=113469">Upload
@@ -55,78 +55,78 @@
</div>
<p>One of the most effective ways to get your application into users' hands is to
-publish it on an application marketplace like Android Market. Publishing on Android Market is a
+publish it on an application marketplace like Google Play. Publishing on Google Play is a
straightforward process that you can do in just a few simple steps—register, configure,
upload, and publish. Registration takes only a few minutes and needs to be done only once.
-The configuration and publishing steps can all be done through the Android Market Developer Console
-after you register as an Android Market developer.</p>
+The configuration and publishing steps can all be done through the Google Play Android Developer Console
+after you register as a Google Play developer.</p>
-<p>To start publishing on Android Market, first read this topic and then go to the <a
-href="https://market.android.com/publish/signup">Android Market publisher site</a> and register as
-an Android Market developer.</p>
+<p>To start publishing on Google Play, first read this topic and then go to the <a
+href="https://play.google.com/apps/publish">Google Play Android Developer Console</a> and register as
+a Google Play developer.</p>
-<h2 id="overview">About Android Market</h2>
+<h2 id="overview">About Google Play</h2>
-<p>Android Market is a robust publishing platform that helps you publicize, sell, and distribute
+<p>Google Play is a robust publishing platform that helps you publicize, sell, and distribute
your Android applications to users around the world. When you release your applications through
-Android Market you have access to a suite of developer tools that let you analyze your sales,
+Google Play you have access to a suite of developer tools that let you analyze your sales,
identify market trends, and control who your applications are being distributed to. You also have
access to several revenue-enhancing features, such as <a
href="{@docRoot}guide/market/billing/index.html">in-app billing</a> and
<a href="{@docRoot}guide/market/licensing/index.html">application licensing</a>.</p>
-<p>Before you can publish applications on Android Market, you need to <a
-href="http://market.android.com/publish">register</a> as an Android Market developer. During the
+<p>Before you can publish applications on Google Play, you need to <a
+href="http://play.google.com/apps/publish">register</a> as a Google Play developer. During the
registration process you will need to create a developer profile, pay a registration fee, and agree
-to the <a href="http://www.android.com/us/developer-distribution-agreement.html">Android Market
-Developer Distribution Agreement</a>. After you register you can access the Android Market Developer
+to the <a href="http://www.android.com/us/developer-distribution-agreement.html">Google Play
+Developer Distribution Agreement</a>. After you register you can access the Developer
Console, where you can upload applications, configure publishing options, and monitor publishing
data. If you want to sell your applications or use the in-app billing feature, you will also need
to set up a Google Checkout merchant account. For more information about the registration process,
see <a href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113468">
Developer Registration</a>.</p>
-<h2 id="marketpublish">Publishing Apps on Android Market</h2>
+<h2 id="marketpublish">Publishing Apps on Google Play</h2>
-<p>Publishing your application on Android Market is a simple process that involves three basic
+<p>Publishing your application on Google Play is a simple process that involves three basic
tasks (see figure 1):</p>
<ul>
<li>Creating various graphical assets that
-accompany your app on Android Market.</li>
- <li>Using the Android Market <a
-href="http://market.android.com/publish">Developer Console</a> to configure publishing options,
-specify listing details, and upload your app and graphical assets to Android Market.</li>
+accompany your app on Google Play.</li>
+ <li>Using the Google Play <a
+href="http://play.google.com/apps/publish">Developer Console</a> to configure publishing options,
+specify listing details, and upload your app and graphical assets to Google Play.</li>
<li>Reviewing your publishing settings and changing the release
status of your app from Unpublished to Published.</li>
</ul>
<img src="{@docRoot}images/publishing/publishing_android_market.png"
- alt="Shows the three steps that are required to publish on Android Market"
+ alt="Shows the three steps that are required to publish on Google Play"
height="168"
id="figure1" />
<p class="img-caption">
- <strong>Figure 1.</strong> To publish apps on Android Market you must first <a
+ <strong>Figure 1.</strong> To publish apps on Google Play you must first <a
href="{@docRoot}guide/publishing/preparing.html">prepare your app for release</a> and then perform
three simple tasks.
</p>
<p class="caution"><strong>Important:</strong> You must <a
href="{@docRoot}guide/publishing/preparing.html">prepare your application for release</a> before you
-can publish it on Android Market. When you prepare your application for release you configure it for
+can publish it on Google Play. When you prepare your application for release you configure it for
release and build it in release mode. Building in release mode signs your application's {@code .apk}
-file with your private release key. You cannot publish an application on Android Market unless it is
+file with your private release key. You cannot publish an application on Google Play unless it is
signed with your own private release key.</p>
<h3>Preparing promotional materials</h3>
-<p>To fully leverage the marketing and publicity capabilities of Android Market, you need to create
-several graphical assets that accompany your app on Android Market, such as screenshots, videos,
+<p>To fully leverage the marketing and publicity capabilities of Google Play, you need to create
+several graphical assets that accompany your app on Google Play, such as screenshots, videos,
promotional graphics, and promotional text. At a minimum you must provide two screenshots of your
application and a high resolution application icon. The screenshots are displayed on the details
-page for your application in Android Market, and the high resolution application icon is displayed
-in various locations throughout Android Market. The high resolution icon does not replace the
+page for your application on Google Play, and the high resolution application icon is displayed
+in various locations throughout Google Play. The high resolution icon does not replace the
launcher icon for your application, rather, it serves as a supplemental icon and should look
the same as your launcher icon. Promotional video,
graphics, and text are optional, although we strongly recommended that you prepare these for your
@@ -136,8 +136,8 @@
<h3>Configuring options and uploading assets</h3>
-<p>Android Market lets you target your application to a worldwide pool of users and devices. To
-reach these users you can use the Android Market Developer Console to configure various publishing
+<p>Google Play lets you target your application to a worldwide pool of users and devices. To
+reach these users you can use the Developer Console to configure various publishing
options and listing details for your app. For example, you can choose the <a
href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=138294&topic=
2365624&ctx=topic">countries</a> you want to reach, the listing languages you want to use, and the
@@ -155,11 +155,11 @@
app.</p>
<p>When you are finished setting publishing options and listing details, you can upload your assets
-and your application to Android Market. You can also upload your application as a draft
+and your application to Google Play. You can also upload your application as a draft
(unpublished) application, which lets you do final testing before you publish it for final
release.</p>
-<p>To learn more about Android Market publishing settings, see the following resources:</p>
+<p>To learn more about Google Play publishing settings, see the following resources:</p>
<ul>
<li><a
@@ -181,20 +181,20 @@
<p>When you are satisfied that your publishing settings are correctly configured and your uploaded
application is ready to be released to the public, you can simply click <strong>Publish</strong> in
the Developer Console to make your app available for download
-around the world. Keep in mind, it can take several hours for your app to appear on Android
-Market after you click <strong>Publish</strong> in the Developer Console.</p>
+around the world. Keep in mind, it can take several hours for your app to appear on Google
+Play after you click <strong>Publish</strong> in the Developer Console.</p>
<h3>Controlling Distribution to Devices</h3>
<p>If your application targets different device configurations, you can control which Android-powered
-devices have access to your application on Android Market by
-using Android Market filters. Filtering compares device configurations that you declare in your
+devices have access to your application on Google Play by
+using Google Play filters. Filtering compares device configurations that you declare in your
app's manifest file to the configuration defined by a device. For example, if you declare the camera
-filter in your manifest, only those devices that have a camera will see your app on Android
-Market. Filters must be configured in your application's manifest file when you are <a
+filter in your manifest, only those devices that have a camera will see your app on Google
+Play. Filters must be configured in your application's manifest file when you are <a
href="{@docRoot}guide/publishing/preparing.html">preparing your app for release</a> (that is, before
-you upload your app to Android Market). For more information, see <a
-href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a>.</p>
+you upload your app to Google Play). For more information, see <a
+href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>.</p>
<p>You can also use the multiple APK feature to distribute different {@code .apk} files under the same
application listing and the same package name; however, you should use this option only as a last
@@ -205,17 +205,17 @@
resources make the APK file too big (greater than 50MB) or other technical challenges prevent a
single APK from working on all devices. Although we encourage you to develop and publish a single
APK that supports as many device configurations as possible, doing so is sometimes
-not possible. To help you publish your application for as many devices as possible, Android Market
-allows you to publish multiple APKs under the same application listing. Android Market then supplies
+not possible. To help you publish your application for as many devices as possible, Google Play
+allows you to publish multiple APKs under the same application listing. Google Play then supplies
each APK to the appropriate devices based on configuration support you've declared in the manifest
file of each APK. To use this feature, you need to build your separate {@code .apk} files when you are <a
href="{@docRoot}guide/publishing/preparing.html">preparing your app for release</a> (that is, before
-you upload your app to Android Market). For more information, see <a
+you upload your app to Google Play). For more information, see <a
href="{@docRoot}guide/market/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
-<h2 id="marketupgrade">Publishing Updates on Android Market</h2>
+<h2 id="marketupgrade">Publishing Updates on Google Play</h2>
-<p>At any time after publishing an application on Android Market, you can upload
+<p>At any time after publishing an application on Google Play, you can upload
and publish an update to the same application package. When you publish an
update to an application, users who have already installed the
application may receive a notification that an update is
@@ -228,49 +228,49 @@
href="{@docRoot}guide/topics/manifest/manifest-element.html"><code><manifest></code></a>
element of the manifest file. Also, the package name must be the same as the existing version and
the {@code .apk} file must be signed with the same private key. If the package name and signing
-certificate do <em>not</em> match those of the existing version, Market will
+certificate do <em>not</em> match those of the existing version, Google Play will
consider it a new application, publish it as such, and will not offer it to existing users as an
update.</p>
-<p>If you plan to publish your application on Android Market, you must make sure
- that it meets the requirements listed below, which are enforced by the Market
- server when you upload the application.</p>
+<p>If you plan to publish your application on Google Play, you must make sure
+ that it meets the requirements listed below, which are enforced by Google Play
+ when you upload the application.</p>
-<h2 id="marketLicensing">Using Android Market Licensing Service</h2>
+<h2 id="marketLicensing">Using Google Play Licensing Service</h2>
-<p>Android Market offers a licensing service that lets you enforce licensing
-policies for paid applications that you publish through Android Market. With
-Android Market Licensing, your applications can query Android Market at runtime
+<p>Google Play offers a licensing service that lets you enforce licensing
+policies for paid applications that you publish through Google Play. With
+Google Play Licensing, your applications can query Google Play at runtime
to obtain the licensing status for the current user, then allow or disallow
further use of the application as appropriate. Using the service, you can apply a flexible
licensing policy on an application-by-application basis—each
application can enforce its licensing status in the way most appropriate
for it. </p>
-<p>Any application that you publish through Android Market can use the Android
-Market Licensing Service. The service uses no dedicated framework APIs, so you can
+<p>Any application that you publish through Google Play can use the Google
+Play Licensing Service. The service uses no dedicated framework APIs, so you can
add licensing to any application that uses a minimum API Level of 3 or
higher.</p>
-<p>For complete information about Android Market Licensing Service and how to
+<p>For complete information about Google Play Licensing Service and how to
use it in your application, read <a
href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a>.</p>
-<h2 id="marketinappbilling">Using Android Market In-app Billing</h2>
+<h2 id="marketinappbilling">Using Google Play In-app Billing</h2>
-<p><a href="{@docRoot}guide/market/billing/billing_overview.html">Android Market In-app Billing</a>
-is an Android Market service that lets you sell digital content in your applications. You can use
+<p><a href="{@docRoot}guide/market/billing/billing_overview.html">Google Play In-app Billing</a>
+is a Google Play service that lets you sell digital content in your applications. You can use
the service to sell a wide range of content, including downloadable content such as media files or
photos, and virtual content such as game levels or potions.</p>
-<p>When you use Android Market's in-app billing service to sell an item, Android Market handles all
+<p>When you use Google Play's in-app billing service to sell an item, Google Play handles all
billing details so your application never has to directly process any financial transactions.
-Android Market uses the same checkout service that is used for application purchases, so your users
+Google Play uses the same checkout service that is used for application purchases, so your users
experience a consistent and familiar purchase flow (see figure 1). Also, the transaction fee for
in-app purchases is the same as the transaction fee for application purchases (30%).</p>
-<p>Any application that you publish through Android Market can implement in-app billing. No special
-account or registration is required other than an Android Market publisher account and a Google
+<p>Any application that you publish through Google Play can implement in-app billing. No special
+account or registration is required other than a Google Play publisher account and a Google
Checkout Merchant account. Also, because the service uses no dedicated framework APIs, you can add
in-app billing to any application that uses a minimum API level of 4 or higher.</p>
@@ -282,58 +282,59 @@
implement in-app billing. For more information about the in-app billing feature, see the
<a href="{@docRoot}guide/market/billing/index.html">In-app Billing documentation</a>.</p>
-<h2 id="marketintent">Linking to Your Apps on Android Market</h2>
+<h2 id="marketintent">Linking to Your Apps on Google Play</h2>
-<p>To help users discover your published applications, you can use two special Android Market URIs
+<p>To help users discover your published applications, you can use two special Google Play URIs
that direct users to your application's details page or perform a search for all of your published
-applications in Android Market. You can use these URIs to create a button in your application or a
+applications on Google Play. You can use these URIs to create a button in your application or a
link on a web page that:</p>
<ul>
- <li>Opens your application's details page in the Android Market application or web site.</li>
- <li>Searches for all your published applications in the Android Market application or web
+ <li>Opens your application's details page in the Google Play application or web site.</li>
+ <li>Searches for all your published applications in the Google Play application or web
site.</li>
</ul>
-<p>You can launch the Android Market application or web site in the following ways:</p>
+<p>You can launch the Google Play application or web site in the following ways:</p>
<ul>
<li>Initiate an {@link android.content.Intent} from your application that launches the
-Android Market application on the user's device.</li>
- <li>Provide a link on a web page that opens the Android Market web site (but will also
-open the Android Market application if clicked from a device).</li>
+Google Play application on the user's device.</li>
+ <li>Provide a link on a web page that opens the Google Play web site (but will also
+open the Google Play application if clicked from a device).</li>
</ul>
<p>In both cases, whether you want to initiate the action from your application or from a web
page, the URIs are quite similar. The only difference is the URI prefix.</p>
-<p>To open the Android Market application from your application, the prefix for the intent's data
+<p>To open the Google Play application from your application, the prefix for the intent's data
URI is:</p>
<p style="margin-left:2em"><code>market://</code></p>
-<p>To open Android Market from your web site, the prefix for the link URI is:</p>
+<p>To open Google Play store from your web site, the prefix for the link URI is:</p>
-<p style="margin-left:2em"><code>http://market.android.com/</code></p>
+<p style="margin-left:2em"><code>http://play.google.com/store/</code></p>
<p>The following sections describe how to create a complete URI for each action.</p>
-<p class="note"><strong>Note:</strong> If you create a link to open Android Market from your web
-site and the user selects it from an Android-powered device, the device's Market application will
-resolve the link so the user can use the Market application instead of opening the web
-site. As such, you should always use {@code http://market.android.com/} URIs when creating a link on
+<p class="note"><strong>Note:</strong> If you create a link to open Google Play from your web
+site and the user selects it from an Android-powered device, the device's Google Play application will
+resolve the link so the user can use the Google Play application on the device instead of opening the web
+site. As such, you should always use {@code http://play.google.com/store/apps/...} URIs when
+creating a link on
a web page. When pointing to your apps from within your Android app, use the
-{@code market://} URIs in an intent, so that the Market application always opens.</p>
+{@code market://} URIs in an intent, so that the Google Play application always opens.</p>
<h3 id="OpeningDetails">Opening an app's details page</h3>
<p>As described above, you can open the details page for a specific application either on the
-Android Market application or the Android Market web site. The details page allows the user to see
+Google Play application or the Google Play web site. The details page allows the user to see
the application description, screenshots, reviews and more, and choose to install it.</p>
<p>The format for the URI that opens the details page is:</p>
-<p style="margin-left:2em"><code><URI_prefix><b>details?id=</b><package_name></code></p>
+<p style="margin-left:2em"><code><URI_prefix><b>apps/details?id=</b><package_name></code></p>
<p>The <code><package_name></code> is a placeholder for the target application's
fully-qualified package name, as declared in the <a
@@ -341,26 +342,28 @@
package}</a> attribute of the <a href="{@docRoot}guide/topics/manifest/manifest-element.html">{@code
<manifest>}</a> element.</p>
+<p>For example: <code>http://play.google.com/store/apps/details?id=com.example.myapp</code></p>
+
<h4>Opening the app details page from your Android app</h4>
-<p>To open the Android Market details page from your application,
+<p>To open the Google Play details page from your application,
create an intent with the {@link android.content.Intent#ACTION_VIEW} action and include a data URI
in this format:</p>
<p style="margin-left:2em"><code>market://details?id=<package_name></code></p>
<p>For example, here's how you can create an intent and open an application's details page in
-Android Market:</p>
+Google Play:</p>
<pre>
Intent intent = new Intent(Intent.ACTION_VIEW);
-intent.setData(Uri.parse("market://details?id=com.android.example"));
+intent.setData(Uri.parse("market://details?id=com.example.android"));
startActivity(intent);
</pre>
-<p>This will open the Android Market application on the device to view the {@code
-com.android.example} application.</p>
+<p>This will open the Google Play application on the device to view the {@code
+com.example.android} application.</p>
<h4>Opening the app details page from a web site</h4>
@@ -369,32 +372,32 @@
format:</p>
<p style="margin-left:2em">
- <code>http://market.android.com/details?id=<package_name></code>
+ <code>http://play.google.com/store/apps/details?id=<package_name></code>
</p>
-<p>For example, here's a link that opens an application's details page on Android Market:</p>
+<p>For example, here's a link that opens an application's details page on Google Play:</p>
<pre>
-<a href="http://market.android.com/details?id=com.android.example">App Link</a>
+<a href="http://play.google.com/store/apps/details?id=com.example.android">App Link</a>
</pre>
-<p>When clicked from a desktop web browser, this opens the Android Market web site to view the
-{@code com.android.example} application. When clicked from an Android-powered device, users are
-given the option to use either their web browser or the Android Market application to view the
+<p>When clicked from a desktop web browser, this opens the Google Play web site to view the
+{@code com.example.android} application. When clicked from an Android-powered device, users are
+given the option to use either their web browser or the Google Play application to view the
application.</p>
<h3 id="PerformingSearch">Performing a search</h3>
-<p>To initiate a search in Android Market, the format for the URI is:</p>
+<p>To initiate a search on Google Play, the format for the URI is:</p>
<p style="margin-left:2em">
<code><URI_prefix><b>search?q=</b><query></code>
</p>
-<p>The <code><query></code> is a placeholder for the search query to execute in Android
-Market. The query can be a raw text string or you can include a parameter that performs a search
+<p>The <code><query></code> is a placeholder for the search query to execute in Google
+Play. The query can be a raw text string or you can include a parameter that performs a search
based on the publisher name:</p>
<ul>
@@ -410,14 +413,14 @@
<h4>Searching from your Android app</h4>
-<p>To initiate a search on Android Market from your application, create an intent with the
+<p>To initiate a search on Google Play from your application, create an intent with the
{@link android.content.Intent#ACTION_VIEW} action and include a data URI in this format:</p>
<p style="margin-left:2em"><code>market://search?q=<query></code></p>
<p>The query may include the {@code pub:} parameter described above.</p>
-<p>For example, here's how you can initiate a search in the Android Market application, based on the
+<p>For example, here's how you can initiate a search in the Google Play application, based on the
publisher name:</p>
<pre>
@@ -426,46 +429,46 @@
startActivity(intent);
</pre>
-<p>This opens the Android Market application to perform the search. The search result shows all
+<p>This opens the Google Play application to perform the search. The search result shows all
applications published by the publisher that are compatible with the current device.</p>
<h4>Searching from a web site</h4>
-<p>To initiate a search on Android Market from your web site, create a link with a URI in this
+<p>To initiate a search on Google Play from your web site, create a link with a URI in this
format:</p>
<p style="margin-left:2em">
- <code>http://market.android.com/search?q=<query></code>
+ <code>http://play.google.com/store/search?q=<query></code>
</p>
<p>The query may include the {@code pub:} parameter described above.</p>
-<p>For example, here's a link that initiates a search on Android Market, based on the
+<p>For example, here's a link that initiates a search on Google Play, based on the
publisher name:</p>
<pre>
-<a href="http://market.android.com/search?q=pub:Your Publisher Name">Search Link</a>
+<a href="http://play.google.com/store/search?q=pub:Your Publisher Name">Search Link</a>
</pre>
-<p>When clicked from a desktop web browser, this opens the Android Market web site and performs the
+<p>When clicked from a desktop web browser, this opens the Google Play web site and performs the
search. When clicked from an Android-powered device, users are given the option to use either their
-web browser or the Android Market application to perform the search.</p>
+web browser or the Google Play application to perform the search.</p>
-<h3 id="BuildaButton">Build an Android Market button</h3>
+<h3 id="BuildaButton">Build a Google Play button</h3>
-<p>Use the following form to generate an "Available in Android Market" button that you can use on
-your web site. Input either your application's package name or publisher name and the button will
-take users to Android Market to either view your application's information or view a list of
-your published apps. If users click the button while on an Android-powered device, the Android
-Market application will respond to show users your application(s).</p>
+<p>Use the following form to create a button for your web site that takes users to your application
+on Google Play. Input either your application's package name or your publisher name and the button
+will take users to Google Play to either view your application's information or view a list of your
+published apps. If users click the button while on an Android-powered device, the Google Play
+application will respond to show users your application(s).</p>
-<p>This form offers four versions of the official "Available in Android Market" button at
-recommended sizes. If you want to create a different size, you can download an EPS file for
-the button images from the <a href="http://www.android.com/branding.html">Android Brand
-Guidelines</a>.</p>
+<p>This form offers two styles of the official brand badge each at recommended sizes. You can pick
+between either "Get it on Google Play" or "Android app on Google Play." You should not modify the
+badge images in any way. For more usage guidelines,
+see the <a href="http://www.android.com/branding.html">Android Brand Guidelines</a>.</p>
<style type="text/css">
@@ -507,33 +510,44 @@
// variables for creating 'try it out' demo button
var imagePath = "http://www.android.com/images/brand/"
-var linkStart = "<a href=\"http://market.android.com/";
+var linkStart = "<a href=\"http://play.google.com/store/";
var imageStart = "\">\n"
- + " <img src=\"" + imagePath;
-var imageEnd = ".png\"\n"
- + " alt=\"Available in Android Market\" />\n</a>";
+ + " <img alt=\"";
+ // leaves opening for the alt text value
+var imageSrc = "\"\n src=\"" + imagePath;
+ // leaves opening for the image file name
+var imageEnd = ".png\" />\n</a>";
// variables for creating code snippet
-var linkStartCode = "<a href=\"http://market.android.com/";
+var linkStartCode = "<a href=\"http://play.google.com/store/";
var imageStartCode = "\">\n"
- + " <img src=\"" + imagePath;
-var imageEndCode = ".png\"\n"
- + " alt=\"Available in Android Market\" />\n</a>";
+ + " <img alt=\"";
+ // leaves opening for the alt text value
+var imageSrcCode = "\"\n src=\"" + imagePath;
+ // leaves opening for the image file name
+var imageEndCode = ".png\" />\n</a>";
/** Generate the HTML snippet and demo based on form values */
function buildButton(form) {
- if (form["package"].value != "com.android.example") {
+ var selectedValue = $('form input[type=radio]:checked').val();
+ var altText = selectedValue.indexOf("get_it") != -1 ? "Get it on Google Play" : "Android app on Google Play";
+
+ if (form["package"].value != "com.example.android") {
$("#preview").show();
- $("#snippet").show().html(linkStartCode + "details?id=" + form["package"].value
- + imageStartCode + $('form input[type=radio]:checked').val() + imageEndCode);
- $("#button-preview").html(linkStart + "details?id=" + form["package"].value
- + imageStart + $('form input[type=radio]:checked').val() + imageEnd);
+ $("#snippet").show().html(linkStartCode + "apps/details?id=" + form["package"].value
+ + imageStartCode + altText + imageSrcCode
+ + selectedValue + imageEndCode);
+ $("#button-preview").html(linkStart + "apps/details?id=" + form["package"].value
+ + imageStart + altText + imageSrc
+ + selectedValue + imageEnd);
} else if (form["publisher"].value != "Example, Inc.") {
$("#preview").show();
$("#snippet").show().html(linkStartCode + "search?q=pub:" + form["publisher"].value
- + imageStartCode + $('form input[type=radio]:checked').val() + imageEndCode);
- $("#button-preview").html(linkStart + "search?q=pub:" + form["publisher"].value + imageStart +
- $('form input[type=radio]:checked').val() + imageEnd);
+ + imageStartCode + altText + imageSrcCode
+ + selectedValue + imageEndCode);
+ $("#button-preview").html(linkStart + "search?q=pub:" + form["publisher"].value
+ + imageStart + altText + imageSrc
+ + selectedValue + imageEnd);
} else {
alert("Please enter your package name or publisher name");
}
@@ -597,13 +611,13 @@
<form class="button-form">
<label class="block" for="package">Package name:</label>
<input class="text" type="text" id="package" name="package"
- value="com.android.example"
- default="com.android.example"
- onfocus="onInputFocus(this, 'com.android.example')"
- onblur="onInputBlur(this, 'com.android.example')"
+ value="com.example.android"
+ default="com.example.android"
+ onfocus="onInputFocus(this, 'com.example.android')"
+ onblur="onInputBlur(this, 'com.example.android')"
onkeyup="return onTextEntered(event, this.parentNode, this)"/>
<a id="package-clear" style="display:none" href="#"
- onclick="return clearLabel('package','com.android.example');">clear</a>
+ onclick="return clearLabel('package','com.example.android');">clear</a>
<p style="clear:both;margin:0"> <em>or</em></p>
<label class="block" style="margin-top:5px" for="publisher">Publisher name:</label>
<input class="text" type="text" id="publisher" name="publisher"
@@ -617,23 +631,23 @@
<br/><br/>
<div class="button-row">
- <input type="radio" name="buttonStyle" value="45_avail_market_logo1" id="ns" checked="checked" />
- <label for="ns"><img src="http://www.android.com/images/brand/45_avail_market_logo1.png"
-alt="narrow and small logo" /></label>
+ <input type="radio" name="buttonStyle" value="get_it_on_play_logo_small" id="ns" checked="checked" />
+ <label for="ns"><img src="http://www.android.com/images/brand/get_it_on_play_logo_small.png"
+alt="Get it on Google Play (small)" /></label>
- <input type="radio" name="buttonStyle" value="60_avail_market_logo1" id="nm" />
- <label for="nm"><img src="http://www.android.com/images/brand/60_avail_market_logo1.png"
-alt="narrow and large logo" /></label>
+ <input type="radio" name="buttonStyle" value="get_it_on_play_logo_large" id="nm" />
+ <label for="nm"><img src="http://www.android.com/images/brand/get_it_on_play_logo_large.png"
+alt="Get it on Google Play (large)" /></label>
</div>
<div class="button-row">
- <input type="radio" name="buttonStyle" value="45_avail_market_logo2" id="ws" />
- <label for="ws"><img src="http://www.android.com/images/brand/45_avail_market_logo2.png"
-alt="wide and small logo" /></label>
+ <input type="radio" name="buttonStyle" value="android_app_on_play_logo_small" id="ws" />
+ <label for="ws"><img src="http://www.android.com/images/brand/android_app_on_play_logo_small.png"
+alt="Android app on Google Play (small)" /></label>
- <input type="radio" name="buttonStyle" value="60_avail_market_logo2" id="wm" />
- <label for="wm"><img src="http://www.android.com/images/brand/60_avail_market_logo2.png"
-alt="wide and large logo" /></label>
+ <input type="radio" name="buttonStyle" value="android_app_on_play_logo_large" id="wm" />
+ <label for="wm"><img src="http://www.android.com/images/brand/android_app_on_play_logo_large.png"
+alt="Android app on Google Play (large)" /></label>
</div>
<input type="button" onclick="return buildButton(this.parentNode)" value="Build my button"
@@ -643,7 +657,7 @@
<div id="preview" style="display:none">
<p>Copy and paste this HTML into your web site:</p>
- <textarea id="snippet" cols="80" rows="4" onclick="this.select()"
+ <textarea id="snippet" cols="100" rows="5" onclick="this.select()"
style="font-family:monospace;background-color:#efefef;padding:5px;display:none;margin-bottom:1em">
</textarea >
@@ -658,7 +672,7 @@
<h3 id="UriSummary">Summary of URI formats</h3>
-<p>The table below provides a summary of the URIs currently supported by the Android Market (both on
+<p>The table below provides a summary of the URIs currently supported by the Google Play (both on
the web and in the Android application), as discussed in the previous sections.</p>
<table>
@@ -670,19 +684,19 @@
<tr>
<td>Display the details screen for a specific application</td>
-<td><code>http://market.android.com/details?id=<package_name></code>
+<td><code>http://play.google.com/store/apps/details?id=<package_name></code>
<td><code>market://details?id=<package_name></code></td>
</tr>
<tr>
<td>Search for applications using a general string query.</td>
-<td><code>http://market.android.com/search?q=<query></code></td>
+<td><code>http://play.google.com/store/search?q=<query></code></td>
<td><code>market://search?q=<query></code></td>
</tr>
<tr>
<td>Search for applications by publisher name</td>
-<td><nobr><code>http://market.android.com/search?q=pub:<publisher_name></code></nobr></td>
+<td><nobr><code>http://play.google.com/store/search?q=pub:<publisher_name></code></nobr></td>
<td><nobr><code>market://search?q=pub:<publisher_name></code></nobr></td>
</tr>
diff --git a/docs/html/guide/publishing/publishing_overview.jd b/docs/html/guide/publishing/publishing_overview.jd
index c94d201..6fb77e1 100755
--- a/docs/html/guide/publishing/publishing_overview.jd
+++ b/docs/html/guide/publishing/publishing_overview.jd
@@ -14,7 +14,7 @@
<li><a href="#publishing-prepare">Preparing Your Application for Release</a></li>
<li><a href="#publishing-release">Releasing Your Application to Users</a>
<ol>
- <li><a href="#publishing-market">Releasing on Android Market</a></li>
+ <li><a href="#publishing-market">Releasing on Google Play</a></li>
<li><a href="#publishing-website">Releasing on your own website</a></li>
<li><a href="#publishing-email">Releasing through email</a></li>
</ol>
@@ -23,7 +23,7 @@
<ol>
<li><a href="{@docRoot}guide/publishing/preparing.html">Preparing for
Release</a></li>
- <li><a href="{@docRoot}guide/publishing/publishing.html">Publishing on Android Market</a></li>
+ <li><a href="{@docRoot}guide/publishing/publishing.html">Publishing on Google Play</a></li>
</ol>
</div>
</div>
@@ -42,7 +42,7 @@
</li>
</ul>
-<p>Usually, you release your application through an application marketplace, such as Android Market.
+<p>Usually, you release your application through an application marketplace, such as Google Play.
However, you can also release applications by sending them directly to users or by letting users
download them from your own website.</p>
@@ -73,7 +73,7 @@
<code>android:versionCode</code> and <code>android:versionName</code> attributes, which are
located in the
<a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a>
- element. You may also have to configure several other settings to meet Android Market
+ element. You may also have to configure several other settings to meet Google Play
requirements or accomodate whatever method you're using to release your application.</p>
</li>
<li>Building and signing a release version of your application.
@@ -114,28 +114,27 @@
<h2 id="publishing-release">Releasing Your Application to Users</h2>
<p>You can release your Android applications several ways. Usually, you release applications
-through an application marketplace, such as Android Market, but you can also release applications
-on your own website or by sending an application directly to a user. Android Market is the
+through an application marketplace, such as Google Play, but you can also release applications
+on your own website or by sending an application directly to a user. Google Play is the
recommended marketplace for Android applications and is particularly useful if you want to
distribute your applications to a large global audience. The other two release methods—server
distribution and email distribution—are useful if you are releasing an application to a small
group of users (for example, a work group in an enterprise environment), or if you do not want to
make your application available to the general public.</p>
-<h3 id="publishing-market">Releasing Your Applications on Android Market</h3>
+<h3 id="publishing-market">Releasing Your Applications on Google Play</h3>
-<p>Android Market is a robust publishing platform that helps you publicize, sell, and distribute
+<p>Google Play is a robust publishing platform that helps you publicize, sell, and distribute
your Android applications to users around the world. When you release your applications through
-Android Market you have access to a suite of developer tools that let you analyze your sales,
+Google Play you have access to a suite of developer tools that let you analyze your sales,
identify market trends, and control who your applications are being distributed to. You also have
access to several revenue-enhancing features that are not available anywhere else, such as <a
href="{@docRoot}guide/market/billing/index.html">in-app billing</a> and <a
-href="{@docRoot}guide/market/licensing/index.html">application licensing</a>. This rich array of
-tools
-and features, coupled with numerous end-user community features, makes Android Market the premier
+href="{@docRoot}guide/market/licensing.html">application licensing</a>. This rich array of tools
+and features, coupled with numerous end-user community features, makes Google Play the premier
marketplace for selling and buying Android applications.</p>
-<p>Releasing your application on Android Market is a simple process that involves three basic
+<p>Releasing your application on Google Play is a simple process that involves three basic
steps:</p>
<div class="figure" style="width:275px">
@@ -144,19 +143,19 @@
to be installed" />
<p class="img-caption">
<strong>Figure 2.</strong> The <strong>Unknown sources</strong> setting lets you install
- applications that are not published on Android Market .
+ applications that are not published on Google Play .
</p>
</div>
<ul>
<li>Preparing promotional materials.
- <p>To fully leverage the marketing and publicity capabilities of Android Market, you need to
+ <p>To fully leverage the marketing and publicity capabilities of Google Play, you need to
create promotional materials for your application, such as screenshots, videos, graphics, and
promotional text.</p>
</li>
<li>Configuring options and uploading assets.
- <p>Android Market lets you target your application to a worldwide pool of users and devices.
- By configuring various Android Market settings, you can choose the countries you want to
+ <p>Google Play lets you target your application to a worldwide pool of users and devices.
+ By configuring various Google Play settings, you can choose the countries you want to
reach, the listing languages you want to use, and the price you want to charge in each
country. You can also configure listing details such as the application type, category, and
content rating. When you are done configuring options you can upload your promotional materials
@@ -170,21 +169,21 @@
</li>
</ul>
-<p>For information about Android Market, see <a
-href="{@docRoot}guide/publishing/publishing.html#market">Publishing on Android Market</a>. This
-topic provides an introduction to Android Market features and provides a step-by-step guide for
-distributing your applications on Android Market.</p>
+<p>For information about Google Play, see <a
+href="{@docRoot}guide/publishing/publishing.html#market">Publishing on Google Play</a>. This
+topic provides an introduction to Google Play features and provides a step-by-step guide for
+distributing your applications on Google Play.</p>
<h3 id="publishing-website">Releasing your application on your own website</h3>
-<p>If you do not want to release your application on an application marketplace like Android Market,
+<p>If you do not want to release your application on an application marketplace like Google Play,
you can release your application by making it available for download on your own website or server.
To do this, you must first prepare your application for release (that is, you must build it for
release and sign it). Then all you need to do is host the release-ready application on your website
and provide a download link for the application. When users browse to your website with their
Android-powered devices and download your application, the Android system will automatically start
installing the application on the device. However, the installation process will start automatically
-only if the user has configured their device to allow the installation of non-Android Market
+only if the user has configured their device to allow the installation of non-Google Play
applications.</p>
<div class="figure" style="width:275px">
@@ -198,7 +197,7 @@
</div>
<p>By default, Android-powered devices allow users to install applications only if the applications
-have been downloaded from Android Market. To allow the installation of applications from other
+have been downloaded from Google Play. To allow the installation of applications from other
sources, users need to enable the <strong>Unknown sources</strong> setting on their devices, and
they need to make this configuration change before they download your application to their
device (see figure 2).</p>
@@ -209,7 +208,7 @@
<p>Although it is relatively easy to release your application on your own website, it can be
inefficient and cumbersome. For example, if you want to monetize your application you will
have to process and track all financial transactions yourself and you will not be able to use
-Android Market's in-app billing feature to sell in-app products. In addition, you will not be
+Google Play's in-app billing feature to sell in-app products. In addition, you will not be
able to use the licensing feature to help prevent unauthorized installation and use of your
application.</p>
@@ -223,7 +222,7 @@
button.</p>
<p class="note"><strong>Note:</strong> The <strong>Install Now</strong> button appears only if a
-user has configured their device to allow the installation of non-Android Market applications and
+user has configured their device to allow the installation of non-Google Play applications and
they open your email with the native Gmail application.</p>
<p>Releasing applications through email is convenient if you are sending your application to
diff --git a/docs/html/guide/publishing/versioning.jd b/docs/html/guide/publishing/versioning.jd
index 79ebf96..da57e3e 100644
--- a/docs/html/guide/publishing/versioning.jd
+++ b/docs/html/guide/publishing/versioning.jd
@@ -25,7 +25,7 @@
<ol>
<li><a href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish Your Application</a></li>
-<li><a href="{@docRoot}guide/publishing/publishing.html#market">Publishing On Android Market</a></li>
+<li><a href="{@docRoot}guide/publishing/publishing.html#market">Publishing On Google Play</a></li>
<li><a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a></li>
</ol>
diff --git a/docs/html/guide/topics/admin/device-admin.jd b/docs/html/guide/topics/admin/device-admin.jd
index 820c3c0..4a325db 100644
--- a/docs/html/guide/topics/admin/device-admin.jd
+++ b/docs/html/guide/topics/admin/device-admin.jd
@@ -75,8 +75,8 @@
not currently have an automated provisioning solution. Some of the ways a sysadmin might
distribute the application to users are as follows:
<ul>
-<li>Android Market.</li>
-<li>Enabling non-market installation.</li>
+<li>Google Play.</li>
+<li>Enabling installation from another store.</li>
<li>Distributing the application through other means, such as email or websites.</li>
</ul>
diff --git a/docs/html/guide/topics/data/backup.jd b/docs/html/guide/topics/data/backup.jd
index 79dfd88..d91e422 100644
--- a/docs/html/guide/topics/data/backup.jd
+++ b/docs/html/guide/topics/data/backup.jd
@@ -892,8 +892,8 @@
<li>Install your application on a suitable Android system image
<ul>
<li>If using the emulator, create and use an AVD with Android 2.2 (API Level 8).</li>
- <li>If using a device, the device must be running Android 2.2 or greater and have Android
-Market built in.</li>
+ <li>If using a device, the device must be running Android 2.2 or greater and have Google
+Play built in.</li>
</ul>
</li>
<li>Ensure that backup is enabled
diff --git a/docs/html/guide/topics/fundamentals.jd b/docs/html/guide/topics/fundamentals.jd
index d1a3786..a86d905 100644
--- a/docs/html/guide/topics/fundamentals.jd
+++ b/docs/html/guide/topics/fundamentals.jd
@@ -392,13 +392,13 @@
that lack features needed by your application, it's important that you clearly define a profile for
the types of devices your application supports by declaring device and software requirements in your
manifest file. Most of these declarations are informational only and the system does not read
-them, but external services such as Android Market do read them in order to provide filtering
+them, but external services such as Google Play do read them in order to provide filtering
for users when they search for applications from their device.</p>
<p>For example, if your application requires a camera and uses APIs introduced in Android 2.1 (<a
href="{@docRoot}guide/appendix/api-levels.html">API Level</a> 7), you should declare these as
requirements in your manifest file. That way, devices that do <em>not</em> have a camera and have an
-Android version <em>lower</em> than 2.1 cannot install your application from Android Market.</p>
+Android version <em>lower</em> than 2.1 cannot install your application from Google Play.</p>
<p>However, you can also declare that your application uses the camera, but does not
<em>require</em> it. In that case, your application must perform a check at runtime to determine
@@ -458,12 +458,12 @@
</dl>
<p>It's important that you declare all such requirements for your application, because, when you
-distribute your application on Android Market, Market uses these declarations to filter which
+distribute your application on Google Play, the store uses these declarations to filter which
applications are available on each device. As such, your application should be available only to
devices that meet all your application requirements.</p>
-<p>For more information about how Android Market filters applications based on these (and other)
-requirements, see the <a href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a>
+<p>For more information about how Google Play filters applications based on these (and other)
+requirements, see the <a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>
document.</p>
diff --git a/docs/html/guide/topics/graphics/opengl.jd b/docs/html/guide/topics/graphics/opengl.jd
index 6a2a20f..a786d42 100644
--- a/docs/html/guide/topics/graphics/opengl.jd
+++ b/docs/html/guide/topics/graphics/opengl.jd
@@ -189,7 +189,7 @@
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
</pre>
- <p>Adding this declaration causes the Android Market to restrict your application from being
+ <p>Adding this declaration causes Google Play to restrict your application from being
installed on devices that do not support OpenGL ES 2.0.</p>
</li>
<li><strong>Texture compression requirements</strong> - If your application uses texture
@@ -200,9 +200,9 @@
<p>Declaring texture compression requirements in your manifest hides your application from users
with devices that do not support at least one of your declared compression types. For more
-information on how Android Market filtering works for texture compressions, see the <a
+information on how Google Play filtering works for texture compressions, see the <a
href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html#market-texture-filtering">
-Android Market and texture compression filtering</a> section of the {@code
+Google Play and texture compression filtering</a> section of the {@code
<supports-gl-texture>} documentation.</p>
</li>
</ul>
@@ -470,7 +470,7 @@
<p class="note"><strong>Note:</strong> Once you decide which texture compression formats your
application will support, make sure you declare them in your manifest using <a
href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html"><supports-gl-texture>
-</a>. Using this declaration enables filtering by external services such as Android Market, so that
+</a>. Using this declaration enables filtering by external services such as Google Play, so that
your app is installed only on devices that support the formats your app requires. For details, see
<a
href="{@docRoot}guide/topics/graphics/opengl.html#manifest">OpenGL manifest declarations</a>.</p>
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index 8b131c8..9dc124b 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -672,7 +672,7 @@
<p class="note"><strong>Note:</strong> When you declare one of the landscape or portrait values,
it is considered a hard requirement for the orientation in which the activity runs. As such,
-the value you declare enables filtering by services such as Android Market so your application is
+the value you declare enables filtering by services such as Google Play so your application is
available only to devices that support the orientation required by your activities. For
example, if you declare either {@code "landscape"}, {@code "reverseLandscape"}, or
{@code "sensorLandscape"}, then your application will be available only to devices that support
@@ -681,7 +681,7 @@
href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
element. For example, <code><uses-feature
android:name="android.hardware.screen.portrait"/></code>. This is purely a filtering behavior
-provided by Android Market (and other services that support it) and the platform itself does not
+provided by Google Play (and other services that support it) and the platform itself does not
control whether your app can be installed when a device supports only certain orientations.</p>
</dd>
diff --git a/docs/html/guide/topics/manifest/compatible-screens-element.jd b/docs/html/guide/topics/manifest/compatible-screens-element.jd
index 5c89869..a27c316 100644
--- a/docs/html/guide/topics/manifest/compatible-screens-element.jd
+++ b/docs/html/guide/topics/manifest/compatible-screens-element.jd
@@ -27,10 +27,10 @@
<p>The Android system <em>does not</em> read the {@code <compatible-screens>} manifest
element (neither at install-time nor at runtime). This element is informational only and may be used
-by external services (such as Android Market) to better understand the application's compatibility
+by external services (such as Google Play) to better understand the application's compatibility
with specific screen configurations and enable filtering for users. Any screen configuration that is
<em>not</em> declared in this element is a screen with which the application is <em>not</em>
-compatible. Thus, external services (such as Android Market) should not provide the application to
+compatible. Thus, external services (such as Google Play) should not provide the application to
devices with such screens.</p>
<p class="caution"><strong>Caution:</strong> Normally, <strong>you should not use this manifest
@@ -48,14 +48,14 @@
only for <em>large</em> and <em>xlarge</em> screen devices, the <a
href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
<supports-screens>}</a> element allows you to declare that your application does not
-support <em>small</em> and <em>normal</em> screen sizes. External services (such as Android
-Market) will filter your application accordingly. You can also use the <a
+support <em>small</em> and <em>normal</em> screen sizes. External services (such as Google
+Play) will filter your application accordingly. You can also use the <a
href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
<supports-screens>}</a> element to declare whether the system should resize your
application for different screen sizes.</p>
- <p>Also see the <a href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a>
-document for more information about how Android Market filters applications using this and
+ <p>Also see the <a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>
+document for more information about how Google Play filters applications using this and
other manifest elements.</p>
</dd>
@@ -138,5 +138,5 @@
<dt>see also:</dt>
<dd><a
href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></dd>
-<dd><a href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a></dd>
+<dd><a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a></dd>
</dl>
diff --git a/docs/html/guide/topics/manifest/manifest-element.jd b/docs/html/guide/topics/manifest/manifest-element.jd
index c970c72..9788945 100644
--- a/docs/html/guide/topics/manifest/manifest-element.jd
+++ b/docs/html/guide/topics/manifest/manifest-element.jd
@@ -150,9 +150,9 @@
</tr>
</table>
-<p class="caution"><strong>Caution:</strong> If your application uses the Android Market's Copy
- Protection feature, it cannot be installed to a device's SD card. However, if you use Android
- Market's <a href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> instead,
+<p class="caution"><strong>Caution:</strong> If your application uses Google Play's Copy
+ Protection feature, it cannot be installed to a device's SD card. However, if you use Google
+ Play's <a href="{@docRoot}guide/market/licensing.html">Application Licensing</a> instead,
your application <em>can</em> be installed to internal or external storage, including SD cards.</p>
<p class="note"><strong>Note:</strong> By default, your application will be installed on the
diff --git a/docs/html/guide/topics/manifest/supports-gl-texture-element.jd b/docs/html/guide/topics/manifest/supports-gl-texture-element.jd
index 6c4a05a..ebdd0b1 100644
--- a/docs/html/guide/topics/manifest/supports-gl-texture-element.jd
+++ b/docs/html/guide/topics/manifest/supports-gl-texture-element.jd
@@ -18,20 +18,20 @@
<div class="sidebox-wrapper">
<img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
<div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_market.jpg"
+ <img src="{@docRoot}assets/images/icon_play.png"
style="float:left;margin:0;padding:0;">
- <p style="color:#669999;">Android Market and <code
+ <p style="color:#669999;padding-top:1em;">Google Play and <code
style="color:#669999;"><supports-gl-texture></code> elements</p>
- <p style="margin-top:1em;">Android Market filters applications according
+ <p style="margin-top:1em;">Google Play filters applications according
to the texture compression formats that they support, to ensure that
they can be installed only on devices that can handle their textures
properly. Developers can use texture compression filtering
as a way of targeting specific device types, based on GPU platform.</p>
<p style="margin-top:1em;" class="caution">For important information about how
- Android Market uses <code><supports-gl-texture></code> elements as
- the basis for filtering, please read <a href="#market-texture-filtering">Android
- Market and texture compression filtering</a>, below.</p>
+ Google Play uses <code><supports-gl-texture></code> elements as
+ the basis for filtering, please read <a href="#market-texture-filtering">Google
+ Play and texture compression filtering</a>, below.</p>
</div>
</div>
@@ -57,7 +57,7 @@
<p>Declared <code><supports-gl-texture></code> elements are informational,
meaning that the Android system itself does not examine the elements at install
time to ensure matching support on the device. However, other services
-(such as Android Market) or applications can check your application's
+(such as Google Play) or applications can check your application's
<code><supports-gl-texture></code> declarations as part of handling or
interacting with your application. For this reason, it's very important that
you declare all of the texture compression formats (from the list below) that
@@ -141,20 +141,20 @@
<dt>see also:</dt>
<dd>
<ul>
- <li><a href="{@docRoot}guide/appendix/market-filters.html">Android Market Filters</a></li>
+ <li><a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a></li>
</ul>
</dd>
-<h2 id="market-texture-filtering">Android Market and texture compression filtering</h2>
+<h2 id="market-texture-filtering">Google Play and texture compression filtering</h2>
-<p>Android Market filters the applications that are visible to users, so that
+<p>Google Play filters the applications that are visible to users, so that
users can see and download only those applications that are compatible with
-their devices. One of the ways Market filters applications is by texture
+their devices. One of the ways it filters applications is by texture
compression compatibility, giving you control over the availability of your
application to various devices, based on the capabilities of their GPUs.</p>
<p>To determine an application's texture compression compatibility with a given
-user's device, Android Market compares:</p>
+user's device, Google Play compares:</p>
<ul>
<li>Texture compression formats that are supported by the application —
@@ -164,26 +164,26 @@
a device reports the formats it supports as read-only system properties.</li>
</ul>
-<p>Each time you upload an application to the Android Market Publisher Site,
-Android Market scans the application's manifest file and looks for any
+<p>Each time you upload an application to the Google Play publisher site,
+Google Play scans the application's manifest file and looks for any
<code><supports-gl-texture></code> elements. It extracts the
format descriptors from the elements and stores them internally as
metadata associated with the application <code>.apk</code> and the application
version. </p>
-<p>When a user searches or browses for applications on Android Market,
+<p>When a user searches or browses for applications on Google Play,
the service compares the texture compression formats supported by the application
with those supported by the user's device. The comparison is based on the format
descriptor strings and a match must be exact.</p>
<p>If <em>any</em> of an application's supported texture compression formats is
-also supported by the device, Android Market allows the user to see the
+also supported by the device, Google Play allows the user to see the
application and potentially download it. Otherwise, if none of the application's
-formats is supported by the device, Android Market filters the application so
+formats is supported by the device, Google Play filters the application so
that it is not available for download. </p>
<p>If an application does not declare any <code><supports-gl-texture></code> elements,
-Android Market does not apply any filtering based on GL texture compression format.</p>
+Google Play does not apply any filtering based on GL texture compression format.</p>
</dl>
diff --git a/docs/html/guide/topics/manifest/supports-screens-element.jd b/docs/html/guide/topics/manifest/supports-screens-element.jd
index 81d6e27..ae14121 100644
--- a/docs/html/guide/topics/manifest/supports-screens-element.jd
+++ b/docs/html/guide/topics/manifest/supports-screens-element.jd
@@ -80,7 +80,7 @@
A small screen is defined as one with a smaller aspect ratio than
the "normal" (traditional HVGA) screen. An application that does
not support small screens <em>will not be available</em> for
- small screen devices from external services (such as Android Market), because there is little
+ small screen devices from external services (such as Google Play), because there is little
the platform can do to make such an application work on a smaller screen. This is {@code "true"} by
default.
</dd>
@@ -156,8 +156,8 @@
<p class="caution"><strong>Caution:</strong> The Android system does not pay attention to this
attribute, so it does not affect how your application behaves at runtime. Instead, it is used
-to enable filtering for your application on services such as Android Market. However,
-<strong>Android Market currently does not support this attribute for filtering</strong> (on Android
+to enable filtering for your application on services such as Google Play. However,
+<strong>Google Play currently does not support this attribute for filtering</strong> (on Android
3.2), so you should continue using the other size attributes if your application does not support
small screens.</p>
diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd
index 9f80638..9175566 100644
--- a/docs/html/guide/topics/manifest/uses-feature-element.jd
+++ b/docs/html/guide/topics/manifest/uses-feature-element.jd
@@ -9,7 +9,7 @@
<h2>In this document</h2>
<ol>
- <li><a href="#market-feature-filtering">Android Market and Feature-Based Filtering</a>
+ <li><a href="#market-feature-filtering">Google Play and Feature-Based Filtering</a>
<ol>
<li><a href="#declared">Filtering based on explicitly declared features</a></li>
<li><a href="#implicit">Filtering based on implicit features</a></li>
@@ -45,26 +45,26 @@
<div class="sidebox-wrapper">
<img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
<div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0;">
- <p style="color:#669999;">Android Market and <code style="color:#669999;"><uses-feature></code> elements</p>
- <p style="margin-top:1em;">Android Market filters the applications that are visible to users, so
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
+ <p style="color:#669999;padding-top:1em;">Google Play and <code style="color:#669999;"><uses-feature></code> elements</p>
+ <p style="margin-top:1em;">Google Play filters the applications that are visible to users, so
that users can see and download only those applications that are compatible with their
-devices. One of the ways Market filters applications is by feature compatibility.</p>
+devices. One of the ways it filters applications is by feature compatibility.</p>
-<p style="margin-top:1em;">To do this, Market checks the
+<p style="margin-top:1em;">To do this, Google Play checks the
<code><uses-feature></code> elements in each application's manifest, to
-establish the app's feature needs. Market then shows or hides the application to
+establish the app's feature needs. Google Play then shows or hides the application to
each user, based on a comparison with the features available on the user's
device. </p>
<p style="margin-top:1em;">By specifying the features that your application requires,
-you enable Android Market to present your application only to users whose
+you enable Google Play to present your application only to users whose
devices meet the application's feature requirements, rather than presenting it
to all users. </p>
<p style="margin-top:1em;" class="caution">For important information about how
-Android Market uses features as the basis for filtering, please read <a
-href="#market-feature-filtering">Android Market and Feature-Based Filtering</a>,
+Google Play uses features as the basis for filtering, please read <a
+href="#market-feature-filtering">Google Play and Feature-Based Filtering</a>,
below.</p>
</div>
</div>
@@ -106,7 +106,7 @@
<p>Declared <code><uses-feature></code> elements are informational only, meaning
that the Android system itself does not check for matching feature support on
the device before installing an application. However, other services
-(such as Android Market) or applications may check your application's
+(such as Google Play) or applications may check your application's
<code><uses-feature></code> declarations as part of handling or interacting
with your application. For this reason, it's very important that you declare all of
the features (from the list below) that your application uses. </p>
@@ -207,22 +207,22 @@
<li>{@link android.content.pm.FeatureInfo}</li>
<li>{@link android.content.pm.ConfigurationInfo}</li>
<li><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><code><uses-permission></code></a></li>
- <li><a href="{@docRoot}guide/appendix/market-filters.html">Android Market Filters</a></li>
+ <li><a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a></li>
</ul>
</dd>
</dl>
-<h2 id="market-feature-filtering">Android Market and Feature-Based Filtering</h2>
+<h2 id="market-feature-filtering">Google Play and Feature-Based Filtering</h2>
-<p>Android Market filters the applications that are visible to users, so that
+<p>Google Play filters the applications that are visible to users, so that
users can see and download only those applications that are compatible with
-their devices. One of the ways Market filters applications is by feature
+their devices. One of the ways it filters applications is by feature
compatibility.</p>
<p>To determine an application's feature compatibility with a given user's
-device, the Android Market service compares:</p>
+device, Google Play compares:</p>
<ul>
<li>Features required by the application — an application declares features in
@@ -238,14 +238,14 @@
the bottom of this document, and in the class documentation for {@link
android.content.pm.PackageManager}.</p>
-<p>When the user launches the Market application, the application queries the
+<p>When the user launches Google Play, the application queries the
Package Manager for the list of features available on the device by calling
{@link android.content.pm.PackageManager#getSystemAvailableFeatures()}. The
-Market application then passes the features list up to the Android Market
-service when establishing the session for the user.</p>
+Store application then passes the features list up to Google Play
+when establishing the session for the user.</p>
-<p>Each time you upload an application to the Android Market Publisher Site,
-Android Market scans the application's manifest file. It looks for
+<p>Each time you upload an application to the Google Play publisher site,
+Google Play scans the application's manifest file. It looks for
<code><uses-feature></code> elements and evaluates them in combination
with other elements, in some cases, such as <code><uses-sdk></code> and
<code><uses-permission></code> elements. After establishing the
@@ -253,17 +253,17 @@
metadata associated with the application <code>.apk</code> and the application
version. </p>
-<p>When a user searches or browses for applications using the Android Market
+<p>When a user searches or browses for applications using the Google Play
application, the service compares the features needed by each application with
the features available on the user's device. If all of an application's required
-features are present on the device, Android Market allows the user to see the
+features are present on the device, Google Play allows the user to see the
application and potentially download it. If any required feature is not
-supported by the device, Android Market filters the application so that it is
+supported by the device, Google Play filters the application so that it is
not visible to the user and not available for download. </p>
<p>Because the features you declare in <code><uses-feature></code>
-elements directly affect how Android Market filters your application, it's
-important to understand how Android Market evaluates the application's manifest
+elements directly affect how Google Play filters your application, it's
+important to understand how Google Play evaluates the application's manifest
and establishes the set of required features. The sections below provide more
information. </p>
@@ -277,35 +277,35 @@
it (<code>"true"</code>), or whether the application prefers to use the feature
if available, but is designed to run without it (<code>"false"</code>).</p>
-<p>Android Market handles explicitly declared features in this way: </p>
+<p>Google Play handles explicitly declared features in this way: </p>
<ul>
-<li>If a feature is explicitly declared as being required, Android Market adds
+<li>If a feature is explicitly declared as being required, Google Play adds
the feature to the list of required features for the application. It then
filters the application from users on devices that do not provide that feature.
For example:
<pre><uses-feature android:name="android.hardware.camera" android:required="true" /></pre></li>
-<li>If a feature is explicitly declared as <em>not</em> being required, Android
-Market <em>does not</em> add the feature to the list of required features. For
+<li>If a feature is explicitly declared as <em>not</em> being required, Google
+Play <em>does not</em> add the feature to the list of required features. For
that reason, an explicitly declared non-required feature is never considered when
filtering the application. Even if the device does not provide the declared
-feature, Android Market will still consider the application compatible with the
+feature, Google Play will still consider the application compatible with the
device and will show it to the user, unless other filtering rules apply. For
example:
<pre><uses-feature android:name="android.hardware.camera" android:required="false" /></pre></li>
<li>If a feature is explicitly declared, but without an
-<code>android:required</code> attribute, Android Market assumes that the feature
+<code>android:required</code> attribute, Google Play assumes that the feature
is required and sets up filtering on it. </li>
</ul>
<p>In general, if your application is designed to run on Android 1.6 and earlier
versions, the <code>android:required</code> attribute is not available in the
-API and Android Market assumes that any and all
+API and Google Play assumes that any and all
<code><uses-feature></code> declarations are required. </p>
<p class="note"><strong>Note:</strong> By declaring a feature explicitly and
including an <code>android:required="false"</code> attribute, you can
-effectively disable all filtering on Android Market for the specified feature.
+effectively disable all filtering on Google Play for the specified feature.
</p>
@@ -317,7 +317,7 @@
speaking, every application should <em>always</em> declare all features that it
uses or requires, so the absence of a declaration for a feature used by an
application should be considered an error. However, as a safeguard for users and
-developers, Android Market looks for implicit features in each application and
+developers, Google Play looks for implicit features in each application and
sets up filters for those features, just as it would do for an explicitly
declared feature. </p>
@@ -337,25 +337,25 @@
</li>
</ul>
-<p>To account for the cases above, Android Market attempts to discover an
+<p>To account for the cases above, Google Play attempts to discover an
application's implied feature requirements by examining <em>other elements</em>
declared in the manifest file, specifically,
<code><uses-permission></code> elements.</p>
-<p>If an application requests hardware-related permissions, Android Market
+<p>If an application requests hardware-related permissions, Google Play
<em>assumes that the application uses the underlying hardware features and
therefore requires those features</em>, even though there might be no
corresponding to <code><uses-feature></code> declarations. For such
-permissions, Android Market adds the underlying hardware features to the
+permissions, Google Play adds the underlying hardware features to the
metadata that it stores for the application and sets up filters for them.</p>
<p>For example, if an application requests the <code>CAMERA</code> permission
but does not declare a <code><uses-feature></code> element for
-<code>android.hardware.camera</code>, Android Market considers that the
+<code>android.hardware.camera</code>, Google Play considers that the
application requires a camera and should not be shown to users whose devices do
not offer a camera.</p>
-<p>If you don't want Android Market to filter based on a specific implied
+<p>If you don't want Google Play to filter based on a specific implied
feature, you can disable that behavior. To do so, declare the feature explicitly
in a <code><uses-feature></code> element and include an
<code>android:required="false"</code> attribute. For example, to disable
@@ -366,30 +366,30 @@
<p class="caution">It's important to understand that the permissions that you
request in <code><uses-permission></code> elements can directly affect how
-Android Market filters your application. The reference section <a
+Google Play filters your application. The reference section <a
href="#permissions">Permissions that Imply Feature Requirements</a>,
below, lists the full set of permissions that imply feature requirements and
therefore trigger filtering.</p>
<h3 id="bt-permission-handling">Special handling for Bluetooth feature</h3>
-<p>Android Market applies slightly different rules than described above, when
+<p>Google Play applies slightly different rules than described above, when
determining filtering for Bluetooth.</p>
<p>If an application declares a Bluetooth permission in a
<code><uses-permission></code> element, but does not explicitly declare
-the Bluetooth feature in a <code><uses-feature></code> element, Android
-Market checks the version(s) of the Android platform on which the application is
+the Bluetooth feature in a <code><uses-feature></code> element, Google
+Play checks the version(s) of the Android platform on which the application is
designed to run, as specified in the <code><uses-sdk></code> element. </p>
-<p>As shown in the table below, Android Market enables filtering for the
+<p>As shown in the table below, Google Play enables filtering for the
Bluetooth feature only if the application declares its lowest or targeted
-platform as Android 2.0 (API level 5) or higher. However, note that Android
-market applies the normal rules for filtering when the application explicitly
+platform as Android 2.0 (API level 5) or higher. However, note that Google
+Play applies the normal rules for filtering when the application explicitly
declares the Bluetooth feature in a <code><uses-feature></code> element.
</p>
-<p class="caption"><strong>Table 1.</strong> How Android Market determines the
+<p class="caption"><strong>Table 1.</strong> How Google Play determines the
Bluetooth feature requirement for an application that requests a Bluetooth
permission but does not declare the Bluetooth feature in a
<code><uses-feature></code> element.</p>
@@ -403,14 +403,14 @@
<tr>
<td><nobr><=4 (or uses-sdk is not declared)</nobr></td>
<td><=4</td>
-<td>Android Market <em>will not</em> filter the application from any devices
+<td>Google Play <em>will not</em> filter the application from any devices
based on their reported support for the <code>android.hardware.bluetooth</code>
feature.</td>
</tr>
<tr>
<td><=4</td>
<td>>=5</td>
-<td rowspan="2">Android Market filters the application from any devices that
+<td rowspan="2">Google Play filters the application from any devices that
do not support the <code>android.hardware.bluetooth</code> feature (including
older releases).</td>
</tr>
@@ -421,13 +421,13 @@
</table>
<p>The examples below illustrate the different filtering effects, based on how
-Android Market handles the Bluetooth feature. </p>
+Google Play handles the Bluetooth feature. </p>
<dl>
<dt>In first example, an application that is designed to run on older API levels
declares a Bluetooth permission, but does not declare the Bluetooth feature in a
<code><uses-feature></code> element.</dt>
-<dd><em>Result:</em> Android Market does not filter the application from any device.</dd>
+<dd><em>Result:</em> Google Play does not filter the application from any device.</dd>
</dl>
<pre><manifest ...>
@@ -439,7 +439,7 @@
<dl>
<dt>In the second example, below, the same application also declares a target
API level of "5". </dt>
-<dd><em>Result:</em> Android Market now assumes that the feature is required and
+<dd><em>Result:</em> Google Play now assumes that the feature is required and
will filter the application from all devices that do not report Bluetooth support,
including devices running older versions of the platform. </dd>
</dl>
@@ -465,7 +465,7 @@
<dl>
<dt>Finally, in the case below, the same application adds an
<code>android:required="false"</code> attribute.</dt>
-<dd><em>Result:</em> Android Market disables filtering based on Bluetooth
+<dd><em>Result:</em> Google Play disables filtering based on Bluetooth
feature support, for all devices.</dd>
</dl>
@@ -481,10 +481,10 @@
<h3 id="testing">Testing the features required by your application</h3>
<p>You can use the <code>aapt</code> tool, included in the Android SDK, to
-determine how Android Market will filter your application, based on its declared
+determine how Google Play will filter your application, based on its declared
features and permissions. To do so, run <code>aapt</code> with the <code>dump
badging</code> command. This causes <code>aapt</code> to parse your
-application's manifest and apply the same rules as used by Android Market to
+application's manifest and apply the same rules as used by Google Play to
determine the features that your application requires. </p>
<p>To use the tool, follow these steps: </p>
@@ -529,7 +529,7 @@
<h2 id=features-reference>Features Reference</h2>
<p>The tables below provide reference information about hardware and software
-features and the permissions that can imply them on Android Market. </p>
+features and the permissions that can imply them on Google Play. </p>
<h3 id="hw-features">Hardware features</h3>
@@ -873,12 +873,12 @@
the ability to declare that they require the API via the
<code><uses-feature></code> system. </p>
-<p>To prevent those apps from being made available unintentionally, Android
-Market assumes that certain hardware-related permissions indicate that the
+<p>To prevent those apps from being made available unintentionally, Google
+Play assumes that certain hardware-related permissions indicate that the
underlying hardware features are required by default. For instance, applications
that use Bluetooth must request the <code>BLUETOOTH</code> permission in a
-<code><uses-permission></code> element — for legacy apps, Android
-Market assumes that the permission declaration means that the underlying
+<code><uses-permission></code> element — for legacy apps, Google
+Play assumes that the permission declaration means that the underlying
<code>android.hardware.bluetooth</code> feature is required by the application
and sets up filtering based on that feature. </p>
diff --git a/docs/html/guide/topics/manifest/uses-library-element.jd b/docs/html/guide/topics/manifest/uses-library-element.jd
index d94ad9f..2f8eb50 100644
--- a/docs/html/guide/topics/manifest/uses-library-element.jd
+++ b/docs/html/guide/topics/manifest/uses-library-element.jd
@@ -33,7 +33,7 @@
</p>
<p>
This element also affects the installation of the application on a particular device and
- the availability of the application in Android Market:
+ the availability of the application on Google Play:
</p>
<dl>
<dt><em>Installation</em></dt>
@@ -42,11 +42,11 @@
{@code true}, the {@link android.content.pm.PackageManager} framework won't let the user
install the application unless the library is present on the user's device.
</dd>
- <dt><em>Market</em></dt>
+ <dt><em>Google Play</em></dt>
<dd>
- Android Market filters applications based on the libraries installed on the
+ Google Play filters applications based on the libraries installed on the
user's device. For more information about filtering, see the topic
- <a href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a>.
+ <a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>.
</dd>
</dl>
<p>
diff --git a/docs/html/guide/topics/manifest/uses-permission-element.jd b/docs/html/guide/topics/manifest/uses-permission-element.jd
index 967fc5a..6c71fb4 100644
--- a/docs/html/guide/topics/manifest/uses-permission-element.jd
+++ b/docs/html/guide/topics/manifest/uses-permission-element.jd
@@ -8,21 +8,21 @@
<div class="sidebox-wrapper">
<img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
<div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0;">
- <p style="color:#669999;"><code style="color:#669999;"><uses-permission></code> and filtering on Android Market. </p>
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
+ <p style="color:#669999;padding-top:1em;"><code style="color:#669999;"><uses-permission></code> and filtering on Google Play. </p>
<p style="margin-top:1em;">In some cases, the permissions that you request
through <code><uses-permission></code> can affect how
-your application is filtered by Android Market.</p>
+your application is filtered by Google Play.</p>
<p style="margin-top:1em;">If you request a hardware-related permission —
-<code>CAMERA</code>, for example — Android Market assumes that your
+<code>CAMERA</code>, for example — Google Play assumes that your
application requires the underlying hardware feature and filters the application
from devices that do not offer it.</p>
<p style="margin-top:1em;">To control filtering, always explicitly declare
hardware features in <code><uses-feature></code> elements, rather than
-relying on Android Market to "discover" the requirements in
+relying on Google Play to "discover" the requirements in
<code><uses-permission></code> elements. Then, if you want to disable
filtering for a particular feature, you can add a
<code>android:required="false"</code> attribute to the
diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd
index 99c91f6..8fa39d1 100644
--- a/docs/html/guide/topics/manifest/uses-sdk-element.jd
+++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd
@@ -33,16 +33,16 @@
<div class="sidebox-wrapper" xstyle="margin-bottom:2em;margin-top:.5em;width:90%;">
<img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
<div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0;">
- <p style="color:#669999;">Android Market and <uses-sdk> attributes</p>
- <p>Android Market filters the applications that are visible to users, so
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
+ <p style="color:#669999;padding-top:1em;">Google Play and <uses-sdk> attributes</p>
+ <p style="padding-top:1em;">Google Play filters the applications that are visible to users, so
that users can only see and download applications that are compatible with their
-devices. One of the ways Market filters applications is by Android
-version-compatibility. To do this, Market checks the <code><uses-sdk></code>
+devices. One of the ways it filters applications is by Android
+version-compatibility. To do this, Google Play checks the <code><uses-sdk></code>
attributes in each application's manifest to establish its version-compatibility
range, then shows or hides the application based on a comparison with the API
Level of the user's Android system version. For more information, see <a
-href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a>.</p>
+href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>.</p>
</div>
</div>
@@ -114,7 +114,7 @@
updates, consider the following example: </p>
<p>An application declaring <code>maxSdkVersion="5"</code> in its
- manifest is published on Android Market. A user whose device is running Android
+ manifest is published on Google Play. A user whose device is running Android
1.6 (API Level 4) downloads and installs the app. After a few weeks, the user
receives an over-the-air system update to Android 2.0 (API Level 5). After the
update is installed, the system checks the application's
@@ -143,7 +143,7 @@
<div class="special">Future versions of Android (beyond Android 2.0.1) will no
longer check or enforce the <code>maxSdkVersion</code> attribute during
-installation or re-validation. Android Market will continue to use the attribute
+installation or re-validation. Google Play will continue to use the attribute
as a filter, however, when presenting users with applications available for
download. </div>
</dd>
diff --git a/docs/html/guide/topics/media/camera.jd b/docs/html/guide/topics/media/camera.jd
index 4e928b3..7d72491 100644
--- a/docs/html/guide/topics/media/camera.jd
+++ b/docs/html/guide/topics/media/camera.jd
@@ -131,11 +131,11 @@
<p>For a list of camera features, see the manifest
<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html#hw-features">Features
Reference</a>.</p>
- <p>Adding camera features to your manifest causes Android Market to prevent your application from
+ <p>Adding camera features to your manifest causes Google Play to prevent your application from
being installed to devices that do not include a camera or do not support the camera features you
-specify. For more information about using feature-based filtering with Android Market, see <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html#market-feature-filtering">Android
-Market and Feature-Based Filtering</a>.</p>
+specify. For more information about using feature-based filtering with Google Play, see <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html#market-feature-filtering">Google
+Play and Feature-Based Filtering</a>.</p>
<p>If your application <em>can use</em> a camera or camera feature for proper operation, but does
not <em>require</em> it, you should specify this in the manifest by including the {@code
android:required} attribute, and setting it to {@code false}:</p>
@@ -442,7 +442,7 @@
the first, back-facing camera on a device with more than one camera.</p>
<h3 id="check-camera-features">Checking camera features</h3>
-<p>Once you obtain access to a camera, you can get further information about its capabilties using
+<p>Once you obtain access to a camera, you can get further information about its capabilities using
the {@link android.hardware.Camera#getParameters() Camera.getParameters()} method and checking the
returned {@link android.hardware.Camera.Parameters} object for supported capabilities. When using
API Level 9 or higher, use the {@link android.hardware.Camera#getCameraInfo(int,
@@ -677,8 +677,8 @@
<pre>
// Add a listener to the Capture button
Button captureButton = (Button) findViewById(id.button_capture);
- captureButton.setOnClickListener(
- new View.OnClickListener() {
+captureButton.setOnClickListener(
+ new View.OnClickListener() {
@Override
public void onClick(View v) {
// get an image from the camera
@@ -1260,7 +1260,7 @@
<p>If your application requires certain camera features in order to function properly, you can
require them through additions to your application manifest. When you declare the use of specific
-camera features, such as flash and auto-focus, the Android Market restricts your application from
+camera features, such as flash and auto-focus, Google Play restricts your application from
being installed on devices which do not support these features. For a list of camera features that
can be declared in your app manifest, see the manifest
<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html#hw-features"> Features
diff --git a/docs/html/guide/topics/network/sip.jd b/docs/html/guide/topics/network/sip.jd
index 276adb6..600da78 100644
--- a/docs/html/guide/topics/network/sip.jd
+++ b/docs/html/guide/topics/network/sip.jd
@@ -147,7 +147,7 @@
</ul>
<p>To control how your application is filtered from devices that do not support
-SIP (for example, in Android Market), add the following to your application's
+SIP (for example, on Google Play), add the following to your application's
manifest:</p>
<ul>
diff --git a/docs/html/guide/topics/nfc/nfc.jd b/docs/html/guide/topics/nfc/nfc.jd
index 83873c3..834656a 100644
--- a/docs/html/guide/topics/nfc/nfc.jd
+++ b/docs/html/guide/topics/nfc/nfc.jd
@@ -318,8 +318,8 @@
</pre>
</li>
- <li>The <code>uses-feature</code> element so that your application shows up in the Android
-Market only for devices that have NFC hardware:
+ <li>The <code>uses-feature</code> element so that your application shows up in Google
+Play only for devices that have NFC hardware:
<pre>
<uses-feature android:name="android.hardware.nfc" android:required="true" />
</pre>
@@ -660,7 +660,7 @@
of an application embedded inside an NDEF record. You can add an AAR to any NDEF record of your NDEF message,
because Android searches the entire NDEF message for AARs. If it finds an AAR, it starts the application based
on the package name inside the AAR. If the application is not present on the device,
-Android Market is launched to download the application.</p>
+Google Play is launched to download the application.</p>
<p>AARs are useful if you want to prevent other applications from filtering for the same intent and
potentially handling specific tags that you have deployed. AARs are only supported at the
@@ -678,7 +678,7 @@
<li>If the Activity that filters for the intent does not match the
AAR, if multiple Activities can handle the intent, or if no Activity handles the intent, start the
application specified by the AAR.</li>
- <li>If no application can start with the AAR, go to the Android Market to download the
+ <li>If no application can start with the AAR, go to Google Play to download the
application based on the AAR.</li>
</ol>
@@ -897,7 +897,7 @@
<p>Note that this code comments out an AAR, which you can remove. If you enable the AAR, the
application specified in the AAR always receives the Android Beam message. If the application is not
-present, the Android Market is started to download the application. Therefore, the following intent
+present, Google Play launches to download the application. Therefore, the following intent
filter is not technically necessary for Android 4.0 devices or later if the AAR is used:
</p>
diff --git a/docs/html/guide/topics/resources/localization.jd b/docs/html/guide/topics/resources/localization.jd
index 9affb15..c2b668d 100755
--- a/docs/html/guide/topics/resources/localization.jd
+++ b/docs/html/guide/topics/resources/localization.jd
@@ -186,7 +186,7 @@
and can include other types of resources such as animations.
<br>
<code> res/drawable/</code>(required directory holding at least
- one graphic file, for the application's icon in the Market)<br>
+ one graphic file, for the application's icon on Google Play)<br>
<code> res/layout/</code> (required directory holding an XML
file that defines the default layout)<br>
<code> res/anim/</code> (required if you have any
@@ -507,7 +507,7 @@
<h2 id="publishing">Publishing Localized Applications</h2>
-<p>The Android Market is
+<p>The Google Play is
the main application distribution system for Android devices. To publish a
localized application, you need to sign your application, version it, and go
through all the other steps described in <a
@@ -521,7 +521,7 @@
href="{@docRoot}guide/publishing/app-signing.html#strategies">Signing
Strategies</a>. </li>
<li>Give each .apk file a different application name. Currently it is
-impossible to put two applications into the Android Market that have exactly the
+impossible to publish two applications on Google Play that have exactly the
same name.</li>
<li>Include a complete set of default resources in each .apk file.</li>
</ul>
@@ -638,7 +638,7 @@
<tr>
<td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26"
border="0"></td>
- <td>Upload your .apk file or files to Market, selecting the appropriate
+ <td>Upload your .apk file or files to Google Play, selecting the appropriate
languages as
you upload. (For more details, see <a
href="{@docRoot}guide/publishing/publishing.html">Publishing Your
diff --git a/docs/html/guide/topics/sensors/sensors_overview.jd b/docs/html/guide/topics/sensors/sensors_overview.jd
index 3c5e94c..543872c 100644
--- a/docs/html/guide/topics/sensors/sensors_overview.jd
+++ b/docs/html/guide/topics/sensors/sensors_overview.jd
@@ -606,7 +606,7 @@
that a given sensor is present on a device:</p>
<ul>
<li>Detect sensors at runtime and enable or disable application features as appropriate.</li>
- <li>Use Android Market filters to target devices with specific sensor configurations.</li>
+ <li>Use Google Play filters to target devices with specific sensor configurations.</li>
</ul>
<p>Each option is discussed in the following sections.</p>
@@ -633,9 +633,9 @@
}
</pre>
-<h4>Using Android Market filters to target specific sensor configurations</h4>
+<h4>Using Google Play filters to target specific sensor configurations</h4>
-<p>If you are publishing your application on Android Market you can use the
+<p>If you are publishing your application on Google Play you can use the
<a href="{@docRoot}guide//topics/manifest/uses-feature-element.html"><code><uses-feature>
</code></a> element in your manifest file to filter your application from devices that do not
have the appropriate sensor configuration for your application. The
@@ -650,7 +650,7 @@
</pre>
<p>If you add this element and descriptor to your application's manifest, users will see your
-application on Android Market only if their device has an accelerometer.</p>
+application on Google Play only if their device has an accelerometer.</p>
<p>You should set the descriptor to <code>android:required="true"</code> only if your application
relies entirely on a specific sensor. If your application uses a sensor for some functionality, but
diff --git a/docs/html/guide/topics/ui/actionbar.jd b/docs/html/guide/topics/ui/actionbar.jd
index e59fa0f..bf7369a 100644
--- a/docs/html/guide/topics/ui/actionbar.jd
+++ b/docs/html/guide/topics/ui/actionbar.jd
@@ -349,7 +349,7 @@
<li><strong>Frequently used</strong>: It's an action that your users need seven out of ten visits
or they use it several times in a row.
<p>Example frequent actions: "New message" in the Messaging app and
-"Search" in Android Market.</p>
+"Search" on Google Play.</p>
</li>
<li><strong>Important</strong>: It's an action that you need users to easily discover or, if it's
diff --git a/docs/html/guide/topics/usb/adk.jd b/docs/html/guide/topics/usb/adk.jd
index 4d5fbfa..c8949a3 100644
--- a/docs/html/guide/topics/usb/adk.jd
+++ b/docs/html/guide/topics/usb/adk.jd
@@ -97,6 +97,9 @@
<li><a href="http://www.sparkfun.com/products/10748">
SparkFun</a></li>
+ <li><a href="http://troido.de/de/shoplsmallgbuy-android-stufflsmallg">
+ Troido</a></li>
+
</ol>
</div>
</div>
diff --git a/docs/html/images/home/play_logo.png b/docs/html/images/home/play_logo.png
new file mode 100644
index 0000000..b8e3ebf
--- /dev/null
+++ b/docs/html/images/home/play_logo.png
Binary files differ
diff --git a/docs/html/index.jd b/docs/html/index.jd
index 431a7d2..cfd9ff1 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -13,14 +13,14 @@
<div id="announcement-block">
<!-- total max width is 520px -->
<a href="{@docRoot}design/index.html">
- <img src="{@docRoot}images/home/android-design.png"
-alt="Android Design" width="160px" style="padding:10px 33px 5px"/>
+ <img src="{@docRoot}images/home/play_logo.png"
+alt="Google Play" width="120px" style="padding:10px 52px"/>
</a>
<div id="announcement" style="width:275px">
- <p>Introducing <b>Android Design</b>: The place to learn about principles, building blocks, and patterns
- for creating world-class Android user interfaces. Whether you're a UI professional or a developer
- playing that role, these docs show you how to make good design decisions, big and small.</p>
- <p><a href="{@docRoot}design/index.html">Android Design »</a></p>
+ <p>Introducing <strong>Google Play</strong>: An integrated digital content destination where
+users buy and enjoy all of their favorite content in one place. It's the new destination for
+Android apps!</p>
+ <p><a href="http://android-developers.blogspot.com/2012/03/introducing-google-play.html">Read more »</a></p>
</div> <!-- end annoucement -->
</div> <!-- end annoucement-block -->
</div><!-- end topAnnouncement -->
@@ -59,11 +59,11 @@
<td colspan="2"><div class="seperator"> </div></td>
</tr>
<tr>
- <td class="imageCell"><a href="http://market.android.com/publish"><img src="{@docRoot}assets/images/icon_market.jpg" style="padding:0" /></a></td>
+ <td class="imageCell"><a href="http://play.google.com/apps/publish"><img src="{@docRoot}assets/images/icon_play.png" style="padding:0" /></a></td>
<td>
<h2 class="green">Publish</h2>
- <p>Android Market is an open service that lets you distribute your apps to handsets.</p>
- <p><a href="http://market.android.com/publish">Learn more »</a></p>
+ <p>Google Play is an open service that lets you distribute your apps to devices.</p>
+ <p><a href="http://play.google.com/apps/publish">Learn more »</a></p>
</td>
</tr>
<tr>
@@ -182,8 +182,8 @@
'desc': "<p>Run and debug your Android applications directly on one of these "
+ "devices. Modify and rebuild the Android operating system, and flash it onto "
+ "the phone. The Android Dev Phones are carrier-independent, and available for "
- + "purchase by developers through their Android Market publisher accounts.</p><p> "
- + "<a href='http://market.android.com/publish'>Visit Android Market "
+ + "purchase by developers through their Google Play publisher accounts.</p><p> "
+ + "<a href='http://play.google.com/apps/publish'>Visit Google Play "
+ "to learn more »</a></p>"
},
*/
diff --git a/docs/html/intl/ja/community/index.jd b/docs/html/intl/ja/community/index.jd
index 490b23f..9739f0d 100644
--- a/docs/html/intl/ja/community/index.jd
+++ b/docs/html/intl/ja/community/index.jd
@@ -85,7 +85,7 @@
<li><b>Android マーケット ヘルプフォーラム</b> - Android マーケットに関する質問や問題の報告をするための、ウェブベースのディスカッション フォーラムです。
<ul>
-<li>URL: <a href="http://www.google.com/support/forum/p/Android+Market?hl=ja">http://www.google.com/support/forum/p/Android+Market?hl=ja</a></li>
+<li>URL: <a href="http://support.google.com/googleplay?hl=ja">http://support.google.com/googleplay?hl=ja</a></li>
</ul>
</li>
diff --git a/docs/html/intl/ja/index.jd b/docs/html/intl/ja/index.jd
index 8096247..fbbd88f 100644
--- a/docs/html/intl/ja/index.jd
+++ b/docs/html/intl/ja/index.jd
@@ -52,11 +52,11 @@
<td colspan="2"><div class="seperator"> </div></td>
</tr>
<tr>
- <td class="imageCell"><a href="http://www.android.com/market.html"><img src="{@docRoot}assets/images/icon_market.jpg" style="padding:0" /></a></td>
+ <td class="imageCell"><a href="http://play.google.com/apps/publish"><img src="{@docRoot}assets/images/icon_play.png" style="padding:0" /></a></td>
<td>
<h2 class="green">公開</h2>
<p>Android マーケットは、アプリケーションを携帯端末に配信するためのオープン サービスです。</p>
- <p><a href="http://market.android.com/publish/Home">詳細 »</a></p>
+ <p><a href="http://play.google.com/apps/publish">詳細 »</a></p>
</td>
</tr>
<tr>
@@ -148,7 +148,7 @@
'name':"Dev Phone 1",
'img':"devphone-large.png",
'title':"Android Dev Phone 1",
- 'desc': "<p>この携帯電話を使用することで、開発した Android アプリケーションの実行とデバッグを行うことができます。Android オペレーティングシステムを変更してからリビルドし、携帯電話に書き込むことができます。Android Dev Phone 1 は携帯通信会社に依存しておらず、<a href='http://market.android.com/publish'>Android マーケット</a>に登録済みのデベロッパーなら誰でも購入可能です。</p><p><a href='/guide/developing/device.html#dev-phone-1'>Android Dev Phone 1 の詳細»</a></p>"
+ 'desc': "<p>この携帯電話を使用することで、開発した Android アプリケーションの実行とデバッグを行うことができます。Android オペレーティングシステムを変更してからリビルドし、携帯電話に書き込むことができます。Android Dev Phone 1 は携帯通信会社に依存しておらず、<a href='http://play.google.com/apps/publish'>Android マーケット</a>に登録済みのデベロッパーなら誰でも購入可能です。</p><p><a href='/guide/developing/device.html#dev-phone-1'>Android Dev Phone 1 の詳細»</a></p>"
}
}
diff --git a/docs/html/intl/ja/resources/community-groups.jd b/docs/html/intl/ja/resources/community-groups.jd
index ecedde1..3fd6601 100644
--- a/docs/html/intl/ja/resources/community-groups.jd
+++ b/docs/html/intl/ja/resources/community-groups.jd
@@ -85,7 +85,7 @@
<li><b>Android マーケット ヘルプフォーラム</b> - Android マーケットに関する質問や問題の報告をするための、ウェブベースのディスカッション フォーラムです。
<ul>
-<li>URL: <a href="http://www.google.com/support/forum/p/Android+Market?hl=ja">http://www.google.com/support/forum/p/Android+Market?hl=ja</a></li>
+<li>URL: <a href="http://support.google.com/googleplay?hl=ja">http://support.google.com/googleplay?hl=ja</a></li>
</ul>
</li>
diff --git a/docs/html/resources/articles/can-i-use-this-intent.jd b/docs/html/resources/articles/can-i-use-this-intent.jd
index c527331..7787d31e 100644
--- a/docs/html/resources/articles/can-i-use-this-intent.jd
+++ b/docs/html/resources/articles/can-i-use-this-intent.jd
@@ -68,4 +68,4 @@
UI accordingly to prevent the user from doing something that won't work. The
technique described here can also be used at startup time to ask the user
whether he'd like to install the missing package, you can then simply redirect
-him to the Android Market by using the appropriate URI.</p>
\ No newline at end of file
+him to Google Play by using the appropriate URI.</p>
\ No newline at end of file
diff --git a/docs/html/resources/articles/contacts.jd b/docs/html/resources/articles/contacts.jd
index 8365d29..374587b 100644
--- a/docs/html/resources/articles/contacts.jd
+++ b/docs/html/resources/articles/contacts.jd
@@ -298,10 +298,10 @@
<li>At launch time, check the version of the SDK. The version of the SDK
is available as {@link android.os.Build.VERSION#SDK android.os.Build.VERSION.SDK}.</li>
<li>If the SDK version is greater or equal to 5 (Android 2.0), show a dialog
-suggesting to the user that it's time to go to Market and find a new version of
-the app. You can even provide a link to the new app on Market (see <a
+suggesting to the user that it's time to go to Google Play and find a new version of
+the app. You can even provide a link to the new app on Google Play (see <a
href="{@docRoot}guide/publishing/publishing.html#marketintent">Using Intents
-to Launch Market</a>). </li>
+to Launch Google Play</a>). </li>
</ul>
<li>Change the new application:</li>
<ul>
@@ -311,14 +311,14 @@
<li>Modify that application's AndroidManifest.xml file: </li>
<ul>
<li>Give the application a new name and a new package name. Currently
-Android Market does not allow you to have two applications with the same
+Google Play does not allow you to have two applications with the same
name/package.</li>
<li>Update (or add) the <code>android:minSdkVersion</code> attribute
to the <code><uses-sdk></code> element. To use the new Contacts API,
you should set the value of the attribute to "5" (or higher, as appropriate).</li>
</ul>
</ul>
- <li>Publish both apps on Market, the old app one as an upgrade and the
+ <li>Publish both apps on Google Play, the old app one as an upgrade and the
other as new. Make sure to explain the difference between the apps in their
descriptions.</li>
</ul>
diff --git a/docs/html/resources/articles/live-wallpapers.jd b/docs/html/resources/articles/live-wallpapers.jd
index bfbbb34..0692a62 100644
--- a/docs/html/resources/articles/live-wallpapers.jd
+++ b/docs/html/resources/articles/live-wallpapers.jd
@@ -76,19 +76,19 @@
supported only on Android 2.1 (API level 7) and higher versions of the platform.
To ensure that your application can only be installed on devices that support
live wallpapers, remember to add the following to the application's manifest
-before publishing to Android Market:</p>
+before publishing to Google Play:</p>
<ul>
<li><code><uses-sdk android:minSdkVersion="7" /></code>, which indicates
-to Android Market and the platform that your application requires Android 2.1 or
+to Google Play and the platform that your application requires Android 2.1 or
higher. For more information, see the <a href="{@docRoot}guide/appendix/api-levels.html">API
Levels</a> and the documentation for the
<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
element.</li>
<li><code><uses-feature android:name="android.software.live_wallpaper" /></code>,
-which tells Android Market that your application includes a live wallpaper
-Android Market uses this feature as a filter, when presenting users lists of
-available applications. When you declaring this feature, Android Market
+which tells Google Play that your application includes a live wallpaper
+Google Play uses this feature as a filter, when presenting users lists of
+available applications. When you declaring this feature, Google Play
displays your application only to users whose devices support live wallpapers,
while hiding it from other devices on which it would not be able to run. For
more information, see the documentation for the
@@ -98,5 +98,5 @@
element.</li>
</ul>
-<p>Many great live wallpapers are already available on Android Market and
+<p>Many great live wallpapers are already available on Google Play and
we can't wait to see more!</p>
diff --git a/docs/html/resources/articles/speech-input.jd b/docs/html/resources/articles/speech-input.jd
index 0867ff2..2f9cd69 100644
--- a/docs/html/resources/articles/speech-input.jd
+++ b/docs/html/resources/articles/speech-input.jd
@@ -9,7 +9,7 @@
<p>Speech input adds another dimension to staying in touch.
Google's Voice Search application, which is pre-installed on many Android devices
-and available in Android Market, provides powerful features like "search by voice"
+and available on Google Play, provides powerful features like "search by voice"
and Voice Actions like "Navigate to." Further
enhancing the voice experience, Android 2.1 introduces a <a
href="http://www.youtube.com/watch?v=laOlkD8LmZw">
@@ -21,7 +21,7 @@
<p> We believe speech can
fundamentally change the mobile experience. We would like to invite every
Android application developer to consider integrating speech input capabilities
-via the Android SDK. One of our favorite apps in the Market that integrates
+via the Android SDK. One of our favorite apps on Google Play that integrates
speech input is <a href="http://www.handcent.com/">Handcent SMS</a>,
because you can dictate a reply to any SMS with a
quick tap on the SMS popup window. Here is Speech input integrated into
diff --git a/docs/html/resources/articles/tts.jd b/docs/html/resources/articles/tts.jd
index 7d07a89..929d084 100644
--- a/docs/html/resources/articles/tts.jd
+++ b/docs/html/resources/articles/tts.jd
@@ -43,7 +43,7 @@
know to install the data that's required for the device to become a
multi-lingual talking machine! Downloading and installing the data is
accomplished by firing off the ACTION_INSTALL_TTS_DATA intent, which will take
-the user to Android Market, and will let her/him initiate the download.
+the user to Google Play, and will let her/him initiate the download.
Installation of the data will happen automatically once the download completes.
Here is an example of what your implementation of
<code>onActivityResult()</code> would look like:</p>
diff --git a/docs/html/resources/articles/ui-1.6.jd b/docs/html/resources/articles/ui-1.6.jd
index 09108dd..b3238e3 100644
--- a/docs/html/resources/articles/ui-1.6.jd
+++ b/docs/html/resources/articles/ui-1.6.jd
@@ -129,4 +129,4 @@
<p>The Android team is committed to helping you write applications in the
easiest and most efficient way possible. We hope you find these improvements
-useful and we're excited to see your applications on Android Market.</p>
+useful and we're excited to see your applications on Google Play.</p>
diff --git a/docs/html/resources/community-groups.jd b/docs/html/resources/community-groups.jd
index 599c4ae..6bd347c 100644
--- a/docs/html/resources/community-groups.jd
+++ b/docs/html/resources/community-groups.jd
@@ -14,7 +14,7 @@
<li><a href="#UsingEmail">Using email with the mailing lists</a></li>
<li><a href="#ApplicationDeveloperLists">Application developer mailing lists</a></li>
</ol></li>
- <li><a href="#MarketHelp">Android Market Help Forum</a></li>
+ <li><a href="#PlayHelp">Google Play Help Forum</a></li>
</ol>
</div>
@@ -113,8 +113,8 @@
</ul>
-<h2 id="MarketHelp">Android Market Help Forum</h2>
+<h2 id="PlayHelp">Google Play Help Forum</h2>
-<p>The <a href="http://www.google.com/support/forum/p/Android+Market">Android Market Help Forum</a> is a web-based discussion forum where you can ask questions or report issues relating to Android Market.</p>
+<p>The <a href="http://support.google.com/googleplay">Google Play Help Forum</a> is a web-based discussion forum where you can ask questions or report issues relating to Google Play.</p>
-<p style="margin-left: 2em"><a href="http://www.google.com/support/forum/p/Android+Market">http://www.google.com/support/forum/p/Android+Market</a></p>
+<p style="margin-left: 2em"><a href="http://support.google.com/googleplay">http://support.google.com/googleplay</a></p>
diff --git a/docs/html/resources/dashboard/opengl.jd b/docs/html/resources/dashboard/opengl.jd
index 6978d62..b1c3234 100644
--- a/docs/html/resources/dashboard/opengl.jd
+++ b/docs/html/resources/dashboard/opengl.jd
@@ -50,7 +50,7 @@
uses.</p>
<p class="note"><strong>Note:</strong> This data is based on the number
-of Android devices that have accessed Android Market within a 7-day period
+of Android devices that have accessed Google Play within a 7-day period
ending on the data collection date noted below.</p>
diff --git a/docs/html/resources/dashboard/platform-versions.jd b/docs/html/resources/dashboard/platform-versions.jd
index 9631059..65a5575 100644
--- a/docs/html/resources/dashboard/platform-versions.jd
+++ b/docs/html/resources/dashboard/platform-versions.jd
@@ -47,12 +47,12 @@
<h3 id="Current">Current Distribution</h3>
<p>The following pie chart and table is based on the number of Android devices that have accessed
-Android Market within a 14-day period ending on the data collection date noted below.</p>
+Google Play within a 14-day period ending on the data collection date noted below.</p>
<div class="dashboard-panel">
<img alt="" height="250" width="470"
-src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.1,0.4,0.8,6.6,25.2,0.5,61.4,1.1,2.1,0.4,1.2&chl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.1|Android%203.2|Android%204.0|Android%204.0.3&chco=c4df9b,6fad0c" />
+src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.4,0.8,6.6,25.2,0.5,61.4,0.1,1.1,2.1,0.4,1.2&chl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.0|Android%203.1|Android%203.2|Android%204.0|Android%204.0.3&chco=c4df9b,6fad0c" />
<table>
<tr>
@@ -103,7 +103,7 @@
line for that version meets the y-axis on the right.</p>
<p>Each dataset in the timeline is based on the number of Android devices that accessed
-Android Market within a 14-day period ending on the date indicated on the x-axis.</p>
+Google Play within a 14-day period ending on the date indicated on the x-axis.</p>
<div class="dashboard-panel">
diff --git a/docs/html/resources/dashboard/screens.jd b/docs/html/resources/dashboard/screens.jd
index 6c04f7e..e9c738e 100644
--- a/docs/html/resources/dashboard/screens.jd
+++ b/docs/html/resources/dashboard/screens.jd
@@ -53,7 +53,7 @@
Screens</a>.</p>
<p class="note"><strong>Note:</strong> This data is based on the number
-of Android devices that have accessed Android Market within a 7-day period
+of Android devices that have accessed Google Play within a 7-day period
ending on the data collection date noted below.</p>
diff --git a/docs/html/sdk/android-1.6-highlights.jd b/docs/html/sdk/android-1.6-highlights.jd
index 84766d6..f0a50fb 100644
--- a/docs/html/sdk/android-1.6-highlights.jd
+++ b/docs/html/sdk/android-1.6-highlights.jd
@@ -38,7 +38,7 @@
<ul>
<li><a href="#UserFeatures">New User Features</a></li>
- <li><a href="#AndroidMarketUpdates">Android Market Updates</a></li>
+ <li><a href="#GooglePlayUpdates">Google Play Updates</a></li>
<li><a href="#PlatformTechnologies">New Platform Technologies</a></li>
</ul>
@@ -118,14 +118,14 @@
-<h2 id="AndroidMarketUpdates" style="clear:right">Android Market Updates</h2>
+<h2 id="GooglePlayUpdates" style="clear:right">Google Play Updates</h2>
<div class="screenshot" style="margin-top:-35px">
<img src="images/market.png" class="screenshot" alt="" /><br/>
-New Android Market UI
+New Google Play UI
</div>
-<p>For devices with Android Market, the latest version improves the overall user experience and makes
+<p>For devices with Google Play, the latest version improves the overall user experience and makes
it easier for users to discover great apps and games from developers.</p>
<ul>
@@ -157,7 +157,7 @@
It allows any Android application to "speak" a string of text with an accent that matches the language.
The engine supports the following languages: English (American and British accents), French,
Italian, German and Spanish. If you're using a T-Mobile G1 or Dream device, you'll need to download the
-SpeechSynthesis Data Installer from Android Market, which includes the "voices" needed by the
+SpeechSynthesis Data Installer from Google Play, which includes the "voices" needed by the
text-to-speech engine.</p>
diff --git a/docs/html/sdk/android-2.1.jd b/docs/html/sdk/android-2.1.jd
index 3f28551..1ee833c 100644
--- a/docs/html/sdk/android-2.1.jd
+++ b/docs/html/sdk/android-2.1.jd
@@ -191,7 +191,7 @@
<uses-feature android:name="android.software.live_wallpaper" />
</pre>
-<p>When you've published your application, Android Market checks for the
+<p>When you've published your application, Google Play checks for the
presence of this element and uses it as a filter, ensuring that your application
is not made available to users whose devices do not support Live Wallpapers.
</p>
diff --git a/docs/html/sdk/android-2.2-highlights.jd b/docs/html/sdk/android-2.2-highlights.jd
index 8bed675..37a20d5 100644
--- a/docs/html/sdk/android-2.2-highlights.jd
+++ b/docs/html/sdk/android-2.2-highlights.jd
@@ -231,7 +231,7 @@
<h3>Android Application Error Reports</h3>
-<p>New bug reporting feature for Android Market apps enables developers to receive crash and freeze
+<p>New bug reporting feature for Google Play apps enables developers to receive crash and freeze
reports from their users. The reports will be available when they log into their publisher
account.</p>
diff --git a/docs/html/sdk/android-2.3.3.jd b/docs/html/sdk/android-2.3.3.jd
index 023e2e4..405c063 100644
--- a/docs/html/sdk/android-2.3.3.jd
+++ b/docs/html/sdk/android-2.3.3.jd
@@ -192,7 +192,7 @@
declaring <code><uses-permission
android:name="android.permission.NFC"></code> in their manifest files.</p>
-<p>Additionally, developers can request filtering on Android Market, such that
+<p>Additionally, developers can request filtering on Google Play, such that
their applications are not discoverable to users whose devices do not support
NFC. To request filtering, add
<code><uses-feature android:name="android.hardware.nfc"
diff --git a/docs/html/sdk/android-2.3.4.jd b/docs/html/sdk/android-2.3.4.jd
index eeaa69a..4bfdabd 100644
--- a/docs/html/sdk/android-2.3.4.jd
+++ b/docs/html/sdk/android-2.3.4.jd
@@ -197,7 +197,7 @@
accessories, please see the related <a
href="{@docRoot}guide/topics/usb/index.html">developer documentation</a>.</p>
-<p>Additionally, developers can request filtering on Android Market, such that
+<p>Additionally, developers can request filtering on Google Play, such that
their applications are not available to users whose devices do not provide the
appropriate accessory support. To request filtering, add the element below
to the application manifest:</p>
diff --git a/docs/html/sdk/android-2.3.jd b/docs/html/sdk/android-2.3.jd
index fc4f5aa..b466913 100644
--- a/docs/html/sdk/android-2.3.jd
+++ b/docs/html/sdk/android-2.3.jd
@@ -150,7 +150,7 @@
android:name="android.permission.INTERNET"></code> and <code><uses-permission
android:name="android.permission.USE_SIP"></code> in their manifest files.</p>
-<p>Additionally, developers can request filtering on Android Market, such that
+<p>Additionally, developers can request filtering on Google Play, such that
their applications are not discoverable to users whose devices do not include
the platform’s SIP stack and services. To request filtering, add <code><uses-feature
android:name="android.software.sip"
@@ -197,7 +197,7 @@
declaring <code><uses-permission
android:name="android.permission.NFC"></code> in their manifest files.</p>
-<p>Additionally, developers can request filtering on Android Market, such that
+<p>Additionally, developers can request filtering on Google Play, such that
their applications are not discoverable to users whose devices do not support
NFC. To request filtering, add
<code><uses-feature android:name="android.hardware.nfc"
@@ -219,7 +219,7 @@
<p>Note that the specific set of hardware sensors available on any given device
varies at the discretion of the device manufacturer. </p>
-<p>Developers can request filtering in Android Market, such that their
+<p>Developers can request filtering on Google Play, such that their
applications are not discoverable to users whose devices do not offer a
gyroscope sensor. To do so, add <code><uses-feature
android:name="android.hardware.sensor.gyroscope"
@@ -726,7 +726,7 @@
<p>The platform adds several new hardware features that developers can declare
in their application manifests as being required by their applications. This
lets developers control how their application is filtered, when published on
-Android Market. </p>
+Google Play. </p>
<ul>
<li>{@link android.content.pm.PackageManager#FEATURE_AUDIO_LOW_LATENCY
diff --git a/docs/html/sdk/android-3.0.jd b/docs/html/sdk/android-3.0.jd
index 49fefee..39a234f 100644
--- a/docs/html/sdk/android-3.0.jd
+++ b/docs/html/sdk/android-3.0.jd
@@ -922,7 +922,7 @@
<p>The <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
-manfest element should be used to inform external entities (such as Android Market) of the set of
+manfest element should be used to inform external entities (such as Google Play) of the set of
hardware and software features on which your application depends. In this release, Android adds the
following new constants that applications can declare with this element:</p>
diff --git a/docs/html/sdk/android-3.1.jd b/docs/html/sdk/android-3.1.jd
index b9cf969..7ec7e33 100644
--- a/docs/html/sdk/android-3.1.jd
+++ b/docs/html/sdk/android-3.1.jd
@@ -214,7 +214,7 @@
their manufacturers. In particular, host mode relies on appropriate USB
controller hardware in the Android-powered device. </p>
-<p>Additionally, developers can request filtering on Android Market, such that
+<p>Additionally, developers can request filtering on Google Play, such that
their applications are not availabe to users whose devices do not provide the
appropriate USB support. To request filtering, add one or both of the elements
below to the application manifest, as appropriate: </p>
@@ -908,8 +908,8 @@
<h3 id="features">New feature constants</h3>
<p>The platform adds new hardware feature constants that developers can declare
-in their application manifests, to inform external entities such as Android
-Market of the application's requirement for new hardware capabilities supported
+in their application manifests, to inform external entities such as Google
+Play of the application's requirement for new hardware capabilities supported
in this version of the platform. Developers declare these and other feature
constants in <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
@@ -926,11 +926,11 @@
devices.</li>
</ul>
-<p>Android Market filters applications based on features declared in <a
+<p>Google Play filters applications based on features declared in <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
<uses-feature>}</a> manifest elements. For more information about
declaring features in an application manifest, read <a
-href="{@docRoot}guide/appendix/market-filters.html">Android Market
+href="{@docRoot}guide/appendix/market-filters.html">Google Play
Filters</a>.</p>
diff --git a/docs/html/sdk/android-3.2.jd b/docs/html/sdk/android-3.2.jd
index aeaf9c8..27df22c 100644
--- a/docs/html/sdk/android-3.2.jd
+++ b/docs/html/sdk/android-3.2.jd
@@ -320,7 +320,7 @@
from being installed and run.</li>
</ul>
-<p class="note"><strong>Note:</strong> Android Market does not currently filter
+<p class="note"><strong>Note:</strong> Google Play does not currently filter
apps based on any of the attributes above. Support for filtering will be
added in a later platform release. Applications that require
filtering based on screen size can use the existing <code><supports-screens></code>
@@ -526,13 +526,13 @@
<h3 id="features">New feature constants</h3>
<p>The platform adds new hardware feature constants that you can declare
-in their application manifests, to inform external entities such as Android
-Market of required hardware and software capabilities. You declare these
+in their application manifests, to inform external entities such as Google
+Play of required hardware and software capabilities. You declare these
and other feature constants in <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
<uses-feature>}</a> manifest elements.
-<p>Android Market filters applications based on their <code><uses-feature></code> attributes, to ensure that they are available only to devices on which their requirements are met. </p>
+<p>Google Play filters applications based on their <code><uses-feature></code> attributes, to ensure that they are available only to devices on which their requirements are met. </p>
<ul>
<li>Feature constants for landscape or portrait requirements
diff --git a/docs/html/sdk/android-4.0-highlights.jd b/docs/html/sdk/android-4.0-highlights.jd
index 922bb08..50e9a14 100644
--- a/docs/html/sdk/android-4.0-highlights.jd
+++ b/docs/html/sdk/android-4.0-highlights.jd
@@ -529,7 +529,7 @@
Just touch one Android-powered phone to another, then tap to send.</p>
<p>For sharing apps, Android Beam pushes a link to the app's details page in
-Android Market. On the other device, the Market app launches and loads the
+Google Play. On the other device, the Google Play client app launches and loads the
details page, for easy downloading of the app. Individual apps can build on
Android Beam to add other types of interactions, such as passing game scores,
initiating a multiplayer game or chat, and more.</p>
@@ -715,7 +715,7 @@
<p>Even if developers do not add custom interactions based on Android Beam they
can still benefit from it being deeply integrated into Android. By default the
-system shares the app’s Android Market URL, so it’s easy for the user to
+system shares the app’s Google Play URL, so it’s easy for the user to
download or purchase the app right away.</p>
diff --git a/docs/html/sdk/android-4.0.jd b/docs/html/sdk/android-4.0.jd
index 2cad86b..e3b13c8 100644
--- a/docs/html/sdk/android-4.0.jd
+++ b/docs/html/sdk/android-4.0.jd
@@ -660,14 +660,14 @@
application record and multiple applications contain activities that handle the specified intent,
the system always delivers the message to the activity in your application (based on the matching
application record). If the target device does not currently have your application installed, the
-system uses the Android application record to launch Android Market and take the user to the
+system uses the Android application record to launch Google Play and take the user to the
application in order to install it.</p>
<p>If your application doesn’t use NFC APIs to perform NDEF Push messaging, then Android provides a
default behavior: When your application is in the foreground on one device and Android Beam is
invoked with another Android-powered device, then the other device receives an NDEF message with an
Android application record that identifies your application. If the receiving device has the
-application installed, the system launches it; if it’s not installed, Android Market opens and takes
+application installed, the system launches it; if it’s not installed, Google Play opens and takes
the user to your application in order to install it.</p>
<p>You can read more about Android Beam and other NFC features in the <a
diff --git a/docs/html/sdk/ndk/index.jd b/docs/html/sdk/ndk/index.jd
index 29f0749..a1c59e3 100644
--- a/docs/html/sdk/ndk/index.jd
+++ b/docs/html/sdk/ndk/index.jd
@@ -756,7 +756,7 @@
<li>Includes improvements to the <code>cpufeatures</code> helper library that improves reporting
of the CPU type (some devices previously reported ARMv7 CPU when the device really was an ARMv6). We
recommend developers that use this library to rebuild their applications then
- upload to Market to benefit from the improvements.</li>
+ upload to Google Play to benefit from the improvements.</li>
<li>Adds an EGL library that lets you create and manage OpenGL ES textures and
services.</li>
@@ -832,7 +832,7 @@
<code>.apk</code>.</li>
<li>To ensure that your applications are available to users only if their devices are
- capable of running them, Android Market now filters applications based on the
+ capable of running them, Google Play now filters applications based on the
instruction set information included in your application — no action is needed on
your part to enable the filtering. Additionally, the Android system itself also checks
your application at install time and allows the installation to continue only if the
diff --git a/docs/html/sdk/ndk/overview.jd b/docs/html/sdk/ndk/overview.jd
index e969f5d..c98e600 100644
--- a/docs/html/sdk/ndk/overview.jd
+++ b/docs/html/sdk/ndk/overview.jd
@@ -535,7 +535,7 @@
<li>Additionally, an application using the OpenGL ES APIs should declare a
<code><uses-feature></code> element in its manifest, with an
<code>android:glEsVersion</code> attribute that specifies the minimum OpenGl ES version
- required by the application. This ensures that Android Market will show your application only
+ required by the application. This ensures that Google Play will show your application only
to users whose devices are capable of supporting your application. For example:
<pre style="margin:1em;">
<manifest>
diff --git a/docs/html/sdk/oem-usb.jd b/docs/html/sdk/oem-usb.jd
index f98257d..818a0af 100644
--- a/docs/html/sdk/oem-usb.jd
+++ b/docs/html/sdk/oem-usb.jd
@@ -34,7 +34,7 @@
href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a>.</p>
<p class="note"><strong>Note:</strong> If your device is one of the Android Developer Phones
-(purchased from the Android Market publisher site), a Nexus One, or a Nexus S, then you need
+(ADP), a Nexus One, or a Nexus S, then you need
the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>, instead of an OEM driver. The Galaxy
Nexus driver, however, is distributed by <a
href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
@@ -211,7 +211,7 @@
<h2 id="Drivers">OEM Drivers</h2>
<p class="note"><strong>Note:</strong> If your device is one of the Android Developer Phones
-(purchased from the Android Market publisher site), a Nexus One, or a Nexus S, then you need
+(purchased from the Google Play publisher site), a Nexus One, or a Nexus S, then you need
the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>, instead of an OEM driver. The Galaxy
Nexus driver, however, is distributed by <a
href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
diff --git a/docs/html/training/camera/cameradirect.jd b/docs/html/training/camera/cameradirect.jd
index 03ad119..4b6f0d2 100644
--- a/docs/html/training/camera/cameradirect.jd
+++ b/docs/html/training/camera/cameradirect.jd
@@ -35,7 +35,7 @@
the framework APIs.</p>
<p>Directly controlling a device camera requires a lot more code than requesting pictures or videos
-from existing camera applications. However, if you want to build a specialized camera application or
+from existing camera applications. However, if you want to build a specialized camera application
or something fully integrated in your app UI, this lesson shows you how.</p>
@@ -95,7 +95,7 @@
<p>To get started with displaying a preview, you need preview class. The
preview requires an implementation of the {@code
android.view.SurfaceHolder.Callback} interface, which is used to pass image
-data from the camera hardware the application.</p>
+data from the camera hardware to the application.</p>
<pre>
class Preview extends ViewGroup implements SurfaceHolder.Callback {
@@ -214,7 +214,7 @@
<h2 id="TaskRestartPreview">Restart the Preview</h2>
-<p>After a picture is taken, you must to restart the preview before the user
+<p>After a picture is taken, you must restart the preview before the user
can take another picture. In this example, the restart is done by overloading
the shutter button.</p>
diff --git a/docs/html/training/camera/photobasics.jd b/docs/html/training/camera/photobasics.jd
index e6ab43e..3420918 100644
--- a/docs/html/training/camera/photobasics.jd
+++ b/docs/html/training/camera/photobasics.jd
@@ -55,7 +55,7 @@
<h2 id="TaskManifest">Request Camera Permission</h2>
<p>If an essential function of your application is taking pictures, then restrict
-its visibility in Android Market to devices that have a camera. To advertise
+its visibility on Google Play to devices that have a camera. To advertise
that your application depends on having a camera, put a <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html"> {@code
<uses-feature>}</a> tag in your manifest file:</p>
@@ -68,7 +68,7 @@
</pre>
<p>If your application uses, but does not require a camera in order to function, add {@code
-android:required="false"} to the tag. In doing so, Android Market will allow devices without a
+android:required="false"} to the tag. In doing so, Google Play will allow devices without a
camera to download your application. It's then your responsibility to check for the availability
of the camera at runtime by calling {@link
android.content.pm.PackageManager#hasSystemFeature hasSystemFeature(PackageManager.FEATURE_CAMERA)}.
diff --git a/docs/html/training/camera/videobasics.jd b/docs/html/training/camera/videobasics.jd
index a3512b0..5fe1a3a 100644
--- a/docs/html/training/camera/videobasics.jd
+++ b/docs/html/training/camera/videobasics.jd
@@ -62,7 +62,7 @@
</pre>
<p>If your application uses, but does not require a camera in order to function, add {@code
-android:required="false"} to the tag. In doing so, Android Market will allow devices without a
+android:required="false"} to the tag. In doing so, Google Play will allow devices without a
camera to download your application. It's then your responsibility to check for the availability
of the camera at runtime by calling {@link
android.content.pm.PackageManager#hasSystemFeature hasSystemFeature(PackageManager.FEATURE_CAMERA)}.
@@ -107,7 +107,7 @@
<p>The Android Camera application returns the video in the {@link android.content.Intent} delivered
to {@link android.app.Activity#onActivityResult onActivityResult()} as a {@link
android.net.Uri} pointing to the video location in storage. The following code
-retrieves this image and displays it in a {@link android.widget.VideoView}.</p>
+retrieves this video and displays it in a {@link android.widget.VideoView}.</p>
<pre>
private void handleCameraVideo(Intent intent) {
diff --git a/docs/html/training/id-auth/custom_auth.jd b/docs/html/training/id-auth/custom_auth.jd
index e2bd778..0509c6e 100644
--- a/docs/html/training/id-auth/custom_auth.jd
+++ b/docs/html/training/id-auth/custom_auth.jd
@@ -181,6 +181,6 @@
<p>One solution is to place the service in one small, special-purpose APK. When
an app wishes to use your custom account type, it can check the device to see if
your custom account service is available. If not, it can direct the user to
-Android Market to download the service. This may seem like a great deal of
+Google Play to download the service. This may seem like a great deal of
trouble at first, but compared with the alternative of re-entering credentials
for every app that uses your custom account, it's refreshingly easy.</p>
diff --git a/docs/html/training/multiple-apks/api.jd b/docs/html/training/multiple-apks/api.jd
index d8588d4..3492245 100644
--- a/docs/html/training/multiple-apks/api.jd
+++ b/docs/html/training/multiple-apks/api.jd
@@ -44,7 +44,7 @@
</div>
-<p>When developing your Android application to take advantage of multiple APKs on Android Market,
+<p>When developing your Android application to take advantage of multiple APKs on Google Play,
it’s important to adopt some good practices from the get-go, and prevent unnecessary headaches
further into the development process. This lesson shows you how to create multiple APKs of your
app, each covering a slightly different range of API levels. You will also gain some tools
@@ -198,7 +198,7 @@
<h2 id="AdjustManifests">Adjust the Manifests</h2>
-<p>When a user downloads an application which uses multiple APKs through Android Market, the correct
+<p>When a user downloads an application which uses multiple APKs through Google Play, the correct
APK to use is chosen using two simple rules:</p>
<ul>
<li>The manifest has to show that particular APK is eligible</li>
@@ -278,19 +278,20 @@
</table>
<p>
-Now, let’s further assume that the Red APK has some requirement on it that the other two don’t. The
-Market Filters page of the Android Developer guide has a whole list of possible culprits. For the
+Now, let’s further assume that the Red APK has some requirement on it that the other two don’t.
+<a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a> page of
+the Android Developer guide has a whole list of possible culprits. For the
sake of example, let’s assume that red requires a front-facing camera. In fact, the entire point of
the red APK is to combine the front-facing camera with sweet new functionality that was added in API
11. But, it turns out, not all devices that support API 11 even HAVE front-facing cameras! The
horror!</p>
-<p>Fortunately, if a user is browsing Market from one such device, Android Market will look at the
+<p>Fortunately, if a user is browsing Google Play from one such device, Google Play will look at the
manifest, see that Red lists the front-facing camera as a requirement, and quietly ignore it, having
determined that Red and that device are not a match made in digital heaven. It will then see that
Green is not only forward-compatible with devices with API 11 (since no maxSdkVersion was defined),
but also doesn’t care whether or not there’s a front-facing camera! The app can still be downloaded
-from Android Market by the user, because despite the whole front-camera mishap, there was still an
+from Google Play by the user, because despite the whole front-camera mishap, there was still an
APK that supported that particular API level.</p>
<p> In order to keep all your APKs on separate "tracks", it’s important to have a good version code
@@ -330,7 +331,7 @@
</pre>
<h2 id="PreLaunch">Go Over Pre-launch Checklist</h2>
-<p> Before uploading to Android Market, double-check the following items. Remember that these are specifically relevant to multiple APKs, and in no way represent a complete checklist for all applications being uploaded to Android Market.</p>
+<p> Before uploading to Google Play, double-check the following items. Remember that these are specifically relevant to multiple APKs, and in no way represent a complete checklist for all applications being uploaded to Google Play.</p>
<ul>
<li>All APKs must have the same package name</li>
@@ -342,7 +343,7 @@
</ul>
<p>It’s also worth inspecting the compiled APK before pushing to market, to make sure there aren’t
-any surprises that could hide your application in Market. This is actually quite simple using the
+any surprises that could hide your application on Google Play. This is actually quite simple using the
"aapt" tool. Aapt (the Android Asset Packaging Tool) is part of the build process for creating and
packaging your Android applications, and is also a very handy tool for inspecting them. </p>
@@ -370,10 +371,14 @@
supports-screens and compatible-screens, and that you don’t have unintended "uses-feature" values
that were added as a result of permissions you set in the manifest. In the example above, the APK
won’t be visible to very many devices.</p>
-<p>Why? By adding the required permission SEND_SMS, the feature requirement of android.hardware.telephony was implicitly added. Since API 11 is Honeycomb (the version of Android optimized specifically for tablets), and no Honeycomb devices have telephony hardware in them, Market will filter out this APK in all cases, until future devices come along which are higher in API level AND possess telephony hardware.
+<p>Why? By adding the required permission SEND_SMS, the feature requirement of android.hardware.telephony was implicitly added. Since API 11 is Honeycomb (the version of Android optimized specifically for tablets), and no Honeycomb devices have telephony hardware in them, Google Play will filter out this APK in all cases, until future devices come along which are higher in API level AND possess telephony hardware.
</p>
<p>Fortunately this is easily fixed by adding the following to your manifest:</p>
<pre>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
</pre>
-<p>Once you’ve completed the pre-launch checklist, upload your APKs to Android Market. It may take a bit for the application to show up when browsing Android Market, but when it does, perform one last check. Download the application onto any test devices you may have, to make sure that the APKs are targeting the intended devices. Congratulations, you’re done!</p>
+<p>The <code>android.hardware.touchscreen</code> requirement is also implicitly added. If you want your APK to be visible on TVs which are non-touchscreen devices you should add the following to your manifest:</p>
+<pre>
+<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
+</pre>
+<p>Once you’ve completed the pre-launch checklist, upload your APKs to Google Play. It may take a bit for the application to show up when browsing Google Play, but when it does, perform one last check. Download the application onto any test devices you may have, to make sure that the APKs are targeting the intended devices. Congratulations, you’re done!</p>
diff --git a/docs/html/training/multiple-apks/index.jd b/docs/html/training/multiple-apks/index.jd
index f9b2b43..d92c106 100644
--- a/docs/html/training/multiple-apks/index.jd
+++ b/docs/html/training/multiple-apks/index.jd
@@ -16,7 +16,7 @@
<ul>
<li>Android 1.0 and higher</li>
- <li>You must have an <a href="http://market.android.com/publish">Android Market</a> publisher
+ <li>You must have an <a href="http://play.google.com/apps/publish">Google Play</a> publisher
account</li>
</ul>
@@ -30,7 +30,7 @@
</div>
</div>
-<p>Multiple APK support is a feature in Android Market that allows you to publish multiple APKs
+<p>Multiple APK support is a feature of Google Play that allows you to publish multiple APKs
under the same application listing. Each APK is a complete instance of your application, optimized
to target specific device configurations. Each APK can target a specific set of GL
textures, API levels, screen sizes, or some combination thereof.</p>
@@ -39,7 +39,7 @@
configuration variables. Each lesson covers basics about how to organize your codebase and target
the right devices, as well as the smart way to avoid pitfalls such as unnecessary redundancy across
your codebase, and making mistakes in your manifest that could render an APK invisible to all
-devices in Android Market. By going through any of these lessons, you'll know how to develop
+devices on Google Play. By going through any of these lessons, you'll know how to develop
multiple APKs the smart way, make sure they're targeting the devices you want them to,
and know how to catch mistakes <em>before</em> your app goes live.</p>
diff --git a/docs/html/training/multiple-apks/multiple.jd b/docs/html/training/multiple-apks/multiple.jd
index 26a3a93..b30068f 100644
--- a/docs/html/training/multiple-apks/multiple.jd
+++ b/docs/html/training/multiple-apks/multiple.jd
@@ -40,7 +40,7 @@
</div>
</div>
-<p>When developing your Android application to take advantage of multiple APKs on Android Market,
+<p>When developing your Android application to take advantage of multiple APKs on Google Play,
it’s important to adopt some good practices from the get-go, and prevent unnecessary headaches
further into the development process. This lesson shows you how to create multiple APKs of your
app, each covering a different class of screen size. You will also gain some tools necessary to
@@ -227,7 +227,7 @@
<h2 id="AdjustManifests">Adjust the Manifests</h2>
-<p>When a user downloads an application which uses multiple APKs through Android Market, the correct
+<p>When a user downloads an application which uses multiple APKs through Google Play, the correct
APK to use is chosen using two simple rules:
<ul>
@@ -329,17 +329,17 @@
Purple ≥ Red ≥ Green ≥ Blue
</p><p>
Why allow all the overlap? Let’s pretend that the Purple APK has some requirement on it that the
-other two don’t. The <a href="{@docRoot}guide/appendix/market-filters.html">Market Filters page</a>
+other two don’t. The <a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a> page
of the Android Developer guide has a whole list of possible culprits. For the sake of example,
let’s assume that Purple requires a front-facing camera. In fact, the entire point of Purple is to
use entertaining things with the front-facing camera! But, it turns out, not all API 11+ devices
even HAVE front-facing cameras! The horror!</p>
-<p>Fortunately, if a user is browsing Market from one such device, Android Market will look at the
+<p>Fortunately, if a user is browsing Google Play from one such device, Google Play will look at the
manifest, see that Purple lists the front-facing camera as a requirement, and quietly ignore it,
having determined that Purple and that device are not a match made in digital heaven. It will then
see that Red is not only compatible with xlarge devices, but also doesn’t care whether or not
-there’s a front-facing camera! The app can still be downloaded from Android Market by the user,
+there’s a front-facing camera! The app can still be downloaded from Google Play by the user,
because despite the whole front-camera mishap, there was still an APK that supported that particular
API level.</p>
@@ -420,9 +420,9 @@
</p>
<h2 id="PreLaunch">Go Over Pre-launch Checklist</h2>
-<p> Before uploading to Android Market, double-check the following items. Remember that these are
+<p> Before uploading to Google Play, double-check the following items. Remember that these are
specifically relevant to multiple APKs, and in no way represent a complete checklist for all
-applications being uploaded to Android Market.</p>
+applications being uploaded to Google Play.</p>
<ul>
<li>All APKs must have the same package name.</li>
<li>All APKs must be signed with the same certificate.</li>
@@ -439,7 +439,7 @@
</ul>
<p>It’s also worth inspecting the compiled APK before pushing to market, to make sure there aren’t
-any surprises that could hide your application in Market. This is actually quite simple using the
+any surprises that could hide your application on Google Play. This is actually quite simple using the
"aapt" tool. Aapt (the Android Asset Packaging Tool) is part of the build process for creating and
packaging your Android applications, and is also a very handy tool for inspecting them. </p>
@@ -467,11 +467,15 @@
supports-screens and compatible-screens, and that you don’t have unintended "uses-feature" values
that were added as a result of permissions you set in the manifest. In the example above, the APK
will be invisible to most, if not all devices.</p>
-<p>Why? By adding the required permission SEND_SMS, the feature requirement of android.hardware.telephony was implicitly added. Since most (if not all) xlarge devices are tablets without telephony hardware in them, Market will filter out this APK in these cases, until future devices come along which are both large enough to report as xlarge screen size, and possess telephony hardware.
+<p>Why? By adding the required permission SEND_SMS, the feature requirement of android.hardware.telephony was implicitly added. Since most (if not all) xlarge devices are tablets without telephony hardware in them, Google Play will filter out this APK in these cases, until future devices come along which are both large enough to report as xlarge screen size, and possess telephony hardware.
</p>
<p>Fortunately this is easily fixed by adding the following to your manifest:<p>
<pre>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
</pre>
+<p>The <code>android.hardware.touchscreen</code> requirement is also implicitly added. If you want your APK to be visible on TVs which are non-touchscreen devices you should add the following to your manifest:</p>
+<pre>
+<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
+</pre>
-<p>Once you’ve completed the pre-launch checklist, upload your APKs to Android Market. It may take a bit for the application to show up when browsing Android Market, but when it does, perform one last check. Download the application onto any test devices you may have to make sure that the APKs are targeting the intended devices. Congratulations, you’re done!</p>
+<p>Once you’ve completed the pre-launch checklist, upload your APKs to Google Play. It may take a bit for the application to show up when browsing Google Play, but when it does, perform one last check. Download the application onto any test devices you may have to make sure that the APKs are targeting the intended devices. Congratulations, you’re done!</p>
diff --git a/docs/html/training/multiple-apks/screensize.jd b/docs/html/training/multiple-apks/screensize.jd
index 0ed972a..ac679a7 100644
--- a/docs/html/training/multiple-apks/screensize.jd
+++ b/docs/html/training/multiple-apks/screensize.jd
@@ -43,7 +43,7 @@
</div>
-<p>When developing your Android application to take advantage of multiple APKs on Android Market,
+<p>When developing your Android application to take advantage of multiple APKs on Google Play,
it’s important to adopt some good practices from the get-go, and prevent unnecessary headaches
further into the development process. This lesson shows you how to create multiple APKs of your
app, each covering a different class of screen size. You will also gain some tools necessary to
@@ -178,7 +178,7 @@
<h2 id="AdjustManifests">Adjust the Manifests</h2>
-<p>When a user downloads an application which uses multiple APKs through Android Market, the correct
+<p>When a user downloads an application which uses multiple APKs through Google Play, the correct
APK to use is chosen using two simple rules:</p>
<ul>
<li>The manifest has to show that particular APK is eligible</li>
@@ -227,17 +227,17 @@
</table>
<p>
Now, let’s further assume that the Red APK has some requirement on it that the other two don’t. The
-<a href="{@docRoot}guide/appendix/market-filters.html">Market Filters page</a> of the Android
+<a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a> page of the Android
Developer guide has a whole list of possible culprits. For the sake of example, let’s assume that
red requires a front-facing camera. In fact, the entire point of the red APK is to use the extra
available screen space to do entertaining things with that front-facing camera. But, it turns out,
not all xlarge devices even HAVE front-facing cameras! The horror!</p>
-<p>Fortunately, if a user is browsing Market from one such device, Android Market will look at the
+<p>Fortunately, if a user is browsing Google Play from one such device, Google Play will look at the
manifest, see that Red lists the front-facing camera as a requirement, and quietly ignore it, having
determined that Red and that device are not a match made in digital heaven. It will then see that
Green is not only compatible with xlarge devices, but also doesn’t care whether or not there’s a
-front-facing camera! The app can still be downloaded from Android Market by the user, because
+front-facing camera! The app can still be downloaded from Google Play by the user, because
despite the whole front-camera mishap, there was still an APK that supported that particular screen
size.</p>
@@ -300,9 +300,9 @@
</p>
<h2 id="PreLaunch">Go Over Pre-launch Checklist</h2>
-<p> Before uploading to Android Market, double-check the following items. Remember that these are
+<p> Before uploading to Google Play, double-check the following items. Remember that these are
specifically relevant to multiple APKs, and in no way represent a complete checklist for all
-applications being uploaded to Android Market.</p>
+applications being uploaded to Google Play.</p>
<ul>
<li>All APKs must have the same package name</li>
<li>All APKs must be signed with the same certificate</li>
@@ -317,7 +317,7 @@
</ul>
<p>It’s also worth inspecting the compiled APK before pushing to market, to make sure there aren’t
-any surprises that could hide your application in Market. This is actually quite simple using the
+any surprises that could hide your application on Google Play. This is actually quite simple using the
"aapt" tool. Aapt (the Android Asset Packaging Tool) is part of the build process for creating and
packaging your Android applications, and is also a very handy tool for inspecting them. </p>
@@ -345,11 +345,16 @@
supports-screens and compatible-screens, and that you don’t have unintended "uses-feature" values
that were added as a result of permissions you set in the manifest. In the example above, the APK
will be invisible to most, if not all devices.</p>
-<p>Why? By adding the required permission SEND_SMS, the feature requirement of android.hardware.telephony was implicitly added. Since most (if not all) xlarge devices are tablets without telephony hardware in them, Market will filter out this APK in these cases, until future devices come along which are both large enough to report as xlarge screen size, and possess telephony hardware.
+<p>Why? By adding the required permission SEND_SMS, the feature requirement of android.hardware.telephony was implicitly added. Since most (if not all) xlarge devices are tablets without telephony hardware in them, Google Play will filter out this APK in these cases, until future devices come along which are both large enough to report as xlarge screen size, and possess telephony hardware.
</p>
<p>Fortunately this is easily fixed by adding the following to your
manifest:</p>
<pre>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
</pre>
-<p>Once you’ve completed the pre-launch checklist, upload your APKs to Android Market. It may take a bit for the application to show up when browsing Android Market, but when it does, perform one last check. Download the application onto any test devices you may have to make sure that the APKs are targeting the intended devices. Congratulations, you’re done!</p>
+<p>The <code>android.hardware.touchscreen</code> requirement is also implicitly added. If you want your APK to be visible on TVs which are non-touchscreen devices you should add the following to your manifest:</p>
+<pre>
+<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
+</pre>
+
+<p>Once you’ve completed the pre-launch checklist, upload your APKs to Google Play. It may take a bit for the application to show up when browsing Google Play, but when it does, perform one last check. Download the application onto any test devices you may have to make sure that the APKs are targeting the intended devices. Congratulations, you’re done!</p>
diff --git a/docs/html/training/multiple-apks/texture.jd b/docs/html/training/multiple-apks/texture.jd
index 2bbe511..497d6b8 100644
--- a/docs/html/training/multiple-apks/texture.jd
+++ b/docs/html/training/multiple-apks/texture.jd
@@ -40,7 +40,7 @@
</div>
</div>
-<p>When developing your Android application to take advantage of multiple APKs on Android Market, it’s important to adopt some good practices from the get-go, and prevent unnecessary headaches further into the development process. This lesson shows you how to create multiple APKs of your app, each supporting a different subset of OpenGL texture formats. You will also gain some tools necessary to make maintaining a multiple APK codebase as painless as possible.</p>
+<p>When developing your Android application to take advantage of multiple APKs on Google Play, it’s important to adopt some good practices from the get-go, and prevent unnecessary headaches further into the development process. This lesson shows you how to create multiple APKs of your app, each supporting a different subset of OpenGL texture formats. You will also gain some tools necessary to make maintaining a multiple APK codebase as painless as possible.</p>
<h2 id="Confirm">Confirm You Need Multiple APKs</h2>
@@ -158,7 +158,7 @@
<h2 id="AdjustManifests">Adjust the Manifests</h2>
-<p>When a user downloads an application which uses multiple APKs through Android Market, the correct
+<p>When a user downloads an application which uses multiple APKs through Google Play, the correct
APK to use is chosen using some simple rules:</p>
<ul>
@@ -246,9 +246,9 @@
</pre>
<h2 id="PreLaunch">Go Over Pre-launch Checklist</h2>
-<p>Before uploading to Android Market, double-check the following items. Remember that these are
+<p>Before uploading to Google Play, double-check the following items. Remember that these are
specifically relevant to multiple APKs, and in no way represent a complete checklist for all
-applications being uploaded to Android Market.</p>
+applications being uploaded to Google Play.</p>
<ul>
<li>All APKs must have the same package name</li>
@@ -262,7 +262,7 @@
</ul>
<p>It’s also worth inspecting the compiled APK before pushing to market, to make sure there aren’t
-any surprises that could hide your application in Market. This is actually quite simple using the
+any surprises that could hide your application on Google Play. This is actually quite simple using the
"aapt" tool. Aapt (the Android Asset Packaging Tool) is part of the build process for creating and
packaging your Android applications, and is also a very handy tool for inspecting them. </p>
@@ -290,10 +290,15 @@
supports-screens and compatible-screens, and that you don’t have unintended "uses-feature" values
that were added as a result of permissions you set in the manifest. In the example above, the APK
will be invisible to most, if not all devices.</p>
-<p>Why? By adding the required permission SEND_SMS, the feature requirement of android.hardware.telephony was implicitly added. Since most (if not all) xlarge devices are tablets without telephony hardware in them, Market will filter out this APK in these cases, until future devices come along which are both large enough to report as xlarge screen size, and possess telephony hardware.
+<p>Why? By adding the required permission SEND_SMS, the feature requirement of android.hardware.telephony was implicitly added. Since most (if not all) xlarge devices are tablets without telephony hardware in them, Google Play will filter out this APK in these cases, until future devices come along which are both large enough to report as xlarge screen size, and possess telephony hardware.
</p>
<p>Fortunately this is easily fixed by adding the following to your manifest:</p>
<pre>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
</pre>
-<p>Once you’ve completed the pre-launch checklist, upload your APKs to Android Market. It may take a bit for the application to show up when browsing Android Market, but when it does, perform one last check. Download the application onto any test devices you may have to make sure that the APKs are targeting the intended devices. Congratulations, you’re done!</p>
+<p>The <code>android.hardware.touchscreen</code> requirement is also implicitly added. If you want your APK to be visible on TVs which are non-touchscreen devices you should add the following to your manifest:</p>
+<pre>
+<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
+</pre>
+
+<p>Once you’ve completed the pre-launch checklist, upload your APKs to Google Play. It may take a bit for the application to show up when browsing Google Play, but when it does, perform one last check. Download the application onto any test devices you may have to make sure that the APKs are targeting the intended devices. Congratulations, you’re done!</p>
diff --git a/docs/html/training/multiscreen/screensizes.jd b/docs/html/training/multiscreen/screensizes.jd
index 2db0b67..bf19b08 100644
--- a/docs/html/training/multiscreen/screensizes.jd
+++ b/docs/html/training/multiscreen/screensizes.jd
@@ -164,14 +164,14 @@
{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
</li>
- <li><code>res/layout-xlarge/main.xml</code>, two-pane layout:
+ <li><code>res/layout-large/main.xml</code>, two-pane layout:
{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
</li>
</ul>
-<p>Notice the <code>xlarge</code> qualifier in the directory name of the second layout. This layout
-will be selected on devices with screens classified as extra-large (for example, 10" tablets). The
+<p>Notice the <code>large</code> qualifier in the directory name of the second layout. This layout
+will be selected on devices with screens classified as large (for example, 7" tablets and above). The
other layout (without qualifiers) will be selected for smaller devices.</p>
@@ -188,7 +188,7 @@
width given in dp. For example, the typical 7" tablet has a minimum width of
600 dp, so if you want your UI to have two panes on those screens (but a single
list on smaller screens), you can use the same two layouts from the previous section for single
-and two-pane layouts, but instead of the <code>xlarge</code> size qualifier, use
+and two-pane layouts, but instead of the <code>large</code> size qualifier, use
<code>sw600dp</code> to indicate the two-pane layout is for screens on which the smallest-width
is 600 dp:</p>
@@ -209,9 +209,9 @@
layout.</p>
<p>However, this won't work well on pre-3.2 devices, because they don't
-recognize <code>sw600dp</code> as a size qualifier, so you still have to use the <code>xlarge</code>
+recognize <code>sw600dp</code> as a size qualifier, so you still have to use the <code>large</code>
qualifier as well. So, you should have a file named
-<code>res/layout-xlarge/main.xml</code>
+<code>res/layout-large/main.xml</code>
which is identical to <code>res/layout-sw600dp/main.xml</code>. In the next section
you'll see a technique that allows you to avoid duplicating the layout files this way.</p>
@@ -222,20 +222,20 @@
Therefore, you should also still use the abstract size bins (small, normal,
large and xlarge) to be compatible with earlier versions. For example, if you
want to design your UI so that it shows a single-pane UI on phones but a
-multi-pane UI on 7" tablets and larger devices, you'd have to supply these
+multi-pane UI on 7" tablets, TVs and other large devices, you'd have to supply these
files:</p>
<p><ul>
<li><code>res/layout/main.xml:</code> single-pane layout</li>
-<li><code>res/layout-xlarge:</code> multi-pane layout</li>
+<li><code>res/layout-large:</code> multi-pane layout</li>
<li><code>res/layout-sw600dp:</code> multi-pane layout</li>
</ul></p>
<p>The last two files are identical, because one of them will be matched by
-Android 3.2 devices, and the other one is for the benefit of tablets with
+Android 3.2 devices, and the other one is for the benefit of tablets and TVs with
earlier versions of Android.</p>
-<p>To avoid this duplication of the same file for tablets (and the maintenance
+<p>To avoid this duplication of the same file for tablets and TVs (and the maintenance
headache resulting from it), you can use alias files. For example, you can define the following
layouts:</p>
@@ -247,7 +247,7 @@
<p>And add these two files:</p>
<p><ul>
-<li><code>res/values-xlarge/layout.xml</code>:
+<li><code>res/values-large/layout.xml</code>:
<pre>
<resources>
<item name="main" type="layout">@layout/main_twopanes</item>
@@ -267,9 +267,9 @@
<p>These latter two files have identical content, but they don’t actually define
the layout. They merely set up {@code main} to be an alias to {@code main_twopanes}. Since
-these files have <code>xlarge</code> and <code>sw600dp</code> selectors, they are
-applied to tablets regardless of Android version (pre-3.2 tablets match
-{@code xlarge}, and post-3.2 will match <code>sw600dp</code>).</p>
+these files have <code>large</code> and <code>sw600dp</code> selectors, they are
+applied to tablets and TVs regardless of Android version (pre-3.2 tablets and TVs match
+{@code large}, and post-3.2 will match <code>sw600dp</code>).</p>
<h2 id="TaskUseOriQuali">Use Orientation Qualifiers</h2>
@@ -285,6 +285,7 @@
<li><b>7" tablet, landscape:</b> dual pane, wide, with action bar</li>
<li><b>10" tablet, portrait:</b> dual pane, narrow, with action bar</li>
<li><b>10" tablet, landscape:</b> dual pane, wide, with action bar</li>
+<li><b>TV, landscape:</b> dual pane, wide, with action bar</li>
</ul></p>
<p>So each of these layouts is defined in an XML file in the
@@ -319,11 +320,11 @@
{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-port/layouts.xml
all}
-<p><code>res/values-xlarge-land/layouts.xml</code>:</p>
-{@sample development/samples/training/multiscreen/newsreader/res/values-xlarge-land/layouts.xml all}
+<p><code>res/values-large-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-land/layouts.xml all}
-<p><code>res/values-xlarge-port/layouts.xml</code>:</p>
-{@sample development/samples/training/multiscreen/newsreader/res/values-xlarge-port/layouts.xml all}
+<p><code>res/values-large-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-port/layouts.xml all}
diff --git a/docs/html/training/sharing/receive.jd b/docs/html/training/sharing/receive.jd
index cc55967..a0a5bc8 100644
--- a/docs/html/training/sharing/receive.jd
+++ b/docs/html/training/sharing/receive.jd
@@ -34,7 +34,7 @@
from applications. Think about how users interact with your application, and what data types you
want to receive from other applications. For example, a social networking application would likely
be interested in receiving text content, like an interesting web URL, from another app. The
-<a href="https://market.android.com/details?id=com.google.android.apps.plus">Google+ Android
+<a href="https://play.google.com/store/details?id=com.google.android.apps.plus">Google+ Android
application</a>
accepts both text <em>and</em> single or multiple images. With this app, a user can easily start a
new Google+ post with photos from the Android Gallery app.</p>
diff --git a/include/binder/Binder.h b/include/binder/Binder.h
deleted file mode 100644
index ba3ac4b..0000000
--- a/include/binder/Binder.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef ANDROID_BINDER_H
-#define ANDROID_BINDER_H
-
-#include <binder/IBinder.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-class BBinder : public IBinder
-{
-public:
- BBinder();
-
- virtual const String16& getInterfaceDescriptor() const;
- virtual bool isBinderAlive() const;
- virtual status_t pingBinder();
- virtual status_t dump(int fd, const Vector<String16>& args);
-
- virtual status_t transact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-
- virtual status_t linkToDeath(const sp<DeathRecipient>& recipient,
- void* cookie = NULL,
- uint32_t flags = 0);
-
- virtual status_t unlinkToDeath( const wp<DeathRecipient>& recipient,
- void* cookie = NULL,
- uint32_t flags = 0,
- wp<DeathRecipient>* outRecipient = NULL);
-
- virtual void attachObject( const void* objectID,
- void* object,
- void* cleanupCookie,
- object_cleanup_func func);
- virtual void* findObject(const void* objectID) const;
- virtual void detachObject(const void* objectID);
-
- virtual BBinder* localBinder();
-
-protected:
- virtual ~BBinder();
-
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-
-private:
- BBinder(const BBinder& o);
- BBinder& operator=(const BBinder& o);
-
- class Extras;
-
- Extras* mExtras;
- void* mReserved0;
-};
-
-// ---------------------------------------------------------------------------
-
-class BpRefBase : public virtual RefBase
-{
-protected:
- BpRefBase(const sp<IBinder>& o);
- virtual ~BpRefBase();
- virtual void onFirstRef();
- virtual void onLastStrongRef(const void* id);
- virtual bool onIncStrongAttempted(uint32_t flags, const void* id);
-
- inline IBinder* remote() { return mRemote; }
- inline IBinder* remote() const { return mRemote; }
-
-private:
- BpRefBase(const BpRefBase& o);
- BpRefBase& operator=(const BpRefBase& o);
-
- IBinder* const mRemote;
- RefBase::weakref_type* mRefs;
- volatile int32_t mState;
-};
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_BINDER_H
diff --git a/include/binder/BinderService.h b/include/binder/BinderService.h
deleted file mode 100644
index ca594d3..0000000
--- a/include/binder/BinderService.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_BINDER_SERVICE_H
-#define ANDROID_BINDER_SERVICE_H
-
-#include <stdint.h>
-
-#include <utils/Errors.h>
-#include <utils/String16.h>
-
-#include <binder/IServiceManager.h>
-#include <binder/IPCThreadState.h>
-#include <binder/ProcessState.h>
-#include <binder/IServiceManager.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-template<typename SERVICE>
-class BinderService
-{
-public:
- static status_t publish(bool allowIsolated = false) {
- sp<IServiceManager> sm(defaultServiceManager());
- return sm->addService(String16(SERVICE::getServiceName()), new SERVICE(), allowIsolated);
- }
-
- static void publishAndJoinThreadPool(bool allowIsolated = false) {
- sp<ProcessState> proc(ProcessState::self());
- sp<IServiceManager> sm(defaultServiceManager());
- sm->addService(String16(SERVICE::getServiceName()), new SERVICE(), allowIsolated);
- ProcessState::self()->startThreadPool();
- IPCThreadState::self()->joinThreadPool();
- }
-
- static void instantiate() { publish(); }
-
- static status_t shutdown() {
- return NO_ERROR;
- }
-};
-
-
-}; // namespace android
-// ---------------------------------------------------------------------------
-#endif // ANDROID_BINDER_SERVICE_H
diff --git a/include/binder/BpBinder.h b/include/binder/BpBinder.h
deleted file mode 100644
index 7ef93aa..0000000
--- a/include/binder/BpBinder.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_BPBINDER_H
-#define ANDROID_BPBINDER_H
-
-#include <binder/IBinder.h>
-#include <utils/KeyedVector.h>
-#include <utils/threads.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-class BpBinder : public IBinder
-{
-public:
- BpBinder(int32_t handle);
-
- inline int32_t handle() const { return mHandle; }
-
- virtual const String16& getInterfaceDescriptor() const;
- virtual bool isBinderAlive() const;
- virtual status_t pingBinder();
- virtual status_t dump(int fd, const Vector<String16>& args);
-
- virtual status_t transact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-
- virtual status_t linkToDeath(const sp<DeathRecipient>& recipient,
- void* cookie = NULL,
- uint32_t flags = 0);
- virtual status_t unlinkToDeath( const wp<DeathRecipient>& recipient,
- void* cookie = NULL,
- uint32_t flags = 0,
- wp<DeathRecipient>* outRecipient = NULL);
-
- virtual void attachObject( const void* objectID,
- void* object,
- void* cleanupCookie,
- object_cleanup_func func);
- virtual void* findObject(const void* objectID) const;
- virtual void detachObject(const void* objectID);
-
- virtual BpBinder* remoteBinder();
-
- status_t setConstantData(const void* data, size_t size);
- void sendObituary();
-
- class ObjectManager
- {
- public:
- ObjectManager();
- ~ObjectManager();
-
- void attach( const void* objectID,
- void* object,
- void* cleanupCookie,
- IBinder::object_cleanup_func func);
- void* find(const void* objectID) const;
- void detach(const void* objectID);
-
- void kill();
-
- private:
- ObjectManager(const ObjectManager&);
- ObjectManager& operator=(const ObjectManager&);
-
- struct entry_t
- {
- void* object;
- void* cleanupCookie;
- IBinder::object_cleanup_func func;
- };
-
- KeyedVector<const void*, entry_t> mObjects;
- };
-
-protected:
- virtual ~BpBinder();
- virtual void onFirstRef();
- virtual void onLastStrongRef(const void* id);
- virtual bool onIncStrongAttempted(uint32_t flags, const void* id);
-
-private:
- const int32_t mHandle;
-
- struct Obituary {
- wp<DeathRecipient> recipient;
- void* cookie;
- uint32_t flags;
- };
-
- void reportOneDeath(const Obituary& obit);
- bool isDescriptorCached() const;
-
- mutable Mutex mLock;
- volatile int32_t mAlive;
- volatile int32_t mObitsSent;
- Vector<Obituary>* mObituaries;
- ObjectManager mObjects;
- Parcel* mConstantData;
- mutable String16 mDescriptorCache;
-};
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_BPBINDER_H
diff --git a/include/binder/IBinder.h b/include/binder/IBinder.h
deleted file mode 100644
index 81b56c2..0000000
--- a/include/binder/IBinder.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef ANDROID_IBINDER_H
-#define ANDROID_IBINDER_H
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/String16.h>
-#include <utils/Vector.h>
-
-
-#define B_PACK_CHARS(c1, c2, c3, c4) \
- ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4))
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-class BBinder;
-class BpBinder;
-class IInterface;
-class Parcel;
-
-/**
- * Base class and low-level protocol for a remotable object.
- * You can derive from this class to create an object for which other
- * processes can hold references to it. Communication between processes
- * (method calls, property get and set) is down through a low-level
- * protocol implemented on top of the transact() API.
- */
-class IBinder : public virtual RefBase
-{
-public:
- enum {
- FIRST_CALL_TRANSACTION = 0x00000001,
- LAST_CALL_TRANSACTION = 0x00ffffff,
-
- PING_TRANSACTION = B_PACK_CHARS('_','P','N','G'),
- DUMP_TRANSACTION = B_PACK_CHARS('_','D','M','P'),
- INTERFACE_TRANSACTION = B_PACK_CHARS('_', 'N', 'T', 'F'),
-
- // Corresponds to TF_ONE_WAY -- an asynchronous call.
- FLAG_ONEWAY = 0x00000001
- };
-
- IBinder();
-
- /**
- * Check if this IBinder implements the interface named by
- * @a descriptor. If it does, the base pointer to it is returned,
- * which you can safely static_cast<> to the concrete C++ interface.
- */
- virtual sp<IInterface> queryLocalInterface(const String16& descriptor);
-
- /**
- * Return the canonical name of the interface provided by this IBinder
- * object.
- */
- virtual const String16& getInterfaceDescriptor() const = 0;
-
- virtual bool isBinderAlive() const = 0;
- virtual status_t pingBinder() = 0;
- virtual status_t dump(int fd, const Vector<String16>& args) = 0;
-
- virtual status_t transact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0) = 0;
-
- /**
- * This method allows you to add data that is transported through
- * IPC along with your IBinder pointer. When implementing a Binder
- * object, override it to write your desired data in to @a outData.
- * You can then call getConstantData() on your IBinder to retrieve
- * that data, from any process. You MUST return the number of bytes
- * written in to the parcel (including padding).
- */
- class DeathRecipient : public virtual RefBase
- {
- public:
- virtual void binderDied(const wp<IBinder>& who) = 0;
- };
-
- /**
- * Register the @a recipient for a notification if this binder
- * goes away. If this binder object unexpectedly goes away
- * (typically because its hosting process has been killed),
- * then DeathRecipient::binderDied() will be called with a reference
- * to this.
- *
- * The @a cookie is optional -- if non-NULL, it should be a
- * memory address that you own (that is, you know it is unique).
- *
- * @note You will only receive death notifications for remote binders,
- * as local binders by definition can't die without you dying as well.
- * Trying to use this function on a local binder will result in an
- * INVALID_OPERATION code being returned and nothing happening.
- *
- * @note This link always holds a weak reference to its recipient.
- *
- * @note You will only receive a weak reference to the dead
- * binder. You should not try to promote this to a strong reference.
- * (Nor should you need to, as there is nothing useful you can
- * directly do with it now that it has passed on.)
- */
- virtual status_t linkToDeath(const sp<DeathRecipient>& recipient,
- void* cookie = NULL,
- uint32_t flags = 0) = 0;
-
- /**
- * Remove a previously registered death notification.
- * The @a recipient will no longer be called if this object
- * dies. The @a cookie is optional. If non-NULL, you can
- * supply a NULL @a recipient, and the recipient previously
- * added with that cookie will be unlinked.
- */
- virtual status_t unlinkToDeath( const wp<DeathRecipient>& recipient,
- void* cookie = NULL,
- uint32_t flags = 0,
- wp<DeathRecipient>* outRecipient = NULL) = 0;
-
- virtual bool checkSubclass(const void* subclassID) const;
-
- typedef void (*object_cleanup_func)(const void* id, void* obj, void* cleanupCookie);
-
- virtual void attachObject( const void* objectID,
- void* object,
- void* cleanupCookie,
- object_cleanup_func func) = 0;
- virtual void* findObject(const void* objectID) const = 0;
- virtual void detachObject(const void* objectID) = 0;
-
- virtual BBinder* localBinder();
- virtual BpBinder* remoteBinder();
-
-protected:
- virtual ~IBinder();
-
-private:
-};
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_IBINDER_H
diff --git a/include/binder/IInterface.h b/include/binder/IInterface.h
deleted file mode 100644
index 5f9f69c..0000000
--- a/include/binder/IInterface.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-#ifndef ANDROID_IINTERFACE_H
-#define ANDROID_IINTERFACE_H
-
-#include <binder/Binder.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------
-
-class IInterface : public virtual RefBase
-{
-public:
- IInterface();
- sp<IBinder> asBinder();
- sp<const IBinder> asBinder() const;
-
-protected:
- virtual ~IInterface();
- virtual IBinder* onAsBinder() = 0;
-};
-
-// ----------------------------------------------------------------------
-
-template<typename INTERFACE>
-inline sp<INTERFACE> interface_cast(const sp<IBinder>& obj)
-{
- return INTERFACE::asInterface(obj);
-}
-
-// ----------------------------------------------------------------------
-
-template<typename INTERFACE>
-class BnInterface : public INTERFACE, public BBinder
-{
-public:
- virtual sp<IInterface> queryLocalInterface(const String16& _descriptor);
- virtual const String16& getInterfaceDescriptor() const;
-
-protected:
- virtual IBinder* onAsBinder();
-};
-
-// ----------------------------------------------------------------------
-
-template<typename INTERFACE>
-class BpInterface : public INTERFACE, public BpRefBase
-{
-public:
- BpInterface(const sp<IBinder>& remote);
-
-protected:
- virtual IBinder* onAsBinder();
-};
-
-// ----------------------------------------------------------------------
-
-#define DECLARE_META_INTERFACE(INTERFACE) \
- static const android::String16 descriptor; \
- static android::sp<I##INTERFACE> asInterface( \
- const android::sp<android::IBinder>& obj); \
- virtual const android::String16& getInterfaceDescriptor() const; \
- I##INTERFACE(); \
- virtual ~I##INTERFACE(); \
-
-
-#define IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \
- const android::String16 I##INTERFACE::descriptor(NAME); \
- const android::String16& \
- I##INTERFACE::getInterfaceDescriptor() const { \
- return I##INTERFACE::descriptor; \
- } \
- android::sp<I##INTERFACE> I##INTERFACE::asInterface( \
- const android::sp<android::IBinder>& obj) \
- { \
- android::sp<I##INTERFACE> intr; \
- if (obj != NULL) { \
- intr = static_cast<I##INTERFACE*>( \
- obj->queryLocalInterface( \
- I##INTERFACE::descriptor).get()); \
- if (intr == NULL) { \
- intr = new Bp##INTERFACE(obj); \
- } \
- } \
- return intr; \
- } \
- I##INTERFACE::I##INTERFACE() { } \
- I##INTERFACE::~I##INTERFACE() { } \
-
-
-#define CHECK_INTERFACE(interface, data, reply) \
- if (!data.checkInterface(this)) { return PERMISSION_DENIED; } \
-
-
-// ----------------------------------------------------------------------
-// No user-serviceable parts after this...
-
-template<typename INTERFACE>
-inline sp<IInterface> BnInterface<INTERFACE>::queryLocalInterface(
- const String16& _descriptor)
-{
- if (_descriptor == INTERFACE::descriptor) return this;
- return NULL;
-}
-
-template<typename INTERFACE>
-inline const String16& BnInterface<INTERFACE>::getInterfaceDescriptor() const
-{
- return INTERFACE::getInterfaceDescriptor();
-}
-
-template<typename INTERFACE>
-IBinder* BnInterface<INTERFACE>::onAsBinder()
-{
- return this;
-}
-
-template<typename INTERFACE>
-inline BpInterface<INTERFACE>::BpInterface(const sp<IBinder>& remote)
- : BpRefBase(remote)
-{
-}
-
-template<typename INTERFACE>
-inline IBinder* BpInterface<INTERFACE>::onAsBinder()
-{
- return remote();
-}
-
-// ----------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_IINTERFACE_H
diff --git a/include/binder/IMemory.h b/include/binder/IMemory.h
deleted file mode 100644
index 2d0db00..0000000
--- a/include/binder/IMemory.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_IMEMORY_H
-#define ANDROID_IMEMORY_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-
-#include <utils/RefBase.h>
-#include <utils/Errors.h>
-#include <binder/IInterface.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-class IMemoryHeap : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(MemoryHeap);
-
- // flags returned by getFlags()
- enum {
- READ_ONLY = 0x00000001
- };
-
- virtual int getHeapID() const = 0;
- virtual void* getBase() const = 0;
- virtual size_t getSize() const = 0;
- virtual uint32_t getFlags() const = 0;
- virtual uint32_t getOffset() const = 0;
-
- // these are there just for backward source compatibility
- int32_t heapID() const { return getHeapID(); }
- void* base() const { return getBase(); }
- size_t virtualSize() const { return getSize(); }
-};
-
-class BnMemoryHeap : public BnInterface<IMemoryHeap>
-{
-public:
- virtual status_t onTransact(
- uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-
- BnMemoryHeap();
-protected:
- virtual ~BnMemoryHeap();
-};
-
-// ----------------------------------------------------------------------------
-
-class IMemory : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(Memory);
-
- virtual sp<IMemoryHeap> getMemory(ssize_t* offset=0, size_t* size=0) const = 0;
-
- // helpers
- void* fastPointer(const sp<IBinder>& heap, ssize_t offset) const;
- void* pointer() const;
- size_t size() const;
- ssize_t offset() const;
-};
-
-class BnMemory : public BnInterface<IMemory>
-{
-public:
- virtual status_t onTransact(
- uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-
- BnMemory();
-protected:
- virtual ~BnMemory();
-};
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_IMEMORY_H
diff --git a/include/binder/IPCThreadState.h b/include/binder/IPCThreadState.h
deleted file mode 100644
index 691ba2f..0000000
--- a/include/binder/IPCThreadState.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_IPC_THREAD_STATE_H
-#define ANDROID_IPC_THREAD_STATE_H
-
-#include <utils/Errors.h>
-#include <binder/Parcel.h>
-#include <binder/ProcessState.h>
-#include <utils/Vector.h>
-
-#ifdef HAVE_WIN32_PROC
-typedef int uid_t;
-#endif
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-class IPCThreadState
-{
-public:
- static IPCThreadState* self();
- static IPCThreadState* selfOrNull(); // self(), but won't instantiate
-
- sp<ProcessState> process();
-
- status_t clearLastError();
-
- int getCallingPid();
- int getCallingUid();
- int getOrigCallingUid();
-
- void setStrictModePolicy(int32_t policy);
- int32_t getStrictModePolicy() const;
-
- void setLastTransactionBinderFlags(int32_t flags);
- int32_t getLastTransactionBinderFlags() const;
-
- int64_t clearCallingIdentity();
- void restoreCallingIdentity(int64_t token);
-
- void flushCommands();
-
- void joinThreadPool(bool isMain = true);
-
- // Stop the local process.
- void stopProcess(bool immediate = true);
-
- status_t transact(int32_t handle,
- uint32_t code, const Parcel& data,
- Parcel* reply, uint32_t flags);
-
- void incStrongHandle(int32_t handle);
- void decStrongHandle(int32_t handle);
- void incWeakHandle(int32_t handle);
- void decWeakHandle(int32_t handle);
- status_t attemptIncStrongHandle(int32_t handle);
- static void expungeHandle(int32_t handle, IBinder* binder);
- status_t requestDeathNotification( int32_t handle,
- BpBinder* proxy);
- status_t clearDeathNotification( int32_t handle,
- BpBinder* proxy);
-
- static void shutdown();
-
- // Call this to disable switching threads to background scheduling when
- // receiving incoming IPC calls. This is specifically here for the
- // Android system process, since it expects to have background apps calling
- // in to it but doesn't want to acquire locks in its services while in
- // the background.
- static void disableBackgroundScheduling(bool disable);
-
-private:
- IPCThreadState();
- ~IPCThreadState();
-
- status_t sendReply(const Parcel& reply, uint32_t flags);
- status_t waitForResponse(Parcel *reply,
- status_t *acquireResult=NULL);
- status_t talkWithDriver(bool doReceive=true);
- status_t writeTransactionData(int32_t cmd,
- uint32_t binderFlags,
- int32_t handle,
- uint32_t code,
- const Parcel& data,
- status_t* statusBuffer);
- status_t executeCommand(int32_t command);
-
- void clearCaller();
-
- static void threadDestructor(void *st);
- static void freeBuffer(Parcel* parcel,
- const uint8_t* data, size_t dataSize,
- const size_t* objects, size_t objectsSize,
- void* cookie);
-
- const sp<ProcessState> mProcess;
- const pid_t mMyThreadId;
- Vector<BBinder*> mPendingStrongDerefs;
- Vector<RefBase::weakref_type*> mPendingWeakDerefs;
-
- Parcel mIn;
- Parcel mOut;
- status_t mLastError;
- pid_t mCallingPid;
- uid_t mCallingUid;
- uid_t mOrigCallingUid;
- int32_t mStrictModePolicy;
- int32_t mLastTransactionBinderFlags;
-};
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_IPC_THREAD_STATE_H
diff --git a/include/binder/IPermissionController.h b/include/binder/IPermissionController.h
deleted file mode 100644
index f9d371b..0000000
--- a/include/binder/IPermissionController.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-#ifndef ANDROID_IPERMISSION_CONTROLLER_H
-#define ANDROID_IPERMISSION_CONTROLLER_H
-
-#include <binder/IInterface.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------
-
-class IPermissionController : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(PermissionController);
-
- virtual bool checkPermission(const String16& permission,
- int32_t pid, int32_t uid) = 0;
-
- enum {
- CHECK_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION
- };
-};
-
-// ----------------------------------------------------------------------
-
-class BnPermissionController : public BnInterface<IPermissionController>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_IPERMISSION_CONTROLLER_H
-
diff --git a/include/binder/IServiceManager.h b/include/binder/IServiceManager.h
deleted file mode 100644
index 2c297d6..0000000
--- a/include/binder/IServiceManager.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-#ifndef ANDROID_ISERVICE_MANAGER_H
-#define ANDROID_ISERVICE_MANAGER_H
-
-#include <binder/IInterface.h>
-#include <binder/IPermissionController.h>
-#include <utils/Vector.h>
-#include <utils/String16.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------
-
-class IServiceManager : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(ServiceManager);
-
- /**
- * Retrieve an existing service, blocking for a few seconds
- * if it doesn't yet exist.
- */
- virtual sp<IBinder> getService( const String16& name) const = 0;
-
- /**
- * Retrieve an existing service, non-blocking.
- */
- virtual sp<IBinder> checkService( const String16& name) const = 0;
-
- /**
- * Register a service.
- */
- virtual status_t addService( const String16& name,
- const sp<IBinder>& service,
- bool allowIsolated = false) = 0;
-
- /**
- * Return list of all existing services.
- */
- virtual Vector<String16> listServices() = 0;
-
- enum {
- GET_SERVICE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
- CHECK_SERVICE_TRANSACTION,
- ADD_SERVICE_TRANSACTION,
- LIST_SERVICES_TRANSACTION,
- };
-};
-
-sp<IServiceManager> defaultServiceManager();
-
-template<typename INTERFACE>
-status_t getService(const String16& name, sp<INTERFACE>* outService)
-{
- const sp<IServiceManager> sm = defaultServiceManager();
- if (sm != NULL) {
- *outService = interface_cast<INTERFACE>(sm->getService(name));
- if ((*outService) != NULL) return NO_ERROR;
- }
- return NAME_NOT_FOUND;
-}
-
-bool checkCallingPermission(const String16& permission);
-bool checkCallingPermission(const String16& permission,
- int32_t* outPid, int32_t* outUid);
-bool checkPermission(const String16& permission, pid_t pid, uid_t uid);
-
-
-// ----------------------------------------------------------------------
-
-class BnServiceManager : public BnInterface<IServiceManager>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_ISERVICE_MANAGER_H
-
diff --git a/include/binder/MemoryBase.h b/include/binder/MemoryBase.h
deleted file mode 100644
index 463e26d..0000000
--- a/include/binder/MemoryBase.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef ANDROID_MEMORY_BASE_H
-#define ANDROID_MEMORY_BASE_H
-
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <binder/IMemory.h>
-
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class MemoryBase : public BnMemory
-{
-public:
- MemoryBase(const sp<IMemoryHeap>& heap, ssize_t offset, size_t size);
- virtual ~MemoryBase();
- virtual sp<IMemoryHeap> getMemory(ssize_t* offset, size_t* size) const;
-
-protected:
- size_t getSize() const { return mSize; }
- ssize_t getOffset() const { return mOffset; }
- const sp<IMemoryHeap>& getHeap() const { return mHeap; }
-
-private:
- size_t mSize;
- ssize_t mOffset;
- sp<IMemoryHeap> mHeap;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_MEMORY_BASE_H
diff --git a/include/binder/MemoryDealer.h b/include/binder/MemoryDealer.h
deleted file mode 100644
index 170f20d..0000000
--- a/include/binder/MemoryDealer.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_MEMORY_DEALER_H
-#define ANDROID_MEMORY_DEALER_H
-
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <binder/IMemory.h>
-#include <binder/MemoryHeapBase.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-class SimpleBestFitAllocator;
-
-// ----------------------------------------------------------------------------
-
-class MemoryDealer : public RefBase
-{
-public:
- MemoryDealer(size_t size, const char* name = 0);
-
- virtual sp<IMemory> allocate(size_t size);
- virtual void deallocate(size_t offset);
- virtual void dump(const char* what) const;
-
- sp<IMemoryHeap> getMemoryHeap() const { return heap(); }
-
-protected:
- virtual ~MemoryDealer();
-
-private:
- const sp<IMemoryHeap>& heap() const;
- SimpleBestFitAllocator* allocator() const;
-
- sp<IMemoryHeap> mHeap;
- SimpleBestFitAllocator* mAllocator;
-};
-
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_MEMORY_DEALER_H
diff --git a/include/binder/MemoryHeapBase.h b/include/binder/MemoryHeapBase.h
deleted file mode 100644
index bbbda9c..0000000
--- a/include/binder/MemoryHeapBase.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef ANDROID_MEMORY_HEAP_BASE_H
-#define ANDROID_MEMORY_HEAP_BASE_H
-
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <binder/IMemory.h>
-
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class MemoryHeapBase : public virtual BnMemoryHeap
-{
-public:
- enum {
- READ_ONLY = IMemoryHeap::READ_ONLY,
- // memory won't be mapped locally, but will be mapped in the remote
- // process.
- DONT_MAP_LOCALLY = 0x00000100,
- NO_CACHING = 0x00000200
- };
-
- /*
- * maps the memory referenced by fd. but DOESN'T take ownership
- * of the filedescriptor (it makes a copy with dup()
- */
- MemoryHeapBase(int fd, size_t size, uint32_t flags = 0, uint32_t offset = 0);
-
- /*
- * maps memory from the given device
- */
- MemoryHeapBase(const char* device, size_t size = 0, uint32_t flags = 0);
-
- /*
- * maps memory from ashmem, with the given name for debugging
- */
- MemoryHeapBase(size_t size, uint32_t flags = 0, char const* name = NULL);
-
- virtual ~MemoryHeapBase();
-
- /* implement IMemoryHeap interface */
- virtual int getHeapID() const;
- virtual void* getBase() const;
- virtual size_t getSize() const;
- virtual uint32_t getFlags() const;
- virtual uint32_t getOffset() const;
-
- const char* getDevice() const;
-
- /* this closes this heap -- use carefully */
- void dispose();
-
- /* this is only needed as a workaround, use only if you know
- * what you are doing */
- status_t setDevice(const char* device) {
- if (mDevice == 0)
- mDevice = device;
- return mDevice ? NO_ERROR : ALREADY_EXISTS;
- }
-
-protected:
- MemoryHeapBase();
- // init() takes ownership of fd
- status_t init(int fd, void *base, int size,
- int flags = 0, const char* device = NULL);
-
-private:
- status_t mapfd(int fd, size_t size, uint32_t offset = 0);
-
- int mFD;
- size_t mSize;
- void* mBase;
- uint32_t mFlags;
- const char* mDevice;
- bool mNeedUnmap;
- uint32_t mOffset;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_MEMORY_HEAP_BASE_H
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h
deleted file mode 100644
index 33b2f00..0000000
--- a/include/binder/Parcel.h
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_PARCEL_H
-#define ANDROID_PARCEL_H
-
-#include <cutils/native_handle.h>
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/String16.h>
-#include <utils/Vector.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-class Flattenable;
-class IBinder;
-class IPCThreadState;
-class ProcessState;
-class String8;
-class TextOutput;
-
-struct flat_binder_object; // defined in support_p/binder_module.h
-
-class Parcel
-{
-public:
- class ReadableBlob;
- class WritableBlob;
-
- Parcel();
- ~Parcel();
-
- const uint8_t* data() const;
- size_t dataSize() const;
- size_t dataAvail() const;
- size_t dataPosition() const;
- size_t dataCapacity() const;
-
- status_t setDataSize(size_t size);
- void setDataPosition(size_t pos) const;
- status_t setDataCapacity(size_t size);
-
- status_t setData(const uint8_t* buffer, size_t len);
-
- status_t appendFrom(const Parcel *parcel,
- size_t start, size_t len);
-
- bool pushAllowFds(bool allowFds);
- void restoreAllowFds(bool lastValue);
-
- bool hasFileDescriptors() const;
-
- // Writes the RPC header.
- status_t writeInterfaceToken(const String16& interface);
-
- // Parses the RPC header, returning true if the interface name
- // in the header matches the expected interface from the caller.
- //
- // Additionally, enforceInterface does part of the work of
- // propagating the StrictMode policy mask, populating the current
- // IPCThreadState, which as an optimization may optionally be
- // passed in.
- bool enforceInterface(const String16& interface,
- IPCThreadState* threadState = NULL) const;
- bool checkInterface(IBinder*) const;
-
- void freeData();
-
- const size_t* objects() const;
- size_t objectsCount() const;
-
- status_t errorCheck() const;
- void setError(status_t err);
-
- status_t write(const void* data, size_t len);
- void* writeInplace(size_t len);
- status_t writeUnpadded(const void* data, size_t len);
- status_t writeInt32(int32_t val);
- status_t writeInt64(int64_t val);
- status_t writeFloat(float val);
- status_t writeDouble(double val);
- status_t writeIntPtr(intptr_t val);
- status_t writeCString(const char* str);
- status_t writeString8(const String8& str);
- status_t writeString16(const String16& str);
- status_t writeString16(const char16_t* str, size_t len);
- status_t writeStrongBinder(const sp<IBinder>& val);
- status_t writeWeakBinder(const wp<IBinder>& val);
- status_t write(const Flattenable& val);
-
- // Place a native_handle into the parcel (the native_handle's file-
- // descriptors are dup'ed, so it is safe to delete the native_handle
- // when this function returns).
- // Doesn't take ownership of the native_handle.
- status_t writeNativeHandle(const native_handle* handle);
-
- // Place a file descriptor into the parcel. The given fd must remain
- // valid for the lifetime of the parcel.
- // The Parcel does not take ownership of the given fd unless you ask it to.
- status_t writeFileDescriptor(int fd, bool takeOwnership = false);
-
- // Place a file descriptor into the parcel. A dup of the fd is made, which
- // will be closed once the parcel is destroyed.
- status_t writeDupFileDescriptor(int fd);
-
- // Writes a blob to the parcel.
- // If the blob is small, then it is stored in-place, otherwise it is
- // transferred by way of an anonymous shared memory region.
- // The caller should call release() on the blob after writing its contents.
- status_t writeBlob(size_t len, WritableBlob* outBlob);
-
- status_t writeObject(const flat_binder_object& val, bool nullMetaData);
-
- // Like Parcel.java's writeNoException(). Just writes a zero int32.
- // Currently the native implementation doesn't do any of the StrictMode
- // stack gathering and serialization that the Java implementation does.
- status_t writeNoException();
-
- void remove(size_t start, size_t amt);
-
- status_t read(void* outData, size_t len) const;
- const void* readInplace(size_t len) const;
- int32_t readInt32() const;
- status_t readInt32(int32_t *pArg) const;
- int64_t readInt64() const;
- status_t readInt64(int64_t *pArg) const;
- float readFloat() const;
- status_t readFloat(float *pArg) const;
- double readDouble() const;
- status_t readDouble(double *pArg) const;
- intptr_t readIntPtr() const;
- status_t readIntPtr(intptr_t *pArg) const;
-
- const char* readCString() const;
- String8 readString8() const;
- String16 readString16() const;
- const char16_t* readString16Inplace(size_t* outLen) const;
- sp<IBinder> readStrongBinder() const;
- wp<IBinder> readWeakBinder() const;
- status_t read(Flattenable& val) const;
-
- // Like Parcel.java's readExceptionCode(). Reads the first int32
- // off of a Parcel's header, returning 0 or the negative error
- // code on exceptions, but also deals with skipping over rich
- // response headers. Callers should use this to read & parse the
- // response headers rather than doing it by hand.
- int32_t readExceptionCode() const;
-
- // Retrieve native_handle from the parcel. This returns a copy of the
- // parcel's native_handle (the caller takes ownership). The caller
- // must free the native_handle with native_handle_close() and
- // native_handle_delete().
- native_handle* readNativeHandle() const;
-
-
- // Retrieve a file descriptor from the parcel. This returns the raw fd
- // in the parcel, which you do not own -- use dup() to get your own copy.
- int readFileDescriptor() const;
-
- // Reads a blob from the parcel.
- // The caller should call release() on the blob after reading its contents.
- status_t readBlob(size_t len, ReadableBlob* outBlob) const;
-
- const flat_binder_object* readObject(bool nullMetaData) const;
-
- // Explicitly close all file descriptors in the parcel.
- void closeFileDescriptors();
-
- typedef void (*release_func)(Parcel* parcel,
- const uint8_t* data, size_t dataSize,
- const size_t* objects, size_t objectsSize,
- void* cookie);
-
- const uint8_t* ipcData() const;
- size_t ipcDataSize() const;
- const size_t* ipcObjects() const;
- size_t ipcObjectsCount() const;
- void ipcSetDataReference(const uint8_t* data, size_t dataSize,
- const size_t* objects, size_t objectsCount,
- release_func relFunc, void* relCookie);
-
- void print(TextOutput& to, uint32_t flags = 0) const;
-
-private:
- Parcel(const Parcel& o);
- Parcel& operator=(const Parcel& o);
-
- status_t finishWrite(size_t len);
- void releaseObjects();
- void acquireObjects();
- status_t growData(size_t len);
- status_t restartWrite(size_t desired);
- status_t continueWrite(size_t desired);
- void freeDataNoInit();
- void initState();
- void scanForFds() const;
-
- template<class T>
- status_t readAligned(T *pArg) const;
-
- template<class T> T readAligned() const;
-
- template<class T>
- status_t writeAligned(T val);
-
- status_t mError;
- uint8_t* mData;
- size_t mDataSize;
- size_t mDataCapacity;
- mutable size_t mDataPos;
- size_t* mObjects;
- size_t mObjectsSize;
- size_t mObjectsCapacity;
- mutable size_t mNextObjectHint;
-
- mutable bool mFdsKnown;
- mutable bool mHasFds;
- bool mAllowFds;
-
- release_func mOwner;
- void* mOwnerCookie;
-
- class Blob {
- public:
- Blob();
- ~Blob();
-
- void release();
- inline size_t size() const { return mSize; }
-
- protected:
- void init(bool mapped, void* data, size_t size);
- void clear();
-
- bool mMapped;
- void* mData;
- size_t mSize;
- };
-
-public:
- class ReadableBlob : public Blob {
- friend class Parcel;
- public:
- inline const void* data() const { return mData; }
- };
-
- class WritableBlob : public Blob {
- friend class Parcel;
- public:
- inline void* data() { return mData; }
- };
-};
-
-// ---------------------------------------------------------------------------
-
-inline TextOutput& operator<<(TextOutput& to, const Parcel& parcel)
-{
- parcel.print(to);
- return to;
-}
-
-// ---------------------------------------------------------------------------
-
-// Generic acquire and release of objects.
-void acquire_object(const sp<ProcessState>& proc,
- const flat_binder_object& obj, const void* who);
-void release_object(const sp<ProcessState>& proc,
- const flat_binder_object& obj, const void* who);
-
-void flatten_binder(const sp<ProcessState>& proc,
- const sp<IBinder>& binder, flat_binder_object* out);
-void flatten_binder(const sp<ProcessState>& proc,
- const wp<IBinder>& binder, flat_binder_object* out);
-status_t unflatten_binder(const sp<ProcessState>& proc,
- const flat_binder_object& flat, sp<IBinder>* out);
-status_t unflatten_binder(const sp<ProcessState>& proc,
- const flat_binder_object& flat, wp<IBinder>* out);
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_PARCEL_H
diff --git a/include/binder/PermissionCache.h b/include/binder/PermissionCache.h
deleted file mode 100644
index 1171d48..0000000
--- a/include/binder/PermissionCache.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#ifndef BINDER_PERMISSION_H
-#define BINDER_PERMISSION_H
-
-#include <stdint.h>
-#include <unistd.h>
-
-#include <utils/String16.h>
-#include <utils/Singleton.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-/*
- * PermissionCache caches permission checks for a given uid.
- *
- * Currently the cache is not updated when there is a permission change,
- * for instance when an application is uninstalled.
- *
- * IMPORTANT: for the reason stated above, only system permissions are safe
- * to cache. This restriction may be lifted at a later time.
- *
- */
-
-class PermissionCache : Singleton<PermissionCache> {
- struct Entry {
- String16 name;
- uid_t uid;
- bool granted;
- inline bool operator < (const Entry& e) const {
- return (uid == e.uid) ? (name < e.name) : (uid < e.uid);
- }
- };
- mutable Mutex mLock;
- // we pool all the permission names we see, as many permissions checks
- // will have identical names
- SortedVector< String16 > mPermissionNamesPool;
- // this is our cache per say. it stores pooled names.
- SortedVector< Entry > mCache;
-
- // free the whole cache, but keep the permission name pool
- void purge();
-
- status_t check(bool* granted,
- const String16& permission, uid_t uid) const;
-
- void cache(const String16& permission, uid_t uid, bool granted);
-
-public:
- PermissionCache();
-
- static bool checkCallingPermission(const String16& permission);
-
- static bool checkCallingPermission(const String16& permission,
- int32_t* outPid, int32_t* outUid);
-
- static bool checkPermission(const String16& permission,
- pid_t pid, uid_t uid);
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif /* BINDER_PERMISSION_H */
diff --git a/include/binder/ProcessState.h b/include/binder/ProcessState.h
deleted file mode 100644
index 9725822..0000000
--- a/include/binder/ProcessState.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_PROCESS_STATE_H
-#define ANDROID_PROCESS_STATE_H
-
-#include <binder/IBinder.h>
-#include <utils/KeyedVector.h>
-#include <utils/String8.h>
-#include <utils/String16.h>
-
-#include <utils/threads.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-// Global variables
-extern int mArgC;
-extern const char* const* mArgV;
-extern int mArgLen;
-
-class IPCThreadState;
-
-class ProcessState : public virtual RefBase
-{
-public:
- static sp<ProcessState> self();
-
- void setContextObject(const sp<IBinder>& object);
- sp<IBinder> getContextObject(const sp<IBinder>& caller);
-
- void setContextObject(const sp<IBinder>& object,
- const String16& name);
- sp<IBinder> getContextObject(const String16& name,
- const sp<IBinder>& caller);
-
- void startThreadPool();
-
- typedef bool (*context_check_func)(const String16& name,
- const sp<IBinder>& caller,
- void* userData);
-
- bool isContextManager(void) const;
- bool becomeContextManager(
- context_check_func checkFunc,
- void* userData);
-
- sp<IBinder> getStrongProxyForHandle(int32_t handle);
- wp<IBinder> getWeakProxyForHandle(int32_t handle);
- void expungeHandle(int32_t handle, IBinder* binder);
-
- void setArgs(int argc, const char* const argv[]);
- int getArgC() const;
- const char* const* getArgV() const;
-
- void setArgV0(const char* txt);
-
- void spawnPooledThread(bool isMain);
-
-private:
- friend class IPCThreadState;
-
- ProcessState();
- ~ProcessState();
-
- ProcessState(const ProcessState& o);
- ProcessState& operator=(const ProcessState& o);
-
- struct handle_entry {
- IBinder* binder;
- RefBase::weakref_type* refs;
- };
-
- handle_entry* lookupHandleLocked(int32_t handle);
-
- int mDriverFD;
- void* mVMStart;
-
- mutable Mutex mLock; // protects everything below.
-
- Vector<handle_entry>mHandleToObject;
-
- bool mManagesContexts;
- context_check_func mBinderContextCheckFunc;
- void* mBinderContextUserData;
-
- KeyedVector<String16, sp<IBinder> >
- mContexts;
-
-
- String8 mRootDir;
- bool mThreadPoolStarted;
- volatile int32_t mThreadPoolSeq;
-};
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_PROCESS_STATE_H
diff --git a/include/gui/BitTube.h b/include/gui/BitTube.h
deleted file mode 100644
index 76389a0..0000000
--- a/include/gui/BitTube.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_GUI_SENSOR_CHANNEL_H
-#define ANDROID_GUI_SENSOR_CHANNEL_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-
-
-namespace android {
-// ----------------------------------------------------------------------------
-class Parcel;
-
-class BitTube : public RefBase
-{
-public:
-
- BitTube();
- BitTube(const Parcel& data);
- virtual ~BitTube();
-
- status_t initCheck() const;
- int getFd() const;
- ssize_t write(void const* vaddr, size_t size);
- ssize_t read(void* vaddr, size_t size);
-
- status_t writeToParcel(Parcel* reply) const;
-
-private:
- int mSendFd;
- mutable int mReceiveFd;
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_SENSOR_CHANNEL_H
diff --git a/include/gui/BufferQueue.h b/include/gui/BufferQueue.h
deleted file mode 100644
index 8c21a28..0000000
--- a/include/gui/BufferQueue.h
+++ /dev/null
@@ -1,426 +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.
- */
-
-#ifndef ANDROID_GUI_BUFFERQUEUE_H
-#define ANDROID_GUI_BUFFERQUEUE_H
-
-#include <EGL/egl.h>
-
-#include <gui/IGraphicBufferAlloc.h>
-#include <gui/ISurfaceTexture.h>
-
-#include <ui/GraphicBuffer.h>
-
-#include <utils/String8.h>
-#include <utils/Vector.h>
-#include <utils/threads.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-class BufferQueue : public BnSurfaceTexture {
-public:
- enum { MIN_UNDEQUEUED_BUFFERS = 2 };
- enum {
- MIN_ASYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS + 1,
- MIN_SYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS
- };
- enum { NUM_BUFFER_SLOTS = 32 };
- enum { NO_CONNECTED_API = 0 };
- enum { INVALID_BUFFER_SLOT = -1 };
-
- struct FrameAvailableListener : public virtual RefBase {
- // onFrameAvailable() is called from queueBuffer() each time an
- // additional frame becomes available for consumption. This means that
- // frames that are queued while in asynchronous mode only trigger the
- // callback if no previous frames are pending. Frames queued while in
- // synchronous mode always trigger the callback.
- //
- // This is called without any lock held and can be called concurrently
- // by multiple threads.
- virtual void onFrameAvailable() = 0;
- };
-
- // BufferQueue manages a pool of gralloc memory slots to be used
- // by producers and consumers.
- // allowSynchronousMode specifies whether or not synchronous mode can be
- // enabled.
- BufferQueue(bool allowSynchronousMode = true);
- virtual ~BufferQueue();
-
- virtual int query(int what, int* value);
-
- // setBufferCount updates the number of available buffer slots. After
- // calling this all buffer slots are both unallocated and owned by the
- // BufferQueue object (i.e. they are not owned by the client).
- virtual status_t setBufferCount(int bufferCount);
-
- virtual status_t requestBuffer(int slot, sp<GraphicBuffer>* buf);
-
- // dequeueBuffer gets the next buffer slot index for the client to use. If a
- // buffer slot is available then that slot index is written to the location
- // pointed to by the buf argument and a status of OK is returned. If no
- // slot is available then a status of -EBUSY is returned and buf is
- // unmodified.
- // The width and height parameters must be no greater than the minimum of
- // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
- // An error due to invalid dimensions might not be reported until
- // updateTexImage() is called.
- virtual status_t dequeueBuffer(int *buf, uint32_t width, uint32_t height,
- uint32_t format, uint32_t usage);
-
- // queueBuffer returns a filled buffer to the BufferQueue. In addition, a
- // timestamp must be provided for the buffer. The timestamp is in
- // nanoseconds, and must be monotonically increasing. Its other semantics
- // (zero point, etc) are client-dependent and should be documented by the
- // client.
- virtual status_t queueBuffer(int buf, int64_t timestamp,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform);
- virtual void cancelBuffer(int buf);
- virtual status_t setCrop(const Rect& reg);
- virtual status_t setTransform(uint32_t transform);
- virtual status_t setScalingMode(int mode);
-
- // setSynchronousMode set whether dequeueBuffer is synchronous or
- // asynchronous. In synchronous mode, dequeueBuffer blocks until
- // a buffer is available, the currently bound buffer can be dequeued and
- // queued buffers will be retired in order.
- // The default mode is asynchronous.
- virtual status_t setSynchronousMode(bool enabled);
-
- // connect attempts to connect a producer client API to the BufferQueue.
- // This must be called before any other ISurfaceTexture methods are called
- // except for getAllocator.
- //
- // This method will fail if the connect was previously called on the
- // BufferQueue and no corresponding disconnect call was made.
- virtual status_t connect(int api,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform);
-
- // disconnect attempts to disconnect a producer client API from the
- // BufferQueue. Calling this method will cause any subsequent calls to other
- // ISurfaceTexture methods to fail except for getAllocator and connect.
- // Successfully calling connect after this will allow the other methods to
- // succeed again.
- //
- // This method will fail if the the BufferQueue is not currently
- // connected to the specified client API.
- virtual status_t disconnect(int api);
-
- // dump our state in a String
- virtual void dump(String8& result) const;
- virtual void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const;
-
- // public facing structure for BufferSlot
- struct BufferItem {
-
- BufferItem()
- :
- mTransform(0),
- mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
- mTimestamp(0),
- mFrameNumber(0),
- mBuf(INVALID_BUFFER_SLOT) {
- mCrop.makeInvalid();
- }
- // mGraphicBuffer points to the buffer allocated for this slot or is NULL
- // if no buffer has been allocated.
- sp<GraphicBuffer> mGraphicBuffer;
-
- // mCrop is the current crop rectangle for this buffer slot. This gets
- // set to mNextCrop each time queueBuffer gets called for this buffer.
- Rect mCrop;
-
- // mTransform is the current transform flags for this buffer slot. This
- // gets set to mNextTransform each time queueBuffer gets called for this
- // slot.
- uint32_t mTransform;
-
- // mScalingMode is the current scaling mode for this buffer slot. This
- // gets set to mNextScalingMode each time queueBuffer gets called for
- // this slot.
- uint32_t mScalingMode;
-
- // mTimestamp is the current timestamp for this buffer slot. This gets
- // to set by queueBuffer each time this slot is queued.
- int64_t mTimestamp;
-
- // mFrameNumber is the number of the queued frame for this slot.
- uint64_t mFrameNumber;
-
- // buf is the slot index of this buffer
- int mBuf;
-
- };
-
- // The following public functions is the consumer facing interface
-
- // acquire consumes a buffer by transferring its ownership to a consumer.
- // buffer contains the GraphicBuffer and its corresponding information.
- // buffer.mGraphicsBuffer will be NULL when the buffer has been already
- // acquired by the consumer.
-
- status_t acquire(BufferItem *buffer);
-
- // releaseBuffer releases a buffer slot from the consumer back to the
- // BufferQueue pending a fence sync.
- status_t releaseBuffer(int buf, EGLDisplay display, EGLSyncKHR fence);
-
- // consumerDisconnect disconnects a consumer from the BufferQueue. All
- // buffers will be freed.
- status_t consumerDisconnect();
-
- // setDefaultBufferSize is used to set the size of buffers returned by
- // requestBuffers when a with and height of zero is requested.
- status_t setDefaultBufferSize(uint32_t w, uint32_t h);
-
- // setBufferCountServer set the buffer count. If the client has requested
- // a buffer count using setBufferCount, the server-buffer count will
- // take effect once the client sets the count back to zero.
- status_t setBufferCountServer(int bufferCount);
-
- // isSynchronousMode returns whether the SurfaceTexture is currently in
- // synchronous mode.
- bool isSynchronousMode() const;
-
- // setConsumerName sets the name used in logging
- void setConsumerName(const String8& name);
-
- // setFrameAvailableListener sets the listener object that will be notified
- // when a new frame becomes available.
- void setFrameAvailableListener(const sp<FrameAvailableListener>& listener);
-
-
-private:
- // freeBufferLocked frees the resources (both GraphicBuffer and EGLImage)
- // for the given slot.
- void freeBufferLocked(int index);
-
- // freeAllBuffersLocked frees the resources (both GraphicBuffer and
- // EGLImage) for all slots.
- void freeAllBuffersLocked();
-
- // freeAllBuffersExceptHeadLocked frees the resources (both GraphicBuffer
- // and EGLImage) for all slots except the head of mQueue
- void freeAllBuffersExceptHeadLocked();
-
- // drainQueueLocked drains the buffer queue if we're in synchronous mode
- // returns immediately otherwise. It returns NO_INIT if the BufferQueue
- // became abandoned or disconnected during this call.
- status_t drainQueueLocked();
-
- // drainQueueAndFreeBuffersLocked drains the buffer queue if we're in
- // synchronous mode and free all buffers. In asynchronous mode, all buffers
- // are freed except the current buffer.
- status_t drainQueueAndFreeBuffersLocked();
-
- status_t setBufferCountServerLocked(int bufferCount);
-
- struct BufferSlot {
-
- BufferSlot()
- : mEglDisplay(EGL_NO_DISPLAY),
- mBufferState(BufferSlot::FREE),
- mRequestBufferCalled(false),
- mTransform(0),
- mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
- mTimestamp(0),
- mFrameNumber(0),
- mFence(EGL_NO_SYNC_KHR),
- mAcquireCalled(false) {
- mCrop.makeInvalid();
- }
-
- // mGraphicBuffer points to the buffer allocated for this slot or is NULL
- // if no buffer has been allocated.
- sp<GraphicBuffer> mGraphicBuffer;
-
- // mEglDisplay is the EGLDisplay used to create mEglImage.
- EGLDisplay mEglDisplay;
-
- // BufferState represents the different states in which a buffer slot
- // can be.
- enum BufferState {
- // FREE indicates that the buffer is not currently being used and
- // will not be used in the future until it gets dequeued and
- // subsequently queued by the client.
- // aka "owned by BufferQueue, ready to be dequeued"
- FREE = 0,
-
- // DEQUEUED indicates that the buffer has been dequeued by the
- // client, but has not yet been queued or canceled. The buffer is
- // considered 'owned' by the client, and the server should not use
- // it for anything.
- //
- // Note that when in synchronous-mode (mSynchronousMode == true),
- // the buffer that's currently attached to the texture may be
- // dequeued by the client. That means that the current buffer can
- // be in either the DEQUEUED or QUEUED state. In asynchronous mode,
- // however, the current buffer is always in the QUEUED state.
- // aka "owned by producer, ready to be queued"
- DEQUEUED = 1,
-
- // QUEUED indicates that the buffer has been queued by the client,
- // and has not since been made available for the client to dequeue.
- // Attaching the buffer to the texture does NOT transition the
- // buffer away from the QUEUED state. However, in Synchronous mode
- // the current buffer may be dequeued by the client under some
- // circumstances. See the note about the current buffer in the
- // documentation for DEQUEUED.
- // aka "owned by BufferQueue, ready to be acquired"
- QUEUED = 2,
-
- // aka "owned by consumer, ready to be released"
- ACQUIRED = 3
- };
-
- // mBufferState is the current state of this buffer slot.
- BufferState mBufferState;
-
- // mRequestBufferCalled is used for validating that the client did
- // call requestBuffer() when told to do so. Technically this is not
- // needed but useful for debugging and catching client bugs.
- bool mRequestBufferCalled;
-
- // mCrop is the current crop rectangle for this buffer slot. This gets
- // set to mNextCrop each time queueBuffer gets called for this buffer.
- Rect mCrop;
-
- // mTransform is the current transform flags for this buffer slot. This
- // gets set to mNextTransform each time queueBuffer gets called for this
- // slot.
- uint32_t mTransform;
-
- // mScalingMode is the current scaling mode for this buffer slot. This
- // gets set to mNextScalingMode each time queueBuffer gets called for
- // this slot.
- uint32_t mScalingMode;
-
- // mTimestamp is the current timestamp for this buffer slot. This gets
- // to set by queueBuffer each time this slot is queued.
- int64_t mTimestamp;
-
- // mFrameNumber is the number of the queued frame for this slot.
- uint64_t mFrameNumber;
-
- // mFence is the EGL sync object that must signal before the buffer
- // associated with this buffer slot may be dequeued. It is initialized
- // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based
- // on a compile-time option) set to a new sync object in updateTexImage.
- EGLSyncKHR mFence;
-
- // Indicates whether this buffer has been seen by a consumer yet
- bool mAcquireCalled;
- };
-
- // mSlots is the array of buffer slots that must be mirrored on the client
- // side. This allows buffer ownership to be transferred between the client
- // and server without sending a GraphicBuffer over binder. The entire array
- // is initialized to NULL at construction time, and buffers are allocated
- // for a slot when requestBuffer is called with that slot's index.
- BufferSlot mSlots[NUM_BUFFER_SLOTS];
-
- // mDefaultWidth holds the default width of allocated buffers. It is used
- // in requestBuffers() if a width and height of zero is specified.
- uint32_t mDefaultWidth;
-
- // mDefaultHeight holds the default height of allocated buffers. It is used
- // in requestBuffers() if a width and height of zero is specified.
- uint32_t mDefaultHeight;
-
- // mPixelFormat holds the pixel format of allocated buffers. It is used
- // in requestBuffers() if a format of zero is specified.
- uint32_t mPixelFormat;
-
- // mBufferCount is the number of buffer slots that the client and server
- // must maintain. It defaults to MIN_ASYNC_BUFFER_SLOTS and can be changed
- // by calling setBufferCount or setBufferCountServer
- int mBufferCount;
-
- // mClientBufferCount is the number of buffer slots requested by the client.
- // The default is zero, which means the client doesn't care how many buffers
- // there is.
- int mClientBufferCount;
-
- // mServerBufferCount buffer count requested by the server-side
- int mServerBufferCount;
-
- // mNextCrop is the crop rectangle that will be used for the next buffer
- // that gets queued. It is set by calling setCrop.
- Rect mNextCrop;
-
- // mNextTransform is the transform identifier that will be used for the next
- // buffer that gets queued. It is set by calling setTransform.
- uint32_t mNextTransform;
-
- // mNextScalingMode is the scaling mode that will be used for the next
- // buffers that get queued. It is set by calling setScalingMode.
- int mNextScalingMode;
-
- // mGraphicBufferAlloc is the connection to SurfaceFlinger that is used to
- // allocate new GraphicBuffer objects.
- sp<IGraphicBufferAlloc> mGraphicBufferAlloc;
-
- // mFrameAvailableListener is the listener object that will be called when a
- // new frame becomes available. If it is not NULL it will be called from
- // queueBuffer.
- sp<FrameAvailableListener> mFrameAvailableListener;
-
- // mSynchronousMode whether we're in synchronous mode or not
- bool mSynchronousMode;
-
- // mAllowSynchronousMode whether we allow synchronous mode or not
- const bool mAllowSynchronousMode;
-
- // mConnectedApi indicates the API that is currently connected to this
- // BufferQueue. It defaults to NO_CONNECTED_API (= 0), and gets updated
- // by the connect and disconnect methods.
- int mConnectedApi;
-
- // mDequeueCondition condition used for dequeueBuffer in synchronous mode
- mutable Condition mDequeueCondition;
-
- // mQueue is a FIFO of queued buffers used in synchronous mode
- typedef Vector<int> Fifo;
- Fifo mQueue;
-
- // mAbandoned indicates that the BufferQueue will no longer be used to
- // consume images buffers pushed to it using the ISurfaceTexture interface.
- // It is initialized to false, and set to true in the abandon method. A
- // BufferQueue that has been abandoned will return the NO_INIT error from
- // all ISurfaceTexture methods capable of returning an error.
- bool mAbandoned;
-
- // mName is a string used to identify the BufferQueue in log messages.
- // It is set by the setName method.
- String8 mConsumerName;
-
- // mMutex is the mutex used to prevent concurrent access to the member
- // variables of BufferQueue objects. It must be locked whenever the
- // member variables are accessed.
- mutable Mutex mMutex;
-
- // mFrameCounter is the free running counter, incremented for every buffer queued
- // with the surface Texture.
- uint64_t mFrameCounter;
-
- bool mBufferHasBeenQueued;
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_BUFFERQUEUE_H
diff --git a/include/gui/DisplayEventReceiver.h b/include/gui/DisplayEventReceiver.h
deleted file mode 100644
index 7bca8d6..0000000
--- a/include/gui/DisplayEventReceiver.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_GUI_DISPLAY_EVENT_H
-#define ANDROID_GUI_DISPLAY_EVENT_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/Timers.h>
-
-#include <binder/IInterface.h>
-
-// ----------------------------------------------------------------------------
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-class BitTube;
-class IDisplayEventConnection;
-
-// ----------------------------------------------------------------------------
-
-class DisplayEventReceiver {
-public:
- enum {
- DISPLAY_EVENT_VSYNC = 'vsyn'
- };
-
- struct Event {
-
- struct Header {
- uint32_t type;
- nsecs_t timestamp;
- };
-
- struct VSync {
- uint32_t count;
- };
-
- Header header;
- union {
- VSync vsync;
- };
- };
-
-public:
- /*
- * DisplayEventReceiver creates and registers an event connection with
- * SurfaceFlinger. VSync events are disabled by default. Call setVSyncRate
- * or requestNextVsync to receive them.
- * Other events start being delivered immediately.
- */
- DisplayEventReceiver();
-
- /*
- * ~DisplayEventReceiver severs the connection with SurfaceFlinger, new events
- * stop being delivered immediately. Note that the queue could have
- * some events pending. These will be delivered.
- */
- ~DisplayEventReceiver();
-
- /*
- * initCheck returns the state of DisplayEventReceiver after construction.
- */
- status_t initCheck() const;
-
- /*
- * getFd returns the file descriptor to use to receive events.
- * OWNERSHIP IS RETAINED by DisplayEventReceiver. DO NOT CLOSE this
- * file-descriptor.
- */
- int getFd() const;
-
- /*
- * getEvents reads event from the queue and returns how many events were
- * read. Returns 0 if there are no more events or a negative error code.
- * If NOT_ENOUGH_DATA is returned, the object has become invalid forever, it
- * should be destroyed and getEvents() shouldn't be called again.
- */
- ssize_t getEvents(Event* events, size_t count);
- static ssize_t getEvents(const sp<BitTube>& dataChannel,
- Event* events, size_t count);
-
- /*
- * setVsyncRate() sets the Event::VSync delivery rate. A value of
- * 1 returns every Event::VSync. A value of 2 returns every other event,
- * etc... a value of 0 returns no event unless requestNextVsync() has
- * been called.
- */
- status_t setVsyncRate(uint32_t count);
-
- /*
- * requestNextVsync() schedules the next Event::VSync. It has no effect
- * if the vsync rate is > 0.
- */
- status_t requestNextVsync();
-
-private:
- sp<IDisplayEventConnection> mEventConnection;
- sp<BitTube> mDataChannel;
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_DISPLAY_EVENT_H
diff --git a/include/gui/IDisplayEventConnection.h b/include/gui/IDisplayEventConnection.h
deleted file mode 100644
index 86247de..0000000
--- a/include/gui/IDisplayEventConnection.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
-#define ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-
-#include <binder/IInterface.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-class BitTube;
-
-class IDisplayEventConnection : public IInterface
-{
-public:
-
- DECLARE_META_INTERFACE(DisplayEventConnection);
-
- /*
- * getDataChannel() returns a BitTube where to receive the events from
- */
- virtual sp<BitTube> getDataChannel() const = 0;
-
- /*
- * setVsyncRate() sets the vsync event delivery rate. A value of
- * 1 returns every vsync events. A value of 2 returns every other events,
- * etc... a value of 0 returns no event unless requestNextVsync() has
- * been called.
- */
- virtual void setVsyncRate(uint32_t count) = 0;
-
- /*
- * requestNextVsync() schedules the next vsync event. It has no effect
- * if the vsync rate is > 0.
- */
- virtual void requestNextVsync() = 0; // asynchronous
-};
-
-// ----------------------------------------------------------------------------
-
-class BnDisplayEventConnection : public BnInterface<IDisplayEventConnection>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
diff --git a/include/gui/IGraphicBufferAlloc.h b/include/gui/IGraphicBufferAlloc.h
deleted file mode 100644
index cee41d9..0000000
--- a/include/gui/IGraphicBufferAlloc.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H
-#define ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <binder/IInterface.h>
-#include <ui/PixelFormat.h>
-#include <utils/RefBase.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-class GraphicBuffer;
-
-class IGraphicBufferAlloc : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(GraphicBufferAlloc);
-
- /* Create a new GraphicBuffer for the client to use.
- */
- virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat format, uint32_t usage, status_t* error) = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnGraphicBufferAlloc : public BnInterface<IGraphicBufferAlloc>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H
diff --git a/include/gui/ISensorEventConnection.h b/include/gui/ISensorEventConnection.h
deleted file mode 100644
index 749065e..0000000
--- a/include/gui/ISensorEventConnection.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H
-#define ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-
-#include <binder/IInterface.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-class BitTube;
-
-class ISensorEventConnection : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(SensorEventConnection);
-
- virtual sp<BitTube> getSensorChannel() const = 0;
- virtual status_t enableDisable(int handle, bool enabled) = 0;
- virtual status_t setEventRate(int handle, nsecs_t ns) = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnSensorEventConnection : public BnInterface<ISensorEventConnection>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H
diff --git a/include/gui/ISensorServer.h b/include/gui/ISensorServer.h
deleted file mode 100644
index 9c8afc5..0000000
--- a/include/gui/ISensorServer.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_GUI_ISENSORSERVER_H
-#define ANDROID_GUI_ISENSORSERVER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-
-#include <binder/IInterface.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-class Sensor;
-class ISensorEventConnection;
-
-class ISensorServer : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(SensorServer);
-
- virtual Vector<Sensor> getSensorList() = 0;
- virtual sp<ISensorEventConnection> createSensorEventConnection() = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnSensorServer : public BnInterface<ISensorServer>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_ISENSORSERVER_H
diff --git a/include/gui/ISurface.h b/include/gui/ISurface.h
deleted file mode 100644
index c0ff9fc..0000000
--- a/include/gui/ISurface.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_GUI_ISURFACE_H
-#define ANDROID_GUI_ISURFACE_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-
-#include <binder/IInterface.h>
-
-#include <ui/PixelFormat.h>
-
-namespace android {
-
-typedef int32_t SurfaceID;
-
-class ISurfaceTexture;
-
-class ISurface : public IInterface
-{
-protected:
- enum {
- GET_SURFACE_TEXTURE = IBinder::FIRST_CALL_TRANSACTION,
- };
-
-public:
- DECLARE_META_INTERFACE(Surface);
-
- virtual sp<ISurfaceTexture> getSurfaceTexture() const = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnSurface : public BnInterface<ISurface>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_GUI_ISURFACE_H
diff --git a/include/gui/ISurfaceComposer.h b/include/gui/ISurfaceComposer.h
deleted file mode 100644
index f3c0ecb..0000000
--- a/include/gui/ISurfaceComposer.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-#ifndef ANDROID_GUI_ISURFACE_COMPOSER_H
-#define ANDROID_GUI_ISURFACE_COMPOSER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/RefBase.h>
-#include <utils/Errors.h>
-
-#include <binder/IInterface.h>
-
-#include <ui/PixelFormat.h>
-
-#include <gui/IGraphicBufferAlloc.h>
-#include <gui/ISurfaceComposerClient.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-class ComposerState;
-class IDisplayEventConnection;
-class IMemoryHeap;
-
-class ISurfaceComposer : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(SurfaceComposer);
-
- enum { // (keep in sync with Surface.java)
- eHidden = 0x00000004,
- eDestroyBackbuffer = 0x00000020,
- eSecure = 0x00000080,
- eNonPremultiplied = 0x00000100,
- eOpaque = 0x00000400,
- eProtectedByApp = 0x00000800,
- eProtectedByDRM = 0x00001000,
-
- eFXSurfaceNormal = 0x00000000,
- eFXSurfaceBlur = 0x00010000,
- eFXSurfaceDim = 0x00020000,
- eFXSurfaceScreenshot= 0x00030000,
- eFXSurfaceMask = 0x000F0000,
- };
-
- enum {
- ePositionChanged = 0x00000001,
- eLayerChanged = 0x00000002,
- eSizeChanged = 0x00000004,
- eAlphaChanged = 0x00000008,
- eMatrixChanged = 0x00000010,
- eTransparentRegionChanged = 0x00000020,
- eVisibilityChanged = 0x00000040,
- eFreezeTintChanged = 0x00000080,
- };
-
- enum {
- eLayerHidden = 0x01,
- eLayerFrozen = 0x02,
- eLayerDither = 0x04,
- eLayerFilter = 0x08,
- eLayerBlurFreeze = 0x10
- };
-
- enum {
- eOrientationDefault = 0,
- eOrientation90 = 1,
- eOrientation180 = 2,
- eOrientation270 = 3,
- eOrientationUnchanged = 4,
- eOrientationSwapMask = 0x01
- };
-
- enum {
- eSynchronous = 0x01,
- };
-
- enum {
- eElectronBeamAnimationOn = 0x01,
- eElectronBeamAnimationOff = 0x10
- };
-
- /* create connection with surface flinger, requires
- * ACCESS_SURFACE_FLINGER permission
- */
- virtual sp<ISurfaceComposerClient> createConnection() = 0;
-
- /* create a graphic buffer allocator
- */
- virtual sp<IGraphicBufferAlloc> createGraphicBufferAlloc() = 0;
-
- /* retrieve the control block */
- virtual sp<IMemoryHeap> getCblk() const = 0;
-
- /* open/close transactions. requires ACCESS_SURFACE_FLINGER permission */
- virtual void setTransactionState(const Vector<ComposerState>& state,
- int orientation, uint32_t flags) = 0;
-
- /* signal that we're done booting.
- * Requires ACCESS_SURFACE_FLINGER permission
- */
- virtual void bootFinished() = 0;
-
- /* Capture the specified screen. requires READ_FRAME_BUFFER permission
- * This function will fail if there is a secure window on screen.
- */
- virtual status_t captureScreen(DisplayID dpy,
- sp<IMemoryHeap>* heap,
- uint32_t* width, uint32_t* height, PixelFormat* format,
- uint32_t reqWidth, uint32_t reqHeight,
- uint32_t minLayerZ, uint32_t maxLayerZ) = 0;
-
- /* triggers screen off animation */
- virtual status_t turnElectronBeamOff(int32_t mode) = 0;
-
- /* triggers screen on animation */
- virtual status_t turnElectronBeamOn(int32_t mode) = 0;
-
- /* verify that an ISurfaceTexture was created by SurfaceFlinger.
- */
- virtual bool authenticateSurfaceTexture(
- const sp<ISurfaceTexture>& surface) const = 0;
-
- /* return an IDisplayEventConnection */
- virtual sp<IDisplayEventConnection> createDisplayEventConnection() = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnSurfaceComposer : public BnInterface<ISurfaceComposer>
-{
-public:
- enum {
- // Note: BOOT_FINISHED must remain this value, it is called from
- // Java by ActivityManagerService.
- BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION,
- CREATE_CONNECTION,
- CREATE_GRAPHIC_BUFFER_ALLOC,
- GET_CBLK,
- SET_TRANSACTION_STATE,
- SET_ORIENTATION,
- CAPTURE_SCREEN,
- TURN_ELECTRON_BEAM_OFF,
- TURN_ELECTRON_BEAM_ON,
- AUTHENTICATE_SURFACE,
- CREATE_DISPLAY_EVENT_CONNECTION,
- };
-
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_GUI_ISURFACE_COMPOSER_H
diff --git a/include/gui/ISurfaceComposerClient.h b/include/gui/ISurfaceComposerClient.h
deleted file mode 100644
index c793933..0000000
--- a/include/gui/ISurfaceComposerClient.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
-#define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-
-#include <binder/IInterface.h>
-
-#include <ui/PixelFormat.h>
-
-#include <gui/ISurface.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-typedef int32_t DisplayID;
-
-// ----------------------------------------------------------------------------
-
-class ISurfaceComposerClient : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(SurfaceComposerClient);
-
- struct surface_data_t {
- int32_t token;
- int32_t identity;
- status_t readFromParcel(const Parcel& parcel);
- status_t writeToParcel(Parcel* parcel) const;
- };
-
- /*
- * Requires ACCESS_SURFACE_FLINGER permission
- */
- virtual sp<ISurface> createSurface( surface_data_t* data,
- const String8& name,
- DisplayID display,
- uint32_t w,
- uint32_t h,
- PixelFormat format,
- uint32_t flags) = 0;
-
- /*
- * Requires ACCESS_SURFACE_FLINGER permission
- */
- virtual status_t destroySurface(SurfaceID sid) = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnSurfaceComposerClient : public BnInterface<ISurfaceComposerClient>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
diff --git a/include/gui/ISurfaceTexture.h b/include/gui/ISurfaceTexture.h
deleted file mode 100644
index 50626a0..0000000
--- a/include/gui/ISurfaceTexture.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_GUI_ISURFACETEXTURE_H
-#define ANDROID_GUI_ISURFACETEXTURE_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-
-#include <binder/IInterface.h>
-
-#include <ui/GraphicBuffer.h>
-#include <ui/Rect.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-class SurfaceTextureClient;
-
-class ISurfaceTexture : public IInterface
-{
-public:
- DECLARE_META_INTERFACE(SurfaceTexture);
-
-protected:
- friend class SurfaceTextureClient;
-
- enum {
- BUFFER_NEEDS_REALLOCATION = 0x1,
- RELEASE_ALL_BUFFERS = 0x2,
- };
-
- // requestBuffer requests a new buffer for the given index. The server (i.e.
- // the ISurfaceTexture implementation) assigns the newly created buffer to
- // the given slot index, and the client is expected to mirror the
- // slot->buffer mapping so that it's not necessary to transfer a
- // GraphicBuffer for every dequeue operation.
- virtual status_t requestBuffer(int slot, sp<GraphicBuffer>* buf) = 0;
-
- // setBufferCount sets the number of buffer slots available. Calling this
- // will also cause all buffer slots to be emptied. The caller should empty
- // its mirrored copy of the buffer slots when calling this method.
- virtual status_t setBufferCount(int bufferCount) = 0;
-
- // dequeueBuffer requests a new buffer slot for the client to use. Ownership
- // of the slot is transfered to the client, meaning that the server will not
- // use the contents of the buffer associated with that slot. The slot index
- // returned may or may not contain a buffer. If the slot is empty the client
- // should call requestBuffer to assign a new buffer to that slot. The client
- // is expected to either call cancelBuffer on the dequeued slot or to fill
- // in the contents of its associated buffer contents and call queueBuffer.
- // If dequeueBuffer return BUFFER_NEEDS_REALLOCATION, the client is
- // expected to call requestBuffer immediately.
- virtual status_t dequeueBuffer(int *slot, uint32_t w, uint32_t h,
- uint32_t format, uint32_t usage) = 0;
-
- // queueBuffer indicates that the client has finished filling in the
- // contents of the buffer associated with slot and transfers ownership of
- // that slot back to the server. It is not valid to call queueBuffer on a
- // slot that is not owned by the client or one for which a buffer associated
- // via requestBuffer. In addition, a timestamp must be provided by the
- // client for this buffer. The timestamp is measured in nanoseconds, and
- // must be monotonically increasing. Its other properties (zero point, etc)
- // are client-dependent, and should be documented by the client.
- //
- // outWidth, outHeight and outTransform are filled with the default width
- // and height of the window and current transform applied to buffers,
- // respectively.
- virtual status_t queueBuffer(int slot, int64_t timestamp,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) = 0;
-
- // cancelBuffer indicates that the client does not wish to fill in the
- // buffer associated with slot and transfers ownership of the slot back to
- // the server.
- virtual void cancelBuffer(int slot) = 0;
-
- virtual status_t setCrop(const Rect& reg) = 0;
- virtual status_t setTransform(uint32_t transform) = 0;
- virtual status_t setScalingMode(int mode) = 0;
-
- // query retrieves some information for this surface
- // 'what' tokens allowed are that of android_natives.h
- virtual int query(int what, int* value) = 0;
-
- // setSynchronousMode set whether dequeueBuffer is synchronous or
- // asynchronous. In synchronous mode, dequeueBuffer blocks until
- // a buffer is available, the currently bound buffer can be dequeued and
- // queued buffers will be retired in order.
- // The default mode is asynchronous.
- virtual status_t setSynchronousMode(bool enabled) = 0;
-
- // connect attempts to connect a client API to the SurfaceTexture. This
- // must be called before any other ISurfaceTexture methods are called except
- // for getAllocator.
- //
- // This method will fail if the connect was previously called on the
- // SurfaceTexture and no corresponding disconnect call was made.
- //
- // outWidth, outHeight and outTransform are filled with the default width
- // and height of the window and current transform applied to buffers,
- // respectively.
- virtual status_t connect(int api,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) = 0;
-
- // disconnect attempts to disconnect a client API from the SurfaceTexture.
- // Calling this method will cause any subsequent calls to other
- // ISurfaceTexture methods to fail except for getAllocator and connect.
- // Successfully calling connect after this will allow the other methods to
- // succeed again.
- //
- // This method will fail if the the SurfaceTexture is not currently
- // connected to the specified client API.
- virtual status_t disconnect(int api) = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnSurfaceTexture : public BnInterface<ISurfaceTexture>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_ISURFACETEXTURE_H
diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h
deleted file mode 100644
index e59757a..0000000
--- a/include/gui/Sensor.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_GUI_SENSOR_H
-#define ANDROID_GUI_SENSOR_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/Flattenable.h>
-#include <utils/String8.h>
-#include <utils/Timers.h>
-
-#include <hardware/sensors.h>
-
-#include <android/sensor.h>
-
-// ----------------------------------------------------------------------------
-// Concrete types for the NDK
-struct ASensor { };
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-class Parcel;
-
-// ----------------------------------------------------------------------------
-
-class Sensor : public ASensor, public Flattenable
-{
-public:
- enum {
- TYPE_ACCELEROMETER = ASENSOR_TYPE_ACCELEROMETER,
- TYPE_MAGNETIC_FIELD = ASENSOR_TYPE_MAGNETIC_FIELD,
- TYPE_GYROSCOPE = ASENSOR_TYPE_GYROSCOPE,
- TYPE_LIGHT = ASENSOR_TYPE_LIGHT,
- TYPE_PROXIMITY = ASENSOR_TYPE_PROXIMITY
- };
-
- Sensor();
- Sensor(struct sensor_t const* hwSensor);
- virtual ~Sensor();
-
- const String8& getName() const;
- const String8& getVendor() const;
- int32_t getHandle() const;
- int32_t getType() const;
- float getMinValue() const;
- float getMaxValue() const;
- float getResolution() const;
- float getPowerUsage() const;
- int32_t getMinDelay() const;
- nsecs_t getMinDelayNs() const;
- int32_t getVersion() const;
-
- // Flattenable interface
- virtual size_t getFlattenedSize() const;
- virtual size_t getFdCount() const;
- virtual status_t flatten(void* buffer, size_t size,
- int fds[], size_t count) const;
- virtual status_t unflatten(void const* buffer, size_t size,
- int fds[], size_t count);
-
-private:
- String8 mName;
- String8 mVendor;
- int32_t mHandle;
- int32_t mType;
- float mMinValue;
- float mMaxValue;
- float mResolution;
- float mPower;
- int32_t mMinDelay;
- int32_t mVersion;
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_SENSOR_H
diff --git a/include/gui/SensorEventQueue.h b/include/gui/SensorEventQueue.h
deleted file mode 100644
index ef7c6e3..0000000
--- a/include/gui/SensorEventQueue.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_SENSOR_EVENT_QUEUE_H
-#define ANDROID_SENSOR_EVENT_QUEUE_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/Timers.h>
-
-#include <gui/BitTube.h>
-
-// ----------------------------------------------------------------------------
-
-struct ALooper;
-struct ASensorEvent;
-
-// Concrete types for the NDK
-struct ASensorEventQueue {
- ALooper* looper;
-};
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-class ISensorEventConnection;
-class Sensor;
-class Looper;
-
-// ----------------------------------------------------------------------------
-
-class SensorEventQueue : public ASensorEventQueue, public RefBase
-{
-public:
- SensorEventQueue(const sp<ISensorEventConnection>& connection);
- virtual ~SensorEventQueue();
- virtual void onFirstRef();
-
- int getFd() const;
- ssize_t write(ASensorEvent const* events, size_t numEvents);
- ssize_t read(ASensorEvent* events, size_t numEvents);
-
- status_t waitForEvent() const;
- status_t wake() const;
-
- status_t enableSensor(Sensor const* sensor) const;
- status_t disableSensor(Sensor const* sensor) const;
- status_t setEventRate(Sensor const* sensor, nsecs_t ns) const;
-
- // these are here only to support SensorManager.java
- status_t enableSensor(int32_t handle, int32_t us) const;
- status_t disableSensor(int32_t handle) const;
-
-private:
- sp<Looper> getLooper() const;
- sp<ISensorEventConnection> mSensorEventConnection;
- sp<BitTube> mSensorChannel;
- mutable Mutex mLock;
- mutable sp<Looper> mLooper;
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_SENSOR_EVENT_QUEUE_H
diff --git a/include/gui/SensorManager.h b/include/gui/SensorManager.h
deleted file mode 100644
index 3176462..0000000
--- a/include/gui/SensorManager.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_GUI_SENSOR_MANAGER_H
-#define ANDROID_GUI_SENSOR_MANAGER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <binder/IBinder.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/Singleton.h>
-#include <utils/Vector.h>
-
-#include <gui/SensorEventQueue.h>
-
-// ----------------------------------------------------------------------------
-// Concrete types for the NDK
-struct ASensorManager { };
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-class ISensorServer;
-class Sensor;
-class SensorEventQueue;
-
-// ----------------------------------------------------------------------------
-
-class SensorManager :
- public ASensorManager,
- public Singleton<SensorManager>
-{
-public:
- SensorManager();
- ~SensorManager();
-
- ssize_t getSensorList(Sensor const* const** list) const;
- Sensor const* getDefaultSensor(int type);
- sp<SensorEventQueue> createEventQueue();
-
-private:
- // DeathRecipient interface
- void sensorManagerDied();
-
- status_t assertStateLocked() const;
-
-private:
- mutable Mutex mLock;
- mutable sp<ISensorServer> mSensorServer;
- mutable Sensor const** mSensorList;
- mutable Vector<Sensor> mSensors;
- mutable sp<IBinder::DeathRecipient> mDeathObserver;
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_SENSOR_MANAGER_H
diff --git a/include/gui/Surface.h b/include/gui/Surface.h
deleted file mode 100644
index 1f90c59..0000000
--- a/include/gui/Surface.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_GUI_SURFACE_H
-#define ANDROID_GUI_SURFACE_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/KeyedVector.h>
-#include <utils/RefBase.h>
-#include <utils/threads.h>
-
-#include <ui/PixelFormat.h>
-#include <ui/Region.h>
-
-#include <gui/SurfaceTextureClient.h>
-#include <gui/ISurface.h>
-#include <gui/ISurfaceComposerClient.h>
-
-#define ANDROID_VIEW_SURFACE_JNI_ID "mNativeSurface"
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class ISurfaceTexture;
-class Surface;
-class SurfaceComposerClient;
-
-// ---------------------------------------------------------------------------
-
-class SurfaceControl : public RefBase
-{
-public:
- static bool isValid(const sp<SurfaceControl>& surface) {
- return (surface != 0) && surface->isValid();
- }
- bool isValid() {
- return mToken>=0 && mClient!=0;
- }
- static bool isSameSurface(
- const sp<SurfaceControl>& lhs, const sp<SurfaceControl>& rhs);
-
- uint32_t getIdentity() const { return mIdentity; }
-
- // release surface data from java
- void clear();
-
- status_t setLayer(int32_t layer);
- status_t setPosition(int32_t x, int32_t y);
- status_t setSize(uint32_t w, uint32_t h);
- status_t hide();
- status_t show(int32_t layer = -1);
- status_t freeze();
- status_t unfreeze();
- status_t setFlags(uint32_t flags, uint32_t mask);
- status_t setTransparentRegionHint(const Region& transparent);
- status_t setAlpha(float alpha=1.0f);
- status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy);
- status_t setFreezeTint(uint32_t tint);
-
- static status_t writeSurfaceToParcel(
- const sp<SurfaceControl>& control, Parcel* parcel);
-
- sp<Surface> getSurface() const;
-
-private:
- // can't be copied
- SurfaceControl& operator = (SurfaceControl& rhs);
- SurfaceControl(const SurfaceControl& rhs);
-
- friend class SurfaceComposerClient;
- friend class Surface;
-
- SurfaceControl(
- const sp<SurfaceComposerClient>& client,
- const sp<ISurface>& surface,
- const ISurfaceComposerClient::surface_data_t& data);
-
- ~SurfaceControl();
-
- status_t validate() const;
- void destroy();
-
- sp<SurfaceComposerClient> mClient;
- sp<ISurface> mSurface;
- SurfaceID mToken;
- uint32_t mIdentity;
- mutable Mutex mLock;
-
- mutable sp<Surface> mSurfaceData;
-};
-
-// ---------------------------------------------------------------------------
-
-class Surface : public SurfaceTextureClient
-{
-public:
- struct SurfaceInfo {
- uint32_t w;
- uint32_t h;
- uint32_t s;
- uint32_t usage;
- PixelFormat format;
- void* bits;
- uint32_t reserved[2];
- };
-
- explicit Surface(const sp<ISurfaceTexture>& st);
-
- static status_t writeToParcel(const sp<Surface>& control, Parcel* parcel);
-
- static sp<Surface> readFromParcel(const Parcel& data);
- static bool isValid(const sp<Surface>& surface) {
- return (surface != 0) && surface->isValid();
- }
-
- bool isValid();
- uint32_t getIdentity() const { return mIdentity; }
- sp<ISurfaceTexture> getSurfaceTexture();
-
- // the lock/unlock APIs must be used from the same thread
- status_t lock(SurfaceInfo* info, Region* dirty = NULL);
- status_t unlockAndPost();
-
- sp<IBinder> asBinder() const;
-
-private:
- // this is just to be able to write some unit tests
- friend class Test;
- friend class SurfaceControl;
-
- // can't be copied
- Surface& operator = (Surface& rhs);
- Surface(const Surface& rhs);
-
- explicit Surface(const sp<SurfaceControl>& control);
- Surface(const Parcel& data, const sp<IBinder>& ref);
- ~Surface();
-
- /*
- * private stuff...
- */
- void init(const sp<ISurfaceTexture>& surfaceTexture);
-
- static void cleanCachedSurfacesLocked();
-
- virtual int query(int what, int* value) const;
-
- // constants
- sp<ISurface> mSurface;
- uint32_t mIdentity;
-
- // A cache of Surface objects that have been deserialized into this process.
- static Mutex sCachedSurfacesLock;
- static DefaultKeyedVector<wp<IBinder>, wp<Surface> > sCachedSurfaces;
-};
-
-}; // namespace android
-
-#endif // ANDROID_GUI_SURFACE_H
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
deleted file mode 100644
index d971031..0000000
--- a/include/gui/SurfaceComposerClient.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H
-#define ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <binder/IBinder.h>
-
-#include <utils/RefBase.h>
-#include <utils/Singleton.h>
-#include <utils/SortedVector.h>
-#include <utils/threads.h>
-
-#include <ui/PixelFormat.h>
-
-#include <gui/Surface.h>
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class DisplayInfo;
-class Composer;
-class IMemoryHeap;
-class ISurfaceComposerClient;
-class Region;
-
-// ---------------------------------------------------------------------------
-
-class SurfaceComposerClient : public RefBase
-{
- friend class Composer;
-public:
- SurfaceComposerClient();
- virtual ~SurfaceComposerClient();
-
- // Always make sure we could initialize
- status_t initCheck() const;
-
- // Return the connection of this client
- sp<IBinder> connection() const;
-
- // Forcibly remove connection before all references have gone away.
- void dispose();
-
- // ------------------------------------------------------------------------
- // surface creation / destruction
-
- //! Create a surface
- sp<SurfaceControl> createSurface(
- const String8& name,// name of the surface
- DisplayID display, // Display to create this surface on
- uint32_t w, // width in pixel
- uint32_t h, // height in pixel
- PixelFormat format, // pixel-format desired
- uint32_t flags = 0 // usage flags
- );
-
- sp<SurfaceControl> createSurface(
- DisplayID display, // Display to create this surface on
- uint32_t w, // width in pixel
- uint32_t h, // height in pixel
- PixelFormat format, // pixel-format desired
- uint32_t flags = 0 // usage flags
- );
-
-
- // ------------------------------------------------------------------------
- // Composer parameters
- // All composer parameters must be changed within a transaction
- // several surfaces can be updated in one transaction, all changes are
- // committed at once when the transaction is closed.
- // closeGlobalTransaction() usually requires an IPC with the server.
-
- //! Open a composer transaction on all active SurfaceComposerClients.
- static void openGlobalTransaction();
-
- //! Close a composer transaction on all active SurfaceComposerClients.
- static void closeGlobalTransaction(bool synchronous = false);
-
- //! Freeze the specified display but not transactions.
- static status_t freezeDisplay(DisplayID dpy, uint32_t flags = 0);
-
- //! Resume updates on the specified display.
- static status_t unfreezeDisplay(DisplayID dpy, uint32_t flags = 0);
-
- //! Set the orientation of the given display
- static int setOrientation(DisplayID dpy, int orientation, uint32_t flags);
-
- // Query the number of displays
- static ssize_t getNumberOfDisplays();
-
- // Get information about a display
- static status_t getDisplayInfo(DisplayID dpy, DisplayInfo* info);
- static ssize_t getDisplayWidth(DisplayID dpy);
- static ssize_t getDisplayHeight(DisplayID dpy);
- static ssize_t getDisplayOrientation(DisplayID dpy);
-
- status_t linkToComposerDeath(const sp<IBinder::DeathRecipient>& recipient,
- void* cookie = NULL, uint32_t flags = 0);
-
- status_t hide(SurfaceID id);
- status_t show(SurfaceID id, int32_t layer = -1);
- status_t freeze(SurfaceID id);
- status_t unfreeze(SurfaceID id);
- status_t setFlags(SurfaceID id, uint32_t flags, uint32_t mask);
- status_t setTransparentRegionHint(SurfaceID id, const Region& transparent);
- status_t setLayer(SurfaceID id, int32_t layer);
- status_t setAlpha(SurfaceID id, float alpha=1.0f);
- status_t setFreezeTint(SurfaceID id, uint32_t tint);
- status_t setMatrix(SurfaceID id, float dsdx, float dtdx, float dsdy, float dtdy);
- status_t setPosition(SurfaceID id, float x, float y);
- status_t setSize(SurfaceID id, uint32_t w, uint32_t h);
- status_t destroySurface(SurfaceID sid);
-
-private:
- virtual void onFirstRef();
- Composer& getComposer();
-
- mutable Mutex mLock;
- status_t mStatus;
- sp<ISurfaceComposerClient> mClient;
- Composer& mComposer;
-};
-
-// ---------------------------------------------------------------------------
-
-class ScreenshotClient
-{
- sp<IMemoryHeap> mHeap;
- uint32_t mWidth;
- uint32_t mHeight;
- PixelFormat mFormat;
-public:
- ScreenshotClient();
-
- // frees the previous screenshot and capture a new one
- status_t update();
- status_t update(uint32_t reqWidth, uint32_t reqHeight);
- status_t update(uint32_t reqWidth, uint32_t reqHeight,
- uint32_t minLayerZ, uint32_t maxLayerZ);
-
- // release memory occupied by the screenshot
- void release();
-
- // pixels are valid until this object is freed or
- // release() or update() is called
- void const* getPixels() const;
-
- uint32_t getWidth() const;
- uint32_t getHeight() const;
- PixelFormat getFormat() const;
- uint32_t getStride() const;
- // size of allocated memory in bytes
- size_t getSize() const;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h
deleted file mode 100644
index 5531e53..0000000
--- a/include/gui/SurfaceTexture.h
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_GUI_SURFACETEXTURE_H
-#define ANDROID_GUI_SURFACETEXTURE_H
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <gui/ISurfaceTexture.h>
-#include <gui/BufferQueue.h>
-
-#include <ui/GraphicBuffer.h>
-
-#include <utils/String8.h>
-#include <utils/Vector.h>
-#include <utils/threads.h>
-
-#define ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID "mSurfaceTexture"
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-
-class String8;
-
-class SurfaceTexture : public BufferQueue {
-public:
-
- // SurfaceTexture constructs a new SurfaceTexture object. tex indicates the
- // name of the OpenGL ES texture to which images are to be streamed. This
- // texture name cannot be changed once the SurfaceTexture is created.
- // allowSynchronousMode specifies whether or not synchronous mode can be
- // enabled. texTarget specifies the OpenGL ES texture target to which the
- // texture will be bound in updateTexImage. useFenceSync specifies whether
- // fences should be used to synchronize access to buffers if that behavior
- // is enabled at compile-time.
- SurfaceTexture(GLuint tex, bool allowSynchronousMode = true,
- GLenum texTarget = GL_TEXTURE_EXTERNAL_OES, bool useFenceSync = true);
-
- virtual ~SurfaceTexture();
-
-
-
- // updateTexImage sets the image contents of the target texture to that of
- // the most recently queued buffer.
- //
- // This call may only be made while the OpenGL ES context to which the
- // target texture belongs is bound to the calling thread.
- status_t updateTexImage();
-
- // setBufferCountServer set the buffer count. If the client has requested
- // a buffer count using setBufferCount, the server-buffer count will
- // take effect once the client sets the count back to zero.
- status_t setBufferCountServer(int bufferCount);
-
- // getTransformMatrix retrieves the 4x4 texture coordinate transform matrix
- // associated with the texture image set by the most recent call to
- // updateTexImage.
- //
- // This transform matrix maps 2D homogeneous texture coordinates of the form
- // (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture
- // coordinate that should be used to sample that location from the texture.
- // Sampling the texture outside of the range of this transform is undefined.
- //
- // This transform is necessary to compensate for transforms that the stream
- // content producer may implicitly apply to the content. By forcing users of
- // a SurfaceTexture to apply this transform we avoid performing an extra
- // copy of the data that would be needed to hide the transform from the
- // user.
- //
- // The matrix is stored in column-major order so that it may be passed
- // directly to OpenGL ES via the glLoadMatrixf or glUniformMatrix4fv
- // functions.
- void getTransformMatrix(float mtx[16]);
-
- // getTimestamp retrieves the timestamp associated with the texture image
- // set by the most recent call to updateTexImage.
- //
- // The timestamp is in nanoseconds, and is monotonically increasing. Its
- // other semantics (zero point, etc) are source-dependent and should be
- // documented by the source.
- int64_t getTimestamp();
-
- // setFrameAvailableListener sets the listener object that will be notified
- // when a new frame becomes available.
- void setFrameAvailableListener(const sp<FrameAvailableListener>& listener);
-
- // getAllocator retrieves the binder object that must be referenced as long
- // as the GraphicBuffers dequeued from this SurfaceTexture are referenced.
- // Holding this binder reference prevents SurfaceFlinger from freeing the
- // buffers before the client is done with them.
- sp<IBinder> getAllocator();
-
- // setDefaultBufferSize is used to set the size of buffers returned by
- // requestBuffers when a with and height of zero is requested.
- // A call to setDefaultBufferSize() may trigger requestBuffers() to
- // be called from the client.
- // The width and height parameters must be no greater than the minimum of
- // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
- // An error due to invalid dimensions might not be reported until
- // updateTexImage() is called.
- status_t setDefaultBufferSize(uint32_t width, uint32_t height);
-
- // getCurrentBuffer returns the buffer associated with the current image.
- sp<GraphicBuffer> getCurrentBuffer() const;
-
- // getCurrentTextureTarget returns the texture target of the current
- // texture as returned by updateTexImage().
- GLenum getCurrentTextureTarget() const;
-
- // getCurrentCrop returns the cropping rectangle of the current buffer
- Rect getCurrentCrop() const;
-
- // getCurrentTransform returns the transform of the current buffer
- uint32_t getCurrentTransform() const;
-
- // getCurrentScalingMode returns the scaling mode of the current buffer
- uint32_t getCurrentScalingMode() const;
-
- // isSynchronousMode returns whether the SurfaceTexture is currently in
- // synchronous mode.
- bool isSynchronousMode() const;
-
- // abandon frees all the buffers and puts the SurfaceTexture into the
- // 'abandoned' state. Once put in this state the SurfaceTexture can never
- // leave it. When in the 'abandoned' state, all methods of the
- // ISurfaceTexture interface will fail with the NO_INIT error.
- //
- // Note that while calling this method causes all the buffers to be freed
- // from the perspective of the the SurfaceTexture, if there are additional
- // references on the buffers (e.g. if a buffer is referenced by a client or
- // by OpenGL ES as a texture) then those buffer will remain allocated.
- void abandon();
-
- // set the name of the SurfaceTexture that will be used to identify it in
- // log messages.
- void setName(const String8& name);
-
- // dump our state in a String
- virtual void dump(String8& result) const;
- virtual void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const;
-
-protected:
-
- static bool isExternalFormat(uint32_t format);
-
-private:
-
- // createImage creates a new EGLImage from a GraphicBuffer.
- EGLImageKHR createImage(EGLDisplay dpy,
- const sp<GraphicBuffer>& graphicBuffer);
-
- // computeCurrentTransformMatrix computes the transform matrix for the
- // current texture. It uses mCurrentTransform and the current GraphicBuffer
- // to compute this matrix and stores it in mCurrentTransformMatrix.
- void computeCurrentTransformMatrix();
-
- // mCurrentTextureBuf is the graphic buffer of the current texture. It's
- // possible that this buffer is not associated with any buffer slot, so we
- // must track it separately in order to support the getCurrentBuffer method.
- sp<GraphicBuffer> mCurrentTextureBuf;
-
- // mCurrentCrop is the crop rectangle that applies to the current texture.
- // It gets set each time updateTexImage is called.
- Rect mCurrentCrop;
-
- // mCurrentTransform is the transform identifier for the current texture. It
- // gets set each time updateTexImage is called.
- uint32_t mCurrentTransform;
-
- // mCurrentScalingMode is the scaling mode for the current texture. It gets
- // set to each time updateTexImage is called.
- uint32_t mCurrentScalingMode;
-
- // mCurrentTransformMatrix is the transform matrix for the current texture.
- // It gets computed by computeTransformMatrix each time updateTexImage is
- // called.
- float mCurrentTransformMatrix[16];
-
- // mCurrentTimestamp is the timestamp for the current texture. It
- // gets set each time updateTexImage is called.
- int64_t mCurrentTimestamp;
-
- // mTexName is the name of the OpenGL texture to which streamed images will
- // be bound when updateTexImage is called. It is set at construction time
- // changed with a call to setTexName.
- const GLuint mTexName;
-
- // mUseFenceSync indicates whether creation of the EGL_KHR_fence_sync
- // extension should be used to prevent buffers from being dequeued before
- // it's safe for them to be written. It gets set at construction time and
- // never changes.
- const bool mUseFenceSync;
-
- // mTexTarget is the GL texture target with which the GL texture object is
- // associated. It is set in the constructor and never changed. It is
- // almost always GL_TEXTURE_EXTERNAL_OES except for one use case in Android
- // Browser. In that case it is set to GL_TEXTURE_2D to allow
- // glCopyTexSubImage to read from the texture. This is a hack to work
- // around a GL driver limitation on the number of FBO attachments, which the
- // browser's tile cache exceeds.
- const GLenum mTexTarget;
-
- // SurfaceTexture maintains EGL information about GraphicBuffers that corresponds
- // directly with BufferQueue's buffers
- struct EGLSlot {
- EGLSlot()
- : mEglImage(EGL_NO_IMAGE_KHR),
- mEglDisplay(EGL_NO_DISPLAY),
- mFence(EGL_NO_SYNC_KHR) {
- }
-
- sp<GraphicBuffer> mGraphicBuffer;
-
- // mEglImage is the EGLImage created from mGraphicBuffer.
- EGLImageKHR mEglImage;
-
- // mEglDisplay is the EGLDisplay used to create mEglImage.
- EGLDisplay mEglDisplay;
-
- // mFence is the EGL sync object that must signal before the buffer
- // associated with this buffer slot may be dequeued. It is initialized
- // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based
- // on a compile-time option) set to a new sync object in updateTexImage.
- EGLSyncKHR mFence;
- };
-
- EGLSlot mEGLSlots[NUM_BUFFER_SLOTS];
-
- // mAbandoned indicates that the BufferQueue will no longer be used to
- // consume images buffers pushed to it using the ISurfaceTexture interface.
- // It is initialized to false, and set to true in the abandon method. A
- // BufferQueue that has been abandoned will return the NO_INIT error from
- // all ISurfaceTexture methods capable of returning an error.
- bool mAbandoned;
-
- // mName is a string used to identify the SurfaceTexture in log messages.
- // It can be set by the setName method.
- String8 mName;
-
- // mMutex is the mutex used to prevent concurrent access to the member
- // variables of SurfaceTexture objects. It must be locked whenever the
- // member variables are accessed.
- mutable Mutex mMutex;
-
- // mCurrentTexture is the buffer slot index of the buffer that is currently
- // bound to the OpenGL texture. It is initialized to INVALID_BUFFER_SLOT,
- // indicating that no buffer slot is currently bound to the texture. Note,
- // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean
- // that no buffer is bound to the texture. A call to setBufferCount will
- // reset mCurrentTexture to INVALID_BUFFER_SLOT.
- int mCurrentTexture;
-
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_SURFACETEXTURE_H
diff --git a/include/gui/SurfaceTextureClient.h b/include/gui/SurfaceTextureClient.h
deleted file mode 100644
index aa7fe48..0000000
--- a/include/gui/SurfaceTextureClient.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_GUI_SURFACETEXTURECLIENT_H
-#define ANDROID_GUI_SURFACETEXTURECLIENT_H
-
-#include <gui/ISurfaceTexture.h>
-#include <gui/SurfaceTexture.h>
-
-#include <ui/ANativeObjectBase.h>
-#include <ui/Region.h>
-
-#include <utils/RefBase.h>
-#include <utils/threads.h>
-
-namespace android {
-
-class Surface;
-
-class SurfaceTextureClient
- : public ANativeObjectBase<ANativeWindow, SurfaceTextureClient, RefBase>
-{
-public:
- SurfaceTextureClient(const sp<ISurfaceTexture>& surfaceTexture);
-
- sp<ISurfaceTexture> getISurfaceTexture() const;
-
-protected:
- SurfaceTextureClient();
- virtual ~SurfaceTextureClient();
- void setISurfaceTexture(const sp<ISurfaceTexture>& surfaceTexture);
-
-private:
- // can't be copied
- SurfaceTextureClient& operator = (const SurfaceTextureClient& rhs);
- SurfaceTextureClient(const SurfaceTextureClient& rhs);
- void init();
-
- // ANativeWindow hooks
- static int hook_cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
- static int hook_dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer);
- static int hook_lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
- static int hook_perform(ANativeWindow* window, int operation, ...);
- static int hook_query(const ANativeWindow* window, int what, int* value);
- static int hook_queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
- static int hook_setSwapInterval(ANativeWindow* window, int interval);
-
- int dispatchConnect(va_list args);
- int dispatchDisconnect(va_list args);
- int dispatchSetBufferCount(va_list args);
- int dispatchSetBuffersGeometry(va_list args);
- int dispatchSetBuffersDimensions(va_list args);
- int dispatchSetBuffersFormat(va_list args);
- int dispatchSetScalingMode(va_list args);
- int dispatchSetBuffersTransform(va_list args);
- int dispatchSetBuffersTimestamp(va_list args);
- int dispatchSetCrop(va_list args);
- int dispatchSetUsage(va_list args);
- int dispatchLock(va_list args);
- int dispatchUnlockAndPost(va_list args);
-
-protected:
- virtual int cancelBuffer(ANativeWindowBuffer* buffer);
- virtual int dequeueBuffer(ANativeWindowBuffer** buffer);
- virtual int lockBuffer(ANativeWindowBuffer* buffer);
- virtual int perform(int operation, va_list args);
- virtual int query(int what, int* value) const;
- virtual int queueBuffer(ANativeWindowBuffer* buffer);
- virtual int setSwapInterval(int interval);
-
- virtual int connect(int api);
- virtual int disconnect(int api);
- virtual int setBufferCount(int bufferCount);
- virtual int setBuffersDimensions(int w, int h);
- virtual int setBuffersFormat(int format);
- virtual int setScalingMode(int mode);
- virtual int setBuffersTransform(int transform);
- virtual int setBuffersTimestamp(int64_t timestamp);
- virtual int setCrop(Rect const* rect);
- virtual int setUsage(uint32_t reqUsage);
- virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds);
- virtual int unlockAndPost();
-
- enum { MIN_UNDEQUEUED_BUFFERS = SurfaceTexture::MIN_UNDEQUEUED_BUFFERS };
- enum { NUM_BUFFER_SLOTS = SurfaceTexture::NUM_BUFFER_SLOTS };
- enum { DEFAULT_FORMAT = PIXEL_FORMAT_RGBA_8888 };
-
-private:
- void freeAllBuffers();
- int getSlotFromBufferLocked(android_native_buffer_t* buffer) const;
-
- // mSurfaceTexture is the interface to the surface texture server. All
- // operations on the surface texture client ultimately translate into
- // interactions with the server using this interface.
- sp<ISurfaceTexture> mSurfaceTexture;
-
- // mSlots stores the buffers that have been allocated for each buffer slot.
- // It is initialized to null pointers, and gets filled in with the result of
- // ISurfaceTexture::requestBuffer when the client dequeues a buffer from a
- // slot that has not yet been used. The buffer allocated to a slot will also
- // be replaced if the requested buffer usage or geometry differs from that
- // of the buffer allocated to a slot.
- sp<GraphicBuffer> mSlots[NUM_BUFFER_SLOTS];
-
- // mReqWidth is the buffer width that will be requested at the next dequeue
- // operation. It is initialized to 1.
- uint32_t mReqWidth;
-
- // mReqHeight is the buffer height that will be requested at the next deuque
- // operation. It is initialized to 1.
- uint32_t mReqHeight;
-
- // mReqFormat is the buffer pixel format that will be requested at the next
- // deuque operation. It is initialized to PIXEL_FORMAT_RGBA_8888.
- uint32_t mReqFormat;
-
- // mReqUsage is the set of buffer usage flags that will be requested
- // at the next deuque operation. It is initialized to 0.
- uint32_t mReqUsage;
-
- // mTimestamp is the timestamp that will be used for the next buffer queue
- // operation. It defaults to NATIVE_WINDOW_TIMESTAMP_AUTO, which means that
- // a timestamp is auto-generated when queueBuffer is called.
- int64_t mTimestamp;
-
- // mDefaultWidth is default width of the window, regardless of the
- // native_window_set_buffers_dimensions call
- uint32_t mDefaultWidth;
-
- // mDefaultHeight is default width of the window, regardless of the
- // native_window_set_buffers_dimensions call
- uint32_t mDefaultHeight;
-
- // mTransformHint is the transform probably applied to buffers of this
- // window. this is only a hint, actual transform may differ.
- uint32_t mTransformHint;
-
- // mMutex is the mutex used to prevent concurrent access to the member
- // variables of SurfaceTexture objects. It must be locked whenever the
- // member variables are accessed.
- mutable Mutex mMutex;
-
- // must be used from the lock/unlock thread
- sp<GraphicBuffer> mLockedBuffer;
- sp<GraphicBuffer> mPostedBuffer;
- mutable Region mOldDirtyRegion;
- bool mConnectedToCpu;
-};
-
-}; // namespace android
-
-#endif // ANDROID_GUI_SURFACETEXTURECLIENT_H
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index e20f1fd..cc0a594 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -218,8 +218,8 @@
// IAudioFlingerClient
// indicate a change in the configuration of an output or input: keeps the cached
- // values for output/input parameters upto date in client process
- virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, void *param2);
+ // values for output/input parameters up-to-date in client process
+ virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2);
};
class AudioPolicyServiceClient: public IBinder::DeathRecipient
diff --git a/include/media/IAudioFlingerClient.h b/include/media/IAudioFlingerClient.h
index f3b4df1..75a9971 100644
--- a/include/media/IAudioFlingerClient.h
+++ b/include/media/IAudioFlingerClient.h
@@ -33,7 +33,7 @@
DECLARE_META_INTERFACE(AudioFlingerClient);
// Notifies a change of audio input/output configuration.
- virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, void *param2) = 0;
+ virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2) = 0;
};
diff --git a/include/private/binder/Static.h b/include/private/binder/Static.h
deleted file mode 100644
index 5b0f9fc..0000000
--- a/include/private/binder/Static.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-// All static variables go here, to control initialization and
-// destruction order in the library.
-
-#include <utils/threads.h>
-
-#include <binder/IBinder.h>
-#include <binder/IMemory.h>
-#include <binder/ProcessState.h>
-#include <binder/IPermissionController.h>
-#include <binder/IServiceManager.h>
-
-namespace android {
-
-// For ProcessState.cpp
-extern Mutex gProcessMutex;
-extern sp<ProcessState> gProcess;
-
-// For ServiceManager.cpp
-extern Mutex gDefaultServiceManagerLock;
-extern sp<IServiceManager> gDefaultServiceManager;
-extern sp<IPermissionController> gPermissionController;
-
-} // namespace android
diff --git a/include/private/binder/binder_module.h b/include/private/binder/binder_module.h
deleted file mode 100644
index a8dd64f..0000000
--- a/include/private/binder/binder_module.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef _BINDER_MODULE_H_
-#define _BINDER_MODULE_H_
-
-#ifdef __cplusplus
-namespace android {
-#endif
-
-/* obtain structures and constants from the kernel header */
-
-#include <sys/ioctl.h>
-#include <linux/binder.h>
-
-#ifdef __cplusplus
-} // namespace android
-#endif
-
-#endif // _BINDER_MODULE_H_
diff --git a/include/private/gui/ComposerService.h b/include/private/gui/ComposerService.h
deleted file mode 100644
index d04491a..0000000
--- a/include/private/gui/ComposerService.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
-#define ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Singleton.h>
-#include <utils/StrongPointer.h>
-
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class IMemoryHeap;
-class ISurfaceComposer;
-class surface_flinger_cblk_t;
-
-// ---------------------------------------------------------------------------
-
-class ComposerService : public Singleton<ComposerService>
-{
- // these are constants
- sp<ISurfaceComposer> mComposerService;
- sp<IMemoryHeap> mServerCblkMemory;
- surface_flinger_cblk_t volatile* mServerCblk;
- ComposerService();
- friend class Singleton<ComposerService>;
-public:
- static sp<ISurfaceComposer> getComposerService();
- static surface_flinger_cblk_t const volatile * getControlBlock();
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
diff --git a/include/private/gui/LayerState.h b/include/private/gui/LayerState.h
deleted file mode 100644
index ca277e0..0000000
--- a/include/private/gui/LayerState.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef ANDROID_SF_LAYER_STATE_H
-#define ANDROID_SF_LAYER_STATE_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-
-#include <ui/Region.h>
-#include <gui/ISurface.h>
-
-namespace android {
-
-class Parcel;
-class ISurfaceComposerClient;
-
-struct layer_state_t {
-
- layer_state_t()
- : surface(0), what(0),
- x(0), y(0), z(0), w(0), h(0),
- alpha(0), tint(0), flags(0), mask(0),
- reserved(0)
- {
- matrix.dsdx = matrix.dtdy = 1.0f;
- matrix.dsdy = matrix.dtdx = 0.0f;
- }
-
- status_t write(Parcel& output) const;
- status_t read(const Parcel& input);
-
- struct matrix22_t {
- float dsdx;
- float dtdx;
- float dsdy;
- float dtdy;
- };
- SurfaceID surface;
- uint32_t what;
- float x;
- float y;
- uint32_t z;
- uint32_t w;
- uint32_t h;
- float alpha;
- uint32_t tint;
- uint8_t flags;
- uint8_t mask;
- uint8_t reserved;
- matrix22_t matrix;
- // non POD must be last. see write/read
- Region transparentRegion;
-};
-
-struct ComposerState {
- sp<ISurfaceComposerClient> client;
- layer_state_t state;
- status_t write(Parcel& output) const;
- status_t read(const Parcel& input);
-};
-
-}; // namespace android
-
-#endif // ANDROID_SF_LAYER_STATE_H
-
diff --git a/include/private/gui/SharedBufferStack.h b/include/private/gui/SharedBufferStack.h
deleted file mode 100644
index 0da03d1..0000000
--- a/include/private/gui/SharedBufferStack.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_SF_SHARED_BUFFER_STACK_H
-#define ANDROID_SF_SHARED_BUFFER_STACK_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Debug.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-#define NUM_DISPLAY_MAX 4
-
-struct display_cblk_t
-{
- uint16_t w;
- uint16_t h;
- uint8_t format;
- uint8_t orientation;
- uint8_t reserved[2];
- float fps;
- float density;
- float xdpi;
- float ydpi;
- uint32_t pad[2];
-};
-
-struct surface_flinger_cblk_t // 4KB max
-{
- uint8_t connected;
- uint8_t reserved[3];
- uint32_t pad[7];
- display_cblk_t displays[NUM_DISPLAY_MAX];
-};
-
-// ---------------------------------------------------------------------------
-
-COMPILE_TIME_ASSERT(sizeof(surface_flinger_cblk_t) <= 4096)
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif /* ANDROID_SF_SHARED_BUFFER_STACK_H */
diff --git a/include/private/ui/RegionHelper.h b/include/private/ui/RegionHelper.h
deleted file mode 100644
index 8d76533..0000000
--- a/include/private/ui/RegionHelper.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#ifndef ANDROID_UI_PRIVATE_REGION_HELPER_H
-#define ANDROID_UI_PRIVATE_REGION_HELPER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-template<typename RECT>
-class region_operator
-{
- typedef typename RECT::value_type TYPE;
- static const TYPE max_value = 0x7FFFFFF;
-
-public:
- /*
- * Common boolean operations:
- * value is computed as 0b101 op 0b110
- * other boolean operation are possible, simply compute
- * their corresponding value with the above formulae and use
- * it when instantiating a region_operator.
- */
- static const uint32_t LHS = 0x5; // 0b101
- static const uint32_t RHS = 0x6; // 0b110
- enum {
- op_nand = LHS & ~RHS,
- op_and = LHS & RHS,
- op_or = LHS | RHS,
- op_xor = LHS ^ RHS
- };
-
- struct region {
- RECT const* rects;
- size_t count;
- TYPE dx;
- TYPE dy;
- inline region(const region& rhs)
- : rects(rhs.rects), count(rhs.count), dx(rhs.dx), dy(rhs.dy) { }
- inline region(RECT const* r, size_t c)
- : rects(r), count(c), dx(), dy() { }
- inline region(RECT const* r, size_t c, TYPE dx, TYPE dy)
- : rects(r), count(c), dx(dx), dy(dy) { }
- };
-
- class region_rasterizer {
- friend class region_operator;
- virtual void operator()(const RECT& rect) = 0;
- public:
- virtual ~region_rasterizer() { };
- };
-
- inline region_operator(int op, const region& lhs, const region& rhs)
- : op_mask(op), spanner(lhs, rhs)
- {
- }
-
- void operator()(region_rasterizer& rasterizer) {
- RECT current;
- do {
- SpannerInner spannerInner(spanner.lhs, spanner.rhs);
- int inside = spanner.next(current.top, current.bottom);
- spannerInner.prepare(inside);
- do {
- TYPE left, right;
- int inside = spannerInner.next(current.left, current.right);
- if ((op_mask >> inside) & 1) {
- if (current.left < current.right &&
- current.top < current.bottom) {
- rasterizer(current);
- }
- }
- } while(!spannerInner.isDone());
- } while(!spanner.isDone());
- }
-
-private:
- uint32_t op_mask;
-
- class SpannerBase
- {
- public:
- enum {
- lhs_before_rhs = 0,
- lhs_after_rhs = 1,
- lhs_coincide_rhs = 2
- };
-
- protected:
- TYPE lhs_head;
- TYPE lhs_tail;
- TYPE rhs_head;
- TYPE rhs_tail;
-
- inline int next(TYPE& head, TYPE& tail,
- bool& more_lhs, bool& more_rhs)
- {
- int inside;
- more_lhs = false;
- more_rhs = false;
- if (lhs_head < rhs_head) {
- inside = lhs_before_rhs;
- head = lhs_head;
- if (lhs_tail <= rhs_head) {
- tail = lhs_tail;
- more_lhs = true;
- } else {
- lhs_head = rhs_head;
- tail = rhs_head;
- }
- } else if (rhs_head < lhs_head) {
- inside = lhs_after_rhs;
- head = rhs_head;
- if (rhs_tail <= lhs_head) {
- tail = rhs_tail;
- more_rhs = true;
- } else {
- rhs_head = lhs_head;
- tail = lhs_head;
- }
- } else {
- inside = lhs_coincide_rhs;
- head = lhs_head;
- if (lhs_tail <= rhs_tail) {
- tail = rhs_head = lhs_tail;
- more_lhs = true;
- }
- if (rhs_tail <= lhs_tail) {
- tail = lhs_head = rhs_tail;
- more_rhs = true;
- }
- }
- return inside;
- }
- };
-
- class Spanner : protected SpannerBase
- {
- friend class region_operator;
- region lhs;
- region rhs;
-
- public:
- inline Spanner(const region& lhs, const region& rhs)
- : lhs(lhs), rhs(rhs)
- {
- SpannerBase::lhs_head = lhs.rects->top + lhs.dy;
- SpannerBase::lhs_tail = lhs.rects->bottom + lhs.dy;
- SpannerBase::rhs_head = rhs.rects->top + rhs.dy;
- SpannerBase::rhs_tail = rhs.rects->bottom + rhs.dy;
- }
-
- inline bool isDone() const {
- return !rhs.count && !lhs.count;
- }
-
- inline int next(TYPE& top, TYPE& bottom)
- {
- bool more_lhs = false;
- bool more_rhs = false;
- int inside = SpannerBase::next(top, bottom, more_lhs, more_rhs);
- if (more_lhs) {
- advance(lhs, SpannerBase::lhs_head, SpannerBase::lhs_tail);
- }
- if (more_rhs) {
- advance(rhs, SpannerBase::rhs_head, SpannerBase::rhs_tail);
- }
- return inside;
- }
-
- private:
- static inline
- void advance(region& reg, TYPE& aTop, TYPE& aBottom) {
- // got to next span
- size_t count = reg.count;
- RECT const * rects = reg.rects;
- RECT const * const end = rects + count;
- const int top = rects->top;
- while (rects != end && rects->top == top) {
- rects++;
- count--;
- }
- if (rects != end) {
- aTop = rects->top + reg.dy;
- aBottom = rects->bottom + reg.dy;
- } else {
- aTop = max_value;
- aBottom = max_value;
- }
- reg.rects = rects;
- reg.count = count;
- }
- };
-
- class SpannerInner : protected SpannerBase
- {
- region lhs;
- region rhs;
-
- public:
- inline SpannerInner(const region& lhs, const region& rhs)
- : lhs(lhs), rhs(rhs)
- {
- }
-
- inline void prepare(int inside) {
- if (inside == SpannerBase::lhs_before_rhs) {
- SpannerBase::lhs_head = lhs.rects->left + lhs.dx;
- SpannerBase::lhs_tail = lhs.rects->right + lhs.dx;
- SpannerBase::rhs_head = max_value;
- SpannerBase::rhs_tail = max_value;
- } else if (inside == SpannerBase::lhs_after_rhs) {
- SpannerBase::lhs_head = max_value;
- SpannerBase::lhs_tail = max_value;
- SpannerBase::rhs_head = rhs.rects->left + rhs.dx;
- SpannerBase::rhs_tail = rhs.rects->right + rhs.dx;
- } else {
- SpannerBase::lhs_head = lhs.rects->left + lhs.dx;
- SpannerBase::lhs_tail = lhs.rects->right + lhs.dx;
- SpannerBase::rhs_head = rhs.rects->left + rhs.dx;
- SpannerBase::rhs_tail = rhs.rects->right + rhs.dx;
- }
- }
-
- inline bool isDone() const {
- return SpannerBase::lhs_head == max_value &&
- SpannerBase::rhs_head == max_value;
- }
-
- inline int next(TYPE& left, TYPE& right)
- {
- bool more_lhs = false;
- bool more_rhs = false;
- int inside = SpannerBase::next(left, right, more_lhs, more_rhs);
- if (more_lhs) {
- advance(lhs, SpannerBase::lhs_head, SpannerBase::lhs_tail);
- }
- if (more_rhs) {
- advance(rhs, SpannerBase::rhs_head, SpannerBase::rhs_tail);
- }
- return inside;
- }
-
- private:
- static inline
- void advance(region& reg, TYPE& left, TYPE& right) {
- if (reg.rects && reg.count) {
- const int cur_span_top = reg.rects->top;
- reg.rects++;
- reg.count--;
- if (!reg.count || reg.rects->top != cur_span_top) {
- left = max_value;
- right = max_value;
- } else {
- left = reg.rects->left + reg.dx;
- right = reg.rects->right + reg.dx;
- }
- }
- }
- };
-
- Spanner spanner;
-};
-
-// ----------------------------------------------------------------------------
-};
-
-#endif /* ANDROID_UI_PRIVATE_REGION_HELPER_H */
diff --git a/include/private/utils/Static.h b/include/private/utils/Static.h
deleted file mode 100644
index d95ae0d..0000000
--- a/include/private/utils/Static.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-// All static variables go here, to control initialization and
-// destruction order in the library.
-
-#include <utils/threads.h>
-#include <utils/KeyedVector.h>
-
-namespace android {
-// For TextStream.cpp
-extern Vector<int32_t> gTextBuffers;
-
-// For String8.cpp
-extern void initialize_string8();
-extern void terminate_string8();
-
-// For String16.cpp
-extern void initialize_string16();
-extern void terminate_string16();
-
-} // namespace android
diff --git a/include/ui/ANativeObjectBase.h b/include/ui/ANativeObjectBase.h
deleted file mode 100644
index 76e850f..0000000
--- a/include/ui/ANativeObjectBase.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#ifndef ANDROID_ANDROID_NATIVES_H
-#define ANDROID_ANDROID_NATIVES_H
-
-#include <sys/types.h>
-#include <string.h>
-
-#include <hardware/gralloc.h>
-#include <system/window.h>
-
-// ---------------------------------------------------------------------------
-
-/* FIXME: this is legacy for pixmaps */
-typedef struct egl_native_pixmap_t
-{
- int32_t version; /* must be 32 */
- int32_t width;
- int32_t height;
- int32_t stride;
- uint8_t* data;
- uint8_t format;
- uint8_t rfu[3];
- union {
- uint32_t compressedFormat;
- int32_t vstride;
- };
- int32_t reserved;
-} egl_native_pixmap_t;
-
-/*****************************************************************************/
-
-#ifdef __cplusplus
-
-#include <utils/RefBase.h>
-
-namespace android {
-
-/*
- * This helper class turns a ANativeXXX object type into a C++
- * reference-counted object; with proper type conversions.
- */
-template <typename NATIVE_TYPE, typename TYPE, typename REF>
-class ANativeObjectBase : public NATIVE_TYPE, public REF
-{
-public:
- // Disambiguate between the incStrong in REF and NATIVE_TYPE
- void incStrong(const void* id) const {
- REF::incStrong(id);
- }
- void decStrong(const void* id) const {
- REF::decStrong(id);
- }
-
-protected:
- typedef ANativeObjectBase<NATIVE_TYPE, TYPE, REF> BASE;
- ANativeObjectBase() : NATIVE_TYPE(), REF() {
- NATIVE_TYPE::common.incRef = incRef;
- NATIVE_TYPE::common.decRef = decRef;
- }
- static inline TYPE* getSelf(NATIVE_TYPE* self) {
- return static_cast<TYPE*>(self);
- }
- static inline TYPE const* getSelf(NATIVE_TYPE const* self) {
- return static_cast<TYPE const *>(self);
- }
- static inline TYPE* getSelf(android_native_base_t* base) {
- return getSelf(reinterpret_cast<NATIVE_TYPE*>(base));
- }
- static inline TYPE const * getSelf(android_native_base_t const* base) {
- return getSelf(reinterpret_cast<NATIVE_TYPE const*>(base));
- }
- static void incRef(android_native_base_t* base) {
- ANativeObjectBase* self = getSelf(base);
- self->incStrong(self);
- }
- static void decRef(android_native_base_t* base) {
- ANativeObjectBase* self = getSelf(base);
- self->decStrong(self);
- }
-};
-
-} // namespace android
-#endif // __cplusplus
-
-/*****************************************************************************/
-
-#endif /* ANDROID_ANDROID_NATIVES_H */
diff --git a/include/ui/DisplayInfo.h b/include/ui/DisplayInfo.h
deleted file mode 100644
index edd28a6..0000000
--- a/include/ui/DisplayInfo.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-
-#ifndef ANDROID_UI_DISPLAY_INFO_H
-#define ANDROID_UI_DISPLAY_INFO_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <ui/PixelFormat.h>
-
-namespace android {
-
-struct DisplayInfo {
- uint32_t w;
- uint32_t h;
- PixelFormatInfo pixelFormatInfo;
- uint8_t orientation;
- uint8_t reserved[3];
- float fps;
- float density;
- float xdpi;
- float ydpi;
-};
-
-/* Display orientations as defined in Surface.java and ISurfaceComposer.h. */
-enum {
- DISPLAY_ORIENTATION_0 = 0,
- DISPLAY_ORIENTATION_90 = 1,
- DISPLAY_ORIENTATION_180 = 2,
- DISPLAY_ORIENTATION_270 = 3
-};
-
-
-}; // namespace android
-
-#endif // ANDROID_COMPOSER_DISPLAY_INFO_H
-
diff --git a/include/ui/FramebufferNativeWindow.h b/include/ui/FramebufferNativeWindow.h
deleted file mode 100644
index b202b95..0000000
--- a/include/ui/FramebufferNativeWindow.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H
-#define ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <EGL/egl.h>
-
-#include <utils/threads.h>
-#include <utils/String8.h>
-
-#include <ui/ANativeObjectBase.h>
-#include <ui/Rect.h>
-
-#define NUM_FRAME_BUFFERS 2
-
-extern "C" EGLNativeWindowType android_createDisplaySurface(void);
-
-// ---------------------------------------------------------------------------
-namespace android {
-// ---------------------------------------------------------------------------
-
-class Surface;
-class NativeBuffer;
-
-// ---------------------------------------------------------------------------
-
-class FramebufferNativeWindow
- : public ANativeObjectBase<
- ANativeWindow,
- FramebufferNativeWindow,
- LightRefBase<FramebufferNativeWindow> >
-{
-public:
- FramebufferNativeWindow();
-
- framebuffer_device_t const * getDevice() const { return fbDev; }
-
- bool isUpdateOnDemand() const { return mUpdateOnDemand; }
- status_t setUpdateRectangle(const Rect& updateRect);
- status_t compositionComplete();
-
- void dump(String8& result);
-
- // for debugging only
- int getCurrentBufferIndex() const;
-
-private:
- friend class LightRefBase<FramebufferNativeWindow>;
- ~FramebufferNativeWindow(); // this class cannot be overloaded
- static int setSwapInterval(ANativeWindow* window, int interval);
- static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer);
- static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
- static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
- static int query(const ANativeWindow* window, int what, int* value);
- static int perform(ANativeWindow* window, int operation, ...);
-
- framebuffer_device_t* fbDev;
- alloc_device_t* grDev;
-
- sp<NativeBuffer> buffers[NUM_FRAME_BUFFERS];
- sp<NativeBuffer> front;
-
- mutable Mutex mutex;
- Condition mCondition;
- int32_t mNumBuffers;
- int32_t mNumFreeBuffers;
- int32_t mBufferHead;
- int32_t mCurrentBufferIndex;
- bool mUpdateOnDemand;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H
-
diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h
deleted file mode 100644
index f318cd8..0000000
--- a/include/ui/GraphicBuffer.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_GRAPHIC_BUFFER_H
-#define ANDROID_GRAPHIC_BUFFER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <ui/ANativeObjectBase.h>
-#include <ui/PixelFormat.h>
-#include <ui/Rect.h>
-#include <utils/Flattenable.h>
-
-
-struct ANativeWindowBuffer;
-
-namespace android {
-
-class GraphicBufferMapper;
-
-// ===========================================================================
-// GraphicBuffer
-// ===========================================================================
-
-class GraphicBuffer
- : public ANativeObjectBase<
- ANativeWindowBuffer,
- GraphicBuffer,
- LightRefBase<GraphicBuffer> >, public Flattenable
-{
-public:
-
- enum {
- USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER,
- USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY,
- USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN,
- USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK,
-
- USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER,
- USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY,
- USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN,
- USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK,
-
- USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK,
-
- USAGE_PROTECTED = GRALLOC_USAGE_PROTECTED,
-
- USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE,
- USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER,
- USAGE_HW_2D = GRALLOC_USAGE_HW_2D,
- USAGE_HW_COMPOSER = GRALLOC_USAGE_HW_COMPOSER,
- USAGE_HW_VIDEO_ENCODER = GRALLOC_USAGE_HW_VIDEO_ENCODER,
- USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK
- };
-
- GraphicBuffer();
-
- // creates w * h buffer
- GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage);
-
- // create a buffer from an existing handle
- GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage,
- uint32_t stride, native_handle_t* handle, bool keepOwnership);
-
- // create a buffer from an existing ANativeWindowBuffer
- GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership);
-
- // return status
- status_t initCheck() const;
-
- uint32_t getWidth() const { return width; }
- uint32_t getHeight() const { return height; }
- uint32_t getStride() const { return stride; }
- uint32_t getUsage() const { return usage; }
- PixelFormat getPixelFormat() const { return format; }
- Rect getBounds() const { return Rect(width, height); }
-
- status_t reallocate(uint32_t w, uint32_t h, PixelFormat f, uint32_t usage);
-
- status_t lock(uint32_t usage, void** vaddr);
- status_t lock(uint32_t usage, const Rect& rect, void** vaddr);
- status_t unlock();
-
- ANativeWindowBuffer* getNativeBuffer() const;
-
- void setIndex(int index);
- int getIndex() const;
-
- // for debugging
- static void dumpAllocationsToSystemLog();
-
-private:
- virtual ~GraphicBuffer();
-
- enum {
- ownNone = 0,
- ownHandle = 1,
- ownData = 2,
- };
-
- inline const GraphicBufferMapper& getBufferMapper() const {
- return mBufferMapper;
- }
- inline GraphicBufferMapper& getBufferMapper() {
- return mBufferMapper;
- }
- uint8_t mOwner;
-
-private:
- friend class Surface;
- friend class BpSurface;
- friend class BnSurface;
- friend class SurfaceTextureClient;
- friend class LightRefBase<GraphicBuffer>;
- GraphicBuffer(const GraphicBuffer& rhs);
- GraphicBuffer& operator = (const GraphicBuffer& rhs);
- const GraphicBuffer& operator = (const GraphicBuffer& rhs) const;
-
- status_t initSize(uint32_t w, uint32_t h, PixelFormat format,
- uint32_t usage);
-
- void free_handle();
-
- // Flattenable interface
- size_t getFlattenedSize() const;
- size_t getFdCount() const;
- status_t flatten(void* buffer, size_t size,
- int fds[], size_t count) const;
- status_t unflatten(void const* buffer, size_t size,
- int fds[], size_t count);
-
-
- GraphicBufferMapper& mBufferMapper;
- ssize_t mInitCheck;
- int mIndex;
-
- // If we're wrapping another buffer then this reference will make sure it
- // doesn't get freed.
- sp<ANativeWindowBuffer> mWrappedBuffer;
-};
-
-}; // namespace android
-
-#endif // ANDROID_GRAPHIC_BUFFER_H
diff --git a/include/ui/GraphicBufferAllocator.h b/include/ui/GraphicBufferAllocator.h
deleted file mode 100644
index dffa788..0000000
--- a/include/ui/GraphicBufferAllocator.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-**
-** Copyright 2009, 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.
-*/
-
-#ifndef ANDROID_BUFFER_ALLOCATOR_H
-#define ANDROID_BUFFER_ALLOCATOR_H
-
-#include <stdint.h>
-
-#include <cutils/native_handle.h>
-
-#include <utils/Errors.h>
-#include <utils/KeyedVector.h>
-#include <utils/threads.h>
-#include <utils/Singleton.h>
-
-#include <ui/PixelFormat.h>
-
-#include <hardware/gralloc.h>
-
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-class String8;
-
-class GraphicBufferAllocator : public Singleton<GraphicBufferAllocator>
-{
-public:
- enum {
- USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER,
- USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY,
- USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN,
- USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK,
-
- USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER,
- USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY,
- USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN,
- USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK,
-
- USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK,
-
- USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE,
- USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER,
- USAGE_HW_2D = GRALLOC_USAGE_HW_2D,
- USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK
- };
-
- static inline GraphicBufferAllocator& get() { return getInstance(); }
-
-
- status_t alloc(uint32_t w, uint32_t h, PixelFormat format, int usage,
- buffer_handle_t* handle, int32_t* stride);
-
- status_t free(buffer_handle_t handle);
-
- void dump(String8& res) const;
- static void dumpToSystemLog();
-
-private:
- struct alloc_rec_t {
- uint32_t w;
- uint32_t h;
- uint32_t s;
- PixelFormat format;
- uint32_t usage;
- size_t size;
- };
-
- static Mutex sLock;
- static KeyedVector<buffer_handle_t, alloc_rec_t> sAllocList;
-
- friend class Singleton<GraphicBufferAllocator>;
- GraphicBufferAllocator();
- ~GraphicBufferAllocator();
-
- alloc_device_t *mAllocDev;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_BUFFER_ALLOCATOR_H
diff --git a/include/ui/GraphicBufferMapper.h b/include/ui/GraphicBufferMapper.h
deleted file mode 100644
index 697a02a..0000000
--- a/include/ui/GraphicBufferMapper.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_UI_BUFFER_MAPPER_H
-#define ANDROID_UI_BUFFER_MAPPER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Singleton.h>
-
-#include <hardware/gralloc.h>
-
-
-struct gralloc_module_t;
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class Rect;
-
-class GraphicBufferMapper : public Singleton<GraphicBufferMapper>
-{
-public:
- static inline GraphicBufferMapper& get() { return getInstance(); }
-
- status_t registerBuffer(buffer_handle_t handle);
-
- status_t unregisterBuffer(buffer_handle_t handle);
-
- status_t lock(buffer_handle_t handle,
- int usage, const Rect& bounds, void** vaddr);
-
- status_t unlock(buffer_handle_t handle);
-
- // dumps information about the mapping of this handle
- void dump(buffer_handle_t handle);
-
-private:
- friend class Singleton<GraphicBufferMapper>;
- GraphicBufferMapper();
- gralloc_module_t const *mAllocMod;
-};
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_UI_BUFFER_MAPPER_H
-
diff --git a/include/ui/PixelFormat.h b/include/ui/PixelFormat.h
deleted file mode 100644
index 9f3e267..0000000
--- a/include/ui/PixelFormat.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-
-// Pixel formats used across the system.
-// These formats might not all be supported by all renderers, for instance
-// skia or SurfaceFlinger are not required to support all of these formats
-// (either as source or destination)
-
-
-#ifndef UI_PIXELFORMAT_H
-#define UI_PIXELFORMAT_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <utils/Errors.h>
-#include <hardware/hardware.h>
-
-namespace android {
-
-enum {
- //
- // these constants need to match those
- // in graphics/PixelFormat.java & pixelflinger/format.h
- //
- PIXEL_FORMAT_UNKNOWN = 0,
- PIXEL_FORMAT_NONE = 0,
-
- // logical pixel formats used by the SurfaceFlinger -----------------------
- PIXEL_FORMAT_CUSTOM = -4,
- // Custom pixel-format described by a PixelFormatInfo structure
-
- PIXEL_FORMAT_TRANSLUCENT = -3,
- // System chooses a format that supports translucency (many alpha bits)
-
- PIXEL_FORMAT_TRANSPARENT = -2,
- // System chooses a format that supports transparency
- // (at least 1 alpha bit)
-
- PIXEL_FORMAT_OPAQUE = -1,
- // System chooses an opaque format (no alpha bits required)
-
- // real pixel formats supported for rendering -----------------------------
-
- PIXEL_FORMAT_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888, // 4x8-bit RGBA
- PIXEL_FORMAT_RGBX_8888 = HAL_PIXEL_FORMAT_RGBX_8888, // 4x8-bit RGB0
- PIXEL_FORMAT_RGB_888 = HAL_PIXEL_FORMAT_RGB_888, // 3x8-bit RGB
- PIXEL_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, // 16-bit RGB
- PIXEL_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, // 4x8-bit BGRA
- PIXEL_FORMAT_RGBA_5551 = HAL_PIXEL_FORMAT_RGBA_5551, // 16-bit ARGB
- PIXEL_FORMAT_RGBA_4444 = HAL_PIXEL_FORMAT_RGBA_4444, // 16-bit ARGB
- PIXEL_FORMAT_A_8 = 8, // 8-bit A
-};
-
-typedef int32_t PixelFormat;
-
-struct PixelFormatInfo {
- enum {
- INDEX_ALPHA = 0,
- INDEX_RED = 1,
- INDEX_GREEN = 2,
- INDEX_BLUE = 3
- };
-
- enum { // components
- ALPHA = 1,
- RGB = 2,
- RGBA = 3,
- L = 4,
- LA = 5,
- OTHER = 0xFF
- };
-
- struct szinfo {
- uint8_t h;
- uint8_t l;
- };
-
- inline PixelFormatInfo() : version(sizeof(PixelFormatInfo)) { }
- size_t getScanlineSize(unsigned int width) const;
- size_t getSize(size_t ci) const {
- return (ci <= 3) ? (cinfo[ci].h - cinfo[ci].l) : 0;
- }
- size_t version;
- PixelFormat format;
- size_t bytesPerPixel;
- size_t bitsPerPixel;
- union {
- szinfo cinfo[4];
- struct {
- uint8_t h_alpha;
- uint8_t l_alpha;
- uint8_t h_red;
- uint8_t l_red;
- uint8_t h_green;
- uint8_t l_green;
- uint8_t h_blue;
- uint8_t l_blue;
- };
- };
- uint8_t components;
- uint8_t reserved0[3];
- uint32_t reserved1;
-};
-
-// Consider caching the results of these functions are they're not
-// guaranteed to be fast.
-ssize_t bytesPerPixel(PixelFormat format);
-ssize_t bitsPerPixel(PixelFormat format);
-status_t getPixelFormatInfo(PixelFormat format, PixelFormatInfo* info);
-
-}; // namespace android
-
-#endif // UI_PIXELFORMAT_H
diff --git a/include/ui/Point.h b/include/ui/Point.h
deleted file mode 100644
index 1653120..0000000
--- a/include/ui/Point.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-#ifndef ANDROID_UI_POINT
-#define ANDROID_UI_POINT
-
-#include <utils/TypeHelpers.h>
-
-namespace android {
-
-class Point
-{
-public:
- int x;
- int y;
-
- // we don't provide copy-ctor and operator= on purpose
- // because we want the compiler generated versions
-
- // Default constructor doesn't initialize the Point
- inline Point() {
- }
- inline Point(int x, int y) : x(x), y(y) {
- }
-
- inline bool operator == (const Point& rhs) const {
- return (x == rhs.x) && (y == rhs.y);
- }
- inline bool operator != (const Point& rhs) const {
- return !operator == (rhs);
- }
-
- inline bool isOrigin() const {
- return !(x|y);
- }
-
- // operator < defines an order which allows to use points in sorted
- // vectors.
- bool operator < (const Point& rhs) const {
- return y<rhs.y || (y==rhs.y && x<rhs.x);
- }
-
- inline Point& operator - () {
- x = -x;
- y = -y;
- return *this;
- }
-
- inline Point& operator += (const Point& rhs) {
- x += rhs.x;
- y += rhs.y;
- return *this;
- }
- inline Point& operator -= (const Point& rhs) {
- x -= rhs.x;
- y -= rhs.y;
- return *this;
- }
-
- const Point operator + (const Point& rhs) const {
- const Point result(x+rhs.x, y+rhs.y);
- return result;
- }
- const Point operator - (const Point& rhs) const {
- const Point result(x-rhs.x, y-rhs.y);
- return result;
- }
-};
-
-ANDROID_BASIC_TYPES_TRAITS(Point)
-
-}; // namespace android
-
-#endif // ANDROID_UI_POINT
diff --git a/include/ui/Rect.h b/include/ui/Rect.h
deleted file mode 100644
index 9e98bc5..0000000
--- a/include/ui/Rect.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-#ifndef ANDROID_UI_RECT
-#define ANDROID_UI_RECT
-
-#include <utils/TypeHelpers.h>
-#include <ui/Point.h>
-
-#include <android/rect.h>
-
-namespace android {
-
-class Rect : public ARect
-{
-public:
- typedef ARect::value_type value_type;
-
- // we don't provide copy-ctor and operator= on purpose
- // because we want the compiler generated versions
-
- inline Rect() {
- }
- inline Rect(int32_t w, int32_t h) {
- left = top = 0; right = w; bottom = h;
- }
- inline Rect(int32_t l, int32_t t, int32_t r, int32_t b) {
- left = l; top = t; right = r; bottom = b;
- }
- inline Rect(const Point& lt, const Point& rb) {
- left = lt.x; top = lt.y; right = rb.x; bottom = rb.y;
- }
-
- void makeInvalid();
-
- inline void clear() {
- left = top = right = bottom = 0;
- }
-
- // a valid rectangle has a non negative width and height
- inline bool isValid() const {
- return (width()>=0) && (height()>=0);
- }
-
- // an empty rect has a zero width or height, or is invalid
- inline bool isEmpty() const {
- return (width()<=0) || (height()<=0);
- }
-
- inline void set(const Rect& rhs) {
- operator = (rhs);
- }
-
- // rectangle's width
- inline int32_t width() const {
- return right-left;
- }
-
- // rectangle's height
- inline int32_t height() const {
- return bottom-top;
- }
-
- void setLeftTop(const Point& lt) {
- left = lt.x;
- top = lt.y;
- }
-
- void setRightBottom(const Point& rb) {
- right = rb.x;
- bottom = rb.y;
- }
-
- // the following 4 functions return the 4 corners of the rect as Point
- Point leftTop() const {
- return Point(left, top);
- }
- Point rightBottom() const {
- return Point(right, bottom);
- }
- Point rightTop() const {
- return Point(right, top);
- }
- Point leftBottom() const {
- return Point(left, bottom);
- }
-
- // comparisons
- inline bool operator == (const Rect& rhs) const {
- return (left == rhs.left) && (top == rhs.top) &&
- (right == rhs.right) && (bottom == rhs.bottom);
- }
-
- inline bool operator != (const Rect& rhs) const {
- return !operator == (rhs);
- }
-
- // operator < defines an order which allows to use rectangles in sorted
- // vectors.
- bool operator < (const Rect& rhs) const;
-
- Rect& offsetToOrigin() {
- right -= left;
- bottom -= top;
- left = top = 0;
- return *this;
- }
- Rect& offsetTo(const Point& p) {
- return offsetTo(p.x, p.y);
- }
- Rect& offsetBy(const Point& dp) {
- return offsetBy(dp.x, dp.y);
- }
- Rect& operator += (const Point& rhs) {
- return offsetBy(rhs.x, rhs.y);
- }
- Rect& operator -= (const Point& rhs) {
- return offsetBy(-rhs.x, -rhs.y);
- }
- const Rect operator + (const Point& rhs) const;
- const Rect operator - (const Point& rhs) const;
-
- void translate(int32_t dx, int32_t dy) { // legacy, don't use.
- offsetBy(dx, dy);
- }
-
- Rect& offsetTo(int32_t x, int32_t y);
- Rect& offsetBy(int32_t x, int32_t y);
- bool intersect(const Rect& with, Rect* result) const;
-};
-
-ANDROID_BASIC_TYPES_TRAITS(Rect)
-
-}; // namespace android
-
-#endif // ANDROID_UI_RECT
diff --git a/include/ui/Region.h b/include/ui/Region.h
deleted file mode 100644
index f242f18..0000000
--- a/include/ui/Region.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_UI_REGION_H
-#define ANDROID_UI_REGION_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Vector.h>
-
-#include <ui/Rect.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-class String8;
-
-// ---------------------------------------------------------------------------
-class Region
-{
-public:
- Region();
- Region(const Region& rhs);
- explicit Region(const Rect& rhs);
- explicit Region(const void* buffer);
- ~Region();
-
- Region& operator = (const Region& rhs);
-
- inline bool isEmpty() const { return mBounds.isEmpty(); }
- inline bool isRect() const { return mStorage.isEmpty(); }
-
- inline Rect getBounds() const { return mBounds; }
- inline Rect bounds() const { return getBounds(); }
-
- // the region becomes its bounds
- Region& makeBoundsSelf();
-
- void clear();
- void set(const Rect& r);
- void set(uint32_t w, uint32_t h);
-
- Region& orSelf(const Rect& rhs);
- Region& xorSelf(const Rect& rhs);
- Region& andSelf(const Rect& rhs);
- Region& subtractSelf(const Rect& rhs);
-
- // boolean operators, applied on this
- Region& orSelf(const Region& rhs);
- Region& xorSelf(const Region& rhs);
- Region& andSelf(const Region& rhs);
- Region& subtractSelf(const Region& rhs);
-
- // boolean operators
- const Region merge(const Rect& rhs) const;
- const Region mergeExclusive(const Rect& rhs) const;
- const Region intersect(const Rect& rhs) const;
- const Region subtract(const Rect& rhs) const;
-
- // boolean operators
- const Region merge(const Region& rhs) const;
- const Region mergeExclusive(const Region& rhs) const;
- const Region intersect(const Region& rhs) const;
- const Region subtract(const Region& rhs) const;
-
- // these translate rhs first
- Region& translateSelf(int dx, int dy);
- Region& orSelf(const Region& rhs, int dx, int dy);
- Region& xorSelf(const Region& rhs, int dx, int dy);
- Region& andSelf(const Region& rhs, int dx, int dy);
- Region& subtractSelf(const Region& rhs, int dx, int dy);
-
- // these translate rhs first
- const Region translate(int dx, int dy) const;
- const Region merge(const Region& rhs, int dx, int dy) const;
- const Region mergeExclusive(const Region& rhs, int dx, int dy) const;
- const Region intersect(const Region& rhs, int dx, int dy) const;
- const Region subtract(const Region& rhs, int dx, int dy) const;
-
- // convenience operators overloads
- inline const Region operator | (const Region& rhs) const;
- inline const Region operator ^ (const Region& rhs) const;
- inline const Region operator & (const Region& rhs) const;
- inline const Region operator - (const Region& rhs) const;
- inline const Region operator + (const Point& pt) const;
-
- inline Region& operator |= (const Region& rhs);
- inline Region& operator ^= (const Region& rhs);
- inline Region& operator &= (const Region& rhs);
- inline Region& operator -= (const Region& rhs);
- inline Region& operator += (const Point& pt);
-
-
- /* various ways to access the rectangle list */
-
- typedef Rect const* const_iterator;
-
- const_iterator begin() const;
- const_iterator end() const;
-
- /* no user serviceable parts here... */
-
- size_t getRects(Vector<Rect>& rectList) const;
- Rect const* getArray(size_t* count) const;
-
-
- // add a rectangle to the internal list. This rectangle must
- // be sorted in Y and X and must not make the region invalid.
- void addRectUnchecked(int l, int t, int r, int b);
-
- // flatten/unflatten a region to/from a raw buffer
- ssize_t write(void* buffer, size_t size) const;
- static ssize_t writeEmpty(void* buffer, size_t size);
-
- ssize_t read(const void* buffer);
- static bool isEmpty(void* buffer);
-
- void dump(String8& out, const char* what, uint32_t flags=0) const;
- void dump(const char* what, uint32_t flags=0) const;
-
-private:
- class rasterizer;
- friend class rasterizer;
-
- Region& operationSelf(const Rect& r, int op);
- Region& operationSelf(const Region& r, int op);
- Region& operationSelf(const Region& r, int dx, int dy, int op);
- const Region operation(const Rect& rhs, int op) const;
- const Region operation(const Region& rhs, int op) const;
- const Region operation(const Region& rhs, int dx, int dy, int op) const;
-
- static void boolean_operation(int op, Region& dst,
- const Region& lhs, const Region& rhs, int dx, int dy);
- static void boolean_operation(int op, Region& dst,
- const Region& lhs, const Rect& rhs, int dx, int dy);
-
- static void boolean_operation(int op, Region& dst,
- const Region& lhs, const Region& rhs);
- static void boolean_operation(int op, Region& dst,
- const Region& lhs, const Rect& rhs);
-
- static void translate(Region& reg, int dx, int dy);
- static void translate(Region& dst, const Region& reg, int dx, int dy);
-
- static bool validate(const Region& reg, const char* name);
-
- Rect mBounds;
- Vector<Rect> mStorage;
-};
-
-
-const Region Region::operator | (const Region& rhs) const {
- return merge(rhs);
-}
-const Region Region::operator ^ (const Region& rhs) const {
- return mergeExclusive(rhs);
-}
-const Region Region::operator & (const Region& rhs) const {
- return intersect(rhs);
-}
-const Region Region::operator - (const Region& rhs) const {
- return subtract(rhs);
-}
-const Region Region::operator + (const Point& pt) const {
- return translate(pt.x, pt.y);
-}
-
-
-Region& Region::operator |= (const Region& rhs) {
- return orSelf(rhs);
-}
-Region& Region::operator ^= (const Region& rhs) {
- return xorSelf(rhs);
-}
-Region& Region::operator &= (const Region& rhs) {
- return andSelf(rhs);
-}
-Region& Region::operator -= (const Region& rhs) {
- return subtractSelf(rhs);
-}
-Region& Region::operator += (const Point& pt) {
- return translateSelf(pt.x, pt.y);
-}
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_UI_REGION_H
-
diff --git a/include/utils/AndroidThreads.h b/include/utils/AndroidThreads.h
deleted file mode 100644
index f9f7aa4..0000000
--- a/include/utils/AndroidThreads.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef _LIBS_UTILS_ANDROID_THREADS_H
-#define _LIBS_UTILS_ANDROID_THREADS_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#if defined(HAVE_PTHREADS)
-# include <pthread.h>
-#endif
-
-#include <utils/ThreadDefs.h>
-
-// ---------------------------------------------------------------------------
-// C API
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Create and run a new thread.
-extern int androidCreateThread(android_thread_func_t, void *);
-
-// Create thread with lots of parameters
-extern int androidCreateThreadEtc(android_thread_func_t entryFunction,
- void *userData,
- const char* threadName,
- int32_t threadPriority,
- size_t threadStackSize,
- android_thread_id_t *threadId);
-
-// Get some sort of unique identifier for the current thread.
-extern android_thread_id_t androidGetThreadId();
-
-// Low-level thread creation -- never creates threads that can
-// interact with the Java VM.
-extern int androidCreateRawThreadEtc(android_thread_func_t entryFunction,
- void *userData,
- const char* threadName,
- int32_t threadPriority,
- size_t threadStackSize,
- android_thread_id_t *threadId);
-
-// Used by the Java Runtime to control how threads are created, so that
-// they can be proper and lovely Java threads.
-typedef int (*android_create_thread_fn)(android_thread_func_t entryFunction,
- void *userData,
- const char* threadName,
- int32_t threadPriority,
- size_t threadStackSize,
- android_thread_id_t *threadId);
-
-extern void androidSetCreateThreadFunc(android_create_thread_fn func);
-
-// ------------------------------------------------------------------
-// Extra functions working with raw pids.
-
-// Get pid for the current thread.
-extern pid_t androidGetTid();
-
-// Change the scheduling group of a particular thread. The group
-// should be one of the ANDROID_TGROUP constants. Returns BAD_VALUE if
-// grp is out of range, else another non-zero value with errno set if
-// the operation failed. Thread ID zero means current thread.
-extern int androidSetThreadSchedulingGroup(pid_t tid, int grp);
-
-// Change the priority AND scheduling group of a particular thread. The priority
-// should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION
-// if the priority set failed, else another value if just the group set failed;
-// in either case errno is set. Thread ID zero means current thread.
-extern int androidSetThreadPriority(pid_t tid, int prio);
-
-// Get the current priority of a particular thread. Returns one of the
-// ANDROID_PRIORITY constants or a negative result in case of error.
-extern int androidGetThreadPriority(pid_t tid);
-
-// Get the current scheduling group of a particular thread. Normally returns
-// one of the ANDROID_TGROUP constants other than ANDROID_TGROUP_DEFAULT.
-// Returns ANDROID_TGROUP_DEFAULT if no pthread support (e.g. on host) or if
-// scheduling groups are disabled. Returns INVALID_OPERATION if unexpected error.
-// Thread ID zero means current thread.
-extern int androidGetThreadSchedulingGroup(pid_t tid);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-// ----------------------------------------------------------------------------
-// C++ API
-#ifdef __cplusplus
-namespace android {
-// ----------------------------------------------------------------------------
-
-// Create and run a new thread.
-inline bool createThread(thread_func_t f, void *a) {
- return androidCreateThread(f, a) ? true : false;
-}
-
-// Create thread with lots of parameters
-inline bool createThreadEtc(thread_func_t entryFunction,
- void *userData,
- const char* threadName = "android:unnamed_thread",
- int32_t threadPriority = PRIORITY_DEFAULT,
- size_t threadStackSize = 0,
- thread_id_t *threadId = 0)
-{
- return androidCreateThreadEtc(entryFunction, userData, threadName,
- threadPriority, threadStackSize, threadId) ? true : false;
-}
-
-// Get some sort of unique identifier for the current thread.
-inline thread_id_t getThreadId() {
- return androidGetThreadId();
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-#endif // __cplusplus
-// ----------------------------------------------------------------------------
-
-#endif // _LIBS_UTILS_ANDROID_THREADS_H
diff --git a/include/utils/Atomic.h b/include/utils/Atomic.h
deleted file mode 100644
index 7eb476c..0000000
--- a/include/utils/Atomic.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_UTILS_ATOMIC_H
-#define ANDROID_UTILS_ATOMIC_H
-
-#include <cutils/atomic.h>
-
-#endif // ANDROID_UTILS_ATOMIC_H
diff --git a/include/utils/BasicHashtable.h b/include/utils/BasicHashtable.h
deleted file mode 100644
index fdf9738..0000000
--- a/include/utils/BasicHashtable.h
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_BASIC_HASHTABLE_H
-#define ANDROID_BASIC_HASHTABLE_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <utils/SharedBuffer.h>
-#include <utils/TypeHelpers.h>
-
-namespace android {
-
-/* Implementation type. Nothing to see here. */
-class BasicHashtableImpl {
-protected:
- struct Bucket {
- // The collision flag indicates that the bucket is part of a collision chain
- // such that at least two entries both hash to this bucket. When true, we
- // may need to seek further along the chain to find the entry.
- static const uint32_t COLLISION = 0x80000000UL;
-
- // The present flag indicates that the bucket contains an initialized entry value.
- static const uint32_t PRESENT = 0x40000000UL;
-
- // Mask for 30 bits worth of the hash code that are stored within the bucket to
- // speed up lookups and rehashing by eliminating the need to recalculate the
- // hash code of the entry's key.
- static const uint32_t HASH_MASK = 0x3fffffffUL;
-
- // Combined value that stores the collision and present flags as well as
- // a 30 bit hash code.
- uint32_t cookie;
-
- // Storage for the entry begins here.
- char entry[0];
- };
-
- BasicHashtableImpl(size_t entrySize, bool hasTrivialDestructor,
- size_t minimumInitialCapacity, float loadFactor);
- BasicHashtableImpl(const BasicHashtableImpl& other);
-
- void dispose();
-
- inline void edit() {
- if (mBuckets && !SharedBuffer::bufferFromData(mBuckets)->onlyOwner()) {
- clone();
- }
- }
-
- void setTo(const BasicHashtableImpl& other);
- void clear();
-
- ssize_t next(ssize_t index) const;
- ssize_t find(ssize_t index, hash_t hash, const void* __restrict__ key) const;
- size_t add(hash_t hash, const void* __restrict__ entry);
- void removeAt(size_t index);
- void rehash(size_t minimumCapacity, float loadFactor);
-
- const size_t mBucketSize; // number of bytes per bucket including the entry
- const bool mHasTrivialDestructor; // true if the entry type does not require destruction
- size_t mCapacity; // number of buckets that can be filled before exceeding load factor
- float mLoadFactor; // load factor
- size_t mSize; // number of elements actually in the table
- size_t mFilledBuckets; // number of buckets for which collision or present is true
- size_t mBucketCount; // number of slots in the mBuckets array
- void* mBuckets; // array of buckets, as a SharedBuffer
-
- inline const Bucket& bucketAt(const void* __restrict__ buckets, size_t index) const {
- return *reinterpret_cast<const Bucket*>(
- static_cast<const uint8_t*>(buckets) + index * mBucketSize);
- }
-
- inline Bucket& bucketAt(void* __restrict__ buckets, size_t index) const {
- return *reinterpret_cast<Bucket*>(static_cast<uint8_t*>(buckets) + index * mBucketSize);
- }
-
- virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const = 0;
- virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const = 0;
- virtual void destroyBucketEntry(Bucket& bucket) const = 0;
-
-private:
- void clone();
-
- // Allocates a bucket array as a SharedBuffer.
- void* allocateBuckets(size_t count) const;
-
- // Releases a bucket array's associated SharedBuffer.
- void releaseBuckets(void* __restrict__ buckets, size_t count) const;
-
- // Destroys the contents of buckets (invokes destroyBucketEntry for each
- // populated bucket if needed).
- void destroyBuckets(void* __restrict__ buckets, size_t count) const;
-
- // Copies the content of buckets (copies the cookie and invokes copyBucketEntry
- // for each populated bucket if needed).
- void copyBuckets(const void* __restrict__ fromBuckets,
- void* __restrict__ toBuckets, size_t count) const;
-
- // Determines the appropriate size of a bucket array to store a certain minimum
- // number of entries and returns its effective capacity.
- static void determineCapacity(size_t minimumCapacity, float loadFactor,
- size_t* __restrict__ outBucketCount, size_t* __restrict__ outCapacity);
-
- // Trim a hash code to 30 bits to match what we store in the bucket's cookie.
- inline static hash_t trimHash(hash_t hash) {
- return (hash & Bucket::HASH_MASK) ^ (hash >> 30);
- }
-
- // Returns the index of the first bucket that is in the collision chain
- // for the specified hash code, given the total number of buckets.
- // (Primary hash)
- inline static size_t chainStart(hash_t hash, size_t count) {
- return hash % count;
- }
-
- // Returns the increment to add to a bucket index to seek to the next bucket
- // in the collision chain for the specified hash code, given the total number of buckets.
- // (Secondary hash)
- inline static size_t chainIncrement(hash_t hash, size_t count) {
- return ((hash >> 7) | (hash << 25)) % (count - 1) + 1;
- }
-
- // Returns the index of the next bucket that is in the collision chain
- // that is defined by the specified increment, given the total number of buckets.
- inline static size_t chainSeek(size_t index, size_t increment, size_t count) {
- return (index + increment) % count;
- }
-};
-
-/*
- * A BasicHashtable stores entries that are indexed by hash code in place
- * within an array. The basic operations are finding entries by key,
- * adding new entries and removing existing entries.
- *
- * This class provides a very limited set of operations with simple semantics.
- * It is intended to be used as a building block to construct more complex
- * and interesting data structures such as HashMap. Think very hard before
- * adding anything extra to BasicHashtable, it probably belongs at a
- * higher level of abstraction.
- *
- * TKey: The key type.
- * TEntry: The entry type which is what is actually stored in the array.
- *
- * TKey must support the following contract:
- * bool operator==(const TKey& other) const; // return true if equal
- * bool operator!=(const TKey& other) const; // return true if unequal
- *
- * TEntry must support the following contract:
- * const TKey& getKey() const; // get the key from the entry
- *
- * This class supports storing entries with duplicate keys. Of course, it can't
- * tell them apart during removal so only the first entry will be removed.
- * We do this because it means that operations like add() can't fail.
- */
-template <typename TKey, typename TEntry>
-class BasicHashtable : private BasicHashtableImpl {
-public:
- /* Creates a hashtable with the specified minimum initial capacity.
- * The underlying array will be created when the first entry is added.
- *
- * minimumInitialCapacity: The minimum initial capacity for the hashtable.
- * Default is 0.
- * loadFactor: The desired load factor for the hashtable, between 0 and 1.
- * Default is 0.75.
- */
- BasicHashtable(size_t minimumInitialCapacity = 0, float loadFactor = 0.75f);
-
- /* Copies a hashtable.
- * The underlying storage is shared copy-on-write.
- */
- BasicHashtable(const BasicHashtable& other);
-
- /* Clears and destroys the hashtable.
- */
- virtual ~BasicHashtable();
-
- /* Making this hashtable a copy of the other hashtable.
- * The underlying storage is shared copy-on-write.
- *
- * other: The hashtable to copy.
- */
- inline BasicHashtable<TKey, TEntry>& operator =(const BasicHashtable<TKey, TEntry> & other) {
- setTo(other);
- return *this;
- }
-
- /* Returns the number of entries in the hashtable.
- */
- inline size_t size() const {
- return mSize;
- }
-
- /* Returns the capacity of the hashtable, which is the number of elements that can
- * added to the hashtable without requiring it to be grown.
- */
- inline size_t capacity() const {
- return mCapacity;
- }
-
- /* Returns the number of buckets that the hashtable has, which is the size of its
- * underlying array.
- */
- inline size_t bucketCount() const {
- return mBucketCount;
- }
-
- /* Returns the load factor of the hashtable. */
- inline float loadFactor() const {
- return mLoadFactor;
- };
-
- /* Returns a const reference to the entry at the specified index.
- *
- * index: The index of the entry to retrieve. Must be a valid index within
- * the bounds of the hashtable.
- */
- inline const TEntry& entryAt(size_t index) const {
- return entryFor(bucketAt(mBuckets, index));
- }
-
- /* Returns a non-const reference to the entry at the specified index.
- *
- * index: The index of the entry to edit. Must be a valid index within
- * the bounds of the hashtable.
- */
- inline TEntry& editEntryAt(size_t index) {
- edit();
- return entryFor(bucketAt(mBuckets, index));
- }
-
- /* Clears the hashtable.
- * All entries in the hashtable are destroyed immediately.
- * If you need to do something special with the entries in the hashtable then iterate
- * over them and do what you need before clearing the hashtable.
- */
- inline void clear() {
- BasicHashtableImpl::clear();
- }
-
- /* Returns the index of the next entry in the hashtable given the index of a previous entry.
- * If the given index is -1, then returns the index of the first entry in the hashtable,
- * if there is one, or -1 otherwise.
- * If the given index is not -1, then returns the index of the next entry in the hashtable,
- * in strictly increasing order, or -1 if there are none left.
- *
- * index: The index of the previous entry that was iterated, or -1 to begin
- * iteration at the beginning of the hashtable.
- */
- inline ssize_t next(ssize_t index) const {
- return BasicHashtableImpl::next(index);
- }
-
- /* Finds the index of an entry with the specified key.
- * If the given index is -1, then returns the index of the first matching entry,
- * otherwise returns the index of the next matching entry.
- * If the hashtable contains multiple entries with keys that match the requested
- * key, then the sequence of entries returned is arbitrary.
- * Returns -1 if no entry was found.
- *
- * index: The index of the previous entry with the specified key, or -1 to
- * find the first matching entry.
- * hash: The hashcode of the key.
- * key: The key.
- */
- inline ssize_t find(ssize_t index, hash_t hash, const TKey& key) const {
- return BasicHashtableImpl::find(index, hash, &key);
- }
-
- /* Adds the entry to the hashtable.
- * Returns the index of the newly added entry.
- * If an entry with the same key already exists, then a duplicate entry is added.
- * If the entry will not fit, then the hashtable's capacity is increased and
- * its contents are rehashed. See rehash().
- *
- * hash: The hashcode of the key.
- * entry: The entry to add.
- */
- inline size_t add(hash_t hash, const TEntry& entry) {
- return BasicHashtableImpl::add(hash, &entry);
- }
-
- /* Removes the entry with the specified index from the hashtable.
- * The entry is destroyed immediately.
- * The index must be valid.
- *
- * The hashtable is not compacted after an item is removed, so it is legal
- * to continue iterating over the hashtable using next() or find().
- *
- * index: The index of the entry to remove. Must be a valid index within the
- * bounds of the hashtable, and it must refer to an existing entry.
- */
- inline void removeAt(size_t index) {
- BasicHashtableImpl::removeAt(index);
- }
-
- /* Rehashes the contents of the hashtable.
- * Grows the hashtable to at least the specified minimum capacity or the
- * current number of elements, whichever is larger.
- *
- * Rehashing causes all entries to be copied and the entry indices may change.
- * Although the hash codes are cached by the hashtable, rehashing can be an
- * expensive operation and should be avoided unless the hashtable's size
- * needs to be changed.
- *
- * Rehashing is the only way to change the capacity or load factor of the
- * hashtable once it has been created. It can be used to compact the
- * hashtable by choosing a minimum capacity that is smaller than the current
- * capacity (such as 0).
- *
- * minimumCapacity: The desired minimum capacity after rehashing.
- * loadFactor: The desired load factor after rehashing.
- */
- inline void rehash(size_t minimumCapacity, float loadFactor) {
- BasicHashtableImpl::rehash(minimumCapacity, loadFactor);
- }
-
-protected:
- static inline const TEntry& entryFor(const Bucket& bucket) {
- return reinterpret_cast<const TEntry&>(bucket.entry);
- }
-
- static inline TEntry& entryFor(Bucket& bucket) {
- return reinterpret_cast<TEntry&>(bucket.entry);
- }
-
- virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const;
- virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const;
- virtual void destroyBucketEntry(Bucket& bucket) const;
-
-private:
- // For dumping the raw contents of a hashtable during testing.
- friend class BasicHashtableTest;
- inline uint32_t cookieAt(size_t index) const {
- return bucketAt(mBuckets, index).cookie;
- }
-};
-
-template <typename TKey, typename TEntry>
-BasicHashtable<TKey, TEntry>::BasicHashtable(size_t minimumInitialCapacity, float loadFactor) :
- BasicHashtableImpl(sizeof(TEntry), traits<TEntry>::has_trivial_dtor,
- minimumInitialCapacity, loadFactor) {
-}
-
-template <typename TKey, typename TEntry>
-BasicHashtable<TKey, TEntry>::BasicHashtable(const BasicHashtable<TKey, TEntry>& other) :
- BasicHashtableImpl(other) {
-}
-
-template <typename TKey, typename TEntry>
-BasicHashtable<TKey, TEntry>::~BasicHashtable() {
- dispose();
-}
-
-template <typename TKey, typename TEntry>
-bool BasicHashtable<TKey, TEntry>::compareBucketKey(const Bucket& bucket,
- const void* __restrict__ key) const {
- return entryFor(bucket).getKey() == *static_cast<const TKey*>(key);
-}
-
-template <typename TKey, typename TEntry>
-void BasicHashtable<TKey, TEntry>::initializeBucketEntry(Bucket& bucket,
- const void* __restrict__ entry) const {
- if (!traits<TEntry>::has_trivial_copy) {
- new (&entryFor(bucket)) TEntry(*(static_cast<const TEntry*>(entry)));
- } else {
- memcpy(&entryFor(bucket), entry, sizeof(TEntry));
- }
-}
-
-template <typename TKey, typename TEntry>
-void BasicHashtable<TKey, TEntry>::destroyBucketEntry(Bucket& bucket) const {
- if (!traits<TEntry>::has_trivial_dtor) {
- entryFor(bucket).~TEntry();
- }
-}
-
-}; // namespace android
-
-#endif // ANDROID_BASIC_HASHTABLE_H
diff --git a/include/utils/BitSet.h b/include/utils/BitSet.h
deleted file mode 100644
index 9452e86..0000000
--- a/include/utils/BitSet.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef UTILS_BITSET_H
-#define UTILS_BITSET_H
-
-#include <stdint.h>
-
-/*
- * Contains some bit manipulation helpers.
- */
-
-namespace android {
-
-// A simple set of 32 bits that can be individually marked or cleared.
-struct BitSet32 {
- uint32_t value;
-
- inline BitSet32() : value(0) { }
- explicit inline BitSet32(uint32_t value) : value(value) { }
-
- // Gets the value associated with a particular bit index.
- static inline uint32_t valueForBit(uint32_t n) { return 0x80000000 >> n; }
-
- // Clears the bit set.
- inline void clear() { value = 0; }
-
- // Returns the number of marked bits in the set.
- inline uint32_t count() const { return __builtin_popcount(value); }
-
- // Returns true if the bit set does not contain any marked bits.
- inline bool isEmpty() const { return ! value; }
-
- // Returns true if the bit set does not contain any unmarked bits.
- inline bool isFull() const { return value == 0xffffffff; }
-
- // Returns true if the specified bit is marked.
- inline bool hasBit(uint32_t n) const { return value & valueForBit(n); }
-
- // Marks the specified bit.
- inline void markBit(uint32_t n) { value |= valueForBit(n); }
-
- // Clears the specified bit.
- inline void clearBit(uint32_t n) { value &= ~ valueForBit(n); }
-
- // Finds the first marked bit in the set.
- // Result is undefined if all bits are unmarked.
- inline uint32_t firstMarkedBit() const { return __builtin_clz(value); }
-
- // Finds the first unmarked bit in the set.
- // Result is undefined if all bits are marked.
- inline uint32_t firstUnmarkedBit() const { return __builtin_clz(~ value); }
-
- // Finds the last marked bit in the set.
- // Result is undefined if all bits are unmarked.
- inline uint32_t lastMarkedBit() const { return 31 - __builtin_ctz(value); }
-
- // Finds the first marked bit in the set and clears it. Returns the bit index.
- // Result is undefined if all bits are unmarked.
- inline uint32_t clearFirstMarkedBit() {
- uint32_t n = firstMarkedBit();
- clearBit(n);
- return n;
- }
-
- // Finds the first unmarked bit in the set and marks it. Returns the bit index.
- // Result is undefined if all bits are marked.
- inline uint32_t markFirstUnmarkedBit() {
- uint32_t n = firstUnmarkedBit();
- markBit(n);
- return n;
- }
-
- // Finds the last marked bit in the set and clears it. Returns the bit index.
- // Result is undefined if all bits are unmarked.
- inline uint32_t clearLastMarkedBit() {
- uint32_t n = lastMarkedBit();
- clearBit(n);
- return n;
- }
-
- // Gets the index of the specified bit in the set, which is the number of
- // marked bits that appear before the specified bit.
- inline uint32_t getIndexOfBit(uint32_t n) const {
- return __builtin_popcount(value & ~(0xffffffffUL >> n));
- }
-
- inline bool operator== (const BitSet32& other) const { return value == other.value; }
- inline bool operator!= (const BitSet32& other) const { return value != other.value; }
-};
-
-} // namespace android
-
-#endif // UTILS_BITSET_H
diff --git a/include/utils/BlobCache.h b/include/utils/BlobCache.h
deleted file mode 100644
index 4f342a2..0000000
--- a/include/utils/BlobCache.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#ifndef ANDROID_BLOB_CACHE_H
-#define ANDROID_BLOB_CACHE_H
-
-#include <stddef.h>
-
-#include <utils/Flattenable.h>
-#include <utils/RefBase.h>
-#include <utils/SortedVector.h>
-#include <utils/threads.h>
-
-namespace android {
-
-// A BlobCache is an in-memory cache for binary key/value pairs. A BlobCache
-// does NOT provide any thread-safety guarantees.
-//
-// The cache contents can be serialized to an in-memory buffer or mmap'd file
-// and then reloaded in a subsequent execution of the program. This
-// serialization is non-portable and the data should only be used by the device
-// that generated it.
-class BlobCache : public RefBase, public Flattenable {
-public:
-
- // Create an empty blob cache. The blob cache will cache key/value pairs
- // with key and value sizes less than or equal to maxKeySize and
- // maxValueSize, respectively. The total combined size of ALL cache entries
- // (key sizes plus value sizes) will not exceed maxTotalSize.
- BlobCache(size_t maxKeySize, size_t maxValueSize, size_t maxTotalSize);
-
- // set inserts a new binary value into the cache and associates it with the
- // given binary key. If the key or value are too large for the cache then
- // the cache remains unchanged. This includes the case where a different
- // value was previously associated with the given key - the old value will
- // remain in the cache. If the given key and value are small enough to be
- // put in the cache (based on the maxKeySize, maxValueSize, and maxTotalSize
- // values specified to the BlobCache constructor), then the key/value pair
- // will be in the cache after set returns. Note, however, that a subsequent
- // call to set may evict old key/value pairs from the cache.
- //
- // Preconditions:
- // key != NULL
- // 0 < keySize
- // value != NULL
- // 0 < valueSize
- void set(const void* key, size_t keySize, const void* value,
- size_t valueSize);
-
- // get retrieves from the cache the binary value associated with a given
- // binary key. If the key is present in the cache then the length of the
- // binary value associated with that key is returned. If the value argument
- // is non-NULL and the size of the cached value is less than valueSize bytes
- // then the cached value is copied into the buffer pointed to by the value
- // argument. If the key is not present in the cache then 0 is returned and
- // the buffer pointed to by the value argument is not modified.
- //
- // Note that when calling get multiple times with the same key, the later
- // calls may fail, returning 0, even if earlier calls succeeded. The return
- // value must be checked for each call.
- //
- // Preconditions:
- // key != NULL
- // 0 < keySize
- // 0 <= valueSize
- size_t get(const void* key, size_t keySize, void* value, size_t valueSize);
-
- // getFlattenedSize returns the number of bytes needed to store the entire
- // serialized cache.
- virtual size_t getFlattenedSize() const;
-
- // getFdCount returns the number of file descriptors that will result from
- // flattening the cache. This will always return 0 so as to allow the
- // flattened cache to be saved to disk and then later restored.
- virtual size_t getFdCount() const;
-
- // flatten serializes the current contents of the cache into the memory
- // pointed to by 'buffer'. The serialized cache contents can later be
- // loaded into a BlobCache object using the unflatten method. The contents
- // of the BlobCache object will not be modified.
- //
- // Preconditions:
- // size >= this.getFlattenedSize()
- // count == 0
- virtual status_t flatten(void* buffer, size_t size, int fds[],
- size_t count) const;
-
- // unflatten replaces the contents of the cache with the serialized cache
- // contents in the memory pointed to by 'buffer'. The previous contents of
- // the BlobCache will be evicted from the cache. If an error occurs while
- // unflattening the serialized cache contents then the BlobCache will be
- // left in an empty state.
- //
- // Preconditions:
- // count == 0
- virtual status_t unflatten(void const* buffer, size_t size, int fds[],
- size_t count);
-
-private:
- // Copying is disallowed.
- BlobCache(const BlobCache&);
- void operator=(const BlobCache&);
-
- // A random function helper to get around MinGW not having nrand48()
- long int blob_random();
-
- // clean evicts a randomly chosen set of entries from the cache such that
- // the total size of all remaining entries is less than mMaxTotalSize/2.
- void clean();
-
- // isCleanable returns true if the cache is full enough for the clean method
- // to have some effect, and false otherwise.
- bool isCleanable() const;
-
- // A Blob is an immutable sized unstructured data blob.
- class Blob : public RefBase {
- public:
- Blob(const void* data, size_t size, bool copyData);
- ~Blob();
-
- bool operator<(const Blob& rhs) const;
-
- const void* getData() const;
- size_t getSize() const;
-
- private:
- // Copying is not allowed.
- Blob(const Blob&);
- void operator=(const Blob&);
-
- // mData points to the buffer containing the blob data.
- const void* mData;
-
- // mSize is the size of the blob data in bytes.
- size_t mSize;
-
- // mOwnsData indicates whether or not this Blob object should free the
- // memory pointed to by mData when the Blob gets destructed.
- bool mOwnsData;
- };
-
- // A CacheEntry is a single key/value pair in the cache.
- class CacheEntry {
- public:
- CacheEntry();
- CacheEntry(const sp<Blob>& key, const sp<Blob>& value);
- CacheEntry(const CacheEntry& ce);
-
- bool operator<(const CacheEntry& rhs) const;
- const CacheEntry& operator=(const CacheEntry&);
-
- sp<Blob> getKey() const;
- sp<Blob> getValue() const;
-
- void setValue(const sp<Blob>& value);
-
- private:
-
- // mKey is the key that identifies the cache entry.
- sp<Blob> mKey;
-
- // mValue is the cached data associated with the key.
- sp<Blob> mValue;
- };
-
- // A Header is the header for the entire BlobCache serialization format. No
- // need to make this portable, so we simply write the struct out.
- struct Header {
- // mMagicNumber is the magic number that identifies the data as
- // serialized BlobCache contents. It must always contain 'Blb$'.
- uint32_t mMagicNumber;
-
- // mBlobCacheVersion is the serialization format version.
- uint32_t mBlobCacheVersion;
-
- // mDeviceVersion is the device-specific version of the cache. This can
- // be used to invalidate the cache.
- uint32_t mDeviceVersion;
-
- // mNumEntries is number of cache entries following the header in the
- // data.
- size_t mNumEntries;
- };
-
- // An EntryHeader is the header for a serialized cache entry. No need to
- // make this portable, so we simply write the struct out. Each EntryHeader
- // is followed imediately by the key data and then the value data.
- //
- // The beginning of each serialized EntryHeader is 4-byte aligned, so the
- // number of bytes that a serialized cache entry will occupy is:
- //
- // ((sizeof(EntryHeader) + keySize + valueSize) + 3) & ~3
- //
- struct EntryHeader {
- // mKeySize is the size of the entry key in bytes.
- size_t mKeySize;
-
- // mValueSize is the size of the entry value in bytes.
- size_t mValueSize;
-
- // mData contains both the key and value data for the cache entry. The
- // key comes first followed immediately by the value.
- uint8_t mData[];
- };
-
- // mMaxKeySize is the maximum key size that will be cached. Calls to
- // BlobCache::set with a keySize parameter larger than mMaxKeySize will
- // simply not add the key/value pair to the cache.
- const size_t mMaxKeySize;
-
- // mMaxValueSize is the maximum value size that will be cached. Calls to
- // BlobCache::set with a valueSize parameter larger than mMaxValueSize will
- // simply not add the key/value pair to the cache.
- const size_t mMaxValueSize;
-
- // mMaxTotalSize is the maximum size that all cache entries can occupy. This
- // includes space for both keys and values. When a call to BlobCache::set
- // would otherwise cause this limit to be exceeded, either the key/value
- // pair passed to BlobCache::set will not be cached or other cache entries
- // will be evicted from the cache to make room for the new entry.
- const size_t mMaxTotalSize;
-
- // mTotalSize is the total combined size of all keys and values currently in
- // the cache.
- size_t mTotalSize;
-
- // mRandState is the pseudo-random number generator state. It is passed to
- // nrand48 to generate random numbers when needed.
- unsigned short mRandState[3];
-
- // mCacheEntries stores all the cache entries that are resident in memory.
- // Cache entries are added to it by the 'set' method.
- SortedVector<CacheEntry> mCacheEntries;
-};
-
-}
-
-#endif // ANDROID_BLOB_CACHE_H
diff --git a/include/utils/BufferedTextOutput.h b/include/utils/BufferedTextOutput.h
deleted file mode 100644
index 69c6240..0000000
--- a/include/utils/BufferedTextOutput.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-#ifndef ANDROID_BUFFEREDTEXTOUTPUT_H
-#define ANDROID_BUFFEREDTEXTOUTPUT_H
-
-#include <utils/TextOutput.h>
-#include <utils/threads.h>
-#include <cutils/uio.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-class BufferedTextOutput : public TextOutput
-{
-public:
- //** Flags for constructor */
- enum {
- MULTITHREADED = 0x0001
- };
-
- BufferedTextOutput(uint32_t flags = 0);
- virtual ~BufferedTextOutput();
-
- virtual status_t print(const char* txt, size_t len);
- virtual void moveIndent(int delta);
-
- virtual void pushBundle();
- virtual void popBundle();
-
-protected:
- virtual status_t writeLines(const struct iovec& vec, size_t N) = 0;
-
-private:
- struct BufferState;
- struct ThreadState;
-
- static ThreadState*getThreadState();
- static void threadDestructor(void *st);
-
- BufferState*getBuffer() const;
-
- uint32_t mFlags;
- const int32_t mSeq;
- const int32_t mIndex;
-
- Mutex mLock;
- BufferState* mGlobalState;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_BUFFEREDTEXTOUTPUT_H
diff --git a/include/utils/ByteOrder.h b/include/utils/ByteOrder.h
deleted file mode 100644
index baa3a83..0000000
--- a/include/utils/ByteOrder.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-//
-
-#ifndef _LIBS_UTILS_BYTE_ORDER_H
-#define _LIBS_UTILS_BYTE_ORDER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#ifdef HAVE_WINSOCK
-#include <winsock2.h>
-#else
-#include <netinet/in.h>
-#endif
-
-/*
- * These macros are like the hton/ntoh byte swapping macros,
- * except they allow you to swap to and from the "device" byte
- * order. The device byte order is the endianness of the target
- * device -- for the ARM CPUs we use today, this is little endian.
- *
- * Note that the byte swapping functions have not been optimized
- * much; performance is currently not an issue for them since the
- * intent is to allow us to avoid byte swapping on the device.
- */
-
-static inline uint32_t android_swap_long(uint32_t v)
-{
- return (v<<24) | ((v<<8)&0x00FF0000) | ((v>>8)&0x0000FF00) | (v>>24);
-}
-
-static inline uint16_t android_swap_short(uint16_t v)
-{
- return (v<<8) | (v>>8);
-}
-
-#define DEVICE_BYTE_ORDER LITTLE_ENDIAN
-
-#if BYTE_ORDER == DEVICE_BYTE_ORDER
-
-#define dtohl(x) (x)
-#define dtohs(x) (x)
-#define htodl(x) (x)
-#define htods(x) (x)
-
-#else
-
-#define dtohl(x) (android_swap_long(x))
-#define dtohs(x) (android_swap_short(x))
-#define htodl(x) (android_swap_long(x))
-#define htods(x) (android_swap_short(x))
-
-#endif
-
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define fromlel(x) (x)
-#define fromles(x) (x)
-#define tolel(x) (x)
-#define toles(x) (x)
-#else
-#define fromlel(x) (android_swap_long(x))
-#define fromles(x) (android_swap_short(x))
-#define tolel(x) (android_swap_long(x))
-#define toles(x) (android_swap_short(x))
-#endif
-
-#endif // _LIBS_UTILS_BYTE_ORDER_H
diff --git a/include/utils/CallStack.h b/include/utils/CallStack.h
deleted file mode 100644
index 079e20c..0000000
--- a/include/utils/CallStack.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_CALLSTACK_H
-#define ANDROID_CALLSTACK_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/String8.h>
-#include <corkscrew/backtrace.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-class CallStack
-{
-public:
- enum {
- MAX_DEPTH = 31
- };
-
- CallStack();
- CallStack(const CallStack& rhs);
- ~CallStack();
-
- CallStack& operator = (const CallStack& rhs);
-
- bool operator == (const CallStack& rhs) const;
- bool operator != (const CallStack& rhs) const;
- bool operator < (const CallStack& rhs) const;
- bool operator >= (const CallStack& rhs) const;
- bool operator > (const CallStack& rhs) const;
- bool operator <= (const CallStack& rhs) const;
-
- const void* operator [] (int index) const;
-
- void clear();
-
- void update(int32_t ignoreDepth=1, int32_t maxDepth=MAX_DEPTH);
-
- // Dump a stack trace to the log
- void dump(const char* prefix = 0) const;
-
- // Return a string (possibly very long) containing the complete stack trace
- String8 toString(const char* prefix = 0) const;
-
- size_t size() const { return mCount; }
-
-private:
- size_t mCount;
- backtrace_frame_t mStack[MAX_DEPTH];
-};
-
-}; // namespace android
-
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_CALLSTACK_H
diff --git a/include/utils/Compat.h b/include/utils/Compat.h
deleted file mode 100644
index 1819266..0000000
--- a/include/utils/Compat.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef __LIB_UTILS_COMPAT_H
-#define __LIB_UTILS_COMPAT_H
-
-#include <unistd.h>
-
-/* Compatibility definitions for non-Linux (i.e., BSD-based) hosts. */
-#ifndef HAVE_OFF64_T
-#if _FILE_OFFSET_BITS < 64
-#error "_FILE_OFFSET_BITS < 64; large files are not supported on this platform"
-#endif /* _FILE_OFFSET_BITS < 64 */
-
-typedef off_t off64_t;
-
-static inline off64_t lseek64(int fd, off64_t offset, int whence) {
- return lseek(fd, offset, whence);
-}
-
-#ifdef HAVE_PREAD
-static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) {
- return pread(fd, buf, nbytes, offset);
-}
-#endif
-
-#endif /* !HAVE_OFF64_T */
-
-#endif /* __LIB_UTILS_COMPAT_H */
diff --git a/include/utils/Condition.h b/include/utils/Condition.h
deleted file mode 100644
index 8852d53..0000000
--- a/include/utils/Condition.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef _LIBS_UTILS_CONDITION_H
-#define _LIBS_UTILS_CONDITION_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <time.h>
-
-#if defined(HAVE_PTHREADS)
-# include <pthread.h>
-#endif
-
-#include <utils/Errors.h>
-#include <utils/Mutex.h>
-#include <utils/Timers.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-// ---------------------------------------------------------------------------
-
-/*
- * Condition variable class. The implementation is system-dependent.
- *
- * Condition variables are paired up with mutexes. Lock the mutex,
- * call wait(), then either re-wait() if things aren't quite what you want,
- * or unlock the mutex and continue. All threads calling wait() must
- * use the same mutex for a given Condition.
- */
-class Condition {
-public:
- enum {
- PRIVATE = 0,
- SHARED = 1
- };
-
- Condition();
- Condition(int type);
- ~Condition();
- // Wait on the condition variable. Lock the mutex before calling.
- status_t wait(Mutex& mutex);
- // same with relative timeout
- status_t waitRelative(Mutex& mutex, nsecs_t reltime);
- // Signal the condition variable, allowing one thread to continue.
- void signal();
- // Signal the condition variable, allowing all threads to continue.
- void broadcast();
-
-private:
-#if defined(HAVE_PTHREADS)
- pthread_cond_t mCond;
-#else
- void* mState;
-#endif
-};
-
-// ---------------------------------------------------------------------------
-
-#if defined(HAVE_PTHREADS)
-
-inline Condition::Condition() {
- pthread_cond_init(&mCond, NULL);
-}
-inline Condition::Condition(int type) {
- if (type == SHARED) {
- pthread_condattr_t attr;
- pthread_condattr_init(&attr);
- pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
- pthread_cond_init(&mCond, &attr);
- pthread_condattr_destroy(&attr);
- } else {
- pthread_cond_init(&mCond, NULL);
- }
-}
-inline Condition::~Condition() {
- pthread_cond_destroy(&mCond);
-}
-inline status_t Condition::wait(Mutex& mutex) {
- return -pthread_cond_wait(&mCond, &mutex.mMutex);
-}
-inline status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime) {
-#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)
- struct timespec ts;
- ts.tv_sec = reltime/1000000000;
- ts.tv_nsec = reltime%1000000000;
- return -pthread_cond_timedwait_relative_np(&mCond, &mutex.mMutex, &ts);
-#else // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE
- struct timespec ts;
-#if defined(HAVE_POSIX_CLOCKS)
- clock_gettime(CLOCK_REALTIME, &ts);
-#else // HAVE_POSIX_CLOCKS
- // we don't support the clocks here.
- struct timeval t;
- gettimeofday(&t, NULL);
- ts.tv_sec = t.tv_sec;
- ts.tv_nsec= t.tv_usec*1000;
-#endif // HAVE_POSIX_CLOCKS
- ts.tv_sec += reltime/1000000000;
- ts.tv_nsec+= reltime%1000000000;
- if (ts.tv_nsec >= 1000000000) {
- ts.tv_nsec -= 1000000000;
- ts.tv_sec += 1;
- }
- return -pthread_cond_timedwait(&mCond, &mutex.mMutex, &ts);
-#endif // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE
-}
-inline void Condition::signal() {
- pthread_cond_signal(&mCond);
-}
-inline void Condition::broadcast() {
- pthread_cond_broadcast(&mCond);
-}
-
-#endif // HAVE_PTHREADS
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-// ---------------------------------------------------------------------------
-
-#endif // _LIBS_UTILS_CONDITON_H
diff --git a/include/utils/Debug.h b/include/utils/Debug.h
deleted file mode 100644
index d9ed32d..0000000
--- a/include/utils/Debug.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_DEBUG_H
-#define ANDROID_DEBUG_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-#ifdef __cplusplus
-template<bool> struct CompileTimeAssert;
-template<> struct CompileTimeAssert<true> {};
-#define COMPILE_TIME_ASSERT(_exp) \
- template class CompileTimeAssert< (_exp) >;
-#endif
-#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \
- CompileTimeAssert<( _exp )>();
-
-// ---------------------------------------------------------------------------
-
-#ifdef __cplusplus
-template<bool C, typename LSH, typename RHS> struct CompileTimeIfElse;
-template<typename LHS, typename RHS>
-struct CompileTimeIfElse<true, LHS, RHS> { typedef LHS TYPE; };
-template<typename LHS, typename RHS>
-struct CompileTimeIfElse<false, LHS, RHS> { typedef RHS TYPE; };
-#endif
-
-// ---------------------------------------------------------------------------
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-const char* stringForIndent(int32_t indentLevel);
-
-typedef void (*debugPrintFunc)(void* cookie, const char* txt);
-
-void printTypeCode(uint32_t typeCode,
- debugPrintFunc func = 0, void* cookie = 0);
-
-void printHexData(int32_t indent, const void *buf, size_t length,
- size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16,
- size_t alignment=0, bool cArrayStyle=false,
- debugPrintFunc func = 0, void* cookie = 0);
-
-#ifdef __cplusplus
-}
-#endif
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_DEBUG_H
diff --git a/include/utils/Endian.h b/include/utils/Endian.h
deleted file mode 100644
index 19f2504..0000000
--- a/include/utils/Endian.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-// Android endian-ness defines.
-//
-#ifndef _LIBS_UTILS_ENDIAN_H
-#define _LIBS_UTILS_ENDIAN_H
-
-#if defined(HAVE_ENDIAN_H)
-
-#include <endian.h>
-
-#else /*not HAVE_ENDIAN_H*/
-
-#define __BIG_ENDIAN 0x1000
-#define __LITTLE_ENDIAN 0x0001
-
-#if defined(HAVE_LITTLE_ENDIAN)
-# define __BYTE_ORDER __LITTLE_ENDIAN
-#else
-# define __BYTE_ORDER __BIG_ENDIAN
-#endif
-
-#endif /*not HAVE_ENDIAN_H*/
-
-#endif /*_LIBS_UTILS_ENDIAN_H*/
diff --git a/include/utils/Errors.h b/include/utils/Errors.h
deleted file mode 100644
index 0b75b19..0000000
--- a/include/utils/Errors.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_ERRORS_H
-#define ANDROID_ERRORS_H
-
-#include <sys/types.h>
-#include <errno.h>
-
-namespace android {
-
-// use this type to return error codes
-#ifdef HAVE_MS_C_RUNTIME
-typedef int status_t;
-#else
-typedef int32_t status_t;
-#endif
-
-/* the MS C runtime lacks a few error codes */
-
-/*
- * Error codes.
- * All error codes are negative values.
- */
-
-// Win32 #defines NO_ERROR as well. It has the same value, so there's no
-// real conflict, though it's a bit awkward.
-#ifdef _WIN32
-# undef NO_ERROR
-#endif
-
-enum {
- OK = 0, // Everything's swell.
- NO_ERROR = 0, // No errors.
-
- UNKNOWN_ERROR = 0x80000000,
-
- NO_MEMORY = -ENOMEM,
- INVALID_OPERATION = -ENOSYS,
- BAD_VALUE = -EINVAL,
- BAD_TYPE = 0x80000001,
- NAME_NOT_FOUND = -ENOENT,
- PERMISSION_DENIED = -EPERM,
- NO_INIT = -ENODEV,
- ALREADY_EXISTS = -EEXIST,
- DEAD_OBJECT = -EPIPE,
- FAILED_TRANSACTION = 0x80000002,
- JPARKS_BROKE_IT = -EPIPE,
-#if !defined(HAVE_MS_C_RUNTIME)
- BAD_INDEX = -EOVERFLOW,
- NOT_ENOUGH_DATA = -ENODATA,
- WOULD_BLOCK = -EWOULDBLOCK,
- TIMED_OUT = -ETIMEDOUT,
- UNKNOWN_TRANSACTION = -EBADMSG,
-#else
- BAD_INDEX = -E2BIG,
- NOT_ENOUGH_DATA = 0x80000003,
- WOULD_BLOCK = 0x80000004,
- TIMED_OUT = 0x80000005,
- UNKNOWN_TRANSACTION = 0x80000006,
-#endif
- FDS_NOT_ALLOWED = 0x80000007,
-};
-
-// Restore define; enumeration is in "android" namespace, so the value defined
-// there won't work for Win32 code in a different namespace.
-#ifdef _WIN32
-# define NO_ERROR 0L
-#endif
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_ERRORS_H
diff --git a/include/utils/FileMap.h b/include/utils/FileMap.h
deleted file mode 100644
index dfe6d51..0000000
--- a/include/utils/FileMap.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-//
-// Encapsulate a shared file mapping.
-//
-#ifndef __LIBS_FILE_MAP_H
-#define __LIBS_FILE_MAP_H
-
-#include <sys/types.h>
-
-#include <utils/Compat.h>
-
-#ifdef HAVE_WIN32_FILEMAP
-#include <windows.h>
-#endif
-
-namespace android {
-
-/*
- * This represents a memory-mapped file. It might be the entire file or
- * only part of it. This requires a little bookkeeping because the mapping
- * needs to be aligned on page boundaries, and in some cases we'd like to
- * have multiple references to the mapped area without creating additional
- * maps.
- *
- * This always uses MAP_SHARED.
- *
- * TODO: we should be able to create a new FileMap that is a subset of
- * an existing FileMap and shares the underlying mapped pages. Requires
- * completing the refcounting stuff and possibly introducing the notion
- * of a FileMap hierarchy.
- */
-class FileMap {
-public:
- FileMap(void);
-
- /*
- * Create a new mapping on an open file.
- *
- * Closing the file descriptor does not unmap the pages, so we don't
- * claim ownership of the fd.
- *
- * Returns "false" on failure.
- */
- bool create(const char* origFileName, int fd,
- off64_t offset, size_t length, bool readOnly);
-
- /*
- * Return the name of the file this map came from, if known.
- */
- const char* getFileName(void) const { return mFileName; }
-
- /*
- * Get a pointer to the piece of the file we requested.
- */
- void* getDataPtr(void) const { return mDataPtr; }
-
- /*
- * Get the length we requested.
- */
- size_t getDataLength(void) const { return mDataLength; }
-
- /*
- * Get the data offset used to create this map.
- */
- off64_t getDataOffset(void) const { return mDataOffset; }
-
- /*
- * Get a "copy" of the object.
- */
- FileMap* acquire(void) { mRefCount++; return this; }
-
- /*
- * Call this when mapping is no longer needed.
- */
- void release(void) {
- if (--mRefCount <= 0)
- delete this;
- }
-
- /*
- * This maps directly to madvise() values, but allows us to avoid
- * including <sys/mman.h> everywhere.
- */
- enum MapAdvice {
- NORMAL, RANDOM, SEQUENTIAL, WILLNEED, DONTNEED
- };
-
- /*
- * Apply an madvise() call to the entire file.
- *
- * Returns 0 on success, -1 on failure.
- */
- int advise(MapAdvice advice);
-
-protected:
- // don't delete objects; call release()
- ~FileMap(void);
-
-private:
- // these are not implemented
- FileMap(const FileMap& src);
- const FileMap& operator=(const FileMap& src);
-
- int mRefCount; // reference count
- char* mFileName; // original file name, if known
- void* mBasePtr; // base of mmap area; page aligned
- size_t mBaseLength; // length, measured from "mBasePtr"
- off64_t mDataOffset; // offset used when map was created
- void* mDataPtr; // start of requested data, offset from base
- size_t mDataLength; // length, measured from "mDataPtr"
-#ifdef HAVE_WIN32_FILEMAP
- HANDLE mFileHandle; // Win32 file handle
- HANDLE mFileMapping; // Win32 file mapping handle
-#endif
-
- static long mPageSize;
-};
-
-}; // namespace android
-
-#endif // __LIBS_FILE_MAP_H
diff --git a/include/utils/Flattenable.h b/include/utils/Flattenable.h
deleted file mode 100644
index 852be3b..0000000
--- a/include/utils/Flattenable.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_UTILS_FLATTENABLE_H
-#define ANDROID_UTILS_FLATTENABLE_H
-
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <utils/Errors.h>
-
-namespace android {
-
-class Flattenable
-{
-public:
- // size in bytes of the flattened object
- virtual size_t getFlattenedSize() const = 0;
-
- // number of file descriptors to flatten
- virtual size_t getFdCount() const = 0;
-
- // flattens the object into buffer.
- // size should be at least of getFlattenedSize()
- // file descriptors are written in the fds[] array but ownership is
- // not transfered (ie: they must be dupped by the caller of
- // flatten() if needed).
- virtual status_t flatten(void* buffer, size_t size,
- int fds[], size_t count) const = 0;
-
- // unflattens the object from buffer.
- // size should be equal to the value of getFlattenedSize() when the
- // object was flattened.
- // unflattened file descriptors are found in the fds[] array and
- // don't need to be dupped(). ie: the caller of unflatten doesn't
- // keep ownership. If a fd is not retained by unflatten() it must be
- // explicitly closed.
- virtual status_t unflatten(void const* buffer, size_t size,
- int fds[], size_t count) = 0;
-
-protected:
- virtual ~Flattenable() = 0;
-
-};
-
-}; // namespace android
-
-
-#endif /* ANDROID_UTILS_FLATTENABLE_H */
diff --git a/include/utils/Functor.h b/include/utils/Functor.h
deleted file mode 100644
index e24ded4..0000000
--- a/include/utils/Functor.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_FUNCTOR_H
-#define ANDROID_FUNCTOR_H
-
-#include <utils/Errors.h>
-
-namespace android {
-
-class Functor {
-public:
- Functor() {}
- virtual ~Functor() {}
- virtual status_t operator ()(int what, void* data) { return NO_ERROR; }
-};
-
-}; // namespace android
-
-#endif // ANDROID_FUNCTOR_H
diff --git a/include/utils/GenerationCache.h b/include/utils/GenerationCache.h
deleted file mode 100644
index 40722d1..0000000
--- a/include/utils/GenerationCache.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_UTILS_GENERATION_CACHE_H
-#define ANDROID_UTILS_GENERATION_CACHE_H
-
-#include <utils/KeyedVector.h>
-#include <utils/RefBase.h>
-
-namespace android {
-
-/**
- * GenerationCache callback used when an item is removed
- */
-template<typename EntryKey, typename EntryValue>
-class OnEntryRemoved {
-public:
- virtual ~OnEntryRemoved() { };
- virtual void operator()(EntryKey& key, EntryValue& value) = 0;
-}; // class OnEntryRemoved
-
-template<typename EntryKey, typename EntryValue>
-struct Entry: public LightRefBase<Entry<EntryKey, EntryValue> > {
- Entry(const Entry<EntryKey, EntryValue>& e) :
- key(e.key), value(e.value),
- parent(e.parent), child(e.child) { }
- Entry(const EntryKey& key, const EntryValue& value) :
- key(key), value(value) { }
-
- EntryKey key;
- EntryValue value;
-
- sp<Entry<EntryKey, EntryValue> > parent; // next older entry
- sp<Entry<EntryKey, EntryValue> > child; // next younger entry
-}; // struct Entry
-
-/**
- * A LRU type cache
- */
-template<typename K, typename V>
-class GenerationCache {
-public:
- GenerationCache(uint32_t maxCapacity);
- virtual ~GenerationCache();
-
- enum Capacity {
- kUnlimitedCapacity,
- };
-
- void setOnEntryRemovedListener(OnEntryRemoved<K, V>* listener);
-
- size_t size() const;
-
- void clear();
-
- bool contains(const K& key) const;
- const K& getKeyAt(size_t index) const;
- const V& getValueAt(size_t index) const;
-
- const V& get(const K& key);
- bool put(const K& key, const V& value);
-
- void removeAt(ssize_t index);
- bool remove(const K& key);
- bool removeOldest();
-
-private:
- KeyedVector<K, sp<Entry<K, V> > > mCache;
- uint32_t mMaxCapacity;
-
- OnEntryRemoved<K, V>* mListener;
-
- sp<Entry<K, V> > mOldest;
- sp<Entry<K, V> > mYoungest;
-
- void attachToCache(const sp<Entry<K, V> >& entry);
- void detachFromCache(const sp<Entry<K, V> >& entry);
-
- const V mNullValue;
-}; // class GenerationCache
-
-template<typename K, typename V>
-GenerationCache<K, V>::GenerationCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity),
- mListener(NULL), mNullValue(NULL) {
-};
-
-template<typename K, typename V>
-GenerationCache<K, V>::~GenerationCache() {
- clear();
-};
-
-template<typename K, typename V>
-uint32_t GenerationCache<K, V>::size() const {
- return mCache.size();
-}
-
-/**
- * Should be set by the user of the Cache so that the callback is called whenever an item is
- * removed from the cache
- */
-template<typename K, typename V>
-void GenerationCache<K, V>::setOnEntryRemovedListener(OnEntryRemoved<K, V>* listener) {
- mListener = listener;
-}
-
-template<typename K, typename V>
-void GenerationCache<K, V>::clear() {
- if (mListener) {
- for (uint32_t i = 0; i < mCache.size(); i++) {
- sp<Entry<K, V> > entry = mCache.valueAt(i);
- if (mListener) {
- (*mListener)(entry->key, entry->value);
- }
- }
- }
- mCache.clear();
- mYoungest.clear();
- mOldest.clear();
-}
-
-template<typename K, typename V>
-bool GenerationCache<K, V>::contains(const K& key) const {
- return mCache.indexOfKey(key) >= 0;
-}
-
-template<typename K, typename V>
-const K& GenerationCache<K, V>::getKeyAt(size_t index) const {
- return mCache.keyAt(index);
-}
-
-template<typename K, typename V>
-const V& GenerationCache<K, V>::getValueAt(size_t index) const {
- return mCache.valueAt(index)->value;
-}
-
-template<typename K, typename V>
-const V& GenerationCache<K, V>::get(const K& key) {
- ssize_t index = mCache.indexOfKey(key);
- if (index >= 0) {
- const sp<Entry<K, V> >& entry = mCache.valueAt(index);
- detachFromCache(entry);
- attachToCache(entry);
- return entry->value;
- }
-
- return mNullValue;
-}
-
-template<typename K, typename V>
-bool GenerationCache<K, V>::put(const K& key, const V& value) {
- if (mMaxCapacity != kUnlimitedCapacity && mCache.size() >= mMaxCapacity) {
- removeOldest();
- }
-
- ssize_t index = mCache.indexOfKey(key);
- if (index < 0) {
- sp<Entry<K, V> > entry = new Entry<K, V>(key, value);
- mCache.add(key, entry);
- attachToCache(entry);
- return true;
- }
-
- return false;
-}
-
-template<typename K, typename V>
-bool GenerationCache<K, V>::remove(const K& key) {
- ssize_t index = mCache.indexOfKey(key);
- if (index >= 0) {
- removeAt(index);
- return true;
- }
-
- return false;
-}
-
-template<typename K, typename V>
-void GenerationCache<K, V>::removeAt(ssize_t index) {
- sp<Entry<K, V> > entry = mCache.valueAt(index);
- if (mListener) {
- (*mListener)(entry->key, entry->value);
- }
- mCache.removeItemsAt(index, 1);
- detachFromCache(entry);
-}
-
-template<typename K, typename V>
-bool GenerationCache<K, V>::removeOldest() {
- if (mOldest.get()) {
- ssize_t index = mCache.indexOfKey(mOldest->key);
- if (index >= 0) {
- removeAt(index);
- return true;
- }
- ALOGE("GenerationCache: removeOldest failed to find the item in the cache "
- "with the given key, but we know it must be in there. "
- "Is the key comparator kaput?");
- }
-
- return false;
-}
-
-template<typename K, typename V>
-void GenerationCache<K, V>::attachToCache(const sp<Entry<K, V> >& entry) {
- if (!mYoungest.get()) {
- mYoungest = mOldest = entry;
- } else {
- entry->parent = mYoungest;
- mYoungest->child = entry;
- mYoungest = entry;
- }
-}
-
-template<typename K, typename V>
-void GenerationCache<K, V>::detachFromCache(const sp<Entry<K, V> >& entry) {
- if (entry->parent.get()) {
- entry->parent->child = entry->child;
- } else {
- mOldest = entry->child;
- }
-
- if (entry->child.get()) {
- entry->child->parent = entry->parent;
- } else {
- mYoungest = entry->parent;
- }
-
- entry->parent.clear();
- entry->child.clear();
-}
-
-}; // namespace android
-
-#endif // ANDROID_UTILS_GENERATION_CACHE_H
diff --git a/include/utils/KeyedVector.h b/include/utils/KeyedVector.h
deleted file mode 100644
index 85535bd..0000000
--- a/include/utils/KeyedVector.h
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_KEYED_VECTOR_H
-#define ANDROID_KEYED_VECTOR_H
-
-#include <assert.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/SortedVector.h>
-#include <utils/TypeHelpers.h>
-#include <utils/Errors.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-template <typename KEY, typename VALUE>
-class KeyedVector
-{
-public:
- typedef KEY key_type;
- typedef VALUE value_type;
-
- inline KeyedVector();
-
- /*
- * empty the vector
- */
-
- inline void clear() { mVector.clear(); }
-
- /*!
- * vector stats
- */
-
- //! returns number of items in the vector
- inline size_t size() const { return mVector.size(); }
- //! returns wether or not the vector is empty
- inline bool isEmpty() const { return mVector.isEmpty(); }
- //! returns how many items can be stored without reallocating the backing store
- inline size_t capacity() const { return mVector.capacity(); }
- //! setst the capacity. capacity can never be reduced less than size()
- inline ssize_t setCapacity(size_t size) { return mVector.setCapacity(size); }
-
- /*!
- * accessors
- */
- const VALUE& valueFor(const KEY& key) const;
- const VALUE& valueAt(size_t index) const;
- const KEY& keyAt(size_t index) const;
- ssize_t indexOfKey(const KEY& key) const;
-
- /*!
- * modifying the array
- */
-
- VALUE& editValueFor(const KEY& key);
- VALUE& editValueAt(size_t index);
-
- /*!
- * add/insert/replace items
- */
-
- ssize_t add(const KEY& key, const VALUE& item);
- ssize_t replaceValueFor(const KEY& key, const VALUE& item);
- ssize_t replaceValueAt(size_t index, const VALUE& item);
-
- /*!
- * remove items
- */
-
- ssize_t removeItem(const KEY& key);
- ssize_t removeItemsAt(size_t index, size_t count = 1);
-
-private:
- SortedVector< key_value_pair_t<KEY, VALUE> > mVector;
-};
-
-// ---------------------------------------------------------------------------
-
-/**
- * Variation of KeyedVector that holds a default value to return when
- * valueFor() is called with a key that doesn't exist.
- */
-template <typename KEY, typename VALUE>
-class DefaultKeyedVector : public KeyedVector<KEY, VALUE>
-{
-public:
- inline DefaultKeyedVector(const VALUE& defValue = VALUE());
- const VALUE& valueFor(const KEY& key) const;
-
-private:
- VALUE mDefault;
-};
-
-// ---------------------------------------------------------------------------
-
-template<typename KEY, typename VALUE> inline
-KeyedVector<KEY,VALUE>::KeyedVector()
-{
-}
-
-template<typename KEY, typename VALUE> inline
-ssize_t KeyedVector<KEY,VALUE>::indexOfKey(const KEY& key) const {
- return mVector.indexOf( key_value_pair_t<KEY,VALUE>(key) );
-}
-
-template<typename KEY, typename VALUE> inline
-const VALUE& KeyedVector<KEY,VALUE>::valueFor(const KEY& key) const {
- ssize_t i = this->indexOfKey(key);
- assert(i>=0);
- return mVector.itemAt(i).value;
-}
-
-template<typename KEY, typename VALUE> inline
-const VALUE& KeyedVector<KEY,VALUE>::valueAt(size_t index) const {
- return mVector.itemAt(index).value;
-}
-
-template<typename KEY, typename VALUE> inline
-const KEY& KeyedVector<KEY,VALUE>::keyAt(size_t index) const {
- return mVector.itemAt(index).key;
-}
-
-template<typename KEY, typename VALUE> inline
-VALUE& KeyedVector<KEY,VALUE>::editValueFor(const KEY& key) {
- ssize_t i = this->indexOfKey(key);
- assert(i>=0);
- return mVector.editItemAt(i).value;
-}
-
-template<typename KEY, typename VALUE> inline
-VALUE& KeyedVector<KEY,VALUE>::editValueAt(size_t index) {
- return mVector.editItemAt(index).value;
-}
-
-template<typename KEY, typename VALUE> inline
-ssize_t KeyedVector<KEY,VALUE>::add(const KEY& key, const VALUE& value) {
- return mVector.add( key_value_pair_t<KEY,VALUE>(key, value) );
-}
-
-template<typename KEY, typename VALUE> inline
-ssize_t KeyedVector<KEY,VALUE>::replaceValueFor(const KEY& key, const VALUE& value) {
- key_value_pair_t<KEY,VALUE> pair(key, value);
- mVector.remove(pair);
- return mVector.add(pair);
-}
-
-template<typename KEY, typename VALUE> inline
-ssize_t KeyedVector<KEY,VALUE>::replaceValueAt(size_t index, const VALUE& item) {
- if (index<size()) {
- mVector.editItemAt(index).value = item;
- return index;
- }
- return BAD_INDEX;
-}
-
-template<typename KEY, typename VALUE> inline
-ssize_t KeyedVector<KEY,VALUE>::removeItem(const KEY& key) {
- return mVector.remove(key_value_pair_t<KEY,VALUE>(key));
-}
-
-template<typename KEY, typename VALUE> inline
-ssize_t KeyedVector<KEY, VALUE>::removeItemsAt(size_t index, size_t count) {
- return mVector.removeItemsAt(index, count);
-}
-
-// ---------------------------------------------------------------------------
-
-template<typename KEY, typename VALUE> inline
-DefaultKeyedVector<KEY,VALUE>::DefaultKeyedVector(const VALUE& defValue)
- : mDefault(defValue)
-{
-}
-
-template<typename KEY, typename VALUE> inline
-const VALUE& DefaultKeyedVector<KEY,VALUE>::valueFor(const KEY& key) const {
- ssize_t i = this->indexOfKey(key);
- return i >= 0 ? KeyedVector<KEY,VALUE>::valueAt(i) : mDefault;
-}
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_KEYED_VECTOR_H
diff --git a/include/utils/LinearTransform.h b/include/utils/LinearTransform.h
deleted file mode 100644
index 04cb355..0000000
--- a/include/utils/LinearTransform.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef _LIBS_UTILS_LINEAR_TRANSFORM_H
-#define _LIBS_UTILS_LINEAR_TRANSFORM_H
-
-#include <stdint.h>
-
-namespace android {
-
-// LinearTransform defines a structure which hold the definition of a
-// transformation from single dimensional coordinate system A into coordinate
-// system B (and back again). Values in A and in B are 64 bit, the linear
-// scale factor is expressed as a rational number using two 32 bit values.
-//
-// Specifically, let
-// f(a) = b
-// F(b) = f^-1(b) = a
-// then
-//
-// f(a) = (((a - a_zero) * a_to_b_numer) / a_to_b_denom) + b_zero;
-//
-// and
-//
-// F(b) = (((b - b_zero) * a_to_b_denom) / a_to_b_numer) + a_zero;
-//
-struct LinearTransform {
- int64_t a_zero;
- int64_t b_zero;
- int32_t a_to_b_numer;
- uint32_t a_to_b_denom;
-
- // Transform from A->B
- // Returns true on success, or false in the case of a singularity or an
- // overflow.
- bool doForwardTransform(int64_t a_in, int64_t* b_out) const;
-
- // Transform from B->A
- // Returns true on success, or false in the case of a singularity or an
- // overflow.
- bool doReverseTransform(int64_t b_in, int64_t* a_out) const;
-
- // Helpers which will reduce the fraction N/D using Euclid's method.
- template <class T> static void reduce(T* N, T* D);
- static void reduce(int32_t* N, uint32_t* D);
-};
-
-
-}
-
-#endif // _LIBS_UTILS_LINEAR_TRANSFORM_H
diff --git a/include/utils/List.h b/include/utils/List.h
deleted file mode 100644
index 403cd7f..0000000
--- a/include/utils/List.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-// Templated list class. Normally we'd use STL, but we don't have that.
-// This class mimics STL's interfaces.
-//
-// Objects are copied into the list with the '=' operator or with copy-
-// construction, so if the compiler's auto-generated versions won't work for
-// you, define your own.
-//
-// The only class you want to use from here is "List".
-//
-#ifndef _LIBS_UTILS_LIST_H
-#define _LIBS_UTILS_LIST_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-namespace android {
-
-/*
- * Doubly-linked list. Instantiate with "List<MyClass> myList".
- *
- * Objects added to the list are copied using the assignment operator,
- * so this must be defined.
- */
-template<typename T>
-class List
-{
-protected:
- /*
- * One element in the list.
- */
- class _Node {
- public:
- explicit _Node(const T& val) : mVal(val) {}
- ~_Node() {}
- inline T& getRef() { return mVal; }
- inline const T& getRef() const { return mVal; }
- inline _Node* getPrev() const { return mpPrev; }
- inline _Node* getNext() const { return mpNext; }
- inline void setVal(const T& val) { mVal = val; }
- inline void setPrev(_Node* ptr) { mpPrev = ptr; }
- inline void setNext(_Node* ptr) { mpNext = ptr; }
- private:
- friend class List;
- friend class _ListIterator;
- T mVal;
- _Node* mpPrev;
- _Node* mpNext;
- };
-
- /*
- * Iterator for walking through the list.
- */
-
- template <typename TYPE>
- struct CONST_ITERATOR {
- typedef _Node const * NodePtr;
- typedef const TYPE Type;
- };
-
- template <typename TYPE>
- struct NON_CONST_ITERATOR {
- typedef _Node* NodePtr;
- typedef TYPE Type;
- };
-
- template<
- typename U,
- template <class> class Constness
- >
- class _ListIterator {
- typedef _ListIterator<U, Constness> _Iter;
- typedef typename Constness<U>::NodePtr _NodePtr;
- typedef typename Constness<U>::Type _Type;
-
- explicit _ListIterator(_NodePtr ptr) : mpNode(ptr) {}
-
- public:
- _ListIterator() {}
- _ListIterator(const _Iter& rhs) : mpNode(rhs.mpNode) {}
- ~_ListIterator() {}
-
- // this will handle conversions from iterator to const_iterator
- // (and also all convertible iterators)
- // Here, in this implementation, the iterators can be converted
- // if the nodes can be converted
- template<typename V> explicit
- _ListIterator(const V& rhs) : mpNode(rhs.mpNode) {}
-
-
- /*
- * Dereference operator. Used to get at the juicy insides.
- */
- _Type& operator*() const { return mpNode->getRef(); }
- _Type* operator->() const { return &(mpNode->getRef()); }
-
- /*
- * Iterator comparison.
- */
- inline bool operator==(const _Iter& right) const {
- return mpNode == right.mpNode; }
-
- inline bool operator!=(const _Iter& right) const {
- return mpNode != right.mpNode; }
-
- /*
- * handle comparisons between iterator and const_iterator
- */
- template<typename OTHER>
- inline bool operator==(const OTHER& right) const {
- return mpNode == right.mpNode; }
-
- template<typename OTHER>
- inline bool operator!=(const OTHER& right) const {
- return mpNode != right.mpNode; }
-
- /*
- * Incr/decr, used to move through the list.
- */
- inline _Iter& operator++() { // pre-increment
- mpNode = mpNode->getNext();
- return *this;
- }
- const _Iter operator++(int) { // post-increment
- _Iter tmp(*this);
- mpNode = mpNode->getNext();
- return tmp;
- }
- inline _Iter& operator--() { // pre-increment
- mpNode = mpNode->getPrev();
- return *this;
- }
- const _Iter operator--(int) { // post-increment
- _Iter tmp(*this);
- mpNode = mpNode->getPrev();
- return tmp;
- }
-
- inline _NodePtr getNode() const { return mpNode; }
-
- _NodePtr mpNode; /* should be private, but older gcc fails */
- private:
- friend class List;
- };
-
-public:
- List() {
- prep();
- }
- List(const List<T>& src) { // copy-constructor
- prep();
- insert(begin(), src.begin(), src.end());
- }
- virtual ~List() {
- clear();
- delete[] (unsigned char*) mpMiddle;
- }
-
- typedef _ListIterator<T, NON_CONST_ITERATOR> iterator;
- typedef _ListIterator<T, CONST_ITERATOR> const_iterator;
-
- List<T>& operator=(const List<T>& right);
-
- /* returns true if the list is empty */
- inline bool empty() const { return mpMiddle->getNext() == mpMiddle; }
-
- /* return #of elements in list */
- size_t size() const {
- return size_t(distance(begin(), end()));
- }
-
- /*
- * Return the first element or one past the last element. The
- * _Node* we're returning is converted to an "iterator" by a
- * constructor in _ListIterator.
- */
- inline iterator begin() {
- return iterator(mpMiddle->getNext());
- }
- inline const_iterator begin() const {
- return const_iterator(const_cast<_Node const*>(mpMiddle->getNext()));
- }
- inline iterator end() {
- return iterator(mpMiddle);
- }
- inline const_iterator end() const {
- return const_iterator(const_cast<_Node const*>(mpMiddle));
- }
-
- /* add the object to the head or tail of the list */
- void push_front(const T& val) { insert(begin(), val); }
- void push_back(const T& val) { insert(end(), val); }
-
- /* insert before the current node; returns iterator at new node */
- iterator insert(iterator posn, const T& val)
- {
- _Node* newNode = new _Node(val); // alloc & copy-construct
- newNode->setNext(posn.getNode());
- newNode->setPrev(posn.getNode()->getPrev());
- posn.getNode()->getPrev()->setNext(newNode);
- posn.getNode()->setPrev(newNode);
- return iterator(newNode);
- }
-
- /* insert a range of elements before the current node */
- void insert(iterator posn, const_iterator first, const_iterator last) {
- for ( ; first != last; ++first)
- insert(posn, *first);
- }
-
- /* remove one entry; returns iterator at next node */
- iterator erase(iterator posn) {
- _Node* pNext = posn.getNode()->getNext();
- _Node* pPrev = posn.getNode()->getPrev();
- pPrev->setNext(pNext);
- pNext->setPrev(pPrev);
- delete posn.getNode();
- return iterator(pNext);
- }
-
- /* remove a range of elements */
- iterator erase(iterator first, iterator last) {
- while (first != last)
- erase(first++); // don't erase than incr later!
- return iterator(last);
- }
-
- /* remove all contents of the list */
- void clear() {
- _Node* pCurrent = mpMiddle->getNext();
- _Node* pNext;
-
- while (pCurrent != mpMiddle) {
- pNext = pCurrent->getNext();
- delete pCurrent;
- pCurrent = pNext;
- }
- mpMiddle->setPrev(mpMiddle);
- mpMiddle->setNext(mpMiddle);
- }
-
- /*
- * Measure the distance between two iterators. On exist, "first"
- * will be equal to "last". The iterators must refer to the same
- * list.
- *
- * FIXME: This is actually a generic iterator function. It should be a
- * template function at the top-level with specializations for things like
- * vector<>, which can just do pointer math). Here we limit it to
- * _ListIterator of the same type but different constness.
- */
- template<
- typename U,
- template <class> class CL,
- template <class> class CR
- >
- ptrdiff_t distance(
- _ListIterator<U, CL> first, _ListIterator<U, CR> last) const
- {
- ptrdiff_t count = 0;
- while (first != last) {
- ++first;
- ++count;
- }
- return count;
- }
-
-private:
- /*
- * I want a _Node but don't need it to hold valid data. More
- * to the point, I don't want T's constructor to fire, since it
- * might have side-effects or require arguments. So, we do this
- * slightly uncouth storage alloc.
- */
- void prep() {
- mpMiddle = (_Node*) new unsigned char[sizeof(_Node)];
- mpMiddle->setPrev(mpMiddle);
- mpMiddle->setNext(mpMiddle);
- }
-
- /*
- * This node plays the role of "pointer to head" and "pointer to tail".
- * It sits in the middle of a circular list of nodes. The iterator
- * runs around the circle until it encounters this one.
- */
- _Node* mpMiddle;
-};
-
-/*
- * Assignment operator.
- *
- * The simplest way to do this would be to clear out the target list and
- * fill it with the source. However, we can speed things along by
- * re-using existing elements.
- */
-template<class T>
-List<T>& List<T>::operator=(const List<T>& right)
-{
- if (this == &right)
- return *this; // self-assignment
- iterator firstDst = begin();
- iterator lastDst = end();
- const_iterator firstSrc = right.begin();
- const_iterator lastSrc = right.end();
- while (firstSrc != lastSrc && firstDst != lastDst)
- *firstDst++ = *firstSrc++;
- if (firstSrc == lastSrc) // ran out of elements in source?
- erase(firstDst, lastDst); // yes, erase any extras
- else
- insert(lastDst, firstSrc, lastSrc); // copy remaining over
- return *this;
-}
-
-}; // namespace android
-
-#endif // _LIBS_UTILS_LIST_H
diff --git a/include/utils/Log.h b/include/utils/Log.h
deleted file mode 100644
index 3c6cc8b..0000000
--- a/include/utils/Log.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-// C/C++ logging functions. See the logging documentation for API details.
-//
-// We'd like these to be available from C code (in case we import some from
-// somewhere), so this has a C interface.
-//
-// The output will be correct when the log file is shared between multiple
-// threads and/or multiple processes so long as the operating system
-// supports O_APPEND. These calls have mutex-protected data structures
-// and so are NOT reentrant. Do not use LOG in a signal handler.
-//
-#ifndef _LIBS_UTILS_LOG_H
-#define _LIBS_UTILS_LOG_H
-
-#include <cutils/log.h>
-
-#endif // _LIBS_UTILS_LOG_H
diff --git a/include/utils/Looper.h b/include/utils/Looper.h
deleted file mode 100644
index 3c2905d..0000000
--- a/include/utils/Looper.h
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef UTILS_LOOPER_H
-#define UTILS_LOOPER_H
-
-#include <utils/threads.h>
-#include <utils/RefBase.h>
-#include <utils/KeyedVector.h>
-#include <utils/Timers.h>
-
-#include <android/looper.h>
-
-// When defined, uses epoll_wait() for polling, otherwise uses poll().
-#define LOOPER_USES_EPOLL
-
-// When defined, logs performance statistics for tuning and debugging purposes.
-//#define LOOPER_STATISTICS
-
-#ifdef LOOPER_USES_EPOLL
-#include <sys/epoll.h>
-#else
-#include <sys/poll.h>
-#endif
-
-/*
- * Declare a concrete type for the NDK's looper forward declaration.
- */
-struct ALooper {
-};
-
-namespace android {
-
-/**
- * A message that can be posted to a Looper.
- */
-struct Message {
- Message() : what(0) { }
- Message(int what) : what(what) { }
-
- /* The message type. (interpretation is left up to the handler) */
- int what;
-};
-
-
-/**
- * Interface for a Looper message handler.
- *
- * The Looper holds a strong reference to the message handler whenever it has
- * a message to deliver to it. Make sure to call Looper::removeMessages
- * to remove any pending messages destined for the handler so that the handler
- * can be destroyed.
- */
-class MessageHandler : public virtual RefBase {
-protected:
- virtual ~MessageHandler() { }
-
-public:
- /**
- * Handles a message.
- */
- virtual void handleMessage(const Message& message) = 0;
-};
-
-
-/**
- * A simple proxy that holds a weak reference to a message handler.
- */
-class WeakMessageHandler : public MessageHandler {
-public:
- WeakMessageHandler(const wp<MessageHandler>& handler);
- virtual void handleMessage(const Message& message);
-
-private:
- wp<MessageHandler> mHandler;
-};
-
-
-/**
- * A polling loop that supports monitoring file descriptor events, optionally
- * using callbacks. The implementation uses epoll() internally.
- *
- * A looper can be associated with a thread although there is no requirement that it must be.
- */
-class Looper : public ALooper, public RefBase {
-protected:
- virtual ~Looper();
-
-public:
- /**
- * Creates a looper.
- *
- * If allowNonCallbaks is true, the looper will allow file descriptors to be
- * registered without associated callbacks. This assumes that the caller of
- * pollOnce() is prepared to handle callback-less events itself.
- */
- Looper(bool allowNonCallbacks);
-
- /**
- * Returns whether this looper instance allows the registration of file descriptors
- * using identifiers instead of callbacks.
- */
- bool getAllowNonCallbacks() const;
-
- /**
- * Waits for events to be available, with optional timeout in milliseconds.
- * Invokes callbacks for all file descriptors on which an event occurred.
- *
- * If the timeout is zero, returns immediately without blocking.
- * If the timeout is negative, waits indefinitely until an event appears.
- *
- * Returns ALOOPER_POLL_WAKE if the poll was awoken using wake() before
- * the timeout expired and no callbacks were invoked and no other file
- * descriptors were ready.
- *
- * Returns ALOOPER_POLL_CALLBACK if one or more callbacks were invoked.
- *
- * Returns ALOOPER_POLL_TIMEOUT if there was no data before the given
- * timeout expired.
- *
- * Returns ALOOPER_POLL_ERROR if an error occurred.
- *
- * Returns a value >= 0 containing an identifier if its file descriptor has data
- * and it has no callback function (requiring the caller here to handle it).
- * In this (and only this) case outFd, outEvents and outData will contain the poll
- * events and data associated with the fd, otherwise they will be set to NULL.
- *
- * This method does not return until it has finished invoking the appropriate callbacks
- * for all file descriptors that were signalled.
- */
- int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData);
- inline int pollOnce(int timeoutMillis) {
- return pollOnce(timeoutMillis, NULL, NULL, NULL);
- }
-
- /**
- * Like pollOnce(), but performs all pending callbacks until all
- * data has been consumed or a file descriptor is available with no callback.
- * This function will never return ALOOPER_POLL_CALLBACK.
- */
- int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData);
- inline int pollAll(int timeoutMillis) {
- return pollAll(timeoutMillis, NULL, NULL, NULL);
- }
-
- /**
- * Wakes the poll asynchronously.
- *
- * This method can be called on any thread.
- * This method returns immediately.
- */
- void wake();
-
- /**
- * Adds a new file descriptor to be polled by the looper.
- * If the same file descriptor was previously added, it is replaced.
- *
- * "fd" is the file descriptor to be added.
- * "ident" is an identifier for this event, which is returned from ALooper_pollOnce().
- * The identifier must be >= 0, or ALOOPER_POLL_CALLBACK if providing a non-NULL callback.
- * "events" are the poll events to wake up on. Typically this is ALOOPER_EVENT_INPUT.
- * "callback" is the function to call when there is an event on the file descriptor.
- * "data" is a private data pointer to supply to the callback.
- *
- * There are two main uses of this function:
- *
- * (1) If "callback" is non-NULL, then this function will be called when there is
- * data on the file descriptor. It should execute any events it has pending,
- * appropriately reading from the file descriptor. The 'ident' is ignored in this case.
- *
- * (2) If "callback" is NULL, the 'ident' will be returned by ALooper_pollOnce
- * when its file descriptor has data available, requiring the caller to take
- * care of processing it.
- *
- * Returns 1 if the file descriptor was added, 0 if the arguments were invalid.
- *
- * This method can be called on any thread.
- * This method may block briefly if it needs to wake the poll.
- */
- int addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data);
-
- /**
- * Removes a previously added file descriptor from the looper.
- *
- * When this method returns, it is safe to close the file descriptor since the looper
- * will no longer have a reference to it. However, it is possible for the callback to
- * already be running or for it to run one last time if the file descriptor was already
- * signalled. Calling code is responsible for ensuring that this case is safely handled.
- * For example, if the callback takes care of removing itself during its own execution either
- * by returning 0 or by calling this method, then it can be guaranteed to not be invoked
- * again at any later time unless registered anew.
- *
- * Returns 1 if the file descriptor was removed, 0 if none was previously registered.
- *
- * This method can be called on any thread.
- * This method may block briefly if it needs to wake the poll.
- */
- int removeFd(int fd);
-
- /**
- * Enqueues a message to be processed by the specified handler.
- *
- * The handler must not be null.
- * This method can be called on any thread.
- */
- void sendMessage(const sp<MessageHandler>& handler, const Message& message);
-
- /**
- * Enqueues a message to be processed by the specified handler after all pending messages
- * after the specified delay.
- *
- * The time delay is specified in uptime nanoseconds.
- * The handler must not be null.
- * This method can be called on any thread.
- */
- void sendMessageDelayed(nsecs_t uptimeDelay, const sp<MessageHandler>& handler,
- const Message& message);
-
- /**
- * Enqueues a message to be processed by the specified handler after all pending messages
- * at the specified time.
- *
- * The time is specified in uptime nanoseconds.
- * The handler must not be null.
- * This method can be called on any thread.
- */
- void sendMessageAtTime(nsecs_t uptime, const sp<MessageHandler>& handler,
- const Message& message);
-
- /**
- * Removes all messages for the specified handler from the queue.
- *
- * The handler must not be null.
- * This method can be called on any thread.
- */
- void removeMessages(const sp<MessageHandler>& handler);
-
- /**
- * Removes all messages of a particular type for the specified handler from the queue.
- *
- * The handler must not be null.
- * This method can be called on any thread.
- */
- void removeMessages(const sp<MessageHandler>& handler, int what);
-
- /**
- * Prepares a looper associated with the calling thread, and returns it.
- * If the thread already has a looper, it is returned. Otherwise, a new
- * one is created, associated with the thread, and returned.
- *
- * The opts may be ALOOPER_PREPARE_ALLOW_NON_CALLBACKS or 0.
- */
- static sp<Looper> prepare(int opts);
-
- /**
- * Sets the given looper to be associated with the calling thread.
- * If another looper is already associated with the thread, it is replaced.
- *
- * If "looper" is NULL, removes the currently associated looper.
- */
- static void setForThread(const sp<Looper>& looper);
-
- /**
- * Returns the looper associated with the calling thread, or NULL if
- * there is not one.
- */
- static sp<Looper> getForThread();
-
-private:
- struct Request {
- int fd;
- int ident;
- ALooper_callbackFunc callback;
- void* data;
- };
-
- struct Response {
- int events;
- Request request;
- };
-
- struct MessageEnvelope {
- MessageEnvelope() : uptime(0) { }
-
- MessageEnvelope(nsecs_t uptime, const sp<MessageHandler> handler,
- const Message& message) : uptime(uptime), handler(handler), message(message) {
- }
-
- nsecs_t uptime;
- sp<MessageHandler> handler;
- Message message;
- };
-
- const bool mAllowNonCallbacks; // immutable
-
- int mWakeReadPipeFd; // immutable
- int mWakeWritePipeFd; // immutable
- Mutex mLock;
-
- Vector<MessageEnvelope> mMessageEnvelopes; // guarded by mLock
- bool mSendingMessage; // guarded by mLock
-
-#ifdef LOOPER_USES_EPOLL
- int mEpollFd; // immutable
-
- // Locked list of file descriptor monitoring requests.
- KeyedVector<int, Request> mRequests; // guarded by mLock
-#else
- // The lock guards state used to track whether there is a poll() in progress and whether
- // there are any other threads waiting in wakeAndLock(). The condition variables
- // are used to transfer control among these threads such that all waiters are
- // serviced before a new poll can begin.
- // The wakeAndLock() method increments mWaiters, wakes the poll, blocks on mAwake
- // until mPolling becomes false, then decrements mWaiters again.
- // The poll() method blocks on mResume until mWaiters becomes 0, then sets
- // mPolling to true, blocks until the poll completes, then resets mPolling to false
- // and signals mResume if there are waiters.
- bool mPolling; // guarded by mLock
- uint32_t mWaiters; // guarded by mLock
- Condition mAwake; // guarded by mLock
- Condition mResume; // guarded by mLock
-
- Vector<struct pollfd> mRequestedFds; // must hold mLock and mPolling must be false to modify
- Vector<Request> mRequests; // must hold mLock and mPolling must be false to modify
-
- ssize_t getRequestIndexLocked(int fd);
- void wakeAndLock();
-#endif
-
-#ifdef LOOPER_STATISTICS
- static const int SAMPLED_WAKE_CYCLES_TO_AGGREGATE = 100;
- static const int SAMPLED_POLLS_TO_AGGREGATE = 1000;
-
- nsecs_t mPendingWakeTime;
- int mPendingWakeCount;
-
- int mSampledWakeCycles;
- int mSampledWakeCountSum;
- nsecs_t mSampledWakeLatencySum;
-
- int mSampledPolls;
- int mSampledZeroPollCount;
- int mSampledZeroPollLatencySum;
- int mSampledTimeoutPollCount;
- int mSampledTimeoutPollLatencySum;
-#endif
-
- // This state is only used privately by pollOnce and does not require a lock since
- // it runs on a single thread.
- Vector<Response> mResponses;
- size_t mResponseIndex;
- nsecs_t mNextMessageUptime; // set to LLONG_MAX when none
-
- int pollInner(int timeoutMillis);
- void awoken();
- void pushResponse(int events, const Request& request);
-
- static void initTLSKey();
- static void threadDestructor(void *st);
-};
-
-} // namespace android
-
-#endif // UTILS_LOOPER_H
diff --git a/include/utils/Mutex.h b/include/utils/Mutex.h
deleted file mode 100644
index de6fb39..0000000
--- a/include/utils/Mutex.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef _LIBS_UTILS_MUTEX_H
-#define _LIBS_UTILS_MUTEX_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <time.h>
-
-#if defined(HAVE_PTHREADS)
-# include <pthread.h>
-#endif
-
-#include <utils/Errors.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-// ---------------------------------------------------------------------------
-
-class Condition;
-
-/*
- * Simple mutex class. The implementation is system-dependent.
- *
- * The mutex must be unlocked by the thread that locked it. They are not
- * recursive, i.e. the same thread can't lock it multiple times.
- */
-class Mutex {
-public:
- enum {
- PRIVATE = 0,
- SHARED = 1
- };
-
- Mutex();
- Mutex(const char* name);
- Mutex(int type, const char* name = NULL);
- ~Mutex();
-
- // lock or unlock the mutex
- status_t lock();
- void unlock();
-
- // lock if possible; returns 0 on success, error otherwise
- status_t tryLock();
-
- // Manages the mutex automatically. It'll be locked when Autolock is
- // constructed and released when Autolock goes out of scope.
- class Autolock {
- public:
- inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); }
- inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); }
- inline ~Autolock() { mLock.unlock(); }
- private:
- Mutex& mLock;
- };
-
-private:
- friend class Condition;
-
- // A mutex cannot be copied
- Mutex(const Mutex&);
- Mutex& operator = (const Mutex&);
-
-#if defined(HAVE_PTHREADS)
- pthread_mutex_t mMutex;
-#else
- void _init();
- void* mState;
-#endif
-};
-
-// ---------------------------------------------------------------------------
-
-#if defined(HAVE_PTHREADS)
-
-inline Mutex::Mutex() {
- pthread_mutex_init(&mMutex, NULL);
-}
-inline Mutex::Mutex(const char* name) {
- pthread_mutex_init(&mMutex, NULL);
-}
-inline Mutex::Mutex(int type, const char* name) {
- if (type == SHARED) {
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
- pthread_mutex_init(&mMutex, &attr);
- pthread_mutexattr_destroy(&attr);
- } else {
- pthread_mutex_init(&mMutex, NULL);
- }
-}
-inline Mutex::~Mutex() {
- pthread_mutex_destroy(&mMutex);
-}
-inline status_t Mutex::lock() {
- return -pthread_mutex_lock(&mMutex);
-}
-inline void Mutex::unlock() {
- pthread_mutex_unlock(&mMutex);
-}
-inline status_t Mutex::tryLock() {
- return -pthread_mutex_trylock(&mMutex);
-}
-
-#endif // HAVE_PTHREADS
-
-// ---------------------------------------------------------------------------
-
-/*
- * Automatic mutex. Declare one of these at the top of a function.
- * When the function returns, it will go out of scope, and release the
- * mutex.
- */
-
-typedef Mutex::Autolock AutoMutex;
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-// ---------------------------------------------------------------------------
-
-#endif // _LIBS_UTILS_MUTEX_H
diff --git a/include/utils/PropertyMap.h b/include/utils/PropertyMap.h
deleted file mode 100644
index a9e674f..0000000
--- a/include/utils/PropertyMap.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef _UTILS_PROPERTY_MAP_H
-#define _UTILS_PROPERTY_MAP_H
-
-#include <utils/KeyedVector.h>
-#include <utils/String8.h>
-#include <utils/Errors.h>
-#include <utils/Tokenizer.h>
-
-namespace android {
-
-/*
- * Provides a mechanism for passing around string-based property key / value pairs
- * and loading them from property files.
- *
- * The property files have the following simple structure:
- *
- * # Comment
- * key = value
- *
- * Keys and values are any sequence of printable ASCII characters.
- * The '=' separates the key from the value.
- * The key and value may not contain whitespace.
- *
- * The '\' character is reserved for escape sequences and is not currently supported.
- * The '"" character is reserved for quoting and is not currently supported.
- * Files that contain the '\' or '"' character will fail to parse.
- *
- * The file must not contain duplicate keys.
- *
- * TODO Support escape sequences and quoted values when needed.
- */
-class PropertyMap {
-public:
- /* Creates an empty property map. */
- PropertyMap();
- ~PropertyMap();
-
- /* Clears the property map. */
- void clear();
-
- /* Adds a property.
- * Replaces the property with the same key if it is already present.
- */
- void addProperty(const String8& key, const String8& value);
-
- /* Returns true if the property map contains the specified key. */
- bool hasProperty(const String8& key) const;
-
- /* Gets the value of a property and parses it.
- * Returns true and sets outValue if the key was found and its value was parsed successfully.
- * Otherwise returns false and does not modify outValue. (Also logs a warning.)
- */
- bool tryGetProperty(const String8& key, String8& outValue) const;
- bool tryGetProperty(const String8& key, bool& outValue) const;
- bool tryGetProperty(const String8& key, int32_t& outValue) const;
- bool tryGetProperty(const String8& key, float& outValue) const;
-
- /* Adds all values from the specified property map. */
- void addAll(const PropertyMap* map);
-
- /* Gets the underlying property map. */
- inline const KeyedVector<String8, String8>& getProperties() const { return mProperties; }
-
- /* Loads a property map from a file. */
- static status_t load(const String8& filename, PropertyMap** outMap);
-
-private:
- class Parser {
- PropertyMap* mMap;
- Tokenizer* mTokenizer;
-
- public:
- Parser(PropertyMap* map, Tokenizer* tokenizer);
- ~Parser();
- status_t parse();
-
- private:
- status_t parseType();
- status_t parseKey();
- status_t parseKeyProperty();
- status_t parseModifier(const String8& token, int32_t* outMetaState);
- status_t parseCharacterLiteral(char16_t* outCharacter);
- };
-
- KeyedVector<String8, String8> mProperties;
-};
-
-} // namespace android
-
-#endif // _UTILS_PROPERTY_MAP_H
diff --git a/include/utils/RWLock.h b/include/utils/RWLock.h
deleted file mode 100644
index a5abea2..0000000
--- a/include/utils/RWLock.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef _LIBS_UTILS_RWLOCK_H
-#define _LIBS_UTILS_RWLOCK_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#if defined(HAVE_PTHREADS)
-# include <pthread.h>
-#endif
-
-#include <utils/Errors.h>
-#include <utils/ThreadDefs.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-// ---------------------------------------------------------------------------
-
-#if defined(HAVE_PTHREADS)
-
-/*
- * Simple mutex class. The implementation is system-dependent.
- *
- * The mutex must be unlocked by the thread that locked it. They are not
- * recursive, i.e. the same thread can't lock it multiple times.
- */
-class RWLock {
-public:
- enum {
- PRIVATE = 0,
- SHARED = 1
- };
-
- RWLock();
- RWLock(const char* name);
- RWLock(int type, const char* name = NULL);
- ~RWLock();
-
- status_t readLock();
- status_t tryReadLock();
- status_t writeLock();
- status_t tryWriteLock();
- void unlock();
-
- class AutoRLock {
- public:
- inline AutoRLock(RWLock& rwlock) : mLock(rwlock) { mLock.readLock(); }
- inline ~AutoRLock() { mLock.unlock(); }
- private:
- RWLock& mLock;
- };
-
- class AutoWLock {
- public:
- inline AutoWLock(RWLock& rwlock) : mLock(rwlock) { mLock.writeLock(); }
- inline ~AutoWLock() { mLock.unlock(); }
- private:
- RWLock& mLock;
- };
-
-private:
- // A RWLock cannot be copied
- RWLock(const RWLock&);
- RWLock& operator = (const RWLock&);
-
- pthread_rwlock_t mRWLock;
-};
-
-inline RWLock::RWLock() {
- pthread_rwlock_init(&mRWLock, NULL);
-}
-inline RWLock::RWLock(const char* name) {
- pthread_rwlock_init(&mRWLock, NULL);
-}
-inline RWLock::RWLock(int type, const char* name) {
- if (type == SHARED) {
- pthread_rwlockattr_t attr;
- pthread_rwlockattr_init(&attr);
- pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
- pthread_rwlock_init(&mRWLock, &attr);
- pthread_rwlockattr_destroy(&attr);
- } else {
- pthread_rwlock_init(&mRWLock, NULL);
- }
-}
-inline RWLock::~RWLock() {
- pthread_rwlock_destroy(&mRWLock);
-}
-inline status_t RWLock::readLock() {
- return -pthread_rwlock_rdlock(&mRWLock);
-}
-inline status_t RWLock::tryReadLock() {
- return -pthread_rwlock_tryrdlock(&mRWLock);
-}
-inline status_t RWLock::writeLock() {
- return -pthread_rwlock_wrlock(&mRWLock);
-}
-inline status_t RWLock::tryWriteLock() {
- return -pthread_rwlock_trywrlock(&mRWLock);
-}
-inline void RWLock::unlock() {
- pthread_rwlock_unlock(&mRWLock);
-}
-
-#endif // HAVE_PTHREADS
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-// ---------------------------------------------------------------------------
-
-#endif // _LIBS_UTILS_RWLOCK_H
diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h
deleted file mode 100644
index c7a9b78..0000000
--- a/include/utils/RefBase.h
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_REF_BASE_H
-#define ANDROID_REF_BASE_H
-
-#include <cutils/atomic.h>
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <utils/StrongPointer.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-class TextOutput;
-TextOutput& printWeakPointer(TextOutput& to, const void* val);
-
-// ---------------------------------------------------------------------------
-
-#define COMPARE_WEAK(_op_) \
-inline bool operator _op_ (const sp<T>& o) const { \
- return m_ptr _op_ o.m_ptr; \
-} \
-inline bool operator _op_ (const T* o) const { \
- return m_ptr _op_ o; \
-} \
-template<typename U> \
-inline bool operator _op_ (const sp<U>& o) const { \
- return m_ptr _op_ o.m_ptr; \
-} \
-template<typename U> \
-inline bool operator _op_ (const U* o) const { \
- return m_ptr _op_ o; \
-}
-
-// ---------------------------------------------------------------------------
-class ReferenceMover;
-class ReferenceConverterBase {
-public:
- virtual size_t getReferenceTypeSize() const = 0;
- virtual void* getReferenceBase(void const*) const = 0;
- inline virtual ~ReferenceConverterBase() { }
-};
-
-// ---------------------------------------------------------------------------
-
-class RefBase
-{
-public:
- void incStrong(const void* id) const;
- void decStrong(const void* id) const;
-
- void forceIncStrong(const void* id) const;
-
- //! DEBUGGING ONLY: Get current strong ref count.
- int32_t getStrongCount() const;
-
- class weakref_type
- {
- public:
- RefBase* refBase() const;
-
- void incWeak(const void* id);
- void decWeak(const void* id);
-
- // acquires a strong reference if there is already one.
- bool attemptIncStrong(const void* id);
-
- // acquires a weak reference if there is already one.
- // This is not always safe. see ProcessState.cpp and BpBinder.cpp
- // for proper use.
- bool attemptIncWeak(const void* id);
-
- //! DEBUGGING ONLY: Get current weak ref count.
- int32_t getWeakCount() const;
-
- //! DEBUGGING ONLY: Print references held on object.
- void printRefs() const;
-
- //! DEBUGGING ONLY: Enable tracking for this object.
- // enable -- enable/disable tracking
- // retain -- when tracking is enable, if true, then we save a stack trace
- // for each reference and dereference; when retain == false, we
- // match up references and dereferences and keep only the
- // outstanding ones.
-
- void trackMe(bool enable, bool retain);
- };
-
- weakref_type* createWeak(const void* id) const;
-
- weakref_type* getWeakRefs() const;
-
- //! DEBUGGING ONLY: Print references held on object.
- inline void printRefs() const { getWeakRefs()->printRefs(); }
-
- //! DEBUGGING ONLY: Enable tracking of object.
- inline void trackMe(bool enable, bool retain)
- {
- getWeakRefs()->trackMe(enable, retain);
- }
-
- typedef RefBase basetype;
-
-protected:
- RefBase();
- virtual ~RefBase();
-
- //! Flags for extendObjectLifetime()
- enum {
- OBJECT_LIFETIME_STRONG = 0x0000,
- OBJECT_LIFETIME_WEAK = 0x0001,
- OBJECT_LIFETIME_MASK = 0x0001
- };
-
- void extendObjectLifetime(int32_t mode);
-
- //! Flags for onIncStrongAttempted()
- enum {
- FIRST_INC_STRONG = 0x0001
- };
-
- virtual void onFirstRef();
- virtual void onLastStrongRef(const void* id);
- virtual bool onIncStrongAttempted(uint32_t flags, const void* id);
- virtual void onLastWeakRef(const void* id);
-
-private:
- friend class ReferenceMover;
- static void moveReferences(void* d, void const* s, size_t n,
- const ReferenceConverterBase& caster);
-
-private:
- friend class weakref_type;
- class weakref_impl;
-
- RefBase(const RefBase& o);
- RefBase& operator=(const RefBase& o);
-
- weakref_impl* const mRefs;
-};
-
-// ---------------------------------------------------------------------------
-
-template <class T>
-class LightRefBase
-{
-public:
- inline LightRefBase() : mCount(0) { }
- inline void incStrong(const void* id) const {
- android_atomic_inc(&mCount);
- }
- inline void decStrong(const void* id) const {
- if (android_atomic_dec(&mCount) == 1) {
- delete static_cast<const T*>(this);
- }
- }
- //! DEBUGGING ONLY: Get current strong ref count.
- inline int32_t getStrongCount() const {
- return mCount;
- }
-
- typedef LightRefBase<T> basetype;
-
-protected:
- inline ~LightRefBase() { }
-
-private:
- friend class ReferenceMover;
- inline static void moveReferences(void* d, void const* s, size_t n,
- const ReferenceConverterBase& caster) { }
-
-private:
- mutable volatile int32_t mCount;
-};
-
-// ---------------------------------------------------------------------------
-
-template <typename T>
-class wp
-{
-public:
- typedef typename RefBase::weakref_type weakref_type;
-
- inline wp() : m_ptr(0) { }
-
- wp(T* other);
- wp(const wp<T>& other);
- wp(const sp<T>& other);
- template<typename U> wp(U* other);
- template<typename U> wp(const sp<U>& other);
- template<typename U> wp(const wp<U>& other);
-
- ~wp();
-
- // Assignment
-
- wp& operator = (T* other);
- wp& operator = (const wp<T>& other);
- wp& operator = (const sp<T>& other);
-
- template<typename U> wp& operator = (U* other);
- template<typename U> wp& operator = (const wp<U>& other);
- template<typename U> wp& operator = (const sp<U>& other);
-
- void set_object_and_refs(T* other, weakref_type* refs);
-
- // promotion to sp
-
- sp<T> promote() const;
-
- // Reset
-
- void clear();
-
- // Accessors
-
- inline weakref_type* get_refs() const { return m_refs; }
-
- inline T* unsafe_get() const { return m_ptr; }
-
- // Operators
-
- COMPARE_WEAK(==)
- COMPARE_WEAK(!=)
- COMPARE_WEAK(>)
- COMPARE_WEAK(<)
- COMPARE_WEAK(<=)
- COMPARE_WEAK(>=)
-
- inline bool operator == (const wp<T>& o) const {
- return (m_ptr == o.m_ptr) && (m_refs == o.m_refs);
- }
- template<typename U>
- inline bool operator == (const wp<U>& o) const {
- return m_ptr == o.m_ptr;
- }
-
- inline bool operator > (const wp<T>& o) const {
- return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr);
- }
- template<typename U>
- inline bool operator > (const wp<U>& o) const {
- return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr);
- }
-
- inline bool operator < (const wp<T>& o) const {
- return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr);
- }
- template<typename U>
- inline bool operator < (const wp<U>& o) const {
- return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr);
- }
- inline bool operator != (const wp<T>& o) const { return m_refs != o.m_refs; }
- template<typename U> inline bool operator != (const wp<U>& o) const { return !operator == (o); }
- inline bool operator <= (const wp<T>& o) const { return !operator > (o); }
- template<typename U> inline bool operator <= (const wp<U>& o) const { return !operator > (o); }
- inline bool operator >= (const wp<T>& o) const { return !operator < (o); }
- template<typename U> inline bool operator >= (const wp<U>& o) const { return !operator < (o); }
-
-private:
- template<typename Y> friend class sp;
- template<typename Y> friend class wp;
-
- T* m_ptr;
- weakref_type* m_refs;
-};
-
-template <typename T>
-TextOutput& operator<<(TextOutput& to, const wp<T>& val);
-
-#undef COMPARE_WEAK
-
-// ---------------------------------------------------------------------------
-// No user serviceable parts below here.
-
-template<typename T>
-wp<T>::wp(T* other)
- : m_ptr(other)
-{
- if (other) m_refs = other->createWeak(this);
-}
-
-template<typename T>
-wp<T>::wp(const wp<T>& other)
- : m_ptr(other.m_ptr), m_refs(other.m_refs)
-{
- if (m_ptr) m_refs->incWeak(this);
-}
-
-template<typename T>
-wp<T>::wp(const sp<T>& other)
- : m_ptr(other.m_ptr)
-{
- if (m_ptr) {
- m_refs = m_ptr->createWeak(this);
- }
-}
-
-template<typename T> template<typename U>
-wp<T>::wp(U* other)
- : m_ptr(other)
-{
- if (other) m_refs = other->createWeak(this);
-}
-
-template<typename T> template<typename U>
-wp<T>::wp(const wp<U>& other)
- : m_ptr(other.m_ptr)
-{
- if (m_ptr) {
- m_refs = other.m_refs;
- m_refs->incWeak(this);
- }
-}
-
-template<typename T> template<typename U>
-wp<T>::wp(const sp<U>& other)
- : m_ptr(other.m_ptr)
-{
- if (m_ptr) {
- m_refs = m_ptr->createWeak(this);
- }
-}
-
-template<typename T>
-wp<T>::~wp()
-{
- if (m_ptr) m_refs->decWeak(this);
-}
-
-template<typename T>
-wp<T>& wp<T>::operator = (T* other)
-{
- weakref_type* newRefs =
- other ? other->createWeak(this) : 0;
- if (m_ptr) m_refs->decWeak(this);
- m_ptr = other;
- m_refs = newRefs;
- return *this;
-}
-
-template<typename T>
-wp<T>& wp<T>::operator = (const wp<T>& other)
-{
- weakref_type* otherRefs(other.m_refs);
- T* otherPtr(other.m_ptr);
- if (otherPtr) otherRefs->incWeak(this);
- if (m_ptr) m_refs->decWeak(this);
- m_ptr = otherPtr;
- m_refs = otherRefs;
- return *this;
-}
-
-template<typename T>
-wp<T>& wp<T>::operator = (const sp<T>& other)
-{
- weakref_type* newRefs =
- other != NULL ? other->createWeak(this) : 0;
- T* otherPtr(other.m_ptr);
- if (m_ptr) m_refs->decWeak(this);
- m_ptr = otherPtr;
- m_refs = newRefs;
- return *this;
-}
-
-template<typename T> template<typename U>
-wp<T>& wp<T>::operator = (U* other)
-{
- weakref_type* newRefs =
- other ? other->createWeak(this) : 0;
- if (m_ptr) m_refs->decWeak(this);
- m_ptr = other;
- m_refs = newRefs;
- return *this;
-}
-
-template<typename T> template<typename U>
-wp<T>& wp<T>::operator = (const wp<U>& other)
-{
- weakref_type* otherRefs(other.m_refs);
- U* otherPtr(other.m_ptr);
- if (otherPtr) otherRefs->incWeak(this);
- if (m_ptr) m_refs->decWeak(this);
- m_ptr = otherPtr;
- m_refs = otherRefs;
- return *this;
-}
-
-template<typename T> template<typename U>
-wp<T>& wp<T>::operator = (const sp<U>& other)
-{
- weakref_type* newRefs =
- other != NULL ? other->createWeak(this) : 0;
- U* otherPtr(other.m_ptr);
- if (m_ptr) m_refs->decWeak(this);
- m_ptr = otherPtr;
- m_refs = newRefs;
- return *this;
-}
-
-template<typename T>
-void wp<T>::set_object_and_refs(T* other, weakref_type* refs)
-{
- if (other) refs->incWeak(this);
- if (m_ptr) m_refs->decWeak(this);
- m_ptr = other;
- m_refs = refs;
-}
-
-template<typename T>
-sp<T> wp<T>::promote() const
-{
- sp<T> result;
- if (m_ptr && m_refs->attemptIncStrong(&result)) {
- result.set_pointer(m_ptr);
- }
- return result;
-}
-
-template<typename T>
-void wp<T>::clear()
-{
- if (m_ptr) {
- m_refs->decWeak(this);
- m_ptr = 0;
- }
-}
-
-template <typename T>
-inline TextOutput& operator<<(TextOutput& to, const wp<T>& val)
-{
- return printWeakPointer(to, val.unsafe_get());
-}
-
-// ---------------------------------------------------------------------------
-
-// this class just serves as a namespace so TYPE::moveReferences can stay
-// private.
-
-class ReferenceMover {
- // StrongReferenceCast and WeakReferenceCast do the impedance matching
- // between the generic (void*) implementation in Refbase and the strongly typed
- // template specializations below.
-
- template <typename TYPE>
- struct StrongReferenceCast : public ReferenceConverterBase {
- virtual size_t getReferenceTypeSize() const { return sizeof( sp<TYPE> ); }
- virtual void* getReferenceBase(void const* p) const {
- sp<TYPE> const* sptr(reinterpret_cast<sp<TYPE> const*>(p));
- return static_cast<typename TYPE::basetype *>(sptr->get());
- }
- };
-
- template <typename TYPE>
- struct WeakReferenceCast : public ReferenceConverterBase {
- virtual size_t getReferenceTypeSize() const { return sizeof( wp<TYPE> ); }
- virtual void* getReferenceBase(void const* p) const {
- wp<TYPE> const* sptr(reinterpret_cast<wp<TYPE> const*>(p));
- return static_cast<typename TYPE::basetype *>(sptr->unsafe_get());
- }
- };
-
-public:
- template<typename TYPE> static inline
- void move_references(sp<TYPE>* d, sp<TYPE> const* s, size_t n) {
- memmove(d, s, n*sizeof(sp<TYPE>));
- StrongReferenceCast<TYPE> caster;
- TYPE::moveReferences(d, s, n, caster);
- }
- template<typename TYPE> static inline
- void move_references(wp<TYPE>* d, wp<TYPE> const* s, size_t n) {
- memmove(d, s, n*sizeof(wp<TYPE>));
- WeakReferenceCast<TYPE> caster;
- TYPE::moveReferences(d, s, n, caster);
- }
-};
-
-// specialization for moving sp<> and wp<> types.
-// these are used by the [Sorted|Keyed]Vector<> implementations
-// sp<> and wp<> need to be handled specially, because they do not
-// have trivial copy operation in the general case (see RefBase.cpp
-// when DEBUG ops are enabled), but can be implemented very
-// efficiently in most cases.
-
-template<typename TYPE> inline
-void move_forward_type(sp<TYPE>* d, sp<TYPE> const* s, size_t n) {
- ReferenceMover::move_references(d, s, n);
-}
-
-template<typename TYPE> inline
-void move_backward_type(sp<TYPE>* d, sp<TYPE> const* s, size_t n) {
- ReferenceMover::move_references(d, s, n);
-}
-
-template<typename TYPE> inline
-void move_forward_type(wp<TYPE>* d, wp<TYPE> const* s, size_t n) {
- ReferenceMover::move_references(d, s, n);
-}
-
-template<typename TYPE> inline
-void move_backward_type(wp<TYPE>* d, wp<TYPE> const* s, size_t n) {
- ReferenceMover::move_references(d, s, n);
-}
-
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_REF_BASE_H
diff --git a/include/utils/SharedBuffer.h b/include/utils/SharedBuffer.h
deleted file mode 100644
index 24508b0..0000000
--- a/include/utils/SharedBuffer.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_SHARED_BUFFER_H
-#define ANDROID_SHARED_BUFFER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-class SharedBuffer
-{
-public:
-
- /* flags to use with release() */
- enum {
- eKeepStorage = 0x00000001
- };
-
- /*! allocate a buffer of size 'size' and acquire() it.
- * call release() to free it.
- */
- static SharedBuffer* alloc(size_t size);
-
- /*! free the memory associated with the SharedBuffer.
- * Fails if there are any users associated with this SharedBuffer.
- * In other words, the buffer must have been release by all its
- * users.
- */
- static ssize_t dealloc(const SharedBuffer* released);
-
- //! get the SharedBuffer from the data pointer
- static inline const SharedBuffer* sharedBuffer(const void* data);
-
- //! access the data for read
- inline const void* data() const;
-
- //! access the data for read/write
- inline void* data();
-
- //! get size of the buffer
- inline size_t size() const;
-
- //! get back a SharedBuffer object from its data
- static inline SharedBuffer* bufferFromData(void* data);
-
- //! get back a SharedBuffer object from its data
- static inline const SharedBuffer* bufferFromData(const void* data);
-
- //! get the size of a SharedBuffer object from its data
- static inline size_t sizeFromData(const void* data);
-
- //! edit the buffer (get a writtable, or non-const, version of it)
- SharedBuffer* edit() const;
-
- //! edit the buffer, resizing if needed
- SharedBuffer* editResize(size_t size) const;
-
- //! like edit() but fails if a copy is required
- SharedBuffer* attemptEdit() const;
-
- //! resize and edit the buffer, loose it's content.
- SharedBuffer* reset(size_t size) const;
-
- //! acquire/release a reference on this buffer
- void acquire() const;
-
- /*! release a reference on this buffer, with the option of not
- * freeing the memory associated with it if it was the last reference
- * returns the previous reference count
- */
- int32_t release(uint32_t flags = 0) const;
-
- //! returns wether or not we're the only owner
- inline bool onlyOwner() const;
-
-
-private:
- inline SharedBuffer() { }
- inline ~SharedBuffer() { }
- inline SharedBuffer(const SharedBuffer&);
-
- // 16 bytes. must be sized to preserve correct alingment.
- mutable int32_t mRefs;
- size_t mSize;
- uint32_t mReserved[2];
-};
-
-// ---------------------------------------------------------------------------
-
-const SharedBuffer* SharedBuffer::sharedBuffer(const void* data) {
- return data ? reinterpret_cast<const SharedBuffer *>(data)-1 : 0;
-}
-
-const void* SharedBuffer::data() const {
- return this + 1;
-}
-
-void* SharedBuffer::data() {
- return this + 1;
-}
-
-size_t SharedBuffer::size() const {
- return mSize;
-}
-
-SharedBuffer* SharedBuffer::bufferFromData(void* data)
-{
- return ((SharedBuffer*)data)-1;
-}
-
-const SharedBuffer* SharedBuffer::bufferFromData(const void* data)
-{
- return ((const SharedBuffer*)data)-1;
-}
-
-size_t SharedBuffer::sizeFromData(const void* data)
-{
- return (((const SharedBuffer*)data)-1)->mSize;
-}
-
-bool SharedBuffer::onlyOwner() const {
- return (mRefs == 1);
-}
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_VECTOR_H
diff --git a/include/utils/Singleton.h b/include/utils/Singleton.h
deleted file mode 100644
index a42ce21..0000000
--- a/include/utils/Singleton.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_UTILS_SINGLETON_H
-#define ANDROID_UTILS_SINGLETON_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <utils/threads.h>
-#include <cutils/compiler.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-template <typename TYPE>
-class ANDROID_API Singleton
-{
-public:
- static TYPE& getInstance() {
- Mutex::Autolock _l(sLock);
- TYPE* instance = sInstance;
- if (instance == 0) {
- instance = new TYPE();
- sInstance = instance;
- }
- return *instance;
- }
-
- static bool hasInstance() {
- Mutex::Autolock _l(sLock);
- return sInstance != 0;
- }
-
-protected:
- ~Singleton() { };
- Singleton() { };
-
-private:
- Singleton(const Singleton&);
- Singleton& operator = (const Singleton&);
- static Mutex sLock;
- static TYPE* sInstance;
-};
-
-/*
- * use ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) in your implementation file
- * (eg: <TYPE>.cpp) to create the static instance of Singleton<>'s attributes,
- * and avoid to have a copy of them in each compilation units Singleton<TYPE>
- * is used.
- * NOTE: we use a version of Mutex ctor that takes a parameter, because
- * for some unknown reason using the default ctor doesn't emit the variable!
- */
-
-#define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \
- template class Singleton< TYPE >; \
- template<> Mutex Singleton< TYPE >::sLock(Mutex::PRIVATE); \
- template<> TYPE* Singleton< TYPE >::sInstance(0);
-
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_UTILS_SINGLETON_H
-
diff --git a/include/utils/SortedVector.h b/include/utils/SortedVector.h
deleted file mode 100644
index 0e98aeb..0000000
--- a/include/utils/SortedVector.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_SORTED_VECTOR_H
-#define ANDROID_SORTED_VECTOR_H
-
-#include <assert.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Vector.h>
-#include <utils/VectorImpl.h>
-#include <utils/TypeHelpers.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-template <class TYPE>
-class SortedVector : private SortedVectorImpl
-{
- friend class Vector<TYPE>;
-
-public:
- typedef TYPE value_type;
-
- /*!
- * Constructors and destructors
- */
-
- SortedVector();
- SortedVector(const SortedVector<TYPE>& rhs);
- virtual ~SortedVector();
-
- /*! copy operator */
- const SortedVector<TYPE>& operator = (const SortedVector<TYPE>& rhs) const;
- SortedVector<TYPE>& operator = (const SortedVector<TYPE>& rhs);
-
- /*
- * empty the vector
- */
-
- inline void clear() { VectorImpl::clear(); }
-
- /*!
- * vector stats
- */
-
- //! returns number of items in the vector
- inline size_t size() const { return VectorImpl::size(); }
- //! returns wether or not the vector is empty
- inline bool isEmpty() const { return VectorImpl::isEmpty(); }
- //! returns how many items can be stored without reallocating the backing store
- inline size_t capacity() const { return VectorImpl::capacity(); }
- //! setst the capacity. capacity can never be reduced less than size()
- inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); }
-
- /*!
- * C-style array access
- */
-
- //! read-only C-style access
- inline const TYPE* array() const;
-
- //! read-write C-style access. BE VERY CAREFUL when modifying the array
- //! you ust keep it sorted! You usually don't use this function.
- TYPE* editArray();
-
- //! finds the index of an item
- ssize_t indexOf(const TYPE& item) const;
-
- //! finds where this item should be inserted
- size_t orderOf(const TYPE& item) const;
-
-
- /*!
- * accessors
- */
-
- //! read-only access to an item at a given index
- inline const TYPE& operator [] (size_t index) const;
- //! alternate name for operator []
- inline const TYPE& itemAt(size_t index) const;
- //! stack-usage of the vector. returns the top of the stack (last element)
- const TYPE& top() const;
- //! same as operator [], but allows to access the vector backward (from the end) with a negative index
- const TYPE& mirrorItemAt(ssize_t index) const;
-
- /*!
- * modifing the array
- */
-
- //! add an item in the right place (and replace the one that is there)
- ssize_t add(const TYPE& item);
-
- //! editItemAt() MUST NOT change the order of this item
- TYPE& editItemAt(size_t index) {
- return *( static_cast<TYPE *>(VectorImpl::editItemLocation(index)) );
- }
-
- //! merges a vector into this one
- ssize_t merge(const Vector<TYPE>& vector);
- ssize_t merge(const SortedVector<TYPE>& vector);
-
- //! removes an item
- ssize_t remove(const TYPE&);
-
- //! remove several items
- inline ssize_t removeItemsAt(size_t index, size_t count = 1);
- //! remove one item
- inline ssize_t removeAt(size_t index) { return removeItemsAt(index); }
-
-protected:
- virtual void do_construct(void* storage, size_t num) const;
- virtual void do_destroy(void* storage, size_t num) const;
- virtual void do_copy(void* dest, const void* from, size_t num) const;
- virtual void do_splat(void* dest, const void* item, size_t num) const;
- virtual void do_move_forward(void* dest, const void* from, size_t num) const;
- virtual void do_move_backward(void* dest, const void* from, size_t num) const;
- virtual int do_compare(const void* lhs, const void* rhs) const;
-};
-
-
-// ---------------------------------------------------------------------------
-// No user serviceable parts from here...
-// ---------------------------------------------------------------------------
-
-template<class TYPE> inline
-SortedVector<TYPE>::SortedVector()
- : SortedVectorImpl(sizeof(TYPE),
- ((traits<TYPE>::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0)
- |(traits<TYPE>::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0)
- |(traits<TYPE>::has_trivial_copy ? HAS_TRIVIAL_COPY : 0))
- )
-{
-}
-
-template<class TYPE> inline
-SortedVector<TYPE>::SortedVector(const SortedVector<TYPE>& rhs)
- : SortedVectorImpl(rhs) {
-}
-
-template<class TYPE> inline
-SortedVector<TYPE>::~SortedVector() {
- finish_vector();
-}
-
-template<class TYPE> inline
-SortedVector<TYPE>& SortedVector<TYPE>::operator = (const SortedVector<TYPE>& rhs) {
- SortedVectorImpl::operator = (rhs);
- return *this;
-}
-
-template<class TYPE> inline
-const SortedVector<TYPE>& SortedVector<TYPE>::operator = (const SortedVector<TYPE>& rhs) const {
- SortedVectorImpl::operator = (rhs);
- return *this;
-}
-
-template<class TYPE> inline
-const TYPE* SortedVector<TYPE>::array() const {
- return static_cast<const TYPE *>(arrayImpl());
-}
-
-template<class TYPE> inline
-TYPE* SortedVector<TYPE>::editArray() {
- return static_cast<TYPE *>(editArrayImpl());
-}
-
-
-template<class TYPE> inline
-const TYPE& SortedVector<TYPE>::operator[](size_t index) const {
- assert( index<size() );
- return *(array() + index);
-}
-
-template<class TYPE> inline
-const TYPE& SortedVector<TYPE>::itemAt(size_t index) const {
- return operator[](index);
-}
-
-template<class TYPE> inline
-const TYPE& SortedVector<TYPE>::mirrorItemAt(ssize_t index) const {
- assert( (index>0 ? index : -index)<size() );
- return *(array() + ((index<0) ? (size()-index) : index));
-}
-
-template<class TYPE> inline
-const TYPE& SortedVector<TYPE>::top() const {
- return *(array() + size() - 1);
-}
-
-template<class TYPE> inline
-ssize_t SortedVector<TYPE>::add(const TYPE& item) {
- return SortedVectorImpl::add(&item);
-}
-
-template<class TYPE> inline
-ssize_t SortedVector<TYPE>::indexOf(const TYPE& item) const {
- return SortedVectorImpl::indexOf(&item);
-}
-
-template<class TYPE> inline
-size_t SortedVector<TYPE>::orderOf(const TYPE& item) const {
- return SortedVectorImpl::orderOf(&item);
-}
-
-template<class TYPE> inline
-ssize_t SortedVector<TYPE>::merge(const Vector<TYPE>& vector) {
- return SortedVectorImpl::merge(reinterpret_cast<const VectorImpl&>(vector));
-}
-
-template<class TYPE> inline
-ssize_t SortedVector<TYPE>::merge(const SortedVector<TYPE>& vector) {
- return SortedVectorImpl::merge(reinterpret_cast<const SortedVectorImpl&>(vector));
-}
-
-template<class TYPE> inline
-ssize_t SortedVector<TYPE>::remove(const TYPE& item) {
- return SortedVectorImpl::remove(&item);
-}
-
-template<class TYPE> inline
-ssize_t SortedVector<TYPE>::removeItemsAt(size_t index, size_t count) {
- return VectorImpl::removeItemsAt(index, count);
-}
-
-// ---------------------------------------------------------------------------
-
-template<class TYPE>
-void SortedVector<TYPE>::do_construct(void* storage, size_t num) const {
- construct_type( reinterpret_cast<TYPE*>(storage), num );
-}
-
-template<class TYPE>
-void SortedVector<TYPE>::do_destroy(void* storage, size_t num) const {
- destroy_type( reinterpret_cast<TYPE*>(storage), num );
-}
-
-template<class TYPE>
-void SortedVector<TYPE>::do_copy(void* dest, const void* from, size_t num) const {
- copy_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(from), num );
-}
-
-template<class TYPE>
-void SortedVector<TYPE>::do_splat(void* dest, const void* item, size_t num) const {
- splat_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(item), num );
-}
-
-template<class TYPE>
-void SortedVector<TYPE>::do_move_forward(void* dest, const void* from, size_t num) const {
- move_forward_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(from), num );
-}
-
-template<class TYPE>
-void SortedVector<TYPE>::do_move_backward(void* dest, const void* from, size_t num) const {
- move_backward_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(from), num );
-}
-
-template<class TYPE>
-int SortedVector<TYPE>::do_compare(const void* lhs, const void* rhs) const {
- return compare_type( *reinterpret_cast<const TYPE*>(lhs), *reinterpret_cast<const TYPE*>(rhs) );
-}
-
-}; // namespace android
-
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_SORTED_VECTOR_H
diff --git a/include/utils/StopWatch.h b/include/utils/StopWatch.h
deleted file mode 100644
index 693dd3c..0000000
--- a/include/utils/StopWatch.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_STOPWATCH_H
-#define ANDROID_STOPWATCH_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Timers.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-class StopWatch
-{
-public:
- StopWatch( const char *name,
- int clock = SYSTEM_TIME_MONOTONIC,
- uint32_t flags = 0);
- ~StopWatch();
-
- const char* name() const;
- nsecs_t lap();
- nsecs_t elapsedTime() const;
-
- void reset();
-
-private:
- const char* mName;
- int mClock;
- uint32_t mFlags;
-
- struct lap_t {
- nsecs_t soFar;
- nsecs_t thisLap;
- };
-
- nsecs_t mStartTime;
- lap_t mLaps[8];
- int mNumLaps;
-};
-
-
-}; // namespace android
-
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_STOPWATCH_H
diff --git a/include/utils/String16.h b/include/utils/String16.h
deleted file mode 100644
index 360f407..0000000
--- a/include/utils/String16.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_STRING16_H
-#define ANDROID_STRING16_H
-
-#include <utils/Errors.h>
-#include <utils/SharedBuffer.h>
-#include <utils/Unicode.h>
-
-// ---------------------------------------------------------------------------
-
-extern "C" {
-
-}
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class String8;
-class TextOutput;
-
-//! This is a string holding UTF-16 characters.
-class String16
-{
-public:
- String16();
- String16(const String16& o);
- String16(const String16& o,
- size_t len,
- size_t begin=0);
- explicit String16(const char16_t* o);
- explicit String16(const char16_t* o, size_t len);
- explicit String16(const String8& o);
- explicit String16(const char* o);
- explicit String16(const char* o, size_t len);
-
- ~String16();
-
- inline const char16_t* string() const;
- inline size_t size() const;
-
- inline const SharedBuffer* sharedBuffer() const;
-
- void setTo(const String16& other);
- status_t setTo(const char16_t* other);
- status_t setTo(const char16_t* other, size_t len);
- status_t setTo(const String16& other,
- size_t len,
- size_t begin=0);
-
- status_t append(const String16& other);
- status_t append(const char16_t* other, size_t len);
-
- inline String16& operator=(const String16& other);
-
- inline String16& operator+=(const String16& other);
- inline String16 operator+(const String16& other) const;
-
- status_t insert(size_t pos, const char16_t* chrs);
- status_t insert(size_t pos,
- const char16_t* chrs, size_t len);
-
- ssize_t findFirst(char16_t c) const;
- ssize_t findLast(char16_t c) const;
-
- bool startsWith(const String16& prefix) const;
- bool startsWith(const char16_t* prefix) const;
-
- status_t makeLower();
-
- status_t replaceAll(char16_t replaceThis,
- char16_t withThis);
-
- status_t remove(size_t len, size_t begin=0);
-
- inline int compare(const String16& other) const;
-
- inline bool operator<(const String16& other) const;
- inline bool operator<=(const String16& other) const;
- inline bool operator==(const String16& other) const;
- inline bool operator!=(const String16& other) const;
- inline bool operator>=(const String16& other) const;
- inline bool operator>(const String16& other) const;
-
- inline bool operator<(const char16_t* other) const;
- inline bool operator<=(const char16_t* other) const;
- inline bool operator==(const char16_t* other) const;
- inline bool operator!=(const char16_t* other) const;
- inline bool operator>=(const char16_t* other) const;
- inline bool operator>(const char16_t* other) const;
-
- inline operator const char16_t*() const;
-
-private:
- const char16_t* mString;
-};
-
-TextOutput& operator<<(TextOutput& to, const String16& val);
-
-// ---------------------------------------------------------------------------
-// No user servicable parts below.
-
-inline int compare_type(const String16& lhs, const String16& rhs)
-{
- return lhs.compare(rhs);
-}
-
-inline int strictly_order_type(const String16& lhs, const String16& rhs)
-{
- return compare_type(lhs, rhs) < 0;
-}
-
-inline const char16_t* String16::string() const
-{
- return mString;
-}
-
-inline size_t String16::size() const
-{
- return SharedBuffer::sizeFromData(mString)/sizeof(char16_t)-1;
-}
-
-inline const SharedBuffer* String16::sharedBuffer() const
-{
- return SharedBuffer::bufferFromData(mString);
-}
-
-inline String16& String16::operator=(const String16& other)
-{
- setTo(other);
- return *this;
-}
-
-inline String16& String16::operator+=(const String16& other)
-{
- append(other);
- return *this;
-}
-
-inline String16 String16::operator+(const String16& other) const
-{
- String16 tmp(*this);
- tmp += other;
- return tmp;
-}
-
-inline int String16::compare(const String16& other) const
-{
- return strzcmp16(mString, size(), other.mString, other.size());
-}
-
-inline bool String16::operator<(const String16& other) const
-{
- return strzcmp16(mString, size(), other.mString, other.size()) < 0;
-}
-
-inline bool String16::operator<=(const String16& other) const
-{
- return strzcmp16(mString, size(), other.mString, other.size()) <= 0;
-}
-
-inline bool String16::operator==(const String16& other) const
-{
- return strzcmp16(mString, size(), other.mString, other.size()) == 0;
-}
-
-inline bool String16::operator!=(const String16& other) const
-{
- return strzcmp16(mString, size(), other.mString, other.size()) != 0;
-}
-
-inline bool String16::operator>=(const String16& other) const
-{
- return strzcmp16(mString, size(), other.mString, other.size()) >= 0;
-}
-
-inline bool String16::operator>(const String16& other) const
-{
- return strzcmp16(mString, size(), other.mString, other.size()) > 0;
-}
-
-inline bool String16::operator<(const char16_t* other) const
-{
- return strcmp16(mString, other) < 0;
-}
-
-inline bool String16::operator<=(const char16_t* other) const
-{
- return strcmp16(mString, other) <= 0;
-}
-
-inline bool String16::operator==(const char16_t* other) const
-{
- return strcmp16(mString, other) == 0;
-}
-
-inline bool String16::operator!=(const char16_t* other) const
-{
- return strcmp16(mString, other) != 0;
-}
-
-inline bool String16::operator>=(const char16_t* other) const
-{
- return strcmp16(mString, other) >= 0;
-}
-
-inline bool String16::operator>(const char16_t* other) const
-{
- return strcmp16(mString, other) > 0;
-}
-
-inline String16::operator const char16_t*() const
-{
- return mString;
-}
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_STRING16_H
diff --git a/include/utils/String8.h b/include/utils/String8.h
deleted file mode 100644
index 4163697..0000000
--- a/include/utils/String8.h
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_STRING8_H
-#define ANDROID_STRING8_H
-
-#include <utils/Errors.h>
-#include <utils/SharedBuffer.h>
-#include <utils/Unicode.h>
-
-#include <string.h> // for strcmp
-#include <stdarg.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-class String16;
-class TextOutput;
-
-//! This is a string holding UTF-8 characters. Does not allow the value more
-// than 0x10FFFF, which is not valid unicode codepoint.
-class String8
-{
-public:
- String8();
- String8(const String8& o);
- explicit String8(const char* o);
- explicit String8(const char* o, size_t numChars);
-
- explicit String8(const String16& o);
- explicit String8(const char16_t* o);
- explicit String8(const char16_t* o, size_t numChars);
- explicit String8(const char32_t* o);
- explicit String8(const char32_t* o, size_t numChars);
- ~String8();
-
- static inline const String8 empty();
-
- static String8 format(const char* fmt, ...) __attribute__((format (printf, 1, 2)));
- static String8 formatV(const char* fmt, va_list args);
-
- inline const char* string() const;
- inline size_t size() const;
- inline size_t length() const;
- inline size_t bytes() const;
- inline bool isEmpty() const;
-
- inline const SharedBuffer* sharedBuffer() const;
-
- void clear();
-
- void setTo(const String8& other);
- status_t setTo(const char* other);
- status_t setTo(const char* other, size_t numChars);
- status_t setTo(const char16_t* other, size_t numChars);
- status_t setTo(const char32_t* other,
- size_t length);
-
- status_t append(const String8& other);
- status_t append(const char* other);
- status_t append(const char* other, size_t numChars);
-
- status_t appendFormat(const char* fmt, ...)
- __attribute__((format (printf, 2, 3)));
- status_t appendFormatV(const char* fmt, va_list args);
-
- // Note that this function takes O(N) time to calculate the value.
- // No cache value is stored.
- size_t getUtf32Length() const;
- int32_t getUtf32At(size_t index,
- size_t *next_index) const;
- void getUtf32(char32_t* dst) const;
-
- inline String8& operator=(const String8& other);
- inline String8& operator=(const char* other);
-
- inline String8& operator+=(const String8& other);
- inline String8 operator+(const String8& other) const;
-
- inline String8& operator+=(const char* other);
- inline String8 operator+(const char* other) const;
-
- inline int compare(const String8& other) const;
-
- inline bool operator<(const String8& other) const;
- inline bool operator<=(const String8& other) const;
- inline bool operator==(const String8& other) const;
- inline bool operator!=(const String8& other) const;
- inline bool operator>=(const String8& other) const;
- inline bool operator>(const String8& other) const;
-
- inline bool operator<(const char* other) const;
- inline bool operator<=(const char* other) const;
- inline bool operator==(const char* other) const;
- inline bool operator!=(const char* other) const;
- inline bool operator>=(const char* other) const;
- inline bool operator>(const char* other) const;
-
- inline operator const char*() const;
-
- char* lockBuffer(size_t size);
- void unlockBuffer();
- status_t unlockBuffer(size_t size);
-
- // return the index of the first byte of other in this at or after
- // start, or -1 if not found
- ssize_t find(const char* other, size_t start = 0) const;
-
- void toLower();
- void toLower(size_t start, size_t numChars);
- void toUpper();
- void toUpper(size_t start, size_t numChars);
-
- /*
- * These methods operate on the string as if it were a path name.
- */
-
- /*
- * Set the filename field to a specific value.
- *
- * Normalizes the filename, removing a trailing '/' if present.
- */
- void setPathName(const char* name);
- void setPathName(const char* name, size_t numChars);
-
- /*
- * Get just the filename component.
- *
- * "/tmp/foo/bar.c" --> "bar.c"
- */
- String8 getPathLeaf(void) const;
-
- /*
- * Remove the last (file name) component, leaving just the directory
- * name.
- *
- * "/tmp/foo/bar.c" --> "/tmp/foo"
- * "/tmp" --> "" // ????? shouldn't this be "/" ???? XXX
- * "bar.c" --> ""
- */
- String8 getPathDir(void) const;
-
- /*
- * Retrieve the front (root dir) component. Optionally also return the
- * remaining components.
- *
- * "/tmp/foo/bar.c" --> "tmp" (remain = "foo/bar.c")
- * "/tmp" --> "tmp" (remain = "")
- * "bar.c" --> "bar.c" (remain = "")
- */
- String8 walkPath(String8* outRemains = NULL) const;
-
- /*
- * Return the filename extension. This is the last '.' and any number
- * of characters that follow it. The '.' is included in case we
- * decide to expand our definition of what constitutes an extension.
- *
- * "/tmp/foo/bar.c" --> ".c"
- * "/tmp" --> ""
- * "/tmp/foo.bar/baz" --> ""
- * "foo.jpeg" --> ".jpeg"
- * "foo." --> ""
- */
- String8 getPathExtension(void) const;
-
- /*
- * Return the path without the extension. Rules for what constitutes
- * an extension are described in the comment for getPathExtension().
- *
- * "/tmp/foo/bar.c" --> "/tmp/foo/bar"
- */
- String8 getBasePath(void) const;
-
- /*
- * Add a component to the pathname. We guarantee that there is
- * exactly one path separator between the old path and the new.
- * If there is no existing name, we just copy the new name in.
- *
- * If leaf is a fully qualified path (i.e. starts with '/', it
- * replaces whatever was there before.
- */
- String8& appendPath(const char* leaf);
- String8& appendPath(const String8& leaf) { return appendPath(leaf.string()); }
-
- /*
- * Like appendPath(), but does not affect this string. Returns a new one instead.
- */
- String8 appendPathCopy(const char* leaf) const
- { String8 p(*this); p.appendPath(leaf); return p; }
- String8 appendPathCopy(const String8& leaf) const { return appendPathCopy(leaf.string()); }
-
- /*
- * Converts all separators in this string to /, the default path separator.
- *
- * If the default OS separator is backslash, this converts all
- * backslashes to slashes, in-place. Otherwise it does nothing.
- * Returns self.
- */
- String8& convertToResPath();
-
-private:
- status_t real_append(const char* other, size_t numChars);
- char* find_extension(void) const;
-
- const char* mString;
-};
-
-TextOutput& operator<<(TextOutput& to, const String16& val);
-
-// ---------------------------------------------------------------------------
-// No user servicable parts below.
-
-inline int compare_type(const String8& lhs, const String8& rhs)
-{
- return lhs.compare(rhs);
-}
-
-inline int strictly_order_type(const String8& lhs, const String8& rhs)
-{
- return compare_type(lhs, rhs) < 0;
-}
-
-inline const String8 String8::empty() {
- return String8();
-}
-
-inline const char* String8::string() const
-{
- return mString;
-}
-
-inline size_t String8::length() const
-{
- return SharedBuffer::sizeFromData(mString)-1;
-}
-
-inline size_t String8::size() const
-{
- return length();
-}
-
-inline bool String8::isEmpty() const
-{
- return length() == 0;
-}
-
-inline size_t String8::bytes() const
-{
- return SharedBuffer::sizeFromData(mString)-1;
-}
-
-inline const SharedBuffer* String8::sharedBuffer() const
-{
- return SharedBuffer::bufferFromData(mString);
-}
-
-inline String8& String8::operator=(const String8& other)
-{
- setTo(other);
- return *this;
-}
-
-inline String8& String8::operator=(const char* other)
-{
- setTo(other);
- return *this;
-}
-
-inline String8& String8::operator+=(const String8& other)
-{
- append(other);
- return *this;
-}
-
-inline String8 String8::operator+(const String8& other) const
-{
- String8 tmp(*this);
- tmp += other;
- return tmp;
-}
-
-inline String8& String8::operator+=(const char* other)
-{
- append(other);
- return *this;
-}
-
-inline String8 String8::operator+(const char* other) const
-{
- String8 tmp(*this);
- tmp += other;
- return tmp;
-}
-
-inline int String8::compare(const String8& other) const
-{
- return strcmp(mString, other.mString);
-}
-
-inline bool String8::operator<(const String8& other) const
-{
- return strcmp(mString, other.mString) < 0;
-}
-
-inline bool String8::operator<=(const String8& other) const
-{
- return strcmp(mString, other.mString) <= 0;
-}
-
-inline bool String8::operator==(const String8& other) const
-{
- return strcmp(mString, other.mString) == 0;
-}
-
-inline bool String8::operator!=(const String8& other) const
-{
- return strcmp(mString, other.mString) != 0;
-}
-
-inline bool String8::operator>=(const String8& other) const
-{
- return strcmp(mString, other.mString) >= 0;
-}
-
-inline bool String8::operator>(const String8& other) const
-{
- return strcmp(mString, other.mString) > 0;
-}
-
-inline bool String8::operator<(const char* other) const
-{
- return strcmp(mString, other) < 0;
-}
-
-inline bool String8::operator<=(const char* other) const
-{
- return strcmp(mString, other) <= 0;
-}
-
-inline bool String8::operator==(const char* other) const
-{
- return strcmp(mString, other) == 0;
-}
-
-inline bool String8::operator!=(const char* other) const
-{
- return strcmp(mString, other) != 0;
-}
-
-inline bool String8::operator>=(const char* other) const
-{
- return strcmp(mString, other) >= 0;
-}
-
-inline bool String8::operator>(const char* other) const
-{
- return strcmp(mString, other) > 0;
-}
-
-inline String8::operator const char*() const
-{
- return mString;
-}
-
-} // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_STRING8_H
diff --git a/include/utils/StringArray.h b/include/utils/StringArray.h
deleted file mode 100644
index c244587..0000000
--- a/include/utils/StringArray.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-//
-// Sortable array of strings. STL-ish, but STL-free.
-//
-#ifndef _LIBS_UTILS_STRING_ARRAY_H
-#define _LIBS_UTILS_STRING_ARRAY_H
-
-#include <stdlib.h>
-#include <string.h>
-
-namespace android {
-
-//
-// An expanding array of strings. Add, get, sort, delete.
-//
-class StringArray {
-public:
- StringArray();
- virtual ~StringArray();
-
- //
- // Add a string. A copy of the string is made.
- //
- bool push_back(const char* str);
-
- //
- // Delete an entry.
- //
- void erase(int idx);
-
- //
- // Sort the array.
- //
- void sort(int (*compare)(const void*, const void*));
-
- //
- // Pass this to the sort routine to do an ascending alphabetical sort.
- //
- static int cmpAscendingAlpha(const void* pstr1, const void* pstr2);
-
- //
- // Get the #of items in the array.
- //
- inline int size(void) const { return mCurrent; }
-
- //
- // Return entry N.
- // [should use operator[] here]
- //
- const char* getEntry(int idx) const {
- return (unsigned(idx) >= unsigned(mCurrent)) ? NULL : mArray[idx];
- }
-
- //
- // Set entry N to specified string.
- // [should use operator[] here]
- //
- void setEntry(int idx, const char* str);
-
-private:
- int mMax;
- int mCurrent;
- char** mArray;
-};
-
-}; // namespace android
-
-#endif // _LIBS_UTILS_STRING_ARRAY_H
diff --git a/include/utils/StrongPointer.h b/include/utils/StrongPointer.h
deleted file mode 100644
index 49fa3a8..0000000
--- a/include/utils/StrongPointer.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_STRONG_POINTER_H
-#define ANDROID_STRONG_POINTER_H
-
-#include <cutils/atomic.h>
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <stdlib.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-class TextOutput;
-TextOutput& printStrongPointer(TextOutput& to, const void* val);
-
-template<typename T> class wp;
-
-// ---------------------------------------------------------------------------
-
-#define COMPARE(_op_) \
-inline bool operator _op_ (const sp<T>& o) const { \
- return m_ptr _op_ o.m_ptr; \
-} \
-inline bool operator _op_ (const T* o) const { \
- return m_ptr _op_ o; \
-} \
-template<typename U> \
-inline bool operator _op_ (const sp<U>& o) const { \
- return m_ptr _op_ o.m_ptr; \
-} \
-template<typename U> \
-inline bool operator _op_ (const U* o) const { \
- return m_ptr _op_ o; \
-} \
-inline bool operator _op_ (const wp<T>& o) const { \
- return m_ptr _op_ o.m_ptr; \
-} \
-template<typename U> \
-inline bool operator _op_ (const wp<U>& o) const { \
- return m_ptr _op_ o.m_ptr; \
-}
-
-// ---------------------------------------------------------------------------
-
-template <typename T>
-class sp
-{
-public:
- inline sp() : m_ptr(0) { }
-
- sp(T* other);
- sp(const sp<T>& other);
- template<typename U> sp(U* other);
- template<typename U> sp(const sp<U>& other);
-
- ~sp();
-
- // Assignment
-
- sp& operator = (T* other);
- sp& operator = (const sp<T>& other);
-
- template<typename U> sp& operator = (const sp<U>& other);
- template<typename U> sp& operator = (U* other);
-
- //! Special optimization for use by ProcessState (and nobody else).
- void force_set(T* other);
-
- // Reset
-
- void clear();
-
- // Accessors
-
- inline T& operator* () const { return *m_ptr; }
- inline T* operator-> () const { return m_ptr; }
- inline T* get() const { return m_ptr; }
-
- // Operators
-
- COMPARE(==)
- COMPARE(!=)
- COMPARE(>)
- COMPARE(<)
- COMPARE(<=)
- COMPARE(>=)
-
-private:
- template<typename Y> friend class sp;
- template<typename Y> friend class wp;
- void set_pointer(T* ptr);
- T* m_ptr;
-};
-
-#undef COMPARE
-
-template <typename T>
-TextOutput& operator<<(TextOutput& to, const sp<T>& val);
-
-// ---------------------------------------------------------------------------
-// No user serviceable parts below here.
-
-template<typename T>
-sp<T>::sp(T* other)
-: m_ptr(other)
- {
- if (other) other->incStrong(this);
- }
-
-template<typename T>
-sp<T>::sp(const sp<T>& other)
-: m_ptr(other.m_ptr)
- {
- if (m_ptr) m_ptr->incStrong(this);
- }
-
-template<typename T> template<typename U>
-sp<T>::sp(U* other) : m_ptr(other)
-{
- if (other) ((T*)other)->incStrong(this);
-}
-
-template<typename T> template<typename U>
-sp<T>::sp(const sp<U>& other)
-: m_ptr(other.m_ptr)
- {
- if (m_ptr) m_ptr->incStrong(this);
- }
-
-template<typename T>
-sp<T>::~sp()
-{
- if (m_ptr) m_ptr->decStrong(this);
-}
-
-template<typename T>
-sp<T>& sp<T>::operator = (const sp<T>& other) {
- T* otherPtr(other.m_ptr);
- if (otherPtr) otherPtr->incStrong(this);
- if (m_ptr) m_ptr->decStrong(this);
- m_ptr = otherPtr;
- return *this;
-}
-
-template<typename T>
-sp<T>& sp<T>::operator = (T* other)
-{
- if (other) other->incStrong(this);
- if (m_ptr) m_ptr->decStrong(this);
- m_ptr = other;
- return *this;
-}
-
-template<typename T> template<typename U>
-sp<T>& sp<T>::operator = (const sp<U>& other)
-{
- T* otherPtr(other.m_ptr);
- if (otherPtr) otherPtr->incStrong(this);
- if (m_ptr) m_ptr->decStrong(this);
- m_ptr = otherPtr;
- return *this;
-}
-
-template<typename T> template<typename U>
-sp<T>& sp<T>::operator = (U* other)
-{
- if (other) ((T*)other)->incStrong(this);
- if (m_ptr) m_ptr->decStrong(this);
- m_ptr = other;
- return *this;
-}
-
-template<typename T>
-void sp<T>::force_set(T* other)
-{
- other->forceIncStrong(this);
- m_ptr = other;
-}
-
-template<typename T>
-void sp<T>::clear()
-{
- if (m_ptr) {
- m_ptr->decStrong(this);
- m_ptr = 0;
- }
-}
-
-template<typename T>
-void sp<T>::set_pointer(T* ptr) {
- m_ptr = ptr;
-}
-
-template <typename T>
-inline TextOutput& operator<<(TextOutput& to, const sp<T>& val)
-{
- return printStrongPointer(to, val.get());
-}
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_STRONG_POINTER_H
diff --git a/include/utils/SystemClock.h b/include/utils/SystemClock.h
deleted file mode 100644
index 7c319be..0000000
--- a/include/utils/SystemClock.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef ANDROID_UTILS_SYSTEMCLOCK_H
-#define ANDROID_UTILS_SYSTEMCLOCK_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-namespace android {
-
-int setCurrentTimeMillis(int64_t millis);
-int64_t uptimeMillis();
-int64_t elapsedRealtime();
-
-}; // namespace android
-
-#endif // ANDROID_UTILS_SYSTEMCLOCK_H
-
diff --git a/include/utils/TextOutput.h b/include/utils/TextOutput.h
deleted file mode 100644
index de2fbbe..0000000
--- a/include/utils/TextOutput.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-#ifndef ANDROID_TEXTOUTPUT_H
-#define ANDROID_TEXTOUTPUT_H
-
-#include <utils/Errors.h>
-
-#include <stdint.h>
-#include <string.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-
-class TextOutput
-{
-public:
- TextOutput();
- virtual ~TextOutput();
-
- virtual status_t print(const char* txt, size_t len) = 0;
- virtual void moveIndent(int delta) = 0;
-
- class Bundle {
- public:
- inline Bundle(TextOutput& to) : mTO(to) { to.pushBundle(); }
- inline ~Bundle() { mTO.popBundle(); }
- private:
- TextOutput& mTO;
- };
-
- virtual void pushBundle() = 0;
- virtual void popBundle() = 0;
-};
-
-// ---------------------------------------------------------------------------
-
-// Text output stream for printing to the log (via utils/Log.h).
-extern TextOutput& alog;
-
-// Text output stream for printing to stdout.
-extern TextOutput& aout;
-
-// Text output stream for printing to stderr.
-extern TextOutput& aerr;
-
-typedef TextOutput& (*TextOutputManipFunc)(TextOutput&);
-
-TextOutput& endl(TextOutput& to);
-TextOutput& indent(TextOutput& to);
-TextOutput& dedent(TextOutput& to);
-
-TextOutput& operator<<(TextOutput& to, const char* str);
-TextOutput& operator<<(TextOutput& to, char); // writes raw character
-TextOutput& operator<<(TextOutput& to, bool);
-TextOutput& operator<<(TextOutput& to, int);
-TextOutput& operator<<(TextOutput& to, long);
-TextOutput& operator<<(TextOutput& to, unsigned int);
-TextOutput& operator<<(TextOutput& to, unsigned long);
-TextOutput& operator<<(TextOutput& to, long long);
-TextOutput& operator<<(TextOutput& to, unsigned long long);
-TextOutput& operator<<(TextOutput& to, float);
-TextOutput& operator<<(TextOutput& to, double);
-TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func);
-TextOutput& operator<<(TextOutput& to, const void*);
-
-class TypeCode
-{
-public:
- inline TypeCode(uint32_t code);
- inline ~TypeCode();
-
- inline uint32_t typeCode() const;
-
-private:
- uint32_t mCode;
-};
-
-TextOutput& operator<<(TextOutput& to, const TypeCode& val);
-
-class HexDump
-{
-public:
- HexDump(const void *buf, size_t size, size_t bytesPerLine=16);
- inline ~HexDump();
-
- inline HexDump& setBytesPerLine(size_t bytesPerLine);
- inline HexDump& setSingleLineCutoff(int32_t bytes);
- inline HexDump& setAlignment(size_t alignment);
- inline HexDump& setCArrayStyle(bool enabled);
-
- inline const void* buffer() const;
- inline size_t size() const;
- inline size_t bytesPerLine() const;
- inline int32_t singleLineCutoff() const;
- inline size_t alignment() const;
- inline bool carrayStyle() const;
-
-private:
- const void* mBuffer;
- size_t mSize;
- size_t mBytesPerLine;
- int32_t mSingleLineCutoff;
- size_t mAlignment;
- bool mCArrayStyle;
-};
-
-TextOutput& operator<<(TextOutput& to, const HexDump& val);
-
-// ---------------------------------------------------------------------------
-// No user servicable parts below.
-
-inline TextOutput& endl(TextOutput& to)
-{
- to.print("\n", 1);
- return to;
-}
-
-inline TextOutput& indent(TextOutput& to)
-{
- to.moveIndent(1);
- return to;
-}
-
-inline TextOutput& dedent(TextOutput& to)
-{
- to.moveIndent(-1);
- return to;
-}
-
-inline TextOutput& operator<<(TextOutput& to, const char* str)
-{
- to.print(str, strlen(str));
- return to;
-}
-
-inline TextOutput& operator<<(TextOutput& to, char c)
-{
- to.print(&c, 1);
- return to;
-}
-
-inline TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func)
-{
- return (*func)(to);
-}
-
-inline TypeCode::TypeCode(uint32_t code) : mCode(code) { }
-inline TypeCode::~TypeCode() { }
-inline uint32_t TypeCode::typeCode() const { return mCode; }
-
-inline HexDump::~HexDump() { }
-
-inline HexDump& HexDump::setBytesPerLine(size_t bytesPerLine) {
- mBytesPerLine = bytesPerLine; return *this;
-}
-inline HexDump& HexDump::setSingleLineCutoff(int32_t bytes) {
- mSingleLineCutoff = bytes; return *this;
-}
-inline HexDump& HexDump::setAlignment(size_t alignment) {
- mAlignment = alignment; return *this;
-}
-inline HexDump& HexDump::setCArrayStyle(bool enabled) {
- mCArrayStyle = enabled; return *this;
-}
-
-inline const void* HexDump::buffer() const { return mBuffer; }
-inline size_t HexDump::size() const { return mSize; }
-inline size_t HexDump::bytesPerLine() const { return mBytesPerLine; }
-inline int32_t HexDump::singleLineCutoff() const { return mSingleLineCutoff; }
-inline size_t HexDump::alignment() const { return mAlignment; }
-inline bool HexDump::carrayStyle() const { return mCArrayStyle; }
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_TEXTOUTPUT_H
diff --git a/include/utils/Thread.h b/include/utils/Thread.h
deleted file mode 100644
index 4a34abd..0000000
--- a/include/utils/Thread.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef _LIBS_UTILS_THREAD_H
-#define _LIBS_UTILS_THREAD_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <time.h>
-
-#if defined(HAVE_PTHREADS)
-# include <pthread.h>
-#endif
-
-#include <utils/Condition.h>
-#include <utils/Errors.h>
-#include <utils/Mutex.h>
-#include <utils/RefBase.h>
-#include <utils/Timers.h>
-#include <utils/ThreadDefs.h>
-
-// ---------------------------------------------------------------------------
-namespace android {
-// ---------------------------------------------------------------------------
-
-class Thread : virtual public RefBase
-{
-public:
- // Create a Thread object, but doesn't create or start the associated
- // thread. See the run() method.
- Thread(bool canCallJava = true);
- virtual ~Thread();
-
- // Start the thread in threadLoop() which needs to be implemented.
- virtual status_t run( const char* name = 0,
- int32_t priority = PRIORITY_DEFAULT,
- size_t stack = 0);
-
- // Ask this object's thread to exit. This function is asynchronous, when the
- // function returns the thread might still be running. Of course, this
- // function can be called from a different thread.
- virtual void requestExit();
-
- // Good place to do one-time initializations
- virtual status_t readyToRun();
-
- // Call requestExit() and wait until this object's thread exits.
- // BE VERY CAREFUL of deadlocks. In particular, it would be silly to call
- // this function from this object's thread. Will return WOULD_BLOCK in
- // that case.
- status_t requestExitAndWait();
-
- // Wait until this object's thread exits. Returns immediately if not yet running.
- // Do not call from this object's thread; will return WOULD_BLOCK in that case.
- status_t join();
-
-#ifdef HAVE_ANDROID_OS
- // Return the thread's kernel ID, same as the thread itself calling gettid() or
- // androidGetTid(), or -1 if the thread is not running.
- pid_t getTid() const;
-#endif
-
-protected:
- // exitPending() returns true if requestExit() has been called.
- bool exitPending() const;
-
-private:
- // Derived class must implement threadLoop(). The thread starts its life
- // here. There are two ways of using the Thread object:
- // 1) loop: if threadLoop() returns true, it will be called again if
- // requestExit() wasn't called.
- // 2) once: if threadLoop() returns false, the thread will exit upon return.
- virtual bool threadLoop() = 0;
-
-private:
- Thread& operator=(const Thread&);
- static int _threadLoop(void* user);
- const bool mCanCallJava;
- // always hold mLock when reading or writing
- thread_id_t mThread;
- mutable Mutex mLock;
- Condition mThreadExitedCondition;
- status_t mStatus;
- // note that all accesses of mExitPending and mRunning need to hold mLock
- volatile bool mExitPending;
- volatile bool mRunning;
- sp<Thread> mHoldSelf;
-#ifdef HAVE_ANDROID_OS
- // legacy for debugging, not used by getTid() as it is set by the child thread
- // and so is not initialized until the child reaches that point
- pid_t mTid;
-#endif
-};
-
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-#endif // _LIBS_UTILS_THREAD_H
-// ---------------------------------------------------------------------------
diff --git a/include/utils/ThreadDefs.h b/include/utils/ThreadDefs.h
deleted file mode 100644
index 3e56373..0000000
--- a/include/utils/ThreadDefs.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef _LIBS_UTILS_THREAD_DEFS_H
-#define _LIBS_UTILS_THREAD_DEFS_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <system/graphics.h>
-
-// ---------------------------------------------------------------------------
-// C API
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void* android_thread_id_t;
-
-typedef int (*android_thread_func_t)(void*);
-
-enum {
- /*
- * ***********************************************
- * ** Keep in sync with android.os.Process.java **
- * ***********************************************
- *
- * This maps directly to the "nice" priorities we use in Android.
- * A thread priority should be chosen inverse-proportionally to
- * the amount of work the thread is expected to do. The more work
- * a thread will do, the less favorable priority it should get so that
- * it doesn't starve the system. Threads not behaving properly might
- * be "punished" by the kernel.
- * Use the levels below when appropriate. Intermediate values are
- * acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below.
- */
- ANDROID_PRIORITY_LOWEST = 19,
-
- /* use for background tasks */
- ANDROID_PRIORITY_BACKGROUND = 10,
-
- /* most threads run at normal priority */
- ANDROID_PRIORITY_NORMAL = 0,
-
- /* threads currently running a UI that the user is interacting with */
- ANDROID_PRIORITY_FOREGROUND = -2,
-
- /* the main UI thread has a slightly more favorable priority */
- ANDROID_PRIORITY_DISPLAY = -4,
-
- /* ui service treads might want to run at a urgent display (uncommon) */
- ANDROID_PRIORITY_URGENT_DISPLAY = HAL_PRIORITY_URGENT_DISPLAY,
-
- /* all normal audio threads */
- ANDROID_PRIORITY_AUDIO = -16,
-
- /* service audio threads (uncommon) */
- ANDROID_PRIORITY_URGENT_AUDIO = -19,
-
- /* should never be used in practice. regular process might not
- * be allowed to use this level */
- ANDROID_PRIORITY_HIGHEST = -20,
-
- ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL,
- ANDROID_PRIORITY_MORE_FAVORABLE = -1,
- ANDROID_PRIORITY_LESS_FAVORABLE = +1,
-};
-
-enum {
- ANDROID_TGROUP_DEFAULT = 0,
- ANDROID_TGROUP_BG_NONINTERACT = 1,
- ANDROID_TGROUP_FG_BOOST = 2,
- ANDROID_TGROUP_MAX = ANDROID_TGROUP_FG_BOOST,
-};
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-// ---------------------------------------------------------------------------
-// C++ API
-#ifdef __cplusplus
-namespace android {
-// ---------------------------------------------------------------------------
-
-typedef android_thread_id_t thread_id_t;
-typedef android_thread_func_t thread_func_t;
-
-enum {
- PRIORITY_LOWEST = ANDROID_PRIORITY_LOWEST,
- PRIORITY_BACKGROUND = ANDROID_PRIORITY_BACKGROUND,
- PRIORITY_NORMAL = ANDROID_PRIORITY_NORMAL,
- PRIORITY_FOREGROUND = ANDROID_PRIORITY_FOREGROUND,
- PRIORITY_DISPLAY = ANDROID_PRIORITY_DISPLAY,
- PRIORITY_URGENT_DISPLAY = ANDROID_PRIORITY_URGENT_DISPLAY,
- PRIORITY_AUDIO = ANDROID_PRIORITY_AUDIO,
- PRIORITY_URGENT_AUDIO = ANDROID_PRIORITY_URGENT_AUDIO,
- PRIORITY_HIGHEST = ANDROID_PRIORITY_HIGHEST,
- PRIORITY_DEFAULT = ANDROID_PRIORITY_DEFAULT,
- PRIORITY_MORE_FAVORABLE = ANDROID_PRIORITY_MORE_FAVORABLE,
- PRIORITY_LESS_FAVORABLE = ANDROID_PRIORITY_LESS_FAVORABLE,
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-#endif // __cplusplus
-// ---------------------------------------------------------------------------
-
-
-#endif // _LIBS_UTILS_THREAD_DEFS_H
diff --git a/include/utils/Timers.h b/include/utils/Timers.h
deleted file mode 100644
index 8b4d322..0000000
--- a/include/utils/Timers.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-// Timer functions.
-//
-#ifndef _LIBS_UTILS_TIMERS_H
-#define _LIBS_UTILS_TIMERS_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-// ------------------------------------------------------------------
-// C API
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef int64_t nsecs_t; // nano-seconds
-
-static inline nsecs_t seconds_to_nanoseconds(nsecs_t secs)
-{
- return secs*1000000000;
-}
-
-static inline nsecs_t milliseconds_to_nanoseconds(nsecs_t secs)
-{
- return secs*1000000;
-}
-
-static inline nsecs_t microseconds_to_nanoseconds(nsecs_t secs)
-{
- return secs*1000;
-}
-
-static inline nsecs_t nanoseconds_to_seconds(nsecs_t secs)
-{
- return secs/1000000000;
-}
-
-static inline nsecs_t nanoseconds_to_milliseconds(nsecs_t secs)
-{
- return secs/1000000;
-}
-
-static inline nsecs_t nanoseconds_to_microseconds(nsecs_t secs)
-{
- return secs/1000;
-}
-
-static inline nsecs_t s2ns(nsecs_t v) {return seconds_to_nanoseconds(v);}
-static inline nsecs_t ms2ns(nsecs_t v) {return milliseconds_to_nanoseconds(v);}
-static inline nsecs_t us2ns(nsecs_t v) {return microseconds_to_nanoseconds(v);}
-static inline nsecs_t ns2s(nsecs_t v) {return nanoseconds_to_seconds(v);}
-static inline nsecs_t ns2ms(nsecs_t v) {return nanoseconds_to_milliseconds(v);}
-static inline nsecs_t ns2us(nsecs_t v) {return nanoseconds_to_microseconds(v);}
-
-static inline nsecs_t seconds(nsecs_t v) { return s2ns(v); }
-static inline nsecs_t milliseconds(nsecs_t v) { return ms2ns(v); }
-static inline nsecs_t microseconds(nsecs_t v) { return us2ns(v); }
-
-enum {
- SYSTEM_TIME_REALTIME = 0, // system-wide realtime clock
- SYSTEM_TIME_MONOTONIC = 1, // monotonic time since unspecified starting point
- SYSTEM_TIME_PROCESS = 2, // high-resolution per-process clock
- SYSTEM_TIME_THREAD = 3 // high-resolution per-thread clock
-};
-
-// return the system-time according to the specified clock
-#ifdef __cplusplus
-nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC);
-#else
-nsecs_t systemTime(int clock);
-#endif // def __cplusplus
-
-/**
- * Returns the number of milliseconds to wait between the reference time and the timeout time.
- * If the timeout is in the past relative to the reference time, returns 0.
- * If the timeout is more than INT_MAX milliseconds in the future relative to the reference time,
- * such as when timeoutTime == LLONG_MAX, returns -1 to indicate an infinite timeout delay.
- * Otherwise, returns the difference between the reference time and timeout time
- * rounded up to the next millisecond.
- */
-int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-// ------------------------------------------------------------------
-// C++ API
-
-#ifdef __cplusplus
-
-namespace android {
-/*
- * Time the duration of something.
- *
- * Includes some timeval manipulation functions.
- */
-class DurationTimer {
-public:
- DurationTimer() {}
- ~DurationTimer() {}
-
- // Start the timer.
- void start();
- // Stop the timer.
- void stop();
- // Get the duration in microseconds.
- long long durationUsecs() const;
-
- // Subtract two timevals. Returns the difference (ptv1-ptv2) in
- // microseconds.
- static long long subtractTimevals(const struct timeval* ptv1,
- const struct timeval* ptv2);
-
- // Add the specified amount of time to the timeval.
- static void addToTimeval(struct timeval* ptv, long usec);
-
-private:
- struct timeval mStartWhen;
- struct timeval mStopWhen;
-};
-
-}; // android
-#endif // def __cplusplus
-
-#endif // _LIBS_UTILS_TIMERS_H
diff --git a/include/utils/Tokenizer.h b/include/utils/Tokenizer.h
deleted file mode 100644
index c7db5fb..0000000
--- a/include/utils/Tokenizer.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef _UTILS_TOKENIZER_H
-#define _UTILS_TOKENIZER_H
-
-#include <assert.h>
-#include <utils/Errors.h>
-#include <utils/FileMap.h>
-#include <utils/String8.h>
-
-namespace android {
-
-/**
- * A simple tokenizer for loading and parsing ASCII text files line by line.
- */
-class Tokenizer {
- Tokenizer(const String8& filename, FileMap* fileMap, char* buffer, size_t length);
-
-public:
- ~Tokenizer();
-
- /**
- * Opens a file and maps it into memory.
- *
- * Returns NO_ERROR and a tokenizer for the file, if successful.
- * Otherwise returns an error and sets outTokenizer to NULL.
- */
- static status_t open(const String8& filename, Tokenizer** outTokenizer);
-
- /**
- * Returns true if at the end of the file.
- */
- inline bool isEof() const { return mCurrent == getEnd(); }
-
- /**
- * Returns true if at the end of the line or end of the file.
- */
- inline bool isEol() const { return isEof() || *mCurrent == '\n'; }
-
- /**
- * Gets the name of the file.
- */
- inline String8 getFilename() const { return mFilename; }
-
- /**
- * Gets a 1-based line number index for the current position.
- */
- inline int32_t getLineNumber() const { return mLineNumber; }
-
- /**
- * Formats a location string consisting of the filename and current line number.
- * Returns a string like "MyFile.txt:33".
- */
- String8 getLocation() const;
-
- /**
- * Gets the character at the current position.
- * Returns null at end of file.
- */
- inline char peekChar() const { return isEof() ? '\0' : *mCurrent; }
-
- /**
- * Gets the remainder of the current line as a string, excluding the newline character.
- */
- String8 peekRemainderOfLine() const;
-
- /**
- * Gets the character at the current position and advances past it.
- * Returns null at end of file.
- */
- inline char nextChar() { return isEof() ? '\0' : *(mCurrent++); }
-
- /**
- * Gets the next token on this line stopping at the specified delimiters
- * or the end of the line whichever comes first and advances past it.
- * Also stops at embedded nulls.
- * Returns the token or an empty string if the current character is a delimiter
- * or is at the end of the line.
- */
- String8 nextToken(const char* delimiters);
-
- /**
- * Advances to the next line.
- * Does nothing if already at the end of the file.
- */
- void nextLine();
-
- /**
- * Skips over the specified delimiters in the line.
- * Also skips embedded nulls.
- */
- void skipDelimiters(const char* delimiters);
-
-private:
- Tokenizer(const Tokenizer& other); // not copyable
-
- String8 mFilename;
- FileMap* mFileMap;
- char* mBuffer;
- size_t mLength;
-
- const char* mCurrent;
- int32_t mLineNumber;
-
- inline const char* getEnd() const { return mBuffer + mLength; }
-
-};
-
-} // namespace android
-
-#endif // _UTILS_TOKENIZER_H
diff --git a/include/utils/Trace.h b/include/utils/Trace.h
deleted file mode 100644
index f33ddf6..0000000
--- a/include/utils/Trace.h
+++ /dev/null
@@ -1,166 +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.
- */
-
-#ifndef ANDROID_TRACE_H
-#define ANDROID_TRACE_H
-
-#include <fcntl.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <cutils/compiler.h>
-#include <utils/threads.h>
-
-// The ATRACE_TAG macro can be defined before including this header to trace
-// using one of the tags defined below. It must be defined to one of the
-// following ATRACE_TAG_* macros. The trace tag is used to filter tracing in
-// userland to avoid some of the runtime cost of tracing when it is not desired.
-//
-// Defining ATRACE_TAG to be ATRACE_TAG_ALWAYS will result in the tracing always
-// being enabled - this should ONLY be done for debug code, as userland tracing
-// has a performance cost even when the trace is not being recorded. Defining
-// ATRACE_TAG to be ATRACE_TAG_NEVER or leaving ATRACE_TAG undefined will result
-// in the tracing always being disabled.
-#define ATRACE_TAG_NEVER 0 // The "never" tag is never enabled.
-#define ATRACE_TAG_ALWAYS (1<<0) // The "always" tag is always enabled.
-#define ATRACE_TAG_GRAPHICS (1<<1)
-#define ATRACE_TAG_LAST (1<<1)
-
-#define ATRACE_TAG_INVALID (~((ATRACE_TAG_LAST - 1) | ATRACE_TAG_LAST))
-
-#ifndef ATRACE_TAG
-#define ATRACE_TAG ATRACE_TAG_NEVER
-#elif ATRACE_TAG > ATRACE_TAG_LAST
-#error ATRACE_TAG must be defined to be one of the tags defined in utils/Trace.h
-#endif
-
-// ATRACE_CALL traces the beginning and end of the current function. To trace
-// the correct start and end times this macro should be the first line of the
-// function body.
-#define ATRACE_CALL() android::ScopedTrace ___tracer(ATRACE_TAG, __FUNCTION__)
-
-// ATRACE_INT traces a named integer value. This can be used to track how the
-// value changes over time in a trace.
-#define ATRACE_INT(name, value) android::Tracer::traceCounter(ATRACE_TAG, name, value)
-
-namespace android {
-
-class Tracer {
-
-public:
-
- static inline void traceCounter(uint64_t tag, const char* name,
- int32_t value) {
- if (!android_atomic_acquire_load(&sIsReady)) {
- init();
- }
- int traceFD = sTraceFD;
- if (CC_UNLIKELY(tagEnabled(tag) && traceFD != -1)) {
- char buf[1024];
- snprintf(buf, 1024, "C|%d|%s|%d", getpid(), name, value);
- write(traceFD, buf, strlen(buf));
- }
- }
-
- static inline void traceBegin(uint64_t tag, const char* name) {
- if (CC_UNLIKELY(!android_atomic_acquire_load(&sIsReady))) {
- init();
- }
- int traceFD = sTraceFD;
- if (CC_UNLIKELY(tagEnabled(tag) && (traceFD != -1))) {
- char buf[1024];
- size_t len = snprintf(buf, 1024, "B|%d|%s", getpid(), name);
- write(traceFD, buf, len);
- }
- }
-
- static inline void traceEnd(uint64_t tag) {
- if (CC_UNLIKELY(!android_atomic_acquire_load(&sIsReady))) {
- init();
- }
- int traceFD = sTraceFD;
- if (CC_UNLIKELY(tagEnabled(tag) && (traceFD != -1))) {
- char buf = 'E';
- write(traceFD, &buf, 1);
- }
- }
-
-private:
-
- static inline bool tagEnabled(uint64_t tag) {
- return !(tag & ATRACE_TAG_INVALID) && (tag & sEnabledTags);
- }
-
- // init opens the trace marker file for writing and reads the
- // atrace.tags.enableflags system property. It does this only the first
- // time it is run, using sMutex for synchronization.
- static void init();
-
- // sIsReady is a boolean value indicating whether a call to init() has
- // completed in this process. It is initialized to 0 and set to 1 when the
- // first init() call completes. It is set to 1 even if a failure occurred
- // in init (e.g. the trace marker file couldn't be opened).
- //
- // This should be checked by all tracing functions using an atomic acquire
- // load operation before calling init(). This check avoids the need to lock
- // a mutex each time a trace function gets called.
- static volatile int32_t sIsReady;
-
- // sTraceFD is the file descriptor used to write to the kernel's trace
- // buffer. It is initialized to -1 and set to an open file descriptor in
- // init() while a lock on sMutex is held.
- //
- // This should only be used by a trace function after init() has
- // successfully completed.
- static int sTraceFD;
-
- // sEnabledTags is the set of tag bits for which tracing is currently
- // enabled. It is initialized to 0 and set based on the
- // atrace.tags.enableflags system property in init() while a lock on sMutex
- // is held.
- //
- // This should only be used by a trace function after init() has
- // successfully completed.
- static uint64_t sEnabledTags;
-
- // sMutex is used to protect the execution of init().
- static Mutex sMutex;
-};
-
-class ScopedTrace {
-
-public:
- inline ScopedTrace(uint64_t tag, const char* name) :
- mTag(tag) {
- Tracer::traceBegin(mTag, name);
- }
-
- inline ~ScopedTrace() {
- Tracer::traceEnd(mTag);
- }
-
-private:
-
- uint64_t mTag;
-};
-
-}; // namespace android
-
-#endif // ANDROID_TRACE_H
diff --git a/include/utils/TypeHelpers.h b/include/utils/TypeHelpers.h
deleted file mode 100644
index 1f2c2d5..0000000
--- a/include/utils/TypeHelpers.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_TYPE_HELPERS_H
-#define ANDROID_TYPE_HELPERS_H
-
-#include <new>
-#include <stdint.h>
-#include <string.h>
-#include <sys/types.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-/*
- * Types traits
- */
-
-template <typename T> struct trait_trivial_ctor { enum { value = false }; };
-template <typename T> struct trait_trivial_dtor { enum { value = false }; };
-template <typename T> struct trait_trivial_copy { enum { value = false }; };
-template <typename T> struct trait_trivial_move { enum { value = false }; };
-template <typename T> struct trait_pointer { enum { value = false }; };
-template <typename T> struct trait_pointer<T*> { enum { value = true }; };
-
-template <typename TYPE>
-struct traits {
- enum {
- // whether this type is a pointer
- is_pointer = trait_pointer<TYPE>::value,
- // whether this type's constructor is a no-op
- has_trivial_ctor = is_pointer || trait_trivial_ctor<TYPE>::value,
- // whether this type's destructor is a no-op
- has_trivial_dtor = is_pointer || trait_trivial_dtor<TYPE>::value,
- // whether this type type can be copy-constructed with memcpy
- has_trivial_copy = is_pointer || trait_trivial_copy<TYPE>::value,
- // whether this type can be moved with memmove
- has_trivial_move = is_pointer || trait_trivial_move<TYPE>::value
- };
-};
-
-template <typename T, typename U>
-struct aggregate_traits {
- enum {
- is_pointer = false,
- has_trivial_ctor =
- traits<T>::has_trivial_ctor && traits<U>::has_trivial_ctor,
- has_trivial_dtor =
- traits<T>::has_trivial_dtor && traits<U>::has_trivial_dtor,
- has_trivial_copy =
- traits<T>::has_trivial_copy && traits<U>::has_trivial_copy,
- has_trivial_move =
- traits<T>::has_trivial_move && traits<U>::has_trivial_move
- };
-};
-
-#define ANDROID_BASIC_TYPES_TRAITS( T ) \
- template<> struct trait_trivial_ctor< T > { enum { value = true }; }; \
- template<> struct trait_trivial_dtor< T > { enum { value = true }; }; \
- template<> struct trait_trivial_copy< T > { enum { value = true }; }; \
- template<> struct trait_trivial_move< T > { enum { value = true }; };
-
-// ---------------------------------------------------------------------------
-
-/*
- * basic types traits
- */
-
-ANDROID_BASIC_TYPES_TRAITS( void )
-ANDROID_BASIC_TYPES_TRAITS( bool )
-ANDROID_BASIC_TYPES_TRAITS( char )
-ANDROID_BASIC_TYPES_TRAITS( unsigned char )
-ANDROID_BASIC_TYPES_TRAITS( short )
-ANDROID_BASIC_TYPES_TRAITS( unsigned short )
-ANDROID_BASIC_TYPES_TRAITS( int )
-ANDROID_BASIC_TYPES_TRAITS( unsigned int )
-ANDROID_BASIC_TYPES_TRAITS( long )
-ANDROID_BASIC_TYPES_TRAITS( unsigned long )
-ANDROID_BASIC_TYPES_TRAITS( long long )
-ANDROID_BASIC_TYPES_TRAITS( unsigned long long )
-ANDROID_BASIC_TYPES_TRAITS( float )
-ANDROID_BASIC_TYPES_TRAITS( double )
-
-// ---------------------------------------------------------------------------
-
-
-/*
- * compare and order types
- */
-
-template<typename TYPE> inline
-int strictly_order_type(const TYPE& lhs, const TYPE& rhs) {
- return (lhs < rhs) ? 1 : 0;
-}
-
-template<typename TYPE> inline
-int compare_type(const TYPE& lhs, const TYPE& rhs) {
- return strictly_order_type(rhs, lhs) - strictly_order_type(lhs, rhs);
-}
-
-/*
- * create, destroy, copy and move types...
- */
-
-template<typename TYPE> inline
-void construct_type(TYPE* p, size_t n) {
- if (!traits<TYPE>::has_trivial_ctor) {
- while (n--) {
- new(p++) TYPE;
- }
- }
-}
-
-template<typename TYPE> inline
-void destroy_type(TYPE* p, size_t n) {
- if (!traits<TYPE>::has_trivial_dtor) {
- while (n--) {
- p->~TYPE();
- p++;
- }
- }
-}
-
-template<typename TYPE> inline
-void copy_type(TYPE* d, const TYPE* s, size_t n) {
- if (!traits<TYPE>::has_trivial_copy) {
- while (n--) {
- new(d) TYPE(*s);
- d++, s++;
- }
- } else {
- memcpy(d,s,n*sizeof(TYPE));
- }
-}
-
-template<typename TYPE> inline
-void splat_type(TYPE* where, const TYPE* what, size_t n) {
- if (!traits<TYPE>::has_trivial_copy) {
- while (n--) {
- new(where) TYPE(*what);
- where++;
- }
- } else {
- while (n--) {
- *where++ = *what;
- }
- }
-}
-
-template<typename TYPE> inline
-void move_forward_type(TYPE* d, const TYPE* s, size_t n = 1) {
- if ((traits<TYPE>::has_trivial_dtor && traits<TYPE>::has_trivial_copy)
- || traits<TYPE>::has_trivial_move)
- {
- memmove(d,s,n*sizeof(TYPE));
- } else {
- d += n;
- s += n;
- while (n--) {
- --d, --s;
- if (!traits<TYPE>::has_trivial_copy) {
- new(d) TYPE(*s);
- } else {
- *d = *s;
- }
- if (!traits<TYPE>::has_trivial_dtor) {
- s->~TYPE();
- }
- }
- }
-}
-
-template<typename TYPE> inline
-void move_backward_type(TYPE* d, const TYPE* s, size_t n = 1) {
- if ((traits<TYPE>::has_trivial_dtor && traits<TYPE>::has_trivial_copy)
- || traits<TYPE>::has_trivial_move)
- {
- memmove(d,s,n*sizeof(TYPE));
- } else {
- while (n--) {
- if (!traits<TYPE>::has_trivial_copy) {
- new(d) TYPE(*s);
- } else {
- *d = *s;
- }
- if (!traits<TYPE>::has_trivial_dtor) {
- s->~TYPE();
- }
- d++, s++;
- }
- }
-}
-
-// ---------------------------------------------------------------------------
-
-/*
- * a key/value pair
- */
-
-template <typename KEY, typename VALUE>
-struct key_value_pair_t {
- typedef KEY key_t;
- typedef VALUE value_t;
-
- KEY key;
- VALUE value;
- key_value_pair_t() { }
- key_value_pair_t(const key_value_pair_t& o) : key(o.key), value(o.value) { }
- key_value_pair_t(const KEY& k, const VALUE& v) : key(k), value(v) { }
- key_value_pair_t(const KEY& k) : key(k) { }
- inline bool operator < (const key_value_pair_t& o) const {
- return strictly_order_type(key, o.key);
- }
- inline const KEY& getKey() const {
- return key;
- }
- inline const VALUE& getValue() const {
- return value;
- }
-};
-
-template <typename K, typename V>
-struct trait_trivial_ctor< key_value_pair_t<K, V> >
-{ enum { value = aggregate_traits<K,V>::has_trivial_ctor }; };
-template <typename K, typename V>
-struct trait_trivial_dtor< key_value_pair_t<K, V> >
-{ enum { value = aggregate_traits<K,V>::has_trivial_dtor }; };
-template <typename K, typename V>
-struct trait_trivial_copy< key_value_pair_t<K, V> >
-{ enum { value = aggregate_traits<K,V>::has_trivial_copy }; };
-template <typename K, typename V>
-struct trait_trivial_move< key_value_pair_t<K, V> >
-{ enum { value = aggregate_traits<K,V>::has_trivial_move }; };
-
-// ---------------------------------------------------------------------------
-
-/*
- * Hash codes.
- */
-typedef uint32_t hash_t;
-
-template <typename TKey>
-hash_t hash_type(const TKey& key);
-
-/* Built-in hash code specializations.
- * Assumes pointers are 32bit. */
-#define ANDROID_INT32_HASH(T) \
- template <> inline hash_t hash_type(const T& value) { return hash_t(value); }
-#define ANDROID_INT64_HASH(T) \
- template <> inline hash_t hash_type(const T& value) { \
- return hash_t((value >> 32) ^ value); }
-#define ANDROID_REINTERPRET_HASH(T, R) \
- template <> inline hash_t hash_type(const T& value) { \
- return hash_type(*reinterpret_cast<const R*>(&value)); }
-
-ANDROID_INT32_HASH(bool)
-ANDROID_INT32_HASH(int8_t)
-ANDROID_INT32_HASH(uint8_t)
-ANDROID_INT32_HASH(int16_t)
-ANDROID_INT32_HASH(uint16_t)
-ANDROID_INT32_HASH(int32_t)
-ANDROID_INT32_HASH(uint32_t)
-ANDROID_INT64_HASH(int64_t)
-ANDROID_INT64_HASH(uint64_t)
-ANDROID_REINTERPRET_HASH(float, uint32_t)
-ANDROID_REINTERPRET_HASH(double, uint64_t)
-
-template <typename T> inline hash_t hash_type(const T*& value) {
- return hash_type(uintptr_t(value));
-}
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_TYPE_HELPERS_H
diff --git a/include/utils/Unicode.h b/include/utils/Unicode.h
deleted file mode 100644
index 9273533..0000000
--- a/include/utils/Unicode.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_UNICODE_H
-#define ANDROID_UNICODE_H
-
-#include <sys/types.h>
-#include <stdint.h>
-
-extern "C" {
-
-typedef uint32_t char32_t;
-typedef uint16_t char16_t;
-
-// Standard string functions on char16_t strings.
-int strcmp16(const char16_t *, const char16_t *);
-int strncmp16(const char16_t *s1, const char16_t *s2, size_t n);
-size_t strlen16(const char16_t *);
-size_t strnlen16(const char16_t *, size_t);
-char16_t *strcpy16(char16_t *, const char16_t *);
-char16_t *strncpy16(char16_t *, const char16_t *, size_t);
-
-// Version of comparison that supports embedded nulls.
-// This is different than strncmp() because we don't stop
-// at a nul character and consider the strings to be different
-// if the lengths are different (thus we need to supply the
-// lengths of both strings). This can also be used when
-// your string is not nul-terminated as it will have the
-// equivalent result as strcmp16 (unlike strncmp16).
-int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2);
-
-// Version of strzcmp16 for comparing strings in different endianness.
-int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2);
-
-// Standard string functions on char32_t strings.
-size_t strlen32(const char32_t *);
-size_t strnlen32(const char32_t *, size_t);
-
-/**
- * Measure the length of a UTF-32 string in UTF-8. If the string is invalid
- * such as containing a surrogate character, -1 will be returned.
- */
-ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len);
-
-/**
- * Stores a UTF-8 string converted from "src" in "dst", if "dst_length" is not
- * large enough to store the string, the part of the "src" string is stored
- * into "dst" as much as possible. See the examples for more detail.
- * Returns the size actually used for storing the string.
- * dst" is not null-terminated when dst_len is fully used (like strncpy).
- *
- * Example 1
- * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84)
- * "src_len" == 2
- * "dst_len" >= 7
- * ->
- * Returned value == 6
- * "dst" becomes \xE3\x81\x82\xE3\x81\x84\0
- * (note that "dst" is null-terminated)
- *
- * Example 2
- * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84)
- * "src_len" == 2
- * "dst_len" == 5
- * ->
- * Returned value == 3
- * "dst" becomes \xE3\x81\x82\0
- * (note that "dst" is null-terminated, but \u3044 is not stored in "dst"
- * since "dst" does not have enough size to store the character)
- *
- * Example 3
- * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84)
- * "src_len" == 2
- * "dst_len" == 6
- * ->
- * Returned value == 6
- * "dst" becomes \xE3\x81\x82\xE3\x81\x84
- * (note that "dst" is NOT null-terminated, like strncpy)
- */
-void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst);
-
-/**
- * Returns the unicode value at "index".
- * Returns -1 when the index is invalid (equals to or more than "src_len").
- * If returned value is positive, it is able to be converted to char32_t, which
- * is unsigned. Then, if "next_index" is not NULL, the next index to be used is
- * stored in "next_index". "next_index" can be NULL.
- */
-int32_t utf32_from_utf8_at(const char *src, size_t src_len, size_t index, size_t *next_index);
-
-
-/**
- * Returns the UTF-8 length of UTF-16 string "src".
- */
-ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len);
-
-/**
- * Converts a UTF-16 string to UTF-8. The destination buffer must be large
- * enough to fit the UTF-16 as measured by utf16_to_utf8_length with an added
- * NULL terminator.
- */
-void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst);
-
-/**
- * Returns the length of "src" when "src" is valid UTF-8 string.
- * Returns 0 if src is NULL or 0-length string. Returns -1 when the source
- * is an invalid string.
- *
- * This function should be used to determine whether "src" is valid UTF-8
- * characters with valid unicode codepoints. "src" must be null-terminated.
- *
- * If you are going to use other utf8_to_... functions defined in this header
- * with string which may not be valid UTF-8 with valid codepoint (form 0 to
- * 0x10FFFF), you should use this function before calling others, since the
- * other functions do not check whether the string is valid UTF-8 or not.
- *
- * If you do not care whether "src" is valid UTF-8 or not, you should use
- * strlen() as usual, which should be much faster.
- */
-ssize_t utf8_length(const char *src);
-
-/**
- * Measure the length of a UTF-32 string.
- */
-size_t utf8_to_utf32_length(const char *src, size_t src_len);
-
-/**
- * Stores a UTF-32 string converted from "src" in "dst". "dst" must be large
- * enough to store the entire converted string as measured by
- * utf8_to_utf32_length plus space for a NULL terminator.
- */
-void utf8_to_utf32(const char* src, size_t src_len, char32_t* dst);
-
-/**
- * Returns the UTF-16 length of UTF-8 string "src".
- */
-ssize_t utf8_to_utf16_length(const uint8_t* src, size_t srcLen);
-
-/**
- * Convert UTF-8 to UTF-16 including surrogate pairs.
- * Returns a pointer to the end of the string (where a null terminator might go
- * if you wanted to add one).
- */
-char16_t* utf8_to_utf16_no_null_terminator(const uint8_t* src, size_t srcLen, char16_t* dst);
-
-/**
- * Convert UTF-8 to UTF-16 including surrogate pairs. The destination buffer
- * must be large enough to hold the result as measured by utf8_to_utf16_length
- * plus an added NULL terminator.
- */
-void utf8_to_utf16(const uint8_t* src, size_t srcLen, char16_t* dst);
-
-}
-
-#endif
diff --git a/include/utils/Vector.h b/include/utils/Vector.h
deleted file mode 100644
index 5b5296b..0000000
--- a/include/utils/Vector.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_VECTOR_H
-#define ANDROID_VECTOR_H
-
-#include <new>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Log.h>
-#include <utils/VectorImpl.h>
-#include <utils/TypeHelpers.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-template <typename TYPE>
-class SortedVector;
-
-/*!
- * The main templated vector class ensuring type safety
- * while making use of VectorImpl.
- * This is the class users want to use.
- */
-
-template <class TYPE>
-class Vector : private VectorImpl
-{
-public:
- typedef TYPE value_type;
-
- /*!
- * Constructors and destructors
- */
-
- Vector();
- Vector(const Vector<TYPE>& rhs);
- explicit Vector(const SortedVector<TYPE>& rhs);
- virtual ~Vector();
-
- /*! copy operator */
- const Vector<TYPE>& operator = (const Vector<TYPE>& rhs) const;
- Vector<TYPE>& operator = (const Vector<TYPE>& rhs);
-
- const Vector<TYPE>& operator = (const SortedVector<TYPE>& rhs) const;
- Vector<TYPE>& operator = (const SortedVector<TYPE>& rhs);
-
- /*
- * empty the vector
- */
-
- inline void clear() { VectorImpl::clear(); }
-
- /*!
- * vector stats
- */
-
- //! returns number of items in the vector
- inline size_t size() const { return VectorImpl::size(); }
- //! returns wether or not the vector is empty
- inline bool isEmpty() const { return VectorImpl::isEmpty(); }
- //! returns how many items can be stored without reallocating the backing store
- inline size_t capacity() const { return VectorImpl::capacity(); }
- //! setst the capacity. capacity can never be reduced less than size()
- inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); }
-
- /*!
- * C-style array access
- */
-
- //! read-only C-style access
- inline const TYPE* array() const;
- //! read-write C-style access
- TYPE* editArray();
-
- /*!
- * accessors
- */
-
- //! read-only access to an item at a given index
- inline const TYPE& operator [] (size_t index) const;
- //! alternate name for operator []
- inline const TYPE& itemAt(size_t index) const;
- //! stack-usage of the vector. returns the top of the stack (last element)
- const TYPE& top() const;
- //! same as operator [], but allows to access the vector backward (from the end) with a negative index
- const TYPE& mirrorItemAt(ssize_t index) const;
-
- /*!
- * modifing the array
- */
-
- //! copy-on write support, grants write access to an item
- TYPE& editItemAt(size_t index);
- //! grants right acces to the top of the stack (last element)
- TYPE& editTop();
-
- /*!
- * append/insert another vector
- */
-
- //! insert another vector at a given index
- ssize_t insertVectorAt(const Vector<TYPE>& vector, size_t index);
-
- //! append another vector at the end of this one
- ssize_t appendVector(const Vector<TYPE>& vector);
-
-
- //! insert an array at a given index
- ssize_t insertArrayAt(const TYPE* array, size_t index, size_t length);
-
- //! append an array at the end of this vector
- ssize_t appendArray(const TYPE* array, size_t length);
-
- /*!
- * add/insert/replace items
- */
-
- //! insert one or several items initialized with their default constructor
- inline ssize_t insertAt(size_t index, size_t numItems = 1);
- //! insert one or several items initialized from a prototype item
- ssize_t insertAt(const TYPE& prototype_item, size_t index, size_t numItems = 1);
- //! pop the top of the stack (removes the last element). No-op if the stack's empty
- inline void pop();
- //! pushes an item initialized with its default constructor
- inline void push();
- //! pushes an item on the top of the stack
- void push(const TYPE& item);
- //! same as push() but returns the index the item was added at (or an error)
- inline ssize_t add();
- //! same as push() but returns the index the item was added at (or an error)
- ssize_t add(const TYPE& item);
- //! replace an item with a new one initialized with its default constructor
- inline ssize_t replaceAt(size_t index);
- //! replace an item with a new one
- ssize_t replaceAt(const TYPE& item, size_t index);
-
- /*!
- * remove items
- */
-
- //! remove several items
- inline ssize_t removeItemsAt(size_t index, size_t count = 1);
- //! remove one item
- inline ssize_t removeAt(size_t index) { return removeItemsAt(index); }
-
- /*!
- * sort (stable) the array
- */
-
- typedef int (*compar_t)(const TYPE* lhs, const TYPE* rhs);
- typedef int (*compar_r_t)(const TYPE* lhs, const TYPE* rhs, void* state);
-
- inline status_t sort(compar_t cmp);
- inline status_t sort(compar_r_t cmp, void* state);
-
- // for debugging only
- inline size_t getItemSize() const { return itemSize(); }
-
-
- /*
- * these inlines add some level of compatibility with STL. eventually
- * we should probably turn things around.
- */
- typedef TYPE* iterator;
- typedef TYPE const* const_iterator;
-
- inline iterator begin() { return editArray(); }
- inline iterator end() { return editArray() + size(); }
- inline const_iterator begin() const { return array(); }
- inline const_iterator end() const { return array() + size(); }
- inline void reserve(size_t n) { setCapacity(n); }
- inline bool empty() const{ return isEmpty(); }
- inline void push_back(const TYPE& item) { insertAt(item, size(), 1); }
- inline void push_front(const TYPE& item) { insertAt(item, 0, 1); }
- inline iterator erase(iterator pos) {
- return begin() + removeItemsAt(pos-array());
- }
-
-protected:
- virtual void do_construct(void* storage, size_t num) const;
- virtual void do_destroy(void* storage, size_t num) const;
- virtual void do_copy(void* dest, const void* from, size_t num) const;
- virtual void do_splat(void* dest, const void* item, size_t num) const;
- virtual void do_move_forward(void* dest, const void* from, size_t num) const;
- virtual void do_move_backward(void* dest, const void* from, size_t num) const;
-};
-
-
-// ---------------------------------------------------------------------------
-// No user serviceable parts from here...
-// ---------------------------------------------------------------------------
-
-template<class TYPE> inline
-Vector<TYPE>::Vector()
- : VectorImpl(sizeof(TYPE),
- ((traits<TYPE>::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0)
- |(traits<TYPE>::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0)
- |(traits<TYPE>::has_trivial_copy ? HAS_TRIVIAL_COPY : 0))
- )
-{
-}
-
-template<class TYPE> inline
-Vector<TYPE>::Vector(const Vector<TYPE>& rhs)
- : VectorImpl(rhs) {
-}
-
-template<class TYPE> inline
-Vector<TYPE>::Vector(const SortedVector<TYPE>& rhs)
- : VectorImpl(static_cast<const VectorImpl&>(rhs)) {
-}
-
-template<class TYPE> inline
-Vector<TYPE>::~Vector() {
- finish_vector();
-}
-
-template<class TYPE> inline
-Vector<TYPE>& Vector<TYPE>::operator = (const Vector<TYPE>& rhs) {
- VectorImpl::operator = (rhs);
- return *this;
-}
-
-template<class TYPE> inline
-const Vector<TYPE>& Vector<TYPE>::operator = (const Vector<TYPE>& rhs) const {
- VectorImpl::operator = (static_cast<const VectorImpl&>(rhs));
- return *this;
-}
-
-template<class TYPE> inline
-Vector<TYPE>& Vector<TYPE>::operator = (const SortedVector<TYPE>& rhs) {
- VectorImpl::operator = (static_cast<const VectorImpl&>(rhs));
- return *this;
-}
-
-template<class TYPE> inline
-const Vector<TYPE>& Vector<TYPE>::operator = (const SortedVector<TYPE>& rhs) const {
- VectorImpl::operator = (rhs);
- return *this;
-}
-
-template<class TYPE> inline
-const TYPE* Vector<TYPE>::array() const {
- return static_cast<const TYPE *>(arrayImpl());
-}
-
-template<class TYPE> inline
-TYPE* Vector<TYPE>::editArray() {
- return static_cast<TYPE *>(editArrayImpl());
-}
-
-
-template<class TYPE> inline
-const TYPE& Vector<TYPE>::operator[](size_t index) const {
- LOG_FATAL_IF( index>=size(),
- "itemAt: index %d is past size %d", (int)index, (int)size() );
- return *(array() + index);
-}
-
-template<class TYPE> inline
-const TYPE& Vector<TYPE>::itemAt(size_t index) const {
- return operator[](index);
-}
-
-template<class TYPE> inline
-const TYPE& Vector<TYPE>::mirrorItemAt(ssize_t index) const {
- LOG_FATAL_IF( (index>0 ? index : -index)>=size(),
- "mirrorItemAt: index %d is past size %d",
- (int)index, (int)size() );
- return *(array() + ((index<0) ? (size()-index) : index));
-}
-
-template<class TYPE> inline
-const TYPE& Vector<TYPE>::top() const {
- return *(array() + size() - 1);
-}
-
-template<class TYPE> inline
-TYPE& Vector<TYPE>::editItemAt(size_t index) {
- return *( static_cast<TYPE *>(editItemLocation(index)) );
-}
-
-template<class TYPE> inline
-TYPE& Vector<TYPE>::editTop() {
- return *( static_cast<TYPE *>(editItemLocation(size()-1)) );
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::insertVectorAt(const Vector<TYPE>& vector, size_t index) {
- return VectorImpl::insertVectorAt(reinterpret_cast<const VectorImpl&>(vector), index);
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::appendVector(const Vector<TYPE>& vector) {
- return VectorImpl::appendVector(reinterpret_cast<const VectorImpl&>(vector));
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::insertArrayAt(const TYPE* array, size_t index, size_t length) {
- return VectorImpl::insertArrayAt(array, index, length);
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::appendArray(const TYPE* array, size_t length) {
- return VectorImpl::appendArray(array, length);
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::insertAt(const TYPE& item, size_t index, size_t numItems) {
- return VectorImpl::insertAt(&item, index, numItems);
-}
-
-template<class TYPE> inline
-void Vector<TYPE>::push(const TYPE& item) {
- return VectorImpl::push(&item);
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::add(const TYPE& item) {
- return VectorImpl::add(&item);
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::replaceAt(const TYPE& item, size_t index) {
- return VectorImpl::replaceAt(&item, index);
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::insertAt(size_t index, size_t numItems) {
- return VectorImpl::insertAt(index, numItems);
-}
-
-template<class TYPE> inline
-void Vector<TYPE>::pop() {
- VectorImpl::pop();
-}
-
-template<class TYPE> inline
-void Vector<TYPE>::push() {
- VectorImpl::push();
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::add() {
- return VectorImpl::add();
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::replaceAt(size_t index) {
- return VectorImpl::replaceAt(index);
-}
-
-template<class TYPE> inline
-ssize_t Vector<TYPE>::removeItemsAt(size_t index, size_t count) {
- return VectorImpl::removeItemsAt(index, count);
-}
-
-template<class TYPE> inline
-status_t Vector<TYPE>::sort(Vector<TYPE>::compar_t cmp) {
- return VectorImpl::sort((VectorImpl::compar_t)cmp);
-}
-
-template<class TYPE> inline
-status_t Vector<TYPE>::sort(Vector<TYPE>::compar_r_t cmp, void* state) {
- return VectorImpl::sort((VectorImpl::compar_r_t)cmp, state);
-}
-
-// ---------------------------------------------------------------------------
-
-template<class TYPE>
-void Vector<TYPE>::do_construct(void* storage, size_t num) const {
- construct_type( reinterpret_cast<TYPE*>(storage), num );
-}
-
-template<class TYPE>
-void Vector<TYPE>::do_destroy(void* storage, size_t num) const {
- destroy_type( reinterpret_cast<TYPE*>(storage), num );
-}
-
-template<class TYPE>
-void Vector<TYPE>::do_copy(void* dest, const void* from, size_t num) const {
- copy_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(from), num );
-}
-
-template<class TYPE>
-void Vector<TYPE>::do_splat(void* dest, const void* item, size_t num) const {
- splat_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(item), num );
-}
-
-template<class TYPE>
-void Vector<TYPE>::do_move_forward(void* dest, const void* from, size_t num) const {
- move_forward_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(from), num );
-}
-
-template<class TYPE>
-void Vector<TYPE>::do_move_backward(void* dest, const void* from, size_t num) const {
- move_backward_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(from), num );
-}
-
-}; // namespace android
-
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_VECTOR_H
diff --git a/include/utils/VectorImpl.h b/include/utils/VectorImpl.h
deleted file mode 100644
index c4ec2ff..0000000
--- a/include/utils/VectorImpl.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#ifndef ANDROID_VECTOR_IMPL_H
-#define ANDROID_VECTOR_IMPL_H
-
-#include <assert.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <utils/Errors.h>
-
-// ---------------------------------------------------------------------------
-// No user serviceable parts in here...
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-/*!
- * Implementation of the guts of the vector<> class
- * this ensures backward binary compatibility and
- * reduces code size.
- * For performance reasons, we expose mStorage and mCount
- * so these fields are set in stone.
- *
- */
-
-class VectorImpl
-{
-public:
- enum { // flags passed to the ctor
- HAS_TRIVIAL_CTOR = 0x00000001,
- HAS_TRIVIAL_DTOR = 0x00000002,
- HAS_TRIVIAL_COPY = 0x00000004,
- };
-
- VectorImpl(size_t itemSize, uint32_t flags);
- VectorImpl(const VectorImpl& rhs);
- virtual ~VectorImpl();
-
- /*! must be called from subclasses destructor */
- void finish_vector();
-
- VectorImpl& operator = (const VectorImpl& rhs);
-
- /*! C-style array access */
- inline const void* arrayImpl() const { return mStorage; }
- void* editArrayImpl();
-
- /*! vector stats */
- inline size_t size() const { return mCount; }
- inline bool isEmpty() const { return mCount == 0; }
- size_t capacity() const;
- ssize_t setCapacity(size_t size);
-
- /*! append/insert another vector or array */
- ssize_t insertVectorAt(const VectorImpl& vector, size_t index);
- ssize_t appendVector(const VectorImpl& vector);
- ssize_t insertArrayAt(const void* array, size_t index, size_t length);
- ssize_t appendArray(const void* array, size_t length);
-
- /*! add/insert/replace items */
- ssize_t insertAt(size_t where, size_t numItems = 1);
- ssize_t insertAt(const void* item, size_t where, size_t numItems = 1);
- void pop();
- void push();
- void push(const void* item);
- ssize_t add();
- ssize_t add(const void* item);
- ssize_t replaceAt(size_t index);
- ssize_t replaceAt(const void* item, size_t index);
-
- /*! remove items */
- ssize_t removeItemsAt(size_t index, size_t count = 1);
- void clear();
-
- const void* itemLocation(size_t index) const;
- void* editItemLocation(size_t index);
-
- typedef int (*compar_t)(const void* lhs, const void* rhs);
- typedef int (*compar_r_t)(const void* lhs, const void* rhs, void* state);
- status_t sort(compar_t cmp);
- status_t sort(compar_r_t cmp, void* state);
-
-protected:
- size_t itemSize() const;
- void release_storage();
-
- virtual void do_construct(void* storage, size_t num) const = 0;
- virtual void do_destroy(void* storage, size_t num) const = 0;
- virtual void do_copy(void* dest, const void* from, size_t num) const = 0;
- virtual void do_splat(void* dest, const void* item, size_t num) const = 0;
- virtual void do_move_forward(void* dest, const void* from, size_t num) const = 0;
- virtual void do_move_backward(void* dest, const void* from, size_t num) const = 0;
-
- // take care of FBC...
- virtual void reservedVectorImpl1();
- virtual void reservedVectorImpl2();
- virtual void reservedVectorImpl3();
- virtual void reservedVectorImpl4();
- virtual void reservedVectorImpl5();
- virtual void reservedVectorImpl6();
- virtual void reservedVectorImpl7();
- virtual void reservedVectorImpl8();
-
-private:
- void* _grow(size_t where, size_t amount);
- void _shrink(size_t where, size_t amount);
-
- inline void _do_construct(void* storage, size_t num) const;
- inline void _do_destroy(void* storage, size_t num) const;
- inline void _do_copy(void* dest, const void* from, size_t num) const;
- inline void _do_splat(void* dest, const void* item, size_t num) const;
- inline void _do_move_forward(void* dest, const void* from, size_t num) const;
- inline void _do_move_backward(void* dest, const void* from, size_t num) const;
-
- // These 2 fields are exposed in the inlines below,
- // so they're set in stone.
- void * mStorage; // base address of the vector
- size_t mCount; // number of items
-
- const uint32_t mFlags;
- const size_t mItemSize;
-};
-
-
-
-class SortedVectorImpl : public VectorImpl
-{
-public:
- SortedVectorImpl(size_t itemSize, uint32_t flags);
- SortedVectorImpl(const VectorImpl& rhs);
- virtual ~SortedVectorImpl();
-
- SortedVectorImpl& operator = (const SortedVectorImpl& rhs);
-
- //! finds the index of an item
- ssize_t indexOf(const void* item) const;
-
- //! finds where this item should be inserted
- size_t orderOf(const void* item) const;
-
- //! add an item in the right place (or replaces it if there is one)
- ssize_t add(const void* item);
-
- //! merges a vector into this one
- ssize_t merge(const VectorImpl& vector);
- ssize_t merge(const SortedVectorImpl& vector);
-
- //! removes an item
- ssize_t remove(const void* item);
-
-protected:
- virtual int do_compare(const void* lhs, const void* rhs) const = 0;
-
- // take care of FBC...
- virtual void reservedSortedVectorImpl1();
- virtual void reservedSortedVectorImpl2();
- virtual void reservedSortedVectorImpl3();
- virtual void reservedSortedVectorImpl4();
- virtual void reservedSortedVectorImpl5();
- virtual void reservedSortedVectorImpl6();
- virtual void reservedSortedVectorImpl7();
- virtual void reservedSortedVectorImpl8();
-
-private:
- ssize_t _indexOrderOf(const void* item, size_t* order = 0) const;
-
- // these are made private, because they can't be used on a SortedVector
- // (they don't have an implementation either)
- ssize_t add();
- void pop();
- void push();
- void push(const void* item);
- ssize_t insertVectorAt(const VectorImpl& vector, size_t index);
- ssize_t appendVector(const VectorImpl& vector);
- ssize_t insertArrayAt(const void* array, size_t index, size_t length);
- ssize_t appendArray(const void* array, size_t length);
- ssize_t insertAt(size_t where, size_t numItems = 1);
- ssize_t insertAt(const void* item, size_t where, size_t numItems = 1);
- ssize_t replaceAt(size_t index);
- ssize_t replaceAt(const void* item, size_t index);
-};
-
-}; // namespace android
-
-
-// ---------------------------------------------------------------------------
-
-#endif // ANDROID_VECTOR_IMPL_H
diff --git a/include/utils/ashmem.h b/include/utils/ashmem.h
deleted file mode 100644
index 0854775..0000000
--- a/include/utils/ashmem.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* utils/ashmem.h
- **
- ** Copyright 2008 The Android Open Source Project
- **
- ** This file is dual licensed. It may be redistributed and/or modified
- ** under the terms of the Apache 2.0 License OR version 2 of the GNU
- ** General Public License.
- */
-
-#ifndef _UTILS_ASHMEM_H
-#define _UTILS_ASHMEM_H
-
-#include <linux/limits.h>
-#include <linux/ioctl.h>
-
-#define ASHMEM_NAME_LEN 256
-
-#define ASHMEM_NAME_DEF "dev/ashmem"
-
-/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */
-#define ASHMEM_NOT_REAPED 0
-#define ASHMEM_WAS_REAPED 1
-
-/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */
-#define ASHMEM_NOW_UNPINNED 0
-#define ASHMEM_NOW_PINNED 1
-
-#define __ASHMEMIOC 0x77
-
-#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
-#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN])
-#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
-#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
-#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long)
-#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6)
-#define ASHMEM_PIN _IO(__ASHMEMIOC, 7)
-#define ASHMEM_UNPIN _IO(__ASHMEMIOC, 8)
-#define ASHMEM_ISPINNED _IO(__ASHMEMIOC, 9)
-#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10)
-
-#endif /* _UTILS_ASHMEM_H */
diff --git a/include/utils/misc.h b/include/utils/misc.h
deleted file mode 100644
index 23f2a4c..0000000
--- a/include/utils/misc.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-// Handy utility functions and portability code.
-//
-#ifndef _LIBS_UTILS_MISC_H
-#define _LIBS_UTILS_MISC_H
-
-#include <sys/time.h>
-#include <utils/Endian.h>
-
-namespace android {
-
-/* get #of elements in a static array */
-#ifndef NELEM
-# define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0])))
-#endif
-
-/*
- * Make a copy of the string, using "new[]" instead of "malloc". Free the
- * string with delete[].
- *
- * Returns NULL if "str" is NULL.
- */
-char* strdupNew(const char* str);
-
-/*
- * Concatenate an argument vector into a single string. If argc is >= 0
- * it will be used; if it's < 0 then the last element in the arg vector
- * must be NULL.
- *
- * This inserts a space between each argument.
- *
- * This does not automatically add double quotes around arguments with
- * spaces in them. This practice is necessary for Win32, because Win32's
- * CreateProcess call is stupid.
- *
- * The caller should delete[] the returned string.
- */
-char* concatArgv(int argc, const char* const argv[]);
-
-/*
- * Count up the number of arguments in "argv". The count does not include
- * the final NULL entry.
- */
-int countArgv(const char* const argv[]);
-
-/*
- * Some utility functions for working with files. These could be made
- * part of a "File" class.
- */
-typedef enum FileType {
- kFileTypeUnknown = 0,
- kFileTypeNonexistent, // i.e. ENOENT
- kFileTypeRegular,
- kFileTypeDirectory,
- kFileTypeCharDev,
- kFileTypeBlockDev,
- kFileTypeFifo,
- kFileTypeSymlink,
- kFileTypeSocket,
-} FileType;
-/* get the file's type; follows symlinks */
-FileType getFileType(const char* fileName);
-/* get the file's modification date; returns -1 w/errno set on failure */
-time_t getFileModDate(const char* fileName);
-
-/*
- * Round up to the nearest power of 2. Handy for hash tables.
- */
-unsigned int roundUpPower2(unsigned int val);
-
-void strreverse(char* begin, char* end);
-void k_itoa(int value, char* str, int base);
-char* itoa(int val, int base);
-
-}; // namespace android
-
-#endif // _LIBS_UTILS_MISC_H
diff --git a/include/utils/threads.h b/include/utils/threads.h
deleted file mode 100644
index 9de3382..0000000
--- a/include/utils/threads.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef _LIBS_UTILS_THREADS_H
-#define _LIBS_UTILS_THREADS_H
-
-/*
- * Please, DO NOT USE!
- *
- * This file is here only for legacy reasons. Instead, include directly
- * the headers you need below.
- *
- */
-
-#include <utils/AndroidThreads.h>
-
-#ifdef __cplusplus
-#include <utils/Condition.h>
-#include <utils/Errors.h>
-#include <utils/Mutex.h>
-#include <utils/RWLock.h>
-#include <utils/Thread.h>
-#endif
-
-#endif // _LIBS_UTILS_THREADS_H
diff --git a/libs/androidfw/tests/InputChannel_test.cpp b/libs/androidfw/tests/InputChannel_test.cpp
index 0e5d19d..7fff8af 100644
--- a/libs/androidfw/tests/InputChannel_test.cpp
+++ b/libs/androidfw/tests/InputChannel_test.cpp
@@ -23,7 +23,7 @@
#include <time.h>
#include <errno.h>
-#include "../../utils/tests/TestHelpers.h"
+#include "TestHelpers.h"
namespace android {
diff --git a/libs/androidfw/tests/InputPublisherAndConsumer_test.cpp b/libs/androidfw/tests/InputPublisherAndConsumer_test.cpp
index bb45247..442b62f 100644
--- a/libs/androidfw/tests/InputPublisherAndConsumer_test.cpp
+++ b/libs/androidfw/tests/InputPublisherAndConsumer_test.cpp
@@ -23,7 +23,7 @@
#include <sys/mman.h>
#include <cutils/ashmem.h>
-#include "../../utils/tests/TestHelpers.h"
+#include "TestHelpers.h"
namespace android {
diff --git a/libs/utils/tests/TestHelpers.h b/libs/androidfw/tests/TestHelpers.h
similarity index 100%
rename from libs/utils/tests/TestHelpers.h
rename to libs/androidfw/tests/TestHelpers.h
diff --git a/libs/binder/Android.mk b/libs/binder/Android.mk
deleted file mode 100644
index d449298..0000000
--- a/libs/binder/Android.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2009 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.
-
-# we have the common sources, plus some device-specific stuff
-sources := \
- Binder.cpp \
- BpBinder.cpp \
- IInterface.cpp \
- IMemory.cpp \
- IPCThreadState.cpp \
- IPermissionController.cpp \
- IServiceManager.cpp \
- MemoryDealer.cpp \
- MemoryBase.cpp \
- MemoryHeapBase.cpp \
- Parcel.cpp \
- PermissionCache.cpp \
- ProcessState.cpp \
- Static.cpp
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_LDLIBS += -lpthread
-LOCAL_MODULE := libbinder
-LOCAL_SHARED_LIBRARIES := liblog libcutils libutils
-LOCAL_SRC_FILES := $(sources)
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_LDLIBS += -lpthread
-LOCAL_MODULE := libbinder
-LOCAL_SRC_FILES := $(sources)
-include $(BUILD_STATIC_LIBRARY)
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp
deleted file mode 100644
index e20d8a3..0000000
--- a/libs/binder/Binder.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#include <binder/Binder.h>
-
-#include <utils/Atomic.h>
-#include <binder/BpBinder.h>
-#include <binder/IInterface.h>
-#include <binder/Parcel.h>
-
-#include <stdio.h>
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-IBinder::IBinder()
- : RefBase()
-{
-}
-
-IBinder::~IBinder()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-sp<IInterface> IBinder::queryLocalInterface(const String16& descriptor)
-{
- return NULL;
-}
-
-BBinder* IBinder::localBinder()
-{
- return NULL;
-}
-
-BpBinder* IBinder::remoteBinder()
-{
- return NULL;
-}
-
-bool IBinder::checkSubclass(const void* /*subclassID*/) const
-{
- return false;
-}
-
-// ---------------------------------------------------------------------------
-
-class BBinder::Extras
-{
-public:
- Mutex mLock;
- BpBinder::ObjectManager mObjects;
-};
-
-// ---------------------------------------------------------------------------
-
-BBinder::BBinder()
- : mExtras(NULL)
-{
-}
-
-bool BBinder::isBinderAlive() const
-{
- return true;
-}
-
-status_t BBinder::pingBinder()
-{
- return NO_ERROR;
-}
-
-const String16& BBinder::getInterfaceDescriptor() const
-{
- // This is a local static rather than a global static,
- // to avoid static initializer ordering issues.
- static String16 sEmptyDescriptor;
- ALOGW("reached BBinder::getInterfaceDescriptor (this=%p)", this);
- return sEmptyDescriptor;
-}
-
-status_t BBinder::transact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- data.setDataPosition(0);
-
- status_t err = NO_ERROR;
- switch (code) {
- case PING_TRANSACTION:
- reply->writeInt32(pingBinder());
- break;
- default:
- err = onTransact(code, data, reply, flags);
- break;
- }
-
- if (reply != NULL) {
- reply->setDataPosition(0);
- }
-
- return err;
-}
-
-status_t BBinder::linkToDeath(
- const sp<DeathRecipient>& recipient, void* cookie, uint32_t flags)
-{
- return INVALID_OPERATION;
-}
-
-status_t BBinder::unlinkToDeath(
- const wp<DeathRecipient>& recipient, void* cookie, uint32_t flags,
- wp<DeathRecipient>* outRecipient)
-{
- return INVALID_OPERATION;
-}
-
-status_t BBinder::dump(int fd, const Vector<String16>& args)
-{
- return NO_ERROR;
-}
-
-void BBinder::attachObject(
- const void* objectID, void* object, void* cleanupCookie,
- object_cleanup_func func)
-{
- Extras* e = mExtras;
-
- if (!e) {
- e = new Extras;
- if (android_atomic_cmpxchg(0, reinterpret_cast<int32_t>(e),
- reinterpret_cast<volatile int32_t*>(&mExtras)) != 0) {
- delete e;
- e = mExtras;
- }
- if (e == 0) return; // out of memory
- }
-
- AutoMutex _l(e->mLock);
- e->mObjects.attach(objectID, object, cleanupCookie, func);
-}
-
-void* BBinder::findObject(const void* objectID) const
-{
- Extras* e = mExtras;
- if (!e) return NULL;
-
- AutoMutex _l(e->mLock);
- return e->mObjects.find(objectID);
-}
-
-void BBinder::detachObject(const void* objectID)
-{
- Extras* e = mExtras;
- if (!e) return;
-
- AutoMutex _l(e->mLock);
- e->mObjects.detach(objectID);
-}
-
-BBinder* BBinder::localBinder()
-{
- return this;
-}
-
-BBinder::~BBinder()
-{
- if (mExtras) delete mExtras;
-}
-
-
-status_t BBinder::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch (code) {
- case INTERFACE_TRANSACTION:
- reply->writeString16(getInterfaceDescriptor());
- return NO_ERROR;
-
- case DUMP_TRANSACTION: {
- int fd = data.readFileDescriptor();
- int argc = data.readInt32();
- Vector<String16> args;
- for (int i = 0; i < argc && data.dataAvail() > 0; i++) {
- args.add(data.readString16());
- }
- return dump(fd, args);
- }
- default:
- return UNKNOWN_TRANSACTION;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-enum {
- // This is used to transfer ownership of the remote binder from
- // the BpRefBase object holding it (when it is constructed), to the
- // owner of the BpRefBase object when it first acquires that BpRefBase.
- kRemoteAcquired = 0x00000001
-};
-
-BpRefBase::BpRefBase(const sp<IBinder>& o)
- : mRemote(o.get()), mRefs(NULL), mState(0)
-{
- extendObjectLifetime(OBJECT_LIFETIME_WEAK);
-
- if (mRemote) {
- mRemote->incStrong(this); // Removed on first IncStrong().
- mRefs = mRemote->createWeak(this); // Held for our entire lifetime.
- }
-}
-
-BpRefBase::~BpRefBase()
-{
- if (mRemote) {
- if (!(mState&kRemoteAcquired)) {
- mRemote->decStrong(this);
- }
- mRefs->decWeak(this);
- }
-}
-
-void BpRefBase::onFirstRef()
-{
- android_atomic_or(kRemoteAcquired, &mState);
-}
-
-void BpRefBase::onLastStrongRef(const void* id)
-{
- if (mRemote) {
- mRemote->decStrong(this);
- }
-}
-
-bool BpRefBase::onIncStrongAttempted(uint32_t flags, const void* id)
-{
- return mRemote ? mRefs->attemptIncStrong(this) : false;
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp
deleted file mode 100644
index 47a62db..0000000
--- a/libs/binder/BpBinder.cpp
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#define LOG_TAG "BpBinder"
-//#define LOG_NDEBUG 0
-
-#include <binder/BpBinder.h>
-
-#include <binder/IPCThreadState.h>
-#include <utils/Log.h>
-
-#include <stdio.h>
-
-//#undef ALOGV
-//#define ALOGV(...) fprintf(stderr, __VA_ARGS__)
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-BpBinder::ObjectManager::ObjectManager()
-{
-}
-
-BpBinder::ObjectManager::~ObjectManager()
-{
- kill();
-}
-
-void BpBinder::ObjectManager::attach(
- const void* objectID, void* object, void* cleanupCookie,
- IBinder::object_cleanup_func func)
-{
- entry_t e;
- e.object = object;
- e.cleanupCookie = cleanupCookie;
- e.func = func;
-
- if (mObjects.indexOfKey(objectID) >= 0) {
- ALOGE("Trying to attach object ID %p to binder ObjectManager %p with object %p, but object ID already in use",
- objectID, this, object);
- return;
- }
-
- mObjects.add(objectID, e);
-}
-
-void* BpBinder::ObjectManager::find(const void* objectID) const
-{
- const ssize_t i = mObjects.indexOfKey(objectID);
- if (i < 0) return NULL;
- return mObjects.valueAt(i).object;
-}
-
-void BpBinder::ObjectManager::detach(const void* objectID)
-{
- mObjects.removeItem(objectID);
-}
-
-void BpBinder::ObjectManager::kill()
-{
- const size_t N = mObjects.size();
- ALOGV("Killing %d objects in manager %p", N, this);
- for (size_t i=0; i<N; i++) {
- const entry_t& e = mObjects.valueAt(i);
- if (e.func != NULL) {
- e.func(mObjects.keyAt(i), e.object, e.cleanupCookie);
- }
- }
-
- mObjects.clear();
-}
-
-// ---------------------------------------------------------------------------
-
-BpBinder::BpBinder(int32_t handle)
- : mHandle(handle)
- , mAlive(1)
- , mObitsSent(0)
- , mObituaries(NULL)
-{
- ALOGV("Creating BpBinder %p handle %d\n", this, mHandle);
-
- extendObjectLifetime(OBJECT_LIFETIME_WEAK);
- IPCThreadState::self()->incWeakHandle(handle);
-}
-
-bool BpBinder::isDescriptorCached() const {
- Mutex::Autolock _l(mLock);
- return mDescriptorCache.size() ? true : false;
-}
-
-const String16& BpBinder::getInterfaceDescriptor() const
-{
- if (isDescriptorCached() == false) {
- Parcel send, reply;
- // do the IPC without a lock held.
- status_t err = const_cast<BpBinder*>(this)->transact(
- INTERFACE_TRANSACTION, send, &reply);
- if (err == NO_ERROR) {
- String16 res(reply.readString16());
- Mutex::Autolock _l(mLock);
- // mDescriptorCache could have been assigned while the lock was
- // released.
- if (mDescriptorCache.size() == 0)
- mDescriptorCache = res;
- }
- }
-
- // we're returning a reference to a non-static object here. Usually this
- // is not something smart to do, however, with binder objects it is
- // (usually) safe because they are reference-counted.
-
- return mDescriptorCache;
-}
-
-bool BpBinder::isBinderAlive() const
-{
- return mAlive != 0;
-}
-
-status_t BpBinder::pingBinder()
-{
- Parcel send;
- Parcel reply;
- status_t err = transact(PING_TRANSACTION, send, &reply);
- if (err != NO_ERROR) return err;
- if (reply.dataSize() < sizeof(status_t)) return NOT_ENOUGH_DATA;
- return (status_t)reply.readInt32();
-}
-
-status_t BpBinder::dump(int fd, const Vector<String16>& args)
-{
- Parcel send;
- Parcel reply;
- send.writeFileDescriptor(fd);
- const size_t numArgs = args.size();
- send.writeInt32(numArgs);
- for (size_t i = 0; i < numArgs; i++) {
- send.writeString16(args[i]);
- }
- status_t err = transact(DUMP_TRANSACTION, send, &reply);
- return err;
-}
-
-status_t BpBinder::transact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- // Once a binder has died, it will never come back to life.
- if (mAlive) {
- status_t status = IPCThreadState::self()->transact(
- mHandle, code, data, reply, flags);
- if (status == DEAD_OBJECT) mAlive = 0;
- return status;
- }
-
- return DEAD_OBJECT;
-}
-
-status_t BpBinder::linkToDeath(
- const sp<DeathRecipient>& recipient, void* cookie, uint32_t flags)
-{
- Obituary ob;
- ob.recipient = recipient;
- ob.cookie = cookie;
- ob.flags = flags;
-
- LOG_ALWAYS_FATAL_IF(recipient == NULL,
- "linkToDeath(): recipient must be non-NULL");
-
- {
- AutoMutex _l(mLock);
-
- if (!mObitsSent) {
- if (!mObituaries) {
- mObituaries = new Vector<Obituary>;
- if (!mObituaries) {
- return NO_MEMORY;
- }
- ALOGV("Requesting death notification: %p handle %d\n", this, mHandle);
- getWeakRefs()->incWeak(this);
- IPCThreadState* self = IPCThreadState::self();
- self->requestDeathNotification(mHandle, this);
- self->flushCommands();
- }
- ssize_t res = mObituaries->add(ob);
- return res >= (ssize_t)NO_ERROR ? (status_t)NO_ERROR : res;
- }
- }
-
- return DEAD_OBJECT;
-}
-
-status_t BpBinder::unlinkToDeath(
- const wp<DeathRecipient>& recipient, void* cookie, uint32_t flags,
- wp<DeathRecipient>* outRecipient)
-{
- AutoMutex _l(mLock);
-
- if (mObitsSent) {
- return DEAD_OBJECT;
- }
-
- const size_t N = mObituaries ? mObituaries->size() : 0;
- for (size_t i=0; i<N; i++) {
- const Obituary& obit = mObituaries->itemAt(i);
- if ((obit.recipient == recipient
- || (recipient == NULL && obit.cookie == cookie))
- && obit.flags == flags) {
- const uint32_t allFlags = obit.flags|flags;
- if (outRecipient != NULL) {
- *outRecipient = mObituaries->itemAt(i).recipient;
- }
- mObituaries->removeAt(i);
- if (mObituaries->size() == 0) {
- ALOGV("Clearing death notification: %p handle %d\n", this, mHandle);
- IPCThreadState* self = IPCThreadState::self();
- self->clearDeathNotification(mHandle, this);
- self->flushCommands();
- delete mObituaries;
- mObituaries = NULL;
- }
- return NO_ERROR;
- }
- }
-
- return NAME_NOT_FOUND;
-}
-
-void BpBinder::sendObituary()
-{
- ALOGV("Sending obituary for proxy %p handle %d, mObitsSent=%s\n",
- this, mHandle, mObitsSent ? "true" : "false");
-
- mAlive = 0;
- if (mObitsSent) return;
-
- mLock.lock();
- Vector<Obituary>* obits = mObituaries;
- if(obits != NULL) {
- ALOGV("Clearing sent death notification: %p handle %d\n", this, mHandle);
- IPCThreadState* self = IPCThreadState::self();
- self->clearDeathNotification(mHandle, this);
- self->flushCommands();
- mObituaries = NULL;
- }
- mObitsSent = 1;
- mLock.unlock();
-
- ALOGV("Reporting death of proxy %p for %d recipients\n",
- this, obits ? obits->size() : 0);
-
- if (obits != NULL) {
- const size_t N = obits->size();
- for (size_t i=0; i<N; i++) {
- reportOneDeath(obits->itemAt(i));
- }
-
- delete obits;
- }
-}
-
-void BpBinder::reportOneDeath(const Obituary& obit)
-{
- sp<DeathRecipient> recipient = obit.recipient.promote();
- ALOGV("Reporting death to recipient: %p\n", recipient.get());
- if (recipient == NULL) return;
-
- recipient->binderDied(this);
-}
-
-
-void BpBinder::attachObject(
- const void* objectID, void* object, void* cleanupCookie,
- object_cleanup_func func)
-{
- AutoMutex _l(mLock);
- ALOGV("Attaching object %p to binder %p (manager=%p)", object, this, &mObjects);
- mObjects.attach(objectID, object, cleanupCookie, func);
-}
-
-void* BpBinder::findObject(const void* objectID) const
-{
- AutoMutex _l(mLock);
- return mObjects.find(objectID);
-}
-
-void BpBinder::detachObject(const void* objectID)
-{
- AutoMutex _l(mLock);
- mObjects.detach(objectID);
-}
-
-BpBinder* BpBinder::remoteBinder()
-{
- return this;
-}
-
-BpBinder::~BpBinder()
-{
- ALOGV("Destroying BpBinder %p handle %d\n", this, mHandle);
-
- IPCThreadState* ipc = IPCThreadState::self();
-
- mLock.lock();
- Vector<Obituary>* obits = mObituaries;
- if(obits != NULL) {
- if (ipc) ipc->clearDeathNotification(mHandle, this);
- mObituaries = NULL;
- }
- mLock.unlock();
-
- if (obits != NULL) {
- // XXX Should we tell any remaining DeathRecipient
- // objects that the last strong ref has gone away, so they
- // are no longer linked?
- delete obits;
- }
-
- if (ipc) {
- ipc->expungeHandle(mHandle, this);
- ipc->decWeakHandle(mHandle);
- }
-}
-
-void BpBinder::onFirstRef()
-{
- ALOGV("onFirstRef BpBinder %p handle %d\n", this, mHandle);
- IPCThreadState* ipc = IPCThreadState::self();
- if (ipc) ipc->incStrongHandle(mHandle);
-}
-
-void BpBinder::onLastStrongRef(const void* id)
-{
- ALOGV("onLastStrongRef BpBinder %p handle %d\n", this, mHandle);
- IF_ALOGV() {
- printRefs();
- }
- IPCThreadState* ipc = IPCThreadState::self();
- if (ipc) ipc->decStrongHandle(mHandle);
-}
-
-bool BpBinder::onIncStrongAttempted(uint32_t flags, const void* id)
-{
- ALOGV("onIncStrongAttempted BpBinder %p handle %d\n", this, mHandle);
- IPCThreadState* ipc = IPCThreadState::self();
- return ipc ? ipc->attemptIncStrongHandle(mHandle) == NO_ERROR : false;
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/libs/binder/IInterface.cpp b/libs/binder/IInterface.cpp
deleted file mode 100644
index 29acf5d..0000000
--- a/libs/binder/IInterface.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#include <binder/IInterface.h>
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-IInterface::IInterface()
- : RefBase() {
-}
-
-IInterface::~IInterface() {
-}
-
-sp<IBinder> IInterface::asBinder()
-{
- return this ? onAsBinder() : NULL;
-}
-
-sp<const IBinder> IInterface::asBinder() const
-{
- return this ? const_cast<IInterface*>(this)->onAsBinder() : NULL;
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp
deleted file mode 100644
index cd2451a..0000000
--- a/libs/binder/IMemory.cpp
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#define LOG_TAG "IMemory"
-
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <sys/types.h>
-#include <sys/mman.h>
-
-#include <binder/IMemory.h>
-#include <utils/KeyedVector.h>
-#include <utils/threads.h>
-#include <utils/Atomic.h>
-#include <binder/Parcel.h>
-#include <utils/CallStack.h>
-
-#define VERBOSE 0
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-class HeapCache : public IBinder::DeathRecipient
-{
-public:
- HeapCache();
- virtual ~HeapCache();
-
- virtual void binderDied(const wp<IBinder>& who);
-
- sp<IMemoryHeap> find_heap(const sp<IBinder>& binder);
- void free_heap(const sp<IBinder>& binder);
- sp<IMemoryHeap> get_heap(const sp<IBinder>& binder);
- void dump_heaps();
-
-private:
- // For IMemory.cpp
- struct heap_info_t {
- sp<IMemoryHeap> heap;
- int32_t count;
- };
-
- void free_heap(const wp<IBinder>& binder);
-
- Mutex mHeapCacheLock;
- KeyedVector< wp<IBinder>, heap_info_t > mHeapCache;
-};
-
-static sp<HeapCache> gHeapCache = new HeapCache();
-
-/******************************************************************************/
-
-enum {
- HEAP_ID = IBinder::FIRST_CALL_TRANSACTION
-};
-
-class BpMemoryHeap : public BpInterface<IMemoryHeap>
-{
-public:
- BpMemoryHeap(const sp<IBinder>& impl);
- virtual ~BpMemoryHeap();
-
- virtual int getHeapID() const;
- virtual void* getBase() const;
- virtual size_t getSize() const;
- virtual uint32_t getFlags() const;
- virtual uint32_t getOffset() const;
-
-private:
- friend class IMemory;
- friend class HeapCache;
-
- // for debugging in this module
- static inline sp<IMemoryHeap> find_heap(const sp<IBinder>& binder) {
- return gHeapCache->find_heap(binder);
- }
- static inline void free_heap(const sp<IBinder>& binder) {
- gHeapCache->free_heap(binder);
- }
- static inline sp<IMemoryHeap> get_heap(const sp<IBinder>& binder) {
- return gHeapCache->get_heap(binder);
- }
- static inline void dump_heaps() {
- gHeapCache->dump_heaps();
- }
-
- void assertMapped() const;
- void assertReallyMapped() const;
-
- mutable volatile int32_t mHeapId;
- mutable void* mBase;
- mutable size_t mSize;
- mutable uint32_t mFlags;
- mutable uint32_t mOffset;
- mutable bool mRealHeap;
- mutable Mutex mLock;
-};
-
-// ----------------------------------------------------------------------------
-
-enum {
- GET_MEMORY = IBinder::FIRST_CALL_TRANSACTION
-};
-
-class BpMemory : public BpInterface<IMemory>
-{
-public:
- BpMemory(const sp<IBinder>& impl);
- virtual ~BpMemory();
- virtual sp<IMemoryHeap> getMemory(ssize_t* offset=0, size_t* size=0) const;
-
-private:
- mutable sp<IMemoryHeap> mHeap;
- mutable ssize_t mOffset;
- mutable size_t mSize;
-};
-
-/******************************************************************************/
-
-void* IMemory::fastPointer(const sp<IBinder>& binder, ssize_t offset) const
-{
- sp<IMemoryHeap> realHeap = BpMemoryHeap::get_heap(binder);
- void* const base = realHeap->base();
- if (base == MAP_FAILED)
- return 0;
- return static_cast<char*>(base) + offset;
-}
-
-void* IMemory::pointer() const {
- ssize_t offset;
- sp<IMemoryHeap> heap = getMemory(&offset);
- void* const base = heap!=0 ? heap->base() : MAP_FAILED;
- if (base == MAP_FAILED)
- return 0;
- return static_cast<char*>(base) + offset;
-}
-
-size_t IMemory::size() const {
- size_t size;
- getMemory(NULL, &size);
- return size;
-}
-
-ssize_t IMemory::offset() const {
- ssize_t offset;
- getMemory(&offset);
- return offset;
-}
-
-/******************************************************************************/
-
-BpMemory::BpMemory(const sp<IBinder>& impl)
- : BpInterface<IMemory>(impl), mOffset(0), mSize(0)
-{
-}
-
-BpMemory::~BpMemory()
-{
-}
-
-sp<IMemoryHeap> BpMemory::getMemory(ssize_t* offset, size_t* size) const
-{
- if (mHeap == 0) {
- Parcel data, reply;
- data.writeInterfaceToken(IMemory::getInterfaceDescriptor());
- if (remote()->transact(GET_MEMORY, data, &reply) == NO_ERROR) {
- sp<IBinder> heap = reply.readStrongBinder();
- ssize_t o = reply.readInt32();
- size_t s = reply.readInt32();
- if (heap != 0) {
- mHeap = interface_cast<IMemoryHeap>(heap);
- if (mHeap != 0) {
- mOffset = o;
- mSize = s;
- }
- }
- }
- }
- if (offset) *offset = mOffset;
- if (size) *size = mSize;
- return mHeap;
-}
-
-// ---------------------------------------------------------------------------
-
-IMPLEMENT_META_INTERFACE(Memory, "android.utils.IMemory");
-
-BnMemory::BnMemory() {
-}
-
-BnMemory::~BnMemory() {
-}
-
-status_t BnMemory::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
- case GET_MEMORY: {
- CHECK_INTERFACE(IMemory, data, reply);
- ssize_t offset;
- size_t size;
- reply->writeStrongBinder( getMemory(&offset, &size)->asBinder() );
- reply->writeInt32(offset);
- reply->writeInt32(size);
- return NO_ERROR;
- } break;
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
-}
-
-
-/******************************************************************************/
-
-BpMemoryHeap::BpMemoryHeap(const sp<IBinder>& impl)
- : BpInterface<IMemoryHeap>(impl),
- mHeapId(-1), mBase(MAP_FAILED), mSize(0), mFlags(0), mOffset(0), mRealHeap(false)
-{
-}
-
-BpMemoryHeap::~BpMemoryHeap() {
- if (mHeapId != -1) {
- close(mHeapId);
- if (mRealHeap) {
- // by construction we're the last one
- if (mBase != MAP_FAILED) {
- sp<IBinder> binder = const_cast<BpMemoryHeap*>(this)->asBinder();
-
- if (VERBOSE) {
- ALOGD("UNMAPPING binder=%p, heap=%p, size=%d, fd=%d",
- binder.get(), this, mSize, mHeapId);
- CallStack stack;
- stack.update();
- stack.dump("callstack");
- }
-
- munmap(mBase, mSize);
- }
- } else {
- // remove from list only if it was mapped before
- sp<IBinder> binder = const_cast<BpMemoryHeap*>(this)->asBinder();
- free_heap(binder);
- }
- }
-}
-
-void BpMemoryHeap::assertMapped() const
-{
- if (mHeapId == -1) {
- sp<IBinder> binder(const_cast<BpMemoryHeap*>(this)->asBinder());
- sp<BpMemoryHeap> heap(static_cast<BpMemoryHeap*>(find_heap(binder).get()));
- heap->assertReallyMapped();
- if (heap->mBase != MAP_FAILED) {
- Mutex::Autolock _l(mLock);
- if (mHeapId == -1) {
- mBase = heap->mBase;
- mSize = heap->mSize;
- mOffset = heap->mOffset;
- android_atomic_write( dup( heap->mHeapId ), &mHeapId );
- }
- } else {
- // something went wrong
- free_heap(binder);
- }
- }
-}
-
-void BpMemoryHeap::assertReallyMapped() const
-{
- if (mHeapId == -1) {
-
- // remote call without mLock held, worse case scenario, we end up
- // calling transact() from multiple threads, but that's not a problem,
- // only mmap below must be in the critical section.
-
- Parcel data, reply;
- data.writeInterfaceToken(IMemoryHeap::getInterfaceDescriptor());
- status_t err = remote()->transact(HEAP_ID, data, &reply);
- int parcel_fd = reply.readFileDescriptor();
- ssize_t size = reply.readInt32();
- uint32_t flags = reply.readInt32();
- uint32_t offset = reply.readInt32();
-
- ALOGE_IF(err, "binder=%p transaction failed fd=%d, size=%ld, err=%d (%s)",
- asBinder().get(), parcel_fd, size, err, strerror(-err));
-
- int fd = dup( parcel_fd );
- ALOGE_IF(fd==-1, "cannot dup fd=%d, size=%ld, err=%d (%s)",
- parcel_fd, size, err, strerror(errno));
-
- int access = PROT_READ;
- if (!(flags & READ_ONLY)) {
- access |= PROT_WRITE;
- }
-
- Mutex::Autolock _l(mLock);
- if (mHeapId == -1) {
- mRealHeap = true;
- mBase = mmap(0, size, access, MAP_SHARED, fd, offset);
- if (mBase == MAP_FAILED) {
- ALOGE("cannot map BpMemoryHeap (binder=%p), size=%ld, fd=%d (%s)",
- asBinder().get(), size, fd, strerror(errno));
- close(fd);
- } else {
- mSize = size;
- mFlags = flags;
- mOffset = offset;
- android_atomic_write(fd, &mHeapId);
- }
- }
- }
-}
-
-int BpMemoryHeap::getHeapID() const {
- assertMapped();
- return mHeapId;
-}
-
-void* BpMemoryHeap::getBase() const {
- assertMapped();
- return mBase;
-}
-
-size_t BpMemoryHeap::getSize() const {
- assertMapped();
- return mSize;
-}
-
-uint32_t BpMemoryHeap::getFlags() const {
- assertMapped();
- return mFlags;
-}
-
-uint32_t BpMemoryHeap::getOffset() const {
- assertMapped();
- return mOffset;
-}
-
-// ---------------------------------------------------------------------------
-
-IMPLEMENT_META_INTERFACE(MemoryHeap, "android.utils.IMemoryHeap");
-
-BnMemoryHeap::BnMemoryHeap() {
-}
-
-BnMemoryHeap::~BnMemoryHeap() {
-}
-
-status_t BnMemoryHeap::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
- case HEAP_ID: {
- CHECK_INTERFACE(IMemoryHeap, data, reply);
- reply->writeFileDescriptor(getHeapID());
- reply->writeInt32(getSize());
- reply->writeInt32(getFlags());
- reply->writeInt32(getOffset());
- return NO_ERROR;
- } break;
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
-}
-
-/*****************************************************************************/
-
-HeapCache::HeapCache()
- : DeathRecipient()
-{
-}
-
-HeapCache::~HeapCache()
-{
-}
-
-void HeapCache::binderDied(const wp<IBinder>& binder)
-{
- //ALOGD("binderDied binder=%p", binder.unsafe_get());
- free_heap(binder);
-}
-
-sp<IMemoryHeap> HeapCache::find_heap(const sp<IBinder>& binder)
-{
- Mutex::Autolock _l(mHeapCacheLock);
- ssize_t i = mHeapCache.indexOfKey(binder);
- if (i>=0) {
- heap_info_t& info = mHeapCache.editValueAt(i);
- ALOGD_IF(VERBOSE,
- "found binder=%p, heap=%p, size=%d, fd=%d, count=%d",
- binder.get(), info.heap.get(),
- static_cast<BpMemoryHeap*>(info.heap.get())->mSize,
- static_cast<BpMemoryHeap*>(info.heap.get())->mHeapId,
- info.count);
- android_atomic_inc(&info.count);
- return info.heap;
- } else {
- heap_info_t info;
- info.heap = interface_cast<IMemoryHeap>(binder);
- info.count = 1;
- //ALOGD("adding binder=%p, heap=%p, count=%d",
- // binder.get(), info.heap.get(), info.count);
- mHeapCache.add(binder, info);
- return info.heap;
- }
-}
-
-void HeapCache::free_heap(const sp<IBinder>& binder) {
- free_heap( wp<IBinder>(binder) );
-}
-
-void HeapCache::free_heap(const wp<IBinder>& binder)
-{
- sp<IMemoryHeap> rel;
- {
- Mutex::Autolock _l(mHeapCacheLock);
- ssize_t i = mHeapCache.indexOfKey(binder);
- if (i>=0) {
- heap_info_t& info(mHeapCache.editValueAt(i));
- int32_t c = android_atomic_dec(&info.count);
- if (c == 1) {
- ALOGD_IF(VERBOSE,
- "removing binder=%p, heap=%p, size=%d, fd=%d, count=%d",
- binder.unsafe_get(), info.heap.get(),
- static_cast<BpMemoryHeap*>(info.heap.get())->mSize,
- static_cast<BpMemoryHeap*>(info.heap.get())->mHeapId,
- info.count);
- rel = mHeapCache.valueAt(i).heap;
- mHeapCache.removeItemsAt(i);
- }
- } else {
- ALOGE("free_heap binder=%p not found!!!", binder.unsafe_get());
- }
- }
-}
-
-sp<IMemoryHeap> HeapCache::get_heap(const sp<IBinder>& binder)
-{
- sp<IMemoryHeap> realHeap;
- Mutex::Autolock _l(mHeapCacheLock);
- ssize_t i = mHeapCache.indexOfKey(binder);
- if (i>=0) realHeap = mHeapCache.valueAt(i).heap;
- else realHeap = interface_cast<IMemoryHeap>(binder);
- return realHeap;
-}
-
-void HeapCache::dump_heaps()
-{
- Mutex::Autolock _l(mHeapCacheLock);
- int c = mHeapCache.size();
- for (int i=0 ; i<c ; i++) {
- const heap_info_t& info = mHeapCache.valueAt(i);
- BpMemoryHeap const* h(static_cast<BpMemoryHeap const *>(info.heap.get()));
- ALOGD("hey=%p, heap=%p, count=%d, (fd=%d, base=%p, size=%d)",
- mHeapCache.keyAt(i).unsafe_get(),
- info.heap.get(), info.count,
- h->mHeapId, h->mBase, h->mSize);
- }
-}
-
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
deleted file mode 100644
index 96cef2c..0000000
--- a/libs/binder/IPCThreadState.cpp
+++ /dev/null
@@ -1,1131 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#define LOG_TAG "IPCThreadState"
-
-#include <binder/IPCThreadState.h>
-
-#include <binder/Binder.h>
-#include <binder/BpBinder.h>
-#include <utils/Debug.h>
-#include <utils/Log.h>
-#include <utils/TextOutput.h>
-#include <utils/threads.h>
-
-#include <private/binder/binder_module.h>
-#include <private/binder/Static.h>
-
-#include <sys/ioctl.h>
-#include <signal.h>
-#include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#ifdef HAVE_PTHREADS
-#include <pthread.h>
-#include <sched.h>
-#include <sys/resource.h>
-#endif
-#ifdef HAVE_WIN32_THREADS
-#include <windows.h>
-#endif
-
-
-#if LOG_NDEBUG
-
-#define IF_LOG_TRANSACTIONS() if (false)
-#define IF_LOG_COMMANDS() if (false)
-#define LOG_REMOTEREFS(...)
-#define IF_LOG_REMOTEREFS() if (false)
-#define LOG_THREADPOOL(...)
-#define LOG_ONEWAY(...)
-
-#else
-
-#define IF_LOG_TRANSACTIONS() IF_ALOG(LOG_VERBOSE, "transact")
-#define IF_LOG_COMMANDS() IF_ALOG(LOG_VERBOSE, "ipc")
-#define LOG_REMOTEREFS(...) ALOG(LOG_DEBUG, "remoterefs", __VA_ARGS__)
-#define IF_LOG_REMOTEREFS() IF_ALOG(LOG_DEBUG, "remoterefs")
-#define LOG_THREADPOOL(...) ALOG(LOG_DEBUG, "threadpool", __VA_ARGS__)
-#define LOG_ONEWAY(...) ALOG(LOG_DEBUG, "ipc", __VA_ARGS__)
-
-#endif
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-static const char* getReturnString(size_t idx);
-static const char* getCommandString(size_t idx);
-static const void* printReturnCommand(TextOutput& out, const void* _cmd);
-static const void* printCommand(TextOutput& out, const void* _cmd);
-
-// This will result in a missing symbol failure if the IF_LOG_COMMANDS()
-// conditionals don't get stripped... but that is probably what we want.
-#if !LOG_NDEBUG
-static const char *kReturnStrings[] = {
- "BR_ERROR",
- "BR_OK",
- "BR_TRANSACTION",
- "BR_REPLY",
- "BR_ACQUIRE_RESULT",
- "BR_DEAD_REPLY",
- "BR_TRANSACTION_COMPLETE",
- "BR_INCREFS",
- "BR_ACQUIRE",
- "BR_RELEASE",
- "BR_DECREFS",
- "BR_ATTEMPT_ACQUIRE",
- "BR_NOOP",
- "BR_SPAWN_LOOPER",
- "BR_FINISHED",
- "BR_DEAD_BINDER",
- "BR_CLEAR_DEATH_NOTIFICATION_DONE",
- "BR_FAILED_REPLY"
-};
-
-static const char *kCommandStrings[] = {
- "BC_TRANSACTION",
- "BC_REPLY",
- "BC_ACQUIRE_RESULT",
- "BC_FREE_BUFFER",
- "BC_INCREFS",
- "BC_ACQUIRE",
- "BC_RELEASE",
- "BC_DECREFS",
- "BC_INCREFS_DONE",
- "BC_ACQUIRE_DONE",
- "BC_ATTEMPT_ACQUIRE",
- "BC_REGISTER_LOOPER",
- "BC_ENTER_LOOPER",
- "BC_EXIT_LOOPER",
- "BC_REQUEST_DEATH_NOTIFICATION",
- "BC_CLEAR_DEATH_NOTIFICATION",
- "BC_DEAD_BINDER_DONE"
-};
-
-static const char* getReturnString(size_t idx)
-{
- if (idx < sizeof(kReturnStrings) / sizeof(kReturnStrings[0]))
- return kReturnStrings[idx];
- else
- return "unknown";
-}
-
-static const char* getCommandString(size_t idx)
-{
- if (idx < sizeof(kCommandStrings) / sizeof(kCommandStrings[0]))
- return kCommandStrings[idx];
- else
- return "unknown";
-}
-
-static const void* printBinderTransactionData(TextOutput& out, const void* data)
-{
- const binder_transaction_data* btd =
- (const binder_transaction_data*)data;
- if (btd->target.handle < 1024) {
- /* want to print descriptors in decimal; guess based on value */
- out << "target.desc=" << btd->target.handle;
- } else {
- out << "target.ptr=" << btd->target.ptr;
- }
- out << " (cookie " << btd->cookie << ")" << endl
- << "code=" << TypeCode(btd->code) << ", flags=" << (void*)btd->flags << endl
- << "data=" << btd->data.ptr.buffer << " (" << (void*)btd->data_size
- << " bytes)" << endl
- << "offsets=" << btd->data.ptr.offsets << " (" << (void*)btd->offsets_size
- << " bytes)";
- return btd+1;
-}
-
-static const void* printReturnCommand(TextOutput& out, const void* _cmd)
-{
- static const size_t N = sizeof(kReturnStrings)/sizeof(kReturnStrings[0]);
- const int32_t* cmd = (const int32_t*)_cmd;
- int32_t code = *cmd++;
- size_t cmdIndex = code & 0xff;
- if (code == (int32_t) BR_ERROR) {
- out << "BR_ERROR: " << (void*)(*cmd++) << endl;
- return cmd;
- } else if (cmdIndex >= N) {
- out << "Unknown reply: " << code << endl;
- return cmd;
- }
- out << kReturnStrings[cmdIndex];
-
- switch (code) {
- case BR_TRANSACTION:
- case BR_REPLY: {
- out << ": " << indent;
- cmd = (const int32_t *)printBinderTransactionData(out, cmd);
- out << dedent;
- } break;
-
- case BR_ACQUIRE_RESULT: {
- const int32_t res = *cmd++;
- out << ": " << res << (res ? " (SUCCESS)" : " (FAILURE)");
- } break;
-
- case BR_INCREFS:
- case BR_ACQUIRE:
- case BR_RELEASE:
- case BR_DECREFS: {
- const int32_t b = *cmd++;
- const int32_t c = *cmd++;
- out << ": target=" << (void*)b << " (cookie " << (void*)c << ")";
- } break;
-
- case BR_ATTEMPT_ACQUIRE: {
- const int32_t p = *cmd++;
- const int32_t b = *cmd++;
- const int32_t c = *cmd++;
- out << ": target=" << (void*)b << " (cookie " << (void*)c
- << "), pri=" << p;
- } break;
-
- case BR_DEAD_BINDER:
- case BR_CLEAR_DEATH_NOTIFICATION_DONE: {
- const int32_t c = *cmd++;
- out << ": death cookie " << (void*)c;
- } break;
-
- default:
- // no details to show for: BR_OK, BR_DEAD_REPLY,
- // BR_TRANSACTION_COMPLETE, BR_FINISHED
- break;
- }
-
- out << endl;
- return cmd;
-}
-
-static const void* printCommand(TextOutput& out, const void* _cmd)
-{
- static const size_t N = sizeof(kCommandStrings)/sizeof(kCommandStrings[0]);
- const int32_t* cmd = (const int32_t*)_cmd;
- int32_t code = *cmd++;
- size_t cmdIndex = code & 0xff;
-
- if (cmdIndex >= N) {
- out << "Unknown command: " << code << endl;
- return cmd;
- }
- out << kCommandStrings[cmdIndex];
-
- switch (code) {
- case BC_TRANSACTION:
- case BC_REPLY: {
- out << ": " << indent;
- cmd = (const int32_t *)printBinderTransactionData(out, cmd);
- out << dedent;
- } break;
-
- case BC_ACQUIRE_RESULT: {
- const int32_t res = *cmd++;
- out << ": " << res << (res ? " (SUCCESS)" : " (FAILURE)");
- } break;
-
- case BC_FREE_BUFFER: {
- const int32_t buf = *cmd++;
- out << ": buffer=" << (void*)buf;
- } break;
-
- case BC_INCREFS:
- case BC_ACQUIRE:
- case BC_RELEASE:
- case BC_DECREFS: {
- const int32_t d = *cmd++;
- out << ": desc=" << d;
- } break;
-
- case BC_INCREFS_DONE:
- case BC_ACQUIRE_DONE: {
- const int32_t b = *cmd++;
- const int32_t c = *cmd++;
- out << ": target=" << (void*)b << " (cookie " << (void*)c << ")";
- } break;
-
- case BC_ATTEMPT_ACQUIRE: {
- const int32_t p = *cmd++;
- const int32_t d = *cmd++;
- out << ": desc=" << d << ", pri=" << p;
- } break;
-
- case BC_REQUEST_DEATH_NOTIFICATION:
- case BC_CLEAR_DEATH_NOTIFICATION: {
- const int32_t h = *cmd++;
- const int32_t c = *cmd++;
- out << ": handle=" << h << " (death cookie " << (void*)c << ")";
- } break;
-
- case BC_DEAD_BINDER_DONE: {
- const int32_t c = *cmd++;
- out << ": death cookie " << (void*)c;
- } break;
-
- default:
- // no details to show for: BC_REGISTER_LOOPER, BC_ENTER_LOOPER,
- // BC_EXIT_LOOPER
- break;
- }
-
- out << endl;
- return cmd;
-}
-#endif
-
-static pthread_mutex_t gTLSMutex = PTHREAD_MUTEX_INITIALIZER;
-static bool gHaveTLS = false;
-static pthread_key_t gTLS = 0;
-static bool gShutdown = false;
-static bool gDisableBackgroundScheduling = false;
-
-IPCThreadState* IPCThreadState::self()
-{
- if (gHaveTLS) {
-restart:
- const pthread_key_t k = gTLS;
- IPCThreadState* st = (IPCThreadState*)pthread_getspecific(k);
- if (st) return st;
- return new IPCThreadState;
- }
-
- if (gShutdown) return NULL;
-
- pthread_mutex_lock(&gTLSMutex);
- if (!gHaveTLS) {
- if (pthread_key_create(&gTLS, threadDestructor) != 0) {
- pthread_mutex_unlock(&gTLSMutex);
- return NULL;
- }
- gHaveTLS = true;
- }
- pthread_mutex_unlock(&gTLSMutex);
- goto restart;
-}
-
-IPCThreadState* IPCThreadState::selfOrNull()
-{
- if (gHaveTLS) {
- const pthread_key_t k = gTLS;
- IPCThreadState* st = (IPCThreadState*)pthread_getspecific(k);
- return st;
- }
- return NULL;
-}
-
-void IPCThreadState::shutdown()
-{
- gShutdown = true;
-
- if (gHaveTLS) {
- // XXX Need to wait for all thread pool threads to exit!
- IPCThreadState* st = (IPCThreadState*)pthread_getspecific(gTLS);
- if (st) {
- delete st;
- pthread_setspecific(gTLS, NULL);
- }
- gHaveTLS = false;
- }
-}
-
-void IPCThreadState::disableBackgroundScheduling(bool disable)
-{
- gDisableBackgroundScheduling = disable;
-}
-
-sp<ProcessState> IPCThreadState::process()
-{
- return mProcess;
-}
-
-status_t IPCThreadState::clearLastError()
-{
- const status_t err = mLastError;
- mLastError = NO_ERROR;
- return err;
-}
-
-int IPCThreadState::getCallingPid()
-{
- return mCallingPid;
-}
-
-int IPCThreadState::getCallingUid()
-{
- return mCallingUid;
-}
-
-int IPCThreadState::getOrigCallingUid()
-{
- return mOrigCallingUid;
-}
-
-int64_t IPCThreadState::clearCallingIdentity()
-{
- int64_t token = ((int64_t)mCallingUid<<32) | mCallingPid;
- clearCaller();
- return token;
-}
-
-void IPCThreadState::setStrictModePolicy(int32_t policy)
-{
- mStrictModePolicy = policy;
-}
-
-int32_t IPCThreadState::getStrictModePolicy() const
-{
- return mStrictModePolicy;
-}
-
-void IPCThreadState::setLastTransactionBinderFlags(int32_t flags)
-{
- mLastTransactionBinderFlags = flags;
-}
-
-int32_t IPCThreadState::getLastTransactionBinderFlags() const
-{
- return mLastTransactionBinderFlags;
-}
-
-void IPCThreadState::restoreCallingIdentity(int64_t token)
-{
- mCallingUid = (int)(token>>32);
- mCallingPid = (int)token;
-}
-
-void IPCThreadState::clearCaller()
-{
- mCallingPid = getpid();
- mCallingUid = getuid();
-}
-
-void IPCThreadState::flushCommands()
-{
- if (mProcess->mDriverFD <= 0)
- return;
- talkWithDriver(false);
-}
-
-void IPCThreadState::joinThreadPool(bool isMain)
-{
- LOG_THREADPOOL("**** THREAD %p (PID %d) IS JOINING THE THREAD POOL\n", (void*)pthread_self(), getpid());
-
- mOut.writeInt32(isMain ? BC_ENTER_LOOPER : BC_REGISTER_LOOPER);
-
- // This thread may have been spawned by a thread that was in the background
- // scheduling group, so first we will make sure it is in the default/foreground
- // one to avoid performing an initial transaction in the background.
- androidSetThreadSchedulingGroup(mMyThreadId, ANDROID_TGROUP_DEFAULT);
-
- status_t result;
- do {
- int32_t cmd;
-
- // When we've cleared the incoming command queue, process any pending derefs
- if (mIn.dataPosition() >= mIn.dataSize()) {
- size_t numPending = mPendingWeakDerefs.size();
- if (numPending > 0) {
- for (size_t i = 0; i < numPending; i++) {
- RefBase::weakref_type* refs = mPendingWeakDerefs[i];
- refs->decWeak(mProcess.get());
- }
- mPendingWeakDerefs.clear();
- }
-
- numPending = mPendingStrongDerefs.size();
- if (numPending > 0) {
- for (size_t i = 0; i < numPending; i++) {
- BBinder* obj = mPendingStrongDerefs[i];
- obj->decStrong(mProcess.get());
- }
- mPendingStrongDerefs.clear();
- }
- }
-
- // now get the next command to be processed, waiting if necessary
- result = talkWithDriver();
- if (result >= NO_ERROR) {
- size_t IN = mIn.dataAvail();
- if (IN < sizeof(int32_t)) continue;
- cmd = mIn.readInt32();
- IF_LOG_COMMANDS() {
- alog << "Processing top-level Command: "
- << getReturnString(cmd) << endl;
- }
-
-
- result = executeCommand(cmd);
- }
-
- // After executing the command, ensure that the thread is returned to the
- // default cgroup before rejoining the pool. The driver takes care of
- // restoring the priority, but doesn't do anything with cgroups so we
- // need to take care of that here in userspace. Note that we do make
- // sure to go in the foreground after executing a transaction, but
- // there are other callbacks into user code that could have changed
- // our group so we want to make absolutely sure it is put back.
- androidSetThreadSchedulingGroup(mMyThreadId, ANDROID_TGROUP_DEFAULT);
-
- // Let this thread exit the thread pool if it is no longer
- // needed and it is not the main process thread.
- if(result == TIMED_OUT && !isMain) {
- break;
- }
- } while (result != -ECONNREFUSED && result != -EBADF);
-
- LOG_THREADPOOL("**** THREAD %p (PID %d) IS LEAVING THE THREAD POOL err=%p\n",
- (void*)pthread_self(), getpid(), (void*)result);
-
- mOut.writeInt32(BC_EXIT_LOOPER);
- talkWithDriver(false);
-}
-
-void IPCThreadState::stopProcess(bool immediate)
-{
- //ALOGI("**** STOPPING PROCESS");
- flushCommands();
- int fd = mProcess->mDriverFD;
- mProcess->mDriverFD = -1;
- close(fd);
- //kill(getpid(), SIGKILL);
-}
-
-status_t IPCThreadState::transact(int32_t handle,
- uint32_t code, const Parcel& data,
- Parcel* reply, uint32_t flags)
-{
- status_t err = data.errorCheck();
-
- flags |= TF_ACCEPT_FDS;
-
- IF_LOG_TRANSACTIONS() {
- TextOutput::Bundle _b(alog);
- alog << "BC_TRANSACTION thr " << (void*)pthread_self() << " / hand "
- << handle << " / code " << TypeCode(code) << ": "
- << indent << data << dedent << endl;
- }
-
- if (err == NO_ERROR) {
- LOG_ONEWAY(">>>> SEND from pid %d uid %d %s", getpid(), getuid(),
- (flags & TF_ONE_WAY) == 0 ? "READ REPLY" : "ONE WAY");
- err = writeTransactionData(BC_TRANSACTION, flags, handle, code, data, NULL);
- }
-
- if (err != NO_ERROR) {
- if (reply) reply->setError(err);
- return (mLastError = err);
- }
-
- if ((flags & TF_ONE_WAY) == 0) {
- #if 0
- if (code == 4) { // relayout
- ALOGI(">>>>>> CALLING transaction 4");
- } else {
- ALOGI(">>>>>> CALLING transaction %d", code);
- }
- #endif
- if (reply) {
- err = waitForResponse(reply);
- } else {
- Parcel fakeReply;
- err = waitForResponse(&fakeReply);
- }
- #if 0
- if (code == 4) { // relayout
- ALOGI("<<<<<< RETURNING transaction 4");
- } else {
- ALOGI("<<<<<< RETURNING transaction %d", code);
- }
- #endif
-
- IF_LOG_TRANSACTIONS() {
- TextOutput::Bundle _b(alog);
- alog << "BR_REPLY thr " << (void*)pthread_self() << " / hand "
- << handle << ": ";
- if (reply) alog << indent << *reply << dedent << endl;
- else alog << "(none requested)" << endl;
- }
- } else {
- err = waitForResponse(NULL, NULL);
- }
-
- return err;
-}
-
-void IPCThreadState::incStrongHandle(int32_t handle)
-{
- LOG_REMOTEREFS("IPCThreadState::incStrongHandle(%d)\n", handle);
- mOut.writeInt32(BC_ACQUIRE);
- mOut.writeInt32(handle);
-}
-
-void IPCThreadState::decStrongHandle(int32_t handle)
-{
- LOG_REMOTEREFS("IPCThreadState::decStrongHandle(%d)\n", handle);
- mOut.writeInt32(BC_RELEASE);
- mOut.writeInt32(handle);
-}
-
-void IPCThreadState::incWeakHandle(int32_t handle)
-{
- LOG_REMOTEREFS("IPCThreadState::incWeakHandle(%d)\n", handle);
- mOut.writeInt32(BC_INCREFS);
- mOut.writeInt32(handle);
-}
-
-void IPCThreadState::decWeakHandle(int32_t handle)
-{
- LOG_REMOTEREFS("IPCThreadState::decWeakHandle(%d)\n", handle);
- mOut.writeInt32(BC_DECREFS);
- mOut.writeInt32(handle);
-}
-
-status_t IPCThreadState::attemptIncStrongHandle(int32_t handle)
-{
- LOG_REMOTEREFS("IPCThreadState::attemptIncStrongHandle(%d)\n", handle);
- mOut.writeInt32(BC_ATTEMPT_ACQUIRE);
- mOut.writeInt32(0); // xxx was thread priority
- mOut.writeInt32(handle);
- status_t result = UNKNOWN_ERROR;
-
- waitForResponse(NULL, &result);
-
-#if LOG_REFCOUNTS
- printf("IPCThreadState::attemptIncStrongHandle(%ld) = %s\n",
- handle, result == NO_ERROR ? "SUCCESS" : "FAILURE");
-#endif
-
- return result;
-}
-
-void IPCThreadState::expungeHandle(int32_t handle, IBinder* binder)
-{
-#if LOG_REFCOUNTS
- printf("IPCThreadState::expungeHandle(%ld)\n", handle);
-#endif
- self()->mProcess->expungeHandle(handle, binder);
-}
-
-status_t IPCThreadState::requestDeathNotification(int32_t handle, BpBinder* proxy)
-{
- mOut.writeInt32(BC_REQUEST_DEATH_NOTIFICATION);
- mOut.writeInt32((int32_t)handle);
- mOut.writeInt32((int32_t)proxy);
- return NO_ERROR;
-}
-
-status_t IPCThreadState::clearDeathNotification(int32_t handle, BpBinder* proxy)
-{
- mOut.writeInt32(BC_CLEAR_DEATH_NOTIFICATION);
- mOut.writeInt32((int32_t)handle);
- mOut.writeInt32((int32_t)proxy);
- return NO_ERROR;
-}
-
-IPCThreadState::IPCThreadState()
- : mProcess(ProcessState::self()),
- mMyThreadId(androidGetTid()),
- mStrictModePolicy(0),
- mLastTransactionBinderFlags(0)
-{
- pthread_setspecific(gTLS, this);
- clearCaller();
- mOrigCallingUid = mCallingUid;
- mIn.setDataCapacity(256);
- mOut.setDataCapacity(256);
-}
-
-IPCThreadState::~IPCThreadState()
-{
-}
-
-status_t IPCThreadState::sendReply(const Parcel& reply, uint32_t flags)
-{
- status_t err;
- status_t statusBuffer;
- err = writeTransactionData(BC_REPLY, flags, -1, 0, reply, &statusBuffer);
- if (err < NO_ERROR) return err;
-
- return waitForResponse(NULL, NULL);
-}
-
-status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult)
-{
- int32_t cmd;
- int32_t err;
-
- while (1) {
- if ((err=talkWithDriver()) < NO_ERROR) break;
- err = mIn.errorCheck();
- if (err < NO_ERROR) break;
- if (mIn.dataAvail() == 0) continue;
-
- cmd = mIn.readInt32();
-
- IF_LOG_COMMANDS() {
- alog << "Processing waitForResponse Command: "
- << getReturnString(cmd) << endl;
- }
-
- switch (cmd) {
- case BR_TRANSACTION_COMPLETE:
- if (!reply && !acquireResult) goto finish;
- break;
-
- case BR_DEAD_REPLY:
- err = DEAD_OBJECT;
- goto finish;
-
- case BR_FAILED_REPLY:
- err = FAILED_TRANSACTION;
- goto finish;
-
- case BR_ACQUIRE_RESULT:
- {
- ALOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT");
- const int32_t result = mIn.readInt32();
- if (!acquireResult) continue;
- *acquireResult = result ? NO_ERROR : INVALID_OPERATION;
- }
- goto finish;
-
- case BR_REPLY:
- {
- binder_transaction_data tr;
- err = mIn.read(&tr, sizeof(tr));
- ALOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY");
- if (err != NO_ERROR) goto finish;
-
- if (reply) {
- if ((tr.flags & TF_STATUS_CODE) == 0) {
- reply->ipcSetDataReference(
- reinterpret_cast<const uint8_t*>(tr.data.ptr.buffer),
- tr.data_size,
- reinterpret_cast<const size_t*>(tr.data.ptr.offsets),
- tr.offsets_size/sizeof(size_t),
- freeBuffer, this);
- } else {
- err = *static_cast<const status_t*>(tr.data.ptr.buffer);
- freeBuffer(NULL,
- reinterpret_cast<const uint8_t*>(tr.data.ptr.buffer),
- tr.data_size,
- reinterpret_cast<const size_t*>(tr.data.ptr.offsets),
- tr.offsets_size/sizeof(size_t), this);
- }
- } else {
- freeBuffer(NULL,
- reinterpret_cast<const uint8_t*>(tr.data.ptr.buffer),
- tr.data_size,
- reinterpret_cast<const size_t*>(tr.data.ptr.offsets),
- tr.offsets_size/sizeof(size_t), this);
- continue;
- }
- }
- goto finish;
-
- default:
- err = executeCommand(cmd);
- if (err != NO_ERROR) goto finish;
- break;
- }
- }
-
-finish:
- if (err != NO_ERROR) {
- if (acquireResult) *acquireResult = err;
- if (reply) reply->setError(err);
- mLastError = err;
- }
-
- return err;
-}
-
-status_t IPCThreadState::talkWithDriver(bool doReceive)
-{
- ALOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened");
-
- binder_write_read bwr;
-
- // Is the read buffer empty?
- const bool needRead = mIn.dataPosition() >= mIn.dataSize();
-
- // We don't want to write anything if we are still reading
- // from data left in the input buffer and the caller
- // has requested to read the next data.
- const size_t outAvail = (!doReceive || needRead) ? mOut.dataSize() : 0;
-
- bwr.write_size = outAvail;
- bwr.write_buffer = (long unsigned int)mOut.data();
-
- // This is what we'll read.
- if (doReceive && needRead) {
- bwr.read_size = mIn.dataCapacity();
- bwr.read_buffer = (long unsigned int)mIn.data();
- } else {
- bwr.read_size = 0;
- bwr.read_buffer = 0;
- }
-
- IF_LOG_COMMANDS() {
- TextOutput::Bundle _b(alog);
- if (outAvail != 0) {
- alog << "Sending commands to driver: " << indent;
- const void* cmds = (const void*)bwr.write_buffer;
- const void* end = ((const uint8_t*)cmds)+bwr.write_size;
- alog << HexDump(cmds, bwr.write_size) << endl;
- while (cmds < end) cmds = printCommand(alog, cmds);
- alog << dedent;
- }
- alog << "Size of receive buffer: " << bwr.read_size
- << ", needRead: " << needRead << ", doReceive: " << doReceive << endl;
- }
-
- // Return immediately if there is nothing to do.
- if ((bwr.write_size == 0) && (bwr.read_size == 0)) return NO_ERROR;
-
- bwr.write_consumed = 0;
- bwr.read_consumed = 0;
- status_t err;
- do {
- IF_LOG_COMMANDS() {
- alog << "About to read/write, write size = " << mOut.dataSize() << endl;
- }
-#if defined(HAVE_ANDROID_OS)
- if (ioctl(mProcess->mDriverFD, BINDER_WRITE_READ, &bwr) >= 0)
- err = NO_ERROR;
- else
- err = -errno;
-#else
- err = INVALID_OPERATION;
-#endif
- IF_LOG_COMMANDS() {
- alog << "Finished read/write, write size = " << mOut.dataSize() << endl;
- }
- } while (err == -EINTR);
-
- IF_LOG_COMMANDS() {
- alog << "Our err: " << (void*)err << ", write consumed: "
- << bwr.write_consumed << " (of " << mOut.dataSize()
- << "), read consumed: " << bwr.read_consumed << endl;
- }
-
- if (err >= NO_ERROR) {
- if (bwr.write_consumed > 0) {
- if (bwr.write_consumed < (ssize_t)mOut.dataSize())
- mOut.remove(0, bwr.write_consumed);
- else
- mOut.setDataSize(0);
- }
- if (bwr.read_consumed > 0) {
- mIn.setDataSize(bwr.read_consumed);
- mIn.setDataPosition(0);
- }
- IF_LOG_COMMANDS() {
- TextOutput::Bundle _b(alog);
- alog << "Remaining data size: " << mOut.dataSize() << endl;
- alog << "Received commands from driver: " << indent;
- const void* cmds = mIn.data();
- const void* end = mIn.data() + mIn.dataSize();
- alog << HexDump(cmds, mIn.dataSize()) << endl;
- while (cmds < end) cmds = printReturnCommand(alog, cmds);
- alog << dedent;
- }
- return NO_ERROR;
- }
-
- return err;
-}
-
-status_t IPCThreadState::writeTransactionData(int32_t cmd, uint32_t binderFlags,
- int32_t handle, uint32_t code, const Parcel& data, status_t* statusBuffer)
-{
- binder_transaction_data tr;
-
- tr.target.handle = handle;
- tr.code = code;
- tr.flags = binderFlags;
- tr.cookie = 0;
- tr.sender_pid = 0;
- tr.sender_euid = 0;
-
- const status_t err = data.errorCheck();
- if (err == NO_ERROR) {
- tr.data_size = data.ipcDataSize();
- tr.data.ptr.buffer = data.ipcData();
- tr.offsets_size = data.ipcObjectsCount()*sizeof(size_t);
- tr.data.ptr.offsets = data.ipcObjects();
- } else if (statusBuffer) {
- tr.flags |= TF_STATUS_CODE;
- *statusBuffer = err;
- tr.data_size = sizeof(status_t);
- tr.data.ptr.buffer = statusBuffer;
- tr.offsets_size = 0;
- tr.data.ptr.offsets = NULL;
- } else {
- return (mLastError = err);
- }
-
- mOut.writeInt32(cmd);
- mOut.write(&tr, sizeof(tr));
-
- return NO_ERROR;
-}
-
-sp<BBinder> the_context_object;
-
-void setTheContextObject(sp<BBinder> obj)
-{
- the_context_object = obj;
-}
-
-status_t IPCThreadState::executeCommand(int32_t cmd)
-{
- BBinder* obj;
- RefBase::weakref_type* refs;
- status_t result = NO_ERROR;
-
- switch (cmd) {
- case BR_ERROR:
- result = mIn.readInt32();
- break;
-
- case BR_OK:
- break;
-
- case BR_ACQUIRE:
- refs = (RefBase::weakref_type*)mIn.readInt32();
- obj = (BBinder*)mIn.readInt32();
- ALOG_ASSERT(refs->refBase() == obj,
- "BR_ACQUIRE: object %p does not match cookie %p (expected %p)",
- refs, obj, refs->refBase());
- obj->incStrong(mProcess.get());
- IF_LOG_REMOTEREFS() {
- LOG_REMOTEREFS("BR_ACQUIRE from driver on %p", obj);
- obj->printRefs();
- }
- mOut.writeInt32(BC_ACQUIRE_DONE);
- mOut.writeInt32((int32_t)refs);
- mOut.writeInt32((int32_t)obj);
- break;
-
- case BR_RELEASE:
- refs = (RefBase::weakref_type*)mIn.readInt32();
- obj = (BBinder*)mIn.readInt32();
- ALOG_ASSERT(refs->refBase() == obj,
- "BR_RELEASE: object %p does not match cookie %p (expected %p)",
- refs, obj, refs->refBase());
- IF_LOG_REMOTEREFS() {
- LOG_REMOTEREFS("BR_RELEASE from driver on %p", obj);
- obj->printRefs();
- }
- mPendingStrongDerefs.push(obj);
- break;
-
- case BR_INCREFS:
- refs = (RefBase::weakref_type*)mIn.readInt32();
- obj = (BBinder*)mIn.readInt32();
- refs->incWeak(mProcess.get());
- mOut.writeInt32(BC_INCREFS_DONE);
- mOut.writeInt32((int32_t)refs);
- mOut.writeInt32((int32_t)obj);
- break;
-
- case BR_DECREFS:
- refs = (RefBase::weakref_type*)mIn.readInt32();
- obj = (BBinder*)mIn.readInt32();
- // NOTE: This assertion is not valid, because the object may no
- // longer exist (thus the (BBinder*)cast above resulting in a different
- // memory address).
- //ALOG_ASSERT(refs->refBase() == obj,
- // "BR_DECREFS: object %p does not match cookie %p (expected %p)",
- // refs, obj, refs->refBase());
- mPendingWeakDerefs.push(refs);
- break;
-
- case BR_ATTEMPT_ACQUIRE:
- refs = (RefBase::weakref_type*)mIn.readInt32();
- obj = (BBinder*)mIn.readInt32();
-
- {
- const bool success = refs->attemptIncStrong(mProcess.get());
- ALOG_ASSERT(success && refs->refBase() == obj,
- "BR_ATTEMPT_ACQUIRE: object %p does not match cookie %p (expected %p)",
- refs, obj, refs->refBase());
-
- mOut.writeInt32(BC_ACQUIRE_RESULT);
- mOut.writeInt32((int32_t)success);
- }
- break;
-
- case BR_TRANSACTION:
- {
- binder_transaction_data tr;
- result = mIn.read(&tr, sizeof(tr));
- ALOG_ASSERT(result == NO_ERROR,
- "Not enough command data for brTRANSACTION");
- if (result != NO_ERROR) break;
-
- Parcel buffer;
- buffer.ipcSetDataReference(
- reinterpret_cast<const uint8_t*>(tr.data.ptr.buffer),
- tr.data_size,
- reinterpret_cast<const size_t*>(tr.data.ptr.offsets),
- tr.offsets_size/sizeof(size_t), freeBuffer, this);
-
- const pid_t origPid = mCallingPid;
- const uid_t origUid = mCallingUid;
-
- mCallingPid = tr.sender_pid;
- mCallingUid = tr.sender_euid;
- mOrigCallingUid = tr.sender_euid;
-
- int curPrio = getpriority(PRIO_PROCESS, mMyThreadId);
- if (gDisableBackgroundScheduling) {
- if (curPrio > ANDROID_PRIORITY_NORMAL) {
- // We have inherited a reduced priority from the caller, but do not
- // want to run in that state in this process. The driver set our
- // priority already (though not our scheduling class), so bounce
- // it back to the default before invoking the transaction.
- setpriority(PRIO_PROCESS, mMyThreadId, ANDROID_PRIORITY_NORMAL);
- }
- } else {
- if (curPrio >= ANDROID_PRIORITY_BACKGROUND) {
- // We want to use the inherited priority from the caller.
- // Ensure this thread is in the background scheduling class,
- // since the driver won't modify scheduling classes for us.
- // The scheduling group is reset to default by the caller
- // once this method returns after the transaction is complete.
- androidSetThreadSchedulingGroup(mMyThreadId,
- ANDROID_TGROUP_BG_NONINTERACT);
- }
- }
-
- //ALOGI(">>>> TRANSACT from pid %d uid %d\n", mCallingPid, mCallingUid);
-
- Parcel reply;
- IF_LOG_TRANSACTIONS() {
- TextOutput::Bundle _b(alog);
- alog << "BR_TRANSACTION thr " << (void*)pthread_self()
- << " / obj " << tr.target.ptr << " / code "
- << TypeCode(tr.code) << ": " << indent << buffer
- << dedent << endl
- << "Data addr = "
- << reinterpret_cast<const uint8_t*>(tr.data.ptr.buffer)
- << ", offsets addr="
- << reinterpret_cast<const size_t*>(tr.data.ptr.offsets) << endl;
- }
- if (tr.target.ptr) {
- sp<BBinder> b((BBinder*)tr.cookie);
- const status_t error = b->transact(tr.code, buffer, &reply, tr.flags);
- if (error < NO_ERROR) reply.setError(error);
-
- } else {
- const status_t error = the_context_object->transact(tr.code, buffer, &reply, tr.flags);
- if (error < NO_ERROR) reply.setError(error);
- }
-
- //ALOGI("<<<< TRANSACT from pid %d restore pid %d uid %d\n",
- // mCallingPid, origPid, origUid);
-
- if ((tr.flags & TF_ONE_WAY) == 0) {
- LOG_ONEWAY("Sending reply to %d!", mCallingPid);
- sendReply(reply, 0);
- } else {
- LOG_ONEWAY("NOT sending reply to %d!", mCallingPid);
- }
-
- mCallingPid = origPid;
- mCallingUid = origUid;
- mOrigCallingUid = origUid;
-
- IF_LOG_TRANSACTIONS() {
- TextOutput::Bundle _b(alog);
- alog << "BC_REPLY thr " << (void*)pthread_self() << " / obj "
- << tr.target.ptr << ": " << indent << reply << dedent << endl;
- }
-
- }
- break;
-
- case BR_DEAD_BINDER:
- {
- BpBinder *proxy = (BpBinder*)mIn.readInt32();
- proxy->sendObituary();
- mOut.writeInt32(BC_DEAD_BINDER_DONE);
- mOut.writeInt32((int32_t)proxy);
- } break;
-
- case BR_CLEAR_DEATH_NOTIFICATION_DONE:
- {
- BpBinder *proxy = (BpBinder*)mIn.readInt32();
- proxy->getWeakRefs()->decWeak(proxy);
- } break;
-
- case BR_FINISHED:
- result = TIMED_OUT;
- break;
-
- case BR_NOOP:
- break;
-
- case BR_SPAWN_LOOPER:
- mProcess->spawnPooledThread(false);
- break;
-
- default:
- printf("*** BAD COMMAND %d received from Binder driver\n", cmd);
- result = UNKNOWN_ERROR;
- break;
- }
-
- if (result != NO_ERROR) {
- mLastError = result;
- }
-
- return result;
-}
-
-void IPCThreadState::threadDestructor(void *st)
-{
- IPCThreadState* const self = static_cast<IPCThreadState*>(st);
- if (self) {
- self->flushCommands();
-#if defined(HAVE_ANDROID_OS)
- ioctl(self->mProcess->mDriverFD, BINDER_THREAD_EXIT, 0);
-#endif
- delete self;
- }
-}
-
-
-void IPCThreadState::freeBuffer(Parcel* parcel, const uint8_t* data, size_t dataSize,
- const size_t* objects, size_t objectsSize,
- void* cookie)
-{
- //ALOGI("Freeing parcel %p", &parcel);
- IF_LOG_COMMANDS() {
- alog << "Writing BC_FREE_BUFFER for " << data << endl;
- }
- ALOG_ASSERT(data != NULL, "Called with NULL data");
- if (parcel != NULL) parcel->closeFileDescriptors();
- IPCThreadState* state = self();
- state->mOut.writeInt32(BC_FREE_BUFFER);
- state->mOut.writeInt32((int32_t)data);
-}
-
-}; // namespace android
diff --git a/libs/binder/IPermissionController.cpp b/libs/binder/IPermissionController.cpp
deleted file mode 100644
index e13036f..0000000
--- a/libs/binder/IPermissionController.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#define LOG_TAG "PermissionController"
-
-#include <binder/IPermissionController.h>
-
-#include <utils/Debug.h>
-#include <utils/Log.h>
-#include <binder/Parcel.h>
-#include <utils/String8.h>
-
-#include <private/binder/Static.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------
-
-class BpPermissionController : public BpInterface<IPermissionController>
-{
-public:
- BpPermissionController(const sp<IBinder>& impl)
- : BpInterface<IPermissionController>(impl)
- {
- }
-
- virtual bool checkPermission(const String16& permission, int32_t pid, int32_t uid)
- {
- Parcel data, reply;
- data.writeInterfaceToken(IPermissionController::getInterfaceDescriptor());
- data.writeString16(permission);
- data.writeInt32(pid);
- data.writeInt32(uid);
- remote()->transact(CHECK_PERMISSION_TRANSACTION, data, &reply);
- // fail on exception
- if (reply.readExceptionCode() != 0) return 0;
- return reply.readInt32() != 0;
- }
-};
-
-IMPLEMENT_META_INTERFACE(PermissionController, "android.os.IPermissionController");
-
-// ----------------------------------------------------------------------
-
-status_t BnPermissionController::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- //printf("PermissionController received: "); data.print();
- switch(code) {
- case CHECK_PERMISSION_TRANSACTION: {
- CHECK_INTERFACE(IPermissionController, data, reply);
- String16 permission = data.readString16();
- int32_t pid = data.readInt32();
- int32_t uid = data.readInt32();
- bool res = checkPermission(permission, pid, uid);
- reply->writeNoException();
- reply->writeInt32(res ? 1 : 0);
- return NO_ERROR;
- } break;
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
-}
-
-}; // namespace android
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
deleted file mode 100644
index 1750640..0000000
--- a/libs/binder/IServiceManager.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#define LOG_TAG "ServiceManager"
-
-#include <binder/IServiceManager.h>
-
-#include <utils/Debug.h>
-#include <utils/Log.h>
-#include <binder/IPCThreadState.h>
-#include <binder/Parcel.h>
-#include <utils/String8.h>
-#include <utils/SystemClock.h>
-
-#include <private/binder/Static.h>
-
-#include <unistd.h>
-
-namespace android {
-
-sp<IServiceManager> defaultServiceManager()
-{
- if (gDefaultServiceManager != NULL) return gDefaultServiceManager;
-
- {
- AutoMutex _l(gDefaultServiceManagerLock);
- if (gDefaultServiceManager == NULL) {
- gDefaultServiceManager = interface_cast<IServiceManager>(
- ProcessState::self()->getContextObject(NULL));
- }
- }
-
- return gDefaultServiceManager;
-}
-
-bool checkCallingPermission(const String16& permission)
-{
- return checkCallingPermission(permission, NULL, NULL);
-}
-
-static String16 _permission("permission");
-
-
-bool checkCallingPermission(const String16& permission, int32_t* outPid, int32_t* outUid)
-{
- IPCThreadState* ipcState = IPCThreadState::self();
- pid_t pid = ipcState->getCallingPid();
- uid_t uid = ipcState->getCallingUid();
- if (outPid) *outPid = pid;
- if (outUid) *outUid = uid;
- return checkPermission(permission, pid, uid);
-}
-
-bool checkPermission(const String16& permission, pid_t pid, uid_t uid)
-{
- sp<IPermissionController> pc;
- gDefaultServiceManagerLock.lock();
- pc = gPermissionController;
- gDefaultServiceManagerLock.unlock();
-
- int64_t startTime = 0;
-
- while (true) {
- if (pc != NULL) {
- bool res = pc->checkPermission(permission, pid, uid);
- if (res) {
- if (startTime != 0) {
- ALOGI("Check passed after %d seconds for %s from uid=%d pid=%d",
- (int)((uptimeMillis()-startTime)/1000),
- String8(permission).string(), uid, pid);
- }
- return res;
- }
-
- // Is this a permission failure, or did the controller go away?
- if (pc->asBinder()->isBinderAlive()) {
- ALOGW("Permission failure: %s from uid=%d pid=%d",
- String8(permission).string(), uid, pid);
- return false;
- }
-
- // Object is dead!
- gDefaultServiceManagerLock.lock();
- if (gPermissionController == pc) {
- gPermissionController = NULL;
- }
- gDefaultServiceManagerLock.unlock();
- }
-
- // Need to retrieve the permission controller.
- sp<IBinder> binder = defaultServiceManager()->checkService(_permission);
- if (binder == NULL) {
- // Wait for the permission controller to come back...
- if (startTime == 0) {
- startTime = uptimeMillis();
- ALOGI("Waiting to check permission %s from uid=%d pid=%d",
- String8(permission).string(), uid, pid);
- }
- sleep(1);
- } else {
- pc = interface_cast<IPermissionController>(binder);
- // Install the new permission controller, and try again.
- gDefaultServiceManagerLock.lock();
- gPermissionController = pc;
- gDefaultServiceManagerLock.unlock();
- }
- }
-}
-
-// ----------------------------------------------------------------------
-
-class BpServiceManager : public BpInterface<IServiceManager>
-{
-public:
- BpServiceManager(const sp<IBinder>& impl)
- : BpInterface<IServiceManager>(impl)
- {
- }
-
- virtual sp<IBinder> getService(const String16& name) const
- {
- unsigned n;
- for (n = 0; n < 5; n++){
- sp<IBinder> svc = checkService(name);
- if (svc != NULL) return svc;
- ALOGI("Waiting for service %s...\n", String8(name).string());
- sleep(1);
- }
- return NULL;
- }
-
- virtual sp<IBinder> checkService( const String16& name) const
- {
- Parcel data, reply;
- data.writeInterfaceToken(IServiceManager::getInterfaceDescriptor());
- data.writeString16(name);
- remote()->transact(CHECK_SERVICE_TRANSACTION, data, &reply);
- return reply.readStrongBinder();
- }
-
- virtual status_t addService(const String16& name, const sp<IBinder>& service,
- bool allowIsolated)
- {
- Parcel data, reply;
- data.writeInterfaceToken(IServiceManager::getInterfaceDescriptor());
- data.writeString16(name);
- data.writeStrongBinder(service);
- data.writeInt32(allowIsolated ? 1 : 0);
- status_t err = remote()->transact(ADD_SERVICE_TRANSACTION, data, &reply);
- return err == NO_ERROR ? reply.readExceptionCode() : err;
- }
-
- virtual Vector<String16> listServices()
- {
- Vector<String16> res;
- int n = 0;
-
- for (;;) {
- Parcel data, reply;
- data.writeInterfaceToken(IServiceManager::getInterfaceDescriptor());
- data.writeInt32(n++);
- status_t err = remote()->transact(LIST_SERVICES_TRANSACTION, data, &reply);
- if (err != NO_ERROR)
- break;
- res.add(reply.readString16());
- }
- return res;
- }
-};
-
-IMPLEMENT_META_INTERFACE(ServiceManager, "android.os.IServiceManager");
-
-// ----------------------------------------------------------------------
-
-status_t BnServiceManager::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- //printf("ServiceManager received: "); data.print();
- switch(code) {
- case GET_SERVICE_TRANSACTION: {
- CHECK_INTERFACE(IServiceManager, data, reply);
- String16 which = data.readString16();
- sp<IBinder> b = const_cast<BnServiceManager*>(this)->getService(which);
- reply->writeStrongBinder(b);
- return NO_ERROR;
- } break;
- case CHECK_SERVICE_TRANSACTION: {
- CHECK_INTERFACE(IServiceManager, data, reply);
- String16 which = data.readString16();
- sp<IBinder> b = const_cast<BnServiceManager*>(this)->checkService(which);
- reply->writeStrongBinder(b);
- return NO_ERROR;
- } break;
- case ADD_SERVICE_TRANSACTION: {
- CHECK_INTERFACE(IServiceManager, data, reply);
- String16 which = data.readString16();
- sp<IBinder> b = data.readStrongBinder();
- status_t err = addService(which, b);
- reply->writeInt32(err);
- return NO_ERROR;
- } break;
- case LIST_SERVICES_TRANSACTION: {
- CHECK_INTERFACE(IServiceManager, data, reply);
- Vector<String16> list = listServices();
- const size_t N = list.size();
- reply->writeInt32(N);
- for (size_t i=0; i<N; i++) {
- reply->writeString16(list[i]);
- }
- return NO_ERROR;
- } break;
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
-}
-
-}; // namespace android
diff --git a/libs/binder/MemoryBase.cpp b/libs/binder/MemoryBase.cpp
deleted file mode 100644
index 033066b..0000000
--- a/libs/binder/MemoryBase.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <binder/MemoryBase.h>
-
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-MemoryBase::MemoryBase(const sp<IMemoryHeap>& heap,
- ssize_t offset, size_t size)
- : mSize(size), mOffset(offset), mHeap(heap)
-{
-}
-
-sp<IMemoryHeap> MemoryBase::getMemory(ssize_t* offset, size_t* size) const
-{
- if (offset) *offset = mOffset;
- if (size) *size = mSize;
- return mHeap;
-}
-
-MemoryBase::~MemoryBase()
-{
-}
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp
deleted file mode 100644
index 8d0e0a7..0000000
--- a/libs/binder/MemoryDealer.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define LOG_TAG "MemoryDealer"
-
-#include <binder/MemoryDealer.h>
-#include <binder/IPCThreadState.h>
-#include <binder/MemoryBase.h>
-
-#include <utils/Log.h>
-#include <utils/SortedVector.h>
-#include <utils/String8.h>
-#include <utils/threads.h>
-
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/file.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-/*
- * A simple templatized doubly linked-list implementation
- */
-
-template <typename NODE>
-class LinkedList
-{
- NODE* mFirst;
- NODE* mLast;
-
-public:
- LinkedList() : mFirst(0), mLast(0) { }
- bool isEmpty() const { return mFirst == 0; }
- NODE const* head() const { return mFirst; }
- NODE* head() { return mFirst; }
- NODE const* tail() const { return mLast; }
- NODE* tail() { return mLast; }
-
- void insertAfter(NODE* node, NODE* newNode) {
- newNode->prev = node;
- newNode->next = node->next;
- if (node->next == 0) mLast = newNode;
- else node->next->prev = newNode;
- node->next = newNode;
- }
-
- void insertBefore(NODE* node, NODE* newNode) {
- newNode->prev = node->prev;
- newNode->next = node;
- if (node->prev == 0) mFirst = newNode;
- else node->prev->next = newNode;
- node->prev = newNode;
- }
-
- void insertHead(NODE* newNode) {
- if (mFirst == 0) {
- mFirst = mLast = newNode;
- newNode->prev = newNode->next = 0;
- } else {
- newNode->prev = 0;
- newNode->next = mFirst;
- mFirst->prev = newNode;
- mFirst = newNode;
- }
- }
-
- void insertTail(NODE* newNode) {
- if (mLast == 0) {
- insertHead(newNode);
- } else {
- newNode->prev = mLast;
- newNode->next = 0;
- mLast->next = newNode;
- mLast = newNode;
- }
- }
-
- NODE* remove(NODE* node) {
- if (node->prev == 0) mFirst = node->next;
- else node->prev->next = node->next;
- if (node->next == 0) mLast = node->prev;
- else node->next->prev = node->prev;
- return node;
- }
-};
-
-// ----------------------------------------------------------------------------
-
-class Allocation : public MemoryBase {
-public:
- Allocation(const sp<MemoryDealer>& dealer,
- const sp<IMemoryHeap>& heap, ssize_t offset, size_t size);
- virtual ~Allocation();
-private:
- sp<MemoryDealer> mDealer;
-};
-
-// ----------------------------------------------------------------------------
-
-class SimpleBestFitAllocator
-{
- enum {
- PAGE_ALIGNED = 0x00000001
- };
-public:
- SimpleBestFitAllocator(size_t size);
- ~SimpleBestFitAllocator();
-
- size_t allocate(size_t size, uint32_t flags = 0);
- status_t deallocate(size_t offset);
- size_t size() const;
- void dump(const char* what) const;
- void dump(String8& res, const char* what) const;
-
-private:
-
- struct chunk_t {
- chunk_t(size_t start, size_t size)
- : start(start), size(size), free(1), prev(0), next(0) {
- }
- size_t start;
- size_t size : 28;
- int free : 4;
- mutable chunk_t* prev;
- mutable chunk_t* next;
- };
-
- ssize_t alloc(size_t size, uint32_t flags);
- chunk_t* dealloc(size_t start);
- void dump_l(const char* what) const;
- void dump_l(String8& res, const char* what) const;
-
- static const int kMemoryAlign;
- mutable Mutex mLock;
- LinkedList<chunk_t> mList;
- size_t mHeapSize;
-};
-
-// ----------------------------------------------------------------------------
-
-Allocation::Allocation(
- const sp<MemoryDealer>& dealer,
- const sp<IMemoryHeap>& heap, ssize_t offset, size_t size)
- : MemoryBase(heap, offset, size), mDealer(dealer)
-{
-#ifndef NDEBUG
- void* const start_ptr = (void*)(intptr_t(heap->base()) + offset);
- memset(start_ptr, 0xda, size);
-#endif
-}
-
-Allocation::~Allocation()
-{
- size_t freedOffset = getOffset();
- size_t freedSize = getSize();
- if (freedSize) {
- /* NOTE: it's VERY important to not free allocations of size 0 because
- * they're special as they don't have any record in the allocator
- * and could alias some real allocation (their offset is zero). */
-
- // keep the size to unmap in excess
- size_t pagesize = getpagesize();
- size_t start = freedOffset;
- size_t end = start + freedSize;
- start &= ~(pagesize-1);
- end = (end + pagesize-1) & ~(pagesize-1);
-
- // give back to the kernel the pages we don't need
- size_t free_start = freedOffset;
- size_t free_end = free_start + freedSize;
- if (start < free_start)
- start = free_start;
- if (end > free_end)
- end = free_end;
- start = (start + pagesize-1) & ~(pagesize-1);
- end &= ~(pagesize-1);
-
- if (start < end) {
- void* const start_ptr = (void*)(intptr_t(getHeap()->base()) + start);
- size_t size = end-start;
-
-#ifndef NDEBUG
- memset(start_ptr, 0xdf, size);
-#endif
-
- // MADV_REMOVE is not defined on Dapper based Goobuntu
-#ifdef MADV_REMOVE
- if (size) {
- int err = madvise(start_ptr, size, MADV_REMOVE);
- ALOGW_IF(err, "madvise(%p, %u, MADV_REMOVE) returned %s",
- start_ptr, size, err<0 ? strerror(errno) : "Ok");
- }
-#endif
- }
-
- // This should be done after madvise(MADV_REMOVE), otherwise madvise()
- // might kick out the memory region that's allocated and/or written
- // right after the deallocation.
- mDealer->deallocate(freedOffset);
- }
-}
-
-// ----------------------------------------------------------------------------
-
-MemoryDealer::MemoryDealer(size_t size, const char* name)
- : mHeap(new MemoryHeapBase(size, 0, name)),
- mAllocator(new SimpleBestFitAllocator(size))
-{
-}
-
-MemoryDealer::~MemoryDealer()
-{
- delete mAllocator;
-}
-
-sp<IMemory> MemoryDealer::allocate(size_t size)
-{
- sp<IMemory> memory;
- const ssize_t offset = allocator()->allocate(size);
- if (offset >= 0) {
- memory = new Allocation(this, heap(), offset, size);
- }
- return memory;
-}
-
-void MemoryDealer::deallocate(size_t offset)
-{
- allocator()->deallocate(offset);
-}
-
-void MemoryDealer::dump(const char* what) const
-{
- allocator()->dump(what);
-}
-
-const sp<IMemoryHeap>& MemoryDealer::heap() const {
- return mHeap;
-}
-
-SimpleBestFitAllocator* MemoryDealer::allocator() const {
- return mAllocator;
-}
-
-// ----------------------------------------------------------------------------
-
-// align all the memory blocks on a cache-line boundary
-const int SimpleBestFitAllocator::kMemoryAlign = 32;
-
-SimpleBestFitAllocator::SimpleBestFitAllocator(size_t size)
-{
- size_t pagesize = getpagesize();
- mHeapSize = ((size + pagesize-1) & ~(pagesize-1));
-
- chunk_t* node = new chunk_t(0, mHeapSize / kMemoryAlign);
- mList.insertHead(node);
-}
-
-SimpleBestFitAllocator::~SimpleBestFitAllocator()
-{
- while(!mList.isEmpty()) {
- delete mList.remove(mList.head());
- }
-}
-
-size_t SimpleBestFitAllocator::size() const
-{
- return mHeapSize;
-}
-
-size_t SimpleBestFitAllocator::allocate(size_t size, uint32_t flags)
-{
- Mutex::Autolock _l(mLock);
- ssize_t offset = alloc(size, flags);
- return offset;
-}
-
-status_t SimpleBestFitAllocator::deallocate(size_t offset)
-{
- Mutex::Autolock _l(mLock);
- chunk_t const * const freed = dealloc(offset);
- if (freed) {
- return NO_ERROR;
- }
- return NAME_NOT_FOUND;
-}
-
-ssize_t SimpleBestFitAllocator::alloc(size_t size, uint32_t flags)
-{
- if (size == 0) {
- return 0;
- }
- size = (size + kMemoryAlign-1) / kMemoryAlign;
- chunk_t* free_chunk = 0;
- chunk_t* cur = mList.head();
-
- size_t pagesize = getpagesize();
- while (cur) {
- int extra = 0;
- if (flags & PAGE_ALIGNED)
- extra = ( -cur->start & ((pagesize/kMemoryAlign)-1) ) ;
-
- // best fit
- if (cur->free && (cur->size >= (size+extra))) {
- if ((!free_chunk) || (cur->size < free_chunk->size)) {
- free_chunk = cur;
- }
- if (cur->size == size) {
- break;
- }
- }
- cur = cur->next;
- }
-
- if (free_chunk) {
- const size_t free_size = free_chunk->size;
- free_chunk->free = 0;
- free_chunk->size = size;
- if (free_size > size) {
- int extra = 0;
- if (flags & PAGE_ALIGNED)
- extra = ( -free_chunk->start & ((pagesize/kMemoryAlign)-1) ) ;
- if (extra) {
- chunk_t* split = new chunk_t(free_chunk->start, extra);
- free_chunk->start += extra;
- mList.insertBefore(free_chunk, split);
- }
-
- ALOGE_IF((flags&PAGE_ALIGNED) &&
- ((free_chunk->start*kMemoryAlign)&(pagesize-1)),
- "PAGE_ALIGNED requested, but page is not aligned!!!");
-
- const ssize_t tail_free = free_size - (size+extra);
- if (tail_free > 0) {
- chunk_t* split = new chunk_t(
- free_chunk->start + free_chunk->size, tail_free);
- mList.insertAfter(free_chunk, split);
- }
- }
- return (free_chunk->start)*kMemoryAlign;
- }
- return NO_MEMORY;
-}
-
-SimpleBestFitAllocator::chunk_t* SimpleBestFitAllocator::dealloc(size_t start)
-{
- start = start / kMemoryAlign;
- chunk_t* cur = mList.head();
- while (cur) {
- if (cur->start == start) {
- LOG_FATAL_IF(cur->free,
- "block at offset 0x%08lX of size 0x%08lX already freed",
- cur->start*kMemoryAlign, cur->size*kMemoryAlign);
-
- // merge freed blocks together
- chunk_t* freed = cur;
- cur->free = 1;
- do {
- chunk_t* const p = cur->prev;
- chunk_t* const n = cur->next;
- if (p && (p->free || !cur->size)) {
- freed = p;
- p->size += cur->size;
- mList.remove(cur);
- delete cur;
- }
- cur = n;
- } while (cur && cur->free);
-
- #ifndef NDEBUG
- if (!freed->free) {
- dump_l("dealloc (!freed->free)");
- }
- #endif
- LOG_FATAL_IF(!freed->free,
- "freed block at offset 0x%08lX of size 0x%08lX is not free!",
- freed->start * kMemoryAlign, freed->size * kMemoryAlign);
-
- return freed;
- }
- cur = cur->next;
- }
- return 0;
-}
-
-void SimpleBestFitAllocator::dump(const char* what) const
-{
- Mutex::Autolock _l(mLock);
- dump_l(what);
-}
-
-void SimpleBestFitAllocator::dump_l(const char* what) const
-{
- String8 result;
- dump_l(result, what);
- ALOGD("%s", result.string());
-}
-
-void SimpleBestFitAllocator::dump(String8& result,
- const char* what) const
-{
- Mutex::Autolock _l(mLock);
- dump_l(result, what);
-}
-
-void SimpleBestFitAllocator::dump_l(String8& result,
- const char* what) const
-{
- size_t size = 0;
- int32_t i = 0;
- chunk_t const* cur = mList.head();
-
- const size_t SIZE = 256;
- char buffer[SIZE];
- snprintf(buffer, SIZE, " %s (%p, size=%u)\n",
- what, this, (unsigned int)mHeapSize);
-
- result.append(buffer);
-
- while (cur) {
- const char* errs[] = {"", "| link bogus NP",
- "| link bogus PN", "| link bogus NP+PN" };
- int np = ((cur->next) && cur->next->prev != cur) ? 1 : 0;
- int pn = ((cur->prev) && cur->prev->next != cur) ? 2 : 0;
-
- snprintf(buffer, SIZE, " %3u: %08x | 0x%08X | 0x%08X | %s %s\n",
- i, int(cur), int(cur->start*kMemoryAlign),
- int(cur->size*kMemoryAlign),
- int(cur->free) ? "F" : "A",
- errs[np|pn]);
-
- result.append(buffer);
-
- if (!cur->free)
- size += cur->size*kMemoryAlign;
-
- i++;
- cur = cur->next;
- }
- snprintf(buffer, SIZE,
- " size allocated: %u (%u KB)\n", int(size), int(size/1024));
- result.append(buffer);
-}
-
-
-}; // namespace android
diff --git a/libs/binder/MemoryHeapBase.cpp b/libs/binder/MemoryHeapBase.cpp
deleted file mode 100644
index d1cbf1c..0000000
--- a/libs/binder/MemoryHeapBase.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#define LOG_TAG "MemoryHeapBase"
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-
-#include <cutils/log.h>
-#include <cutils/ashmem.h>
-#include <cutils/atomic.h>
-
-#include <binder/MemoryHeapBase.h>
-
-#ifdef HAVE_ANDROID_OS
-#include <linux/android_pmem.h>
-#endif
-
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-MemoryHeapBase::MemoryHeapBase()
- : mFD(-1), mSize(0), mBase(MAP_FAILED),
- mDevice(NULL), mNeedUnmap(false), mOffset(0)
-{
-}
-
-MemoryHeapBase::MemoryHeapBase(size_t size, uint32_t flags, char const * name)
- : mFD(-1), mSize(0), mBase(MAP_FAILED), mFlags(flags),
- mDevice(0), mNeedUnmap(false), mOffset(0)
-{
- const size_t pagesize = getpagesize();
- size = ((size + pagesize-1) & ~(pagesize-1));
- int fd = ashmem_create_region(name == NULL ? "MemoryHeapBase" : name, size);
- ALOGE_IF(fd<0, "error creating ashmem region: %s", strerror(errno));
- if (fd >= 0) {
- if (mapfd(fd, size) == NO_ERROR) {
- if (flags & READ_ONLY) {
- ashmem_set_prot_region(fd, PROT_READ);
- }
- }
- }
-}
-
-MemoryHeapBase::MemoryHeapBase(const char* device, size_t size, uint32_t flags)
- : mFD(-1), mSize(0), mBase(MAP_FAILED), mFlags(flags),
- mDevice(0), mNeedUnmap(false), mOffset(0)
-{
- int open_flags = O_RDWR;
- if (flags & NO_CACHING)
- open_flags |= O_SYNC;
-
- int fd = open(device, open_flags);
- ALOGE_IF(fd<0, "error opening %s: %s", device, strerror(errno));
- if (fd >= 0) {
- const size_t pagesize = getpagesize();
- size = ((size + pagesize-1) & ~(pagesize-1));
- if (mapfd(fd, size) == NO_ERROR) {
- mDevice = device;
- }
- }
-}
-
-MemoryHeapBase::MemoryHeapBase(int fd, size_t size, uint32_t flags, uint32_t offset)
- : mFD(-1), mSize(0), mBase(MAP_FAILED), mFlags(flags),
- mDevice(0), mNeedUnmap(false), mOffset(0)
-{
- const size_t pagesize = getpagesize();
- size = ((size + pagesize-1) & ~(pagesize-1));
- mapfd(dup(fd), size, offset);
-}
-
-status_t MemoryHeapBase::init(int fd, void *base, int size, int flags, const char* device)
-{
- if (mFD != -1) {
- return INVALID_OPERATION;
- }
- mFD = fd;
- mBase = base;
- mSize = size;
- mFlags = flags;
- mDevice = device;
- return NO_ERROR;
-}
-
-status_t MemoryHeapBase::mapfd(int fd, size_t size, uint32_t offset)
-{
- if (size == 0) {
- // try to figure out the size automatically
-#ifdef HAVE_ANDROID_OS
- // first try the PMEM ioctl
- pmem_region reg;
- int err = ioctl(fd, PMEM_GET_TOTAL_SIZE, ®);
- if (err == 0)
- size = reg.len;
-#endif
- if (size == 0) { // try fstat
- struct stat sb;
- if (fstat(fd, &sb) == 0)
- size = sb.st_size;
- }
- // if it didn't work, let mmap() fail.
- }
-
- if ((mFlags & DONT_MAP_LOCALLY) == 0) {
- void* base = (uint8_t*)mmap(0, size,
- PROT_READ|PROT_WRITE, MAP_SHARED, fd, offset);
- if (base == MAP_FAILED) {
- ALOGE("mmap(fd=%d, size=%u) failed (%s)",
- fd, uint32_t(size), strerror(errno));
- close(fd);
- return -errno;
- }
- //ALOGD("mmap(fd=%d, base=%p, size=%lu)", fd, base, size);
- mBase = base;
- mNeedUnmap = true;
- } else {
- mBase = 0; // not MAP_FAILED
- mNeedUnmap = false;
- }
- mFD = fd;
- mSize = size;
- mOffset = offset;
- return NO_ERROR;
-}
-
-MemoryHeapBase::~MemoryHeapBase()
-{
- dispose();
-}
-
-void MemoryHeapBase::dispose()
-{
- int fd = android_atomic_or(-1, &mFD);
- if (fd >= 0) {
- if (mNeedUnmap) {
- //ALOGD("munmap(fd=%d, base=%p, size=%lu)", fd, mBase, mSize);
- munmap(mBase, mSize);
- }
- mBase = 0;
- mSize = 0;
- close(fd);
- }
-}
-
-int MemoryHeapBase::getHeapID() const {
- return mFD;
-}
-
-void* MemoryHeapBase::getBase() const {
- return mBase;
-}
-
-size_t MemoryHeapBase::getSize() const {
- return mSize;
-}
-
-uint32_t MemoryHeapBase::getFlags() const {
- return mFlags;
-}
-
-const char* MemoryHeapBase::getDevice() const {
- return mDevice;
-}
-
-uint32_t MemoryHeapBase::getOffset() const {
- return mOffset;
-}
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
deleted file mode 100644
index dea14bb..0000000
--- a/libs/binder/Parcel.cpp
+++ /dev/null
@@ -1,1590 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#define LOG_TAG "Parcel"
-//#define LOG_NDEBUG 0
-
-#include <binder/Parcel.h>
-
-#include <binder/IPCThreadState.h>
-#include <binder/Binder.h>
-#include <binder/BpBinder.h>
-#include <utils/Debug.h>
-#include <binder/ProcessState.h>
-#include <utils/Log.h>
-#include <utils/String8.h>
-#include <utils/String16.h>
-#include <utils/TextOutput.h>
-#include <utils/misc.h>
-#include <utils/Flattenable.h>
-#include <cutils/ashmem.h>
-
-#include <private/binder/binder_module.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/mman.h>
-
-#ifndef INT32_MAX
-#define INT32_MAX ((int32_t)(2147483647))
-#endif
-
-#define LOG_REFS(...)
-//#define LOG_REFS(...) ALOG(LOG_DEBUG, "Parcel", __VA_ARGS__)
-
-// ---------------------------------------------------------------------------
-
-#define PAD_SIZE(s) (((s)+3)&~3)
-
-// Note: must be kept in sync with android/os/StrictMode.java's PENALTY_GATHER
-#define STRICT_MODE_PENALTY_GATHER 0x100
-
-// Note: must be kept in sync with android/os/Parcel.java's EX_HAS_REPLY_HEADER
-#define EX_HAS_REPLY_HEADER -128
-
-// Maximum size of a blob to transfer in-place.
-static const size_t IN_PLACE_BLOB_LIMIT = 40 * 1024;
-
-// XXX This can be made public if we want to provide
-// support for typed data.
-struct small_flat_data
-{
- uint32_t type;
- uint32_t data;
-};
-
-namespace android {
-
-void acquire_object(const sp<ProcessState>& proc,
- const flat_binder_object& obj, const void* who)
-{
- switch (obj.type) {
- case BINDER_TYPE_BINDER:
- if (obj.binder) {
- LOG_REFS("Parcel %p acquiring reference on local %p", who, obj.cookie);
- static_cast<IBinder*>(obj.cookie)->incStrong(who);
- }
- return;
- case BINDER_TYPE_WEAK_BINDER:
- if (obj.binder)
- static_cast<RefBase::weakref_type*>(obj.binder)->incWeak(who);
- return;
- case BINDER_TYPE_HANDLE: {
- const sp<IBinder> b = proc->getStrongProxyForHandle(obj.handle);
- if (b != NULL) {
- LOG_REFS("Parcel %p acquiring reference on remote %p", who, b.get());
- b->incStrong(who);
- }
- return;
- }
- case BINDER_TYPE_WEAK_HANDLE: {
- const wp<IBinder> b = proc->getWeakProxyForHandle(obj.handle);
- if (b != NULL) b.get_refs()->incWeak(who);
- return;
- }
- case BINDER_TYPE_FD: {
- // intentionally blank -- nothing to do to acquire this, but we do
- // recognize it as a legitimate object type.
- return;
- }
- }
-
- ALOGD("Invalid object type 0x%08lx", obj.type);
-}
-
-void release_object(const sp<ProcessState>& proc,
- const flat_binder_object& obj, const void* who)
-{
- switch (obj.type) {
- case BINDER_TYPE_BINDER:
- if (obj.binder) {
- LOG_REFS("Parcel %p releasing reference on local %p", who, obj.cookie);
- static_cast<IBinder*>(obj.cookie)->decStrong(who);
- }
- return;
- case BINDER_TYPE_WEAK_BINDER:
- if (obj.binder)
- static_cast<RefBase::weakref_type*>(obj.binder)->decWeak(who);
- return;
- case BINDER_TYPE_HANDLE: {
- const sp<IBinder> b = proc->getStrongProxyForHandle(obj.handle);
- if (b != NULL) {
- LOG_REFS("Parcel %p releasing reference on remote %p", who, b.get());
- b->decStrong(who);
- }
- return;
- }
- case BINDER_TYPE_WEAK_HANDLE: {
- const wp<IBinder> b = proc->getWeakProxyForHandle(obj.handle);
- if (b != NULL) b.get_refs()->decWeak(who);
- return;
- }
- case BINDER_TYPE_FD: {
- if (obj.cookie != (void*)0) close(obj.handle);
- return;
- }
- }
-
- ALOGE("Invalid object type 0x%08lx", obj.type);
-}
-
-inline static status_t finish_flatten_binder(
- const sp<IBinder>& binder, const flat_binder_object& flat, Parcel* out)
-{
- return out->writeObject(flat, false);
-}
-
-status_t flatten_binder(const sp<ProcessState>& proc,
- const sp<IBinder>& binder, Parcel* out)
-{
- flat_binder_object obj;
-
- obj.flags = 0x7f | FLAT_BINDER_FLAG_ACCEPTS_FDS;
- if (binder != NULL) {
- IBinder *local = binder->localBinder();
- if (!local) {
- BpBinder *proxy = binder->remoteBinder();
- if (proxy == NULL) {
- ALOGE("null proxy");
- }
- const int32_t handle = proxy ? proxy->handle() : 0;
- obj.type = BINDER_TYPE_HANDLE;
- obj.handle = handle;
- obj.cookie = NULL;
- } else {
- obj.type = BINDER_TYPE_BINDER;
- obj.binder = local->getWeakRefs();
- obj.cookie = local;
- }
- } else {
- obj.type = BINDER_TYPE_BINDER;
- obj.binder = NULL;
- obj.cookie = NULL;
- }
-
- return finish_flatten_binder(binder, obj, out);
-}
-
-status_t flatten_binder(const sp<ProcessState>& proc,
- const wp<IBinder>& binder, Parcel* out)
-{
- flat_binder_object obj;
-
- obj.flags = 0x7f | FLAT_BINDER_FLAG_ACCEPTS_FDS;
- if (binder != NULL) {
- sp<IBinder> real = binder.promote();
- if (real != NULL) {
- IBinder *local = real->localBinder();
- if (!local) {
- BpBinder *proxy = real->remoteBinder();
- if (proxy == NULL) {
- ALOGE("null proxy");
- }
- const int32_t handle = proxy ? proxy->handle() : 0;
- obj.type = BINDER_TYPE_WEAK_HANDLE;
- obj.handle = handle;
- obj.cookie = NULL;
- } else {
- obj.type = BINDER_TYPE_WEAK_BINDER;
- obj.binder = binder.get_refs();
- obj.cookie = binder.unsafe_get();
- }
- return finish_flatten_binder(real, obj, out);
- }
-
- // XXX How to deal? In order to flatten the given binder,
- // we need to probe it for information, which requires a primary
- // reference... but we don't have one.
- //
- // The OpenBinder implementation uses a dynamic_cast<> here,
- // but we can't do that with the different reference counting
- // implementation we are using.
- ALOGE("Unable to unflatten Binder weak reference!");
- obj.type = BINDER_TYPE_BINDER;
- obj.binder = NULL;
- obj.cookie = NULL;
- return finish_flatten_binder(NULL, obj, out);
-
- } else {
- obj.type = BINDER_TYPE_BINDER;
- obj.binder = NULL;
- obj.cookie = NULL;
- return finish_flatten_binder(NULL, obj, out);
- }
-}
-
-inline static status_t finish_unflatten_binder(
- BpBinder* proxy, const flat_binder_object& flat, const Parcel& in)
-{
- return NO_ERROR;
-}
-
-status_t unflatten_binder(const sp<ProcessState>& proc,
- const Parcel& in, sp<IBinder>* out)
-{
- const flat_binder_object* flat = in.readObject(false);
-
- if (flat) {
- switch (flat->type) {
- case BINDER_TYPE_BINDER:
- *out = static_cast<IBinder*>(flat->cookie);
- return finish_unflatten_binder(NULL, *flat, in);
- case BINDER_TYPE_HANDLE:
- *out = proc->getStrongProxyForHandle(flat->handle);
- return finish_unflatten_binder(
- static_cast<BpBinder*>(out->get()), *flat, in);
- }
- }
- return BAD_TYPE;
-}
-
-status_t unflatten_binder(const sp<ProcessState>& proc,
- const Parcel& in, wp<IBinder>* out)
-{
- const flat_binder_object* flat = in.readObject(false);
-
- if (flat) {
- switch (flat->type) {
- case BINDER_TYPE_BINDER:
- *out = static_cast<IBinder*>(flat->cookie);
- return finish_unflatten_binder(NULL, *flat, in);
- case BINDER_TYPE_WEAK_BINDER:
- if (flat->binder != NULL) {
- out->set_object_and_refs(
- static_cast<IBinder*>(flat->cookie),
- static_cast<RefBase::weakref_type*>(flat->binder));
- } else {
- *out = NULL;
- }
- return finish_unflatten_binder(NULL, *flat, in);
- case BINDER_TYPE_HANDLE:
- case BINDER_TYPE_WEAK_HANDLE:
- *out = proc->getWeakProxyForHandle(flat->handle);
- return finish_unflatten_binder(
- static_cast<BpBinder*>(out->unsafe_get()), *flat, in);
- }
- }
- return BAD_TYPE;
-}
-
-// ---------------------------------------------------------------------------
-
-Parcel::Parcel()
-{
- initState();
-}
-
-Parcel::~Parcel()
-{
- freeDataNoInit();
-}
-
-const uint8_t* Parcel::data() const
-{
- return mData;
-}
-
-size_t Parcel::dataSize() const
-{
- return (mDataSize > mDataPos ? mDataSize : mDataPos);
-}
-
-size_t Parcel::dataAvail() const
-{
- // TODO: decide what to do about the possibility that this can
- // report an available-data size that exceeds a Java int's max
- // positive value, causing havoc. Fortunately this will only
- // happen if someone constructs a Parcel containing more than two
- // gigabytes of data, which on typical phone hardware is simply
- // not possible.
- return dataSize() - dataPosition();
-}
-
-size_t Parcel::dataPosition() const
-{
- return mDataPos;
-}
-
-size_t Parcel::dataCapacity() const
-{
- return mDataCapacity;
-}
-
-status_t Parcel::setDataSize(size_t size)
-{
- status_t err;
- err = continueWrite(size);
- if (err == NO_ERROR) {
- mDataSize = size;
- ALOGV("setDataSize Setting data size of %p to %d\n", this, mDataSize);
- }
- return err;
-}
-
-void Parcel::setDataPosition(size_t pos) const
-{
- mDataPos = pos;
- mNextObjectHint = 0;
-}
-
-status_t Parcel::setDataCapacity(size_t size)
-{
- if (size > mDataCapacity) return continueWrite(size);
- return NO_ERROR;
-}
-
-status_t Parcel::setData(const uint8_t* buffer, size_t len)
-{
- status_t err = restartWrite(len);
- if (err == NO_ERROR) {
- memcpy(const_cast<uint8_t*>(data()), buffer, len);
- mDataSize = len;
- mFdsKnown = false;
- }
- return err;
-}
-
-status_t Parcel::appendFrom(const Parcel *parcel, size_t offset, size_t len)
-{
- const sp<ProcessState> proc(ProcessState::self());
- status_t err;
- const uint8_t *data = parcel->mData;
- const size_t *objects = parcel->mObjects;
- size_t size = parcel->mObjectsSize;
- int startPos = mDataPos;
- int firstIndex = -1, lastIndex = -2;
-
- if (len == 0) {
- return NO_ERROR;
- }
-
- // range checks against the source parcel size
- if ((offset > parcel->mDataSize)
- || (len > parcel->mDataSize)
- || (offset + len > parcel->mDataSize)) {
- return BAD_VALUE;
- }
-
- // Count objects in range
- for (int i = 0; i < (int) size; i++) {
- size_t off = objects[i];
- if ((off >= offset) && (off < offset + len)) {
- if (firstIndex == -1) {
- firstIndex = i;
- }
- lastIndex = i;
- }
- }
- int numObjects = lastIndex - firstIndex + 1;
-
- if ((mDataSize+len) > mDataCapacity) {
- // grow data
- err = growData(len);
- if (err != NO_ERROR) {
- return err;
- }
- }
-
- // append data
- memcpy(mData + mDataPos, data + offset, len);
- mDataPos += len;
- mDataSize += len;
-
- err = NO_ERROR;
-
- if (numObjects > 0) {
- // grow objects
- if (mObjectsCapacity < mObjectsSize + numObjects) {
- int newSize = ((mObjectsSize + numObjects)*3)/2;
- size_t *objects =
- (size_t*)realloc(mObjects, newSize*sizeof(size_t));
- if (objects == (size_t*)0) {
- return NO_MEMORY;
- }
- mObjects = objects;
- mObjectsCapacity = newSize;
- }
-
- // append and acquire objects
- int idx = mObjectsSize;
- for (int i = firstIndex; i <= lastIndex; i++) {
- size_t off = objects[i] - offset + startPos;
- mObjects[idx++] = off;
- mObjectsSize++;
-
- flat_binder_object* flat
- = reinterpret_cast<flat_binder_object*>(mData + off);
- acquire_object(proc, *flat, this);
-
- if (flat->type == BINDER_TYPE_FD) {
- // If this is a file descriptor, we need to dup it so the
- // new Parcel now owns its own fd, and can declare that we
- // officially know we have fds.
- flat->handle = dup(flat->handle);
- flat->cookie = (void*)1;
- mHasFds = mFdsKnown = true;
- if (!mAllowFds) {
- err = FDS_NOT_ALLOWED;
- }
- }
- }
- }
-
- return err;
-}
-
-bool Parcel::pushAllowFds(bool allowFds)
-{
- const bool origValue = mAllowFds;
- if (!allowFds) {
- mAllowFds = false;
- }
- return origValue;
-}
-
-void Parcel::restoreAllowFds(bool lastValue)
-{
- mAllowFds = lastValue;
-}
-
-bool Parcel::hasFileDescriptors() const
-{
- if (!mFdsKnown) {
- scanForFds();
- }
- return mHasFds;
-}
-
-// Write RPC headers. (previously just the interface token)
-status_t Parcel::writeInterfaceToken(const String16& interface)
-{
- writeInt32(IPCThreadState::self()->getStrictModePolicy() |
- STRICT_MODE_PENALTY_GATHER);
- // currently the interface identification token is just its name as a string
- return writeString16(interface);
-}
-
-bool Parcel::checkInterface(IBinder* binder) const
-{
- return enforceInterface(binder->getInterfaceDescriptor());
-}
-
-bool Parcel::enforceInterface(const String16& interface,
- IPCThreadState* threadState) const
-{
- int32_t strictPolicy = readInt32();
- if (threadState == NULL) {
- threadState = IPCThreadState::self();
- }
- if ((threadState->getLastTransactionBinderFlags() &
- IBinder::FLAG_ONEWAY) != 0) {
- // For one-way calls, the callee is running entirely
- // disconnected from the caller, so disable StrictMode entirely.
- // Not only does disk/network usage not impact the caller, but
- // there's no way to commuicate back any violations anyway.
- threadState->setStrictModePolicy(0);
- } else {
- threadState->setStrictModePolicy(strictPolicy);
- }
- const String16 str(readString16());
- if (str == interface) {
- return true;
- } else {
- ALOGW("**** enforceInterface() expected '%s' but read '%s'\n",
- String8(interface).string(), String8(str).string());
- return false;
- }
-}
-
-const size_t* Parcel::objects() const
-{
- return mObjects;
-}
-
-size_t Parcel::objectsCount() const
-{
- return mObjectsSize;
-}
-
-status_t Parcel::errorCheck() const
-{
- return mError;
-}
-
-void Parcel::setError(status_t err)
-{
- mError = err;
-}
-
-status_t Parcel::finishWrite(size_t len)
-{
- //printf("Finish write of %d\n", len);
- mDataPos += len;
- ALOGV("finishWrite Setting data pos of %p to %d\n", this, mDataPos);
- if (mDataPos > mDataSize) {
- mDataSize = mDataPos;
- ALOGV("finishWrite Setting data size of %p to %d\n", this, mDataSize);
- }
- //printf("New pos=%d, size=%d\n", mDataPos, mDataSize);
- return NO_ERROR;
-}
-
-status_t Parcel::writeUnpadded(const void* data, size_t len)
-{
- size_t end = mDataPos + len;
- if (end < mDataPos) {
- // integer overflow
- return BAD_VALUE;
- }
-
- if (end <= mDataCapacity) {
-restart_write:
- memcpy(mData+mDataPos, data, len);
- return finishWrite(len);
- }
-
- status_t err = growData(len);
- if (err == NO_ERROR) goto restart_write;
- return err;
-}
-
-status_t Parcel::write(const void* data, size_t len)
-{
- void* const d = writeInplace(len);
- if (d) {
- memcpy(d, data, len);
- return NO_ERROR;
- }
- return mError;
-}
-
-void* Parcel::writeInplace(size_t len)
-{
- const size_t padded = PAD_SIZE(len);
-
- // sanity check for integer overflow
- if (mDataPos+padded < mDataPos) {
- return NULL;
- }
-
- if ((mDataPos+padded) <= mDataCapacity) {
-restart_write:
- //printf("Writing %ld bytes, padded to %ld\n", len, padded);
- uint8_t* const data = mData+mDataPos;
-
- // Need to pad at end?
- if (padded != len) {
-#if BYTE_ORDER == BIG_ENDIAN
- static const uint32_t mask[4] = {
- 0x00000000, 0xffffff00, 0xffff0000, 0xff000000
- };
-#endif
-#if BYTE_ORDER == LITTLE_ENDIAN
- static const uint32_t mask[4] = {
- 0x00000000, 0x00ffffff, 0x0000ffff, 0x000000ff
- };
-#endif
- //printf("Applying pad mask: %p to %p\n", (void*)mask[padded-len],
- // *reinterpret_cast<void**>(data+padded-4));
- *reinterpret_cast<uint32_t*>(data+padded-4) &= mask[padded-len];
- }
-
- finishWrite(padded);
- return data;
- }
-
- status_t err = growData(padded);
- if (err == NO_ERROR) goto restart_write;
- return NULL;
-}
-
-status_t Parcel::writeInt32(int32_t val)
-{
- return writeAligned(val);
-}
-
-status_t Parcel::writeInt64(int64_t val)
-{
- return writeAligned(val);
-}
-
-status_t Parcel::writeFloat(float val)
-{
- return writeAligned(val);
-}
-
-status_t Parcel::writeDouble(double val)
-{
- return writeAligned(val);
-}
-
-status_t Parcel::writeIntPtr(intptr_t val)
-{
- return writeAligned(val);
-}
-
-status_t Parcel::writeCString(const char* str)
-{
- return write(str, strlen(str)+1);
-}
-
-status_t Parcel::writeString8(const String8& str)
-{
- status_t err = writeInt32(str.bytes());
- // only write string if its length is more than zero characters,
- // as readString8 will only read if the length field is non-zero.
- // this is slightly different from how writeString16 works.
- if (str.bytes() > 0 && err == NO_ERROR) {
- err = write(str.string(), str.bytes()+1);
- }
- return err;
-}
-
-status_t Parcel::writeString16(const String16& str)
-{
- return writeString16(str.string(), str.size());
-}
-
-status_t Parcel::writeString16(const char16_t* str, size_t len)
-{
- if (str == NULL) return writeInt32(-1);
-
- status_t err = writeInt32(len);
- if (err == NO_ERROR) {
- len *= sizeof(char16_t);
- uint8_t* data = (uint8_t*)writeInplace(len+sizeof(char16_t));
- if (data) {
- memcpy(data, str, len);
- *reinterpret_cast<char16_t*>(data+len) = 0;
- return NO_ERROR;
- }
- err = mError;
- }
- return err;
-}
-
-status_t Parcel::writeStrongBinder(const sp<IBinder>& val)
-{
- return flatten_binder(ProcessState::self(), val, this);
-}
-
-status_t Parcel::writeWeakBinder(const wp<IBinder>& val)
-{
- return flatten_binder(ProcessState::self(), val, this);
-}
-
-status_t Parcel::writeNativeHandle(const native_handle* handle)
-{
- if (!handle || handle->version != sizeof(native_handle))
- return BAD_TYPE;
-
- status_t err;
- err = writeInt32(handle->numFds);
- if (err != NO_ERROR) return err;
-
- err = writeInt32(handle->numInts);
- if (err != NO_ERROR) return err;
-
- for (int i=0 ; err==NO_ERROR && i<handle->numFds ; i++)
- err = writeDupFileDescriptor(handle->data[i]);
-
- if (err != NO_ERROR) {
- ALOGD("write native handle, write dup fd failed");
- return err;
- }
- err = write(handle->data + handle->numFds, sizeof(int)*handle->numInts);
- return err;
-}
-
-status_t Parcel::writeFileDescriptor(int fd, bool takeOwnership)
-{
- flat_binder_object obj;
- obj.type = BINDER_TYPE_FD;
- obj.flags = 0x7f | FLAT_BINDER_FLAG_ACCEPTS_FDS;
- obj.handle = fd;
- obj.cookie = (void*) (takeOwnership ? 1 : 0);
- return writeObject(obj, true);
-}
-
-status_t Parcel::writeDupFileDescriptor(int fd)
-{
- int dupFd = dup(fd);
- if (dupFd < 0) {
- return -errno;
- }
- status_t err = writeFileDescriptor(dupFd, true /*takeOwnership*/);
- if (err) {
- close(dupFd);
- }
- return err;
-}
-
-status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob)
-{
- status_t status;
-
- if (!mAllowFds || len <= IN_PLACE_BLOB_LIMIT) {
- ALOGV("writeBlob: write in place");
- status = writeInt32(0);
- if (status) return status;
-
- void* ptr = writeInplace(len);
- if (!ptr) return NO_MEMORY;
-
- outBlob->init(false /*mapped*/, ptr, len);
- return NO_ERROR;
- }
-
- ALOGV("writeBlob: write to ashmem");
- int fd = ashmem_create_region("Parcel Blob", len);
- if (fd < 0) return NO_MEMORY;
-
- int result = ashmem_set_prot_region(fd, PROT_READ | PROT_WRITE);
- if (result < 0) {
- status = result;
- } else {
- void* ptr = ::mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (ptr == MAP_FAILED) {
- status = -errno;
- } else {
- result = ashmem_set_prot_region(fd, PROT_READ);
- if (result < 0) {
- status = result;
- } else {
- status = writeInt32(1);
- if (!status) {
- status = writeFileDescriptor(fd, true /*takeOwnership*/);
- if (!status) {
- outBlob->init(true /*mapped*/, ptr, len);
- return NO_ERROR;
- }
- }
- }
- }
- ::munmap(ptr, len);
- }
- ::close(fd);
- return status;
-}
-
-status_t Parcel::write(const Flattenable& val)
-{
- status_t err;
-
- // size if needed
- size_t len = val.getFlattenedSize();
- size_t fd_count = val.getFdCount();
-
- err = this->writeInt32(len);
- if (err) return err;
-
- err = this->writeInt32(fd_count);
- if (err) return err;
-
- // payload
- void* buf = this->writeInplace(PAD_SIZE(len));
- if (buf == NULL)
- return BAD_VALUE;
-
- int* fds = NULL;
- if (fd_count) {
- fds = new int[fd_count];
- }
-
- err = val.flatten(buf, len, fds, fd_count);
- for (size_t i=0 ; i<fd_count && err==NO_ERROR ; i++) {
- err = this->writeDupFileDescriptor( fds[i] );
- }
-
- if (fd_count) {
- delete [] fds;
- }
-
- return err;
-}
-
-status_t Parcel::writeObject(const flat_binder_object& val, bool nullMetaData)
-{
- const bool enoughData = (mDataPos+sizeof(val)) <= mDataCapacity;
- const bool enoughObjects = mObjectsSize < mObjectsCapacity;
- if (enoughData && enoughObjects) {
-restart_write:
- *reinterpret_cast<flat_binder_object*>(mData+mDataPos) = val;
-
- // Need to write meta-data?
- if (nullMetaData || val.binder != NULL) {
- mObjects[mObjectsSize] = mDataPos;
- acquire_object(ProcessState::self(), val, this);
- mObjectsSize++;
- }
-
- // remember if it's a file descriptor
- if (val.type == BINDER_TYPE_FD) {
- if (!mAllowFds) {
- return FDS_NOT_ALLOWED;
- }
- mHasFds = mFdsKnown = true;
- }
-
- return finishWrite(sizeof(flat_binder_object));
- }
-
- if (!enoughData) {
- const status_t err = growData(sizeof(val));
- if (err != NO_ERROR) return err;
- }
- if (!enoughObjects) {
- size_t newSize = ((mObjectsSize+2)*3)/2;
- size_t* objects = (size_t*)realloc(mObjects, newSize*sizeof(size_t));
- if (objects == NULL) return NO_MEMORY;
- mObjects = objects;
- mObjectsCapacity = newSize;
- }
-
- goto restart_write;
-}
-
-status_t Parcel::writeNoException()
-{
- return writeInt32(0);
-}
-
-void Parcel::remove(size_t start, size_t amt)
-{
- LOG_ALWAYS_FATAL("Parcel::remove() not yet implemented!");
-}
-
-status_t Parcel::read(void* outData, size_t len) const
-{
- if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) {
- memcpy(outData, mData+mDataPos, len);
- mDataPos += PAD_SIZE(len);
- ALOGV("read Setting data pos of %p to %d\n", this, mDataPos);
- return NO_ERROR;
- }
- return NOT_ENOUGH_DATA;
-}
-
-const void* Parcel::readInplace(size_t len) const
-{
- if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) {
- const void* data = mData+mDataPos;
- mDataPos += PAD_SIZE(len);
- ALOGV("readInplace Setting data pos of %p to %d\n", this, mDataPos);
- return data;
- }
- return NULL;
-}
-
-template<class T>
-status_t Parcel::readAligned(T *pArg) const {
- COMPILE_TIME_ASSERT_FUNCTION_SCOPE(PAD_SIZE(sizeof(T)) == sizeof(T));
-
- if ((mDataPos+sizeof(T)) <= mDataSize) {
- const void* data = mData+mDataPos;
- mDataPos += sizeof(T);
- *pArg = *reinterpret_cast<const T*>(data);
- return NO_ERROR;
- } else {
- return NOT_ENOUGH_DATA;
- }
-}
-
-template<class T>
-T Parcel::readAligned() const {
- T result;
- if (readAligned(&result) != NO_ERROR) {
- result = 0;
- }
-
- return result;
-}
-
-template<class T>
-status_t Parcel::writeAligned(T val) {
- COMPILE_TIME_ASSERT_FUNCTION_SCOPE(PAD_SIZE(sizeof(T)) == sizeof(T));
-
- if ((mDataPos+sizeof(val)) <= mDataCapacity) {
-restart_write:
- *reinterpret_cast<T*>(mData+mDataPos) = val;
- return finishWrite(sizeof(val));
- }
-
- status_t err = growData(sizeof(val));
- if (err == NO_ERROR) goto restart_write;
- return err;
-}
-
-status_t Parcel::readInt32(int32_t *pArg) const
-{
- return readAligned(pArg);
-}
-
-int32_t Parcel::readInt32() const
-{
- return readAligned<int32_t>();
-}
-
-
-status_t Parcel::readInt64(int64_t *pArg) const
-{
- return readAligned(pArg);
-}
-
-
-int64_t Parcel::readInt64() const
-{
- return readAligned<int64_t>();
-}
-
-status_t Parcel::readFloat(float *pArg) const
-{
- return readAligned(pArg);
-}
-
-
-float Parcel::readFloat() const
-{
- return readAligned<float>();
-}
-
-status_t Parcel::readDouble(double *pArg) const
-{
- return readAligned(pArg);
-}
-
-
-double Parcel::readDouble() const
-{
- return readAligned<double>();
-}
-
-status_t Parcel::readIntPtr(intptr_t *pArg) const
-{
- return readAligned(pArg);
-}
-
-
-intptr_t Parcel::readIntPtr() const
-{
- return readAligned<intptr_t>();
-}
-
-
-const char* Parcel::readCString() const
-{
- const size_t avail = mDataSize-mDataPos;
- if (avail > 0) {
- const char* str = reinterpret_cast<const char*>(mData+mDataPos);
- // is the string's trailing NUL within the parcel's valid bounds?
- const char* eos = reinterpret_cast<const char*>(memchr(str, 0, avail));
- if (eos) {
- const size_t len = eos - str;
- mDataPos += PAD_SIZE(len+1);
- ALOGV("readCString Setting data pos of %p to %d\n", this, mDataPos);
- return str;
- }
- }
- return NULL;
-}
-
-String8 Parcel::readString8() const
-{
- int32_t size = readInt32();
- // watch for potential int overflow adding 1 for trailing NUL
- if (size > 0 && size < INT32_MAX) {
- const char* str = (const char*)readInplace(size+1);
- if (str) return String8(str, size);
- }
- return String8();
-}
-
-String16 Parcel::readString16() const
-{
- size_t len;
- const char16_t* str = readString16Inplace(&len);
- if (str) return String16(str, len);
- ALOGE("Reading a NULL string not supported here.");
- return String16();
-}
-
-const char16_t* Parcel::readString16Inplace(size_t* outLen) const
-{
- int32_t size = readInt32();
- // watch for potential int overflow from size+1
- if (size >= 0 && size < INT32_MAX) {
- *outLen = size;
- const char16_t* str = (const char16_t*)readInplace((size+1)*sizeof(char16_t));
- if (str != NULL) {
- return str;
- }
- }
- *outLen = 0;
- return NULL;
-}
-
-sp<IBinder> Parcel::readStrongBinder() const
-{
- sp<IBinder> val;
- unflatten_binder(ProcessState::self(), *this, &val);
- return val;
-}
-
-wp<IBinder> Parcel::readWeakBinder() const
-{
- wp<IBinder> val;
- unflatten_binder(ProcessState::self(), *this, &val);
- return val;
-}
-
-int32_t Parcel::readExceptionCode() const
-{
- int32_t exception_code = readAligned<int32_t>();
- if (exception_code == EX_HAS_REPLY_HEADER) {
- int32_t header_size = readAligned<int32_t>();
- // Skip over fat responses headers. Not used (or propagated) in
- // native code
- setDataPosition(dataPosition() + header_size);
- // And fat response headers are currently only used when there are no
- // exceptions, so return no error:
- return 0;
- }
- return exception_code;
-}
-
-native_handle* Parcel::readNativeHandle() const
-{
- int numFds, numInts;
- status_t err;
- err = readInt32(&numFds);
- if (err != NO_ERROR) return 0;
- err = readInt32(&numInts);
- if (err != NO_ERROR) return 0;
-
- native_handle* h = native_handle_create(numFds, numInts);
- for (int i=0 ; err==NO_ERROR && i<numFds ; i++) {
- h->data[i] = dup(readFileDescriptor());
- if (h->data[i] < 0) err = BAD_VALUE;
- }
- err = read(h->data + numFds, sizeof(int)*numInts);
- if (err != NO_ERROR) {
- native_handle_close(h);
- native_handle_delete(h);
- h = 0;
- }
- return h;
-}
-
-
-int Parcel::readFileDescriptor() const
-{
- const flat_binder_object* flat = readObject(true);
- if (flat) {
- switch (flat->type) {
- case BINDER_TYPE_FD:
- //ALOGI("Returning file descriptor %ld from parcel %p\n", flat->handle, this);
- return flat->handle;
- }
- }
- return BAD_TYPE;
-}
-
-status_t Parcel::readBlob(size_t len, ReadableBlob* outBlob) const
-{
- int32_t useAshmem;
- status_t status = readInt32(&useAshmem);
- if (status) return status;
-
- if (!useAshmem) {
- ALOGV("readBlob: read in place");
- const void* ptr = readInplace(len);
- if (!ptr) return BAD_VALUE;
-
- outBlob->init(false /*mapped*/, const_cast<void*>(ptr), len);
- return NO_ERROR;
- }
-
- ALOGV("readBlob: read from ashmem");
- int fd = readFileDescriptor();
- if (fd == int(BAD_TYPE)) return BAD_VALUE;
-
- void* ptr = ::mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
- if (!ptr) return NO_MEMORY;
-
- outBlob->init(true /*mapped*/, ptr, len);
- return NO_ERROR;
-}
-
-status_t Parcel::read(Flattenable& val) const
-{
- // size
- const size_t len = this->readInt32();
- const size_t fd_count = this->readInt32();
-
- // payload
- void const* buf = this->readInplace(PAD_SIZE(len));
- if (buf == NULL)
- return BAD_VALUE;
-
- int* fds = NULL;
- if (fd_count) {
- fds = new int[fd_count];
- }
-
- status_t err = NO_ERROR;
- for (size_t i=0 ; i<fd_count && err==NO_ERROR ; i++) {
- fds[i] = dup(this->readFileDescriptor());
- if (fds[i] < 0) err = BAD_VALUE;
- }
-
- if (err == NO_ERROR) {
- err = val.unflatten(buf, len, fds, fd_count);
- }
-
- if (fd_count) {
- delete [] fds;
- }
-
- return err;
-}
-const flat_binder_object* Parcel::readObject(bool nullMetaData) const
-{
- const size_t DPOS = mDataPos;
- if ((DPOS+sizeof(flat_binder_object)) <= mDataSize) {
- const flat_binder_object* obj
- = reinterpret_cast<const flat_binder_object*>(mData+DPOS);
- mDataPos = DPOS + sizeof(flat_binder_object);
- if (!nullMetaData && (obj->cookie == NULL && obj->binder == NULL)) {
- // When transferring a NULL object, we don't write it into
- // the object list, so we don't want to check for it when
- // reading.
- ALOGV("readObject Setting data pos of %p to %d\n", this, mDataPos);
- return obj;
- }
-
- // Ensure that this object is valid...
- size_t* const OBJS = mObjects;
- const size_t N = mObjectsSize;
- size_t opos = mNextObjectHint;
-
- if (N > 0) {
- ALOGV("Parcel %p looking for obj at %d, hint=%d\n",
- this, DPOS, opos);
-
- // Start at the current hint position, looking for an object at
- // the current data position.
- if (opos < N) {
- while (opos < (N-1) && OBJS[opos] < DPOS) {
- opos++;
- }
- } else {
- opos = N-1;
- }
- if (OBJS[opos] == DPOS) {
- // Found it!
- ALOGV("Parcel found obj %d at index %d with forward search",
- this, DPOS, opos);
- mNextObjectHint = opos+1;
- ALOGV("readObject Setting data pos of %p to %d\n", this, mDataPos);
- return obj;
- }
-
- // Look backwards for it...
- while (opos > 0 && OBJS[opos] > DPOS) {
- opos--;
- }
- if (OBJS[opos] == DPOS) {
- // Found it!
- ALOGV("Parcel found obj %d at index %d with backward search",
- this, DPOS, opos);
- mNextObjectHint = opos+1;
- ALOGV("readObject Setting data pos of %p to %d\n", this, mDataPos);
- return obj;
- }
- }
- ALOGW("Attempt to read object from Parcel %p at offset %d that is not in the object list",
- this, DPOS);
- }
- return NULL;
-}
-
-void Parcel::closeFileDescriptors()
-{
- size_t i = mObjectsSize;
- if (i > 0) {
- //ALOGI("Closing file descriptors for %d objects...", mObjectsSize);
- }
- while (i > 0) {
- i--;
- const flat_binder_object* flat
- = reinterpret_cast<flat_binder_object*>(mData+mObjects[i]);
- if (flat->type == BINDER_TYPE_FD) {
- //ALOGI("Closing fd: %ld\n", flat->handle);
- close(flat->handle);
- }
- }
-}
-
-const uint8_t* Parcel::ipcData() const
-{
- return mData;
-}
-
-size_t Parcel::ipcDataSize() const
-{
- return (mDataSize > mDataPos ? mDataSize : mDataPos);
-}
-
-const size_t* Parcel::ipcObjects() const
-{
- return mObjects;
-}
-
-size_t Parcel::ipcObjectsCount() const
-{
- return mObjectsSize;
-}
-
-void Parcel::ipcSetDataReference(const uint8_t* data, size_t dataSize,
- const size_t* objects, size_t objectsCount, release_func relFunc, void* relCookie)
-{
- freeDataNoInit();
- mError = NO_ERROR;
- mData = const_cast<uint8_t*>(data);
- mDataSize = mDataCapacity = dataSize;
- //ALOGI("setDataReference Setting data size of %p to %lu (pid=%d)\n", this, mDataSize, getpid());
- mDataPos = 0;
- ALOGV("setDataReference Setting data pos of %p to %d\n", this, mDataPos);
- mObjects = const_cast<size_t*>(objects);
- mObjectsSize = mObjectsCapacity = objectsCount;
- mNextObjectHint = 0;
- mOwner = relFunc;
- mOwnerCookie = relCookie;
- scanForFds();
-}
-
-void Parcel::print(TextOutput& to, uint32_t flags) const
-{
- to << "Parcel(";
-
- if (errorCheck() != NO_ERROR) {
- const status_t err = errorCheck();
- to << "Error: " << (void*)err << " \"" << strerror(-err) << "\"";
- } else if (dataSize() > 0) {
- const uint8_t* DATA = data();
- to << indent << HexDump(DATA, dataSize()) << dedent;
- const size_t* OBJS = objects();
- const size_t N = objectsCount();
- for (size_t i=0; i<N; i++) {
- const flat_binder_object* flat
- = reinterpret_cast<const flat_binder_object*>(DATA+OBJS[i]);
- to << endl << "Object #" << i << " @ " << (void*)OBJS[i] << ": "
- << TypeCode(flat->type & 0x7f7f7f00)
- << " = " << flat->binder;
- }
- } else {
- to << "NULL";
- }
-
- to << ")";
-}
-
-void Parcel::releaseObjects()
-{
- const sp<ProcessState> proc(ProcessState::self());
- size_t i = mObjectsSize;
- uint8_t* const data = mData;
- size_t* const objects = mObjects;
- while (i > 0) {
- i--;
- const flat_binder_object* flat
- = reinterpret_cast<flat_binder_object*>(data+objects[i]);
- release_object(proc, *flat, this);
- }
-}
-
-void Parcel::acquireObjects()
-{
- const sp<ProcessState> proc(ProcessState::self());
- size_t i = mObjectsSize;
- uint8_t* const data = mData;
- size_t* const objects = mObjects;
- while (i > 0) {
- i--;
- const flat_binder_object* flat
- = reinterpret_cast<flat_binder_object*>(data+objects[i]);
- acquire_object(proc, *flat, this);
- }
-}
-
-void Parcel::freeData()
-{
- freeDataNoInit();
- initState();
-}
-
-void Parcel::freeDataNoInit()
-{
- if (mOwner) {
- //ALOGI("Freeing data ref of %p (pid=%d)\n", this, getpid());
- mOwner(this, mData, mDataSize, mObjects, mObjectsSize, mOwnerCookie);
- } else {
- releaseObjects();
- if (mData) free(mData);
- if (mObjects) free(mObjects);
- }
-}
-
-status_t Parcel::growData(size_t len)
-{
- size_t newSize = ((mDataSize+len)*3)/2;
- return (newSize <= mDataSize)
- ? (status_t) NO_MEMORY
- : continueWrite(newSize);
-}
-
-status_t Parcel::restartWrite(size_t desired)
-{
- if (mOwner) {
- freeData();
- return continueWrite(desired);
- }
-
- uint8_t* data = (uint8_t*)realloc(mData, desired);
- if (!data && desired > mDataCapacity) {
- mError = NO_MEMORY;
- return NO_MEMORY;
- }
-
- releaseObjects();
-
- if (data) {
- mData = data;
- mDataCapacity = desired;
- }
-
- mDataSize = mDataPos = 0;
- ALOGV("restartWrite Setting data size of %p to %d\n", this, mDataSize);
- ALOGV("restartWrite Setting data pos of %p to %d\n", this, mDataPos);
-
- free(mObjects);
- mObjects = NULL;
- mObjectsSize = mObjectsCapacity = 0;
- mNextObjectHint = 0;
- mHasFds = false;
- mFdsKnown = true;
- mAllowFds = true;
-
- return NO_ERROR;
-}
-
-status_t Parcel::continueWrite(size_t desired)
-{
- // If shrinking, first adjust for any objects that appear
- // after the new data size.
- size_t objectsSize = mObjectsSize;
- if (desired < mDataSize) {
- if (desired == 0) {
- objectsSize = 0;
- } else {
- while (objectsSize > 0) {
- if (mObjects[objectsSize-1] < desired)
- break;
- objectsSize--;
- }
- }
- }
-
- if (mOwner) {
- // If the size is going to zero, just release the owner's data.
- if (desired == 0) {
- freeData();
- return NO_ERROR;
- }
-
- // If there is a different owner, we need to take
- // posession.
- uint8_t* data = (uint8_t*)malloc(desired);
- if (!data) {
- mError = NO_MEMORY;
- return NO_MEMORY;
- }
- size_t* objects = NULL;
-
- if (objectsSize) {
- objects = (size_t*)malloc(objectsSize*sizeof(size_t));
- if (!objects) {
- mError = NO_MEMORY;
- return NO_MEMORY;
- }
-
- // Little hack to only acquire references on objects
- // we will be keeping.
- size_t oldObjectsSize = mObjectsSize;
- mObjectsSize = objectsSize;
- acquireObjects();
- mObjectsSize = oldObjectsSize;
- }
-
- if (mData) {
- memcpy(data, mData, mDataSize < desired ? mDataSize : desired);
- }
- if (objects && mObjects) {
- memcpy(objects, mObjects, objectsSize*sizeof(size_t));
- }
- //ALOGI("Freeing data ref of %p (pid=%d)\n", this, getpid());
- mOwner(this, mData, mDataSize, mObjects, mObjectsSize, mOwnerCookie);
- mOwner = NULL;
-
- mData = data;
- mObjects = objects;
- mDataSize = (mDataSize < desired) ? mDataSize : desired;
- ALOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize);
- mDataCapacity = desired;
- mObjectsSize = mObjectsCapacity = objectsSize;
- mNextObjectHint = 0;
-
- } else if (mData) {
- if (objectsSize < mObjectsSize) {
- // Need to release refs on any objects we are dropping.
- const sp<ProcessState> proc(ProcessState::self());
- for (size_t i=objectsSize; i<mObjectsSize; i++) {
- const flat_binder_object* flat
- = reinterpret_cast<flat_binder_object*>(mData+mObjects[i]);
- if (flat->type == BINDER_TYPE_FD) {
- // will need to rescan because we may have lopped off the only FDs
- mFdsKnown = false;
- }
- release_object(proc, *flat, this);
- }
- size_t* objects =
- (size_t*)realloc(mObjects, objectsSize*sizeof(size_t));
- if (objects) {
- mObjects = objects;
- }
- mObjectsSize = objectsSize;
- mNextObjectHint = 0;
- }
-
- // We own the data, so we can just do a realloc().
- if (desired > mDataCapacity) {
- uint8_t* data = (uint8_t*)realloc(mData, desired);
- if (data) {
- mData = data;
- mDataCapacity = desired;
- } else if (desired > mDataCapacity) {
- mError = NO_MEMORY;
- return NO_MEMORY;
- }
- } else {
- if (mDataSize > desired) {
- mDataSize = desired;
- ALOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize);
- }
- if (mDataPos > desired) {
- mDataPos = desired;
- ALOGV("continueWrite Setting data pos of %p to %d\n", this, mDataPos);
- }
- }
-
- } else {
- // This is the first data. Easy!
- uint8_t* data = (uint8_t*)malloc(desired);
- if (!data) {
- mError = NO_MEMORY;
- return NO_MEMORY;
- }
-
- if(!(mDataCapacity == 0 && mObjects == NULL
- && mObjectsCapacity == 0)) {
- ALOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired);
- }
-
- mData = data;
- mDataSize = mDataPos = 0;
- ALOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize);
- ALOGV("continueWrite Setting data pos of %p to %d\n", this, mDataPos);
- mDataCapacity = desired;
- }
-
- return NO_ERROR;
-}
-
-void Parcel::initState()
-{
- mError = NO_ERROR;
- mData = 0;
- mDataSize = 0;
- mDataCapacity = 0;
- mDataPos = 0;
- ALOGV("initState Setting data size of %p to %d\n", this, mDataSize);
- ALOGV("initState Setting data pos of %p to %d\n", this, mDataPos);
- mObjects = NULL;
- mObjectsSize = 0;
- mObjectsCapacity = 0;
- mNextObjectHint = 0;
- mHasFds = false;
- mFdsKnown = true;
- mAllowFds = true;
- mOwner = NULL;
-}
-
-void Parcel::scanForFds() const
-{
- bool hasFds = false;
- for (size_t i=0; i<mObjectsSize; i++) {
- const flat_binder_object* flat
- = reinterpret_cast<const flat_binder_object*>(mData + mObjects[i]);
- if (flat->type == BINDER_TYPE_FD) {
- hasFds = true;
- break;
- }
- }
- mHasFds = hasFds;
- mFdsKnown = true;
-}
-
-// --- Parcel::Blob ---
-
-Parcel::Blob::Blob() :
- mMapped(false), mData(NULL), mSize(0) {
-}
-
-Parcel::Blob::~Blob() {
- release();
-}
-
-void Parcel::Blob::release() {
- if (mMapped && mData) {
- ::munmap(mData, mSize);
- }
- clear();
-}
-
-void Parcel::Blob::init(bool mapped, void* data, size_t size) {
- mMapped = mapped;
- mData = data;
- mSize = size;
-}
-
-void Parcel::Blob::clear() {
- mMapped = false;
- mData = NULL;
- mSize = 0;
-}
-
-}; // namespace android
diff --git a/libs/binder/PermissionCache.cpp b/libs/binder/PermissionCache.cpp
deleted file mode 100644
index a503be8..0000000
--- a/libs/binder/PermissionCache.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#define LOG_TAG "PermissionCache"
-
-#include <stdint.h>
-#include <utils/Log.h>
-#include <binder/IPCThreadState.h>
-#include <binder/IServiceManager.h>
-#include <binder/PermissionCache.h>
-#include <utils/String8.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-ANDROID_SINGLETON_STATIC_INSTANCE(PermissionCache) ;
-
-// ----------------------------------------------------------------------------
-
-PermissionCache::PermissionCache() {
-}
-
-status_t PermissionCache::check(bool* granted,
- const String16& permission, uid_t uid) const {
- Mutex::Autolock _l(mLock);
- Entry e;
- e.name = permission;
- e.uid = uid;
- ssize_t index = mCache.indexOf(e);
- if (index >= 0) {
- *granted = mCache.itemAt(index).granted;
- return NO_ERROR;
- }
- return NAME_NOT_FOUND;
-}
-
-void PermissionCache::cache(const String16& permission,
- uid_t uid, bool granted) {
- Mutex::Autolock _l(mLock);
- Entry e;
- ssize_t index = mPermissionNamesPool.indexOf(permission);
- if (index > 0) {
- e.name = mPermissionNamesPool.itemAt(index);
- } else {
- mPermissionNamesPool.add(permission);
- e.name = permission;
- }
- // note, we don't need to store the pid, which is not actually used in
- // permission checks
- e.uid = uid;
- e.granted = granted;
- index = mCache.indexOf(e);
- if (index < 0) {
- mCache.add(e);
- }
-}
-
-void PermissionCache::purge() {
- Mutex::Autolock _l(mLock);
- mCache.clear();
-}
-
-bool PermissionCache::checkCallingPermission(const String16& permission) {
- return PermissionCache::checkCallingPermission(permission, NULL, NULL);
-}
-
-bool PermissionCache::checkCallingPermission(
- const String16& permission, int32_t* outPid, int32_t* outUid) {
- IPCThreadState* ipcState = IPCThreadState::self();
- pid_t pid = ipcState->getCallingPid();
- uid_t uid = ipcState->getCallingUid();
- if (outPid) *outPid = pid;
- if (outUid) *outUid = uid;
- return PermissionCache::checkPermission(permission, pid, uid);
-}
-
-bool PermissionCache::checkPermission(
- const String16& permission, pid_t pid, uid_t uid) {
- if ((uid == 0) || (pid == getpid())) {
- // root and ourselves is always okay
- return true;
- }
-
- PermissionCache& pc(PermissionCache::getInstance());
- bool granted = false;
- if (pc.check(&granted, permission, uid) != NO_ERROR) {
- nsecs_t t = -systemTime();
- granted = android::checkPermission(permission, pid, uid);
- t += systemTime();
- ALOGD("checking %s for uid=%d => %s (%d us)",
- String8(permission).string(), uid,
- granted?"granted":"denied", (int)ns2us(t));
- pc.cache(permission, uid, granted);
- }
- return granted;
-}
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
deleted file mode 100644
index 9fa412c..0000000
--- a/libs/binder/ProcessState.cpp
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#define LOG_TAG "ProcessState"
-
-#include <cutils/process_name.h>
-
-#include <binder/ProcessState.h>
-
-#include <utils/Atomic.h>
-#include <binder/BpBinder.h>
-#include <binder/IPCThreadState.h>
-#include <utils/Log.h>
-#include <utils/String8.h>
-#include <binder/IServiceManager.h>
-#include <utils/String8.h>
-#include <utils/threads.h>
-
-#include <private/binder/binder_module.h>
-#include <private/binder/Static.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-
-#define BINDER_VM_SIZE ((1*1024*1024) - (4096 *2))
-
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-// Global variables
-int mArgC;
-const char* const* mArgV;
-int mArgLen;
-
-class PoolThread : public Thread
-{
-public:
- PoolThread(bool isMain)
- : mIsMain(isMain)
- {
- }
-
-protected:
- virtual bool threadLoop()
- {
- IPCThreadState::self()->joinThreadPool(mIsMain);
- return false;
- }
-
- const bool mIsMain;
-};
-
-sp<ProcessState> ProcessState::self()
-{
- if (gProcess != NULL) return gProcess;
-
- AutoMutex _l(gProcessMutex);
- if (gProcess == NULL) gProcess = new ProcessState;
- return gProcess;
-}
-
-void ProcessState::setContextObject(const sp<IBinder>& object)
-{
- setContextObject(object, String16("default"));
-}
-
-sp<IBinder> ProcessState::getContextObject(const sp<IBinder>& caller)
-{
- return getStrongProxyForHandle(0);
-}
-
-void ProcessState::setContextObject(const sp<IBinder>& object, const String16& name)
-{
- AutoMutex _l(mLock);
- mContexts.add(name, object);
-}
-
-sp<IBinder> ProcessState::getContextObject(const String16& name, const sp<IBinder>& caller)
-{
- mLock.lock();
- sp<IBinder> object(
- mContexts.indexOfKey(name) >= 0 ? mContexts.valueFor(name) : NULL);
- mLock.unlock();
-
- //printf("Getting context object %s for %p\n", String8(name).string(), caller.get());
-
- if (object != NULL) return object;
-
- // Don't attempt to retrieve contexts if we manage them
- if (mManagesContexts) {
- ALOGE("getContextObject(%s) failed, but we manage the contexts!\n",
- String8(name).string());
- return NULL;
- }
-
- IPCThreadState* ipc = IPCThreadState::self();
- {
- Parcel data, reply;
- // no interface token on this magic transaction
- data.writeString16(name);
- data.writeStrongBinder(caller);
- status_t result = ipc->transact(0 /*magic*/, 0, data, &reply, 0);
- if (result == NO_ERROR) {
- object = reply.readStrongBinder();
- }
- }
-
- ipc->flushCommands();
-
- if (object != NULL) setContextObject(object, name);
- return object;
-}
-
-void ProcessState::startThreadPool()
-{
- AutoMutex _l(mLock);
- if (!mThreadPoolStarted) {
- mThreadPoolStarted = true;
- spawnPooledThread(true);
- }
-}
-
-bool ProcessState::isContextManager(void) const
-{
- return mManagesContexts;
-}
-
-bool ProcessState::becomeContextManager(context_check_func checkFunc, void* userData)
-{
- if (!mManagesContexts) {
- AutoMutex _l(mLock);
- mBinderContextCheckFunc = checkFunc;
- mBinderContextUserData = userData;
-
- int dummy = 0;
- status_t result = ioctl(mDriverFD, BINDER_SET_CONTEXT_MGR, &dummy);
- if (result == 0) {
- mManagesContexts = true;
- } else if (result == -1) {
- mBinderContextCheckFunc = NULL;
- mBinderContextUserData = NULL;
- ALOGE("Binder ioctl to become context manager failed: %s\n", strerror(errno));
- }
- }
- return mManagesContexts;
-}
-
-ProcessState::handle_entry* ProcessState::lookupHandleLocked(int32_t handle)
-{
- const size_t N=mHandleToObject.size();
- if (N <= (size_t)handle) {
- handle_entry e;
- e.binder = NULL;
- e.refs = NULL;
- status_t err = mHandleToObject.insertAt(e, N, handle+1-N);
- if (err < NO_ERROR) return NULL;
- }
- return &mHandleToObject.editItemAt(handle);
-}
-
-sp<IBinder> ProcessState::getStrongProxyForHandle(int32_t handle)
-{
- sp<IBinder> result;
-
- AutoMutex _l(mLock);
-
- handle_entry* e = lookupHandleLocked(handle);
-
- if (e != NULL) {
- // We need to create a new BpBinder if there isn't currently one, OR we
- // are unable to acquire a weak reference on this current one. See comment
- // in getWeakProxyForHandle() for more info about this.
- IBinder* b = e->binder;
- if (b == NULL || !e->refs->attemptIncWeak(this)) {
- b = new BpBinder(handle);
- e->binder = b;
- if (b) e->refs = b->getWeakRefs();
- result = b;
- } else {
- // This little bit of nastyness is to allow us to add a primary
- // reference to the remote proxy when this team doesn't have one
- // but another team is sending the handle to us.
- result.force_set(b);
- e->refs->decWeak(this);
- }
- }
-
- return result;
-}
-
-wp<IBinder> ProcessState::getWeakProxyForHandle(int32_t handle)
-{
- wp<IBinder> result;
-
- AutoMutex _l(mLock);
-
- handle_entry* e = lookupHandleLocked(handle);
-
- if (e != NULL) {
- // We need to create a new BpBinder if there isn't currently one, OR we
- // are unable to acquire a weak reference on this current one. The
- // attemptIncWeak() is safe because we know the BpBinder destructor will always
- // call expungeHandle(), which acquires the same lock we are holding now.
- // We need to do this because there is a race condition between someone
- // releasing a reference on this BpBinder, and a new reference on its handle
- // arriving from the driver.
- IBinder* b = e->binder;
- if (b == NULL || !e->refs->attemptIncWeak(this)) {
- b = new BpBinder(handle);
- result = b;
- e->binder = b;
- if (b) e->refs = b->getWeakRefs();
- } else {
- result = b;
- e->refs->decWeak(this);
- }
- }
-
- return result;
-}
-
-void ProcessState::expungeHandle(int32_t handle, IBinder* binder)
-{
- AutoMutex _l(mLock);
-
- handle_entry* e = lookupHandleLocked(handle);
-
- // This handle may have already been replaced with a new BpBinder
- // (if someone failed the AttemptIncWeak() above); we don't want
- // to overwrite it.
- if (e && e->binder == binder) e->binder = NULL;
-}
-
-void ProcessState::setArgs(int argc, const char* const argv[])
-{
- mArgC = argc;
- mArgV = (const char **)argv;
-
- mArgLen = 0;
- for (int i=0; i<argc; i++) {
- mArgLen += strlen(argv[i]) + 1;
- }
- mArgLen--;
-}
-
-int ProcessState::getArgC() const
-{
- return mArgC;
-}
-
-const char* const* ProcessState::getArgV() const
-{
- return mArgV;
-}
-
-void ProcessState::setArgV0(const char* txt)
-{
- if (mArgV != NULL) {
- strncpy((char*)mArgV[0], txt, mArgLen);
- set_process_name(txt);
- }
-}
-
-void ProcessState::spawnPooledThread(bool isMain)
-{
- if (mThreadPoolStarted) {
- int32_t s = android_atomic_add(1, &mThreadPoolSeq);
- char buf[16];
- snprintf(buf, sizeof(buf), "Binder_%X", s);
- ALOGV("Spawning new pooled thread, name=%s\n", buf);
- sp<Thread> t = new PoolThread(isMain);
- t->run(buf);
- }
-}
-
-static int open_driver()
-{
- int fd = open("/dev/binder", O_RDWR);
- if (fd >= 0) {
- fcntl(fd, F_SETFD, FD_CLOEXEC);
- int vers;
- status_t result = ioctl(fd, BINDER_VERSION, &vers);
- if (result == -1) {
- ALOGE("Binder ioctl to obtain version failed: %s", strerror(errno));
- close(fd);
- fd = -1;
- }
- if (result != 0 || vers != BINDER_CURRENT_PROTOCOL_VERSION) {
- ALOGE("Binder driver protocol does not match user space protocol!");
- close(fd);
- fd = -1;
- }
- size_t maxThreads = 15;
- result = ioctl(fd, BINDER_SET_MAX_THREADS, &maxThreads);
- if (result == -1) {
- ALOGE("Binder ioctl to set max threads failed: %s", strerror(errno));
- }
- } else {
- ALOGW("Opening '/dev/binder' failed: %s\n", strerror(errno));
- }
- return fd;
-}
-
-ProcessState::ProcessState()
- : mDriverFD(open_driver())
- , mVMStart(MAP_FAILED)
- , mManagesContexts(false)
- , mBinderContextCheckFunc(NULL)
- , mBinderContextUserData(NULL)
- , mThreadPoolStarted(false)
- , mThreadPoolSeq(1)
-{
- if (mDriverFD >= 0) {
- // XXX Ideally, there should be a specific define for whether we
- // have mmap (or whether we could possibly have the kernel module
- // availabla).
-#if !defined(HAVE_WIN32_IPC)
- // mmap the binder, providing a chunk of virtual address space to receive transactions.
- mVMStart = mmap(0, BINDER_VM_SIZE, PROT_READ, MAP_PRIVATE | MAP_NORESERVE, mDriverFD, 0);
- if (mVMStart == MAP_FAILED) {
- // *sigh*
- ALOGE("Using /dev/binder failed: unable to mmap transaction memory.\n");
- close(mDriverFD);
- mDriverFD = -1;
- }
-#else
- mDriverFD = -1;
-#endif
- }
-
- LOG_ALWAYS_FATAL_IF(mDriverFD < 0, "Binder driver could not be opened. Terminating.");
-}
-
-ProcessState::~ProcessState()
-{
-}
-
-}; // namespace android
diff --git a/libs/binder/Static.cpp b/libs/binder/Static.cpp
deleted file mode 100644
index 12b0308..0000000
--- a/libs/binder/Static.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-// All static variables go here, to control initialization and
-// destruction order in the library.
-
-#include <private/binder/Static.h>
-
-#include <binder/IPCThreadState.h>
-#include <utils/Log.h>
-
-namespace android {
-
-// ------------ ProcessState.cpp
-
-Mutex gProcessMutex;
-sp<ProcessState> gProcess;
-
-class LibUtilsIPCtStatics
-{
-public:
- LibUtilsIPCtStatics()
- {
- }
-
- ~LibUtilsIPCtStatics()
- {
- IPCThreadState::shutdown();
- }
-};
-
-static LibUtilsIPCtStatics gIPCStatics;
-
-// ------------ ServiceManager.cpp
-
-Mutex gDefaultServiceManagerLock;
-sp<IServiceManager> gDefaultServiceManager;
-sp<IPermissionController> gPermissionController;
-
-} // namespace android
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
deleted file mode 100644
index 2f4ac62..0000000
--- a/libs/gui/Android.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- BitTube.cpp \
- BufferQueue.cpp \
- DisplayEventReceiver.cpp \
- IDisplayEventConnection.cpp \
- ISensorEventConnection.cpp \
- ISensorServer.cpp \
- ISurfaceTexture.cpp \
- Sensor.cpp \
- SensorEventQueue.cpp \
- SensorManager.cpp \
- SurfaceTexture.cpp \
- SurfaceTextureClient.cpp \
- ISurfaceComposer.cpp \
- ISurface.cpp \
- ISurfaceComposerClient.cpp \
- IGraphicBufferAlloc.cpp \
- LayerState.cpp \
- Surface.cpp \
- SurfaceComposerClient.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libbinder \
- libhardware \
- libhardware_legacy \
- libui \
- libEGL \
- libGLESv2 \
-
-
-LOCAL_MODULE:= libgui
-
-ifeq ($(TARGET_BOARD_PLATFORM), omap4)
- LOCAL_CFLAGS += -DUSE_FENCE_SYNC
-endif
-ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
- LOCAL_CFLAGS += -DUSE_FENCE_SYNC
-endif
-
-ifeq ($(TARGET_BOARD_PLATFORM), tegra)
- LOCAL_CFLAGS += -DALLOW_DEQUEUE_CURRENT_BUFFER
-endif
-
-include $(BUILD_SHARED_LIBRARY)
-
-ifeq (,$(ONE_SHOT_MAKEFILE))
-include $(call first-makefiles-under,$(LOCAL_PATH))
-endif
diff --git a/libs/gui/BitTube.cpp b/libs/gui/BitTube.cpp
deleted file mode 100644
index 55f4178..0000000
--- a/libs/gui/BitTube.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <fcntl.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <utils/Errors.h>
-
-#include <binder/Parcel.h>
-
-#include <gui/BitTube.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-BitTube::BitTube()
- : mSendFd(-1), mReceiveFd(-1)
-{
- int fds[2];
- if (pipe(fds) == 0) {
- mReceiveFd = fds[0];
- mSendFd = fds[1];
- fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
- fcntl(mSendFd, F_SETFL, O_NONBLOCK);
- // ignore SIGPIPE, we handle write errors through EPIPE instead
- signal(SIGPIPE, SIG_IGN);
- } else {
- mReceiveFd = -errno;
- ALOGE("BitTube: pipe creation failed (%s)", strerror(-mReceiveFd));
- }
-}
-
-BitTube::BitTube(const Parcel& data)
- : mSendFd(-1), mReceiveFd(-1)
-{
- mReceiveFd = dup(data.readFileDescriptor());
- if (mReceiveFd >= 0) {
- fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
- } else {
- mReceiveFd = -errno;
- ALOGE("BitTube(Parcel): can't dup filedescriptor (%s)",
- strerror(-mReceiveFd));
- }
-}
-
-BitTube::~BitTube()
-{
- if (mSendFd >= 0)
- close(mSendFd);
-
- if (mReceiveFd >= 0)
- close(mReceiveFd);
-}
-
-status_t BitTube::initCheck() const
-{
- if (mReceiveFd < 0) {
- return status_t(mReceiveFd);
- }
- return NO_ERROR;
-}
-
-int BitTube::getFd() const
-{
- return mReceiveFd;
-}
-
-ssize_t BitTube::write(void const* vaddr, size_t size)
-{
- ssize_t err, len;
- do {
- len = ::write(mSendFd, vaddr, size);
- err = len < 0 ? errno : 0;
- } while (err == EINTR);
- return err == 0 ? len : -err;
-
-}
-
-ssize_t BitTube::read(void* vaddr, size_t size)
-{
- ssize_t err, len;
- do {
- len = ::read(mReceiveFd, vaddr, size);
- err = len < 0 ? errno : 0;
- } while (err == EINTR);
- if (err == EAGAIN || err == EWOULDBLOCK) {
- // EAGAIN means that we have non-blocking I/O but there was
- // no data to be read. Nothing the client should care about.
- return 0;
- }
- return err == 0 ? len : -err;
-}
-
-status_t BitTube::writeToParcel(Parcel* reply) const
-{
- if (mReceiveFd < 0)
- return -EINVAL;
-
- status_t result = reply->writeDupFileDescriptor(mReceiveFd);
- close(mReceiveFd);
- mReceiveFd = -1;
- return result;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
deleted file mode 100644
index 25a4c22..0000000
--- a/libs/gui/BufferQueue.cpp
+++ /dev/null
@@ -1,959 +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.
- */
-
-#define LOG_TAG "BufferQueue"
-//#define LOG_NDEBUG 0
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-
-#define GL_GLEXT_PROTOTYPES
-#define EGL_EGLEXT_PROTOTYPES
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#include <gui/BufferQueue.h>
-#include <gui/ISurfaceComposer.h>
-#include <private/gui/ComposerService.h>
-
-#include <utils/Log.h>
-#include <gui/SurfaceTexture.h>
-#include <utils/Trace.h>
-
-// This compile option causes SurfaceTexture to return the buffer that is currently
-// attached to the GL texture from dequeueBuffer when no other buffers are
-// available. It requires the drivers (Gralloc, GL, OMX IL, and Camera) to do
-// implicit cross-process synchronization to prevent the buffer from being
-// written to before the buffer has (a) been detached from the GL texture and
-// (b) all GL reads from the buffer have completed.
-
-// During refactoring, do not support dequeuing the current buffer
-#undef ALLOW_DEQUEUE_CURRENT_BUFFER
-
-#ifdef ALLOW_DEQUEUE_CURRENT_BUFFER
-#define FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER true
-#warning "ALLOW_DEQUEUE_CURRENT_BUFFER enabled"
-#else
-#define FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER false
-#endif
-
-// Macros for including the BufferQueue name in log messages
-#define ST_LOGV(x, ...) ALOGV("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
-#define ST_LOGD(x, ...) ALOGD("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
-#define ST_LOGI(x, ...) ALOGI("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
-#define ST_LOGW(x, ...) ALOGW("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
-#define ST_LOGE(x, ...) ALOGE("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
-
-#define ATRACE_BUFFER_INDEX(index) \
- char ___traceBuf[1024]; \
- snprintf(___traceBuf, 1024, "%s: %d", mConsumerName.string(), (index)); \
- android::ScopedTrace ___bufTracer(ATRACE_TAG, ___traceBuf);
-
-namespace android {
-
-// Get an ID that's unique within this process.
-static int32_t createProcessUniqueId() {
- static volatile int32_t globalCounter = 0;
- return android_atomic_inc(&globalCounter);
-}
-
-BufferQueue::BufferQueue( bool allowSynchronousMode ) :
- mDefaultWidth(1),
- mDefaultHeight(1),
- mPixelFormat(PIXEL_FORMAT_RGBA_8888),
- mBufferCount(MIN_ASYNC_BUFFER_SLOTS),
- mClientBufferCount(0),
- mServerBufferCount(MIN_ASYNC_BUFFER_SLOTS),
- mNextTransform(0),
- mNextScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
- mSynchronousMode(false),
- mAllowSynchronousMode(allowSynchronousMode),
- mConnectedApi(NO_CONNECTED_API),
- mAbandoned(false),
- mFrameCounter(0),
- mBufferHasBeenQueued(false)
-{
- // Choose a name using the PID and a process-unique ID.
- mConsumerName = String8::format("unnamed-%d-%d", getpid(), createProcessUniqueId());
-
- ST_LOGV("BufferQueue");
- sp<ISurfaceComposer> composer(ComposerService::getComposerService());
- mGraphicBufferAlloc = composer->createGraphicBufferAlloc();
- mNextCrop.makeInvalid();
-}
-
-BufferQueue::~BufferQueue() {
- ST_LOGV("~BufferQueue");
-}
-
-status_t BufferQueue::setBufferCountServerLocked(int bufferCount) {
- if (bufferCount > NUM_BUFFER_SLOTS)
- return BAD_VALUE;
-
- // special-case, nothing to do
- if (bufferCount == mBufferCount)
- return OK;
-
- if (!mClientBufferCount &&
- bufferCount >= mBufferCount) {
- // easy, we just have more buffers
- mBufferCount = bufferCount;
- mServerBufferCount = bufferCount;
- mDequeueCondition.signal();
- } else {
- // we're here because we're either
- // - reducing the number of available buffers
- // - or there is a client-buffer-count in effect
-
- // less than 2 buffers is never allowed
- if (bufferCount < 2)
- return BAD_VALUE;
-
- // when there is non client-buffer-count in effect, the client is not
- // allowed to dequeue more than one buffer at a time,
- // so the next time they dequeue a buffer, we know that they don't
- // own one. the actual resizing will happen during the next
- // dequeueBuffer.
-
- mServerBufferCount = bufferCount;
- }
- return OK;
-}
-
-bool BufferQueue::isSynchronousMode() const {
- Mutex::Autolock lock(mMutex);
- return mSynchronousMode;
-}
-
-void BufferQueue::setConsumerName(const String8& name) {
- Mutex::Autolock lock(mMutex);
- mConsumerName = name;
-}
-
-void BufferQueue::setFrameAvailableListener(
- const sp<FrameAvailableListener>& listener) {
- ST_LOGV("setFrameAvailableListener");
- Mutex::Autolock lock(mMutex);
- mFrameAvailableListener = listener;
-}
-
-status_t BufferQueue::setBufferCount(int bufferCount) {
- ST_LOGV("setBufferCount: count=%d", bufferCount);
- Mutex::Autolock lock(mMutex);
-
- if (mAbandoned) {
- ST_LOGE("setBufferCount: SurfaceTexture has been abandoned!");
- return NO_INIT;
- }
- if (bufferCount > NUM_BUFFER_SLOTS) {
- ST_LOGE("setBufferCount: bufferCount larger than slots available");
- return BAD_VALUE;
- }
-
- // Error out if the user has dequeued buffers
- for (int i=0 ; i<mBufferCount ; i++) {
- if (mSlots[i].mBufferState == BufferSlot::DEQUEUED) {
- ST_LOGE("setBufferCount: client owns some buffers");
- return -EINVAL;
- }
- }
-
- const int minBufferSlots = mSynchronousMode ?
- MIN_SYNC_BUFFER_SLOTS : MIN_ASYNC_BUFFER_SLOTS;
- if (bufferCount == 0) {
- mClientBufferCount = 0;
- bufferCount = (mServerBufferCount >= minBufferSlots) ?
- mServerBufferCount : minBufferSlots;
- return setBufferCountServerLocked(bufferCount);
- }
-
- if (bufferCount < minBufferSlots) {
- ST_LOGE("setBufferCount: requested buffer count (%d) is less than "
- "minimum (%d)", bufferCount, minBufferSlots);
- return BAD_VALUE;
- }
-
- // here we're guaranteed that the client doesn't have dequeued buffers
- // and will release all of its buffer references.
- freeAllBuffersLocked();
- mBufferCount = bufferCount;
- mClientBufferCount = bufferCount;
- mBufferHasBeenQueued = false;
- mQueue.clear();
- mDequeueCondition.signal();
- return OK;
-}
-
-int BufferQueue::query(int what, int* outValue)
-{
- ATRACE_CALL();
- Mutex::Autolock lock(mMutex);
-
- if (mAbandoned) {
- ST_LOGE("query: SurfaceTexture has been abandoned!");
- return NO_INIT;
- }
-
- int value;
- switch (what) {
- case NATIVE_WINDOW_WIDTH:
- value = mDefaultWidth;
- break;
- case NATIVE_WINDOW_HEIGHT:
- value = mDefaultHeight;
- break;
- case NATIVE_WINDOW_FORMAT:
- value = mPixelFormat;
- break;
- case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS:
- value = mSynchronousMode ?
- (MIN_UNDEQUEUED_BUFFERS-1) : MIN_UNDEQUEUED_BUFFERS;
- break;
- default:
- return BAD_VALUE;
- }
- outValue[0] = value;
- return NO_ERROR;
-}
-
-status_t BufferQueue::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
- ATRACE_CALL();
- ST_LOGV("requestBuffer: slot=%d", slot);
- Mutex::Autolock lock(mMutex);
- if (mAbandoned) {
- ST_LOGE("requestBuffer: SurfaceTexture has been abandoned!");
- return NO_INIT;
- }
- if (slot < 0 || mBufferCount <= slot) {
- ST_LOGE("requestBuffer: slot index out of range [0, %d]: %d",
- mBufferCount, slot);
- return BAD_VALUE;
- }
- mSlots[slot].mRequestBufferCalled = true;
- *buf = mSlots[slot].mGraphicBuffer;
- return NO_ERROR;
-}
-
-status_t BufferQueue::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
- uint32_t format, uint32_t usage) {
- ATRACE_CALL();
- ST_LOGV("dequeueBuffer: w=%d h=%d fmt=%#x usage=%#x", w, h, format, usage);
-
- if ((w && !h) || (!w && h)) {
- ST_LOGE("dequeueBuffer: invalid size: w=%u, h=%u", w, h);
- return BAD_VALUE;
- }
-
- status_t returnFlags(OK);
- EGLDisplay dpy = EGL_NO_DISPLAY;
- EGLSyncKHR fence = EGL_NO_SYNC_KHR;
-
- { // Scope for the lock
- Mutex::Autolock lock(mMutex);
-
- int found = -1;
- int foundSync = -1;
- int dequeuedCount = 0;
- bool tryAgain = true;
- while (tryAgain) {
- if (mAbandoned) {
- ST_LOGE("dequeueBuffer: SurfaceTexture has been abandoned!");
- return NO_INIT;
- }
-
- // We need to wait for the FIFO to drain if the number of buffer
- // needs to change.
- //
- // The condition "number of buffers needs to change" is true if
- // - the client doesn't care about how many buffers there are
- // - AND the actual number of buffer is different from what was
- // set in the last setBufferCountServer()
- // - OR -
- // setBufferCountServer() was set to a value incompatible with
- // the synchronization mode (for instance because the sync mode
- // changed since)
- //
- // As long as this condition is true AND the FIFO is not empty, we
- // wait on mDequeueCondition.
-
- const int minBufferCountNeeded = mSynchronousMode ?
- MIN_SYNC_BUFFER_SLOTS : MIN_ASYNC_BUFFER_SLOTS;
-
- const bool numberOfBuffersNeedsToChange = !mClientBufferCount &&
- ((mServerBufferCount != mBufferCount) ||
- (mServerBufferCount < minBufferCountNeeded));
-
- if (!mQueue.isEmpty() && numberOfBuffersNeedsToChange) {
- // wait for the FIFO to drain
- mDequeueCondition.wait(mMutex);
- // NOTE: we continue here because we need to reevaluate our
- // whole state (eg: we could be abandoned or disconnected)
- continue;
- }
-
- if (numberOfBuffersNeedsToChange) {
- // here we're guaranteed that mQueue is empty
- freeAllBuffersLocked();
- mBufferCount = mServerBufferCount;
- if (mBufferCount < minBufferCountNeeded)
- mBufferCount = minBufferCountNeeded;
- mBufferHasBeenQueued = false;
- returnFlags |= ISurfaceTexture::RELEASE_ALL_BUFFERS;
- }
-
- // look for a free buffer to give to the client
- found = INVALID_BUFFER_SLOT;
- foundSync = INVALID_BUFFER_SLOT;
- dequeuedCount = 0;
- for (int i = 0; i < mBufferCount; i++) {
- const int state = mSlots[i].mBufferState;
- if (state == BufferSlot::DEQUEUED) {
- dequeuedCount++;
- }
-
- // this logic used to be if (FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER)
- // but dequeuing the current buffer is disabled.
- if (false) {
- // This functionality has been temporarily removed so
- // BufferQueue and SurfaceTexture can be refactored into
- // separate objects
- } else {
- if (state == BufferSlot::FREE) {
- /* We return the oldest of the free buffers to avoid
- * stalling the producer if possible. This is because
- * the consumer may still have pending reads of the
- * buffers in flight.
- */
- bool isOlder = mSlots[i].mFrameNumber <
- mSlots[found].mFrameNumber;
- if (found < 0 || isOlder) {
- foundSync = i;
- found = i;
- }
- }
- }
- }
-
- // clients are not allowed to dequeue more than one buffer
- // if they didn't set a buffer count.
- if (!mClientBufferCount && dequeuedCount) {
- ST_LOGE("dequeueBuffer: can't dequeue multiple buffers without "
- "setting the buffer count");
- return -EINVAL;
- }
-
- // See whether a buffer has been queued since the last
- // setBufferCount so we know whether to perform the
- // MIN_UNDEQUEUED_BUFFERS check below.
- if (mBufferHasBeenQueued) {
- // make sure the client is not trying to dequeue more buffers
- // than allowed.
- const int avail = mBufferCount - (dequeuedCount+1);
- if (avail < (MIN_UNDEQUEUED_BUFFERS-int(mSynchronousMode))) {
- ST_LOGE("dequeueBuffer: MIN_UNDEQUEUED_BUFFERS=%d exceeded "
- "(dequeued=%d)",
- MIN_UNDEQUEUED_BUFFERS-int(mSynchronousMode),
- dequeuedCount);
- return -EBUSY;
- }
- }
-
- // we're in synchronous mode and didn't find a buffer, we need to
- // wait for some buffers to be consumed
- tryAgain = mSynchronousMode && (foundSync == INVALID_BUFFER_SLOT);
- if (tryAgain) {
- mDequeueCondition.wait(mMutex);
- }
- }
-
- if (mSynchronousMode && found == INVALID_BUFFER_SLOT) {
- // foundSync guaranteed to be != INVALID_BUFFER_SLOT
- found = foundSync;
- }
-
- if (found == INVALID_BUFFER_SLOT) {
- // This should not happen.
- ST_LOGE("dequeueBuffer: no available buffer slots");
- return -EBUSY;
- }
-
- const int buf = found;
- *outBuf = found;
-
- ATRACE_BUFFER_INDEX(buf);
-
- const bool useDefaultSize = !w && !h;
- if (useDefaultSize) {
- // use the default size
- w = mDefaultWidth;
- h = mDefaultHeight;
- }
-
- const bool updateFormat = (format != 0);
- if (!updateFormat) {
- // keep the current (or default) format
- format = mPixelFormat;
- }
-
- // buffer is now in DEQUEUED (but can also be current at the same time,
- // if we're in synchronous mode)
- mSlots[buf].mBufferState = BufferSlot::DEQUEUED;
-
- const sp<GraphicBuffer>& buffer(mSlots[buf].mGraphicBuffer);
- if ((buffer == NULL) ||
- (uint32_t(buffer->width) != w) ||
- (uint32_t(buffer->height) != h) ||
- (uint32_t(buffer->format) != format) ||
- ((uint32_t(buffer->usage) & usage) != usage))
- {
- usage |= GraphicBuffer::USAGE_HW_TEXTURE;
- status_t error;
- sp<GraphicBuffer> graphicBuffer(
- mGraphicBufferAlloc->createGraphicBuffer(
- w, h, format, usage, &error));
- if (graphicBuffer == 0) {
- ST_LOGE("dequeueBuffer: SurfaceComposer::createGraphicBuffer "
- "failed");
- return error;
- }
- if (updateFormat) {
- mPixelFormat = format;
- }
-
- mSlots[buf].mAcquireCalled = false;
- mSlots[buf].mGraphicBuffer = graphicBuffer;
- mSlots[buf].mRequestBufferCalled = false;
- mSlots[buf].mFence = EGL_NO_SYNC_KHR;
- mSlots[buf].mEglDisplay = EGL_NO_DISPLAY;
-
-
-
-
- returnFlags |= ISurfaceTexture::BUFFER_NEEDS_REALLOCATION;
- }
-
- dpy = mSlots[buf].mEglDisplay;
- fence = mSlots[buf].mFence;
- mSlots[buf].mFence = EGL_NO_SYNC_KHR;
- } // end lock scope
-
- if (fence != EGL_NO_SYNC_KHR) {
- EGLint result = eglClientWaitSyncKHR(dpy, fence, 0, 1000000000);
- // If something goes wrong, log the error, but return the buffer without
- // synchronizing access to it. It's too late at this point to abort the
- // dequeue operation.
- if (result == EGL_FALSE) {
- ALOGE("dequeueBuffer: error waiting for fence: %#x", eglGetError());
- } else if (result == EGL_TIMEOUT_EXPIRED_KHR) {
- ALOGE("dequeueBuffer: timeout waiting for fence");
- }
- eglDestroySyncKHR(dpy, fence);
-
- }
-
- ST_LOGV("dequeueBuffer: returning slot=%d buf=%p flags=%#x", *outBuf,
- mSlots[*outBuf].mGraphicBuffer->handle, returnFlags);
-
- return returnFlags;
-}
-
-status_t BufferQueue::setSynchronousMode(bool enabled) {
- ATRACE_CALL();
- ST_LOGV("setSynchronousMode: enabled=%d", enabled);
- Mutex::Autolock lock(mMutex);
-
- if (mAbandoned) {
- ST_LOGE("setSynchronousMode: SurfaceTexture has been abandoned!");
- return NO_INIT;
- }
-
- status_t err = OK;
- if (!mAllowSynchronousMode && enabled)
- return err;
-
- if (!enabled) {
- // going to asynchronous mode, drain the queue
- err = drainQueueLocked();
- if (err != NO_ERROR)
- return err;
- }
-
- if (mSynchronousMode != enabled) {
- // - if we're going to asynchronous mode, the queue is guaranteed to be
- // empty here
- // - if the client set the number of buffers, we're guaranteed that
- // we have at least 3 (because we don't allow less)
- mSynchronousMode = enabled;
- mDequeueCondition.signal();
- }
- return err;
-}
-
-status_t BufferQueue::queueBuffer(int buf, int64_t timestamp,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
- ATRACE_CALL();
- ATRACE_BUFFER_INDEX(buf);
-
- ST_LOGV("queueBuffer: slot=%d time=%lld", buf, timestamp);
-
- sp<FrameAvailableListener> listener;
-
- { // scope for the lock
- Mutex::Autolock lock(mMutex);
- if (mAbandoned) {
- ST_LOGE("queueBuffer: SurfaceTexture has been abandoned!");
- return NO_INIT;
- }
- if (buf < 0 || buf >= mBufferCount) {
- ST_LOGE("queueBuffer: slot index out of range [0, %d]: %d",
- mBufferCount, buf);
- return -EINVAL;
- } else if (mSlots[buf].mBufferState != BufferSlot::DEQUEUED) {
- ST_LOGE("queueBuffer: slot %d is not owned by the client "
- "(state=%d)", buf, mSlots[buf].mBufferState);
- return -EINVAL;
- } else if (!mSlots[buf].mRequestBufferCalled) {
- ST_LOGE("queueBuffer: slot %d was enqueued without requesting a "
- "buffer", buf);
- return -EINVAL;
- }
-
- if (mSynchronousMode) {
- // In synchronous mode we queue all buffers in a FIFO.
- mQueue.push_back(buf);
-
- // Synchronous mode always signals that an additional frame should
- // be consumed.
- listener = mFrameAvailableListener;
- } else {
- // In asynchronous mode we only keep the most recent buffer.
- if (mQueue.empty()) {
- mQueue.push_back(buf);
-
- // Asynchronous mode only signals that a frame should be
- // consumed if no previous frame was pending. If a frame were
- // pending then the consumer would have already been notified.
- listener = mFrameAvailableListener;
- } else {
- Fifo::iterator front(mQueue.begin());
- // buffer currently queued is freed
- mSlots[*front].mBufferState = BufferSlot::FREE;
- // and we record the new buffer index in the queued list
- *front = buf;
- }
- }
-
- mSlots[buf].mBufferState = BufferSlot::QUEUED;
- mSlots[buf].mCrop = mNextCrop;
- mSlots[buf].mTransform = mNextTransform;
- mSlots[buf].mScalingMode = mNextScalingMode;
- mSlots[buf].mTimestamp = timestamp;
- mFrameCounter++;
- mSlots[buf].mFrameNumber = mFrameCounter;
-
- mBufferHasBeenQueued = true;
- mDequeueCondition.signal();
-
- *outWidth = mDefaultWidth;
- *outHeight = mDefaultHeight;
- *outTransform = 0;
-
- ATRACE_INT(mConsumerName.string(), mQueue.size());
- } // scope for the lock
-
- // call back without lock held
- if (listener != 0) {
- listener->onFrameAvailable();
- }
- return OK;
-}
-
-void BufferQueue::cancelBuffer(int buf) {
- ATRACE_CALL();
- ST_LOGV("cancelBuffer: slot=%d", buf);
- Mutex::Autolock lock(mMutex);
-
- if (mAbandoned) {
- ST_LOGW("cancelBuffer: BufferQueue has been abandoned!");
- return;
- }
-
- if (buf < 0 || buf >= mBufferCount) {
- ST_LOGE("cancelBuffer: slot index out of range [0, %d]: %d",
- mBufferCount, buf);
- return;
- } else if (mSlots[buf].mBufferState != BufferSlot::DEQUEUED) {
- ST_LOGE("cancelBuffer: slot %d is not owned by the client (state=%d)",
- buf, mSlots[buf].mBufferState);
- return;
- }
- mSlots[buf].mBufferState = BufferSlot::FREE;
- mSlots[buf].mFrameNumber = 0;
- mDequeueCondition.signal();
-}
-
-status_t BufferQueue::setCrop(const Rect& crop) {
- ATRACE_CALL();
- ST_LOGV("setCrop: crop=[%d,%d,%d,%d]", crop.left, crop.top, crop.right,
- crop.bottom);
-
- Mutex::Autolock lock(mMutex);
- if (mAbandoned) {
- ST_LOGE("setCrop: BufferQueue has been abandoned!");
- return NO_INIT;
- }
- mNextCrop = crop;
- return OK;
-}
-
-status_t BufferQueue::setTransform(uint32_t transform) {
- ATRACE_CALL();
- ST_LOGV("setTransform: xform=%#x", transform);
- Mutex::Autolock lock(mMutex);
- if (mAbandoned) {
- ST_LOGE("setTransform: BufferQueue has been abandoned!");
- return NO_INIT;
- }
- mNextTransform = transform;
- return OK;
-}
-
-status_t BufferQueue::setScalingMode(int mode) {
- ATRACE_CALL();
- ST_LOGV("setScalingMode: mode=%d", mode);
-
- switch (mode) {
- case NATIVE_WINDOW_SCALING_MODE_FREEZE:
- case NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW:
- break;
- default:
- ST_LOGE("unknown scaling mode: %d", mode);
- return BAD_VALUE;
- }
-
- Mutex::Autolock lock(mMutex);
- mNextScalingMode = mode;
- return OK;
-}
-
-status_t BufferQueue::connect(int api,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
- ATRACE_CALL();
- ST_LOGV("connect: api=%d", api);
- Mutex::Autolock lock(mMutex);
-
- if (mAbandoned) {
- ST_LOGE("connect: BufferQueue has been abandoned!");
- return NO_INIT;
- }
-
- int err = NO_ERROR;
- switch (api) {
- case NATIVE_WINDOW_API_EGL:
- case NATIVE_WINDOW_API_CPU:
- case NATIVE_WINDOW_API_MEDIA:
- case NATIVE_WINDOW_API_CAMERA:
- if (mConnectedApi != NO_CONNECTED_API) {
- ST_LOGE("connect: already connected (cur=%d, req=%d)",
- mConnectedApi, api);
- err = -EINVAL;
- } else {
- mConnectedApi = api;
- *outWidth = mDefaultWidth;
- *outHeight = mDefaultHeight;
- *outTransform = 0;
- }
- break;
- default:
- err = -EINVAL;
- break;
- }
-
- mBufferHasBeenQueued = false;
-
- return err;
-}
-
-status_t BufferQueue::disconnect(int api) {
- ATRACE_CALL();
- ST_LOGV("disconnect: api=%d", api);
- Mutex::Autolock lock(mMutex);
-
- if (mAbandoned) {
- // it is not really an error to disconnect after the surface
- // has been abandoned, it should just be a no-op.
- return NO_ERROR;
- }
-
- int err = NO_ERROR;
- switch (api) {
- case NATIVE_WINDOW_API_EGL:
- case NATIVE_WINDOW_API_CPU:
- case NATIVE_WINDOW_API_MEDIA:
- case NATIVE_WINDOW_API_CAMERA:
- if (mConnectedApi == api) {
- drainQueueAndFreeBuffersLocked();
- mConnectedApi = NO_CONNECTED_API;
- mNextCrop.makeInvalid();
- mNextScalingMode = NATIVE_WINDOW_SCALING_MODE_FREEZE;
- mNextTransform = 0;
- mDequeueCondition.signal();
- } else {
- ST_LOGE("disconnect: connected to another api (cur=%d, req=%d)",
- mConnectedApi, api);
- err = -EINVAL;
- }
- break;
- default:
- ST_LOGE("disconnect: unknown API %d", api);
- err = -EINVAL;
- break;
- }
- return err;
-}
-
-void BufferQueue::dump(String8& result) const
-{
- char buffer[1024];
- BufferQueue::dump(result, "", buffer, 1024);
-}
-
-void BufferQueue::dump(String8& result, const char* prefix,
- char* buffer, size_t SIZE) const
-{
- Mutex::Autolock _l(mMutex);
- snprintf(buffer, SIZE,
- "%snext : {crop=[%d,%d,%d,%d], transform=0x%02x}\n"
- ,prefix, mNextCrop.left, mNextCrop.top, mNextCrop.right,
- mNextCrop.bottom, mNextTransform
- );
- result.append(buffer);
-
- String8 fifo;
- int fifoSize = 0;
- Fifo::const_iterator i(mQueue.begin());
- while (i != mQueue.end()) {
- snprintf(buffer, SIZE, "%02d ", *i++);
- fifoSize++;
- fifo.append(buffer);
- }
-
- snprintf(buffer, SIZE,
- "%s-BufferQueue mBufferCount=%d, mSynchronousMode=%d, default-size=[%dx%d], "
- "mPixelFormat=%d, FIFO(%d)={%s}\n",
- prefix, mBufferCount, mSynchronousMode, mDefaultWidth,
- mDefaultHeight, mPixelFormat, fifoSize, fifo.string());
- result.append(buffer);
-
-
- struct {
- const char * operator()(int state) const {
- switch (state) {
- case BufferSlot::DEQUEUED: return "DEQUEUED";
- case BufferSlot::QUEUED: return "QUEUED";
- case BufferSlot::FREE: return "FREE";
- case BufferSlot::ACQUIRED: return "ACQUIRED";
- default: return "Unknown";
- }
- }
- } stateName;
-
- for (int i=0 ; i<mBufferCount ; i++) {
- const BufferSlot& slot(mSlots[i]);
- snprintf(buffer, SIZE,
- "%s%s[%02d] "
- "state=%-8s, crop=[%d,%d,%d,%d], "
- "transform=0x%02x, timestamp=%lld",
- prefix, (slot.mBufferState == BufferSlot::ACQUIRED)?">":" ", i,
- stateName(slot.mBufferState),
- slot.mCrop.left, slot.mCrop.top, slot.mCrop.right,
- slot.mCrop.bottom, slot.mTransform, slot.mTimestamp
- );
- result.append(buffer);
-
- const sp<GraphicBuffer>& buf(slot.mGraphicBuffer);
- if (buf != NULL) {
- snprintf(buffer, SIZE,
- ", %p [%4ux%4u:%4u,%3X]",
- buf->handle, buf->width, buf->height, buf->stride,
- buf->format);
- result.append(buffer);
- }
- result.append("\n");
- }
-}
-
-void BufferQueue::freeBufferLocked(int i) {
- mSlots[i].mGraphicBuffer = 0;
- mSlots[i].mBufferState = BufferSlot::FREE;
- mSlots[i].mFrameNumber = 0;
- mSlots[i].mAcquireCalled = false;
-
- // destroy fence as BufferQueue now takes ownership
- if (mSlots[i].mFence != EGL_NO_SYNC_KHR) {
- eglDestroySyncKHR(mSlots[i].mEglDisplay, mSlots[i].mFence);
- mSlots[i].mFence = EGL_NO_SYNC_KHR;
- }
-}
-
-void BufferQueue::freeAllBuffersLocked() {
- ALOGW_IF(!mQueue.isEmpty(),
- "freeAllBuffersLocked called but mQueue is not empty");
- mQueue.clear();
- mBufferHasBeenQueued = false;
- for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
- freeBufferLocked(i);
- }
-}
-
-status_t BufferQueue::acquire(BufferItem *buffer) {
- ATRACE_CALL();
- Mutex::Autolock _l(mMutex);
- // check if queue is empty
- // In asynchronous mode the list is guaranteed to be one buffer
- // deep, while in synchronous mode we use the oldest buffer.
- if (!mQueue.empty()) {
- Fifo::iterator front(mQueue.begin());
- int buf = *front;
-
- ATRACE_BUFFER_INDEX(buf);
-
- if (mSlots[buf].mAcquireCalled) {
- buffer->mGraphicBuffer = NULL;
- }
- else {
- buffer->mGraphicBuffer = mSlots[buf].mGraphicBuffer;
- }
- buffer->mCrop = mSlots[buf].mCrop;
- buffer->mTransform = mSlots[buf].mTransform;
- buffer->mScalingMode = mSlots[buf].mScalingMode;
- buffer->mFrameNumber = mSlots[buf].mFrameNumber;
- buffer->mTimestamp = mSlots[buf].mTimestamp;
- buffer->mBuf = buf;
- mSlots[buf].mAcquireCalled = true;
-
- mSlots[buf].mBufferState = BufferSlot::ACQUIRED;
- mQueue.erase(front);
-
- ATRACE_INT(mConsumerName.string(), mQueue.size());
- }
- else {
- return -EINVAL; //should be a better return code
- }
-
- return OK;
-}
-
-status_t BufferQueue::releaseBuffer(int buf, EGLDisplay display,
- EGLSyncKHR fence) {
- ATRACE_CALL();
- ATRACE_BUFFER_INDEX(buf);
-
- Mutex::Autolock _l(mMutex);
-
- if (buf == INVALID_BUFFER_SLOT) {
- return -EINVAL;
- }
-
- mSlots[buf].mEglDisplay = display;
- mSlots[buf].mFence = fence;
-
- // The current buffer becomes FREE if it was still in the queued
- // state. If it has already been given to the client
- // (synchronous mode), then it stays in DEQUEUED state.
- if (mSlots[buf].mBufferState == BufferSlot::QUEUED
- || mSlots[buf].mBufferState == BufferSlot::ACQUIRED) {
- mSlots[buf].mBufferState = BufferSlot::FREE;
- }
- mDequeueCondition.signal();
-
- return OK;
-}
-
-status_t BufferQueue::consumerDisconnect() {
- Mutex::Autolock lock(mMutex);
- // Once the SurfaceTexture disconnects, the BufferQueue
- // is considered abandoned
- mAbandoned = true;
- freeAllBuffersLocked();
- mDequeueCondition.signal();
- return OK;
-}
-
-status_t BufferQueue::setDefaultBufferSize(uint32_t w, uint32_t h)
-{
- ST_LOGV("setDefaultBufferSize: w=%d, h=%d", w, h);
- if (!w || !h) {
- ST_LOGE("setDefaultBufferSize: dimensions cannot be 0 (w=%d, h=%d)",
- w, h);
- return BAD_VALUE;
- }
-
- Mutex::Autolock lock(mMutex);
- mDefaultWidth = w;
- mDefaultHeight = h;
- return OK;
-}
-
-status_t BufferQueue::setBufferCountServer(int bufferCount) {
- ATRACE_CALL();
- Mutex::Autolock lock(mMutex);
- return setBufferCountServerLocked(bufferCount);
-}
-
-void BufferQueue::freeAllBuffersExceptHeadLocked() {
- ALOGW_IF(!mQueue.isEmpty(),
- "freeAllBuffersExceptCurrentLocked called but mQueue is not empty");
- int head = -1;
- if (!mQueue.empty()) {
- Fifo::iterator front(mQueue.begin());
- head = *front;
- }
- mBufferHasBeenQueued = false;
- for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
- if (i != head) {
- freeBufferLocked(i);
- }
- }
-}
-
-status_t BufferQueue::drainQueueLocked() {
- while (mSynchronousMode && !mQueue.isEmpty()) {
- mDequeueCondition.wait(mMutex);
- if (mAbandoned) {
- ST_LOGE("drainQueueLocked: BufferQueue has been abandoned!");
- return NO_INIT;
- }
- if (mConnectedApi == NO_CONNECTED_API) {
- ST_LOGE("drainQueueLocked: BufferQueue is not connected!");
- return NO_INIT;
- }
- }
- return NO_ERROR;
-}
-
-status_t BufferQueue::drainQueueAndFreeBuffersLocked() {
- status_t err = drainQueueLocked();
- if (err == NO_ERROR) {
- if (mSynchronousMode) {
- freeAllBuffersLocked();
- } else {
- freeAllBuffersExceptHeadLocked();
- }
- }
- return err;
-}
-
-}; // namespace android
diff --git a/libs/gui/DisplayEventReceiver.cpp b/libs/gui/DisplayEventReceiver.cpp
deleted file mode 100644
index a6790ad..0000000
--- a/libs/gui/DisplayEventReceiver.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <string.h>
-
-#include <utils/Errors.h>
-
-#include <gui/BitTube.h>
-#include <gui/DisplayEventReceiver.h>
-#include <gui/IDisplayEventConnection.h>
-#include <gui/ISurfaceComposer.h>
-
-#include <private/gui/ComposerService.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-DisplayEventReceiver::DisplayEventReceiver() {
- sp<ISurfaceComposer> sf(ComposerService::getComposerService());
- if (sf != NULL) {
- mEventConnection = sf->createDisplayEventConnection();
- if (mEventConnection != NULL) {
- mDataChannel = mEventConnection->getDataChannel();
- }
- }
-}
-
-DisplayEventReceiver::~DisplayEventReceiver() {
-}
-
-status_t DisplayEventReceiver::initCheck() const {
- if (mDataChannel != NULL)
- return NO_ERROR;
- return NO_INIT;
-}
-
-int DisplayEventReceiver::getFd() const {
- if (mDataChannel == NULL)
- return NO_INIT;
-
- return mDataChannel->getFd();
-}
-
-status_t DisplayEventReceiver::setVsyncRate(uint32_t count) {
- if (int32_t(count) < 0)
- return BAD_VALUE;
-
- if (mEventConnection != NULL) {
- mEventConnection->setVsyncRate(count);
- return NO_ERROR;
- }
- return NO_INIT;
-}
-
-status_t DisplayEventReceiver::requestNextVsync() {
- if (mEventConnection != NULL) {
- mEventConnection->requestNextVsync();
- return NO_ERROR;
- }
- return NO_INIT;
-}
-
-
-ssize_t DisplayEventReceiver::getEvents(DisplayEventReceiver::Event* events,
- size_t count) {
- return DisplayEventReceiver::getEvents(mDataChannel, events, count);
-}
-
-ssize_t DisplayEventReceiver::getEvents(const sp<BitTube>& dataChannel,
- Event* events, size_t count)
-{
- ssize_t size = dataChannel->read(events, sizeof(events[0])*count);
- ALOGE_IF(size<0,
- "DisplayEventReceiver::getEvents error (%s)",
- strerror(-size));
- if (size >= 0) {
- // Note: if (size % sizeof(events[0])) != 0, we've got a
- // partial read. This can happen if the queue filed up (ie: if we
- // didn't pull from it fast enough).
- // We discard the partial event and rely on the sender to
- // re-send the event if appropriate (some events, like VSYNC
- // can be lost forever).
-
- // returns number of events read
- size /= sizeof(events[0]);
- }
- return size;
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/libs/gui/IDisplayEventConnection.cpp b/libs/gui/IDisplayEventConnection.cpp
deleted file mode 100644
index 887d176..0000000
--- a/libs/gui/IDisplayEventConnection.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/Timers.h>
-
-#include <binder/Parcel.h>
-#include <binder/IInterface.h>
-
-#include <gui/IDisplayEventConnection.h>
-#include <gui/BitTube.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-enum {
- GET_DATA_CHANNEL = IBinder::FIRST_CALL_TRANSACTION,
- SET_VSYNC_RATE,
- REQUEST_NEXT_VSYNC
-};
-
-class BpDisplayEventConnection : public BpInterface<IDisplayEventConnection>
-{
-public:
- BpDisplayEventConnection(const sp<IBinder>& impl)
- : BpInterface<IDisplayEventConnection>(impl)
- {
- }
-
- virtual sp<BitTube> getDataChannel() const
- {
- Parcel data, reply;
- data.writeInterfaceToken(IDisplayEventConnection::getInterfaceDescriptor());
- remote()->transact(GET_DATA_CHANNEL, data, &reply);
- return new BitTube(reply);
- }
-
- virtual void setVsyncRate(uint32_t count) {
- Parcel data, reply;
- data.writeInterfaceToken(IDisplayEventConnection::getInterfaceDescriptor());
- data.writeInt32(count);
- remote()->transact(SET_VSYNC_RATE, data, &reply);
- }
-
- virtual void requestNextVsync() {
- Parcel data, reply;
- data.writeInterfaceToken(IDisplayEventConnection::getInterfaceDescriptor());
- remote()->transact(REQUEST_NEXT_VSYNC, data, &reply, IBinder::FLAG_ONEWAY);
- }
-};
-
-IMPLEMENT_META_INTERFACE(DisplayEventConnection, "android.gui.DisplayEventConnection");
-
-// ----------------------------------------------------------------------------
-
-status_t BnDisplayEventConnection::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
- case GET_DATA_CHANNEL: {
- CHECK_INTERFACE(IDisplayEventConnection, data, reply);
- sp<BitTube> channel(getDataChannel());
- channel->writeToParcel(reply);
- return NO_ERROR;
- } break;
- case SET_VSYNC_RATE: {
- CHECK_INTERFACE(IDisplayEventConnection, data, reply);
- setVsyncRate(data.readInt32());
- return NO_ERROR;
- } break;
- case REQUEST_NEXT_VSYNC: {
- CHECK_INTERFACE(IDisplayEventConnection, data, reply);
- requestNextVsync();
- return NO_ERROR;
- } break;
- }
- return BBinder::onTransact(code, data, reply, flags);
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/gui/IGraphicBufferAlloc.cpp b/libs/gui/IGraphicBufferAlloc.cpp
deleted file mode 100644
index a70a5e8..0000000
--- a/libs/gui/IGraphicBufferAlloc.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-// tag as surfaceflinger
-#define LOG_TAG "SurfaceFlinger"
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <binder/Parcel.h>
-
-#include <ui/GraphicBuffer.h>
-
-#include <gui/IGraphicBufferAlloc.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-enum {
- CREATE_GRAPHIC_BUFFER = IBinder::FIRST_CALL_TRANSACTION,
-};
-
-class BpGraphicBufferAlloc : public BpInterface<IGraphicBufferAlloc>
-{
-public:
- BpGraphicBufferAlloc(const sp<IBinder>& impl)
- : BpInterface<IGraphicBufferAlloc>(impl)
- {
- }
-
- virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat format, uint32_t usage, status_t* error) {
- Parcel data, reply;
- data.writeInterfaceToken(IGraphicBufferAlloc::getInterfaceDescriptor());
- data.writeInt32(w);
- data.writeInt32(h);
- data.writeInt32(format);
- data.writeInt32(usage);
- remote()->transact(CREATE_GRAPHIC_BUFFER, data, &reply);
- sp<GraphicBuffer> graphicBuffer;
- status_t result = reply.readInt32();
- if (result == NO_ERROR) {
- graphicBuffer = new GraphicBuffer();
- reply.read(*graphicBuffer);
- // reply.readStrongBinder();
- // here we don't even have to read the BufferReference from
- // the parcel, it'll die with the parcel.
- }
- *error = result;
- return graphicBuffer;
- }
-};
-
-IMPLEMENT_META_INTERFACE(GraphicBufferAlloc, "android.ui.IGraphicBufferAlloc");
-
-// ----------------------------------------------------------------------
-
-status_t BnGraphicBufferAlloc::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- // codes that don't require permission check
-
- /* BufferReference just keeps a strong reference to a
- * GraphicBuffer until it is destroyed (that is, until
- * no local or remote process have a reference to it).
- */
- class BufferReference : public BBinder {
- sp<GraphicBuffer> buffer;
- public:
- BufferReference(const sp<GraphicBuffer>& buffer) : buffer(buffer) { }
- };
-
-
- switch(code) {
- case CREATE_GRAPHIC_BUFFER: {
- CHECK_INTERFACE(IGraphicBufferAlloc, data, reply);
- uint32_t w = data.readInt32();
- uint32_t h = data.readInt32();
- PixelFormat format = data.readInt32();
- uint32_t usage = data.readInt32();
- status_t error;
- sp<GraphicBuffer> result =
- createGraphicBuffer(w, h, format, usage, &error);
- reply->writeInt32(error);
- if (result != 0) {
- reply->write(*result);
- // We add a BufferReference to this parcel to make sure the
- // buffer stays alive until the GraphicBuffer object on
- // the other side has been created.
- // This is needed so that the buffer handle can be
- // registered before the buffer is destroyed on implementations
- // that do not use file-descriptors to track their buffers.
- reply->writeStrongBinder( new BufferReference(result) );
- }
- return NO_ERROR;
- } break;
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
-}
-
-}; // namespace android
diff --git a/libs/gui/ISensorEventConnection.cpp b/libs/gui/ISensorEventConnection.cpp
deleted file mode 100644
index 0e51e8e..0000000
--- a/libs/gui/ISensorEventConnection.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/Timers.h>
-
-#include <binder/Parcel.h>
-#include <binder/IInterface.h>
-
-#include <gui/ISensorEventConnection.h>
-#include <gui/BitTube.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-enum {
- GET_SENSOR_CHANNEL = IBinder::FIRST_CALL_TRANSACTION,
- ENABLE_DISABLE,
- SET_EVENT_RATE
-};
-
-class BpSensorEventConnection : public BpInterface<ISensorEventConnection>
-{
-public:
- BpSensorEventConnection(const sp<IBinder>& impl)
- : BpInterface<ISensorEventConnection>(impl)
- {
- }
-
- virtual sp<BitTube> getSensorChannel() const
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor());
- remote()->transact(GET_SENSOR_CHANNEL, data, &reply);
- return new BitTube(reply);
- }
-
- virtual status_t enableDisable(int handle, bool enabled)
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor());
- data.writeInt32(handle);
- data.writeInt32(enabled);
- remote()->transact(ENABLE_DISABLE, data, &reply);
- return reply.readInt32();
- }
-
- virtual status_t setEventRate(int handle, nsecs_t ns)
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor());
- data.writeInt32(handle);
- data.writeInt64(ns);
- remote()->transact(SET_EVENT_RATE, data, &reply);
- return reply.readInt32();
- }
-};
-
-IMPLEMENT_META_INTERFACE(SensorEventConnection, "android.gui.SensorEventConnection");
-
-// ----------------------------------------------------------------------------
-
-status_t BnSensorEventConnection::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
- case GET_SENSOR_CHANNEL: {
- CHECK_INTERFACE(ISensorEventConnection, data, reply);
- sp<BitTube> channel(getSensorChannel());
- channel->writeToParcel(reply);
- return NO_ERROR;
- } break;
- case ENABLE_DISABLE: {
- CHECK_INTERFACE(ISensorEventConnection, data, reply);
- int handle = data.readInt32();
- int enabled = data.readInt32();
- status_t result = enableDisable(handle, enabled);
- reply->writeInt32(result);
- return NO_ERROR;
- } break;
- case SET_EVENT_RATE: {
- CHECK_INTERFACE(ISensorEventConnection, data, reply);
- int handle = data.readInt32();
- int ns = data.readInt64();
- status_t result = setEventRate(handle, ns);
- reply->writeInt32(result);
- return NO_ERROR;
- } break;
- }
- return BBinder::onTransact(code, data, reply, flags);
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/gui/ISensorServer.cpp b/libs/gui/ISensorServer.cpp
deleted file mode 100644
index 7111092..0000000
--- a/libs/gui/ISensorServer.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/Vector.h>
-#include <utils/Timers.h>
-
-#include <binder/Parcel.h>
-#include <binder/IInterface.h>
-
-#include <gui/Sensor.h>
-#include <gui/ISensorServer.h>
-#include <gui/ISensorEventConnection.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-enum {
- GET_SENSOR_LIST = IBinder::FIRST_CALL_TRANSACTION,
- CREATE_SENSOR_EVENT_CONNECTION,
-};
-
-class BpSensorServer : public BpInterface<ISensorServer>
-{
-public:
- BpSensorServer(const sp<IBinder>& impl)
- : BpInterface<ISensorServer>(impl)
- {
- }
-
- virtual Vector<Sensor> getSensorList()
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISensorServer::getInterfaceDescriptor());
- remote()->transact(GET_SENSOR_LIST, data, &reply);
- Sensor s;
- Vector<Sensor> v;
- int32_t n = reply.readInt32();
- v.setCapacity(n);
- while (n--) {
- reply.read(static_cast<Flattenable&>(s));
- v.add(s);
- }
- return v;
- }
-
- virtual sp<ISensorEventConnection> createSensorEventConnection()
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISensorServer::getInterfaceDescriptor());
- remote()->transact(CREATE_SENSOR_EVENT_CONNECTION, data, &reply);
- return interface_cast<ISensorEventConnection>(reply.readStrongBinder());
- }
-};
-
-IMPLEMENT_META_INTERFACE(SensorServer, "android.gui.SensorServer");
-
-// ----------------------------------------------------------------------
-
-status_t BnSensorServer::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
- case GET_SENSOR_LIST: {
- CHECK_INTERFACE(ISensorServer, data, reply);
- Vector<Sensor> v(getSensorList());
- size_t n = v.size();
- reply->writeInt32(n);
- for (size_t i=0 ; i<n ; i++) {
- reply->write(static_cast<const Flattenable&>(v[i]));
- }
- return NO_ERROR;
- } break;
- case CREATE_SENSOR_EVENT_CONNECTION: {
- CHECK_INTERFACE(ISensorServer, data, reply);
- sp<ISensorEventConnection> connection(createSensorEventConnection());
- reply->writeStrongBinder(connection->asBinder());
- return NO_ERROR;
- } break;
- }
- return BBinder::onTransact(code, data, reply, flags);
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/gui/ISurface.cpp b/libs/gui/ISurface.cpp
deleted file mode 100644
index c2ea183..0000000
--- a/libs/gui/ISurface.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define LOG_TAG "ISurface"
-
-#include <stdio.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <binder/Parcel.h>
-
-#include <gui/ISurface.h>
-#include <gui/ISurfaceTexture.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------
-
-class BpSurface : public BpInterface<ISurface>
-{
-public:
- BpSurface(const sp<IBinder>& impl)
- : BpInterface<ISurface>(impl)
- {
- }
-
- virtual sp<ISurfaceTexture> getSurfaceTexture() const {
- Parcel data, reply;
- data.writeInterfaceToken(ISurface::getInterfaceDescriptor());
- remote()->transact(GET_SURFACE_TEXTURE, data, &reply);
- return interface_cast<ISurfaceTexture>(reply.readStrongBinder());
- }
-};
-
-IMPLEMENT_META_INTERFACE(Surface, "android.ui.ISurface");
-
-// ----------------------------------------------------------------------
-
-status_t BnSurface::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
- case GET_SURFACE_TEXTURE: {
- CHECK_INTERFACE(ISurface, data, reply);
- reply->writeStrongBinder( getSurfaceTexture()->asBinder() );
- return NO_ERROR;
- }
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
-}
-
-}; // namespace android
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
deleted file mode 100644
index 1f1794c..0000000
--- a/libs/gui/ISurfaceComposer.cpp
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-// tag as surfaceflinger
-#define LOG_TAG "SurfaceFlinger"
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <binder/Parcel.h>
-#include <binder/IMemory.h>
-#include <binder/IPCThreadState.h>
-#include <binder/IServiceManager.h>
-
-#include <gui/BitTube.h>
-#include <gui/IDisplayEventConnection.h>
-#include <gui/ISurfaceComposer.h>
-#include <gui/ISurfaceTexture.h>
-
-#include <private/gui/LayerState.h>
-
-#include <ui/DisplayInfo.h>
-
-#include <utils/Log.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-class IDisplayEventConnection;
-
-class BpSurfaceComposer : public BpInterface<ISurfaceComposer>
-{
-public:
- BpSurfaceComposer(const sp<IBinder>& impl)
- : BpInterface<ISurfaceComposer>(impl)
- {
- }
-
- virtual sp<ISurfaceComposerClient> createConnection()
- {
- uint32_t n;
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- remote()->transact(BnSurfaceComposer::CREATE_CONNECTION, data, &reply);
- return interface_cast<ISurfaceComposerClient>(reply.readStrongBinder());
- }
-
- virtual sp<IGraphicBufferAlloc> createGraphicBufferAlloc()
- {
- uint32_t n;
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- remote()->transact(BnSurfaceComposer::CREATE_GRAPHIC_BUFFER_ALLOC, data, &reply);
- return interface_cast<IGraphicBufferAlloc>(reply.readStrongBinder());
- }
-
- virtual sp<IMemoryHeap> getCblk() const
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- remote()->transact(BnSurfaceComposer::GET_CBLK, data, &reply);
- return interface_cast<IMemoryHeap>(reply.readStrongBinder());
- }
-
- virtual void setTransactionState(const Vector<ComposerState>& state,
- int orientation, uint32_t flags)
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- Vector<ComposerState>::const_iterator b(state.begin());
- Vector<ComposerState>::const_iterator e(state.end());
- data.writeInt32(state.size());
- for ( ; b != e ; ++b ) {
- b->write(data);
- }
- data.writeInt32(orientation);
- data.writeInt32(flags);
- remote()->transact(BnSurfaceComposer::SET_TRANSACTION_STATE, data, &reply);
- }
-
- virtual void bootFinished()
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- remote()->transact(BnSurfaceComposer::BOOT_FINISHED, data, &reply);
- }
-
- virtual status_t captureScreen(DisplayID dpy,
- sp<IMemoryHeap>* heap,
- uint32_t* width, uint32_t* height, PixelFormat* format,
- uint32_t reqWidth, uint32_t reqHeight,
- uint32_t minLayerZ, uint32_t maxLayerZ)
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- data.writeInt32(dpy);
- data.writeInt32(reqWidth);
- data.writeInt32(reqHeight);
- data.writeInt32(minLayerZ);
- data.writeInt32(maxLayerZ);
- remote()->transact(BnSurfaceComposer::CAPTURE_SCREEN, data, &reply);
- *heap = interface_cast<IMemoryHeap>(reply.readStrongBinder());
- *width = reply.readInt32();
- *height = reply.readInt32();
- *format = reply.readInt32();
- return reply.readInt32();
- }
-
- virtual status_t turnElectronBeamOff(int32_t mode)
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- data.writeInt32(mode);
- remote()->transact(BnSurfaceComposer::TURN_ELECTRON_BEAM_OFF, data, &reply);
- return reply.readInt32();
- }
-
- virtual status_t turnElectronBeamOn(int32_t mode)
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- data.writeInt32(mode);
- remote()->transact(BnSurfaceComposer::TURN_ELECTRON_BEAM_ON, data, &reply);
- return reply.readInt32();
- }
-
- virtual bool authenticateSurfaceTexture(
- const sp<ISurfaceTexture>& surfaceTexture) const
- {
- Parcel data, reply;
- int err = NO_ERROR;
- err = data.writeInterfaceToken(
- ISurfaceComposer::getInterfaceDescriptor());
- if (err != NO_ERROR) {
- ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing "
- "interface descriptor: %s (%d)", strerror(-err), -err);
- return false;
- }
- err = data.writeStrongBinder(surfaceTexture->asBinder());
- if (err != NO_ERROR) {
- ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing "
- "strong binder to parcel: %s (%d)", strerror(-err), -err);
- return false;
- }
- err = remote()->transact(BnSurfaceComposer::AUTHENTICATE_SURFACE, data,
- &reply);
- if (err != NO_ERROR) {
- ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error "
- "performing transaction: %s (%d)", strerror(-err), -err);
- return false;
- }
- int32_t result = 0;
- err = reply.readInt32(&result);
- if (err != NO_ERROR) {
- ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error "
- "retrieving result: %s (%d)", strerror(-err), -err);
- return false;
- }
- return result != 0;
- }
-
- virtual sp<IDisplayEventConnection> createDisplayEventConnection()
- {
- Parcel data, reply;
- sp<IDisplayEventConnection> result;
- int err = data.writeInterfaceToken(
- ISurfaceComposer::getInterfaceDescriptor());
- if (err != NO_ERROR) {
- return result;
- }
- err = remote()->transact(
- BnSurfaceComposer::CREATE_DISPLAY_EVENT_CONNECTION,
- data, &reply);
- if (err != NO_ERROR) {
- ALOGE("ISurfaceComposer::createDisplayEventConnection: error performing "
- "transaction: %s (%d)", strerror(-err), -err);
- return result;
- }
- result = interface_cast<IDisplayEventConnection>(reply.readStrongBinder());
- return result;
- }
-};
-
-IMPLEMENT_META_INTERFACE(SurfaceComposer, "android.ui.ISurfaceComposer");
-
-// ----------------------------------------------------------------------
-
-status_t BnSurfaceComposer::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
- case CREATE_CONNECTION: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- sp<IBinder> b = createConnection()->asBinder();
- reply->writeStrongBinder(b);
- } break;
- case CREATE_GRAPHIC_BUFFER_ALLOC: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- sp<IBinder> b = createGraphicBufferAlloc()->asBinder();
- reply->writeStrongBinder(b);
- } break;
- case SET_TRANSACTION_STATE: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- size_t count = data.readInt32();
- ComposerState s;
- Vector<ComposerState> state;
- state.setCapacity(count);
- for (size_t i=0 ; i<count ; i++) {
- s.read(data);
- state.add(s);
- }
- int orientation = data.readInt32();
- uint32_t flags = data.readInt32();
- setTransactionState(state, orientation, flags);
- } break;
- case BOOT_FINISHED: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- bootFinished();
- } break;
- case GET_CBLK: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- sp<IBinder> b = getCblk()->asBinder();
- reply->writeStrongBinder(b);
- } break;
- case CAPTURE_SCREEN: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- DisplayID dpy = data.readInt32();
- uint32_t reqWidth = data.readInt32();
- uint32_t reqHeight = data.readInt32();
- uint32_t minLayerZ = data.readInt32();
- uint32_t maxLayerZ = data.readInt32();
- sp<IMemoryHeap> heap;
- uint32_t w, h;
- PixelFormat f;
- status_t res = captureScreen(dpy, &heap, &w, &h, &f,
- reqWidth, reqHeight, minLayerZ, maxLayerZ);
- reply->writeStrongBinder(heap->asBinder());
- reply->writeInt32(w);
- reply->writeInt32(h);
- reply->writeInt32(f);
- reply->writeInt32(res);
- } break;
- case TURN_ELECTRON_BEAM_OFF: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- int32_t mode = data.readInt32();
- status_t res = turnElectronBeamOff(mode);
- reply->writeInt32(res);
- } break;
- case TURN_ELECTRON_BEAM_ON: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- int32_t mode = data.readInt32();
- status_t res = turnElectronBeamOn(mode);
- reply->writeInt32(res);
- } break;
- case AUTHENTICATE_SURFACE: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- sp<ISurfaceTexture> surfaceTexture =
- interface_cast<ISurfaceTexture>(data.readStrongBinder());
- int32_t result = authenticateSurfaceTexture(surfaceTexture) ? 1 : 0;
- reply->writeInt32(result);
- } break;
- case CREATE_DISPLAY_EVENT_CONNECTION: {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- sp<IDisplayEventConnection> connection(createDisplayEventConnection());
- reply->writeStrongBinder(connection->asBinder());
- return NO_ERROR;
- } break;
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
- return NO_ERROR;
-}
-
-// ----------------------------------------------------------------------------
-
-};
diff --git a/libs/gui/ISurfaceComposerClient.cpp b/libs/gui/ISurfaceComposerClient.cpp
deleted file mode 100644
index ca9ed5b..0000000
--- a/libs/gui/ISurfaceComposerClient.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-// tag as surfaceflinger
-#define LOG_TAG "SurfaceFlinger"
-
-#include <stdio.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <binder/Parcel.h>
-#include <binder/IMemory.h>
-#include <binder/IPCThreadState.h>
-#include <binder/IServiceManager.h>
-
-#include <ui/Point.h>
-#include <ui/Rect.h>
-
-#include <gui/ISurface.h>
-#include <gui/ISurfaceComposerClient.h>
-#include <private/gui/LayerState.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-enum {
- CREATE_SURFACE = IBinder::FIRST_CALL_TRANSACTION,
- DESTROY_SURFACE
-};
-
-class BpSurfaceComposerClient : public BpInterface<ISurfaceComposerClient>
-{
-public:
- BpSurfaceComposerClient(const sp<IBinder>& impl)
- : BpInterface<ISurfaceComposerClient>(impl)
- {
- }
-
- virtual sp<ISurface> createSurface( surface_data_t* params,
- const String8& name,
- DisplayID display,
- uint32_t w,
- uint32_t h,
- PixelFormat format,
- uint32_t flags)
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposerClient::getInterfaceDescriptor());
- data.writeString8(name);
- data.writeInt32(display);
- data.writeInt32(w);
- data.writeInt32(h);
- data.writeInt32(format);
- data.writeInt32(flags);
- remote()->transact(CREATE_SURFACE, data, &reply);
- params->readFromParcel(reply);
- return interface_cast<ISurface>(reply.readStrongBinder());
- }
-
- virtual status_t destroySurface(SurfaceID sid)
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceComposerClient::getInterfaceDescriptor());
- data.writeInt32(sid);
- remote()->transact(DESTROY_SURFACE, data, &reply);
- return reply.readInt32();
- }
-};
-
-IMPLEMENT_META_INTERFACE(SurfaceComposerClient, "android.ui.ISurfaceComposerClient");
-
-// ----------------------------------------------------------------------
-
-status_t BnSurfaceComposerClient::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
- case CREATE_SURFACE: {
- CHECK_INTERFACE(ISurfaceComposerClient, data, reply);
- surface_data_t params;
- String8 name = data.readString8();
- DisplayID display = data.readInt32();
- uint32_t w = data.readInt32();
- uint32_t h = data.readInt32();
- PixelFormat format = data.readInt32();
- uint32_t flags = data.readInt32();
- sp<ISurface> s = createSurface(¶ms, name, display, w, h,
- format, flags);
- params.writeToParcel(reply);
- reply->writeStrongBinder(s->asBinder());
- return NO_ERROR;
- } break;
- case DESTROY_SURFACE: {
- CHECK_INTERFACE(ISurfaceComposerClient, data, reply);
- reply->writeInt32( destroySurface( data.readInt32() ) );
- return NO_ERROR;
- } break;
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
-}
-
-// ----------------------------------------------------------------------
-
-status_t ISurfaceComposerClient::surface_data_t::readFromParcel(const Parcel& parcel)
-{
- token = parcel.readInt32();
- identity = parcel.readInt32();
- return NO_ERROR;
-}
-
-status_t ISurfaceComposerClient::surface_data_t::writeToParcel(Parcel* parcel) const
-{
- parcel->writeInt32(token);
- parcel->writeInt32(identity);
- return NO_ERROR;
-}
-
-}; // namespace android
diff --git a/libs/gui/ISurfaceTexture.cpp b/libs/gui/ISurfaceTexture.cpp
deleted file mode 100644
index d2e5627..0000000
--- a/libs/gui/ISurfaceTexture.cpp
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/Vector.h>
-#include <utils/Timers.h>
-
-#include <binder/Parcel.h>
-#include <binder/IInterface.h>
-
-#include <gui/ISurfaceTexture.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-enum {
- REQUEST_BUFFER = IBinder::FIRST_CALL_TRANSACTION,
- SET_BUFFER_COUNT,
- DEQUEUE_BUFFER,
- QUEUE_BUFFER,
- CANCEL_BUFFER,
- SET_CROP,
- SET_TRANSFORM,
- QUERY,
- SET_SYNCHRONOUS_MODE,
- CONNECT,
- DISCONNECT,
- SET_SCALING_MODE,
-};
-
-
-class BpSurfaceTexture : public BpInterface<ISurfaceTexture>
-{
-public:
- BpSurfaceTexture(const sp<IBinder>& impl)
- : BpInterface<ISurfaceTexture>(impl)
- {
- }
-
- virtual status_t requestBuffer(int bufferIdx, sp<GraphicBuffer>* buf) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(bufferIdx);
- status_t result =remote()->transact(REQUEST_BUFFER, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- bool nonNull = reply.readInt32();
- if (nonNull) {
- *buf = new GraphicBuffer();
- reply.read(**buf);
- }
- result = reply.readInt32();
- return result;
- }
-
- virtual status_t setBufferCount(int bufferCount)
- {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(bufferCount);
- status_t result =remote()->transact(SET_BUFFER_COUNT, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- result = reply.readInt32();
- return result;
- }
-
- virtual status_t dequeueBuffer(int *buf, uint32_t w, uint32_t h,
- uint32_t format, uint32_t usage) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(w);
- data.writeInt32(h);
- data.writeInt32(format);
- data.writeInt32(usage);
- status_t result = remote()->transact(DEQUEUE_BUFFER, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- *buf = reply.readInt32();
- result = reply.readInt32();
- return result;
- }
-
- virtual status_t queueBuffer(int buf, int64_t timestamp,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(buf);
- data.writeInt64(timestamp);
- status_t result = remote()->transact(QUEUE_BUFFER, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- *outWidth = reply.readInt32();
- *outHeight = reply.readInt32();
- *outTransform = reply.readInt32();
- result = reply.readInt32();
- return result;
- }
-
- virtual void cancelBuffer(int buf) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(buf);
- remote()->transact(CANCEL_BUFFER, data, &reply);
- }
-
- virtual status_t setCrop(const Rect& reg) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeFloat(reg.left);
- data.writeFloat(reg.top);
- data.writeFloat(reg.right);
- data.writeFloat(reg.bottom);
- status_t result = remote()->transact(SET_CROP, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- result = reply.readInt32();
- return result;
- }
-
- virtual status_t setTransform(uint32_t transform) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(transform);
- status_t result = remote()->transact(SET_TRANSFORM, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- result = reply.readInt32();
- return result;
- }
-
- virtual status_t setScalingMode(int mode) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(mode);
- status_t result = remote()->transact(SET_SCALING_MODE, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- result = reply.readInt32();
- return result;
- }
-
- virtual int query(int what, int* value) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(what);
- status_t result = remote()->transact(QUERY, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- value[0] = reply.readInt32();
- result = reply.readInt32();
- return result;
- }
-
- virtual status_t setSynchronousMode(bool enabled) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(enabled);
- status_t result = remote()->transact(SET_SYNCHRONOUS_MODE, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- result = reply.readInt32();
- return result;
- }
-
- virtual status_t connect(int api,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(api);
- status_t result = remote()->transact(CONNECT, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- *outWidth = reply.readInt32();
- *outHeight = reply.readInt32();
- *outTransform = reply.readInt32();
- result = reply.readInt32();
- return result;
- }
-
- virtual status_t disconnect(int api) {
- Parcel data, reply;
- data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
- data.writeInt32(api);
- status_t result =remote()->transact(DISCONNECT, data, &reply);
- if (result != NO_ERROR) {
- return result;
- }
- result = reply.readInt32();
- return result;
- }
-};
-
-IMPLEMENT_META_INTERFACE(SurfaceTexture, "android.gui.SurfaceTexture");
-
-// ----------------------------------------------------------------------
-
-status_t BnSurfaceTexture::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
- case REQUEST_BUFFER: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- int bufferIdx = data.readInt32();
- sp<GraphicBuffer> buffer;
- int result = requestBuffer(bufferIdx, &buffer);
- reply->writeInt32(buffer != 0);
- if (buffer != 0) {
- reply->write(*buffer);
- }
- reply->writeInt32(result);
- return NO_ERROR;
- } break;
- case SET_BUFFER_COUNT: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- int bufferCount = data.readInt32();
- int result = setBufferCount(bufferCount);
- reply->writeInt32(result);
- return NO_ERROR;
- } break;
- case DEQUEUE_BUFFER: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- uint32_t w = data.readInt32();
- uint32_t h = data.readInt32();
- uint32_t format = data.readInt32();
- uint32_t usage = data.readInt32();
- int buf;
- int result = dequeueBuffer(&buf, w, h, format, usage);
- reply->writeInt32(buf);
- reply->writeInt32(result);
- return NO_ERROR;
- } break;
- case QUEUE_BUFFER: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- int buf = data.readInt32();
- int64_t timestamp = data.readInt64();
- uint32_t outWidth, outHeight, outTransform;
- status_t result = queueBuffer(buf, timestamp,
- &outWidth, &outHeight, &outTransform);
- reply->writeInt32(outWidth);
- reply->writeInt32(outHeight);
- reply->writeInt32(outTransform);
- reply->writeInt32(result);
- return NO_ERROR;
- } break;
- case CANCEL_BUFFER: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- int buf = data.readInt32();
- cancelBuffer(buf);
- return NO_ERROR;
- } break;
- case SET_CROP: {
- Rect reg;
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- reg.left = data.readFloat();
- reg.top = data.readFloat();
- reg.right = data.readFloat();
- reg.bottom = data.readFloat();
- status_t result = setCrop(reg);
- reply->writeInt32(result);
- return NO_ERROR;
- } break;
- case SET_TRANSFORM: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- uint32_t transform = data.readInt32();
- status_t result = setTransform(transform);
- reply->writeInt32(result);
- return NO_ERROR;
- } break;
- case SET_SCALING_MODE: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- int mode = data.readInt32();
- status_t result = setScalingMode(mode);
- reply->writeInt32(result);
- return NO_ERROR;
- } break;
- case QUERY: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- int value;
- int what = data.readInt32();
- int res = query(what, &value);
- reply->writeInt32(value);
- reply->writeInt32(res);
- return NO_ERROR;
- } break;
- case SET_SYNCHRONOUS_MODE: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- bool enabled = data.readInt32();
- status_t res = setSynchronousMode(enabled);
- reply->writeInt32(res);
- return NO_ERROR;
- } break;
- case CONNECT: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- int api = data.readInt32();
- uint32_t outWidth, outHeight, outTransform;
- status_t res = connect(api,
- &outWidth, &outHeight, &outTransform);
- reply->writeInt32(outWidth);
- reply->writeInt32(outHeight);
- reply->writeInt32(outTransform);
- reply->writeInt32(res);
- return NO_ERROR;
- } break;
- case DISCONNECT: {
- CHECK_INTERFACE(ISurfaceTexture, data, reply);
- int api = data.readInt32();
- status_t res = disconnect(api);
- reply->writeInt32(res);
- return NO_ERROR;
- } break;
- }
- return BBinder::onTransact(code, data, reply, flags);
-}
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
deleted file mode 100644
index 224c305..0000000
--- a/libs/gui/LayerState.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#include <utils/Errors.h>
-#include <binder/Parcel.h>
-#include <gui/ISurfaceComposerClient.h>
-#include <private/gui/LayerState.h>
-
-namespace android {
-
-status_t layer_state_t::write(Parcel& output) const
-{
- status_t err;
-
- size_t len = transparentRegion.write(NULL, 0);
- err = output.writeInt32(len);
- if (err < NO_ERROR) return err;
-
- void* buf = output.writeInplace(len);
- if (buf == NULL) return NO_MEMORY;
-
- err = transparentRegion.write(buf, len);
- if (err < NO_ERROR) return err;
-
- // NOTE: regions are at the end of the structure
- size_t size = sizeof(layer_state_t);
- size -= sizeof(transparentRegion);
- err = output.write(this, size);
- return err;
-}
-
-status_t layer_state_t::read(const Parcel& input)
-{
- status_t err;
- size_t len = input.readInt32();
- void const* buf = input.readInplace(len);
- if (buf == NULL) return NO_MEMORY;
-
- err = transparentRegion.read(buf);
- if (err < NO_ERROR) return err;
-
- // NOTE: regions are at the end of the structure
- size_t size = sizeof(layer_state_t);
- size -= sizeof(transparentRegion);
- input.read(this, size);
- return NO_ERROR;
-}
-
-status_t ComposerState::write(Parcel& output) const {
- output.writeStrongBinder(client->asBinder());
- return state.write(output);
-}
-
-status_t ComposerState::read(const Parcel& input) {
- client = interface_cast<ISurfaceComposerClient>(input.readStrongBinder());
- return state.read(input);
-}
-
-}; // namespace android
diff --git a/libs/gui/Sensor.cpp b/libs/gui/Sensor.cpp
deleted file mode 100644
index f9a2c046..0000000
--- a/libs/gui/Sensor.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/String8.h>
-#include <utils/Flattenable.h>
-
-#include <hardware/sensors.h>
-
-#include <gui/Sensor.h>
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-Sensor::Sensor()
- : mHandle(0), mType(0),
- mMinValue(0), mMaxValue(0), mResolution(0),
- mPower(0), mMinDelay(0)
-{
-}
-
-Sensor::Sensor(struct sensor_t const* hwSensor)
-{
- mName = hwSensor->name;
- mVendor = hwSensor->vendor;
- mHandle = hwSensor->handle;
- mType = hwSensor->type;
- mMinValue = 0; // FIXME: minValue
- mMaxValue = hwSensor->maxRange; // FIXME: maxValue
- mResolution = hwSensor->resolution;
- mPower = hwSensor->power;
- mMinDelay = hwSensor->minDelay;
-}
-
-Sensor::~Sensor()
-{
-}
-
-const String8& Sensor::getName() const {
- return mName;
-}
-
-const String8& Sensor::getVendor() const {
- return mVendor;
-}
-
-int32_t Sensor::getHandle() const {
- return mHandle;
-}
-
-int32_t Sensor::getType() const {
- return mType;
-}
-
-float Sensor::getMinValue() const {
- return mMinValue;
-}
-
-float Sensor::getMaxValue() const {
- return mMaxValue;
-}
-
-float Sensor::getResolution() const {
- return mResolution;
-}
-
-float Sensor::getPowerUsage() const {
- return mPower;
-}
-
-int32_t Sensor::getMinDelay() const {
- return mMinDelay;
-}
-
-nsecs_t Sensor::getMinDelayNs() const {
- return getMinDelay() * 1000;
-}
-
-int32_t Sensor::getVersion() const {
- return mVersion;
-}
-
-size_t Sensor::getFlattenedSize() const
-{
- return sizeof(int32_t) + ((mName.length() + 3) & ~3) +
- sizeof(int32_t) + ((mVendor.length() + 3) & ~3) +
- sizeof(int32_t) * 2 +
- sizeof(float) * 4 +
- sizeof(int32_t);
-}
-
-size_t Sensor::getFdCount() const
-{
- return 0;
-}
-
-static inline
-size_t write(void* buffer, size_t offset, const String8& value) {
- memcpy(static_cast<char*>(buffer) + offset, value.string(), value.length());
- return (value.length() + 3) & ~3;
-}
-
-static inline
-size_t write(void* buffer, size_t offset, float value) {
- *reinterpret_cast<float*>(static_cast<char*>(buffer) + offset) = value;
- return sizeof(float);
-}
-
-static inline
-size_t write(void* buffer, size_t offset, int32_t value) {
- *reinterpret_cast<int32_t*>(static_cast<char*>(buffer) + offset) = value;
- return sizeof(int32_t);
-}
-
-status_t Sensor::flatten(void* buffer, size_t size,
- int fds[], size_t count) const
-{
- if (size < Sensor::getFlattenedSize())
- return -ENOMEM;
-
- size_t offset = 0;
- offset += write(buffer, offset, int32_t(mName.length()));
- offset += write(buffer, offset, mName);
- offset += write(buffer, offset, int32_t(mVendor.length()));
- offset += write(buffer, offset, mVendor);
- offset += write(buffer, offset, mHandle);
- offset += write(buffer, offset, mType);
- offset += write(buffer, offset, mMinValue);
- offset += write(buffer, offset, mMaxValue);
- offset += write(buffer, offset, mResolution);
- offset += write(buffer, offset, mPower);
- offset += write(buffer, offset, mMinDelay);
-
- return NO_ERROR;
-}
-
-static inline
-size_t read(void const* buffer, size_t offset, String8* value, int32_t len) {
- value->setTo(static_cast<char const*>(buffer) + offset, len);
- return (len + 3) & ~3;
-}
-
-static inline
-size_t read(void const* buffer, size_t offset, float* value) {
- *value = *reinterpret_cast<float const*>(static_cast<char const*>(buffer) + offset);
- return sizeof(float);
-}
-
-static inline
-size_t read(void const* buffer, size_t offset, int32_t* value) {
- *value = *reinterpret_cast<int32_t const*>(static_cast<char const*>(buffer) + offset);
- return sizeof(int32_t);
-}
-
-status_t Sensor::unflatten(void const* buffer, size_t size,
- int fds[], size_t count)
-{
- int32_t len;
- size_t offset = 0;
- offset += read(buffer, offset, &len);
- offset += read(buffer, offset, &mName, len);
- offset += read(buffer, offset, &len);
- offset += read(buffer, offset, &mVendor, len);
- offset += read(buffer, offset, &mHandle);
- offset += read(buffer, offset, &mType);
- offset += read(buffer, offset, &mMinValue);
- offset += read(buffer, offset, &mMaxValue);
- offset += read(buffer, offset, &mResolution);
- offset += read(buffer, offset, &mPower);
- offset += read(buffer, offset, &mMinDelay);
-
- return NO_ERROR;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/gui/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp
deleted file mode 100644
index b95dd902..0000000
--- a/libs/gui/SensorEventQueue.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#define LOG_TAG "Sensors"
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/Looper.h>
-
-#include <gui/Sensor.h>
-#include <gui/BitTube.h>
-#include <gui/SensorEventQueue.h>
-#include <gui/ISensorEventConnection.h>
-
-#include <android/sensor.h>
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-SensorEventQueue::SensorEventQueue(const sp<ISensorEventConnection>& connection)
- : mSensorEventConnection(connection)
-{
-}
-
-SensorEventQueue::~SensorEventQueue()
-{
-}
-
-void SensorEventQueue::onFirstRef()
-{
- mSensorChannel = mSensorEventConnection->getSensorChannel();
-}
-
-int SensorEventQueue::getFd() const
-{
- return mSensorChannel->getFd();
-}
-
-ssize_t SensorEventQueue::write(ASensorEvent const* events, size_t numEvents)
-{
- ssize_t size = mSensorChannel->write(events, numEvents * sizeof(events[0]));
- if (size >= 0) {
- if (size % sizeof(events[0])) {
- // partial write!!! should never happen.
- return -EINVAL;
- }
- // returns number of events written
- size /= sizeof(events[0]);
- }
- return size;
-}
-
-ssize_t SensorEventQueue::read(ASensorEvent* events, size_t numEvents)
-{
- ssize_t size = mSensorChannel->read(events, numEvents*sizeof(events[0]));
- ALOGE_IF(size<0 && size!=-EAGAIN,
- "SensorChannel::read error (%s)", strerror(-size));
- if (size >= 0) {
- if (size % sizeof(events[0])) {
- // partial read!!! should never happen.
- ALOGE("SensorEventQueue partial read (event-size=%u, read=%d)",
- sizeof(events[0]), int(size));
- return -EINVAL;
- }
- // returns number of events read
- size /= sizeof(events[0]);
- }
- return size;
-}
-
-sp<Looper> SensorEventQueue::getLooper() const
-{
- Mutex::Autolock _l(mLock);
- if (mLooper == 0) {
- mLooper = new Looper(true);
- mLooper->addFd(getFd(), getFd(), ALOOPER_EVENT_INPUT, NULL, NULL);
- }
- return mLooper;
-}
-
-status_t SensorEventQueue::waitForEvent() const
-{
- const int fd = getFd();
- sp<Looper> looper(getLooper());
-
- int32_t result;
- do {
- result = looper->pollOnce(-1);
- if (result == ALOOPER_EVENT_ERROR) {
- ALOGE("SensorEventQueue::waitForEvent error (errno=%d)", errno);
- result = -EPIPE; // unknown error, so we make up one
- break;
- }
- } while (result != fd);
-
- return (result == fd) ? status_t(NO_ERROR) : result;
-}
-
-status_t SensorEventQueue::wake() const
-{
- sp<Looper> looper(getLooper());
- looper->wake();
- return NO_ERROR;
-}
-
-status_t SensorEventQueue::enableSensor(Sensor const* sensor) const {
- return mSensorEventConnection->enableDisable(sensor->getHandle(), true);
-}
-
-status_t SensorEventQueue::disableSensor(Sensor const* sensor) const {
- return mSensorEventConnection->enableDisable(sensor->getHandle(), false);
-}
-
-status_t SensorEventQueue::enableSensor(int32_t handle, int32_t us) const {
- status_t err = mSensorEventConnection->enableDisable(handle, true);
- if (err == NO_ERROR) {
- mSensorEventConnection->setEventRate(handle, us2ns(us));
- }
- return err;
-}
-
-status_t SensorEventQueue::disableSensor(int32_t handle) const {
- return mSensorEventConnection->enableDisable(handle, false);
-}
-
-status_t SensorEventQueue::setEventRate(Sensor const* sensor, nsecs_t ns) const {
- return mSensorEventConnection->setEventRate(sensor->getHandle(), ns);
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
diff --git a/libs/gui/SensorManager.cpp b/libs/gui/SensorManager.cpp
deleted file mode 100644
index b80da56..0000000
--- a/libs/gui/SensorManager.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#define LOG_TAG "Sensors"
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-#include <utils/Singleton.h>
-
-#include <binder/IBinder.h>
-#include <binder/IServiceManager.h>
-
-#include <gui/ISensorServer.h>
-#include <gui/ISensorEventConnection.h>
-#include <gui/Sensor.h>
-#include <gui/SensorManager.h>
-#include <gui/SensorEventQueue.h>
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-ANDROID_SINGLETON_STATIC_INSTANCE(SensorManager)
-
-SensorManager::SensorManager()
- : mSensorList(0)
-{
- // okay we're not locked here, but it's not needed during construction
- assertStateLocked();
-}
-
-SensorManager::~SensorManager()
-{
- free(mSensorList);
-}
-
-void SensorManager::sensorManagerDied()
-{
- Mutex::Autolock _l(mLock);
- mSensorServer.clear();
- free(mSensorList);
- mSensorList = NULL;
- mSensors.clear();
-}
-
-status_t SensorManager::assertStateLocked() const {
- if (mSensorServer == NULL) {
- // try for one second
- const String16 name("sensorservice");
- for (int i=0 ; i<4 ; i++) {
- status_t err = getService(name, &mSensorServer);
- if (err == NAME_NOT_FOUND) {
- usleep(250000);
- continue;
- }
- if (err != NO_ERROR) {
- return err;
- }
- break;
- }
-
- class DeathObserver : public IBinder::DeathRecipient {
- SensorManager& mSensorManger;
- virtual void binderDied(const wp<IBinder>& who) {
- ALOGW("sensorservice died [%p]", who.unsafe_get());
- mSensorManger.sensorManagerDied();
- }
- public:
- DeathObserver(SensorManager& mgr) : mSensorManger(mgr) { }
- };
-
- mDeathObserver = new DeathObserver(*const_cast<SensorManager *>(this));
- mSensorServer->asBinder()->linkToDeath(mDeathObserver);
-
- mSensors = mSensorServer->getSensorList();
- size_t count = mSensors.size();
- mSensorList = (Sensor const**)malloc(count * sizeof(Sensor*));
- for (size_t i=0 ; i<count ; i++) {
- mSensorList[i] = mSensors.array() + i;
- }
- }
-
- return NO_ERROR;
-}
-
-
-
-ssize_t SensorManager::getSensorList(Sensor const* const** list) const
-{
- Mutex::Autolock _l(mLock);
- status_t err = assertStateLocked();
- if (err < 0) {
- return ssize_t(err);
- }
- *list = mSensorList;
- return mSensors.size();
-}
-
-Sensor const* SensorManager::getDefaultSensor(int type)
-{
- Mutex::Autolock _l(mLock);
- if (assertStateLocked() == NO_ERROR) {
- // For now we just return the first sensor of that type we find.
- // in the future it will make sense to let the SensorService make
- // that decision.
- for (size_t i=0 ; i<mSensors.size() ; i++) {
- if (mSensorList[i]->getType() == type)
- return mSensorList[i];
- }
- }
- return NULL;
-}
-
-sp<SensorEventQueue> SensorManager::createEventQueue()
-{
- sp<SensorEventQueue> queue;
-
- Mutex::Autolock _l(mLock);
- while (assertStateLocked() == NO_ERROR) {
- sp<ISensorEventConnection> connection =
- mSensorServer->createSensorEventConnection();
- if (connection == NULL) {
- // SensorService just died.
- ALOGE("createEventQueue: connection is NULL. SensorService died.");
- continue;
- }
- queue = new SensorEventQueue(connection);
- break;
- }
- return queue;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
deleted file mode 100644
index 72b27ed..0000000
--- a/libs/gui/Surface.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define LOG_TAG "Surface"
-
-#include <stdint.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <utils/CallStack.h>
-#include <utils/Errors.h>
-#include <utils/Log.h>
-#include <utils/threads.h>
-
-#include <binder/IPCThreadState.h>
-
-#include <ui/DisplayInfo.h>
-#include <ui/GraphicBuffer.h>
-#include <ui/Rect.h>
-
-#include <gui/ISurface.h>
-#include <gui/ISurfaceComposer.h>
-#include <gui/Surface.h>
-#include <gui/SurfaceComposerClient.h>
-#include <gui/SurfaceTextureClient.h>
-
-namespace android {
-
-// ============================================================================
-// SurfaceControl
-// ============================================================================
-
-SurfaceControl::SurfaceControl(
- const sp<SurfaceComposerClient>& client,
- const sp<ISurface>& surface,
- const ISurfaceComposerClient::surface_data_t& data)
- : mClient(client), mSurface(surface),
- mToken(data.token), mIdentity(data.identity)
-{
-}
-
-SurfaceControl::~SurfaceControl()
-{
- destroy();
-}
-
-void SurfaceControl::destroy()
-{
- if (isValid()) {
- mClient->destroySurface(mToken);
- }
-
- // clear all references and trigger an IPC now, to make sure things
- // happen without delay, since these resources are quite heavy.
- mClient.clear();
- mSurface.clear();
- IPCThreadState::self()->flushCommands();
-}
-
-void SurfaceControl::clear()
-{
- // here, the window manager tells us explicitly that we should destroy
- // the surface's resource. Soon after this call, it will also release
- // its last reference (which will call the dtor); however, it is possible
- // that a client living in the same process still holds references which
- // would delay the call to the dtor -- that is why we need this explicit
- // "clear()" call.
- destroy();
-}
-
-bool SurfaceControl::isSameSurface(
- const sp<SurfaceControl>& lhs, const sp<SurfaceControl>& rhs)
-{
- if (lhs == 0 || rhs == 0)
- return false;
- return lhs->mSurface->asBinder() == rhs->mSurface->asBinder();
-}
-
-status_t SurfaceControl::setLayer(int32_t layer) {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->setLayer(mToken, layer);
-}
-status_t SurfaceControl::setPosition(int32_t x, int32_t y) {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->setPosition(mToken, x, y);
-}
-status_t SurfaceControl::setSize(uint32_t w, uint32_t h) {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->setSize(mToken, w, h);
-}
-status_t SurfaceControl::hide() {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->hide(mToken);
-}
-status_t SurfaceControl::show(int32_t layer) {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->show(mToken, layer);
-}
-status_t SurfaceControl::freeze() {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->freeze(mToken);
-}
-status_t SurfaceControl::unfreeze() {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->unfreeze(mToken);
-}
-status_t SurfaceControl::setFlags(uint32_t flags, uint32_t mask) {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->setFlags(mToken, flags, mask);
-}
-status_t SurfaceControl::setTransparentRegionHint(const Region& transparent) {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->setTransparentRegionHint(mToken, transparent);
-}
-status_t SurfaceControl::setAlpha(float alpha) {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->setAlpha(mToken, alpha);
-}
-status_t SurfaceControl::setMatrix(float dsdx, float dtdx, float dsdy, float dtdy) {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->setMatrix(mToken, dsdx, dtdx, dsdy, dtdy);
-}
-status_t SurfaceControl::setFreezeTint(uint32_t tint) {
- status_t err = validate();
- if (err < 0) return err;
- const sp<SurfaceComposerClient>& client(mClient);
- return client->setFreezeTint(mToken, tint);
-}
-
-status_t SurfaceControl::validate() const
-{
- if (mToken<0 || mClient==0) {
- ALOGE("invalid token (%d, identity=%u) or client (%p)",
- mToken, mIdentity, mClient.get());
- return NO_INIT;
- }
- return NO_ERROR;
-}
-
-status_t SurfaceControl::writeSurfaceToParcel(
- const sp<SurfaceControl>& control, Parcel* parcel)
-{
- sp<ISurface> sur;
- uint32_t identity = 0;
- if (SurfaceControl::isValid(control)) {
- sur = control->mSurface;
- identity = control->mIdentity;
- }
- parcel->writeStrongBinder(sur!=0 ? sur->asBinder() : NULL);
- parcel->writeStrongBinder(NULL); // NULL ISurfaceTexture in this case.
- parcel->writeInt32(identity);
- return NO_ERROR;
-}
-
-sp<Surface> SurfaceControl::getSurface() const
-{
- Mutex::Autolock _l(mLock);
- if (mSurfaceData == 0) {
- sp<SurfaceControl> surface_control(const_cast<SurfaceControl*>(this));
- mSurfaceData = new Surface(surface_control);
- }
- return mSurfaceData;
-}
-
-// ============================================================================
-// Surface
-// ============================================================================
-
-// ---------------------------------------------------------------------------
-
-Surface::Surface(const sp<SurfaceControl>& surface)
- : SurfaceTextureClient(),
- mSurface(surface->mSurface),
- mIdentity(surface->mIdentity)
-{
- sp<ISurfaceTexture> st;
- if (mSurface != NULL) {
- st = mSurface->getSurfaceTexture();
- }
- init(st);
-}
-
-Surface::Surface(const Parcel& parcel, const sp<IBinder>& ref)
- : SurfaceTextureClient()
-{
- mSurface = interface_cast<ISurface>(ref);
- sp<IBinder> st_binder(parcel.readStrongBinder());
- sp<ISurfaceTexture> st;
- if (st_binder != NULL) {
- st = interface_cast<ISurfaceTexture>(st_binder);
- } else if (mSurface != NULL) {
- st = mSurface->getSurfaceTexture();
- }
-
- mIdentity = parcel.readInt32();
- init(st);
-}
-
-Surface::Surface(const sp<ISurfaceTexture>& st)
- : SurfaceTextureClient(),
- mSurface(NULL),
- mIdentity(0)
-{
- init(st);
-}
-
-status_t Surface::writeToParcel(
- const sp<Surface>& surface, Parcel* parcel)
-{
- sp<ISurface> sur;
- sp<ISurfaceTexture> st;
- uint32_t identity = 0;
- if (Surface::isValid(surface)) {
- sur = surface->mSurface;
- st = surface->getISurfaceTexture();
- identity = surface->mIdentity;
- } else if (surface != 0 &&
- (surface->mSurface != NULL ||
- surface->getISurfaceTexture() != NULL)) {
- ALOGE("Parceling invalid surface with non-NULL ISurface/ISurfaceTexture as NULL: "
- "mSurface = %p, surfaceTexture = %p, mIdentity = %d, ",
- surface->mSurface.get(), surface->getISurfaceTexture().get(),
- surface->mIdentity);
- }
-
- parcel->writeStrongBinder(sur != NULL ? sur->asBinder() : NULL);
- parcel->writeStrongBinder(st != NULL ? st->asBinder() : NULL);
- parcel->writeInt32(identity);
- return NO_ERROR;
-
-}
-
-Mutex Surface::sCachedSurfacesLock;
-DefaultKeyedVector<wp<IBinder>, wp<Surface> > Surface::sCachedSurfaces;
-
-sp<Surface> Surface::readFromParcel(const Parcel& data) {
- Mutex::Autolock _l(sCachedSurfacesLock);
- sp<IBinder> binder(data.readStrongBinder());
- sp<Surface> surface = sCachedSurfaces.valueFor(binder).promote();
- if (surface == 0) {
- surface = new Surface(data, binder);
- sCachedSurfaces.add(binder, surface);
- } else {
- // The Surface was found in the cache, but we still should clear any
- // remaining data from the parcel.
- data.readStrongBinder(); // ISurfaceTexture
- data.readInt32(); // identity
- }
- if (surface->mSurface == NULL && surface->getISurfaceTexture() == NULL) {
- surface = 0;
- }
- cleanCachedSurfacesLocked();
- return surface;
-}
-
-// Remove the stale entries from the surface cache. This should only be called
-// with sCachedSurfacesLock held.
-void Surface::cleanCachedSurfacesLocked() {
- for (int i = sCachedSurfaces.size()-1; i >= 0; --i) {
- wp<Surface> s(sCachedSurfaces.valueAt(i));
- if (s == 0 || s.promote() == 0) {
- sCachedSurfaces.removeItemsAt(i);
- }
- }
-}
-
-void Surface::init(const sp<ISurfaceTexture>& surfaceTexture)
-{
- if (mSurface != NULL || surfaceTexture != NULL) {
- ALOGE_IF(surfaceTexture==0, "got a NULL ISurfaceTexture from ISurface");
- if (surfaceTexture != NULL) {
- setISurfaceTexture(surfaceTexture);
- setUsage(GraphicBuffer::USAGE_HW_RENDER);
- }
-
- DisplayInfo dinfo;
- SurfaceComposerClient::getDisplayInfo(0, &dinfo);
- const_cast<float&>(ANativeWindow::xdpi) = dinfo.xdpi;
- const_cast<float&>(ANativeWindow::ydpi) = dinfo.ydpi;
- const_cast<uint32_t&>(ANativeWindow::flags) = 0;
- }
-}
-
-Surface::~Surface()
-{
- // clear all references and trigger an IPC now, to make sure things
- // happen without delay, since these resources are quite heavy.
- mSurface.clear();
- IPCThreadState::self()->flushCommands();
-}
-
-bool Surface::isValid() {
- return getISurfaceTexture() != NULL;
-}
-
-sp<ISurfaceTexture> Surface::getSurfaceTexture() {
- return getISurfaceTexture();
-}
-
-sp<IBinder> Surface::asBinder() const {
- return mSurface!=0 ? mSurface->asBinder() : 0;
-}
-
-// ----------------------------------------------------------------------------
-
-int Surface::query(int what, int* value) const {
- switch (what) {
- case NATIVE_WINDOW_CONCRETE_TYPE:
- *value = NATIVE_WINDOW_SURFACE;
- return NO_ERROR;
- }
- return SurfaceTextureClient::query(what, value);
-}
-
-// ----------------------------------------------------------------------------
-
-status_t Surface::lock(SurfaceInfo* other, Region* inOutDirtyRegion) {
- ANativeWindow_Buffer outBuffer;
-
- ARect temp;
- ARect* inOutDirtyBounds = NULL;
- if (inOutDirtyRegion) {
- temp = inOutDirtyRegion->getBounds();
- inOutDirtyBounds = &temp;
- }
-
- status_t err = SurfaceTextureClient::lock(&outBuffer, inOutDirtyBounds);
-
- if (err == NO_ERROR) {
- other->w = uint32_t(outBuffer.width);
- other->h = uint32_t(outBuffer.height);
- other->s = uint32_t(outBuffer.stride);
- other->usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
- other->format = uint32_t(outBuffer.format);
- other->bits = outBuffer.bits;
- }
-
- if (inOutDirtyRegion) {
- inOutDirtyRegion->set( static_cast<Rect const&>(temp) );
- }
-
- return err;
-}
-
-status_t Surface::unlockAndPost() {
- return SurfaceTextureClient::unlockAndPost();
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
deleted file mode 100644
index ceb1ba6..0000000
--- a/libs/gui/SurfaceComposerClient.cpp
+++ /dev/null
@@ -1,603 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define LOG_TAG "SurfaceComposerClient"
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/Log.h>
-#include <utils/Singleton.h>
-#include <utils/SortedVector.h>
-#include <utils/String8.h>
-#include <utils/threads.h>
-
-#include <binder/IMemory.h>
-#include <binder/IServiceManager.h>
-
-#include <ui/DisplayInfo.h>
-
-#include <gui/ISurface.h>
-#include <gui/ISurfaceComposer.h>
-#include <gui/ISurfaceComposerClient.h>
-#include <gui/SurfaceComposerClient.h>
-
-#include <private/gui/ComposerService.h>
-#include <private/gui/LayerState.h>
-#include <private/gui/SharedBufferStack.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-ANDROID_SINGLETON_STATIC_INSTANCE(ComposerService);
-
-ComposerService::ComposerService()
-: Singleton<ComposerService>() {
- const String16 name("SurfaceFlinger");
- while (getService(name, &mComposerService) != NO_ERROR) {
- usleep(250000);
- }
- mServerCblkMemory = mComposerService->getCblk();
- mServerCblk = static_cast<surface_flinger_cblk_t volatile *>(
- mServerCblkMemory->getBase());
-}
-
-sp<ISurfaceComposer> ComposerService::getComposerService() {
- return ComposerService::getInstance().mComposerService;
-}
-
-surface_flinger_cblk_t const volatile * ComposerService::getControlBlock() {
- return ComposerService::getInstance().mServerCblk;
-}
-
-static inline sp<ISurfaceComposer> getComposerService() {
- return ComposerService::getComposerService();
-}
-
-static inline surface_flinger_cblk_t const volatile * get_cblk() {
- return ComposerService::getControlBlock();
-}
-
-// ---------------------------------------------------------------------------
-
-// NOTE: this is NOT a member function (it's a friend defined with its
-// declaration).
-static inline
-int compare_type( const ComposerState& lhs, const ComposerState& rhs) {
- if (lhs.client < rhs.client) return -1;
- if (lhs.client > rhs.client) return 1;
- if (lhs.state.surface < rhs.state.surface) return -1;
- if (lhs.state.surface > rhs.state.surface) return 1;
- return 0;
-}
-
-class Composer : public Singleton<Composer>
-{
- friend class Singleton<Composer>;
-
- mutable Mutex mLock;
- SortedVector<ComposerState> mStates;
- int mOrientation;
- uint32_t mForceSynchronous;
-
- Composer() : Singleton<Composer>(),
- mOrientation(ISurfaceComposer::eOrientationUnchanged),
- mForceSynchronous(0)
- { }
-
- void closeGlobalTransactionImpl(bool synchronous);
-
- layer_state_t* getLayerStateLocked(
- const sp<SurfaceComposerClient>& client, SurfaceID id);
-
-public:
-
- status_t setPosition(const sp<SurfaceComposerClient>& client, SurfaceID id,
- float x, float y);
- status_t setSize(const sp<SurfaceComposerClient>& client, SurfaceID id,
- uint32_t w, uint32_t h);
- status_t setLayer(const sp<SurfaceComposerClient>& client, SurfaceID id,
- int32_t z);
- status_t setFlags(const sp<SurfaceComposerClient>& client, SurfaceID id,
- uint32_t flags, uint32_t mask);
- status_t setTransparentRegionHint(
- const sp<SurfaceComposerClient>& client, SurfaceID id,
- const Region& transparentRegion);
- status_t setAlpha(const sp<SurfaceComposerClient>& client, SurfaceID id,
- float alpha);
- status_t setMatrix(const sp<SurfaceComposerClient>& client, SurfaceID id,
- float dsdx, float dtdx, float dsdy, float dtdy);
- status_t setFreezeTint(
- const sp<SurfaceComposerClient>& client, SurfaceID id,
- uint32_t tint);
- status_t setOrientation(int orientation);
-
- static void closeGlobalTransaction(bool synchronous) {
- Composer::getInstance().closeGlobalTransactionImpl(synchronous);
- }
-};
-
-ANDROID_SINGLETON_STATIC_INSTANCE(Composer);
-
-// ---------------------------------------------------------------------------
-
-void Composer::closeGlobalTransactionImpl(bool synchronous) {
- sp<ISurfaceComposer> sm(getComposerService());
-
- Vector<ComposerState> transaction;
- int orientation;
- uint32_t flags = 0;
-
- { // scope for the lock
- Mutex::Autolock _l(mLock);
- transaction = mStates;
- mStates.clear();
-
- orientation = mOrientation;
- mOrientation = ISurfaceComposer::eOrientationUnchanged;
-
- if (synchronous || mForceSynchronous) {
- flags |= ISurfaceComposer::eSynchronous;
- }
- mForceSynchronous = false;
- }
-
- sm->setTransactionState(transaction, orientation, flags);
-}
-
-layer_state_t* Composer::getLayerStateLocked(
- const sp<SurfaceComposerClient>& client, SurfaceID id) {
-
- ComposerState s;
- s.client = client->mClient;
- s.state.surface = id;
-
- ssize_t index = mStates.indexOf(s);
- if (index < 0) {
- // we don't have it, add an initialized layer_state to our list
- index = mStates.add(s);
- }
-
- ComposerState* const out = mStates.editArray();
- return &(out[index].state);
-}
-
-status_t Composer::setPosition(const sp<SurfaceComposerClient>& client,
- SurfaceID id, float x, float y) {
- Mutex::Autolock _l(mLock);
- layer_state_t* s = getLayerStateLocked(client, id);
- if (!s)
- return BAD_INDEX;
- s->what |= ISurfaceComposer::ePositionChanged;
- s->x = x;
- s->y = y;
- return NO_ERROR;
-}
-
-status_t Composer::setSize(const sp<SurfaceComposerClient>& client,
- SurfaceID id, uint32_t w, uint32_t h) {
- Mutex::Autolock _l(mLock);
- layer_state_t* s = getLayerStateLocked(client, id);
- if (!s)
- return BAD_INDEX;
- s->what |= ISurfaceComposer::eSizeChanged;
- s->w = w;
- s->h = h;
-
- // Resizing a surface makes the transaction synchronous.
- mForceSynchronous = true;
-
- return NO_ERROR;
-}
-
-status_t Composer::setLayer(const sp<SurfaceComposerClient>& client,
- SurfaceID id, int32_t z) {
- Mutex::Autolock _l(mLock);
- layer_state_t* s = getLayerStateLocked(client, id);
- if (!s)
- return BAD_INDEX;
- s->what |= ISurfaceComposer::eLayerChanged;
- s->z = z;
- return NO_ERROR;
-}
-
-status_t Composer::setFlags(const sp<SurfaceComposerClient>& client,
- SurfaceID id, uint32_t flags,
- uint32_t mask) {
- Mutex::Autolock _l(mLock);
- layer_state_t* s = getLayerStateLocked(client, id);
- if (!s)
- return BAD_INDEX;
- s->what |= ISurfaceComposer::eVisibilityChanged;
- s->flags &= ~mask;
- s->flags |= (flags & mask);
- s->mask |= mask;
- return NO_ERROR;
-}
-
-status_t Composer::setTransparentRegionHint(
- const sp<SurfaceComposerClient>& client, SurfaceID id,
- const Region& transparentRegion) {
- Mutex::Autolock _l(mLock);
- layer_state_t* s = getLayerStateLocked(client, id);
- if (!s)
- return BAD_INDEX;
- s->what |= ISurfaceComposer::eTransparentRegionChanged;
- s->transparentRegion = transparentRegion;
- return NO_ERROR;
-}
-
-status_t Composer::setAlpha(const sp<SurfaceComposerClient>& client,
- SurfaceID id, float alpha) {
- Mutex::Autolock _l(mLock);
- layer_state_t* s = getLayerStateLocked(client, id);
- if (!s)
- return BAD_INDEX;
- s->what |= ISurfaceComposer::eAlphaChanged;
- s->alpha = alpha;
- return NO_ERROR;
-}
-
-status_t Composer::setMatrix(const sp<SurfaceComposerClient>& client,
- SurfaceID id, float dsdx, float dtdx,
- float dsdy, float dtdy) {
- Mutex::Autolock _l(mLock);
- layer_state_t* s = getLayerStateLocked(client, id);
- if (!s)
- return BAD_INDEX;
- s->what |= ISurfaceComposer::eMatrixChanged;
- layer_state_t::matrix22_t matrix;
- matrix.dsdx = dsdx;
- matrix.dtdx = dtdx;
- matrix.dsdy = dsdy;
- matrix.dtdy = dtdy;
- s->matrix = matrix;
- return NO_ERROR;
-}
-
-status_t Composer::setFreezeTint(const sp<SurfaceComposerClient>& client,
- SurfaceID id, uint32_t tint) {
- Mutex::Autolock _l(mLock);
- layer_state_t* s = getLayerStateLocked(client, id);
- if (!s)
- return BAD_INDEX;
- s->what |= ISurfaceComposer::eFreezeTintChanged;
- s->tint = tint;
- return NO_ERROR;
-}
-
-status_t Composer::setOrientation(int orientation) {
- Mutex::Autolock _l(mLock);
- mOrientation = orientation;
-
- // Changing the orientation makes the transaction synchronous.
- mForceSynchronous = true;
-
- return NO_ERROR;
-}
-
-// ---------------------------------------------------------------------------
-
-SurfaceComposerClient::SurfaceComposerClient()
- : mStatus(NO_INIT), mComposer(Composer::getInstance())
-{
-}
-
-void SurfaceComposerClient::onFirstRef() {
- sp<ISurfaceComposer> sm(getComposerService());
- if (sm != 0) {
- sp<ISurfaceComposerClient> conn = sm->createConnection();
- if (conn != 0) {
- mClient = conn;
- mStatus = NO_ERROR;
- }
- }
-}
-
-SurfaceComposerClient::~SurfaceComposerClient() {
- dispose();
-}
-
-status_t SurfaceComposerClient::initCheck() const {
- return mStatus;
-}
-
-sp<IBinder> SurfaceComposerClient::connection() const {
- return (mClient != 0) ? mClient->asBinder() : 0;
-}
-
-status_t SurfaceComposerClient::linkToComposerDeath(
- const sp<IBinder::DeathRecipient>& recipient,
- void* cookie, uint32_t flags) {
- sp<ISurfaceComposer> sm(getComposerService());
- return sm->asBinder()->linkToDeath(recipient, cookie, flags);
-}
-
-void SurfaceComposerClient::dispose() {
- // this can be called more than once.
- sp<ISurfaceComposerClient> client;
- Mutex::Autolock _lm(mLock);
- if (mClient != 0) {
- client = mClient; // hold ref while lock is held
- mClient.clear();
- }
- mStatus = NO_INIT;
-}
-
-sp<SurfaceControl> SurfaceComposerClient::createSurface(
- DisplayID display,
- uint32_t w,
- uint32_t h,
- PixelFormat format,
- uint32_t flags)
-{
- String8 name;
- const size_t SIZE = 128;
- char buffer[SIZE];
- snprintf(buffer, SIZE, "<pid_%d>", getpid());
- name.append(buffer);
-
- return SurfaceComposerClient::createSurface(name, display,
- w, h, format, flags);
-}
-
-sp<SurfaceControl> SurfaceComposerClient::createSurface(
- const String8& name,
- DisplayID display,
- uint32_t w,
- uint32_t h,
- PixelFormat format,
- uint32_t flags)
-{
- sp<SurfaceControl> result;
- if (mStatus == NO_ERROR) {
- ISurfaceComposerClient::surface_data_t data;
- sp<ISurface> surface = mClient->createSurface(&data, name,
- display, w, h, format, flags);
- if (surface != 0) {
- result = new SurfaceControl(this, surface, data);
- }
- }
- return result;
-}
-
-status_t SurfaceComposerClient::destroySurface(SurfaceID sid) {
- if (mStatus != NO_ERROR)
- return mStatus;
- status_t err = mClient->destroySurface(sid);
- return err;
-}
-
-inline Composer& SurfaceComposerClient::getComposer() {
- return mComposer;
-}
-
-// ----------------------------------------------------------------------------
-
-void SurfaceComposerClient::openGlobalTransaction() {
- // Currently a no-op
-}
-
-void SurfaceComposerClient::closeGlobalTransaction(bool synchronous) {
- Composer::closeGlobalTransaction(synchronous);
-}
-
-// ----------------------------------------------------------------------------
-
-status_t SurfaceComposerClient::setFreezeTint(SurfaceID id, uint32_t tint) {
- return getComposer().setFreezeTint(this, id, tint);
-}
-
-status_t SurfaceComposerClient::setPosition(SurfaceID id, float x, float y) {
- return getComposer().setPosition(this, id, x, y);
-}
-
-status_t SurfaceComposerClient::setSize(SurfaceID id, uint32_t w, uint32_t h) {
- return getComposer().setSize(this, id, w, h);
-}
-
-status_t SurfaceComposerClient::setLayer(SurfaceID id, int32_t z) {
- return getComposer().setLayer(this, id, z);
-}
-
-status_t SurfaceComposerClient::hide(SurfaceID id) {
- return getComposer().setFlags(this, id,
- ISurfaceComposer::eLayerHidden,
- ISurfaceComposer::eLayerHidden);
-}
-
-status_t SurfaceComposerClient::show(SurfaceID id, int32_t) {
- return getComposer().setFlags(this, id,
- 0,
- ISurfaceComposer::eLayerHidden);
-}
-
-status_t SurfaceComposerClient::freeze(SurfaceID id) {
- return getComposer().setFlags(this, id,
- ISurfaceComposer::eLayerFrozen,
- ISurfaceComposer::eLayerFrozen);
-}
-
-status_t SurfaceComposerClient::unfreeze(SurfaceID id) {
- return getComposer().setFlags(this, id,
- 0,
- ISurfaceComposer::eLayerFrozen);
-}
-
-status_t SurfaceComposerClient::setFlags(SurfaceID id, uint32_t flags,
- uint32_t mask) {
- return getComposer().setFlags(this, id, flags, mask);
-}
-
-status_t SurfaceComposerClient::setTransparentRegionHint(SurfaceID id,
- const Region& transparentRegion) {
- return getComposer().setTransparentRegionHint(this, id, transparentRegion);
-}
-
-status_t SurfaceComposerClient::setAlpha(SurfaceID id, float alpha) {
- return getComposer().setAlpha(this, id, alpha);
-}
-
-status_t SurfaceComposerClient::setMatrix(SurfaceID id, float dsdx, float dtdx,
- float dsdy, float dtdy) {
- return getComposer().setMatrix(this, id, dsdx, dtdx, dsdy, dtdy);
-}
-
-status_t SurfaceComposerClient::setOrientation(DisplayID dpy,
- int orientation, uint32_t flags)
-{
- return Composer::getInstance().setOrientation(orientation);
-}
-
-// ----------------------------------------------------------------------------
-
-status_t SurfaceComposerClient::getDisplayInfo(
- DisplayID dpy, DisplayInfo* info)
-{
- if (uint32_t(dpy)>=NUM_DISPLAY_MAX)
- return BAD_VALUE;
-
- volatile surface_flinger_cblk_t const * cblk = get_cblk();
- volatile display_cblk_t const * dcblk = cblk->displays + dpy;
-
- info->w = dcblk->w;
- info->h = dcblk->h;
- info->orientation = dcblk->orientation;
- info->xdpi = dcblk->xdpi;
- info->ydpi = dcblk->ydpi;
- info->fps = dcblk->fps;
- info->density = dcblk->density;
- return getPixelFormatInfo(dcblk->format, &(info->pixelFormatInfo));
-}
-
-ssize_t SurfaceComposerClient::getDisplayWidth(DisplayID dpy)
-{
- if (uint32_t(dpy)>=NUM_DISPLAY_MAX)
- return BAD_VALUE;
- volatile surface_flinger_cblk_t const * cblk = get_cblk();
- volatile display_cblk_t const * dcblk = cblk->displays + dpy;
- return dcblk->w;
-}
-
-ssize_t SurfaceComposerClient::getDisplayHeight(DisplayID dpy)
-{
- if (uint32_t(dpy)>=NUM_DISPLAY_MAX)
- return BAD_VALUE;
- volatile surface_flinger_cblk_t const * cblk = get_cblk();
- volatile display_cblk_t const * dcblk = cblk->displays + dpy;
- return dcblk->h;
-}
-
-ssize_t SurfaceComposerClient::getDisplayOrientation(DisplayID dpy)
-{
- if (uint32_t(dpy)>=NUM_DISPLAY_MAX)
- return BAD_VALUE;
- volatile surface_flinger_cblk_t const * cblk = get_cblk();
- volatile display_cblk_t const * dcblk = cblk->displays + dpy;
- return dcblk->orientation;
-}
-
-ssize_t SurfaceComposerClient::getNumberOfDisplays()
-{
- volatile surface_flinger_cblk_t const * cblk = get_cblk();
- uint32_t connected = cblk->connected;
- int n = 0;
- while (connected) {
- if (connected&1) n++;
- connected >>= 1;
- }
- return n;
-}
-
-// ----------------------------------------------------------------------------
-
-status_t SurfaceComposerClient::freezeDisplay(DisplayID dpy, uint32_t flags)
-{
- // This has been made a no-op because it can cause Gralloc buffer deadlocks.
- return NO_ERROR;
-}
-
-status_t SurfaceComposerClient::unfreezeDisplay(DisplayID dpy, uint32_t flags)
-{
- // This has been made a no-op because it can cause Gralloc buffer deadlocks.
- return NO_ERROR;
-}
-
-// ----------------------------------------------------------------------------
-
-ScreenshotClient::ScreenshotClient()
- : mWidth(0), mHeight(0), mFormat(PIXEL_FORMAT_NONE) {
-}
-
-status_t ScreenshotClient::update() {
- sp<ISurfaceComposer> s(ComposerService::getComposerService());
- if (s == NULL) return NO_INIT;
- mHeap = 0;
- return s->captureScreen(0, &mHeap,
- &mWidth, &mHeight, &mFormat, 0, 0,
- 0, -1UL);
-}
-
-status_t ScreenshotClient::update(uint32_t reqWidth, uint32_t reqHeight) {
- sp<ISurfaceComposer> s(ComposerService::getComposerService());
- if (s == NULL) return NO_INIT;
- mHeap = 0;
- return s->captureScreen(0, &mHeap,
- &mWidth, &mHeight, &mFormat, reqWidth, reqHeight,
- 0, -1UL);
-}
-
-status_t ScreenshotClient::update(uint32_t reqWidth, uint32_t reqHeight,
- uint32_t minLayerZ, uint32_t maxLayerZ) {
- sp<ISurfaceComposer> s(ComposerService::getComposerService());
- if (s == NULL) return NO_INIT;
- mHeap = 0;
- return s->captureScreen(0, &mHeap,
- &mWidth, &mHeight, &mFormat, reqWidth, reqHeight,
- minLayerZ, maxLayerZ);
-}
-
-void ScreenshotClient::release() {
- mHeap = 0;
-}
-
-void const* ScreenshotClient::getPixels() const {
- return mHeap->getBase();
-}
-
-uint32_t ScreenshotClient::getWidth() const {
- return mWidth;
-}
-
-uint32_t ScreenshotClient::getHeight() const {
- return mHeight;
-}
-
-PixelFormat ScreenshotClient::getFormat() const {
- return mFormat;
-}
-
-uint32_t ScreenshotClient::getStride() const {
- return mWidth;
-}
-
-size_t ScreenshotClient::getSize() const {
- return mHeap->getSize();
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
deleted file mode 100644
index b42aa34..0000000
--- a/libs/gui/SurfaceTexture.cpp
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#define LOG_TAG "SurfaceTexture"
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-//#define LOG_NDEBUG 0
-
-#define GL_GLEXT_PROTOTYPES
-#define EGL_EGLEXT_PROTOTYPES
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <hardware/hardware.h>
-
-#include <gui/IGraphicBufferAlloc.h>
-#include <gui/ISurfaceComposer.h>
-#include <gui/SurfaceComposerClient.h>
-#include <gui/SurfaceTexture.h>
-
-#include <private/gui/ComposerService.h>
-
-#include <utils/Log.h>
-#include <utils/String8.h>
-#include <utils/Trace.h>
-
-// This compile option makes SurfaceTexture use the EGL_KHR_fence_sync extension
-// to synchronize access to the buffers. It will cause dequeueBuffer to stall,
-// waiting for the GL reads for the buffer being dequeued to complete before
-// allowing the buffer to be dequeued.
-#ifdef USE_FENCE_SYNC
-#ifdef ALLOW_DEQUEUE_CURRENT_BUFFER
-#error "USE_FENCE_SYNC and ALLOW_DEQUEUE_CURRENT_BUFFER are incompatible"
-#endif
-#endif
-
-// Macros for including the SurfaceTexture name in log messages
-#define ST_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGD(x, ...) ALOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGI(x, ...) ALOGI("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGW(x, ...) ALOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGE(x, ...) ALOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
-
-namespace android {
-
-// Transform matrices
-static float mtxIdentity[16] = {
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
- 0, 0, 0, 1,
-};
-static float mtxFlipH[16] = {
- -1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
- 1, 0, 0, 1,
-};
-static float mtxFlipV[16] = {
- 1, 0, 0, 0,
- 0, -1, 0, 0,
- 0, 0, 1, 0,
- 0, 1, 0, 1,
-};
-static float mtxRot90[16] = {
- 0, 1, 0, 0,
- -1, 0, 0, 0,
- 0, 0, 1, 0,
- 1, 0, 0, 1,
-};
-static float mtxRot180[16] = {
- -1, 0, 0, 0,
- 0, -1, 0, 0,
- 0, 0, 1, 0,
- 1, 1, 0, 1,
-};
-static float mtxRot270[16] = {
- 0, -1, 0, 0,
- 1, 0, 0, 0,
- 0, 0, 1, 0,
- 0, 1, 0, 1,
-};
-
-static void mtxMul(float out[16], const float a[16], const float b[16]);
-
-// Get an ID that's unique within this process.
-static int32_t createProcessUniqueId() {
- static volatile int32_t globalCounter = 0;
- return android_atomic_inc(&globalCounter);
-}
-
-SurfaceTexture::SurfaceTexture(GLuint tex, bool allowSynchronousMode,
- GLenum texTarget, bool useFenceSync) :
- BufferQueue(allowSynchronousMode),
- mCurrentTransform(0),
- mCurrentTimestamp(0),
- mTexName(tex),
-#ifdef USE_FENCE_SYNC
- mUseFenceSync(useFenceSync),
-#else
- mUseFenceSync(false),
-#endif
- mTexTarget(texTarget),
- mAbandoned(false),
- mCurrentTexture(BufferQueue::INVALID_BUFFER_SLOT)
-{
- // Choose a name using the PID and a process-unique ID.
- mName = String8::format("unnamed-%d-%d", getpid(), createProcessUniqueId());
- BufferQueue::setConsumerName(mName);
-
- ST_LOGV("SurfaceTexture");
- memcpy(mCurrentTransformMatrix, mtxIdentity,
- sizeof(mCurrentTransformMatrix));
-}
-
-SurfaceTexture::~SurfaceTexture() {
- ST_LOGV("~SurfaceTexture");
- abandon();
-}
-
-status_t SurfaceTexture::setBufferCountServer(int bufferCount) {
- Mutex::Autolock lock(mMutex);
- return BufferQueue::setBufferCountServer(bufferCount);
-}
-
-
-status_t SurfaceTexture::setDefaultBufferSize(uint32_t w, uint32_t h)
-{
- return BufferQueue::setDefaultBufferSize(w, h);
-}
-
-status_t SurfaceTexture::updateTexImage() {
- ATRACE_CALL();
- ST_LOGV("updateTexImage");
- Mutex::Autolock lock(mMutex);
-
- if (mAbandoned) {
- ST_LOGE("calling updateTexImage() on an abandoned SurfaceTexture");
- return NO_INIT;
- }
-
- BufferItem item;
-
- // In asynchronous mode the list is guaranteed to be one buffer
- // deep, while in synchronous mode we use the oldest buffer.
- if (acquire(&item) == NO_ERROR) {
- int buf = item.mBuf;
- // This buffer was newly allocated, so we need to clean up on our side
- if (item.mGraphicBuffer != NULL) {
- mEGLSlots[buf].mGraphicBuffer = 0;
- if (mEGLSlots[buf].mEglImage != EGL_NO_IMAGE_KHR) {
- eglDestroyImageKHR(mEGLSlots[buf].mEglDisplay,
- mEGLSlots[buf].mEglImage);
- mEGLSlots[buf].mEglImage = EGL_NO_IMAGE_KHR;
- mEGLSlots[buf].mEglDisplay = EGL_NO_DISPLAY;
- }
- mEGLSlots[buf].mGraphicBuffer = item.mGraphicBuffer;
- }
-
- // Update the GL texture object.
- EGLImageKHR image = mEGLSlots[buf].mEglImage;
- EGLDisplay dpy = eglGetCurrentDisplay();
- if (image == EGL_NO_IMAGE_KHR) {
- if (item.mGraphicBuffer == 0) {
- ST_LOGE("buffer at slot %d is null", buf);
- return BAD_VALUE;
- }
- image = createImage(dpy, item.mGraphicBuffer);
- mEGLSlots[buf].mEglImage = image;
- mEGLSlots[buf].mEglDisplay = dpy;
- if (image == EGL_NO_IMAGE_KHR) {
- // NOTE: if dpy was invalid, createImage() is guaranteed to
- // fail. so we'd end up here.
- return -EINVAL;
- }
- }
-
- GLint error;
- while ((error = glGetError()) != GL_NO_ERROR) {
- ST_LOGW("updateTexImage: clearing GL error: %#04x", error);
- }
-
- glBindTexture(mTexTarget, mTexName);
- glEGLImageTargetTexture2DOES(mTexTarget, (GLeglImageOES)image);
-
- bool failed = false;
- while ((error = glGetError()) != GL_NO_ERROR) {
- ST_LOGE("error binding external texture image %p (slot %d): %#04x",
- image, buf, error);
- failed = true;
- }
- if (failed) {
- releaseBuffer(buf, mEGLSlots[buf].mEglDisplay,
- mEGLSlots[buf].mFence);
- return -EINVAL;
- }
-
- if (mCurrentTexture != INVALID_BUFFER_SLOT) {
- if (mUseFenceSync) {
- EGLSyncKHR fence = eglCreateSyncKHR(dpy, EGL_SYNC_FENCE_KHR,
- NULL);
- if (fence == EGL_NO_SYNC_KHR) {
- ALOGE("updateTexImage: error creating fence: %#x",
- eglGetError());
- releaseBuffer(buf, mEGLSlots[buf].mEglDisplay,
- mEGLSlots[buf].mFence);
- return -EINVAL;
- }
- glFlush();
- mEGLSlots[mCurrentTexture].mFence = fence;
- }
- }
-
- ST_LOGV("updateTexImage: (slot=%d buf=%p) -> (slot=%d buf=%p)",
- mCurrentTexture,
- mCurrentTextureBuf != NULL ? mCurrentTextureBuf->handle : 0,
- buf, item.mGraphicBuffer != NULL ? item.mGraphicBuffer->handle : 0);
-
- // release old buffer
- releaseBuffer(mCurrentTexture,
- mEGLSlots[mCurrentTexture].mEglDisplay,
- mEGLSlots[mCurrentTexture].mFence);
-
- // Update the SurfaceTexture state.
- mCurrentTexture = buf;
- mCurrentTextureBuf = mEGLSlots[buf].mGraphicBuffer;
- mCurrentCrop = item.mCrop;
- mCurrentTransform = item.mTransform;
- mCurrentScalingMode = item.mScalingMode;
- mCurrentTimestamp = item.mTimestamp;
- computeCurrentTransformMatrix();
-
- // Now that we've passed the point at which failures can happen,
- // it's safe to remove the buffer from the front of the queue.
-
- } else {
- // We always bind the texture even if we don't update its contents.
- glBindTexture(mTexTarget, mTexName);
- }
-
- return OK;
-}
-
-bool SurfaceTexture::isExternalFormat(uint32_t format)
-{
- switch (format) {
- // supported YUV formats
- case HAL_PIXEL_FORMAT_YV12:
- // Legacy/deprecated YUV formats
- case HAL_PIXEL_FORMAT_YCbCr_422_SP:
- case HAL_PIXEL_FORMAT_YCrCb_420_SP:
- case HAL_PIXEL_FORMAT_YCbCr_422_I:
- return true;
- }
-
- // Any OEM format needs to be considered
- if (format>=0x100 && format<=0x1FF)
- return true;
-
- return false;
-}
-
-GLenum SurfaceTexture::getCurrentTextureTarget() const {
- return mTexTarget;
-}
-
-void SurfaceTexture::getTransformMatrix(float mtx[16]) {
- Mutex::Autolock lock(mMutex);
- memcpy(mtx, mCurrentTransformMatrix, sizeof(mCurrentTransformMatrix));
-}
-
-void SurfaceTexture::computeCurrentTransformMatrix() {
- ST_LOGV("computeCurrentTransformMatrix");
-
- float xform[16];
- for (int i = 0; i < 16; i++) {
- xform[i] = mtxIdentity[i];
- }
- if (mCurrentTransform & NATIVE_WINDOW_TRANSFORM_FLIP_H) {
- float result[16];
- mtxMul(result, xform, mtxFlipH);
- for (int i = 0; i < 16; i++) {
- xform[i] = result[i];
- }
- }
- if (mCurrentTransform & NATIVE_WINDOW_TRANSFORM_FLIP_V) {
- float result[16];
- mtxMul(result, xform, mtxFlipV);
- for (int i = 0; i < 16; i++) {
- xform[i] = result[i];
- }
- }
- if (mCurrentTransform & NATIVE_WINDOW_TRANSFORM_ROT_90) {
- float result[16];
- mtxMul(result, xform, mtxRot90);
- for (int i = 0; i < 16; i++) {
- xform[i] = result[i];
- }
- }
-
- sp<GraphicBuffer>& buf(mCurrentTextureBuf);
- float tx, ty, sx, sy;
- if (!mCurrentCrop.isEmpty()) {
- // In order to prevent bilinear sampling at the of the crop rectangle we
- // may need to shrink it by 2 texels in each direction. Normally this
- // would just need to take 1/2 a texel off each end, but because the
- // chroma channels will likely be subsampled we need to chop off a whole
- // texel. This will cause artifacts if someone does nearest sampling
- // with 1:1 pixel:texel ratio, but it's impossible to simultaneously
- // accomodate the bilinear and nearest sampling uses.
- //
- // If nearest sampling turns out to be a desirable usage of these
- // textures then we could add the ability to switch a SurfaceTexture to
- // nearest-mode. Preferably, however, the image producers (video
- // decoder, camera, etc.) would simply not use a crop rectangle (or at
- // least not tell the framework about it) so that the GPU can do the
- // correct edge behavior.
- int xshrink = 0, yshrink = 0;
- if (mCurrentCrop.left > 0) {
- tx = float(mCurrentCrop.left + 1) / float(buf->getWidth());
- xshrink++;
- } else {
- tx = 0.0f;
- }
- if (mCurrentCrop.right < int32_t(buf->getWidth())) {
- xshrink++;
- }
- if (mCurrentCrop.bottom < int32_t(buf->getHeight())) {
- ty = (float(buf->getHeight() - mCurrentCrop.bottom) + 1.0f) /
- float(buf->getHeight());
- yshrink++;
- } else {
- ty = 0.0f;
- }
- if (mCurrentCrop.top > 0) {
- yshrink++;
- }
- sx = float(mCurrentCrop.width() - xshrink) / float(buf->getWidth());
- sy = float(mCurrentCrop.height() - yshrink) / float(buf->getHeight());
- } else {
- tx = 0.0f;
- ty = 0.0f;
- sx = 1.0f;
- sy = 1.0f;
- }
- float crop[16] = {
- sx, 0, 0, 0,
- 0, sy, 0, 0,
- 0, 0, 1, 0,
- tx, ty, 0, 1,
- };
-
- float mtxBeforeFlipV[16];
- mtxMul(mtxBeforeFlipV, crop, xform);
-
- // SurfaceFlinger expects the top of its window textures to be at a Y
- // coordinate of 0, so SurfaceTexture must behave the same way. We don't
- // want to expose this to applications, however, so we must add an
- // additional vertical flip to the transform after all the other transforms.
- mtxMul(mCurrentTransformMatrix, mtxFlipV, mtxBeforeFlipV);
-}
-
-nsecs_t SurfaceTexture::getTimestamp() {
- ST_LOGV("getTimestamp");
- Mutex::Autolock lock(mMutex);
- return mCurrentTimestamp;
-}
-
-void SurfaceTexture::setFrameAvailableListener(
- const sp<FrameAvailableListener>& listener) {
- ST_LOGV("setFrameAvailableListener");
- Mutex::Autolock lock(mMutex);
- BufferQueue::setFrameAvailableListener(listener);
-}
-
-EGLImageKHR SurfaceTexture::createImage(EGLDisplay dpy,
- const sp<GraphicBuffer>& graphicBuffer) {
- EGLClientBuffer cbuf = (EGLClientBuffer)graphicBuffer->getNativeBuffer();
- EGLint attrs[] = {
- EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
- EGL_NONE,
- };
- EGLImageKHR image = eglCreateImageKHR(dpy, EGL_NO_CONTEXT,
- EGL_NATIVE_BUFFER_ANDROID, cbuf, attrs);
- if (image == EGL_NO_IMAGE_KHR) {
- EGLint error = eglGetError();
- ST_LOGE("error creating EGLImage: %#x", error);
- }
- return image;
-}
-
-sp<GraphicBuffer> SurfaceTexture::getCurrentBuffer() const {
- Mutex::Autolock lock(mMutex);
- return mCurrentTextureBuf;
-}
-
-Rect SurfaceTexture::getCurrentCrop() const {
- Mutex::Autolock lock(mMutex);
- return mCurrentCrop;
-}
-
-uint32_t SurfaceTexture::getCurrentTransform() const {
- Mutex::Autolock lock(mMutex);
- return mCurrentTransform;
-}
-
-uint32_t SurfaceTexture::getCurrentScalingMode() const {
- Mutex::Autolock lock(mMutex);
- return mCurrentScalingMode;
-}
-
-bool SurfaceTexture::isSynchronousMode() const {
- Mutex::Autolock lock(mMutex);
- return BufferQueue::isSynchronousMode();
-}
-
-void SurfaceTexture::abandon() {
- Mutex::Autolock lock(mMutex);
- mAbandoned = true;
- mCurrentTextureBuf.clear();
-
- // destroy all egl buffers
- for (int i =0; i < NUM_BUFFER_SLOTS; i++) {
- mEGLSlots[i].mGraphicBuffer = 0;
- if (mEGLSlots[i].mEglImage != EGL_NO_IMAGE_KHR) {
- eglDestroyImageKHR(mEGLSlots[i].mEglDisplay,
- mEGLSlots[i].mEglImage);
- mEGLSlots[i].mEglImage = EGL_NO_IMAGE_KHR;
- mEGLSlots[i].mEglDisplay = EGL_NO_DISPLAY;
- }
- }
-
- // disconnect from the BufferQueue
- BufferQueue::consumerDisconnect();
-}
-
-void SurfaceTexture::setName(const String8& name) {
- Mutex::Autolock _l(mMutex);
- mName = name;
- BufferQueue::setConsumerName(name);
-}
-
-void SurfaceTexture::dump(String8& result) const
-{
- char buffer[1024];
- dump(result, "", buffer, 1024);
-}
-
-void SurfaceTexture::dump(String8& result, const char* prefix,
- char* buffer, size_t SIZE) const
-{
- Mutex::Autolock _l(mMutex);
- snprintf(buffer, SIZE, "%smTexName=%d\n", prefix, mTexName);
- result.append(buffer);
-
- snprintf(buffer, SIZE,
- "%snext : {crop=[%d,%d,%d,%d], transform=0x%02x, current=%d}\n"
- ,prefix, mCurrentCrop.left,
- mCurrentCrop.top, mCurrentCrop.right, mCurrentCrop.bottom,
- mCurrentTransform, mCurrentTexture
- );
- result.append(buffer);
-
-
- BufferQueue::dump(result, prefix, buffer, SIZE);
-}
-
-static void mtxMul(float out[16], const float a[16], const float b[16]) {
- out[0] = a[0]*b[0] + a[4]*b[1] + a[8]*b[2] + a[12]*b[3];
- out[1] = a[1]*b[0] + a[5]*b[1] + a[9]*b[2] + a[13]*b[3];
- out[2] = a[2]*b[0] + a[6]*b[1] + a[10]*b[2] + a[14]*b[3];
- out[3] = a[3]*b[0] + a[7]*b[1] + a[11]*b[2] + a[15]*b[3];
-
- out[4] = a[0]*b[4] + a[4]*b[5] + a[8]*b[6] + a[12]*b[7];
- out[5] = a[1]*b[4] + a[5]*b[5] + a[9]*b[6] + a[13]*b[7];
- out[6] = a[2]*b[4] + a[6]*b[5] + a[10]*b[6] + a[14]*b[7];
- out[7] = a[3]*b[4] + a[7]*b[5] + a[11]*b[6] + a[15]*b[7];
-
- out[8] = a[0]*b[8] + a[4]*b[9] + a[8]*b[10] + a[12]*b[11];
- out[9] = a[1]*b[8] + a[5]*b[9] + a[9]*b[10] + a[13]*b[11];
- out[10] = a[2]*b[8] + a[6]*b[9] + a[10]*b[10] + a[14]*b[11];
- out[11] = a[3]*b[8] + a[7]*b[9] + a[11]*b[10] + a[15]*b[11];
-
- out[12] = a[0]*b[12] + a[4]*b[13] + a[8]*b[14] + a[12]*b[15];
- out[13] = a[1]*b[12] + a[5]*b[13] + a[9]*b[14] + a[13]*b[15];
- out[14] = a[2]*b[12] + a[6]*b[13] + a[10]*b[14] + a[14]*b[15];
- out[15] = a[3]*b[12] + a[7]*b[13] + a[11]*b[14] + a[15]*b[15];
-}
-
-}; // namespace android
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
deleted file mode 100644
index f88dcaf..0000000
--- a/libs/gui/SurfaceTextureClient.cpp
+++ /dev/null
@@ -1,713 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#define LOG_TAG "SurfaceTextureClient"
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-//#define LOG_NDEBUG 0
-
-#include <utils/Log.h>
-#include <utils/Trace.h>
-
-#include <gui/ISurfaceComposer.h>
-#include <gui/SurfaceComposerClient.h>
-#include <gui/SurfaceTextureClient.h>
-
-#include <private/gui/ComposerService.h>
-
-namespace android {
-
-SurfaceTextureClient::SurfaceTextureClient(
- const sp<ISurfaceTexture>& surfaceTexture)
-{
- SurfaceTextureClient::init();
- SurfaceTextureClient::setISurfaceTexture(surfaceTexture);
-}
-
-SurfaceTextureClient::SurfaceTextureClient() {
- SurfaceTextureClient::init();
-}
-
-SurfaceTextureClient::~SurfaceTextureClient() {
- if (mConnectedToCpu) {
- SurfaceTextureClient::disconnect(NATIVE_WINDOW_API_CPU);
- }
-}
-
-void SurfaceTextureClient::init() {
- // Initialize the ANativeWindow function pointers.
- ANativeWindow::setSwapInterval = hook_setSwapInterval;
- ANativeWindow::dequeueBuffer = hook_dequeueBuffer;
- ANativeWindow::cancelBuffer = hook_cancelBuffer;
- ANativeWindow::lockBuffer = hook_lockBuffer;
- ANativeWindow::queueBuffer = hook_queueBuffer;
- ANativeWindow::query = hook_query;
- ANativeWindow::perform = hook_perform;
-
- const_cast<int&>(ANativeWindow::minSwapInterval) = 0;
- const_cast<int&>(ANativeWindow::maxSwapInterval) = 1;
-
- mReqWidth = 0;
- mReqHeight = 0;
- mReqFormat = 0;
- mReqUsage = 0;
- mTimestamp = NATIVE_WINDOW_TIMESTAMP_AUTO;
- mDefaultWidth = 0;
- mDefaultHeight = 0;
- mTransformHint = 0;
- mConnectedToCpu = false;
-}
-
-void SurfaceTextureClient::setISurfaceTexture(
- const sp<ISurfaceTexture>& surfaceTexture)
-{
- mSurfaceTexture = surfaceTexture;
-}
-
-sp<ISurfaceTexture> SurfaceTextureClient::getISurfaceTexture() const {
- return mSurfaceTexture;
-}
-
-int SurfaceTextureClient::hook_setSwapInterval(ANativeWindow* window, int interval) {
- SurfaceTextureClient* c = getSelf(window);
- return c->setSwapInterval(interval);
-}
-
-int SurfaceTextureClient::hook_dequeueBuffer(ANativeWindow* window,
- ANativeWindowBuffer** buffer) {
- SurfaceTextureClient* c = getSelf(window);
- return c->dequeueBuffer(buffer);
-}
-
-int SurfaceTextureClient::hook_cancelBuffer(ANativeWindow* window,
- ANativeWindowBuffer* buffer) {
- SurfaceTextureClient* c = getSelf(window);
- return c->cancelBuffer(buffer);
-}
-
-int SurfaceTextureClient::hook_lockBuffer(ANativeWindow* window,
- ANativeWindowBuffer* buffer) {
- SurfaceTextureClient* c = getSelf(window);
- return c->lockBuffer(buffer);
-}
-
-int SurfaceTextureClient::hook_queueBuffer(ANativeWindow* window,
- ANativeWindowBuffer* buffer) {
- SurfaceTextureClient* c = getSelf(window);
- return c->queueBuffer(buffer);
-}
-
-int SurfaceTextureClient::hook_query(const ANativeWindow* window,
- int what, int* value) {
- const SurfaceTextureClient* c = getSelf(window);
- return c->query(what, value);
-}
-
-int SurfaceTextureClient::hook_perform(ANativeWindow* window, int operation, ...) {
- va_list args;
- va_start(args, operation);
- SurfaceTextureClient* c = getSelf(window);
- return c->perform(operation, args);
-}
-
-int SurfaceTextureClient::setSwapInterval(int interval) {
- ATRACE_CALL();
- // EGL specification states:
- // interval is silently clamped to minimum and maximum implementation
- // dependent values before being stored.
- // Although we don't have to, we apply the same logic here.
-
- if (interval < minSwapInterval)
- interval = minSwapInterval;
-
- if (interval > maxSwapInterval)
- interval = maxSwapInterval;
-
- status_t res = mSurfaceTexture->setSynchronousMode(interval ? true : false);
-
- return res;
-}
-
-int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) {
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::dequeueBuffer");
- Mutex::Autolock lock(mMutex);
- int buf = -1;
- status_t result = mSurfaceTexture->dequeueBuffer(&buf, mReqWidth, mReqHeight,
- mReqFormat, mReqUsage);
- if (result < 0) {
- ALOGV("dequeueBuffer: ISurfaceTexture::dequeueBuffer(%d, %d, %d, %d)"
- "failed: %d", mReqWidth, mReqHeight, mReqFormat, mReqUsage,
- result);
- return result;
- }
- sp<GraphicBuffer>& gbuf(mSlots[buf]);
- if (result & ISurfaceTexture::RELEASE_ALL_BUFFERS) {
- freeAllBuffers();
- }
-
- if ((result & ISurfaceTexture::BUFFER_NEEDS_REALLOCATION) || gbuf == 0) {
- result = mSurfaceTexture->requestBuffer(buf, &gbuf);
- if (result != NO_ERROR) {
- ALOGE("dequeueBuffer: ISurfaceTexture::requestBuffer failed: %d",
- result);
- return result;
- }
- }
- *buffer = gbuf.get();
- return OK;
-}
-
-int SurfaceTextureClient::cancelBuffer(android_native_buffer_t* buffer) {
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::cancelBuffer");
- Mutex::Autolock lock(mMutex);
- int i = getSlotFromBufferLocked(buffer);
- if (i < 0) {
- return i;
- }
- mSurfaceTexture->cancelBuffer(i);
- return OK;
-}
-
-int SurfaceTextureClient::getSlotFromBufferLocked(
- android_native_buffer_t* buffer) const {
- bool dumpedState = false;
- for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
- // XXX: Dump the slots whenever we hit a NULL entry while searching for
- // a buffer.
- if (mSlots[i] == NULL) {
- if (!dumpedState) {
- ALOGD("getSlotFromBufferLocked: encountered NULL buffer in slot %d "
- "looking for buffer %p", i, buffer->handle);
- for (int j = 0; j < NUM_BUFFER_SLOTS; j++) {
- if (mSlots[j] == NULL) {
- ALOGD("getSlotFromBufferLocked: %02d: NULL", j);
- } else {
- ALOGD("getSlotFromBufferLocked: %02d: %p", j, mSlots[j]->handle);
- }
- }
- dumpedState = true;
- }
- }
-
- if (mSlots[i] != NULL && mSlots[i]->handle == buffer->handle) {
- return i;
- }
- }
- ALOGE("getSlotFromBufferLocked: unknown buffer: %p", buffer->handle);
- return BAD_VALUE;
-}
-
-int SurfaceTextureClient::lockBuffer(android_native_buffer_t* buffer) {
- ALOGV("SurfaceTextureClient::lockBuffer");
- Mutex::Autolock lock(mMutex);
- return OK;
-}
-
-int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) {
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::queueBuffer");
- Mutex::Autolock lock(mMutex);
- int64_t timestamp;
- if (mTimestamp == NATIVE_WINDOW_TIMESTAMP_AUTO) {
- timestamp = systemTime(SYSTEM_TIME_MONOTONIC);
- ALOGV("SurfaceTextureClient::queueBuffer making up timestamp: %.2f ms",
- timestamp / 1000000.f);
- } else {
- timestamp = mTimestamp;
- }
- int i = getSlotFromBufferLocked(buffer);
- if (i < 0) {
- return i;
- }
- status_t err = mSurfaceTexture->queueBuffer(i, timestamp,
- &mDefaultWidth, &mDefaultHeight, &mTransformHint);
- if (err != OK) {
- ALOGE("queueBuffer: error queuing buffer to SurfaceTexture, %d", err);
- }
- return err;
-}
-
-int SurfaceTextureClient::query(int what, int* value) const {
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::query");
- { // scope for the lock
- Mutex::Autolock lock(mMutex);
- switch (what) {
- case NATIVE_WINDOW_FORMAT:
- if (mReqFormat) {
- *value = mReqFormat;
- return NO_ERROR;
- }
- break;
- case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER:
- {
- sp<ISurfaceComposer> composer(
- ComposerService::getComposerService());
- if (composer->authenticateSurfaceTexture(mSurfaceTexture)) {
- *value = 1;
- } else {
- *value = 0;
- }
- }
- return NO_ERROR;
- case NATIVE_WINDOW_CONCRETE_TYPE:
- *value = NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT;
- return NO_ERROR;
- case NATIVE_WINDOW_DEFAULT_WIDTH:
- *value = mDefaultWidth;
- return NO_ERROR;
- case NATIVE_WINDOW_DEFAULT_HEIGHT:
- *value = mDefaultHeight;
- return NO_ERROR;
- case NATIVE_WINDOW_TRANSFORM_HINT:
- *value = mTransformHint;
- return NO_ERROR;
- }
- }
- return mSurfaceTexture->query(what, value);
-}
-
-int SurfaceTextureClient::perform(int operation, va_list args)
-{
- int res = NO_ERROR;
- switch (operation) {
- case NATIVE_WINDOW_CONNECT:
- // deprecated. must return NO_ERROR.
- break;
- case NATIVE_WINDOW_DISCONNECT:
- // deprecated. must return NO_ERROR.
- break;
- case NATIVE_WINDOW_SET_USAGE:
- res = dispatchSetUsage(args);
- break;
- case NATIVE_WINDOW_SET_CROP:
- res = dispatchSetCrop(args);
- break;
- case NATIVE_WINDOW_SET_BUFFER_COUNT:
- res = dispatchSetBufferCount(args);
- break;
- case NATIVE_WINDOW_SET_BUFFERS_GEOMETRY:
- res = dispatchSetBuffersGeometry(args);
- break;
- case NATIVE_WINDOW_SET_BUFFERS_TRANSFORM:
- res = dispatchSetBuffersTransform(args);
- break;
- case NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP:
- res = dispatchSetBuffersTimestamp(args);
- break;
- case NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS:
- res = dispatchSetBuffersDimensions(args);
- break;
- case NATIVE_WINDOW_SET_BUFFERS_FORMAT:
- res = dispatchSetBuffersFormat(args);
- break;
- case NATIVE_WINDOW_LOCK:
- res = dispatchLock(args);
- break;
- case NATIVE_WINDOW_UNLOCK_AND_POST:
- res = dispatchUnlockAndPost(args);
- break;
- case NATIVE_WINDOW_SET_SCALING_MODE:
- res = dispatchSetScalingMode(args);
- break;
- case NATIVE_WINDOW_API_CONNECT:
- res = dispatchConnect(args);
- break;
- case NATIVE_WINDOW_API_DISCONNECT:
- res = dispatchDisconnect(args);
- break;
- default:
- res = NAME_NOT_FOUND;
- break;
- }
- return res;
-}
-
-int SurfaceTextureClient::dispatchConnect(va_list args) {
- int api = va_arg(args, int);
- return connect(api);
-}
-
-int SurfaceTextureClient::dispatchDisconnect(va_list args) {
- int api = va_arg(args, int);
- return disconnect(api);
-}
-
-int SurfaceTextureClient::dispatchSetUsage(va_list args) {
- int usage = va_arg(args, int);
- return setUsage(usage);
-}
-
-int SurfaceTextureClient::dispatchSetCrop(va_list args) {
- android_native_rect_t const* rect = va_arg(args, android_native_rect_t*);
- return setCrop(reinterpret_cast<Rect const*>(rect));
-}
-
-int SurfaceTextureClient::dispatchSetBufferCount(va_list args) {
- size_t bufferCount = va_arg(args, size_t);
- return setBufferCount(bufferCount);
-}
-
-int SurfaceTextureClient::dispatchSetBuffersGeometry(va_list args) {
- int w = va_arg(args, int);
- int h = va_arg(args, int);
- int f = va_arg(args, int);
- int err = setBuffersDimensions(w, h);
- if (err != 0) {
- return err;
- }
- return setBuffersFormat(f);
-}
-
-int SurfaceTextureClient::dispatchSetBuffersDimensions(va_list args) {
- int w = va_arg(args, int);
- int h = va_arg(args, int);
- return setBuffersDimensions(w, h);
-}
-
-int SurfaceTextureClient::dispatchSetBuffersFormat(va_list args) {
- int f = va_arg(args, int);
- return setBuffersFormat(f);
-}
-
-int SurfaceTextureClient::dispatchSetScalingMode(va_list args) {
- int m = va_arg(args, int);
- return setScalingMode(m);
-}
-
-int SurfaceTextureClient::dispatchSetBuffersTransform(va_list args) {
- int transform = va_arg(args, int);
- return setBuffersTransform(transform);
-}
-
-int SurfaceTextureClient::dispatchSetBuffersTimestamp(va_list args) {
- int64_t timestamp = va_arg(args, int64_t);
- return setBuffersTimestamp(timestamp);
-}
-
-int SurfaceTextureClient::dispatchLock(va_list args) {
- ANativeWindow_Buffer* outBuffer = va_arg(args, ANativeWindow_Buffer*);
- ARect* inOutDirtyBounds = va_arg(args, ARect*);
- return lock(outBuffer, inOutDirtyBounds);
-}
-
-int SurfaceTextureClient::dispatchUnlockAndPost(va_list args) {
- return unlockAndPost();
-}
-
-
-int SurfaceTextureClient::connect(int api) {
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::connect");
- Mutex::Autolock lock(mMutex);
- int err = mSurfaceTexture->connect(api,
- &mDefaultWidth, &mDefaultHeight, &mTransformHint);
- if (!err && api == NATIVE_WINDOW_API_CPU) {
- mConnectedToCpu = true;
- }
- return err;
-}
-
-int SurfaceTextureClient::disconnect(int api) {
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::disconnect");
- Mutex::Autolock lock(mMutex);
- freeAllBuffers();
- int err = mSurfaceTexture->disconnect(api);
- if (!err) {
- mReqFormat = 0;
- mReqWidth = 0;
- mReqHeight = 0;
- mReqUsage = 0;
- if (api == NATIVE_WINDOW_API_CPU) {
- mConnectedToCpu = false;
- }
- }
- return err;
-}
-
-int SurfaceTextureClient::setUsage(uint32_t reqUsage)
-{
- ALOGV("SurfaceTextureClient::setUsage");
- Mutex::Autolock lock(mMutex);
- mReqUsage = reqUsage;
- return OK;
-}
-
-int SurfaceTextureClient::setCrop(Rect const* rect)
-{
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::setCrop");
- Mutex::Autolock lock(mMutex);
-
- Rect realRect;
- if (rect == NULL || rect->isEmpty()) {
- realRect = Rect(0, 0);
- } else {
- realRect = *rect;
- }
-
- status_t err = mSurfaceTexture->setCrop(*rect);
- ALOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err));
-
- return err;
-}
-
-int SurfaceTextureClient::setBufferCount(int bufferCount)
-{
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::setBufferCount");
- Mutex::Autolock lock(mMutex);
-
- status_t err = mSurfaceTexture->setBufferCount(bufferCount);
- ALOGE_IF(err, "ISurfaceTexture::setBufferCount(%d) returned %s",
- bufferCount, strerror(-err));
-
- if (err == NO_ERROR) {
- freeAllBuffers();
- }
-
- return err;
-}
-
-int SurfaceTextureClient::setBuffersDimensions(int w, int h)
-{
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::setBuffersDimensions");
- Mutex::Autolock lock(mMutex);
-
- if (w<0 || h<0)
- return BAD_VALUE;
-
- if ((w && !h) || (!w && h))
- return BAD_VALUE;
-
- mReqWidth = w;
- mReqHeight = h;
-
- status_t err = mSurfaceTexture->setCrop(Rect(0, 0));
- ALOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err));
-
- return err;
-}
-
-int SurfaceTextureClient::setBuffersFormat(int format)
-{
- ALOGV("SurfaceTextureClient::setBuffersFormat");
- Mutex::Autolock lock(mMutex);
-
- if (format<0)
- return BAD_VALUE;
-
- mReqFormat = format;
-
- return NO_ERROR;
-}
-
-int SurfaceTextureClient::setScalingMode(int mode)
-{
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::setScalingMode(%d)", mode);
- Mutex::Autolock lock(mMutex);
- // mode is validated on the server
- status_t err = mSurfaceTexture->setScalingMode(mode);
- ALOGE_IF(err, "ISurfaceTexture::setScalingMode(%d) returned %s",
- mode, strerror(-err));
-
- return err;
-}
-
-int SurfaceTextureClient::setBuffersTransform(int transform)
-{
- ATRACE_CALL();
- ALOGV("SurfaceTextureClient::setBuffersTransform");
- Mutex::Autolock lock(mMutex);
- status_t err = mSurfaceTexture->setTransform(transform);
- return err;
-}
-
-int SurfaceTextureClient::setBuffersTimestamp(int64_t timestamp)
-{
- ALOGV("SurfaceTextureClient::setBuffersTimestamp");
- Mutex::Autolock lock(mMutex);
- mTimestamp = timestamp;
- return NO_ERROR;
-}
-
-void SurfaceTextureClient::freeAllBuffers() {
- for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
- mSlots[i] = 0;
- }
-}
-
-// ----------------------------------------------------------------------
-// the lock/unlock APIs must be used from the same thread
-
-static status_t copyBlt(
- const sp<GraphicBuffer>& dst,
- const sp<GraphicBuffer>& src,
- const Region& reg)
-{
- // src and dst with, height and format must be identical. no verification
- // is done here.
- status_t err;
- uint8_t const * src_bits = NULL;
- err = src->lock(GRALLOC_USAGE_SW_READ_OFTEN, reg.bounds(), (void**)&src_bits);
- ALOGE_IF(err, "error locking src buffer %s", strerror(-err));
-
- uint8_t* dst_bits = NULL;
- err = dst->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, reg.bounds(), (void**)&dst_bits);
- ALOGE_IF(err, "error locking dst buffer %s", strerror(-err));
-
- Region::const_iterator head(reg.begin());
- Region::const_iterator tail(reg.end());
- if (head != tail && src_bits && dst_bits) {
- const size_t bpp = bytesPerPixel(src->format);
- const size_t dbpr = dst->stride * bpp;
- const size_t sbpr = src->stride * bpp;
-
- while (head != tail) {
- const Rect& r(*head++);
- ssize_t h = r.height();
- if (h <= 0) continue;
- size_t size = r.width() * bpp;
- uint8_t const * s = src_bits + (r.left + src->stride * r.top) * bpp;
- uint8_t * d = dst_bits + (r.left + dst->stride * r.top) * bpp;
- if (dbpr==sbpr && size==sbpr) {
- size *= h;
- h = 1;
- }
- do {
- memcpy(d, s, size);
- d += dbpr;
- s += sbpr;
- } while (--h > 0);
- }
- }
-
- if (src_bits)
- src->unlock();
-
- if (dst_bits)
- dst->unlock();
-
- return err;
-}
-
-// ----------------------------------------------------------------------------
-
-status_t SurfaceTextureClient::lock(
- ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds)
-{
- if (mLockedBuffer != 0) {
- ALOGE("Surface::lock failed, already locked");
- return INVALID_OPERATION;
- }
-
- if (!mConnectedToCpu) {
- int err = SurfaceTextureClient::connect(NATIVE_WINDOW_API_CPU);
- if (err) {
- return err;
- }
- // we're intending to do software rendering from this point
- setUsage(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
- }
-
- ANativeWindowBuffer* out;
- status_t err = dequeueBuffer(&out);
- ALOGE_IF(err, "dequeueBuffer failed (%s)", strerror(-err));
- if (err == NO_ERROR) {
- sp<GraphicBuffer> backBuffer(GraphicBuffer::getSelf(out));
- err = lockBuffer(backBuffer.get());
- ALOGE_IF(err, "lockBuffer (handle=%p) failed (%s)",
- backBuffer->handle, strerror(-err));
- if (err == NO_ERROR) {
- const Rect bounds(backBuffer->width, backBuffer->height);
-
- Region newDirtyRegion;
- if (inOutDirtyBounds) {
- newDirtyRegion.set(static_cast<Rect const&>(*inOutDirtyBounds));
- newDirtyRegion.andSelf(bounds);
- } else {
- newDirtyRegion.set(bounds);
- }
-
- // figure out if we can copy the frontbuffer back
- const sp<GraphicBuffer>& frontBuffer(mPostedBuffer);
- const bool canCopyBack = (frontBuffer != 0 &&
- backBuffer->width == frontBuffer->width &&
- backBuffer->height == frontBuffer->height &&
- backBuffer->format == frontBuffer->format);
-
- if (canCopyBack) {
- // copy the area that is invalid and not repainted this round
- const Region copyback(mOldDirtyRegion.subtract(newDirtyRegion));
- if (!copyback.isEmpty())
- copyBlt(backBuffer, frontBuffer, copyback);
- } else {
- // if we can't copy-back anything, modify the user's dirty
- // region to make sure they redraw the whole buffer
- newDirtyRegion.set(bounds);
- }
-
- // keep track of the are of the buffer that is "clean"
- // (ie: that will be redrawn)
- mOldDirtyRegion = newDirtyRegion;
-
- if (inOutDirtyBounds) {
- *inOutDirtyBounds = newDirtyRegion.getBounds();
- }
-
- void* vaddr;
- status_t res = backBuffer->lock(
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
- newDirtyRegion.bounds(), &vaddr);
-
- ALOGW_IF(res, "failed locking buffer (handle = %p)",
- backBuffer->handle);
-
- mLockedBuffer = backBuffer;
- outBuffer->width = backBuffer->width;
- outBuffer->height = backBuffer->height;
- outBuffer->stride = backBuffer->stride;
- outBuffer->format = backBuffer->format;
- outBuffer->bits = vaddr;
- }
- }
- return err;
-}
-
-status_t SurfaceTextureClient::unlockAndPost()
-{
- if (mLockedBuffer == 0) {
- ALOGE("Surface::unlockAndPost failed, no locked buffer");
- return INVALID_OPERATION;
- }
-
- status_t err = mLockedBuffer->unlock();
- ALOGE_IF(err, "failed unlocking buffer (%p)", mLockedBuffer->handle);
-
- err = queueBuffer(mLockedBuffer.get());
- ALOGE_IF(err, "queueBuffer (handle=%p) failed (%s)",
- mLockedBuffer->handle, strerror(-err));
-
- mPostedBuffer = mLockedBuffer;
- mLockedBuffer = 0;
- return err;
-}
-
-}; // namespace android
diff --git a/libs/gui/tests/Android.mk b/libs/gui/tests/Android.mk
deleted file mode 100644
index 55ac133..0000000
--- a/libs/gui/tests/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Build the unit tests,
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := SurfaceTexture_test
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
- Surface_test.cpp \
- SurfaceTextureClient_test.cpp \
- SurfaceTexture_test.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libEGL \
- libGLESv2 \
- libandroid \
- libbinder \
- libcutils \
- libgui \
- libstlport \
- libui \
- libutils \
-
-LOCAL_C_INCLUDES := \
- bionic \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport \
-
-# Build the binary to $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
-# to integrate with auto-test framework.
-include $(BUILD_NATIVE_TEST)
-
-# Include subdirectory makefiles
-# ============================================================
-
-# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
-# team really wants is to build the stuff defined by this makefile.
-ifeq (,$(ONE_SHOT_MAKEFILE))
-include $(call first-makefiles-under,$(LOCAL_PATH))
-endif
diff --git a/libs/gui/tests/SurfaceTextureClient_test.cpp b/libs/gui/tests/SurfaceTextureClient_test.cpp
deleted file mode 100644
index c1a3c98..0000000
--- a/libs/gui/tests/SurfaceTextureClient_test.cpp
+++ /dev/null
@@ -1,697 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <EGL/egl.h>
-#include <gtest/gtest.h>
-#include <gui/SurfaceTextureClient.h>
-#include <utils/threads.h>
-
-namespace android {
-
-class SurfaceTextureClientTest : public ::testing::Test {
-protected:
- SurfaceTextureClientTest():
- mEglDisplay(EGL_NO_DISPLAY),
- mEglSurface(EGL_NO_SURFACE),
- mEglContext(EGL_NO_CONTEXT) {
- }
-
- virtual void SetUp() {
- mST = new SurfaceTexture(123);
- mSTC = new SurfaceTextureClient(mST);
- mANW = mSTC;
-
- // We need a valid GL context so we can test updateTexImage()
- // This initializes EGL and create a dummy GL context with a
- // pbuffer render target.
- mEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_DISPLAY, mEglDisplay);
-
- EGLint majorVersion, minorVersion;
- EXPECT_TRUE(eglInitialize(mEglDisplay, &majorVersion, &minorVersion));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EGLConfig myConfig;
- EGLint numConfigs = 0;
- EXPECT_TRUE(eglChooseConfig(mEglDisplay, getConfigAttribs(),
- &myConfig, 1, &numConfigs));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EGLint pbufferAttribs[] = {
- EGL_WIDTH, 16,
- EGL_HEIGHT, 16,
- EGL_NONE };
- mEglSurface = eglCreatePbufferSurface(mEglDisplay, myConfig, pbufferAttribs);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_SURFACE, mEglSurface);
-
- mEglContext = eglCreateContext(mEglDisplay, myConfig, EGL_NO_CONTEXT, 0);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_CONTEXT, mEglContext);
-
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- }
-
- virtual void TearDown() {
- mST.clear();
- mSTC.clear();
- mANW.clear();
-
- eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- eglDestroyContext(mEglDisplay, mEglContext);
- eglDestroySurface(mEglDisplay, mEglSurface);
- eglTerminate(mEglDisplay);
- }
-
- virtual EGLint const* getConfigAttribs() {
- static EGLint sDefaultConfigAttribs[] = {
- EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
- EGL_NONE
- };
-
- return sDefaultConfigAttribs;
- }
-
- sp<SurfaceTexture> mST;
- sp<SurfaceTextureClient> mSTC;
- sp<ANativeWindow> mANW;
-
- EGLDisplay mEglDisplay;
- EGLSurface mEglSurface;
- EGLContext mEglContext;
-};
-
-TEST_F(SurfaceTextureClientTest, GetISurfaceTextureIsNotNull) {
- sp<ISurfaceTexture> ist(mSTC->getISurfaceTexture());
- ASSERT_TRUE(ist != NULL);
-}
-
-TEST_F(SurfaceTextureClientTest, QueuesToWindowCompositorIsFalse) {
- int result = -123;
- int err = mANW->query(mANW.get(), NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER,
- &result);
- EXPECT_EQ(NO_ERROR, err);
- EXPECT_EQ(0, result);
-}
-
-TEST_F(SurfaceTextureClientTest, ConcreteTypeIsSurfaceTextureClient) {
- int result = -123;
- int err = mANW->query(mANW.get(), NATIVE_WINDOW_CONCRETE_TYPE, &result);
- EXPECT_EQ(NO_ERROR, err);
- EXPECT_EQ(NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT, result);
-}
-
-TEST_F(SurfaceTextureClientTest, EglCreateWindowSurfaceSucceeds) {
- EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_DISPLAY, dpy);
-
- EGLint majorVersion;
- EGLint minorVersion;
- EXPECT_TRUE(eglInitialize(dpy, &majorVersion, &minorVersion));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EGLConfig myConfig = {0};
- EGLint numConfigs = 0;
- EGLint configAttribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_RED_SIZE, 8,
- EGL_GREEN_SIZE, 8,
- EGL_BLUE_SIZE, 8,
- EGL_ALPHA_SIZE, 8,
- EGL_DEPTH_SIZE, 16,
- EGL_STENCIL_SIZE, 8,
- EGL_NONE };
- EXPECT_TRUE(eglChooseConfig(dpy, configAttribs, &myConfig, 1,
- &numConfigs));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EGLSurface eglSurface = eglCreateWindowSurface(dpy, myConfig, mANW.get(),
- NULL);
- EXPECT_NE(EGL_NO_SURFACE, eglSurface);
- EXPECT_EQ(EGL_SUCCESS, eglGetError());
-
- eglTerminate(dpy);
-}
-
-TEST_F(SurfaceTextureClientTest, BufferGeometryInvalidSizesFail) {
- EXPECT_GT(OK, native_window_set_buffers_geometry(mANW.get(), -1, 0, 0));
- EXPECT_GT(OK, native_window_set_buffers_geometry(mANW.get(), 0, -1, 0));
- EXPECT_GT(OK, native_window_set_buffers_geometry(mANW.get(), 0, 0, -1));
- EXPECT_GT(OK, native_window_set_buffers_geometry(mANW.get(), -1, -1, 0));
- EXPECT_GT(OK, native_window_set_buffers_geometry(mANW.get(), 0, 8, 0));
- EXPECT_GT(OK, native_window_set_buffers_geometry(mANW.get(), 8, 0, 0));
-}
-
-TEST_F(SurfaceTextureClientTest, DefaultGeometryValues) {
- ANativeWindowBuffer* buf;
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf));
- EXPECT_EQ(1, buf->width);
- EXPECT_EQ(1, buf->height);
- EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf));
-}
-
-TEST_F(SurfaceTextureClientTest, BufferGeometryCanBeSet) {
- ANativeWindowBuffer* buf;
- EXPECT_EQ(OK, native_window_set_buffers_geometry(mANW.get(), 16, 8, PIXEL_FORMAT_RGB_565));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf));
- EXPECT_EQ(16, buf->width);
- EXPECT_EQ(8, buf->height);
- EXPECT_EQ(PIXEL_FORMAT_RGB_565, buf->format);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf));
-}
-
-TEST_F(SurfaceTextureClientTest, BufferGeometryDefaultSizeSetFormat) {
- ANativeWindowBuffer* buf;
- EXPECT_EQ(OK, native_window_set_buffers_geometry(mANW.get(), 0, 0, PIXEL_FORMAT_RGB_565));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf));
- EXPECT_EQ(1, buf->width);
- EXPECT_EQ(1, buf->height);
- EXPECT_EQ(PIXEL_FORMAT_RGB_565, buf->format);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf));
-}
-
-TEST_F(SurfaceTextureClientTest, BufferGeometrySetSizeDefaultFormat) {
- ANativeWindowBuffer* buf;
- EXPECT_EQ(OK, native_window_set_buffers_geometry(mANW.get(), 16, 8, 0));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf));
- EXPECT_EQ(16, buf->width);
- EXPECT_EQ(8, buf->height);
- EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf));
-}
-
-TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeUnset) {
- ANativeWindowBuffer* buf;
- EXPECT_EQ(OK, native_window_set_buffers_geometry(mANW.get(), 16, 8, 0));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf));
- EXPECT_EQ(16, buf->width);
- EXPECT_EQ(8, buf->height);
- EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf));
- EXPECT_EQ(OK, native_window_set_buffers_geometry(mANW.get(), 0, 0, 0));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf));
- EXPECT_EQ(1, buf->width);
- EXPECT_EQ(1, buf->height);
- EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf));
-}
-
-TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeChangedWithoutFormat) {
- ANativeWindowBuffer* buf;
- EXPECT_EQ(OK, native_window_set_buffers_geometry(mANW.get(), 0, 0, PIXEL_FORMAT_RGB_565));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf));
- EXPECT_EQ(1, buf->width);
- EXPECT_EQ(1, buf->height);
- EXPECT_EQ(PIXEL_FORMAT_RGB_565, buf->format);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf));
- EXPECT_EQ(OK, native_window_set_buffers_geometry(mANW.get(), 16, 8, 0));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf));
- EXPECT_EQ(16, buf->width);
- EXPECT_EQ(8, buf->height);
- EXPECT_EQ(PIXEL_FORMAT_RGB_565, buf->format);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf));
-}
-
-TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSize) {
- sp<SurfaceTexture> st(mST);
- ANativeWindowBuffer* buf;
- EXPECT_EQ(OK, st->setDefaultBufferSize(16, 8));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf));
- EXPECT_EQ(16, buf->width);
- EXPECT_EQ(8, buf->height);
- EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf));
-}
-
-TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeAfterDequeue) {
- ANativeWindowBuffer* buf[2];
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- EXPECT_NE(buf[0], buf[1]);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[1]));
- EXPECT_EQ(OK, mST->setDefaultBufferSize(16, 8));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- EXPECT_NE(buf[0], buf[1]);
- EXPECT_EQ(16, buf[0]->width);
- EXPECT_EQ(16, buf[1]->width);
- EXPECT_EQ(8, buf[0]->height);
- EXPECT_EQ(8, buf[1]->height);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[1]));
-}
-
-TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeVsGeometry) {
- ANativeWindowBuffer* buf[2];
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
- EXPECT_EQ(OK, mST->setDefaultBufferSize(16, 8));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- EXPECT_NE(buf[0], buf[1]);
- EXPECT_EQ(16, buf[0]->width);
- EXPECT_EQ(16, buf[1]->width);
- EXPECT_EQ(8, buf[0]->height);
- EXPECT_EQ(8, buf[1]->height);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[1]));
- EXPECT_EQ(OK, native_window_set_buffers_geometry(mANW.get(), 12, 24, 0));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- EXPECT_NE(buf[0], buf[1]);
- EXPECT_EQ(12, buf[0]->width);
- EXPECT_EQ(12, buf[1]->width);
- EXPECT_EQ(24, buf[0]->height);
- EXPECT_EQ(24, buf[1]->height);
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[1]));
-}
-
-TEST_F(SurfaceTextureClientTest, SurfaceTextureTooManyUpdateTexImage) {
- android_native_buffer_t* buf[3];
- ASSERT_EQ(OK, mST->setSynchronousMode(false));
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
-
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(OK, mST->updateTexImage());
-
- ASSERT_EQ(OK, mST->setSynchronousMode(true));
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3));
-
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1]));
-
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(OK, mST->updateTexImage());
-}
-
-TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeSlowRetire) {
- android_native_buffer_t* buf[3];
- ASSERT_EQ(OK, mST->setSynchronousMode(true));
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[2]));
- EXPECT_NE(buf[0], buf[1]);
- EXPECT_NE(buf[1], buf[2]);
- EXPECT_NE(buf[2], buf[0]);
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2]));
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[0]);
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[1]);
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[2]);
-}
-
-TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeFastRetire) {
- android_native_buffer_t* buf[3];
- ASSERT_EQ(OK, mST->setSynchronousMode(true));
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[2]));
- EXPECT_NE(buf[0], buf[1]);
- EXPECT_NE(buf[1], buf[2]);
- EXPECT_NE(buf[2], buf[0]);
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[0]);
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1]));
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[1]);
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2]));
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[2]);
-}
-
-TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeDQQR) {
- android_native_buffer_t* buf[3];
- ASSERT_EQ(OK, mST->setSynchronousMode(true));
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3));
-
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[0]);
-
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- EXPECT_NE(buf[0], buf[1]);
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1]));
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[1]);
-
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[2]));
- EXPECT_NE(buf[1], buf[2]);
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2]));
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[2]);
-}
-
-// XXX: We currently have no hardware that properly handles dequeuing the
-// buffer that is currently bound to the texture.
-TEST_F(SurfaceTextureClientTest, DISABLED_SurfaceTextureSyncModeDequeueCurrent) {
- android_native_buffer_t* buf[3];
- android_native_buffer_t* firstBuf;
- ASSERT_EQ(OK, mST->setSynchronousMode(true));
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &firstBuf));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), firstBuf));
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), firstBuf);
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1]));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[2]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2]));
- EXPECT_NE(buf[0], buf[1]);
- EXPECT_NE(buf[1], buf[2]);
- EXPECT_NE(buf[2], buf[0]);
- EXPECT_EQ(firstBuf, buf[2]);
-}
-
-TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeMinUndequeued) {
- android_native_buffer_t* buf[3];
- ASSERT_EQ(OK, mST->setSynchronousMode(true));
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3));
-
- // We should be able to dequeue all the buffers before we've queued mANWy.
- EXPECT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- EXPECT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- EXPECT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[2]));
-
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[2]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1]));
-
- EXPECT_EQ(OK, mST->updateTexImage());
- EXPECT_EQ(mST->getCurrentBuffer().get(), buf[1]);
-
- EXPECT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[2]));
-
- // Once we've queued a buffer, however we should not be able to dequeue more
- // than (buffer-count - MIN_UNDEQUEUED_BUFFERS), which is 2 in this case.
- EXPECT_EQ(-EBUSY, mANW->dequeueBuffer(mANW.get(), &buf[1]));
-
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[2]));
-}
-
-// XXX: This is not expected to pass until the synchronization hacks are removed
-// from the SurfaceTexture class.
-TEST_F(SurfaceTextureClientTest, DISABLED_SurfaceTextureSyncModeWaitRetire) {
- class MyThread : public Thread {
- sp<SurfaceTexture> mST;
- EGLContext ctx;
- EGLSurface sur;
- EGLDisplay dpy;
- bool mBufferRetired;
- Mutex mLock;
- virtual bool threadLoop() {
- eglMakeCurrent(dpy, sur, sur, ctx);
- usleep(20000);
- Mutex::Autolock _l(mLock);
- mST->updateTexImage();
- mBufferRetired = true;
- eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- return false;
- }
- public:
- MyThread(const sp<SurfaceTexture>& mST)
- : mST(mST), mBufferRetired(false) {
- ctx = eglGetCurrentContext();
- sur = eglGetCurrentSurface(EGL_DRAW);
- dpy = eglGetCurrentDisplay();
- eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- }
- ~MyThread() {
- eglMakeCurrent(dpy, sur, sur, ctx);
- }
- void bufferDequeued() {
- Mutex::Autolock _l(mLock);
- EXPECT_EQ(true, mBufferRetired);
- }
- };
-
- android_native_buffer_t* buf[3];
- ASSERT_EQ(OK, mST->setSynchronousMode(true));
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3));
- // dequeue/queue/update so we have a current buffer
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- mST->updateTexImage();
-
- MyThread* thread = new MyThread(mST);
- sp<Thread> threadBase(thread);
-
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- thread->run();
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[1]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1]));
- //ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[2]));
- //ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2]));
- thread->bufferDequeued();
- thread->requestExitAndWait();
-}
-
-TEST_F(SurfaceTextureClientTest, GetTransformMatrixReturnsVerticalFlip) {
- android_native_buffer_t* buf[3];
- float mtx[16] = {};
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mST->updateTexImage());
- mST->getTransformMatrix(mtx);
-
- EXPECT_EQ(1.f, mtx[0]);
- EXPECT_EQ(0.f, mtx[1]);
- EXPECT_EQ(0.f, mtx[2]);
- EXPECT_EQ(0.f, mtx[3]);
-
- EXPECT_EQ(0.f, mtx[4]);
- EXPECT_EQ(-1.f, mtx[5]);
- EXPECT_EQ(0.f, mtx[6]);
- EXPECT_EQ(0.f, mtx[7]);
-
- EXPECT_EQ(0.f, mtx[8]);
- EXPECT_EQ(0.f, mtx[9]);
- EXPECT_EQ(1.f, mtx[10]);
- EXPECT_EQ(0.f, mtx[11]);
-
- EXPECT_EQ(0.f, mtx[12]);
- EXPECT_EQ(1.f, mtx[13]);
- EXPECT_EQ(0.f, mtx[14]);
- EXPECT_EQ(1.f, mtx[15]);
-}
-
-TEST_F(SurfaceTextureClientTest, GetTransformMatrixSucceedsAfterFreeingBuffers) {
- android_native_buffer_t* buf[3];
- float mtx[16] = {};
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mST->updateTexImage());
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 6)); // frees buffers
- mST->getTransformMatrix(mtx);
-
- EXPECT_EQ(1.f, mtx[0]);
- EXPECT_EQ(0.f, mtx[1]);
- EXPECT_EQ(0.f, mtx[2]);
- EXPECT_EQ(0.f, mtx[3]);
-
- EXPECT_EQ(0.f, mtx[4]);
- EXPECT_EQ(-1.f, mtx[5]);
- EXPECT_EQ(0.f, mtx[6]);
- EXPECT_EQ(0.f, mtx[7]);
-
- EXPECT_EQ(0.f, mtx[8]);
- EXPECT_EQ(0.f, mtx[9]);
- EXPECT_EQ(1.f, mtx[10]);
- EXPECT_EQ(0.f, mtx[11]);
-
- EXPECT_EQ(0.f, mtx[12]);
- EXPECT_EQ(1.f, mtx[13]);
- EXPECT_EQ(0.f, mtx[14]);
- EXPECT_EQ(1.f, mtx[15]);
-}
-
-TEST_F(SurfaceTextureClientTest, GetTransformMatrixSucceedsAfterFreeingBuffersWithCrop) {
- android_native_buffer_t* buf[3];
- float mtx[16] = {};
- android_native_rect_t crop;
- crop.left = 0;
- crop.top = 0;
- crop.right = 5;
- crop.bottom = 5;
-
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
- ASSERT_EQ(OK, native_window_set_buffers_geometry(mANW.get(), 8, 8, 0));
- ASSERT_EQ(OK, mANW->dequeueBuffer(mANW.get(), &buf[0]));
- ASSERT_EQ(OK, native_window_set_crop(mANW.get(), &crop));
- ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0]));
- ASSERT_EQ(OK, mST->updateTexImage());
- ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 6)); // frees buffers
- mST->getTransformMatrix(mtx);
-
- // This accounts for the 1 texel shrink for each edge that's included in the
- // transform matrix to avoid texturing outside the crop region.
- EXPECT_EQ(.5f, mtx[0]);
- EXPECT_EQ(0.f, mtx[1]);
- EXPECT_EQ(0.f, mtx[2]);
- EXPECT_EQ(0.f, mtx[3]);
-
- EXPECT_EQ(0.f, mtx[4]);
- EXPECT_EQ(-.5f, mtx[5]);
- EXPECT_EQ(0.f, mtx[6]);
- EXPECT_EQ(0.f, mtx[7]);
-
- EXPECT_EQ(0.f, mtx[8]);
- EXPECT_EQ(0.f, mtx[9]);
- EXPECT_EQ(1.f, mtx[10]);
- EXPECT_EQ(0.f, mtx[11]);
-
- EXPECT_EQ(0.f, mtx[12]);
- EXPECT_EQ(.5f, mtx[13]);
- EXPECT_EQ(0.f, mtx[14]);
- EXPECT_EQ(1.f, mtx[15]);
-}
-
-// This test verifies that the buffer format can be queried immediately after
-// it is set.
-TEST_F(SurfaceTextureClientTest, QueryFormatAfterSettingWorks) {
- sp<ANativeWindow> anw(mSTC);
- int fmts[] = {
- // RGBA_8888 should not come first, as it's the default
- HAL_PIXEL_FORMAT_RGBX_8888,
- HAL_PIXEL_FORMAT_RGBA_8888,
- HAL_PIXEL_FORMAT_RGB_888,
- HAL_PIXEL_FORMAT_RGB_565,
- HAL_PIXEL_FORMAT_BGRA_8888,
- HAL_PIXEL_FORMAT_RGBA_5551,
- HAL_PIXEL_FORMAT_RGBA_4444,
- HAL_PIXEL_FORMAT_YV12,
- };
-
- const int numFmts = (sizeof(fmts) / sizeof(fmts[0]));
- for (int i = 0; i < numFmts; i++) {
- int fmt = -1;
- ASSERT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 0, 0, fmts[i]));
- ASSERT_EQ(OK, anw->query(anw.get(), NATIVE_WINDOW_FORMAT, &fmt));
- EXPECT_EQ(fmts[i], fmt);
- }
-}
-
-class MultiSurfaceTextureClientTest : public ::testing::Test {
-
-public:
- MultiSurfaceTextureClientTest() :
- mEglDisplay(EGL_NO_DISPLAY),
- mEglContext(EGL_NO_CONTEXT) {
- for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) {
- mEglSurfaces[i] = EGL_NO_CONTEXT;
- }
- }
-
-protected:
-
- enum { NUM_SURFACE_TEXTURES = 32 };
-
- virtual void SetUp() {
- mEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_DISPLAY, mEglDisplay);
-
- EGLint majorVersion, minorVersion;
- EXPECT_TRUE(eglInitialize(mEglDisplay, &majorVersion, &minorVersion));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EGLConfig myConfig;
- EGLint numConfigs = 0;
- EGLint configAttribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_NONE
- };
- EXPECT_TRUE(eglChooseConfig(mEglDisplay, configAttribs, &myConfig, 1,
- &numConfigs));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- mEglContext = eglCreateContext(mEglDisplay, myConfig, EGL_NO_CONTEXT,
- 0);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_CONTEXT, mEglContext);
-
- for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) {
- sp<SurfaceTexture> st(new SurfaceTexture(i));
- sp<SurfaceTextureClient> stc(new SurfaceTextureClient(st));
- mEglSurfaces[i] = eglCreateWindowSurface(mEglDisplay, myConfig,
- static_cast<ANativeWindow*>(stc.get()), NULL);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_SURFACE, mEglSurfaces[i]);
- }
- }
-
- virtual void TearDown() {
- eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE,
- EGL_NO_CONTEXT);
-
- for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) {
- if (mEglSurfaces[i] != EGL_NO_SURFACE) {
- eglDestroySurface(mEglDisplay, mEglSurfaces[i]);
- }
- }
-
- if (mEglContext != EGL_NO_CONTEXT) {
- eglDestroyContext(mEglDisplay, mEglContext);
- }
-
- if (mEglDisplay != EGL_NO_DISPLAY) {
- eglTerminate(mEglDisplay);
- }
- }
-
- EGLDisplay mEglDisplay;
- EGLSurface mEglSurfaces[NUM_SURFACE_TEXTURES];
- EGLContext mEglContext;
-};
-
-// XXX: This test is disabled because it causes a hang on some devices. See bug
-// 5015672.
-TEST_F(MultiSurfaceTextureClientTest, DISABLED_MakeCurrentBetweenSurfacesWorks) {
- for (int iter = 0; iter < 8; iter++) {
- for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) {
- eglMakeCurrent(mEglDisplay, mEglSurfaces[i], mEglSurfaces[i],
- mEglContext);
- glClear(GL_COLOR_BUFFER_BIT);
- eglSwapBuffers(mEglDisplay, mEglSurfaces[i]);
- }
- }
-}
-
-} // namespace android
diff --git a/libs/gui/tests/SurfaceTexture_test.cpp b/libs/gui/tests/SurfaceTexture_test.cpp
deleted file mode 100644
index 8c6defe..0000000
--- a/libs/gui/tests/SurfaceTexture_test.cpp
+++ /dev/null
@@ -1,1730 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#define LOG_TAG "SurfaceTexture_test"
-//#define LOG_NDEBUG 0
-
-#include <gtest/gtest.h>
-#include <gui/SurfaceTexture.h>
-#include <gui/SurfaceTextureClient.h>
-#include <ui/GraphicBuffer.h>
-#include <utils/String8.h>
-#include <utils/threads.h>
-
-#include <gui/ISurfaceComposer.h>
-#include <gui/Surface.h>
-#include <gui/SurfaceComposerClient.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-
-namespace android {
-
-class GLTest : public ::testing::Test {
-protected:
-
- GLTest():
- mEglDisplay(EGL_NO_DISPLAY),
- mEglSurface(EGL_NO_SURFACE),
- mEglContext(EGL_NO_CONTEXT) {
- }
-
- virtual void SetUp() {
- mEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_DISPLAY, mEglDisplay);
-
- EGLint majorVersion;
- EGLint minorVersion;
- EXPECT_TRUE(eglInitialize(mEglDisplay, &majorVersion, &minorVersion));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- RecordProperty("EglVersionMajor", majorVersion);
- RecordProperty("EglVersionMajor", minorVersion);
-
- EGLint numConfigs = 0;
- EXPECT_TRUE(eglChooseConfig(mEglDisplay, getConfigAttribs(), &mGlConfig,
- 1, &numConfigs));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- char* displaySecsEnv = getenv("GLTEST_DISPLAY_SECS");
- if (displaySecsEnv != NULL) {
- mDisplaySecs = atoi(displaySecsEnv);
- if (mDisplaySecs < 0) {
- mDisplaySecs = 0;
- }
- } else {
- mDisplaySecs = 0;
- }
-
- if (mDisplaySecs > 0) {
- mComposerClient = new SurfaceComposerClient;
- ASSERT_EQ(NO_ERROR, mComposerClient->initCheck());
-
- mSurfaceControl = mComposerClient->createSurface(
- String8("Test Surface"), 0,
- getSurfaceWidth(), getSurfaceHeight(),
- PIXEL_FORMAT_RGB_888, 0);
-
- ASSERT_TRUE(mSurfaceControl != NULL);
- ASSERT_TRUE(mSurfaceControl->isValid());
-
- SurfaceComposerClient::openGlobalTransaction();
- ASSERT_EQ(NO_ERROR, mSurfaceControl->setLayer(0x7FFFFFFF));
- ASSERT_EQ(NO_ERROR, mSurfaceControl->show());
- SurfaceComposerClient::closeGlobalTransaction();
-
- sp<ANativeWindow> window = mSurfaceControl->getSurface();
- mEglSurface = eglCreateWindowSurface(mEglDisplay, mGlConfig,
- window.get(), NULL);
- } else {
- EGLint pbufferAttribs[] = {
- EGL_WIDTH, getSurfaceWidth(),
- EGL_HEIGHT, getSurfaceHeight(),
- EGL_NONE };
-
- mEglSurface = eglCreatePbufferSurface(mEglDisplay, mGlConfig,
- pbufferAttribs);
- }
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_SURFACE, mEglSurface);
-
- mEglContext = eglCreateContext(mEglDisplay, mGlConfig, EGL_NO_CONTEXT,
- getContextAttribs());
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_CONTEXT, mEglContext);
-
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
- mEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EGLint w, h;
- EXPECT_TRUE(eglQuerySurface(mEglDisplay, mEglSurface, EGL_WIDTH, &w));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- EXPECT_TRUE(eglQuerySurface(mEglDisplay, mEglSurface, EGL_HEIGHT, &h));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- RecordProperty("EglSurfaceWidth", w);
- RecordProperty("EglSurfaceHeight", h);
-
- glViewport(0, 0, w, h);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- }
-
- virtual void TearDown() {
- // Display the result
- if (mDisplaySecs > 0 && mEglSurface != EGL_NO_SURFACE) {
- eglSwapBuffers(mEglDisplay, mEglSurface);
- sleep(mDisplaySecs);
- }
-
- if (mComposerClient != NULL) {
- mComposerClient->dispose();
- }
- if (mEglContext != EGL_NO_CONTEXT) {
- eglDestroyContext(mEglDisplay, mEglContext);
- }
- if (mEglSurface != EGL_NO_SURFACE) {
- eglDestroySurface(mEglDisplay, mEglSurface);
- }
- if (mEglDisplay != EGL_NO_DISPLAY) {
- eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE,
- EGL_NO_CONTEXT);
- eglTerminate(mEglDisplay);
- }
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- }
-
- virtual EGLint const* getConfigAttribs() {
- static EGLint sDefaultConfigAttribs[] = {
- EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_RED_SIZE, 8,
- EGL_GREEN_SIZE, 8,
- EGL_BLUE_SIZE, 8,
- EGL_ALPHA_SIZE, 8,
- EGL_DEPTH_SIZE, 16,
- EGL_STENCIL_SIZE, 8,
- EGL_NONE };
-
- return sDefaultConfigAttribs;
- }
-
- virtual EGLint const* getContextAttribs() {
- static EGLint sDefaultContextAttribs[] = {
- EGL_CONTEXT_CLIENT_VERSION, 2,
- EGL_NONE };
-
- return sDefaultContextAttribs;
- }
-
- virtual EGLint getSurfaceWidth() {
- return 512;
- }
-
- virtual EGLint getSurfaceHeight() {
- return 512;
- }
-
- void loadShader(GLenum shaderType, const char* pSource, GLuint* outShader) {
- GLuint shader = glCreateShader(shaderType);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- if (shader) {
- glShaderSource(shader, 1, &pSource, NULL);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- glCompileShader(shader);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- GLint compiled = 0;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- if (!compiled) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf) {
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- printf("Shader compile log:\n%s\n", buf);
- free(buf);
- FAIL();
- }
- } else {
- char* buf = (char*) malloc(0x1000);
- if (buf) {
- glGetShaderInfoLog(shader, 0x1000, NULL, buf);
- printf("Shader compile log:\n%s\n", buf);
- free(buf);
- FAIL();
- }
- }
- glDeleteShader(shader);
- shader = 0;
- }
- }
- ASSERT_TRUE(shader != 0);
- *outShader = shader;
- }
-
- void createProgram(const char* pVertexSource, const char* pFragmentSource,
- GLuint* outPgm) {
- GLuint vertexShader, fragmentShader;
- {
- SCOPED_TRACE("compiling vertex shader");
- loadShader(GL_VERTEX_SHADER, pVertexSource, &vertexShader);
- if (HasFatalFailure()) {
- return;
- }
- }
- {
- SCOPED_TRACE("compiling fragment shader");
- loadShader(GL_FRAGMENT_SHADER, pFragmentSource, &fragmentShader);
- if (HasFatalFailure()) {
- return;
- }
- }
-
- GLuint program = glCreateProgram();
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- if (program) {
- glAttachShader(program, vertexShader);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- glAttachShader(program, fragmentShader);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- glLinkProgram(program);
- GLint linkStatus = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
- if (linkStatus != GL_TRUE) {
- GLint bufLength = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
- if (bufLength) {
- char* buf = (char*) malloc(bufLength);
- if (buf) {
- glGetProgramInfoLog(program, bufLength, NULL, buf);
- printf("Program link log:\n%s\n", buf);
- free(buf);
- FAIL();
- }
- }
- glDeleteProgram(program);
- program = 0;
- }
- }
- glDeleteShader(vertexShader);
- glDeleteShader(fragmentShader);
- ASSERT_TRUE(program != 0);
- *outPgm = program;
- }
-
- static int abs(int value) {
- return value > 0 ? value : -value;
- }
-
- ::testing::AssertionResult checkPixel(int x, int y, int r,
- int g, int b, int a, int tolerance=2) {
- GLubyte pixel[4];
- String8 msg;
- glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
- GLenum err = glGetError();
- if (err != GL_NO_ERROR) {
- msg += String8::format("error reading pixel: %#x", err);
- while ((err = glGetError()) != GL_NO_ERROR) {
- msg += String8::format(", %#x", err);
- }
- fprintf(stderr, "pixel check failure: %s\n", msg.string());
- return ::testing::AssertionFailure(
- ::testing::Message(msg.string()));
- }
- if (r >= 0 && abs(r - int(pixel[0])) > tolerance) {
- msg += String8::format("r(%d isn't %d)", pixel[0], r);
- }
- if (g >= 0 && abs(g - int(pixel[1])) > tolerance) {
- if (!msg.isEmpty()) {
- msg += " ";
- }
- msg += String8::format("g(%d isn't %d)", pixel[1], g);
- }
- if (b >= 0 && abs(b - int(pixel[2])) > tolerance) {
- if (!msg.isEmpty()) {
- msg += " ";
- }
- msg += String8::format("b(%d isn't %d)", pixel[2], b);
- }
- if (a >= 0 && abs(a - int(pixel[3])) > tolerance) {
- if (!msg.isEmpty()) {
- msg += " ";
- }
- msg += String8::format("a(%d isn't %d)", pixel[3], a);
- }
- if (!msg.isEmpty()) {
- fprintf(stderr, "pixel check failure: %s\n", msg.string());
- return ::testing::AssertionFailure(
- ::testing::Message(msg.string()));
- } else {
- return ::testing::AssertionSuccess();
- }
- }
-
- int mDisplaySecs;
- sp<SurfaceComposerClient> mComposerClient;
- sp<SurfaceControl> mSurfaceControl;
-
- EGLDisplay mEglDisplay;
- EGLSurface mEglSurface;
- EGLContext mEglContext;
- EGLConfig mGlConfig;
-};
-
-// XXX: Code above this point should live elsewhere
-
-class SurfaceTextureGLTest : public GLTest {
-protected:
- enum { TEX_ID = 123 };
-
- virtual void SetUp() {
- GLTest::SetUp();
- mST = new SurfaceTexture(TEX_ID);
- mSTC = new SurfaceTextureClient(mST);
- mANW = mSTC;
-
- const char vsrc[] =
- "attribute vec4 vPosition;\n"
- "varying vec2 texCoords;\n"
- "uniform mat4 texMatrix;\n"
- "void main() {\n"
- " vec2 vTexCoords = 0.5 * (vPosition.xy + vec2(1.0, 1.0));\n"
- " texCoords = (texMatrix * vec4(vTexCoords, 0.0, 1.0)).xy;\n"
- " gl_Position = vPosition;\n"
- "}\n";
-
- const char fsrc[] =
- "#extension GL_OES_EGL_image_external : require\n"
- "precision mediump float;\n"
- "uniform samplerExternalOES texSampler;\n"
- "varying vec2 texCoords;\n"
- "void main() {\n"
- " gl_FragColor = texture2D(texSampler, texCoords);\n"
- "}\n";
-
- {
- SCOPED_TRACE("creating shader program");
- createProgram(vsrc, fsrc, &mPgm);
- if (HasFatalFailure()) {
- return;
- }
- }
-
- mPositionHandle = glGetAttribLocation(mPgm, "vPosition");
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- ASSERT_NE(-1, mPositionHandle);
- mTexSamplerHandle = glGetUniformLocation(mPgm, "texSampler");
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- ASSERT_NE(-1, mTexSamplerHandle);
- mTexMatrixHandle = glGetUniformLocation(mPgm, "texMatrix");
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- ASSERT_NE(-1, mTexMatrixHandle);
- }
-
- virtual void TearDown() {
- mANW.clear();
- mSTC.clear();
- mST.clear();
- GLTest::TearDown();
- }
-
- // drawTexture draws the SurfaceTexture over the entire GL viewport.
- void drawTexture() {
- const GLfloat triangleVertices[] = {
- -1.0f, 1.0f,
- -1.0f, -1.0f,
- 1.0f, -1.0f,
- 1.0f, 1.0f,
- };
-
- glVertexAttribPointer(mPositionHandle, 2, GL_FLOAT, GL_FALSE, 0,
- triangleVertices);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- glEnableVertexAttribArray(mPositionHandle);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
-
- glUseProgram(mPgm);
- glUniform1i(mTexSamplerHandle, 0);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, TEX_ID);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
-
- // XXX: These calls are not needed for GL_TEXTURE_EXTERNAL_OES as
- // they're setting the defautls for that target, but when hacking things
- // to use GL_TEXTURE_2D they are needed to achieve the same behavior.
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER,
- GL_LINEAR);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER,
- GL_LINEAR);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S,
- GL_CLAMP_TO_EDGE);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T,
- GL_CLAMP_TO_EDGE);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
-
- GLfloat texMatrix[16];
- mST->getTransformMatrix(texMatrix);
- glUniformMatrix4fv(mTexMatrixHandle, 1, GL_FALSE, texMatrix);
-
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- }
-
- class FrameWaiter : public SurfaceTexture::FrameAvailableListener {
- public:
- FrameWaiter():
- mPendingFrames(0) {
- }
-
- void waitForFrame() {
- Mutex::Autolock lock(mMutex);
- while (mPendingFrames == 0) {
- mCondition.wait(mMutex);
- }
- mPendingFrames--;
- }
-
- virtual void onFrameAvailable() {
- Mutex::Autolock lock(mMutex);
- mPendingFrames++;
- mCondition.signal();
- }
-
- int mPendingFrames;
- Mutex mMutex;
- Condition mCondition;
- };
-
- sp<SurfaceTexture> mST;
- sp<SurfaceTextureClient> mSTC;
- sp<ANativeWindow> mANW;
-
- GLuint mPgm;
- GLint mPositionHandle;
- GLint mTexSamplerHandle;
- GLint mTexMatrixHandle;
-};
-
-// Fill a YV12 buffer with a multi-colored checkerboard pattern
-void fillYV12Buffer(uint8_t* buf, int w, int h, int stride) {
- const int blockWidth = w > 16 ? w / 16 : 1;
- const int blockHeight = h > 16 ? h / 16 : 1;
- const int yuvTexOffsetY = 0;
- int yuvTexStrideY = stride;
- int yuvTexOffsetV = yuvTexStrideY * h;
- int yuvTexStrideV = (yuvTexStrideY/2 + 0xf) & ~0xf;
- int yuvTexOffsetU = yuvTexOffsetV + yuvTexStrideV * h/2;
- int yuvTexStrideU = yuvTexStrideV;
- for (int x = 0; x < w; x++) {
- for (int y = 0; y < h; y++) {
- int parityX = (x / blockWidth) & 1;
- int parityY = (y / blockHeight) & 1;
- unsigned char intensity = (parityX ^ parityY) ? 63 : 191;
- buf[yuvTexOffsetY + (y * yuvTexStrideY) + x] = intensity;
- if (x < w / 2 && y < h / 2) {
- buf[yuvTexOffsetU + (y * yuvTexStrideU) + x] = intensity;
- if (x * 2 < w / 2 && y * 2 < h / 2) {
- buf[yuvTexOffsetV + (y*2 * yuvTexStrideV) + x*2 + 0] =
- buf[yuvTexOffsetV + (y*2 * yuvTexStrideV) + x*2 + 1] =
- buf[yuvTexOffsetV + ((y*2+1) * yuvTexStrideV) + x*2 + 0] =
- buf[yuvTexOffsetV + ((y*2+1) * yuvTexStrideV) + x*2 + 1] =
- intensity;
- }
- }
- }
- }
-}
-
-// Fill a YV12 buffer with red outside a given rectangle and green inside it.
-void fillYV12BufferRect(uint8_t* buf, int w, int h, int stride,
- const android_native_rect_t& rect) {
- const int yuvTexOffsetY = 0;
- int yuvTexStrideY = stride;
- int yuvTexOffsetV = yuvTexStrideY * h;
- int yuvTexStrideV = (yuvTexStrideY/2 + 0xf) & ~0xf;
- int yuvTexOffsetU = yuvTexOffsetV + yuvTexStrideV * h/2;
- int yuvTexStrideU = yuvTexStrideV;
- for (int x = 0; x < w; x++) {
- for (int y = 0; y < h; y++) {
- bool inside = rect.left <= x && x < rect.right &&
- rect.top <= y && y < rect.bottom;
- buf[yuvTexOffsetY + (y * yuvTexStrideY) + x] = inside ? 240 : 64;
- if (x < w / 2 && y < h / 2) {
- bool inside = rect.left <= 2*x && 2*x < rect.right &&
- rect.top <= 2*y && 2*y < rect.bottom;
- buf[yuvTexOffsetU + (y * yuvTexStrideU) + x] = 16;
- buf[yuvTexOffsetV + (y * yuvTexStrideV) + x] =
- inside ? 16 : 255;
- }
- }
- }
-}
-
-void fillRGBA8Buffer(uint8_t* buf, int w, int h, int stride) {
- const size_t PIXEL_SIZE = 4;
- for (int x = 0; x < w; x++) {
- for (int y = 0; y < h; y++) {
- off_t offset = (y * stride + x) * PIXEL_SIZE;
- for (int c = 0; c < 4; c++) {
- int parityX = (x / (1 << (c+2))) & 1;
- int parityY = (y / (1 << (c+2))) & 1;
- buf[offset + c] = (parityX ^ parityY) ? 231 : 35;
- }
- }
- }
-}
-
-void fillRGBA8BufferSolid(uint8_t* buf, int w, int h, int stride, uint8_t r,
- uint8_t g, uint8_t b, uint8_t a) {
- const size_t PIXEL_SIZE = 4;
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < h; x++) {
- off_t offset = (y * stride + x) * PIXEL_SIZE;
- buf[offset + 0] = r;
- buf[offset + 1] = g;
- buf[offset + 2] = b;
- buf[offset + 3] = a;
- }
- }
-}
-
-TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferNpot) {
- const int texWidth = 64;
- const int texHeight = 66;
-
- ASSERT_EQ(NO_ERROR, native_window_set_buffers_geometry(mANW.get(),
- texWidth, texHeight, HAL_PIXEL_FORMAT_YV12));
- ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(),
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN));
-
- ANativeWindowBuffer* anb;
- ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- ASSERT_TRUE(anb != NULL);
-
- sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
- ASSERT_EQ(NO_ERROR, mANW->lockBuffer(mANW.get(), buf->getNativeBuffer()));
-
- // Fill the buffer with the a checkerboard pattern
- uint8_t* img = NULL;
- buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
- fillYV12Buffer(img, texWidth, texHeight, buf->getStride());
- buf->unlock();
- ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer()));
-
- mST->updateTexImage();
-
- glClearColor(0.2, 0.2, 0.2, 0.2);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glViewport(0, 0, texWidth, texHeight);
- drawTexture();
-
- EXPECT_TRUE(checkPixel( 0, 0, 255, 127, 255, 255));
- EXPECT_TRUE(checkPixel(63, 0, 0, 133, 0, 255));
- EXPECT_TRUE(checkPixel(63, 65, 0, 133, 0, 255));
- EXPECT_TRUE(checkPixel( 0, 65, 255, 127, 255, 255));
-
- EXPECT_TRUE(checkPixel(22, 44, 255, 127, 255, 255));
- EXPECT_TRUE(checkPixel(45, 52, 255, 127, 255, 255));
- EXPECT_TRUE(checkPixel(52, 51, 98, 255, 73, 255));
- EXPECT_TRUE(checkPixel( 7, 31, 155, 0, 118, 255));
- EXPECT_TRUE(checkPixel(31, 9, 107, 24, 87, 255));
- EXPECT_TRUE(checkPixel(29, 35, 255, 127, 255, 255));
- EXPECT_TRUE(checkPixel(36, 22, 155, 29, 0, 255));
-}
-
-TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferPow2) {
- const int texWidth = 64;
- const int texHeight = 64;
-
- ASSERT_EQ(NO_ERROR, native_window_set_buffers_geometry(mANW.get(),
- texWidth, texHeight, HAL_PIXEL_FORMAT_YV12));
- ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(),
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN));
-
- ANativeWindowBuffer* anb;
- ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- ASSERT_TRUE(anb != NULL);
-
- sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
- ASSERT_EQ(NO_ERROR, mANW->lockBuffer(mANW.get(), buf->getNativeBuffer()));
-
- // Fill the buffer with the a checkerboard pattern
- uint8_t* img = NULL;
- buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
- fillYV12Buffer(img, texWidth, texHeight, buf->getStride());
- buf->unlock();
- ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer()));
-
- mST->updateTexImage();
-
- glClearColor(0.2, 0.2, 0.2, 0.2);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glViewport(0, 0, texWidth, texHeight);
- drawTexture();
-
- EXPECT_TRUE(checkPixel( 0, 0, 0, 133, 0, 255));
- EXPECT_TRUE(checkPixel(63, 0, 255, 127, 255, 255));
- EXPECT_TRUE(checkPixel(63, 63, 0, 133, 0, 255));
- EXPECT_TRUE(checkPixel( 0, 63, 255, 127, 255, 255));
-
- EXPECT_TRUE(checkPixel(22, 19, 100, 255, 74, 255));
- EXPECT_TRUE(checkPixel(45, 11, 100, 255, 74, 255));
- EXPECT_TRUE(checkPixel(52, 12, 155, 0, 181, 255));
- EXPECT_TRUE(checkPixel( 7, 32, 150, 237, 170, 255));
- EXPECT_TRUE(checkPixel(31, 54, 0, 71, 117, 255));
- EXPECT_TRUE(checkPixel(29, 28, 0, 133, 0, 255));
- EXPECT_TRUE(checkPixel(36, 41, 100, 232, 255, 255));
-}
-
-TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferWithCrop) {
- const int texWidth = 64;
- const int texHeight = 66;
-
- ASSERT_EQ(NO_ERROR, native_window_set_buffers_geometry(mANW.get(),
- texWidth, texHeight, HAL_PIXEL_FORMAT_YV12));
- ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(),
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN));
-
- android_native_rect_t crops[] = {
- {4, 6, 22, 36},
- {0, 6, 22, 36},
- {4, 0, 22, 36},
- {4, 6, texWidth, 36},
- {4, 6, 22, texHeight},
- };
-
- for (int i = 0; i < 5; i++) {
- const android_native_rect_t& crop(crops[i]);
- SCOPED_TRACE(String8::format("rect{ l: %d t: %d r: %d b: %d }",
- crop.left, crop.top, crop.right, crop.bottom).string());
-
- ASSERT_EQ(NO_ERROR, native_window_set_crop(mANW.get(), &crop));
-
- ANativeWindowBuffer* anb;
- ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- ASSERT_TRUE(anb != NULL);
-
- sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
- ASSERT_EQ(NO_ERROR, mANW->lockBuffer(mANW.get(),
- buf->getNativeBuffer()));
-
- uint8_t* img = NULL;
- buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
- fillYV12BufferRect(img, texWidth, texHeight, buf->getStride(), crop);
- buf->unlock();
- ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(),
- buf->getNativeBuffer()));
-
- mST->updateTexImage();
-
- glClearColor(0.2, 0.2, 0.2, 0.2);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glViewport(0, 0, 64, 64);
- drawTexture();
-
- EXPECT_TRUE(checkPixel( 0, 0, 82, 255, 35, 255));
- EXPECT_TRUE(checkPixel(63, 0, 82, 255, 35, 255));
- EXPECT_TRUE(checkPixel(63, 63, 82, 255, 35, 255));
- EXPECT_TRUE(checkPixel( 0, 63, 82, 255, 35, 255));
-
- EXPECT_TRUE(checkPixel(25, 14, 82, 255, 35, 255));
- EXPECT_TRUE(checkPixel(35, 31, 82, 255, 35, 255));
- EXPECT_TRUE(checkPixel(57, 6, 82, 255, 35, 255));
- EXPECT_TRUE(checkPixel( 5, 42, 82, 255, 35, 255));
- EXPECT_TRUE(checkPixel(32, 33, 82, 255, 35, 255));
- EXPECT_TRUE(checkPixel(16, 26, 82, 255, 35, 255));
- EXPECT_TRUE(checkPixel(46, 51, 82, 255, 35, 255));
- }
-}
-
-// This test is intended to catch synchronization bugs between the CPU-written
-// and GPU-read buffers.
-TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BuffersRepeatedly) {
- enum { texWidth = 16 };
- enum { texHeight = 16 };
- enum { numFrames = 1024 };
-
- ASSERT_EQ(NO_ERROR, mST->setSynchronousMode(true));
- ASSERT_EQ(NO_ERROR, mST->setBufferCountServer(2));
- ASSERT_EQ(NO_ERROR, native_window_set_buffers_geometry(mANW.get(),
- texWidth, texHeight, HAL_PIXEL_FORMAT_YV12));
- ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(),
- GRALLOC_USAGE_SW_WRITE_OFTEN));
-
- struct TestPixel {
- int x;
- int y;
- };
- const TestPixel testPixels[] = {
- { 4, 11 },
- { 12, 14 },
- { 7, 2 },
- };
- enum {numTestPixels = sizeof(testPixels) / sizeof(testPixels[0])};
-
- class ProducerThread : public Thread {
- public:
- ProducerThread(const sp<ANativeWindow>& anw,
- const TestPixel* testPixels):
- mANW(anw),
- mTestPixels(testPixels) {
- }
-
- virtual ~ProducerThread() {
- }
-
- virtual bool threadLoop() {
- for (int i = 0; i < numFrames; i++) {
- ANativeWindowBuffer* anb;
- if (mANW->dequeueBuffer(mANW.get(), &anb) != NO_ERROR) {
- return false;
- }
- if (anb == NULL) {
- return false;
- }
-
- sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
- if (mANW->lockBuffer(mANW.get(), buf->getNativeBuffer())
- != NO_ERROR) {
- return false;
- }
-
- const int yuvTexOffsetY = 0;
- int stride = buf->getStride();
- int yuvTexStrideY = stride;
- int yuvTexOffsetV = yuvTexStrideY * texHeight;
- int yuvTexStrideV = (yuvTexStrideY/2 + 0xf) & ~0xf;
- int yuvTexOffsetU = yuvTexOffsetV + yuvTexStrideV * texHeight/2;
- int yuvTexStrideU = yuvTexStrideV;
-
- uint8_t* img = NULL;
- buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
-
- // Gray out all the test pixels first, so we're more likely to
- // see a failure if GL is still texturing from the buffer we
- // just dequeued.
- for (int j = 0; j < numTestPixels; j++) {
- int x = mTestPixels[j].x;
- int y = mTestPixels[j].y;
- uint8_t value = 128;
- img[y*stride + x] = value;
- }
-
- // Fill the buffer with gray.
- for (int y = 0; y < texHeight; y++) {
- for (int x = 0; x < texWidth; x++) {
- img[yuvTexOffsetY + y*yuvTexStrideY + x] = 128;
- img[yuvTexOffsetU + (y/2)*yuvTexStrideU + x/2] = 128;
- img[yuvTexOffsetV + (y/2)*yuvTexStrideV + x/2] = 128;
- }
- }
-
- // Set the test pixels to either white or black.
- for (int j = 0; j < numTestPixels; j++) {
- int x = mTestPixels[j].x;
- int y = mTestPixels[j].y;
- uint8_t value = 0;
- if (j == (i % numTestPixels)) {
- value = 255;
- }
- img[y*stride + x] = value;
- }
-
- buf->unlock();
- if (mANW->queueBuffer(mANW.get(), buf->getNativeBuffer())
- != NO_ERROR) {
- return false;
- }
- }
- return false;
- }
-
- sp<ANativeWindow> mANW;
- const TestPixel* mTestPixels;
- };
-
- sp<FrameWaiter> fw(new FrameWaiter);
- mST->setFrameAvailableListener(fw);
-
- sp<Thread> pt(new ProducerThread(mANW, testPixels));
- pt->run();
-
- glViewport(0, 0, texWidth, texHeight);
-
- glClearColor(0.2, 0.2, 0.2, 0.2);
- glClear(GL_COLOR_BUFFER_BIT);
-
- // We wait for the first two frames up front so that the producer will be
- // likely to dequeue the buffer that's currently being textured from.
- fw->waitForFrame();
- fw->waitForFrame();
-
- for (int i = 0; i < numFrames; i++) {
- SCOPED_TRACE(String8::format("frame %d", i).string());
-
- // We must wait for each frame to come in because if we ever do an
- // updateTexImage call that doesn't consume a newly available buffer
- // then the producer and consumer will get out of sync, which will cause
- // a deadlock.
- if (i > 1) {
- fw->waitForFrame();
- }
- mST->updateTexImage();
- drawTexture();
-
- for (int j = 0; j < numTestPixels; j++) {
- int x = testPixels[j].x;
- int y = testPixels[j].y;
- uint8_t value = 0;
- if (j == (i % numTestPixels)) {
- // We must y-invert the texture coords
- EXPECT_TRUE(checkPixel(x, texHeight-y-1, 255, 255, 255, 255));
- } else {
- // We must y-invert the texture coords
- EXPECT_TRUE(checkPixel(x, texHeight-y-1, 0, 0, 0, 255));
- }
- }
- }
-
- pt->requestExitAndWait();
-}
-
-TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledRGBABufferNpot) {
- const int texWidth = 64;
- const int texHeight = 66;
-
- ASSERT_EQ(NO_ERROR, native_window_set_buffers_geometry(mANW.get(),
- texWidth, texHeight, HAL_PIXEL_FORMAT_RGBA_8888));
- ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(),
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN));
-
- android_native_buffer_t* anb;
- ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- ASSERT_TRUE(anb != NULL);
-
- sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
- ASSERT_EQ(NO_ERROR, mANW->lockBuffer(mANW.get(), buf->getNativeBuffer()));
-
- // Fill the buffer with the a checkerboard pattern
- uint8_t* img = NULL;
- buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
- fillRGBA8Buffer(img, texWidth, texHeight, buf->getStride());
- buf->unlock();
- ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer()));
-
- mST->updateTexImage();
-
- glClearColor(0.2, 0.2, 0.2, 0.2);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glViewport(0, 0, texWidth, texHeight);
- drawTexture();
-
- EXPECT_TRUE(checkPixel( 0, 0, 35, 35, 35, 35));
- EXPECT_TRUE(checkPixel(63, 0, 231, 231, 231, 231));
- EXPECT_TRUE(checkPixel(63, 65, 231, 231, 231, 231));
- EXPECT_TRUE(checkPixel( 0, 65, 35, 35, 35, 35));
-
- EXPECT_TRUE(checkPixel(15, 10, 35, 231, 231, 231));
- EXPECT_TRUE(checkPixel(23, 65, 231, 35, 231, 35));
- EXPECT_TRUE(checkPixel(19, 40, 35, 231, 35, 35));
- EXPECT_TRUE(checkPixel(38, 30, 231, 35, 35, 35));
- EXPECT_TRUE(checkPixel(42, 54, 35, 35, 35, 231));
- EXPECT_TRUE(checkPixel(37, 34, 35, 231, 231, 231));
- EXPECT_TRUE(checkPixel(31, 8, 231, 35, 35, 231));
- EXPECT_TRUE(checkPixel(37, 47, 231, 35, 231, 231));
- EXPECT_TRUE(checkPixel(25, 38, 35, 35, 35, 35));
- EXPECT_TRUE(checkPixel(49, 6, 35, 231, 35, 35));
- EXPECT_TRUE(checkPixel(54, 50, 35, 231, 231, 231));
- EXPECT_TRUE(checkPixel(27, 26, 231, 231, 231, 231));
- EXPECT_TRUE(checkPixel(10, 6, 35, 35, 231, 231));
- EXPECT_TRUE(checkPixel(29, 4, 35, 35, 35, 231));
- EXPECT_TRUE(checkPixel(55, 28, 35, 35, 231, 35));
- EXPECT_TRUE(checkPixel(58, 55, 35, 35, 231, 231));
-}
-
-TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledRGBABufferPow2) {
- const int texWidth = 64;
- const int texHeight = 64;
-
- ASSERT_EQ(NO_ERROR, native_window_set_buffers_geometry(mANW.get(),
- texWidth, texHeight, HAL_PIXEL_FORMAT_RGBA_8888));
- ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(),
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN));
-
- android_native_buffer_t* anb;
- ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- ASSERT_TRUE(anb != NULL);
-
- sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
- ASSERT_EQ(NO_ERROR, mANW->lockBuffer(mANW.get(), buf->getNativeBuffer()));
-
- // Fill the buffer with the a checkerboard pattern
- uint8_t* img = NULL;
- buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
- fillRGBA8Buffer(img, texWidth, texHeight, buf->getStride());
- buf->unlock();
- ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer()));
-
- mST->updateTexImage();
-
- glClearColor(0.2, 0.2, 0.2, 0.2);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glViewport(0, 0, texWidth, texHeight);
- drawTexture();
-
- EXPECT_TRUE(checkPixel( 0, 0, 231, 231, 231, 231));
- EXPECT_TRUE(checkPixel(63, 0, 35, 35, 35, 35));
- EXPECT_TRUE(checkPixel(63, 63, 231, 231, 231, 231));
- EXPECT_TRUE(checkPixel( 0, 63, 35, 35, 35, 35));
-
- EXPECT_TRUE(checkPixel(12, 46, 231, 231, 231, 35));
- EXPECT_TRUE(checkPixel(16, 1, 231, 231, 35, 231));
- EXPECT_TRUE(checkPixel(21, 12, 231, 35, 35, 231));
- EXPECT_TRUE(checkPixel(26, 51, 231, 35, 231, 35));
- EXPECT_TRUE(checkPixel( 5, 32, 35, 231, 231, 35));
- EXPECT_TRUE(checkPixel(13, 8, 35, 231, 231, 231));
- EXPECT_TRUE(checkPixel(46, 3, 35, 35, 231, 35));
- EXPECT_TRUE(checkPixel(30, 33, 35, 35, 35, 35));
- EXPECT_TRUE(checkPixel( 6, 52, 231, 231, 35, 35));
- EXPECT_TRUE(checkPixel(55, 33, 35, 231, 35, 231));
- EXPECT_TRUE(checkPixel(16, 29, 35, 35, 231, 231));
- EXPECT_TRUE(checkPixel( 1, 30, 35, 35, 35, 231));
- EXPECT_TRUE(checkPixel(41, 37, 35, 35, 231, 231));
- EXPECT_TRUE(checkPixel(46, 29, 231, 231, 35, 35));
- EXPECT_TRUE(checkPixel(15, 25, 35, 231, 35, 231));
- EXPECT_TRUE(checkPixel( 3, 52, 35, 231, 35, 35));
-}
-
-TEST_F(SurfaceTextureGLTest, AbandonUnblocksDequeueBuffer) {
- class ProducerThread : public Thread {
- public:
- ProducerThread(const sp<ANativeWindow>& anw):
- mANW(anw),
- mDequeueError(NO_ERROR) {
- }
-
- virtual ~ProducerThread() {
- }
-
- virtual bool threadLoop() {
- Mutex::Autolock lock(mMutex);
- ANativeWindowBuffer* anb;
-
- // Frame 1
- if (mANW->dequeueBuffer(mANW.get(), &anb) != NO_ERROR) {
- return false;
- }
- if (anb == NULL) {
- return false;
- }
- if (mANW->queueBuffer(mANW.get(), anb)
- != NO_ERROR) {
- return false;
- }
-
- // Frame 2
- if (mANW->dequeueBuffer(mANW.get(), &anb) != NO_ERROR) {
- return false;
- }
- if (anb == NULL) {
- return false;
- }
- if (mANW->queueBuffer(mANW.get(), anb)
- != NO_ERROR) {
- return false;
- }
-
- // Frame 3 - error expected
- mDequeueError = mANW->dequeueBuffer(mANW.get(), &anb);
- return false;
- }
-
- status_t getDequeueError() {
- Mutex::Autolock lock(mMutex);
- return mDequeueError;
- }
-
- private:
- sp<ANativeWindow> mANW;
- status_t mDequeueError;
- Mutex mMutex;
- };
-
- sp<FrameWaiter> fw(new FrameWaiter);
- mST->setFrameAvailableListener(fw);
- ASSERT_EQ(OK, mST->setSynchronousMode(true));
- ASSERT_EQ(OK, mST->setBufferCountServer(2));
-
- sp<Thread> pt(new ProducerThread(mANW));
- pt->run();
-
- fw->waitForFrame();
- fw->waitForFrame();
-
- // Sleep for 100ms to allow the producer thread's dequeueBuffer call to
- // block waiting for a buffer to become available.
- usleep(100000);
-
- mST->abandon();
-
- pt->requestExitAndWait();
- ASSERT_EQ(NO_INIT,
- reinterpret_cast<ProducerThread*>(pt.get())->getDequeueError());
-}
-
-TEST_F(SurfaceTextureGLTest, InvalidWidthOrHeightFails) {
- int texHeight = 16;
- ANativeWindowBuffer* anb;
-
- GLint maxTextureSize;
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
-
- // make sure it works with small textures
- mST->setDefaultBufferSize(16, texHeight);
- EXPECT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- EXPECT_EQ(16, anb->width);
- EXPECT_EQ(texHeight, anb->height);
- EXPECT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), anb));
- EXPECT_EQ(NO_ERROR, mST->updateTexImage());
-
- // make sure it works with GL_MAX_TEXTURE_SIZE
- mST->setDefaultBufferSize(maxTextureSize, texHeight);
- EXPECT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- EXPECT_EQ(maxTextureSize, anb->width);
- EXPECT_EQ(texHeight, anb->height);
- EXPECT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), anb));
- EXPECT_EQ(NO_ERROR, mST->updateTexImage());
-
- // make sure it fails with GL_MAX_TEXTURE_SIZE+1
- mST->setDefaultBufferSize(maxTextureSize+1, texHeight);
- EXPECT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- EXPECT_EQ(maxTextureSize+1, anb->width);
- EXPECT_EQ(texHeight, anb->height);
- EXPECT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), anb));
- ASSERT_NE(NO_ERROR, mST->updateTexImage());
-}
-
-/*
- * This test fixture is for testing GL -> GL texture streaming. It creates an
- * EGLSurface and an EGLContext for the image producer to use.
- */
-class SurfaceTextureGLToGLTest : public SurfaceTextureGLTest {
-protected:
- SurfaceTextureGLToGLTest():
- mProducerEglSurface(EGL_NO_SURFACE),
- mProducerEglContext(EGL_NO_CONTEXT) {
- }
-
- virtual void SetUp() {
- SurfaceTextureGLTest::SetUp();
-
- EGLConfig myConfig = {0};
- EGLint numConfigs = 0;
- EXPECT_TRUE(eglChooseConfig(mEglDisplay, getConfigAttribs(), &myConfig,
- 1, &numConfigs));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- mProducerEglSurface = eglCreateWindowSurface(mEglDisplay, myConfig,
- mANW.get(), NULL);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_SURFACE, mProducerEglSurface);
-
- mProducerEglContext = eglCreateContext(mEglDisplay, myConfig,
- EGL_NO_CONTEXT, getContextAttribs());
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_NE(EGL_NO_CONTEXT, mProducerEglContext);
- }
-
- virtual void TearDown() {
- if (mProducerEglContext != EGL_NO_CONTEXT) {
- eglDestroyContext(mEglDisplay, mProducerEglContext);
- }
- if (mProducerEglSurface != EGL_NO_SURFACE) {
- eglDestroySurface(mEglDisplay, mProducerEglSurface);
- }
- SurfaceTextureGLTest::TearDown();
- }
-
- EGLSurface mProducerEglSurface;
- EGLContext mProducerEglContext;
-};
-
-TEST_F(SurfaceTextureGLToGLTest, TexturingFromGLFilledRGBABufferPow2) {
- const int texWidth = 64;
- const int texHeight = 64;
-
- mST->setDefaultBufferSize(texWidth, texHeight);
-
- // Do the producer side of things
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
- mProducerEglSurface, mProducerEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- // This is needed to ensure we pick up a buffer of the correct size.
- eglSwapBuffers(mEglDisplay, mProducerEglSurface);
-
- glClearColor(0.6, 0.6, 0.6, 0.6);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glEnable(GL_SCISSOR_TEST);
- glScissor(4, 4, 4, 4);
- glClearColor(1.0, 0.0, 0.0, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glScissor(24, 48, 4, 4);
- glClearColor(0.0, 1.0, 0.0, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glScissor(37, 17, 4, 4);
- glClearColor(0.0, 0.0, 1.0, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- eglSwapBuffers(mEglDisplay, mProducerEglSurface);
-
- // Do the consumer side of things
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
- mEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- glDisable(GL_SCISSOR_TEST);
-
- mST->updateTexImage(); // Skip the first frame, which was empty
- mST->updateTexImage();
-
- glClearColor(0.2, 0.2, 0.2, 0.2);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glViewport(0, 0, texWidth, texHeight);
- drawTexture();
-
- EXPECT_TRUE(checkPixel( 0, 0, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(63, 0, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(63, 63, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel( 0, 63, 153, 153, 153, 153));
-
- EXPECT_TRUE(checkPixel( 4, 7, 255, 0, 0, 255));
- EXPECT_TRUE(checkPixel(25, 51, 0, 255, 0, 255));
- EXPECT_TRUE(checkPixel(40, 19, 0, 0, 255, 255));
- EXPECT_TRUE(checkPixel(29, 51, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel( 5, 32, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(13, 8, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(46, 3, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(30, 33, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel( 6, 52, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(55, 33, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(16, 29, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel( 1, 30, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(41, 37, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(46, 29, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel(15, 25, 153, 153, 153, 153));
- EXPECT_TRUE(checkPixel( 3, 52, 153, 153, 153, 153));
-}
-
-TEST_F(SurfaceTextureGLToGLTest, EglDestroySurfaceUnrefsBuffers) {
- sp<GraphicBuffer> buffers[3];
-
- // This test requires async mode to run on a single thread.
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
- mProducerEglSurface, mProducerEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- EXPECT_TRUE(eglSwapInterval(mEglDisplay, 0));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- for (int i = 0; i < 3; i++) {
- // Produce a frame
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
- mProducerEglSurface, mProducerEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- glClear(GL_COLOR_BUFFER_BIT);
- eglSwapBuffers(mEglDisplay, mProducerEglSurface);
-
- // Consume a frame
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
- mEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- mST->updateTexImage();
- buffers[i] = mST->getCurrentBuffer();
- }
-
- // Destroy the GL texture object to release its ref on buffers[2].
- GLuint texID = TEX_ID;
- glDeleteTextures(1, &texID);
-
- // Destroy the EGLSurface
- EXPECT_TRUE(eglDestroySurface(mEglDisplay, mProducerEglSurface));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- // Release the ref that the SurfaceTexture has on buffers[2].
- mST->abandon();
-
- EXPECT_EQ(1, buffers[0]->getStrongCount());
- EXPECT_EQ(1, buffers[1]->getStrongCount());
-
- // Depending on how lazily the GL driver dequeues buffers, we may end up
- // with either two or three total buffers. If there are three, make sure
- // the last one was properly down-ref'd.
- if (buffers[2] != buffers[0]) {
- EXPECT_EQ(1, buffers[2]->getStrongCount());
- }
-}
-
-TEST_F(SurfaceTextureGLToGLTest, EglDestroySurfaceAfterAbandonUnrefsBuffers) {
- sp<GraphicBuffer> buffers[3];
-
- // This test requires async mode to run on a single thread.
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
- mProducerEglSurface, mProducerEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- EXPECT_TRUE(eglSwapInterval(mEglDisplay, 0));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- for (int i = 0; i < 3; i++) {
- // Produce a frame
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
- mProducerEglSurface, mProducerEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- glClear(GL_COLOR_BUFFER_BIT);
- EXPECT_TRUE(eglSwapBuffers(mEglDisplay, mProducerEglSurface));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- // Consume a frame
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
- mEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_EQ(NO_ERROR, mST->updateTexImage());
- buffers[i] = mST->getCurrentBuffer();
- }
-
- // Abandon the SurfaceTexture, releasing the ref that the SurfaceTexture has
- // on buffers[2].
- mST->abandon();
-
- // Destroy the GL texture object to release its ref on buffers[2].
- GLuint texID = TEX_ID;
- glDeleteTextures(1, &texID);
-
- // Destroy the EGLSurface.
- EXPECT_TRUE(eglDestroySurface(mEglDisplay, mProducerEglSurface));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EXPECT_EQ(1, buffers[0]->getStrongCount());
- EXPECT_EQ(1, buffers[1]->getStrongCount());
-
- // Depending on how lazily the GL driver dequeues buffers, we may end up
- // with either two or three total buffers. If there are three, make sure
- // the last one was properly down-ref'd.
- if (buffers[2] != buffers[0]) {
- EXPECT_EQ(1, buffers[2]->getStrongCount());
- }
-}
-
-TEST_F(SurfaceTextureGLToGLTest, EglSurfaceDefaultsToSynchronousMode) {
- // This test requires 3 buffers to run on a single thread.
- mST->setBufferCountServer(3);
-
- ASSERT_TRUE(mST->isSynchronousMode());
-
- for (int i = 0; i < 10; i++) {
- // Produce a frame
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
- mProducerEglSurface, mProducerEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- glClear(GL_COLOR_BUFFER_BIT);
- EXPECT_TRUE(eglSwapBuffers(mEglDisplay, mProducerEglSurface));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- // Consume a frame
- EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
- mEglContext));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_EQ(NO_ERROR, mST->updateTexImage());
- }
-
- ASSERT_TRUE(mST->isSynchronousMode());
-}
-
-/*
- * This test fixture is for testing GL -> GL texture streaming from one thread
- * to another. It contains functionality to create a producer thread that will
- * perform GL rendering to an ANativeWindow that feeds frames to a
- * SurfaceTexture. Additionally it supports interlocking the producer and
- * consumer threads so that a specific sequence of calls can be
- * deterministically created by the test.
- *
- * The intended usage is as follows:
- *
- * TEST_F(...) {
- * class PT : public ProducerThread {
- * virtual void render() {
- * ...
- * swapBuffers();
- * }
- * };
- *
- * runProducerThread(new PT());
- *
- * // The order of these calls will vary from test to test and may include
- * // multiple frames and additional operations (e.g. GL rendering from the
- * // texture).
- * fc->waitForFrame();
- * mST->updateTexImage();
- * fc->finishFrame();
- * }
- *
- */
-class SurfaceTextureGLThreadToGLTest : public SurfaceTextureGLToGLTest {
-protected:
-
- // ProducerThread is an abstract base class to simplify the creation of
- // OpenGL ES frame producer threads.
- class ProducerThread : public Thread {
- public:
- virtual ~ProducerThread() {
- }
-
- void setEglObjects(EGLDisplay producerEglDisplay,
- EGLSurface producerEglSurface,
- EGLContext producerEglContext) {
- mProducerEglDisplay = producerEglDisplay;
- mProducerEglSurface = producerEglSurface;
- mProducerEglContext = producerEglContext;
- }
-
- virtual bool threadLoop() {
- eglMakeCurrent(mProducerEglDisplay, mProducerEglSurface,
- mProducerEglSurface, mProducerEglContext);
- render();
- eglMakeCurrent(mProducerEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE,
- EGL_NO_CONTEXT);
- return false;
- }
-
- protected:
- virtual void render() = 0;
-
- void swapBuffers() {
- eglSwapBuffers(mProducerEglDisplay, mProducerEglSurface);
- }
-
- EGLDisplay mProducerEglDisplay;
- EGLSurface mProducerEglSurface;
- EGLContext mProducerEglContext;
- };
-
- // FrameCondition is a utility class for interlocking between the producer
- // and consumer threads. The FrameCondition object should be created and
- // destroyed in the consumer thread only. The consumer thread should set
- // the FrameCondition as the FrameAvailableListener of the SurfaceTexture,
- // and should call both waitForFrame and finishFrame once for each expected
- // frame.
- //
- // This interlocking relies on the fact that onFrameAvailable gets called
- // synchronously from SurfaceTexture::queueBuffer.
- class FrameCondition : public SurfaceTexture::FrameAvailableListener {
- public:
- FrameCondition():
- mFrameAvailable(false),
- mFrameFinished(false) {
- }
-
- // waitForFrame waits for the next frame to arrive. This should be
- // called from the consumer thread once for every frame expected by the
- // test.
- void waitForFrame() {
- Mutex::Autolock lock(mMutex);
- ALOGV("+waitForFrame");
- while (!mFrameAvailable) {
- mFrameAvailableCondition.wait(mMutex);
- }
- mFrameAvailable = false;
- ALOGV("-waitForFrame");
- }
-
- // Allow the producer to return from its swapBuffers call and continue
- // on to produce the next frame. This should be called by the consumer
- // thread once for every frame expected by the test.
- void finishFrame() {
- Mutex::Autolock lock(mMutex);
- ALOGV("+finishFrame");
- mFrameFinished = true;
- mFrameFinishCondition.signal();
- ALOGV("-finishFrame");
- }
-
- // This should be called by SurfaceTexture on the producer thread.
- virtual void onFrameAvailable() {
- Mutex::Autolock lock(mMutex);
- ALOGV("+onFrameAvailable");
- mFrameAvailable = true;
- mFrameAvailableCondition.signal();
- while (!mFrameFinished) {
- mFrameFinishCondition.wait(mMutex);
- }
- mFrameFinished = false;
- ALOGV("-onFrameAvailable");
- }
-
- protected:
- bool mFrameAvailable;
- bool mFrameFinished;
-
- Mutex mMutex;
- Condition mFrameAvailableCondition;
- Condition mFrameFinishCondition;
- };
-
- virtual void SetUp() {
- SurfaceTextureGLToGLTest::SetUp();
- mFC = new FrameCondition();
- mST->setFrameAvailableListener(mFC);
- }
-
- virtual void TearDown() {
- if (mProducerThread != NULL) {
- mProducerThread->requestExitAndWait();
- }
- mProducerThread.clear();
- mFC.clear();
- SurfaceTextureGLToGLTest::TearDown();
- }
-
- void runProducerThread(const sp<ProducerThread> producerThread) {
- ASSERT_TRUE(mProducerThread == NULL);
- mProducerThread = producerThread;
- producerThread->setEglObjects(mEglDisplay, mProducerEglSurface,
- mProducerEglContext);
- producerThread->run();
- }
-
- sp<ProducerThread> mProducerThread;
- sp<FrameCondition> mFC;
-};
-
-TEST_F(SurfaceTextureGLThreadToGLTest,
- UpdateTexImageBeforeFrameFinishedCompletes) {
- class PT : public ProducerThread {
- virtual void render() {
- glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- swapBuffers();
- }
- };
-
- runProducerThread(new PT());
-
- mFC->waitForFrame();
- mST->updateTexImage();
- mFC->finishFrame();
-
- // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported!
-}
-
-TEST_F(SurfaceTextureGLThreadToGLTest,
- UpdateTexImageAfterFrameFinishedCompletes) {
- class PT : public ProducerThread {
- virtual void render() {
- glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- swapBuffers();
- }
- };
-
- runProducerThread(new PT());
-
- mFC->waitForFrame();
- mFC->finishFrame();
- mST->updateTexImage();
-
- // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported!
-}
-
-TEST_F(SurfaceTextureGLThreadToGLTest,
- RepeatedUpdateTexImageBeforeFrameFinishedCompletes) {
- enum { NUM_ITERATIONS = 1024 };
-
- class PT : public ProducerThread {
- virtual void render() {
- for (int i = 0; i < NUM_ITERATIONS; i++) {
- glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- ALOGV("+swapBuffers");
- swapBuffers();
- ALOGV("-swapBuffers");
- }
- }
- };
-
- runProducerThread(new PT());
-
- for (int i = 0; i < NUM_ITERATIONS; i++) {
- mFC->waitForFrame();
- ALOGV("+updateTexImage");
- mST->updateTexImage();
- ALOGV("-updateTexImage");
- mFC->finishFrame();
-
- // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported!
- }
-}
-
-TEST_F(SurfaceTextureGLThreadToGLTest,
- RepeatedUpdateTexImageAfterFrameFinishedCompletes) {
- enum { NUM_ITERATIONS = 1024 };
-
- class PT : public ProducerThread {
- virtual void render() {
- for (int i = 0; i < NUM_ITERATIONS; i++) {
- glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- ALOGV("+swapBuffers");
- swapBuffers();
- ALOGV("-swapBuffers");
- }
- }
- };
-
- runProducerThread(new PT());
-
- for (int i = 0; i < NUM_ITERATIONS; i++) {
- mFC->waitForFrame();
- mFC->finishFrame();
- ALOGV("+updateTexImage");
- mST->updateTexImage();
- ALOGV("-updateTexImage");
-
- // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported!
- }
-}
-
-// XXX: This test is disabled because it is currently hanging on some devices.
-TEST_F(SurfaceTextureGLThreadToGLTest,
- DISABLED_RepeatedSwapBuffersWhileDequeueStalledCompletes) {
- enum { NUM_ITERATIONS = 64 };
-
- class PT : public ProducerThread {
- virtual void render() {
- for (int i = 0; i < NUM_ITERATIONS; i++) {
- glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- ALOGV("+swapBuffers");
- swapBuffers();
- ALOGV("-swapBuffers");
- }
- }
- };
-
- ASSERT_EQ(OK, mST->setSynchronousMode(true));
- ASSERT_EQ(OK, mST->setBufferCountServer(2));
-
- runProducerThread(new PT());
-
- // Allow three frames to be rendered and queued before starting the
- // rendering in this thread. For the latter two frames we don't call
- // updateTexImage so the next dequeue from the producer thread will block
- // waiting for a frame to become available.
- mFC->waitForFrame();
- mFC->finishFrame();
-
- // We must call updateTexImage to consume the first frame so that the
- // SurfaceTexture is able to reduce the buffer count to 2. This is because
- // the GL driver may dequeue a buffer when the EGLSurface is created, and
- // that happens before we call setBufferCountServer. It's possible that the
- // driver does not dequeue a buffer at EGLSurface creation time, so we
- // cannot rely on this to cause the second dequeueBuffer call to block.
- mST->updateTexImage();
-
- mFC->waitForFrame();
- mFC->finishFrame();
- mFC->waitForFrame();
- mFC->finishFrame();
-
- // Sleep for 100ms to allow the producer thread's dequeueBuffer call to
- // block waiting for a buffer to become available.
- usleep(100000);
-
- // Render and present a number of images. This thread should not be blocked
- // by the fact that the producer thread is blocking in dequeue.
- for (int i = 0; i < NUM_ITERATIONS; i++) {
- glClear(GL_COLOR_BUFFER_BIT);
- eglSwapBuffers(mEglDisplay, mEglSurface);
- }
-
- // Consume the two pending buffers to unblock the producer thread.
- mST->updateTexImage();
- mST->updateTexImage();
-
- // Consume the remaining buffers from the producer thread.
- for (int i = 0; i < NUM_ITERATIONS-3; i++) {
- mFC->waitForFrame();
- mFC->finishFrame();
- ALOGV("+updateTexImage");
- mST->updateTexImage();
- ALOGV("-updateTexImage");
- }
-}
-
-class SurfaceTextureFBOTest : public SurfaceTextureGLTest {
-protected:
-
- virtual void SetUp() {
- SurfaceTextureGLTest::SetUp();
-
- glGenFramebuffers(1, &mFbo);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
-
- glGenTextures(1, &mFboTex);
- glBindTexture(GL_TEXTURE_2D, mFboTex);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, getSurfaceWidth(),
- getSurfaceHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glBindTexture(GL_TEXTURE_2D, 0);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
-
- glBindFramebuffer(GL_FRAMEBUFFER, mFbo);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_TEXTURE_2D, mFboTex, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
- ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError());
- }
-
- virtual void TearDown() {
- SurfaceTextureGLTest::TearDown();
-
- glDeleteTextures(1, &mFboTex);
- glDeleteFramebuffers(1, &mFbo);
- }
-
- GLuint mFbo;
- GLuint mFboTex;
-};
-
-// This test is intended to verify that proper synchronization is done when
-// rendering into an FBO.
-TEST_F(SurfaceTextureFBOTest, BlitFromCpuFilledBufferToFbo) {
- const int texWidth = 64;
- const int texHeight = 64;
-
- ASSERT_EQ(NO_ERROR, native_window_set_buffers_geometry(mANW.get(),
- texWidth, texHeight, HAL_PIXEL_FORMAT_RGBA_8888));
- ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(),
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN));
-
- android_native_buffer_t* anb;
- ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- ASSERT_TRUE(anb != NULL);
-
- sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
- ASSERT_EQ(NO_ERROR, mANW->lockBuffer(mANW.get(), buf->getNativeBuffer()));
-
- // Fill the buffer with green
- uint8_t* img = NULL;
- buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
- fillRGBA8BufferSolid(img, texWidth, texHeight, buf->getStride(), 0, 255,
- 0, 255);
- buf->unlock();
- ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer()));
-
- ASSERT_EQ(NO_ERROR, mST->updateTexImage());
-
- glBindFramebuffer(GL_FRAMEBUFFER, mFbo);
- drawTexture();
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
-
- for (int i = 0; i < 4; i++) {
- SCOPED_TRACE(String8::format("frame %d", i).string());
-
- ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
- ASSERT_TRUE(anb != NULL);
-
- buf = new GraphicBuffer(anb, false);
- ASSERT_EQ(NO_ERROR, mANW->lockBuffer(mANW.get(),
- buf->getNativeBuffer()));
-
- // Fill the buffer with red
- ASSERT_EQ(NO_ERROR, buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN,
- (void**)(&img)));
- fillRGBA8BufferSolid(img, texWidth, texHeight, buf->getStride(), 255, 0,
- 0, 255);
- ASSERT_EQ(NO_ERROR, buf->unlock());
- ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(),
- buf->getNativeBuffer()));
-
- ASSERT_EQ(NO_ERROR, mST->updateTexImage());
-
- drawTexture();
-
- EXPECT_TRUE(checkPixel( 24, 39, 255, 0, 0, 255));
- }
-
- glBindFramebuffer(GL_FRAMEBUFFER, mFbo);
-
- EXPECT_TRUE(checkPixel( 24, 39, 0, 255, 0, 255));
-}
-
-} // namespace android
diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp
deleted file mode 100644
index b585d68..0000000
--- a/libs/gui/tests/Surface_test.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <gtest/gtest.h>
-
-#include <binder/IMemory.h>
-#include <gui/ISurfaceComposer.h>
-#include <gui/Surface.h>
-#include <gui/SurfaceComposerClient.h>
-#include <utils/String8.h>
-
-#include <private/gui/ComposerService.h>
-
-namespace android {
-
-class SurfaceTest : public ::testing::Test {
-protected:
- virtual void SetUp() {
- mComposerClient = new SurfaceComposerClient;
- ASSERT_EQ(NO_ERROR, mComposerClient->initCheck());
-
- mSurfaceControl = mComposerClient->createSurface(
- String8("Test Surface"), 0, 32, 32, PIXEL_FORMAT_RGBA_8888, 0);
-
- ASSERT_TRUE(mSurfaceControl != NULL);
- ASSERT_TRUE(mSurfaceControl->isValid());
-
- SurfaceComposerClient::openGlobalTransaction();
- ASSERT_EQ(NO_ERROR, mSurfaceControl->setLayer(0x7fffffff));
- ASSERT_EQ(NO_ERROR, mSurfaceControl->show());
- SurfaceComposerClient::closeGlobalTransaction();
-
- mSurface = mSurfaceControl->getSurface();
- ASSERT_TRUE(mSurface != NULL);
- }
-
- virtual void TearDown() {
- mComposerClient->dispose();
- }
-
- sp<Surface> mSurface;
- sp<SurfaceComposerClient> mComposerClient;
- sp<SurfaceControl> mSurfaceControl;
-};
-
-TEST_F(SurfaceTest, QueuesToWindowComposerIsTrueWhenVisible) {
- sp<ANativeWindow> anw(mSurface);
- int result = -123;
- int err = anw->query(anw.get(), NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER,
- &result);
- EXPECT_EQ(NO_ERROR, err);
- EXPECT_EQ(1, result);
-}
-
-TEST_F(SurfaceTest, QueuesToWindowComposerIsTrueWhenPurgatorized) {
- mSurfaceControl.clear();
-
- sp<ANativeWindow> anw(mSurface);
- int result = -123;
- int err = anw->query(anw.get(), NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER,
- &result);
- EXPECT_EQ(NO_ERROR, err);
- EXPECT_EQ(1, result);
-}
-
-// This test probably doesn't belong here.
-TEST_F(SurfaceTest, ScreenshotsOfProtectedBuffersSucceed) {
- sp<ANativeWindow> anw(mSurface);
-
- // Verify the screenshot works with no protected buffers.
- sp<IMemoryHeap> heap;
- uint32_t w=0, h=0;
- PixelFormat fmt=0;
- sp<ISurfaceComposer> sf(ComposerService::getComposerService());
- ASSERT_EQ(NO_ERROR, sf->captureScreen(0, &heap, &w, &h, &fmt, 64, 64, 0,
- 0x7fffffff));
- ASSERT_TRUE(heap != NULL);
-
- // Set the PROTECTED usage bit and verify that the screenshot fails. Note
- // that we need to dequeue a buffer in order for it to actually get
- // allocated in SurfaceFlinger.
- ASSERT_EQ(NO_ERROR, native_window_set_usage(anw.get(),
- GRALLOC_USAGE_PROTECTED));
- ASSERT_EQ(NO_ERROR, native_window_set_buffer_count(anw.get(), 3));
- ANativeWindowBuffer* buf = 0;
-
- status_t err = anw->dequeueBuffer(anw.get(), &buf);
- if (err) {
- // we could fail if GRALLOC_USAGE_PROTECTED is not supported.
- // that's okay as long as this is the reason for the failure.
- // try again without the GRALLOC_USAGE_PROTECTED bit.
- ASSERT_EQ(NO_ERROR, native_window_set_usage(anw.get(), 0));
- ASSERT_EQ(NO_ERROR, anw->dequeueBuffer(anw.get(), &buf));
- return;
- }
- ASSERT_EQ(NO_ERROR, anw->cancelBuffer(anw.get(), buf));
-
- for (int i = 0; i < 4; i++) {
- // Loop to make sure SurfaceFlinger has retired a protected buffer.
- ASSERT_EQ(NO_ERROR, anw->dequeueBuffer(anw.get(), &buf));
- ASSERT_EQ(NO_ERROR, anw->lockBuffer(anw.get(), buf));
- ASSERT_EQ(NO_ERROR, anw->queueBuffer(anw.get(), buf));
- }
- heap = 0;
- w = h = fmt = 0;
- ASSERT_EQ(NO_ERROR, sf->captureScreen(0, &heap, &w, &h, &fmt,
- 64, 64, 0, 0x7fffffff));
- ASSERT_TRUE(heap != NULL);
-}
-
-TEST_F(SurfaceTest, ConcreteTypeIsSurface) {
- sp<ANativeWindow> anw(mSurface);
- int result = -123;
- int err = anw->query(anw.get(), NATIVE_WINDOW_CONCRETE_TYPE, &result);
- EXPECT_EQ(NO_ERROR, err);
- EXPECT_EQ(NATIVE_WINDOW_SURFACE, result);
-}
-
-}
diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk
deleted file mode 100644
index 5aff7a4..0000000
--- a/libs/ui/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- FramebufferNativeWindow.cpp \
- GraphicBuffer.cpp \
- GraphicBufferAllocator.cpp \
- GraphicBufferMapper.cpp \
- PixelFormat.cpp \
- Rect.cpp \
- Region.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libhardware
-
-ifneq ($(BOARD_FRAMEBUFFER_FORCE_FORMAT),)
-LOCAL_CFLAGS += -DFRAMEBUFFER_FORCE_FORMAT=$(BOARD_FRAMEBUFFER_FORCE_FORMAT)
-endif
-
-LOCAL_MODULE:= libui
-
-include $(BUILD_SHARED_LIBRARY)
-
-
-# Include subdirectory makefiles
-# ============================================================
-
-# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
-# team really wants is to build the stuff defined by this makefile.
-ifeq (,$(ONE_SHOT_MAKEFILE))
-include $(call first-makefiles-under,$(LOCAL_PATH))
-endif
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
deleted file mode 100644
index dec99b6..0000000
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
-**
-** Copyright 2007 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.
-*/
-
-#define LOG_TAG "FramebufferNativeWindow"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include <cutils/log.h>
-#include <cutils/atomic.h>
-#include <utils/threads.h>
-#include <utils/RefBase.h>
-
-#include <ui/ANativeObjectBase.h>
-#include <ui/FramebufferNativeWindow.h>
-#include <ui/Rect.h>
-
-#include <EGL/egl.h>
-
-#include <hardware/hardware.h>
-#include <hardware/gralloc.h>
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-class NativeBuffer
- : public ANativeObjectBase<
- ANativeWindowBuffer,
- NativeBuffer,
- LightRefBase<NativeBuffer> >
-{
-public:
- NativeBuffer(int w, int h, int f, int u) : BASE() {
- ANativeWindowBuffer::width = w;
- ANativeWindowBuffer::height = h;
- ANativeWindowBuffer::format = f;
- ANativeWindowBuffer::usage = u;
- }
-private:
- friend class LightRefBase<NativeBuffer>;
- ~NativeBuffer() { }; // this class cannot be overloaded
-};
-
-
-/*
- * This implements the (main) framebuffer management. This class is used
- * mostly by SurfaceFlinger, but also by command line GL application.
- *
- * In fact this is an implementation of ANativeWindow on top of
- * the framebuffer.
- *
- * Currently it is pretty simple, it manages only two buffers (the front and
- * back buffer).
- *
- */
-
-FramebufferNativeWindow::FramebufferNativeWindow()
- : BASE(), fbDev(0), grDev(0), mUpdateOnDemand(false)
-{
- hw_module_t const* module;
- if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module) == 0) {
- int stride;
- int err;
- int i;
- err = framebuffer_open(module, &fbDev);
- ALOGE_IF(err, "couldn't open framebuffer HAL (%s)", strerror(-err));
-
- err = gralloc_open(module, &grDev);
- ALOGE_IF(err, "couldn't open gralloc HAL (%s)", strerror(-err));
-
- // bail out if we can't initialize the modules
- if (!fbDev || !grDev)
- return;
-
- mUpdateOnDemand = (fbDev->setUpdateRect != 0);
-
- // initialize the buffer FIFO
- mNumBuffers = NUM_FRAME_BUFFERS;
- mNumFreeBuffers = NUM_FRAME_BUFFERS;
- mBufferHead = mNumBuffers-1;
-
- /*
- * This does not actually change the framebuffer format. It merely
- * fakes this format to surfaceflinger so that when it creates
- * framebuffer surfaces it will use this format. It's really a giant
- * HACK to allow interworking with buggy gralloc+GPU driver
- * implementations. You should *NEVER* need to set this for shipping
- * devices.
- */
-#ifdef FRAMEBUFFER_FORCE_FORMAT
- *((uint32_t *)&fbDev->format) = FRAMEBUFFER_FORCE_FORMAT;
-#endif
-
- for (i = 0; i < mNumBuffers; i++)
- {
- buffers[i] = new NativeBuffer(
- fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB);
- }
-
- for (i = 0; i < mNumBuffers; i++)
- {
- err = grDev->alloc(grDev,
- fbDev->width, fbDev->height, fbDev->format,
- GRALLOC_USAGE_HW_FB, &buffers[i]->handle, &buffers[i]->stride);
-
- ALOGE_IF(err, "fb buffer %d allocation failed w=%d, h=%d, err=%s",
- i, fbDev->width, fbDev->height, strerror(-err));
-
- if (err)
- {
- mNumBuffers = i;
- mNumFreeBuffers = i;
- mBufferHead = mNumBuffers-1;
- break;
- }
- }
-
- const_cast<uint32_t&>(ANativeWindow::flags) = fbDev->flags;
- const_cast<float&>(ANativeWindow::xdpi) = fbDev->xdpi;
- const_cast<float&>(ANativeWindow::ydpi) = fbDev->ydpi;
- const_cast<int&>(ANativeWindow::minSwapInterval) =
- fbDev->minSwapInterval;
- const_cast<int&>(ANativeWindow::maxSwapInterval) =
- fbDev->maxSwapInterval;
- } else {
- ALOGE("Couldn't get gralloc module");
- }
-
- ANativeWindow::setSwapInterval = setSwapInterval;
- ANativeWindow::dequeueBuffer = dequeueBuffer;
- ANativeWindow::lockBuffer = lockBuffer;
- ANativeWindow::queueBuffer = queueBuffer;
- ANativeWindow::query = query;
- ANativeWindow::perform = perform;
-}
-
-FramebufferNativeWindow::~FramebufferNativeWindow()
-{
- if (grDev) {
- if (buffers[0] != NULL)
- grDev->free(grDev, buffers[0]->handle);
- if (buffers[1] != NULL)
- grDev->free(grDev, buffers[1]->handle);
- gralloc_close(grDev);
- }
-
- if (fbDev) {
- framebuffer_close(fbDev);
- }
-}
-
-status_t FramebufferNativeWindow::setUpdateRectangle(const Rect& r)
-{
- if (!mUpdateOnDemand) {
- return INVALID_OPERATION;
- }
- return fbDev->setUpdateRect(fbDev, r.left, r.top, r.width(), r.height());
-}
-
-status_t FramebufferNativeWindow::compositionComplete()
-{
- if (fbDev->compositionComplete) {
- return fbDev->compositionComplete(fbDev);
- }
- return INVALID_OPERATION;
-}
-
-int FramebufferNativeWindow::setSwapInterval(
- ANativeWindow* window, int interval)
-{
- framebuffer_device_t* fb = getSelf(window)->fbDev;
- return fb->setSwapInterval(fb, interval);
-}
-
-void FramebufferNativeWindow::dump(String8& result) {
- if (fbDev->common.version >= 1 && fbDev->dump) {
- const size_t SIZE = 4096;
- char buffer[SIZE];
-
- fbDev->dump(fbDev, buffer, SIZE);
- result.append(buffer);
- }
-}
-
-// only for debugging / logging
-int FramebufferNativeWindow::getCurrentBufferIndex() const
-{
- Mutex::Autolock _l(mutex);
- const int index = mCurrentBufferIndex;
- return index;
-}
-
-int FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window,
- ANativeWindowBuffer** buffer)
-{
- FramebufferNativeWindow* self = getSelf(window);
- Mutex::Autolock _l(self->mutex);
- framebuffer_device_t* fb = self->fbDev;
-
- int index = self->mBufferHead++;
- if (self->mBufferHead >= self->mNumBuffers)
- self->mBufferHead = 0;
-
- // wait for a free buffer
- while (!self->mNumFreeBuffers) {
- self->mCondition.wait(self->mutex);
- }
- // get this buffer
- self->mNumFreeBuffers--;
- self->mCurrentBufferIndex = index;
-
- *buffer = self->buffers[index].get();
-
- return 0;
-}
-
-int FramebufferNativeWindow::lockBuffer(ANativeWindow* window,
- ANativeWindowBuffer* buffer)
-{
- FramebufferNativeWindow* self = getSelf(window);
- Mutex::Autolock _l(self->mutex);
-
- const int index = self->mCurrentBufferIndex;
-
- // wait that the buffer we're locking is not front anymore
- while (self->front == buffer) {
- self->mCondition.wait(self->mutex);
- }
-
- return NO_ERROR;
-}
-
-int FramebufferNativeWindow::queueBuffer(ANativeWindow* window,
- ANativeWindowBuffer* buffer)
-{
- FramebufferNativeWindow* self = getSelf(window);
- Mutex::Autolock _l(self->mutex);
- framebuffer_device_t* fb = self->fbDev;
- buffer_handle_t handle = static_cast<NativeBuffer*>(buffer)->handle;
-
- const int index = self->mCurrentBufferIndex;
- int res = fb->post(fb, handle);
- self->front = static_cast<NativeBuffer*>(buffer);
- self->mNumFreeBuffers++;
- self->mCondition.broadcast();
- return res;
-}
-
-int FramebufferNativeWindow::query(const ANativeWindow* window,
- int what, int* value)
-{
- const FramebufferNativeWindow* self = getSelf(window);
- Mutex::Autolock _l(self->mutex);
- framebuffer_device_t* fb = self->fbDev;
- switch (what) {
- case NATIVE_WINDOW_WIDTH:
- *value = fb->width;
- return NO_ERROR;
- case NATIVE_WINDOW_HEIGHT:
- *value = fb->height;
- return NO_ERROR;
- case NATIVE_WINDOW_FORMAT:
- *value = fb->format;
- return NO_ERROR;
- case NATIVE_WINDOW_CONCRETE_TYPE:
- *value = NATIVE_WINDOW_FRAMEBUFFER;
- return NO_ERROR;
- case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER:
- *value = 0;
- return NO_ERROR;
- case NATIVE_WINDOW_DEFAULT_WIDTH:
- *value = fb->width;
- return NO_ERROR;
- case NATIVE_WINDOW_DEFAULT_HEIGHT:
- *value = fb->height;
- return NO_ERROR;
- case NATIVE_WINDOW_TRANSFORM_HINT:
- *value = 0;
- return NO_ERROR;
- }
- *value = 0;
- return BAD_VALUE;
-}
-
-int FramebufferNativeWindow::perform(ANativeWindow* window,
- int operation, ...)
-{
- switch (operation) {
- case NATIVE_WINDOW_CONNECT:
- case NATIVE_WINDOW_DISCONNECT:
- case NATIVE_WINDOW_SET_USAGE:
- case NATIVE_WINDOW_SET_BUFFERS_GEOMETRY:
- case NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS:
- case NATIVE_WINDOW_SET_BUFFERS_FORMAT:
- case NATIVE_WINDOW_SET_BUFFERS_TRANSFORM:
- case NATIVE_WINDOW_API_CONNECT:
- case NATIVE_WINDOW_API_DISCONNECT:
- // TODO: we should implement these
- return NO_ERROR;
-
- case NATIVE_WINDOW_LOCK:
- case NATIVE_WINDOW_UNLOCK_AND_POST:
- case NATIVE_WINDOW_SET_CROP:
- case NATIVE_WINDOW_SET_BUFFER_COUNT:
- case NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP:
- case NATIVE_WINDOW_SET_SCALING_MODE:
- return INVALID_OPERATION;
- }
- return NAME_NOT_FOUND;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-using namespace android;
-
-EGLNativeWindowType android_createDisplaySurface(void)
-{
- FramebufferNativeWindow* w;
- w = new FramebufferNativeWindow();
- if (w->getDevice() == NULL) {
- // get a ref so it can be destroyed when we exit this block
- sp<FramebufferNativeWindow> ref(w);
- return NULL;
- }
- return (EGLNativeWindowType)w;
-}
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
deleted file mode 100644
index 57063e5..0000000
--- a/libs/ui/GraphicBuffer.cpp
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define LOG_TAG "GraphicBuffer"
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/Log.h>
-
-#include <ui/GraphicBuffer.h>
-#include <ui/GraphicBufferAllocator.h>
-#include <ui/GraphicBufferMapper.h>
-#include <ui/PixelFormat.h>
-
-namespace android {
-
-// ===========================================================================
-// Buffer and implementation of ANativeWindowBuffer
-// ===========================================================================
-
-GraphicBuffer::GraphicBuffer()
- : BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()),
- mInitCheck(NO_ERROR), mIndex(-1)
-{
- width =
- height =
- stride =
- format =
- usage = 0;
- handle = NULL;
-}
-
-GraphicBuffer::GraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat reqFormat, uint32_t reqUsage)
- : BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()),
- mInitCheck(NO_ERROR), mIndex(-1)
-{
- width =
- height =
- stride =
- format =
- usage = 0;
- handle = NULL;
- mInitCheck = initSize(w, h, reqFormat, reqUsage);
-}
-
-GraphicBuffer::GraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat inFormat, uint32_t inUsage,
- uint32_t inStride, native_handle_t* inHandle, bool keepOwnership)
- : BASE(), mOwner(keepOwnership ? ownHandle : ownNone),
- mBufferMapper(GraphicBufferMapper::get()),
- mInitCheck(NO_ERROR), mIndex(-1)
-{
- width = w;
- height = h;
- stride = inStride;
- format = inFormat;
- usage = inUsage;
- handle = inHandle;
-}
-
-GraphicBuffer::GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership)
- : BASE(), mOwner(keepOwnership ? ownHandle : ownNone),
- mBufferMapper(GraphicBufferMapper::get()),
- mInitCheck(NO_ERROR), mIndex(-1), mWrappedBuffer(buffer)
-{
- width = buffer->width;
- height = buffer->height;
- stride = buffer->stride;
- format = buffer->format;
- usage = buffer->usage;
- handle = buffer->handle;
-}
-
-GraphicBuffer::~GraphicBuffer()
-{
- if (handle) {
- free_handle();
- }
-}
-
-void GraphicBuffer::free_handle()
-{
- if (mOwner == ownHandle) {
- mBufferMapper.unregisterBuffer(handle);
- native_handle_close(handle);
- native_handle_delete(const_cast<native_handle*>(handle));
- } else if (mOwner == ownData) {
- GraphicBufferAllocator& allocator(GraphicBufferAllocator::get());
- allocator.free(handle);
- }
- mWrappedBuffer = 0;
-}
-
-status_t GraphicBuffer::initCheck() const {
- return mInitCheck;
-}
-
-void GraphicBuffer::dumpAllocationsToSystemLog()
-{
- GraphicBufferAllocator::dumpToSystemLog();
-}
-
-ANativeWindowBuffer* GraphicBuffer::getNativeBuffer() const
-{
- return static_cast<ANativeWindowBuffer*>(
- const_cast<GraphicBuffer*>(this));
-}
-
-status_t GraphicBuffer::reallocate(uint32_t w, uint32_t h, PixelFormat f,
- uint32_t reqUsage)
-{
- if (mOwner != ownData)
- return INVALID_OPERATION;
-
- if (handle && w==width && h==height && f==format && reqUsage==usage)
- return NO_ERROR;
-
- if (handle) {
- GraphicBufferAllocator& allocator(GraphicBufferAllocator::get());
- allocator.free(handle);
- handle = 0;
- }
- return initSize(w, h, f, reqUsage);
-}
-
-status_t GraphicBuffer::initSize(uint32_t w, uint32_t h, PixelFormat format,
- uint32_t reqUsage)
-{
- GraphicBufferAllocator& allocator = GraphicBufferAllocator::get();
- status_t err = allocator.alloc(w, h, format, reqUsage, &handle, &stride);
- if (err == NO_ERROR) {
- this->width = w;
- this->height = h;
- this->format = format;
- this->usage = reqUsage;
- }
- return err;
-}
-
-status_t GraphicBuffer::lock(uint32_t usage, void** vaddr)
-{
- const Rect lockBounds(width, height);
- status_t res = lock(usage, lockBounds, vaddr);
- return res;
-}
-
-status_t GraphicBuffer::lock(uint32_t usage, const Rect& rect, void** vaddr)
-{
- if (rect.left < 0 || rect.right > this->width ||
- rect.top < 0 || rect.bottom > this->height) {
- ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
- rect.left, rect.top, rect.right, rect.bottom,
- this->width, this->height);
- return BAD_VALUE;
- }
- status_t res = getBufferMapper().lock(handle, usage, rect, vaddr);
- return res;
-}
-
-status_t GraphicBuffer::unlock()
-{
- status_t res = getBufferMapper().unlock(handle);
- return res;
-}
-
-size_t GraphicBuffer::getFlattenedSize() const {
- return (8 + (handle ? handle->numInts : 0))*sizeof(int);
-}
-
-size_t GraphicBuffer::getFdCount() const {
- return handle ? handle->numFds : 0;
-}
-
-status_t GraphicBuffer::flatten(void* buffer, size_t size,
- int fds[], size_t count) const
-{
- size_t sizeNeeded = GraphicBuffer::getFlattenedSize();
- if (size < sizeNeeded) return NO_MEMORY;
-
- size_t fdCountNeeded = GraphicBuffer::getFdCount();
- if (count < fdCountNeeded) return NO_MEMORY;
-
- int* buf = static_cast<int*>(buffer);
- buf[0] = 'GBFR';
- buf[1] = width;
- buf[2] = height;
- buf[3] = stride;
- buf[4] = format;
- buf[5] = usage;
- buf[6] = 0;
- buf[7] = 0;
-
- if (handle) {
- buf[6] = handle->numFds;
- buf[7] = handle->numInts;
- native_handle_t const* const h = handle;
- memcpy(fds, h->data, h->numFds*sizeof(int));
- memcpy(&buf[8], h->data + h->numFds, h->numInts*sizeof(int));
- }
-
- return NO_ERROR;
-}
-
-status_t GraphicBuffer::unflatten(void const* buffer, size_t size,
- int fds[], size_t count)
-{
- if (size < 8*sizeof(int)) return NO_MEMORY;
-
- int const* buf = static_cast<int const*>(buffer);
- if (buf[0] != 'GBFR') return BAD_TYPE;
-
- const size_t numFds = buf[6];
- const size_t numInts = buf[7];
-
- const size_t sizeNeeded = (8 + numInts) * sizeof(int);
- if (size < sizeNeeded) return NO_MEMORY;
-
- size_t fdCountNeeded = 0;
- if (count < fdCountNeeded) return NO_MEMORY;
-
- if (handle) {
- // free previous handle if any
- free_handle();
- }
-
- if (numFds || numInts) {
- width = buf[1];
- height = buf[2];
- stride = buf[3];
- format = buf[4];
- usage = buf[5];
- native_handle* h = native_handle_create(numFds, numInts);
- memcpy(h->data, fds, numFds*sizeof(int));
- memcpy(h->data + numFds, &buf[8], numInts*sizeof(int));
- handle = h;
- } else {
- width = height = stride = format = usage = 0;
- handle = NULL;
- }
-
- mOwner = ownHandle;
-
- if (handle != 0) {
- mBufferMapper.registerBuffer(handle);
- }
-
- return NO_ERROR;
-}
-
-
-void GraphicBuffer::setIndex(int index) {
- mIndex = index;
-}
-
-int GraphicBuffer::getIndex() const {
- return mIndex;
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
deleted file mode 100644
index ff550d9..0000000
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-**
-** Copyright 2009, 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.
-*/
-
-#define LOG_TAG "GraphicBufferAllocator"
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-
-#include <cutils/log.h>
-
-#include <utils/Singleton.h>
-#include <utils/String8.h>
-#include <utils/Trace.h>
-
-#include <ui/GraphicBufferAllocator.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-ANDROID_SINGLETON_STATIC_INSTANCE( GraphicBufferAllocator )
-
-Mutex GraphicBufferAllocator::sLock;
-KeyedVector<buffer_handle_t,
- GraphicBufferAllocator::alloc_rec_t> GraphicBufferAllocator::sAllocList;
-
-GraphicBufferAllocator::GraphicBufferAllocator()
- : mAllocDev(0)
-{
- hw_module_t const* module;
- int err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
- ALOGE_IF(err, "FATAL: can't find the %s module", GRALLOC_HARDWARE_MODULE_ID);
- if (err == 0) {
- gralloc_open(module, &mAllocDev);
- }
-}
-
-GraphicBufferAllocator::~GraphicBufferAllocator()
-{
- gralloc_close(mAllocDev);
-}
-
-void GraphicBufferAllocator::dump(String8& result) const
-{
- Mutex::Autolock _l(sLock);
- KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
- size_t total = 0;
- const size_t SIZE = 4096;
- char buffer[SIZE];
- snprintf(buffer, SIZE, "Allocated buffers:\n");
- result.append(buffer);
- const size_t c = list.size();
- for (size_t i=0 ; i<c ; i++) {
- const alloc_rec_t& rec(list.valueAt(i));
- if (rec.size) {
- snprintf(buffer, SIZE, "%10p: %7.2f KiB | %4u (%4u) x %4u | %8X | 0x%08x\n",
- list.keyAt(i), rec.size/1024.0f,
- rec.w, rec.s, rec.h, rec.format, rec.usage);
- } else {
- snprintf(buffer, SIZE, "%10p: unknown | %4u (%4u) x %4u | %8X | 0x%08x\n",
- list.keyAt(i),
- rec.w, rec.s, rec.h, rec.format, rec.usage);
- }
- result.append(buffer);
- total += rec.size;
- }
- snprintf(buffer, SIZE, "Total allocated (estimate): %.2f KB\n", total/1024.0f);
- result.append(buffer);
- if (mAllocDev->common.version >= 1 && mAllocDev->dump) {
- mAllocDev->dump(mAllocDev, buffer, SIZE);
- result.append(buffer);
- }
-}
-
-void GraphicBufferAllocator::dumpToSystemLog()
-{
- String8 s;
- GraphicBufferAllocator::getInstance().dump(s);
- ALOGD("%s", s.string());
-}
-
-status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat format,
- int usage, buffer_handle_t* handle, int32_t* stride)
-{
- ATRACE_CALL();
- // make sure to not allocate a N x 0 or 0 x N buffer, since this is
- // allowed from an API stand-point allocate a 1x1 buffer instead.
- if (!w || !h)
- w = h = 1;
-
- // we have a h/w allocator and h/w buffer is requested
- status_t err;
-
- err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
-
- ALOGW_IF(err, "alloc(%u, %u, %d, %08x, ...) failed %d (%s)",
- w, h, format, usage, err, strerror(-err));
-
- if (err == NO_ERROR) {
- Mutex::Autolock _l(sLock);
- KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
- int bpp = bytesPerPixel(format);
- if (bpp < 0) {
- // probably a HAL custom format. in any case, we don't know
- // what its pixel size is.
- bpp = 0;
- }
- alloc_rec_t rec;
- rec.w = w;
- rec.h = h;
- rec.s = *stride;
- rec.format = format;
- rec.usage = usage;
- rec.size = h * stride[0] * bpp;
- list.add(*handle, rec);
- }
-
- return err;
-}
-
-status_t GraphicBufferAllocator::free(buffer_handle_t handle)
-{
- ATRACE_CALL();
- status_t err;
-
- err = mAllocDev->free(mAllocDev, handle);
-
- ALOGW_IF(err, "free(...) failed %d (%s)", err, strerror(-err));
- if (err == NO_ERROR) {
- Mutex::Autolock _l(sLock);
- KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
- list.removeItem(handle);
- }
-
- return err;
-}
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp
deleted file mode 100644
index 967da98..0000000
--- a/libs/ui/GraphicBufferMapper.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define LOG_TAG "GraphicBufferMapper"
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-
-#include <stdint.h>
-#include <errno.h>
-
-#include <utils/Errors.h>
-#include <utils/Log.h>
-#include <utils/Trace.h>
-
-#include <ui/GraphicBufferMapper.h>
-#include <ui/Rect.h>
-
-#include <hardware/gralloc.h>
-
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-ANDROID_SINGLETON_STATIC_INSTANCE( GraphicBufferMapper )
-
-GraphicBufferMapper::GraphicBufferMapper()
- : mAllocMod(0)
-{
- hw_module_t const* module;
- int err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
- ALOGE_IF(err, "FATAL: can't find the %s module", GRALLOC_HARDWARE_MODULE_ID);
- if (err == 0) {
- mAllocMod = (gralloc_module_t const *)module;
- }
-}
-
-status_t GraphicBufferMapper::registerBuffer(buffer_handle_t handle)
-{
- ATRACE_CALL();
- status_t err;
-
- err = mAllocMod->registerBuffer(mAllocMod, handle);
-
- ALOGW_IF(err, "registerBuffer(%p) failed %d (%s)",
- handle, err, strerror(-err));
- return err;
-}
-
-status_t GraphicBufferMapper::unregisterBuffer(buffer_handle_t handle)
-{
- ATRACE_CALL();
- status_t err;
-
- err = mAllocMod->unregisterBuffer(mAllocMod, handle);
-
- ALOGW_IF(err, "unregisterBuffer(%p) failed %d (%s)",
- handle, err, strerror(-err));
- return err;
-}
-
-status_t GraphicBufferMapper::lock(buffer_handle_t handle,
- int usage, const Rect& bounds, void** vaddr)
-{
- ATRACE_CALL();
- status_t err;
-
- err = mAllocMod->lock(mAllocMod, handle, usage,
- bounds.left, bounds.top, bounds.width(), bounds.height(),
- vaddr);
-
- ALOGW_IF(err, "lock(...) failed %d (%s)", err, strerror(-err));
- return err;
-}
-
-status_t GraphicBufferMapper::unlock(buffer_handle_t handle)
-{
- ATRACE_CALL();
- status_t err;
-
- err = mAllocMod->unlock(mAllocMod, handle);
-
- ALOGW_IF(err, "unlock(...) failed %d (%s)", err, strerror(-err));
- return err;
-}
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/ui/MODULE_LICENSE_APACHE2 b/libs/ui/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/libs/ui/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/libs/ui/NOTICE b/libs/ui/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/libs/ui/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
- Copyright (c) 2005-2008, 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.
-
- 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.
-
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
diff --git a/libs/ui/PixelFormat.cpp b/libs/ui/PixelFormat.cpp
deleted file mode 100644
index fc1d3c2..0000000
--- a/libs/ui/PixelFormat.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <ui/PixelFormat.h>
-#include <hardware/hardware.h>
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-static const int COMPONENT_YUV = 0xFF;
-
-struct Info {
- size_t size;
- size_t bitsPerPixel;
- struct {
- uint8_t ah;
- uint8_t al;
- uint8_t rh;
- uint8_t rl;
- uint8_t gh;
- uint8_t gl;
- uint8_t bh;
- uint8_t bl;
- };
- uint8_t components;
-};
-
-static Info const sPixelFormatInfos[] = {
- { 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 }, 0 },
- { 4, 32, {32,24, 8, 0, 16, 8, 24,16 }, PixelFormatInfo::RGBA },
- { 4, 24, { 0, 0, 8, 0, 16, 8, 24,16 }, PixelFormatInfo::RGB },
- { 3, 24, { 0, 0, 8, 0, 16, 8, 24,16 }, PixelFormatInfo::RGB },
- { 2, 16, { 0, 0, 16,11, 11, 5, 5, 0 }, PixelFormatInfo::RGB },
- { 4, 32, {32,24, 24,16, 16, 8, 8, 0 }, PixelFormatInfo::RGBA },
- { 2, 16, { 1, 0, 16,11, 11, 6, 6, 1 }, PixelFormatInfo::RGBA },
- { 2, 16, { 4, 0, 16,12, 12, 8, 8, 4 }, PixelFormatInfo::RGBA },
- { 1, 8, { 8, 0, 0, 0, 0, 0, 0, 0 }, PixelFormatInfo::ALPHA},
- { 1, 8, { 0, 0, 8, 0, 8, 0, 8, 0 }, PixelFormatInfo::L },
- { 2, 16, {16, 8, 8, 0, 8, 0, 8, 0 }, PixelFormatInfo::LA },
- { 1, 8, { 0, 0, 8, 5, 5, 2, 2, 0 }, PixelFormatInfo::RGB },
-};
-
-static const Info* gGetPixelFormatTable(size_t* numEntries) {
- if (numEntries) {
- *numEntries = sizeof(sPixelFormatInfos)/sizeof(Info);
- }
- return sPixelFormatInfos;
-}
-
-// ----------------------------------------------------------------------------
-
-size_t PixelFormatInfo::getScanlineSize(unsigned int width) const
-{
- size_t size;
- if (components == COMPONENT_YUV) {
- // YCbCr formats are different.
- size = (width * bitsPerPixel)>>3;
- } else {
- size = width * bytesPerPixel;
- }
- return size;
-}
-
-ssize_t bytesPerPixel(PixelFormat format)
-{
- PixelFormatInfo info;
- status_t err = getPixelFormatInfo(format, &info);
- return (err < 0) ? err : info.bytesPerPixel;
-}
-
-ssize_t bitsPerPixel(PixelFormat format)
-{
- PixelFormatInfo info;
- status_t err = getPixelFormatInfo(format, &info);
- return (err < 0) ? err : info.bitsPerPixel;
-}
-
-status_t getPixelFormatInfo(PixelFormat format, PixelFormatInfo* info)
-{
- if (format < 0)
- return BAD_VALUE;
-
- if (info->version != sizeof(PixelFormatInfo))
- return INVALID_OPERATION;
-
- // YUV format from the HAL are handled here
- switch (format) {
- case HAL_PIXEL_FORMAT_YCbCr_422_SP:
- case HAL_PIXEL_FORMAT_YCbCr_422_I:
- info->bitsPerPixel = 16;
- goto done;
- case HAL_PIXEL_FORMAT_YCrCb_420_SP:
- case HAL_PIXEL_FORMAT_YV12:
- info->bitsPerPixel = 12;
- done:
- info->format = format;
- info->components = COMPONENT_YUV;
- info->bytesPerPixel = 1;
- info->h_alpha = 0;
- info->l_alpha = 0;
- info->h_red = info->h_green = info->h_blue = 8;
- info->l_red = info->l_green = info->l_blue = 0;
- return NO_ERROR;
- }
-
- size_t numEntries;
- const Info *i = gGetPixelFormatTable(&numEntries) + format;
- bool valid = uint32_t(format) < numEntries;
- if (!valid) {
- return BAD_INDEX;
- }
-
- info->format = format;
- info->bytesPerPixel = i->size;
- info->bitsPerPixel = i->bitsPerPixel;
- info->h_alpha = i->ah;
- info->l_alpha = i->al;
- info->h_red = i->rh;
- info->l_red = i->rl;
- info->h_green = i->gh;
- info->l_green = i->gl;
- info->h_blue = i->bh;
- info->l_blue = i->bl;
- info->components = i->components;
-
- return NO_ERROR;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
diff --git a/libs/ui/Rect.cpp b/libs/ui/Rect.cpp
deleted file mode 100644
index 5694e00..0000000
--- a/libs/ui/Rect.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#include <ui/Rect.h>
-
-namespace android {
-
-static inline int32_t min(int32_t a, int32_t b) {
- return (a<b) ? a : b;
-}
-
-static inline int32_t max(int32_t a, int32_t b) {
- return (a>b) ? a : b;
-}
-
-void Rect::makeInvalid() {
- left = 0;
- top = 0;
- right = -1;
- bottom = -1;
-}
-
-bool Rect::operator < (const Rect& rhs) const
-{
- if (top<rhs.top) {
- return true;
- } else if (top == rhs.top) {
- if (left < rhs.left) {
- return true;
- } else if (left == rhs.left) {
- if (bottom<rhs.bottom) {
- return true;
- } else if (bottom == rhs.bottom) {
- if (right<rhs.right) {
- return true;
- }
- }
- }
- }
- return false;
-}
-
-Rect& Rect::offsetTo(int32_t x, int32_t y)
-{
- right -= left - x;
- bottom -= top - y;
- left = x;
- top = y;
- return *this;
-}
-
-Rect& Rect::offsetBy(int32_t x, int32_t y)
-{
- left += x;
- top += y;
- right+= x;
- bottom+=y;
- return *this;
-}
-
-const Rect Rect::operator + (const Point& rhs) const
-{
- const Rect result(left+rhs.x, top+rhs.y, right+rhs.x, bottom+rhs.y);
- return result;
-}
-
-const Rect Rect::operator - (const Point& rhs) const
-{
- const Rect result(left-rhs.x, top-rhs.y, right-rhs.x, bottom-rhs.y);
- return result;
-}
-
-bool Rect::intersect(const Rect& with, Rect* result) const
-{
- result->left = max(left, with.left);
- result->top = max(top, with.top);
- result->right = min(right, with.right);
- result->bottom = min(bottom, with.bottom);
- return !(result->isEmpty());
-}
-
-}; // namespace android
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
deleted file mode 100644
index 6e2e731..0000000
--- a/libs/ui/Region.cpp
+++ /dev/null
@@ -1,679 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define LOG_TAG "Region"
-
-#include <limits.h>
-
-#include <utils/Log.h>
-#include <utils/String8.h>
-
-#include <ui/Rect.h>
-#include <ui/Region.h>
-#include <ui/Point.h>
-
-#include <private/ui/RegionHelper.h>
-
-// ----------------------------------------------------------------------------
-#define VALIDATE_REGIONS (false)
-#define VALIDATE_WITH_CORECG (false)
-// ----------------------------------------------------------------------------
-
-#if VALIDATE_WITH_CORECG
-#include <core/SkRegion.h>
-#endif
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-enum {
- op_nand = region_operator<Rect>::op_nand,
- op_and = region_operator<Rect>::op_and,
- op_or = region_operator<Rect>::op_or,
- op_xor = region_operator<Rect>::op_xor
-};
-
-// ----------------------------------------------------------------------------
-
-Region::Region()
- : mBounds(0,0)
-{
-}
-
-Region::Region(const Region& rhs)
- : mBounds(rhs.mBounds), mStorage(rhs.mStorage)
-{
-#if VALIDATE_REGIONS
- validate(rhs, "rhs copy-ctor");
-#endif
-}
-
-Region::Region(const Rect& rhs)
- : mBounds(rhs)
-{
-}
-
-Region::Region(const void* buffer)
-{
- status_t err = read(buffer);
- ALOGE_IF(err<0, "error %s reading Region from buffer", strerror(err));
-}
-
-Region::~Region()
-{
-}
-
-Region& Region::operator = (const Region& rhs)
-{
-#if VALIDATE_REGIONS
- validate(*this, "this->operator=");
- validate(rhs, "rhs.operator=");
-#endif
- mBounds = rhs.mBounds;
- mStorage = rhs.mStorage;
- return *this;
-}
-
-Region& Region::makeBoundsSelf()
-{
- mStorage.clear();
- return *this;
-}
-
-void Region::clear()
-{
- mBounds.clear();
- mStorage.clear();
-}
-
-void Region::set(const Rect& r)
-{
- mBounds = r;
- mStorage.clear();
-}
-
-void Region::set(uint32_t w, uint32_t h)
-{
- mBounds = Rect(int(w), int(h));
- mStorage.clear();
-}
-
-// ----------------------------------------------------------------------------
-
-void Region::addRectUnchecked(int l, int t, int r, int b)
-{
- mStorage.add(Rect(l,t,r,b));
-#if VALIDATE_REGIONS
- validate(*this, "addRectUnchecked");
-#endif
-}
-
-// ----------------------------------------------------------------------------
-
-Region& Region::orSelf(const Rect& r) {
- return operationSelf(r, op_or);
-}
-Region& Region::xorSelf(const Rect& r) {
- return operationSelf(r, op_xor);
-}
-Region& Region::andSelf(const Rect& r) {
- return operationSelf(r, op_and);
-}
-Region& Region::subtractSelf(const Rect& r) {
- return operationSelf(r, op_nand);
-}
-Region& Region::operationSelf(const Rect& r, int op) {
- Region lhs(*this);
- boolean_operation(op, *this, lhs, r);
- return *this;
-}
-
-// ----------------------------------------------------------------------------
-
-Region& Region::orSelf(const Region& rhs) {
- return operationSelf(rhs, op_or);
-}
-Region& Region::xorSelf(const Region& rhs) {
- return operationSelf(rhs, op_xor);
-}
-Region& Region::andSelf(const Region& rhs) {
- return operationSelf(rhs, op_and);
-}
-Region& Region::subtractSelf(const Region& rhs) {
- return operationSelf(rhs, op_nand);
-}
-Region& Region::operationSelf(const Region& rhs, int op) {
- Region lhs(*this);
- boolean_operation(op, *this, lhs, rhs);
- return *this;
-}
-
-Region& Region::translateSelf(int x, int y) {
- if (x|y) translate(*this, x, y);
- return *this;
-}
-
-// ----------------------------------------------------------------------------
-
-const Region Region::merge(const Rect& rhs) const {
- return operation(rhs, op_or);
-}
-const Region Region::mergeExclusive(const Rect& rhs) const {
- return operation(rhs, op_xor);
-}
-const Region Region::intersect(const Rect& rhs) const {
- return operation(rhs, op_and);
-}
-const Region Region::subtract(const Rect& rhs) const {
- return operation(rhs, op_nand);
-}
-const Region Region::operation(const Rect& rhs, int op) const {
- Region result;
- boolean_operation(op, result, *this, rhs);
- return result;
-}
-
-// ----------------------------------------------------------------------------
-
-const Region Region::merge(const Region& rhs) const {
- return operation(rhs, op_or);
-}
-const Region Region::mergeExclusive(const Region& rhs) const {
- return operation(rhs, op_xor);
-}
-const Region Region::intersect(const Region& rhs) const {
- return operation(rhs, op_and);
-}
-const Region Region::subtract(const Region& rhs) const {
- return operation(rhs, op_nand);
-}
-const Region Region::operation(const Region& rhs, int op) const {
- Region result;
- boolean_operation(op, result, *this, rhs);
- return result;
-}
-
-const Region Region::translate(int x, int y) const {
- Region result;
- translate(result, *this, x, y);
- return result;
-}
-
-// ----------------------------------------------------------------------------
-
-Region& Region::orSelf(const Region& rhs, int dx, int dy) {
- return operationSelf(rhs, dx, dy, op_or);
-}
-Region& Region::xorSelf(const Region& rhs, int dx, int dy) {
- return operationSelf(rhs, dx, dy, op_xor);
-}
-Region& Region::andSelf(const Region& rhs, int dx, int dy) {
- return operationSelf(rhs, dx, dy, op_and);
-}
-Region& Region::subtractSelf(const Region& rhs, int dx, int dy) {
- return operationSelf(rhs, dx, dy, op_nand);
-}
-Region& Region::operationSelf(const Region& rhs, int dx, int dy, int op) {
- Region lhs(*this);
- boolean_operation(op, *this, lhs, rhs, dx, dy);
- return *this;
-}
-
-// ----------------------------------------------------------------------------
-
-const Region Region::merge(const Region& rhs, int dx, int dy) const {
- return operation(rhs, dx, dy, op_or);
-}
-const Region Region::mergeExclusive(const Region& rhs, int dx, int dy) const {
- return operation(rhs, dx, dy, op_xor);
-}
-const Region Region::intersect(const Region& rhs, int dx, int dy) const {
- return operation(rhs, dx, dy, op_and);
-}
-const Region Region::subtract(const Region& rhs, int dx, int dy) const {
- return operation(rhs, dx, dy, op_nand);
-}
-const Region Region::operation(const Region& rhs, int dx, int dy, int op) const {
- Region result;
- boolean_operation(op, result, *this, rhs, dx, dy);
- return result;
-}
-
-// ----------------------------------------------------------------------------
-
-// This is our region rasterizer, which merges rects and spans together
-// to obtain an optimal region.
-class Region::rasterizer : public region_operator<Rect>::region_rasterizer
-{
- Rect& bounds;
- Vector<Rect>& storage;
- Rect* head;
- Rect* tail;
- Vector<Rect> span;
- Rect* cur;
-public:
- rasterizer(Region& reg)
- : bounds(reg.mBounds), storage(reg.mStorage), head(), tail(), cur() {
- bounds.top = bounds.bottom = 0;
- bounds.left = INT_MAX;
- bounds.right = INT_MIN;
- storage.clear();
- }
-
- ~rasterizer() {
- if (span.size()) {
- flushSpan();
- }
- if (storage.size()) {
- bounds.top = storage.itemAt(0).top;
- bounds.bottom = storage.top().bottom;
- if (storage.size() == 1) {
- storage.clear();
- }
- } else {
- bounds.left = 0;
- bounds.right = 0;
- }
- }
-
- virtual void operator()(const Rect& rect) {
- //ALOGD(">>> %3d, %3d, %3d, %3d",
- // rect.left, rect.top, rect.right, rect.bottom);
- if (span.size()) {
- if (cur->top != rect.top) {
- flushSpan();
- } else if (cur->right == rect.left) {
- cur->right = rect.right;
- return;
- }
- }
- span.add(rect);
- cur = span.editArray() + (span.size() - 1);
- }
-private:
- template<typename T>
- static inline T min(T rhs, T lhs) { return rhs < lhs ? rhs : lhs; }
- template<typename T>
- static inline T max(T rhs, T lhs) { return rhs > lhs ? rhs : lhs; }
- void flushSpan() {
- bool merge = false;
- if (tail-head == ssize_t(span.size())) {
- Rect const* p = span.editArray();
- Rect const* q = head;
- if (p->top == q->bottom) {
- merge = true;
- while (q != tail) {
- if ((p->left != q->left) || (p->right != q->right)) {
- merge = false;
- break;
- }
- p++, q++;
- }
- }
- }
- if (merge) {
- const int bottom = span[0].bottom;
- Rect* r = head;
- while (r != tail) {
- r->bottom = bottom;
- r++;
- }
- } else {
- bounds.left = min(span.itemAt(0).left, bounds.left);
- bounds.right = max(span.top().right, bounds.right);
- storage.appendVector(span);
- tail = storage.editArray() + storage.size();
- head = tail - span.size();
- }
- span.clear();
- }
-};
-
-bool Region::validate(const Region& reg, const char* name)
-{
- bool result = true;
- const_iterator cur = reg.begin();
- const_iterator const tail = reg.end();
- const_iterator prev = cur++;
- Rect b(*prev);
- while (cur != tail) {
- b.left = b.left < cur->left ? b.left : cur->left;
- b.top = b.top < cur->top ? b.top : cur->top;
- b.right = b.right > cur->right ? b.right : cur->right;
- b.bottom = b.bottom > cur->bottom ? b.bottom : cur->bottom;
- if (cur->top == prev->top) {
- if (cur->bottom != prev->bottom) {
- ALOGE("%s: invalid span %p", name, cur);
- result = false;
- } else if (cur->left < prev->right) {
- ALOGE("%s: spans overlap horizontally prev=%p, cur=%p",
- name, prev, cur);
- result = false;
- }
- } else if (cur->top < prev->bottom) {
- ALOGE("%s: spans overlap vertically prev=%p, cur=%p",
- name, prev, cur);
- result = false;
- }
- prev = cur;
- cur++;
- }
- if (b != reg.getBounds()) {
- result = false;
- ALOGE("%s: invalid bounds [%d,%d,%d,%d] vs. [%d,%d,%d,%d]", name,
- b.left, b.top, b.right, b.bottom,
- reg.getBounds().left, reg.getBounds().top,
- reg.getBounds().right, reg.getBounds().bottom);
- }
- if (result == false) {
- reg.dump(name);
- }
- return result;
-}
-
-void Region::boolean_operation(int op, Region& dst,
- const Region& lhs,
- const Region& rhs, int dx, int dy)
-{
-#if VALIDATE_REGIONS
- validate(lhs, "boolean_operation (before): lhs");
- validate(rhs, "boolean_operation (before): rhs");
- validate(dst, "boolean_operation (before): dst");
-#endif
-
- size_t lhs_count;
- Rect const * const lhs_rects = lhs.getArray(&lhs_count);
-
- size_t rhs_count;
- Rect const * const rhs_rects = rhs.getArray(&rhs_count);
-
- region_operator<Rect>::region lhs_region(lhs_rects, lhs_count);
- region_operator<Rect>::region rhs_region(rhs_rects, rhs_count, dx, dy);
- region_operator<Rect> operation(op, lhs_region, rhs_region);
- { // scope for rasterizer (dtor has side effects)
- rasterizer r(dst);
- operation(r);
- }
-
-#if VALIDATE_REGIONS
- validate(lhs, "boolean_operation: lhs");
- validate(rhs, "boolean_operation: rhs");
- validate(dst, "boolean_operation: dst");
-#endif
-
-#if VALIDATE_WITH_CORECG
- SkRegion sk_lhs;
- SkRegion sk_rhs;
- SkRegion sk_dst;
-
- for (size_t i=0 ; i<lhs_count ; i++)
- sk_lhs.op(
- lhs_rects[i].left + dx,
- lhs_rects[i].top + dy,
- lhs_rects[i].right + dx,
- lhs_rects[i].bottom + dy,
- SkRegion::kUnion_Op);
-
- for (size_t i=0 ; i<rhs_count ; i++)
- sk_rhs.op(
- rhs_rects[i].left + dx,
- rhs_rects[i].top + dy,
- rhs_rects[i].right + dx,
- rhs_rects[i].bottom + dy,
- SkRegion::kUnion_Op);
-
- const char* name = "---";
- SkRegion::Op sk_op;
- switch (op) {
- case op_or: sk_op = SkRegion::kUnion_Op; name="OR"; break;
- case op_xor: sk_op = SkRegion::kUnion_XOR; name="XOR"; break;
- case op_and: sk_op = SkRegion::kIntersect_Op; name="AND"; break;
- case op_nand: sk_op = SkRegion::kDifference_Op; name="NAND"; break;
- }
- sk_dst.op(sk_lhs, sk_rhs, sk_op);
-
- if (sk_dst.isEmpty() && dst.isEmpty())
- return;
-
- bool same = true;
- Region::const_iterator head = dst.begin();
- Region::const_iterator const tail = dst.end();
- SkRegion::Iterator it(sk_dst);
- while (!it.done()) {
- if (head != tail) {
- if (
- head->left != it.rect().fLeft ||
- head->top != it.rect().fTop ||
- head->right != it.rect().fRight ||
- head->bottom != it.rect().fBottom
- ) {
- same = false;
- break;
- }
- } else {
- same = false;
- break;
- }
- head++;
- it.next();
- }
-
- if (head != tail) {
- same = false;
- }
-
- if(!same) {
- ALOGD("---\nregion boolean %s failed", name);
- lhs.dump("lhs");
- rhs.dump("rhs");
- dst.dump("dst");
- ALOGD("should be");
- SkRegion::Iterator it(sk_dst);
- while (!it.done()) {
- ALOGD(" [%3d, %3d, %3d, %3d]",
- it.rect().fLeft,
- it.rect().fTop,
- it.rect().fRight,
- it.rect().fBottom);
- it.next();
- }
- }
-#endif
-}
-
-void Region::boolean_operation(int op, Region& dst,
- const Region& lhs,
- const Rect& rhs, int dx, int dy)
-{
- if (!rhs.isValid()) {
- ALOGE("Region::boolean_operation(op=%d) invalid Rect={%d,%d,%d,%d}",
- op, rhs.left, rhs.top, rhs.right, rhs.bottom);
- return;
- }
-
-#if VALIDATE_WITH_CORECG || VALIDATE_REGIONS
- boolean_operation(op, dst, lhs, Region(rhs), dx, dy);
-#else
- size_t lhs_count;
- Rect const * const lhs_rects = lhs.getArray(&lhs_count);
-
- region_operator<Rect>::region lhs_region(lhs_rects, lhs_count);
- region_operator<Rect>::region rhs_region(&rhs, 1, dx, dy);
- region_operator<Rect> operation(op, lhs_region, rhs_region);
- { // scope for rasterizer (dtor has side effects)
- rasterizer r(dst);
- operation(r);
- }
-
-#endif
-}
-
-void Region::boolean_operation(int op, Region& dst,
- const Region& lhs, const Region& rhs)
-{
- boolean_operation(op, dst, lhs, rhs, 0, 0);
-}
-
-void Region::boolean_operation(int op, Region& dst,
- const Region& lhs, const Rect& rhs)
-{
- boolean_operation(op, dst, lhs, rhs, 0, 0);
-}
-
-void Region::translate(Region& reg, int dx, int dy)
-{
- if (!reg.isEmpty()) {
-#if VALIDATE_REGIONS
- validate(reg, "translate (before)");
-#endif
- reg.mBounds.translate(dx, dy);
- size_t count = reg.mStorage.size();
- Rect* rects = reg.mStorage.editArray();
- while (count) {
- rects->translate(dx, dy);
- rects++;
- count--;
- }
-#if VALIDATE_REGIONS
- validate(reg, "translate (after)");
-#endif
- }
-}
-
-void Region::translate(Region& dst, const Region& reg, int dx, int dy)
-{
- dst = reg;
- translate(dst, dx, dy);
-}
-
-// ----------------------------------------------------------------------------
-
-ssize_t Region::write(void* buffer, size_t size) const
-{
-#if VALIDATE_REGIONS
- validate(*this, "write(buffer)");
-#endif
- const size_t count = mStorage.size();
- const size_t sizeNeeded = sizeof(int32_t) + (1+count)*sizeof(Rect);
- if (buffer != NULL) {
- if (sizeNeeded > size) return NO_MEMORY;
- int32_t* const p = static_cast<int32_t*>(buffer);
- *p = count;
- memcpy(p+1, &mBounds, sizeof(Rect));
- if (count) {
- memcpy(p+5, mStorage.array(), count*sizeof(Rect));
- }
- }
- return ssize_t(sizeNeeded);
-}
-
-ssize_t Region::read(const void* buffer)
-{
- int32_t const* const p = static_cast<int32_t const*>(buffer);
- const size_t count = *p;
- memcpy(&mBounds, p+1, sizeof(Rect));
- mStorage.clear();
- if (count) {
- mStorage.insertAt(0, count);
- memcpy(mStorage.editArray(), p+5, count*sizeof(Rect));
- }
-#if VALIDATE_REGIONS
- validate(*this, "read(buffer)");
-#endif
- return ssize_t(sizeof(int32_t) + (1+count)*sizeof(Rect));
-}
-
-ssize_t Region::writeEmpty(void* buffer, size_t size)
-{
- const size_t sizeNeeded = sizeof(int32_t) + sizeof(Rect);
- if (sizeNeeded > size) return NO_MEMORY;
- int32_t* const p = static_cast<int32_t*>(buffer);
- memset(p, 0, sizeNeeded);
- return ssize_t(sizeNeeded);
-}
-
-bool Region::isEmpty(void* buffer)
-{
- int32_t const* const p = static_cast<int32_t const*>(buffer);
- Rect const* const b = reinterpret_cast<Rect const *>(p+1);
- return b->isEmpty();
-}
-
-// ----------------------------------------------------------------------------
-
-Region::const_iterator Region::begin() const {
- return isRect() ? &mBounds : mStorage.array();
-}
-
-Region::const_iterator Region::end() const {
- return isRect() ? ((&mBounds) + 1) : (mStorage.array() + mStorage.size());
-}
-
-Rect const* Region::getArray(size_t* count) const {
- const_iterator const b(begin());
- const_iterator const e(end());
- if (count) *count = e-b;
- return b;
-}
-
-size_t Region::getRects(Vector<Rect>& rectList) const
-{
- rectList = mStorage;
- if (rectList.isEmpty()) {
- rectList.clear();
- rectList.add(mBounds);
- }
- return rectList.size();
-}
-
-// ----------------------------------------------------------------------------
-
-void Region::dump(String8& out, const char* what, uint32_t flags) const
-{
- (void)flags;
- const_iterator head = begin();
- const_iterator const tail = end();
-
- size_t SIZE = 256;
- char buffer[SIZE];
-
- snprintf(buffer, SIZE, " Region %s (this=%p, count=%d)\n",
- what, this, tail-head);
- out.append(buffer);
- while (head != tail) {
- snprintf(buffer, SIZE, " [%3d, %3d, %3d, %3d]\n",
- head->left, head->top, head->right, head->bottom);
- out.append(buffer);
- head++;
- }
-}
-
-void Region::dump(const char* what, uint32_t flags) const
-{
- (void)flags;
- const_iterator head = begin();
- const_iterator const tail = end();
- ALOGD(" Region %s (this=%p, count=%d)\n", what, this, tail-head);
- while (head != tail) {
- ALOGD(" [%3d, %3d, %3d, %3d]\n",
- head->left, head->top, head->right, head->bottom);
- head++;
- }
-}
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/libs/ui/tests/Android.mk b/libs/ui/tests/Android.mk
deleted file mode 100644
index 50cad36..0000000
--- a/libs/ui/tests/Android.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-# Build the unit tests.
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# Build the manual test programs.
-include $(call all-makefiles-under, $(LOCAL_PATH))
diff --git a/libs/ui/tests/region/Android.mk b/libs/ui/tests/region/Android.mk
deleted file mode 100644
index 6cc4a5a..0000000
--- a/libs/ui/tests/region/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- region.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libui
-
-LOCAL_MODULE:= test-region
-
-LOCAL_MODULE_TAGS := tests
-
-include $(BUILD_EXECUTABLE)
diff --git a/libs/ui/tests/region/region.cpp b/libs/ui/tests/region/region.cpp
deleted file mode 100644
index 6347294..0000000
--- a/libs/ui/tests/region/region.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#define LOG_TAG "Region"
-
-#include <stdio.h>
-#include <utils/Debug.h>
-#include <ui/Rect.h>
-#include <ui/Region.h>
-
-using namespace android;
-
-int main()
-{
- Region empty;
- Region reg0( Rect( 0, 0, 100, 100 ) );
- Region reg1 = reg0;
- Region reg2, reg3;
-
- Region reg4 = empty | reg1;
- Region reg5 = reg1 | empty;
-
- reg4.dump("reg4");
- reg5.dump("reg5");
-
- reg0.dump("reg0");
- reg1.dump("reg1");
-
- reg0 = reg0 | reg0.translate(150, 0);
- reg0.dump("reg0");
- reg1.dump("reg1");
-
- reg0 = reg0 | reg0.translate(300, 0);
- reg0.dump("reg0");
- reg1.dump("reg1");
-
- //reg2 = reg0 | reg0.translate(0, 100);
- //reg0.dump("reg0");
- //reg1.dump("reg1");
- //reg2.dump("reg2");
-
- //reg3 = reg0 | reg0.translate(0, 150);
- //reg0.dump("reg0");
- //reg1.dump("reg1");
- //reg2.dump("reg2");
- //reg3.dump("reg3");
-
- ALOGD("---");
- reg2 = reg0 | reg0.translate(100, 0);
- reg0.dump("reg0");
- reg1.dump("reg1");
- reg2.dump("reg2");
-
- return 0;
-}
-
diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk
deleted file mode 100644
index 57c048a..0000000
--- a/libs/utils/Android.mk
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright (C) 2008 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.
-
-LOCAL_PATH:= $(call my-dir)
-
-# libutils is a little unique: It's built twice, once for the host
-# and once for the device.
-
-commonSources:= \
- BasicHashtable.cpp \
- BlobCache.cpp \
- BufferedTextOutput.cpp \
- CallStack.cpp \
- Debug.cpp \
- FileMap.cpp \
- Flattenable.cpp \
- LinearTransform.cpp \
- PropertyMap.cpp \
- RefBase.cpp \
- SharedBuffer.cpp \
- Static.cpp \
- StopWatch.cpp \
- String8.cpp \
- String16.cpp \
- StringArray.cpp \
- SystemClock.cpp \
- TextOutput.cpp \
- Threads.cpp \
- Timers.cpp \
- Tokenizer.cpp \
- Unicode.cpp \
- VectorImpl.cpp \
- misc.cpp
-
-
-# For the host
-# =====================================================
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= $(commonSources)
-
-LOCAL_MODULE:= libutils
-
-LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
-
-ifeq ($(HOST_OS),windows)
-ifeq ($(strip $(USE_CYGWIN),),)
-# Under MinGW, ctype.h doesn't need multi-byte support
-LOCAL_CFLAGS += -DMB_CUR_MAX=1
-endif
-endif
-
-ifeq ($(TARGET_OS),linux)
-LOCAL_LDLIBS += -lrt -ldl
-endif
-
-include $(BUILD_HOST_STATIC_LIBRARY)
-
-
-# For the device
-# =====================================================
-include $(CLEAR_VARS)
-
-
-# we have the common sources, plus some device-specific stuff
-LOCAL_SRC_FILES:= \
- $(commonSources) \
- Looper.cpp \
- Trace.cpp
-
-ifeq ($(TARGET_OS),linux)
-LOCAL_LDLIBS += -lrt -ldl
-endif
-
-LOCAL_C_INCLUDES += \
- bionic/libc/private
-
-LOCAL_LDLIBS += -lpthread
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libcutils \
- libdl \
- libcorkscrew
-
-LOCAL_MODULE:= libutils
-include $(BUILD_SHARED_LIBRARY)
-
-# Include subdirectory makefiles
-# ============================================================
-
-# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
-# team really wants is to build the stuff defined by this makefile.
-ifeq (,$(ONE_SHOT_MAKEFILE))
-include $(call first-makefiles-under,$(LOCAL_PATH))
-endif
diff --git a/libs/utils/BasicHashtable.cpp b/libs/utils/BasicHashtable.cpp
deleted file mode 100644
index fb8ec9f..0000000
--- a/libs/utils/BasicHashtable.cpp
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#define LOG_TAG "BasicHashtable"
-
-#include <math.h>
-
-#include <utils/Log.h>
-#include <utils/BasicHashtable.h>
-#include <utils/misc.h>
-
-namespace android {
-
-BasicHashtableImpl::BasicHashtableImpl(size_t entrySize, bool hasTrivialDestructor,
- size_t minimumInitialCapacity, float loadFactor) :
- mBucketSize(entrySize + sizeof(Bucket)), mHasTrivialDestructor(hasTrivialDestructor),
- mLoadFactor(loadFactor), mSize(0),
- mFilledBuckets(0), mBuckets(NULL) {
- determineCapacity(minimumInitialCapacity, mLoadFactor, &mBucketCount, &mCapacity);
-}
-
-BasicHashtableImpl::BasicHashtableImpl(const BasicHashtableImpl& other) :
- mBucketSize(other.mBucketSize), mHasTrivialDestructor(other.mHasTrivialDestructor),
- mCapacity(other.mCapacity), mLoadFactor(other.mLoadFactor),
- mSize(other.mSize), mFilledBuckets(other.mFilledBuckets),
- mBucketCount(other.mBucketCount), mBuckets(other.mBuckets) {
- if (mBuckets) {
- SharedBuffer::bufferFromData(mBuckets)->acquire();
- }
-}
-
-void BasicHashtableImpl::dispose() {
- if (mBuckets) {
- releaseBuckets(mBuckets, mBucketCount);
- }
-}
-
-void BasicHashtableImpl::clone() {
- if (mBuckets) {
- void* newBuckets = allocateBuckets(mBucketCount);
- copyBuckets(mBuckets, newBuckets, mBucketCount);
- releaseBuckets(mBuckets, mBucketCount);
- mBuckets = newBuckets;
- }
-}
-
-void BasicHashtableImpl::setTo(const BasicHashtableImpl& other) {
- if (mBuckets) {
- releaseBuckets(mBuckets, mBucketCount);
- }
-
- mCapacity = other.mCapacity;
- mLoadFactor = other.mLoadFactor;
- mSize = other.mSize;
- mFilledBuckets = other.mFilledBuckets;
- mBucketCount = other.mBucketCount;
- mBuckets = other.mBuckets;
-
- if (mBuckets) {
- SharedBuffer::bufferFromData(mBuckets)->acquire();
- }
-}
-
-void BasicHashtableImpl::clear() {
- if (mBuckets) {
- if (mFilledBuckets) {
- SharedBuffer* sb = SharedBuffer::bufferFromData(mBuckets);
- if (sb->onlyOwner()) {
- destroyBuckets(mBuckets, mBucketCount);
- for (size_t i = 0; i < mSize; i++) {
- Bucket& bucket = bucketAt(mBuckets, i);
- bucket.cookie = 0;
- }
- } else {
- releaseBuckets(mBuckets, mBucketCount);
- mBuckets = NULL;
- }
- mFilledBuckets = 0;
- }
- mSize = 0;
- }
-}
-
-ssize_t BasicHashtableImpl::next(ssize_t index) const {
- if (mSize) {
- while (size_t(++index) < mBucketCount) {
- const Bucket& bucket = bucketAt(mBuckets, index);
- if (bucket.cookie & Bucket::PRESENT) {
- return index;
- }
- }
- }
- return -1;
-}
-
-ssize_t BasicHashtableImpl::find(ssize_t index, hash_t hash,
- const void* __restrict__ key) const {
- if (!mSize) {
- return -1;
- }
-
- hash = trimHash(hash);
- if (index < 0) {
- index = chainStart(hash, mBucketCount);
-
- const Bucket& bucket = bucketAt(mBuckets, size_t(index));
- if (bucket.cookie & Bucket::PRESENT) {
- if (compareBucketKey(bucket, key)) {
- return index;
- }
- } else {
- if (!(bucket.cookie & Bucket::COLLISION)) {
- return -1;
- }
- }
- }
-
- size_t inc = chainIncrement(hash, mBucketCount);
- for (;;) {
- index = chainSeek(index, inc, mBucketCount);
-
- const Bucket& bucket = bucketAt(mBuckets, size_t(index));
- if (bucket.cookie & Bucket::PRESENT) {
- if ((bucket.cookie & Bucket::HASH_MASK) == hash
- && compareBucketKey(bucket, key)) {
- return index;
- }
- }
- if (!(bucket.cookie & Bucket::COLLISION)) {
- return -1;
- }
- }
-}
-
-size_t BasicHashtableImpl::add(hash_t hash, const void* entry) {
- if (!mBuckets) {
- mBuckets = allocateBuckets(mBucketCount);
- } else {
- edit();
- }
-
- hash = trimHash(hash);
- for (;;) {
- size_t index = chainStart(hash, mBucketCount);
- Bucket* bucket = &bucketAt(mBuckets, size_t(index));
- if (bucket->cookie & Bucket::PRESENT) {
- size_t inc = chainIncrement(hash, mBucketCount);
- do {
- bucket->cookie |= Bucket::COLLISION;
- index = chainSeek(index, inc, mBucketCount);
- bucket = &bucketAt(mBuckets, size_t(index));
- } while (bucket->cookie & Bucket::PRESENT);
- }
-
- uint32_t collision = bucket->cookie & Bucket::COLLISION;
- if (!collision) {
- if (mFilledBuckets >= mCapacity) {
- rehash(mCapacity * 2, mLoadFactor);
- continue;
- }
- mFilledBuckets += 1;
- }
-
- bucket->cookie = collision | Bucket::PRESENT | hash;
- mSize += 1;
- initializeBucketEntry(*bucket, entry);
- return index;
- }
-}
-
-void BasicHashtableImpl::removeAt(size_t index) {
- edit();
-
- Bucket& bucket = bucketAt(mBuckets, index);
- bucket.cookie &= ~Bucket::PRESENT;
- if (!(bucket.cookie & Bucket::COLLISION)) {
- mFilledBuckets -= 1;
- }
- mSize -= 1;
- if (!mHasTrivialDestructor) {
- destroyBucketEntry(bucket);
- }
-}
-
-void BasicHashtableImpl::rehash(size_t minimumCapacity, float loadFactor) {
- if (minimumCapacity < mSize) {
- minimumCapacity = mSize;
- }
- size_t newBucketCount, newCapacity;
- determineCapacity(minimumCapacity, loadFactor, &newBucketCount, &newCapacity);
-
- if (newBucketCount != mBucketCount || newCapacity != mCapacity) {
- if (mBuckets) {
- void* newBuckets;
- if (mSize) {
- newBuckets = allocateBuckets(newBucketCount);
- for (size_t i = 0; i < mBucketCount; i++) {
- const Bucket& fromBucket = bucketAt(mBuckets, i);
- if (fromBucket.cookie & Bucket::PRESENT) {
- hash_t hash = fromBucket.cookie & Bucket::HASH_MASK;
- size_t index = chainStart(hash, newBucketCount);
- Bucket* toBucket = &bucketAt(newBuckets, size_t(index));
- if (toBucket->cookie & Bucket::PRESENT) {
- size_t inc = chainIncrement(hash, newBucketCount);
- do {
- toBucket->cookie |= Bucket::COLLISION;
- index = chainSeek(index, inc, newBucketCount);
- toBucket = &bucketAt(newBuckets, size_t(index));
- } while (toBucket->cookie & Bucket::PRESENT);
- }
- toBucket->cookie = Bucket::PRESENT | hash;
- initializeBucketEntry(*toBucket, fromBucket.entry);
- }
- }
- } else {
- newBuckets = NULL;
- }
- releaseBuckets(mBuckets, mBucketCount);
- mBuckets = newBuckets;
- mFilledBuckets = mSize;
- }
- mBucketCount = newBucketCount;
- mCapacity = newCapacity;
- }
- mLoadFactor = loadFactor;
-}
-
-void* BasicHashtableImpl::allocateBuckets(size_t count) const {
- size_t bytes = count * mBucketSize;
- SharedBuffer* sb = SharedBuffer::alloc(bytes);
- LOG_ALWAYS_FATAL_IF(!sb, "Could not allocate %u bytes for hashtable with %u buckets.",
- uint32_t(bytes), uint32_t(count));
- void* buckets = sb->data();
- for (size_t i = 0; i < count; i++) {
- Bucket& bucket = bucketAt(buckets, i);
- bucket.cookie = 0;
- }
- return buckets;
-}
-
-void BasicHashtableImpl::releaseBuckets(void* __restrict__ buckets, size_t count) const {
- SharedBuffer* sb = SharedBuffer::bufferFromData(buckets);
- if (sb->release(SharedBuffer::eKeepStorage) == 1) {
- destroyBuckets(buckets, count);
- SharedBuffer::dealloc(sb);
- }
-}
-
-void BasicHashtableImpl::destroyBuckets(void* __restrict__ buckets, size_t count) const {
- if (!mHasTrivialDestructor) {
- for (size_t i = 0; i < count; i++) {
- Bucket& bucket = bucketAt(buckets, i);
- if (bucket.cookie & Bucket::PRESENT) {
- destroyBucketEntry(bucket);
- }
- }
- }
-}
-
-void BasicHashtableImpl::copyBuckets(const void* __restrict__ fromBuckets,
- void* __restrict__ toBuckets, size_t count) const {
- for (size_t i = 0; i < count; i++) {
- const Bucket& fromBucket = bucketAt(fromBuckets, i);
- Bucket& toBucket = bucketAt(toBuckets, i);
- toBucket.cookie = fromBucket.cookie;
- if (fromBucket.cookie & Bucket::PRESENT) {
- initializeBucketEntry(toBucket, fromBucket.entry);
- }
- }
-}
-
-// Table of 31-bit primes where each prime is no less than twice as large
-// as the previous one. Generated by "primes.py".
-static size_t PRIMES[] = {
- 5,
- 11,
- 23,
- 47,
- 97,
- 197,
- 397,
- 797,
- 1597,
- 3203,
- 6421,
- 12853,
- 25717,
- 51437,
- 102877,
- 205759,
- 411527,
- 823117,
- 1646237,
- 3292489,
- 6584983,
- 13169977,
- 26339969,
- 52679969,
- 105359939,
- 210719881,
- 421439783,
- 842879579,
- 1685759167,
- 0,
-};
-
-void BasicHashtableImpl::determineCapacity(size_t minimumCapacity, float loadFactor,
- size_t* __restrict__ outBucketCount, size_t* __restrict__ outCapacity) {
- LOG_ALWAYS_FATAL_IF(loadFactor <= 0.0f || loadFactor > 1.0f,
- "Invalid load factor %0.3f. Must be in the range (0, 1].", loadFactor);
-
- size_t count = ceilf(minimumCapacity / loadFactor) + 1;
- size_t i = 0;
- while (count > PRIMES[i] && i < NELEM(PRIMES)) {
- i++;
- }
- count = PRIMES[i];
- LOG_ALWAYS_FATAL_IF(!count, "Could not determine required number of buckets for "
- "hashtable with minimum capacity %u and load factor %0.3f.",
- uint32_t(minimumCapacity), loadFactor);
- *outBucketCount = count;
- *outCapacity = ceilf((count - 1) * loadFactor);
-}
-
-}; // namespace android
diff --git a/libs/utils/BlobCache.cpp b/libs/utils/BlobCache.cpp
deleted file mode 100644
index be398ee..0000000
--- a/libs/utils/BlobCache.cpp
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#define LOG_TAG "BlobCache"
-//#define LOG_NDEBUG 0
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <utils/BlobCache.h>
-#include <utils/Errors.h>
-#include <utils/Log.h>
-
-namespace android {
-
-// BlobCache::Header::mMagicNumber value
-static const uint32_t blobCacheMagic = '_Bb$';
-
-// BlobCache::Header::mBlobCacheVersion value
-static const uint32_t blobCacheVersion = 1;
-
-// BlobCache::Header::mDeviceVersion value
-static const uint32_t blobCacheDeviceVersion = 1;
-
-BlobCache::BlobCache(size_t maxKeySize, size_t maxValueSize, size_t maxTotalSize):
- mMaxKeySize(maxKeySize),
- mMaxValueSize(maxValueSize),
- mMaxTotalSize(maxTotalSize),
- mTotalSize(0) {
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
-#ifdef _WIN32
- srand(now);
-#else
- mRandState[0] = (now >> 0) & 0xFFFF;
- mRandState[1] = (now >> 16) & 0xFFFF;
- mRandState[2] = (now >> 32) & 0xFFFF;
-#endif
- ALOGV("initializing random seed using %lld", now);
-}
-
-void BlobCache::set(const void* key, size_t keySize, const void* value,
- size_t valueSize) {
- if (mMaxKeySize < keySize) {
- ALOGV("set: not caching because the key is too large: %d (limit: %d)",
- keySize, mMaxKeySize);
- return;
- }
- if (mMaxValueSize < valueSize) {
- ALOGV("set: not caching because the value is too large: %d (limit: %d)",
- valueSize, mMaxValueSize);
- return;
- }
- if (mMaxTotalSize < keySize + valueSize) {
- ALOGV("set: not caching because the combined key/value size is too "
- "large: %d (limit: %d)", keySize + valueSize, mMaxTotalSize);
- return;
- }
- if (keySize == 0) {
- ALOGW("set: not caching because keySize is 0");
- return;
- }
- if (valueSize <= 0) {
- ALOGW("set: not caching because valueSize is 0");
- return;
- }
-
- sp<Blob> dummyKey(new Blob(key, keySize, false));
- CacheEntry dummyEntry(dummyKey, NULL);
-
- while (true) {
- ssize_t index = mCacheEntries.indexOf(dummyEntry);
- if (index < 0) {
- // Create a new cache entry.
- sp<Blob> keyBlob(new Blob(key, keySize, true));
- sp<Blob> valueBlob(new Blob(value, valueSize, true));
- size_t newTotalSize = mTotalSize + keySize + valueSize;
- if (mMaxTotalSize < newTotalSize) {
- if (isCleanable()) {
- // Clean the cache and try again.
- clean();
- continue;
- } else {
- ALOGV("set: not caching new key/value pair because the "
- "total cache size limit would be exceeded: %d "
- "(limit: %d)",
- keySize + valueSize, mMaxTotalSize);
- break;
- }
- }
- mCacheEntries.add(CacheEntry(keyBlob, valueBlob));
- mTotalSize = newTotalSize;
- ALOGV("set: created new cache entry with %d byte key and %d byte value",
- keySize, valueSize);
- } else {
- // Update the existing cache entry.
- sp<Blob> valueBlob(new Blob(value, valueSize, true));
- sp<Blob> oldValueBlob(mCacheEntries[index].getValue());
- size_t newTotalSize = mTotalSize + valueSize - oldValueBlob->getSize();
- if (mMaxTotalSize < newTotalSize) {
- if (isCleanable()) {
- // Clean the cache and try again.
- clean();
- continue;
- } else {
- ALOGV("set: not caching new value because the total cache "
- "size limit would be exceeded: %d (limit: %d)",
- keySize + valueSize, mMaxTotalSize);
- break;
- }
- }
- mCacheEntries.editItemAt(index).setValue(valueBlob);
- mTotalSize = newTotalSize;
- ALOGV("set: updated existing cache entry with %d byte key and %d byte "
- "value", keySize, valueSize);
- }
- break;
- }
-}
-
-size_t BlobCache::get(const void* key, size_t keySize, void* value,
- size_t valueSize) {
- if (mMaxKeySize < keySize) {
- ALOGV("get: not searching because the key is too large: %d (limit %d)",
- keySize, mMaxKeySize);
- return 0;
- }
- sp<Blob> dummyKey(new Blob(key, keySize, false));
- CacheEntry dummyEntry(dummyKey, NULL);
- ssize_t index = mCacheEntries.indexOf(dummyEntry);
- if (index < 0) {
- ALOGV("get: no cache entry found for key of size %d", keySize);
- return 0;
- }
-
- // The key was found. Return the value if the caller's buffer is large
- // enough.
- sp<Blob> valueBlob(mCacheEntries[index].getValue());
- size_t valueBlobSize = valueBlob->getSize();
- if (valueBlobSize <= valueSize) {
- ALOGV("get: copying %d bytes to caller's buffer", valueBlobSize);
- memcpy(value, valueBlob->getData(), valueBlobSize);
- } else {
- ALOGV("get: caller's buffer is too small for value: %d (needs %d)",
- valueSize, valueBlobSize);
- }
- return valueBlobSize;
-}
-
-static inline size_t align4(size_t size) {
- return (size + 3) & ~3;
-}
-
-size_t BlobCache::getFlattenedSize() const {
- size_t size = sizeof(Header);
- for (size_t i = 0; i < mCacheEntries.size(); i++) {
- const CacheEntry& e(mCacheEntries[i]);
- sp<Blob> keyBlob = e.getKey();
- sp<Blob> valueBlob = e.getValue();
- size = align4(size);
- size += sizeof(EntryHeader) + keyBlob->getSize() +
- valueBlob->getSize();
- }
- return size;
-}
-
-size_t BlobCache::getFdCount() const {
- return 0;
-}
-
-status_t BlobCache::flatten(void* buffer, size_t size, int fds[], size_t count)
- const {
- if (count != 0) {
- ALOGE("flatten: nonzero fd count: %zu", count);
- return BAD_VALUE;
- }
-
- // Write the cache header
- if (size < sizeof(Header)) {
- ALOGE("flatten: not enough room for cache header");
- return BAD_VALUE;
- }
- Header* header = reinterpret_cast<Header*>(buffer);
- header->mMagicNumber = blobCacheMagic;
- header->mBlobCacheVersion = blobCacheVersion;
- header->mDeviceVersion = blobCacheDeviceVersion;
- header->mNumEntries = mCacheEntries.size();
-
- // Write cache entries
- uint8_t* byteBuffer = reinterpret_cast<uint8_t*>(buffer);
- off_t byteOffset = align4(sizeof(Header));
- for (size_t i = 0; i < mCacheEntries.size(); i++) {
- const CacheEntry& e(mCacheEntries[i]);
- sp<Blob> keyBlob = e.getKey();
- sp<Blob> valueBlob = e.getValue();
- size_t keySize = keyBlob->getSize();
- size_t valueSize = valueBlob->getSize();
-
- size_t entrySize = sizeof(EntryHeader) + keySize + valueSize;
- if (byteOffset + entrySize > size) {
- ALOGE("flatten: not enough room for cache entries");
- return BAD_VALUE;
- }
-
- EntryHeader* eheader = reinterpret_cast<EntryHeader*>(
- &byteBuffer[byteOffset]);
- eheader->mKeySize = keySize;
- eheader->mValueSize = valueSize;
-
- memcpy(eheader->mData, keyBlob->getData(), keySize);
- memcpy(eheader->mData + keySize, valueBlob->getData(), valueSize);
-
- byteOffset += align4(entrySize);
- }
-
- return OK;
-}
-
-status_t BlobCache::unflatten(void const* buffer, size_t size, int fds[],
- size_t count) {
- // All errors should result in the BlobCache being in an empty state.
- mCacheEntries.clear();
-
- if (count != 0) {
- ALOGE("unflatten: nonzero fd count: %zu", count);
- return BAD_VALUE;
- }
-
- // Read the cache header
- if (size < sizeof(Header)) {
- ALOGE("unflatten: not enough room for cache header");
- return BAD_VALUE;
- }
- const Header* header = reinterpret_cast<const Header*>(buffer);
- if (header->mMagicNumber != blobCacheMagic) {
- ALOGE("unflatten: bad magic number: %d", header->mMagicNumber);
- return BAD_VALUE;
- }
- if (header->mBlobCacheVersion != blobCacheVersion ||
- header->mDeviceVersion != blobCacheDeviceVersion) {
- // We treat version mismatches as an empty cache.
- return OK;
- }
-
- // Read cache entries
- const uint8_t* byteBuffer = reinterpret_cast<const uint8_t*>(buffer);
- off_t byteOffset = align4(sizeof(Header));
- size_t numEntries = header->mNumEntries;
- for (size_t i = 0; i < numEntries; i++) {
- if (byteOffset + sizeof(EntryHeader) > size) {
- mCacheEntries.clear();
- ALOGE("unflatten: not enough room for cache entry headers");
- return BAD_VALUE;
- }
-
- const EntryHeader* eheader = reinterpret_cast<const EntryHeader*>(
- &byteBuffer[byteOffset]);
- size_t keySize = eheader->mKeySize;
- size_t valueSize = eheader->mValueSize;
- size_t entrySize = sizeof(EntryHeader) + keySize + valueSize;
-
- if (byteOffset + entrySize > size) {
- mCacheEntries.clear();
- ALOGE("unflatten: not enough room for cache entry headers");
- return BAD_VALUE;
- }
-
- const uint8_t* data = eheader->mData;
- set(data, keySize, data + keySize, valueSize);
-
- byteOffset += align4(entrySize);
- }
-
- return OK;
-}
-
-long int BlobCache::blob_random() {
-#ifdef _WIN32
- return rand();
-#else
- return nrand48(mRandState);
-#endif
-}
-
-void BlobCache::clean() {
- // Remove a random cache entry until the total cache size gets below half
- // the maximum total cache size.
- while (mTotalSize > mMaxTotalSize / 2) {
- size_t i = size_t(blob_random() % (mCacheEntries.size()));
- const CacheEntry& entry(mCacheEntries[i]);
- mTotalSize -= entry.getKey()->getSize() + entry.getValue()->getSize();
- mCacheEntries.removeAt(i);
- }
-}
-
-bool BlobCache::isCleanable() const {
- return mTotalSize > mMaxTotalSize / 2;
-}
-
-BlobCache::Blob::Blob(const void* data, size_t size, bool copyData):
- mData(copyData ? malloc(size) : data),
- mSize(size),
- mOwnsData(copyData) {
- if (data != NULL && copyData) {
- memcpy(const_cast<void*>(mData), data, size);
- }
-}
-
-BlobCache::Blob::~Blob() {
- if (mOwnsData) {
- free(const_cast<void*>(mData));
- }
-}
-
-bool BlobCache::Blob::operator<(const Blob& rhs) const {
- if (mSize == rhs.mSize) {
- return memcmp(mData, rhs.mData, mSize) < 0;
- } else {
- return mSize < rhs.mSize;
- }
-}
-
-const void* BlobCache::Blob::getData() const {
- return mData;
-}
-
-size_t BlobCache::Blob::getSize() const {
- return mSize;
-}
-
-BlobCache::CacheEntry::CacheEntry() {
-}
-
-BlobCache::CacheEntry::CacheEntry(const sp<Blob>& key, const sp<Blob>& value):
- mKey(key),
- mValue(value) {
-}
-
-BlobCache::CacheEntry::CacheEntry(const CacheEntry& ce):
- mKey(ce.mKey),
- mValue(ce.mValue) {
-}
-
-bool BlobCache::CacheEntry::operator<(const CacheEntry& rhs) const {
- return *mKey < *rhs.mKey;
-}
-
-const BlobCache::CacheEntry& BlobCache::CacheEntry::operator=(const CacheEntry& rhs) {
- mKey = rhs.mKey;
- mValue = rhs.mValue;
- return *this;
-}
-
-sp<BlobCache::Blob> BlobCache::CacheEntry::getKey() const {
- return mKey;
-}
-
-sp<BlobCache::Blob> BlobCache::CacheEntry::getValue() const {
- return mValue;
-}
-
-void BlobCache::CacheEntry::setValue(const sp<Blob>& value) {
- mValue = value;
-}
-
-} // namespace android
diff --git a/libs/utils/BufferedTextOutput.cpp b/libs/utils/BufferedTextOutput.cpp
deleted file mode 100644
index 989662e..0000000
--- a/libs/utils/BufferedTextOutput.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-#include <utils/BufferedTextOutput.h>
-
-#include <utils/Atomic.h>
-#include <utils/Debug.h>
-#include <utils/Log.h>
-#include <utils/RefBase.h>
-#include <utils/Vector.h>
-#include <cutils/threads.h>
-
-#include <private/utils/Static.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-struct BufferedTextOutput::BufferState : public RefBase
-{
- BufferState(int32_t _seq)
- : seq(_seq)
- , buffer(NULL)
- , bufferPos(0)
- , bufferSize(0)
- , atFront(true)
- , indent(0)
- , bundle(0) {
- }
- ~BufferState() {
- free(buffer);
- }
-
- status_t append(const char* txt, size_t len) {
- if ((len+bufferPos) > bufferSize) {
- void* b = realloc(buffer, ((len+bufferPos)*3)/2);
- if (!b) return NO_MEMORY;
- buffer = (char*)b;
- }
- memcpy(buffer+bufferPos, txt, len);
- bufferPos += len;
- return NO_ERROR;
- }
-
- void restart() {
- bufferPos = 0;
- atFront = true;
- if (bufferSize > 256) {
- void* b = realloc(buffer, 256);
- if (b) {
- buffer = (char*)b;
- bufferSize = 256;
- }
- }
- }
-
- const int32_t seq;
- char* buffer;
- size_t bufferPos;
- size_t bufferSize;
- bool atFront;
- int32_t indent;
- int32_t bundle;
-};
-
-struct BufferedTextOutput::ThreadState
-{
- Vector<sp<BufferedTextOutput::BufferState> > states;
-};
-
-static mutex_t gMutex;
-
-static thread_store_t tls;
-
-BufferedTextOutput::ThreadState* BufferedTextOutput::getThreadState()
-{
- ThreadState* ts = (ThreadState*) thread_store_get( &tls );
- if (ts) return ts;
- ts = new ThreadState;
- thread_store_set( &tls, ts, threadDestructor );
- return ts;
-}
-
-void BufferedTextOutput::threadDestructor(void *st)
-{
- delete ((ThreadState*)st);
-}
-
-static volatile int32_t gSequence = 0;
-
-static volatile int32_t gFreeBufferIndex = -1;
-
-static int32_t allocBufferIndex()
-{
- int32_t res = -1;
-
- mutex_lock(&gMutex);
-
- if (gFreeBufferIndex >= 0) {
- res = gFreeBufferIndex;
- gFreeBufferIndex = gTextBuffers[res];
- gTextBuffers.editItemAt(res) = -1;
-
- } else {
- res = gTextBuffers.size();
- gTextBuffers.add(-1);
- }
-
- mutex_unlock(&gMutex);
-
- return res;
-}
-
-static void freeBufferIndex(int32_t idx)
-{
- mutex_lock(&gMutex);
- gTextBuffers.editItemAt(idx) = gFreeBufferIndex;
- gFreeBufferIndex = idx;
- mutex_unlock(&gMutex);
-}
-
-// ---------------------------------------------------------------------------
-
-BufferedTextOutput::BufferedTextOutput(uint32_t flags)
- : mFlags(flags)
- , mSeq(android_atomic_inc(&gSequence))
- , mIndex(allocBufferIndex())
-{
- mGlobalState = new BufferState(mSeq);
- if (mGlobalState) mGlobalState->incStrong(this);
-}
-
-BufferedTextOutput::~BufferedTextOutput()
-{
- if (mGlobalState) mGlobalState->decStrong(this);
- freeBufferIndex(mIndex);
-}
-
-status_t BufferedTextOutput::print(const char* txt, size_t len)
-{
- //printf("BufferedTextOutput: printing %d\n", len);
-
- AutoMutex _l(mLock);
- BufferState* b = getBuffer();
-
- const char* const end = txt+len;
-
- status_t err;
-
- while (txt < end) {
- // Find the next line.
- const char* first = txt;
- while (txt < end && *txt != '\n') txt++;
-
- // Include this and all following empty lines.
- while (txt < end && *txt == '\n') txt++;
-
- // Special cases for first data on a line.
- if (b->atFront) {
- if (b->indent > 0) {
- // If this is the start of a line, add the indent.
- const char* prefix = stringForIndent(b->indent);
- err = b->append(prefix, strlen(prefix));
- if (err != NO_ERROR) return err;
-
- } else if (*(txt-1) == '\n' && !b->bundle) {
- // Fast path: if we are not indenting or bundling, and
- // have been given one or more complete lines, just write
- // them out without going through the buffer.
-
- // Slurp up all of the lines.
- const char* lastLine = txt+1;
- while (txt < end) {
- if (*txt++ == '\n') lastLine = txt;
- }
- struct iovec vec;
- vec.iov_base = (void*)first;
- vec.iov_len = lastLine-first;
- //printf("Writing %d bytes of data!\n", vec.iov_len);
- writeLines(vec, 1);
- txt = lastLine;
- continue;
- }
- }
-
- // Append the new text to the buffer.
- err = b->append(first, txt-first);
- if (err != NO_ERROR) return err;
- b->atFront = *(txt-1) == '\n';
-
- // If we have finished a line and are not bundling, write
- // it out.
- //printf("Buffer is now %d bytes\n", b->bufferPos);
- if (b->atFront && !b->bundle) {
- struct iovec vec;
- vec.iov_base = b->buffer;
- vec.iov_len = b->bufferPos;
- //printf("Writing %d bytes of data!\n", vec.iov_len);
- writeLines(vec, 1);
- b->restart();
- }
- }
-
- return NO_ERROR;
-}
-
-void BufferedTextOutput::moveIndent(int delta)
-{
- AutoMutex _l(mLock);
- BufferState* b = getBuffer();
- b->indent += delta;
- if (b->indent < 0) b->indent = 0;
-}
-
-void BufferedTextOutput::pushBundle()
-{
- AutoMutex _l(mLock);
- BufferState* b = getBuffer();
- b->bundle++;
-}
-
-void BufferedTextOutput::popBundle()
-{
- AutoMutex _l(mLock);
- BufferState* b = getBuffer();
- b->bundle--;
- LOG_FATAL_IF(b->bundle < 0,
- "TextOutput::popBundle() called more times than pushBundle()");
- if (b->bundle < 0) b->bundle = 0;
-
- if (b->bundle == 0) {
- // Last bundle, write out data if it is complete. If it is not
- // complete, don't write until the last line is done... this may
- // or may not be the write thing to do, but it's the easiest.
- if (b->bufferPos > 0 && b->atFront) {
- struct iovec vec;
- vec.iov_base = b->buffer;
- vec.iov_len = b->bufferPos;
- writeLines(vec, 1);
- b->restart();
- }
- }
-}
-
-BufferedTextOutput::BufferState* BufferedTextOutput::getBuffer() const
-{
- if ((mFlags&MULTITHREADED) != 0) {
- ThreadState* ts = getThreadState();
- if (ts) {
- while (ts->states.size() <= (size_t)mIndex) ts->states.add(NULL);
- BufferState* bs = ts->states[mIndex].get();
- if (bs != NULL && bs->seq == mSeq) return bs;
-
- ts->states.editItemAt(mIndex) = new BufferState(mIndex);
- bs = ts->states[mIndex].get();
- if (bs != NULL) return bs;
- }
- }
-
- return mGlobalState;
-}
-
-}; // namespace android
diff --git a/libs/utils/CallStack.cpp b/libs/utils/CallStack.cpp
deleted file mode 100644
index 18fd84f..0000000
--- a/libs/utils/CallStack.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define LOG_TAG "CallStack"
-
-#include <string.h>
-
-#include <utils/Log.h>
-#include <utils/Errors.h>
-#include <utils/CallStack.h>
-#include <corkscrew/backtrace.h>
-
-/*****************************************************************************/
-namespace android {
-
-CallStack::CallStack() :
- mCount(0) {
-}
-
-CallStack::CallStack(const CallStack& rhs) :
- mCount(rhs.mCount) {
- if (mCount) {
- memcpy(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t));
- }
-}
-
-CallStack::~CallStack() {
-}
-
-CallStack& CallStack::operator = (const CallStack& rhs) {
- mCount = rhs.mCount;
- if (mCount) {
- memcpy(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t));
- }
- return *this;
-}
-
-bool CallStack::operator == (const CallStack& rhs) const {
- if (mCount != rhs.mCount)
- return false;
- return !mCount || memcmp(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t)) == 0;
-}
-
-bool CallStack::operator != (const CallStack& rhs) const {
- return !operator == (rhs);
-}
-
-bool CallStack::operator < (const CallStack& rhs) const {
- if (mCount != rhs.mCount)
- return mCount < rhs.mCount;
- return memcmp(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t)) < 0;
-}
-
-bool CallStack::operator >= (const CallStack& rhs) const {
- return !operator < (rhs);
-}
-
-bool CallStack::operator > (const CallStack& rhs) const {
- if (mCount != rhs.mCount)
- return mCount > rhs.mCount;
- return memcmp(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t)) > 0;
-}
-
-bool CallStack::operator <= (const CallStack& rhs) const {
- return !operator > (rhs);
-}
-
-const void* CallStack::operator [] (int index) const {
- if (index >= int(mCount))
- return 0;
- return reinterpret_cast<const void*>(mStack[index].absolute_pc);
-}
-
-void CallStack::clear() {
- mCount = 0;
-}
-
-void CallStack::update(int32_t ignoreDepth, int32_t maxDepth) {
- if (maxDepth > MAX_DEPTH) {
- maxDepth = MAX_DEPTH;
- }
- ssize_t count = unwind_backtrace(mStack, ignoreDepth + 1, maxDepth);
- mCount = count > 0 ? count : 0;
-}
-
-void CallStack::dump(const char* prefix) const {
- backtrace_symbol_t symbols[mCount];
-
- get_backtrace_symbols(mStack, mCount, symbols);
- for (size_t i = 0; i < mCount; i++) {
- char line[MAX_BACKTRACE_LINE_LENGTH];
- format_backtrace_line(i, &mStack[i], &symbols[i],
- line, MAX_BACKTRACE_LINE_LENGTH);
- ALOGD("%s%s", prefix, line);
- }
- free_backtrace_symbols(symbols, mCount);
-}
-
-String8 CallStack::toString(const char* prefix) const {
- String8 str;
- backtrace_symbol_t symbols[mCount];
-
- get_backtrace_symbols(mStack, mCount, symbols);
- for (size_t i = 0; i < mCount; i++) {
- char line[MAX_BACKTRACE_LINE_LENGTH];
- format_backtrace_line(i, &mStack[i], &symbols[i],
- line, MAX_BACKTRACE_LINE_LENGTH);
- str.append(prefix);
- str.append(line);
- str.append("\n");
- }
- free_backtrace_symbols(symbols, mCount);
- return str;
-}
-
-}; // namespace android
diff --git a/libs/utils/Debug.cpp b/libs/utils/Debug.cpp
deleted file mode 100644
index e8ac983..0000000
--- a/libs/utils/Debug.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#include <utils/Debug.h>
-
-#include <utils/misc.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-namespace android {
-
-// ---------------------------------------------------------------------
-
-static const char indentStr[] =
-" "
-" ";
-
-const char* stringForIndent(int32_t indentLevel)
-{
- ssize_t off = sizeof(indentStr)-1-(indentLevel*2);
- return indentStr + (off < 0 ? 0 : off);
-}
-
-// ---------------------------------------------------------------------
-
-static void defaultPrintFunc(void* cookie, const char* txt)
-{
- printf("%s", txt);
-}
-
-// ---------------------------------------------------------------------
-
-static inline int isident(int c)
-{
- return isalnum(c) || c == '_';
-}
-
-static inline bool isasciitype(char c)
-{
- if( c >= ' ' && c < 127 && c != '\'' && c != '\\' ) return true;
- return false;
-}
-
-static inline char makehexdigit(uint32_t val)
-{
- return "0123456789abcdef"[val&0xF];
-}
-
-static char* appendhexnum(uint32_t val, char* out)
-{
- for( int32_t i=28; i>=0; i-=4 ) {
- *out++ = makehexdigit( val>>i );
- }
- *out = 0;
- return out;
-}
-
-static inline char makeupperhexdigit(uint32_t val)
-{
- return "0123456789ABCDEF"[val&0xF];
-}
-
-static char* appendupperhexnum(uint32_t val, char* out)
-{
- for( int32_t i=28; i>=0; i-=4 ) {
- *out++ = makeupperhexdigit( val>>i );
- }
- *out = 0;
- return out;
-}
-
-static char* appendcharornum(char c, char* out, bool skipzero = true)
-{
- if (skipzero && c == 0) return out;
-
- if (isasciitype(c)) {
- *out++ = c;
- return out;
- }
-
- *out++ = '\\';
- *out++ = 'x';
- *out++ = makehexdigit(c>>4);
- *out++ = makehexdigit(c);
- return out;
-}
-
-static char* typetostring(uint32_t type, char* out,
- bool fullContext = true,
- bool strict = false)
-{
- char* pos = out;
- char c[4];
- c[0] = (char)((type>>24)&0xFF);
- c[1] = (char)((type>>16)&0xFF);
- c[2] = (char)((type>>8)&0xFF);
- c[3] = (char)(type&0xFF);
- bool valid;
- if( !strict ) {
- // now even less strict!
- // valid = isasciitype(c[3]);
- valid = true;
- int32_t i = 0;
- bool zero = true;
- while (valid && i<3) {
- if (c[i] == 0) {
- if (!zero) valid = false;
- } else {
- zero = false;
- //if (!isasciitype(c[i])) valid = false;
- }
- i++;
- }
- // if all zeros, not a valid type code.
- if (zero) valid = false;
- } else {
- valid = isident(c[3]) ? true : false;
- int32_t i = 0;
- bool zero = true;
- while (valid && i<3) {
- if (c[i] == 0) {
- if (!zero) valid = false;
- } else {
- zero = false;
- if (!isident(c[i])) valid = false;
- }
- i++;
- }
- }
- if( valid && (!fullContext || c[0] != '0' || c[1] != 'x') ) {
- if( fullContext ) *pos++ = '\'';
- pos = appendcharornum(c[0], pos);
- pos = appendcharornum(c[1], pos);
- pos = appendcharornum(c[2], pos);
- pos = appendcharornum(c[3], pos);
- if( fullContext ) *pos++ = '\'';
- *pos = 0;
- return pos;
- }
-
- if( fullContext ) {
- *pos++ = '0';
- *pos++ = 'x';
- }
- return appendhexnum(type, pos);
-}
-
-void printTypeCode(uint32_t typeCode, debugPrintFunc func, void* cookie)
-{
- char buffer[32];
- char* end = typetostring(typeCode, buffer);
- *end = 0;
- func ? (*func)(cookie, buffer) : defaultPrintFunc(cookie, buffer);
-}
-
-void printHexData(int32_t indent, const void *buf, size_t length,
- size_t bytesPerLine, int32_t singleLineBytesCutoff,
- size_t alignment, bool cStyle,
- debugPrintFunc func, void* cookie)
-{
- if (alignment == 0) {
- if (bytesPerLine >= 16) alignment = 4;
- else if (bytesPerLine >= 8) alignment = 2;
- else alignment = 1;
- }
- if (func == NULL) func = defaultPrintFunc;
-
- size_t offset;
-
- unsigned char *pos = (unsigned char *)buf;
-
- if (pos == NULL) {
- if (singleLineBytesCutoff < 0) func(cookie, "\n");
- func(cookie, "(NULL)");
- return;
- }
-
- if (length == 0) {
- if (singleLineBytesCutoff < 0) func(cookie, "\n");
- func(cookie, "(empty)");
- return;
- }
-
- if ((int32_t)length < 0) {
- if (singleLineBytesCutoff < 0) func(cookie, "\n");
- char buf[64];
- sprintf(buf, "(bad length: %zu)", length);
- func(cookie, buf);
- return;
- }
-
- char buffer[256];
- static const size_t maxBytesPerLine = (sizeof(buffer)-1-11-4)/(3+1);
-
- if (bytesPerLine > maxBytesPerLine) bytesPerLine = maxBytesPerLine;
-
- const bool oneLine = (int32_t)length <= singleLineBytesCutoff;
- bool newLine = false;
- if (cStyle) {
- indent++;
- func(cookie, "{\n");
- newLine = true;
- } else if (!oneLine) {
- func(cookie, "\n");
- newLine = true;
- }
-
- for (offset = 0; ; offset += bytesPerLine, pos += bytesPerLine) {
- long remain = length;
-
- char* c = buffer;
- if (!oneLine && !cStyle) {
- sprintf(c, "0x%08x: ", (int)offset);
- c += 12;
- }
-
- size_t index;
- size_t word;
-
- for (word = 0; word < bytesPerLine; ) {
-
-#ifdef HAVE_LITTLE_ENDIAN
- const size_t startIndex = word+(alignment-(alignment?1:0));
- const ssize_t dir = -1;
-#else
- const size_t startIndex = word;
- const ssize_t dir = 1;
-#endif
-
- for (index = 0; index < alignment || (alignment == 0 && index < bytesPerLine); index++) {
-
- if (!cStyle) {
- if (index == 0 && word > 0 && alignment > 0) {
- *c++ = ' ';
- }
-
- if (remain-- > 0) {
- const unsigned char val = *(pos+startIndex+(index*dir));
- *c++ = makehexdigit(val>>4);
- *c++ = makehexdigit(val);
- } else if (!oneLine) {
- *c++ = ' ';
- *c++ = ' ';
- }
- } else {
- if (remain > 0) {
- if (index == 0 && word > 0) {
- *c++ = ',';
- *c++ = ' ';
- }
- if (index == 0) {
- *c++ = '0';
- *c++ = 'x';
- }
- const unsigned char val = *(pos+startIndex+(index*dir));
- *c++ = makehexdigit(val>>4);
- *c++ = makehexdigit(val);
- remain--;
- }
- }
- }
-
- word += index;
- }
-
- if (!cStyle) {
- remain = length;
- *c++ = ' ';
- *c++ = '\'';
- for (index = 0; index < bytesPerLine; index++) {
-
- if (remain-- > 0) {
- const unsigned char val = pos[index];
- *c++ = (val >= ' ' && val < 127) ? val : '.';
- } else if (!oneLine) {
- *c++ = ' ';
- }
- }
-
- *c++ = '\'';
- if (length > bytesPerLine) *c++ = '\n';
- } else {
- if (remain > 0) *c++ = ',';
- *c++ = '\n';
- }
-
- if (newLine && indent) func(cookie, stringForIndent(indent));
- *c = 0;
- func(cookie, buffer);
- newLine = true;
-
- if (length <= bytesPerLine) break;
- length -= bytesPerLine;
- }
-
- if (cStyle) {
- if (indent > 0) func(cookie, stringForIndent(indent-1));
- func(cookie, "};");
- }
-}
-
-}; // namespace android
-
diff --git a/libs/utils/FileMap.cpp b/libs/utils/FileMap.cpp
deleted file mode 100644
index 9ce370e..0000000
--- a/libs/utils/FileMap.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-//
-// Shared file mapping class.
-//
-
-#define LOG_TAG "filemap"
-
-#include <utils/FileMap.h>
-#include <utils/Log.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef HAVE_POSIX_FILEMAP
-#include <sys/mman.h>
-#endif
-
-#include <string.h>
-#include <memory.h>
-#include <errno.h>
-#include <assert.h>
-
-using namespace android;
-
-/*static*/ long FileMap::mPageSize = -1;
-
-
-/*
- * Constructor. Create an empty object.
- */
-FileMap::FileMap(void)
- : mRefCount(1), mFileName(NULL), mBasePtr(NULL), mBaseLength(0),
- mDataPtr(NULL), mDataLength(0)
-{
-}
-
-/*
- * Destructor.
- */
-FileMap::~FileMap(void)
-{
- assert(mRefCount == 0);
-
- //printf("+++ removing FileMap %p %u\n", mDataPtr, mDataLength);
-
- mRefCount = -100; // help catch double-free
- if (mFileName != NULL) {
- free(mFileName);
- }
-#ifdef HAVE_POSIX_FILEMAP
- if (mBasePtr && munmap(mBasePtr, mBaseLength) != 0) {
- ALOGD("munmap(%p, %d) failed\n", mBasePtr, (int) mBaseLength);
- }
-#endif
-#ifdef HAVE_WIN32_FILEMAP
- if (mBasePtr && UnmapViewOfFile(mBasePtr) == 0) {
- ALOGD("UnmapViewOfFile(%p) failed, error = %ld\n", mBasePtr,
- GetLastError() );
- }
- if (mFileMapping != INVALID_HANDLE_VALUE) {
- CloseHandle(mFileMapping);
- }
- CloseHandle(mFileHandle);
-#endif
-}
-
-
-/*
- * Create a new mapping on an open file.
- *
- * Closing the file descriptor does not unmap the pages, so we don't
- * claim ownership of the fd.
- *
- * Returns "false" on failure.
- */
-bool FileMap::create(const char* origFileName, int fd, off64_t offset, size_t length,
- bool readOnly)
-{
-#ifdef HAVE_WIN32_FILEMAP
- int adjust;
- off64_t adjOffset;
- size_t adjLength;
-
- if (mPageSize == -1) {
- SYSTEM_INFO si;
-
- GetSystemInfo( &si );
- mPageSize = si.dwAllocationGranularity;
- }
-
- DWORD protect = readOnly ? PAGE_READONLY : PAGE_READWRITE;
-
- mFileHandle = (HANDLE) _get_osfhandle(fd);
- mFileMapping = CreateFileMapping( mFileHandle, NULL, protect, 0, 0, NULL);
- if (mFileMapping == NULL) {
- ALOGE("CreateFileMapping(%p, %lx) failed with error %ld\n",
- mFileHandle, protect, GetLastError() );
- return false;
- }
-
- adjust = offset % mPageSize;
- adjOffset = offset - adjust;
- adjLength = length + adjust;
-
- mBasePtr = MapViewOfFile( mFileMapping,
- readOnly ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS,
- 0,
- (DWORD)(adjOffset),
- adjLength );
- if (mBasePtr == NULL) {
- ALOGE("MapViewOfFile(%ld, %ld) failed with error %ld\n",
- adjOffset, adjLength, GetLastError() );
- CloseHandle(mFileMapping);
- mFileMapping = INVALID_HANDLE_VALUE;
- return false;
- }
-#endif
-#ifdef HAVE_POSIX_FILEMAP
- int prot, flags, adjust;
- off64_t adjOffset;
- size_t adjLength;
-
- void* ptr;
-
- assert(mRefCount == 1);
- assert(fd >= 0);
- assert(offset >= 0);
- assert(length > 0);
-
- /* init on first use */
- if (mPageSize == -1) {
-#if NOT_USING_KLIBC
- mPageSize = sysconf(_SC_PAGESIZE);
- if (mPageSize == -1) {
- ALOGE("could not get _SC_PAGESIZE\n");
- return false;
- }
-#else
- /* this holds for Linux, Darwin, Cygwin, and doesn't pain the ARM */
- mPageSize = 4096;
-#endif
- }
-
- adjust = offset % mPageSize;
-try_again:
- adjOffset = offset - adjust;
- adjLength = length + adjust;
-
- flags = MAP_SHARED;
- prot = PROT_READ;
- if (!readOnly)
- prot |= PROT_WRITE;
-
- ptr = mmap(NULL, adjLength, prot, flags, fd, adjOffset);
- if (ptr == MAP_FAILED) {
- // Cygwin does not seem to like file mapping files from an offset.
- // So if we fail, try again with offset zero
- if (adjOffset > 0) {
- adjust = offset;
- goto try_again;
- }
-
- ALOGE("mmap(%ld,%ld) failed: %s\n",
- (long) adjOffset, (long) adjLength, strerror(errno));
- return false;
- }
- mBasePtr = ptr;
-#endif /* HAVE_POSIX_FILEMAP */
-
- mFileName = origFileName != NULL ? strdup(origFileName) : NULL;
- mBaseLength = adjLength;
- mDataOffset = offset;
- mDataPtr = (char*) mBasePtr + adjust;
- mDataLength = length;
-
- assert(mBasePtr != NULL);
-
- ALOGV("MAP: base %p/%d data %p/%d\n",
- mBasePtr, (int) mBaseLength, mDataPtr, (int) mDataLength);
-
- return true;
-}
-
-/*
- * Provide guidance to the system.
- */
-int FileMap::advise(MapAdvice advice)
-{
-#if HAVE_MADVISE
- int cc, sysAdvice;
-
- switch (advice) {
- case NORMAL: sysAdvice = MADV_NORMAL; break;
- case RANDOM: sysAdvice = MADV_RANDOM; break;
- case SEQUENTIAL: sysAdvice = MADV_SEQUENTIAL; break;
- case WILLNEED: sysAdvice = MADV_WILLNEED; break;
- case DONTNEED: sysAdvice = MADV_DONTNEED; break;
- default:
- assert(false);
- return -1;
- }
-
- cc = madvise(mBasePtr, mBaseLength, sysAdvice);
- if (cc != 0)
- ALOGW("madvise(%d) failed: %s\n", sysAdvice, strerror(errno));
- return cc;
-#else
- return -1;
-#endif // HAVE_MADVISE
-}
diff --git a/libs/utils/Flattenable.cpp b/libs/utils/Flattenable.cpp
deleted file mode 100644
index 1f2ffaa..0000000
--- a/libs/utils/Flattenable.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-#include <utils/Flattenable.h>
-
-namespace android {
-
-Flattenable::~Flattenable() {
-}
-
-}; // namespace android
diff --git a/libs/utils/LinearTransform.cpp b/libs/utils/LinearTransform.cpp
deleted file mode 100644
index d752415..0000000
--- a/libs/utils/LinearTransform.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#define __STDC_LIMIT_MACROS
-
-#include <assert.h>
-#include <stdint.h>
-
-#include <utils/LinearTransform.h>
-
-namespace android {
-
-template<class T> static inline T ABS(T x) { return (x < 0) ? -x : x; }
-
-// Static math methods involving linear transformations
-static bool scale_u64_to_u64(
- uint64_t val,
- uint32_t N,
- uint32_t D,
- uint64_t* res,
- bool round_up_not_down) {
- uint64_t tmp1, tmp2;
- uint32_t r;
-
- assert(res);
- assert(D);
-
- // Let U32(X) denote a uint32_t containing the upper 32 bits of a 64 bit
- // integer X.
- // Let L32(X) denote a uint32_t containing the lower 32 bits of a 64 bit
- // integer X.
- // Let X[A, B] with A <= B denote bits A through B of the integer X.
- // Let (A | B) denote the concatination of two 32 bit ints, A and B.
- // IOW X = (A | B) => U32(X) == A && L32(X) == B
- //
- // compute M = val * N (a 96 bit int)
- // ---------------------------------
- // tmp2 = U32(val) * N (a 64 bit int)
- // tmp1 = L32(val) * N (a 64 bit int)
- // which means
- // M = val * N = (tmp2 << 32) + tmp1
- tmp2 = (val >> 32) * N;
- tmp1 = (val & UINT32_MAX) * N;
-
- // compute M[32, 95]
- // tmp2 = tmp2 + U32(tmp1)
- // = (U32(val) * N) + U32(L32(val) * N)
- // = M[32, 95]
- tmp2 += tmp1 >> 32;
-
- // if M[64, 95] >= D, then M/D has bits > 63 set and we have
- // an overflow.
- if ((tmp2 >> 32) >= D) {
- *res = UINT64_MAX;
- return false;
- }
-
- // Divide. Going in we know
- // tmp2 = M[32, 95]
- // U32(tmp2) < D
- r = tmp2 % D;
- tmp2 /= D;
-
- // At this point
- // tmp1 = L32(val) * N
- // tmp2 = M[32, 95] / D
- // = (M / D)[32, 95]
- // r = M[32, 95] % D
- // U32(tmp2) = 0
- //
- // compute tmp1 = (r | M[0, 31])
- tmp1 = (tmp1 & UINT32_MAX) | ((uint64_t)r << 32);
-
- // Divide again. Keep the remainder around in order to round properly.
- r = tmp1 % D;
- tmp1 /= D;
-
- // At this point
- // tmp2 = (M / D)[32, 95]
- // tmp1 = (M / D)[ 0, 31]
- // r = M % D
- // U32(tmp1) = 0
- // U32(tmp2) = 0
-
- // Pack the result and deal with the round-up case (As well as the
- // remote possiblility over overflow in such a case).
- *res = (tmp2 << 32) | tmp1;
- if (r && round_up_not_down) {
- ++(*res);
- if (!(*res)) {
- *res = UINT64_MAX;
- return false;
- }
- }
-
- return true;
-}
-
-static bool linear_transform_s64_to_s64(
- int64_t val,
- int64_t basis1,
- int32_t N,
- uint32_t D,
- int64_t basis2,
- int64_t* out) {
- uint64_t scaled, res;
- uint64_t abs_val;
- bool is_neg;
-
- if (!out)
- return false;
-
- // Compute abs(val - basis_64). Keep track of whether or not this delta
- // will be negative after the scale opertaion.
- if (val < basis1) {
- is_neg = true;
- abs_val = basis1 - val;
- } else {
- is_neg = false;
- abs_val = val - basis1;
- }
-
- if (N < 0)
- is_neg = !is_neg;
-
- if (!scale_u64_to_u64(abs_val,
- ABS(N),
- D,
- &scaled,
- is_neg))
- return false; // overflow/undeflow
-
- // if scaled is >= 0x8000<etc>, then we are going to overflow or
- // underflow unless ABS(basis2) is large enough to pull us back into the
- // non-overflow/underflow region.
- if (scaled & INT64_MIN) {
- if (is_neg && (basis2 < 0))
- return false; // certain underflow
-
- if (!is_neg && (basis2 >= 0))
- return false; // certain overflow
-
- if (ABS(basis2) <= static_cast<int64_t>(scaled & INT64_MAX))
- return false; // not enough
-
- // Looks like we are OK
- *out = (is_neg ? (-scaled) : scaled) + basis2;
- } else {
- // Scaled fits within signed bounds, so we just need to check for
- // over/underflow for two signed integers. Basically, if both scaled
- // and basis2 have the same sign bit, and the result has a different
- // sign bit, then we have under/overflow. An easy way to compute this
- // is
- // (scaled_signbit XNOR basis_signbit) &&
- // (scaled_signbit XOR res_signbit)
- // ==
- // (scaled_signbit XOR basis_signbit XOR 1) &&
- // (scaled_signbit XOR res_signbit)
-
- if (is_neg)
- scaled = -scaled;
- res = scaled + basis2;
-
- if ((scaled ^ basis2 ^ INT64_MIN) & (scaled ^ res) & INT64_MIN)
- return false;
-
- *out = res;
- }
-
- return true;
-}
-
-bool LinearTransform::doForwardTransform(int64_t a_in, int64_t* b_out) const {
- if (0 == a_to_b_denom)
- return false;
-
- return linear_transform_s64_to_s64(a_in,
- a_zero,
- a_to_b_numer,
- a_to_b_denom,
- b_zero,
- b_out);
-}
-
-bool LinearTransform::doReverseTransform(int64_t b_in, int64_t* a_out) const {
- if (0 == a_to_b_numer)
- return false;
-
- return linear_transform_s64_to_s64(b_in,
- b_zero,
- a_to_b_denom,
- a_to_b_numer,
- a_zero,
- a_out);
-}
-
-template <class T> void LinearTransform::reduce(T* N, T* D) {
- T a, b;
- if (!N || !D || !(*D)) {
- assert(false);
- return;
- }
-
- a = *N;
- b = *D;
-
- if (a == 0) {
- *D = 1;
- return;
- }
-
- // This implements Euclid's method to find GCD.
- if (a < b) {
- T tmp = a;
- a = b;
- b = tmp;
- }
-
- while (1) {
- // a is now the greater of the two.
- const T remainder = a % b;
- if (remainder == 0) {
- *N /= b;
- *D /= b;
- return;
- }
- // by swapping remainder and b, we are guaranteeing that a is
- // still the greater of the two upon entrance to the loop.
- a = b;
- b = remainder;
- }
-};
-
-template void LinearTransform::reduce<uint64_t>(uint64_t* N, uint64_t* D);
-template void LinearTransform::reduce<uint32_t>(uint32_t* N, uint32_t* D);
-
-void LinearTransform::reduce(int32_t* N, uint32_t* D) {
- if (N && D && *D) {
- if (*N < 0) {
- *N = -(*N);
- reduce(reinterpret_cast<uint32_t*>(N), D);
- *N = -(*N);
- } else {
- reduce(reinterpret_cast<uint32_t*>(N), D);
- }
- }
-}
-
-} // namespace android
diff --git a/libs/utils/Looper.cpp b/libs/utils/Looper.cpp
deleted file mode 100644
index d1aa664..0000000
--- a/libs/utils/Looper.cpp
+++ /dev/null
@@ -1,744 +0,0 @@
-//
-// Copyright 2010 The Android Open Source Project
-//
-// A looper implementation based on epoll().
-//
-#define LOG_TAG "Looper"
-
-//#define LOG_NDEBUG 0
-
-// Debugs poll and wake interactions.
-#define DEBUG_POLL_AND_WAKE 0
-
-// Debugs callback registration and invocation.
-#define DEBUG_CALLBACKS 0
-
-#include <cutils/log.h>
-#include <utils/Looper.h>
-#include <utils/Timers.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <limits.h>
-
-
-namespace android {
-
-// --- WeakMessageHandler ---
-
-WeakMessageHandler::WeakMessageHandler(const wp<MessageHandler>& handler) :
- mHandler(handler) {
-}
-
-void WeakMessageHandler::handleMessage(const Message& message) {
- sp<MessageHandler> handler = mHandler.promote();
- if (handler != NULL) {
- handler->handleMessage(message);
- }
-}
-
-
-// --- Looper ---
-
-#ifdef LOOPER_USES_EPOLL
-// Hint for number of file descriptors to be associated with the epoll instance.
-static const int EPOLL_SIZE_HINT = 8;
-
-// Maximum number of file descriptors for which to retrieve poll events each iteration.
-static const int EPOLL_MAX_EVENTS = 16;
-#endif
-
-static pthread_once_t gTLSOnce = PTHREAD_ONCE_INIT;
-static pthread_key_t gTLSKey = 0;
-
-Looper::Looper(bool allowNonCallbacks) :
- mAllowNonCallbacks(allowNonCallbacks), mSendingMessage(false),
- mResponseIndex(0), mNextMessageUptime(LLONG_MAX) {
- int wakeFds[2];
- int result = pipe(wakeFds);
- LOG_ALWAYS_FATAL_IF(result != 0, "Could not create wake pipe. errno=%d", errno);
-
- mWakeReadPipeFd = wakeFds[0];
- mWakeWritePipeFd = wakeFds[1];
-
- result = fcntl(mWakeReadPipeFd, F_SETFL, O_NONBLOCK);
- LOG_ALWAYS_FATAL_IF(result != 0, "Could not make wake read pipe non-blocking. errno=%d",
- errno);
-
- result = fcntl(mWakeWritePipeFd, F_SETFL, O_NONBLOCK);
- LOG_ALWAYS_FATAL_IF(result != 0, "Could not make wake write pipe non-blocking. errno=%d",
- errno);
-
-#ifdef LOOPER_USES_EPOLL
- // Allocate the epoll instance and register the wake pipe.
- mEpollFd = epoll_create(EPOLL_SIZE_HINT);
- LOG_ALWAYS_FATAL_IF(mEpollFd < 0, "Could not create epoll instance. errno=%d", errno);
-
- struct epoll_event eventItem;
- memset(& eventItem, 0, sizeof(epoll_event)); // zero out unused members of data field union
- eventItem.events = EPOLLIN;
- eventItem.data.fd = mWakeReadPipeFd;
- result = epoll_ctl(mEpollFd, EPOLL_CTL_ADD, mWakeReadPipeFd, & eventItem);
- LOG_ALWAYS_FATAL_IF(result != 0, "Could not add wake read pipe to epoll instance. errno=%d",
- errno);
-#else
- // Add the wake pipe to the head of the request list with a null callback.
- struct pollfd requestedFd;
- requestedFd.fd = mWakeReadPipeFd;
- requestedFd.events = POLLIN;
- mRequestedFds.push(requestedFd);
-
- Request request;
- request.fd = mWakeReadPipeFd;
- request.callback = NULL;
- request.ident = 0;
- request.data = NULL;
- mRequests.push(request);
-
- mPolling = false;
- mWaiters = 0;
-#endif
-
-#ifdef LOOPER_STATISTICS
- mPendingWakeTime = -1;
- mPendingWakeCount = 0;
- mSampledWakeCycles = 0;
- mSampledWakeCountSum = 0;
- mSampledWakeLatencySum = 0;
-
- mSampledPolls = 0;
- mSampledZeroPollCount = 0;
- mSampledZeroPollLatencySum = 0;
- mSampledTimeoutPollCount = 0;
- mSampledTimeoutPollLatencySum = 0;
-#endif
-}
-
-Looper::~Looper() {
- close(mWakeReadPipeFd);
- close(mWakeWritePipeFd);
-#ifdef LOOPER_USES_EPOLL
- close(mEpollFd);
-#endif
-}
-
-void Looper::initTLSKey() {
- int result = pthread_key_create(& gTLSKey, threadDestructor);
- LOG_ALWAYS_FATAL_IF(result != 0, "Could not allocate TLS key.");
-}
-
-void Looper::threadDestructor(void *st) {
- Looper* const self = static_cast<Looper*>(st);
- if (self != NULL) {
- self->decStrong((void*)threadDestructor);
- }
-}
-
-void Looper::setForThread(const sp<Looper>& looper) {
- sp<Looper> old = getForThread(); // also has side-effect of initializing TLS
-
- if (looper != NULL) {
- looper->incStrong((void*)threadDestructor);
- }
-
- pthread_setspecific(gTLSKey, looper.get());
-
- if (old != NULL) {
- old->decStrong((void*)threadDestructor);
- }
-}
-
-sp<Looper> Looper::getForThread() {
- int result = pthread_once(& gTLSOnce, initTLSKey);
- LOG_ALWAYS_FATAL_IF(result != 0, "pthread_once failed");
-
- return (Looper*)pthread_getspecific(gTLSKey);
-}
-
-sp<Looper> Looper::prepare(int opts) {
- bool allowNonCallbacks = opts & ALOOPER_PREPARE_ALLOW_NON_CALLBACKS;
- sp<Looper> looper = Looper::getForThread();
- if (looper == NULL) {
- looper = new Looper(allowNonCallbacks);
- Looper::setForThread(looper);
- }
- if (looper->getAllowNonCallbacks() != allowNonCallbacks) {
- ALOGW("Looper already prepared for this thread with a different value for the "
- "ALOOPER_PREPARE_ALLOW_NON_CALLBACKS option.");
- }
- return looper;
-}
-
-bool Looper::getAllowNonCallbacks() const {
- return mAllowNonCallbacks;
-}
-
-int Looper::pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData) {
- int result = 0;
- for (;;) {
- while (mResponseIndex < mResponses.size()) {
- const Response& response = mResponses.itemAt(mResponseIndex++);
- ALooper_callbackFunc callback = response.request.callback;
- if (!callback) {
- int ident = response.request.ident;
- int fd = response.request.fd;
- int events = response.events;
- void* data = response.request.data;
-#if DEBUG_POLL_AND_WAKE
- ALOGD("%p ~ pollOnce - returning signalled identifier %d: "
- "fd=%d, events=0x%x, data=%p",
- this, ident, fd, events, data);
-#endif
- if (outFd != NULL) *outFd = fd;
- if (outEvents != NULL) *outEvents = events;
- if (outData != NULL) *outData = data;
- return ident;
- }
- }
-
- if (result != 0) {
-#if DEBUG_POLL_AND_WAKE
- ALOGD("%p ~ pollOnce - returning result %d", this, result);
-#endif
- if (outFd != NULL) *outFd = 0;
- if (outEvents != NULL) *outEvents = NULL;
- if (outData != NULL) *outData = NULL;
- return result;
- }
-
- result = pollInner(timeoutMillis);
- }
-}
-
-int Looper::pollInner(int timeoutMillis) {
-#if DEBUG_POLL_AND_WAKE
- ALOGD("%p ~ pollOnce - waiting: timeoutMillis=%d", this, timeoutMillis);
-#endif
-
- // Adjust the timeout based on when the next message is due.
- if (timeoutMillis != 0 && mNextMessageUptime != LLONG_MAX) {
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- int messageTimeoutMillis = toMillisecondTimeoutDelay(now, mNextMessageUptime);
- if (messageTimeoutMillis >= 0
- && (timeoutMillis < 0 || messageTimeoutMillis < timeoutMillis)) {
- timeoutMillis = messageTimeoutMillis;
- }
-#if DEBUG_POLL_AND_WAKE
- ALOGD("%p ~ pollOnce - next message in %lldns, adjusted timeout: timeoutMillis=%d",
- this, mNextMessageUptime - now, timeoutMillis);
-#endif
- }
-
- // Poll.
- int result = ALOOPER_POLL_WAKE;
- mResponses.clear();
- mResponseIndex = 0;
-
-#ifdef LOOPER_STATISTICS
- nsecs_t pollStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-#endif
-
-#ifdef LOOPER_USES_EPOLL
- struct epoll_event eventItems[EPOLL_MAX_EVENTS];
- int eventCount = epoll_wait(mEpollFd, eventItems, EPOLL_MAX_EVENTS, timeoutMillis);
-#else
- // Wait for wakeAndLock() waiters to run then set mPolling to true.
- mLock.lock();
- while (mWaiters != 0) {
- mResume.wait(mLock);
- }
- mPolling = true;
- mLock.unlock();
-
- size_t requestedCount = mRequestedFds.size();
- int eventCount = poll(mRequestedFds.editArray(), requestedCount, timeoutMillis);
-#endif
-
- // Acquire lock.
- mLock.lock();
-
- // Check for poll error.
- if (eventCount < 0) {
- if (errno == EINTR) {
- goto Done;
- }
- ALOGW("Poll failed with an unexpected error, errno=%d", errno);
- result = ALOOPER_POLL_ERROR;
- goto Done;
- }
-
- // Check for poll timeout.
- if (eventCount == 0) {
-#if DEBUG_POLL_AND_WAKE
- ALOGD("%p ~ pollOnce - timeout", this);
-#endif
- result = ALOOPER_POLL_TIMEOUT;
- goto Done;
- }
-
- // Handle all events.
-#if DEBUG_POLL_AND_WAKE
- ALOGD("%p ~ pollOnce - handling events from %d fds", this, eventCount);
-#endif
-
-#ifdef LOOPER_USES_EPOLL
- for (int i = 0; i < eventCount; i++) {
- int fd = eventItems[i].data.fd;
- uint32_t epollEvents = eventItems[i].events;
- if (fd == mWakeReadPipeFd) {
- if (epollEvents & EPOLLIN) {
- awoken();
- } else {
- ALOGW("Ignoring unexpected epoll events 0x%x on wake read pipe.", epollEvents);
- }
- } else {
- ssize_t requestIndex = mRequests.indexOfKey(fd);
- if (requestIndex >= 0) {
- int events = 0;
- if (epollEvents & EPOLLIN) events |= ALOOPER_EVENT_INPUT;
- if (epollEvents & EPOLLOUT) events |= ALOOPER_EVENT_OUTPUT;
- if (epollEvents & EPOLLERR) events |= ALOOPER_EVENT_ERROR;
- if (epollEvents & EPOLLHUP) events |= ALOOPER_EVENT_HANGUP;
- pushResponse(events, mRequests.valueAt(requestIndex));
- } else {
- ALOGW("Ignoring unexpected epoll events 0x%x on fd %d that is "
- "no longer registered.", epollEvents, fd);
- }
- }
- }
-Done: ;
-#else
- for (size_t i = 0; i < requestedCount; i++) {
- const struct pollfd& requestedFd = mRequestedFds.itemAt(i);
-
- short pollEvents = requestedFd.revents;
- if (pollEvents) {
- if (requestedFd.fd == mWakeReadPipeFd) {
- if (pollEvents & POLLIN) {
- awoken();
- } else {
- ALOGW("Ignoring unexpected poll events 0x%x on wake read pipe.", pollEvents);
- }
- } else {
- int events = 0;
- if (pollEvents & POLLIN) events |= ALOOPER_EVENT_INPUT;
- if (pollEvents & POLLOUT) events |= ALOOPER_EVENT_OUTPUT;
- if (pollEvents & POLLERR) events |= ALOOPER_EVENT_ERROR;
- if (pollEvents & POLLHUP) events |= ALOOPER_EVENT_HANGUP;
- if (pollEvents & POLLNVAL) events |= ALOOPER_EVENT_INVALID;
- pushResponse(events, mRequests.itemAt(i));
- }
- if (--eventCount == 0) {
- break;
- }
- }
- }
-Done:
- // Set mPolling to false and wake up the wakeAndLock() waiters.
- mPolling = false;
- if (mWaiters != 0) {
- mAwake.broadcast();
- }
-#endif
-
-#ifdef LOOPER_STATISTICS
- nsecs_t pollEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
- mSampledPolls += 1;
- if (timeoutMillis == 0) {
- mSampledZeroPollCount += 1;
- mSampledZeroPollLatencySum += pollEndTime - pollStartTime;
- } else if (timeoutMillis > 0 && result == ALOOPER_POLL_TIMEOUT) {
- mSampledTimeoutPollCount += 1;
- mSampledTimeoutPollLatencySum += pollEndTime - pollStartTime
- - milliseconds_to_nanoseconds(timeoutMillis);
- }
- if (mSampledPolls == SAMPLED_POLLS_TO_AGGREGATE) {
- ALOGD("%p ~ poll latency statistics: %0.3fms zero timeout, %0.3fms non-zero timeout", this,
- 0.000001f * float(mSampledZeroPollLatencySum) / mSampledZeroPollCount,
- 0.000001f * float(mSampledTimeoutPollLatencySum) / mSampledTimeoutPollCount);
- mSampledPolls = 0;
- mSampledZeroPollCount = 0;
- mSampledZeroPollLatencySum = 0;
- mSampledTimeoutPollCount = 0;
- mSampledTimeoutPollLatencySum = 0;
- }
-#endif
-
- // Invoke pending message callbacks.
- mNextMessageUptime = LLONG_MAX;
- while (mMessageEnvelopes.size() != 0) {
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- const MessageEnvelope& messageEnvelope = mMessageEnvelopes.itemAt(0);
- if (messageEnvelope.uptime <= now) {
- // Remove the envelope from the list.
- // We keep a strong reference to the handler until the call to handleMessage
- // finishes. Then we drop it so that the handler can be deleted *before*
- // we reacquire our lock.
- { // obtain handler
- sp<MessageHandler> handler = messageEnvelope.handler;
- Message message = messageEnvelope.message;
- mMessageEnvelopes.removeAt(0);
- mSendingMessage = true;
- mLock.unlock();
-
-#if DEBUG_POLL_AND_WAKE || DEBUG_CALLBACKS
- ALOGD("%p ~ pollOnce - sending message: handler=%p, what=%d",
- this, handler.get(), message.what);
-#endif
- handler->handleMessage(message);
- } // release handler
-
- mLock.lock();
- mSendingMessage = false;
- result = ALOOPER_POLL_CALLBACK;
- } else {
- // The last message left at the head of the queue determines the next wakeup time.
- mNextMessageUptime = messageEnvelope.uptime;
- break;
- }
- }
-
- // Release lock.
- mLock.unlock();
-
- // Invoke all response callbacks.
- for (size_t i = 0; i < mResponses.size(); i++) {
- const Response& response = mResponses.itemAt(i);
- ALooper_callbackFunc callback = response.request.callback;
- if (callback) {
- int fd = response.request.fd;
- int events = response.events;
- void* data = response.request.data;
-#if DEBUG_POLL_AND_WAKE || DEBUG_CALLBACKS
- ALOGD("%p ~ pollOnce - invoking fd event callback %p: fd=%d, events=0x%x, data=%p",
- this, callback, fd, events, data);
-#endif
- int callbackResult = callback(fd, events, data);
- if (callbackResult == 0) {
- removeFd(fd);
- }
- result = ALOOPER_POLL_CALLBACK;
- }
- }
- return result;
-}
-
-int Looper::pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData) {
- if (timeoutMillis <= 0) {
- int result;
- do {
- result = pollOnce(timeoutMillis, outFd, outEvents, outData);
- } while (result == ALOOPER_POLL_CALLBACK);
- return result;
- } else {
- nsecs_t endTime = systemTime(SYSTEM_TIME_MONOTONIC)
- + milliseconds_to_nanoseconds(timeoutMillis);
-
- for (;;) {
- int result = pollOnce(timeoutMillis, outFd, outEvents, outData);
- if (result != ALOOPER_POLL_CALLBACK) {
- return result;
- }
-
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- timeoutMillis = toMillisecondTimeoutDelay(now, endTime);
- if (timeoutMillis == 0) {
- return ALOOPER_POLL_TIMEOUT;
- }
- }
- }
-}
-
-void Looper::wake() {
-#if DEBUG_POLL_AND_WAKE
- ALOGD("%p ~ wake", this);
-#endif
-
-#ifdef LOOPER_STATISTICS
- // FIXME: Possible race with awoken() but this code is for testing only and is rarely enabled.
- if (mPendingWakeCount++ == 0) {
- mPendingWakeTime = systemTime(SYSTEM_TIME_MONOTONIC);
- }
-#endif
-
- ssize_t nWrite;
- do {
- nWrite = write(mWakeWritePipeFd, "W", 1);
- } while (nWrite == -1 && errno == EINTR);
-
- if (nWrite != 1) {
- if (errno != EAGAIN) {
- ALOGW("Could not write wake signal, errno=%d", errno);
- }
- }
-}
-
-void Looper::awoken() {
-#if DEBUG_POLL_AND_WAKE
- ALOGD("%p ~ awoken", this);
-#endif
-
-#ifdef LOOPER_STATISTICS
- if (mPendingWakeCount == 0) {
- ALOGD("%p ~ awoken: spurious!", this);
- } else {
- mSampledWakeCycles += 1;
- mSampledWakeCountSum += mPendingWakeCount;
- mSampledWakeLatencySum += systemTime(SYSTEM_TIME_MONOTONIC) - mPendingWakeTime;
- mPendingWakeCount = 0;
- mPendingWakeTime = -1;
- if (mSampledWakeCycles == SAMPLED_WAKE_CYCLES_TO_AGGREGATE) {
- ALOGD("%p ~ wake statistics: %0.3fms wake latency, %0.3f wakes per cycle", this,
- 0.000001f * float(mSampledWakeLatencySum) / mSampledWakeCycles,
- float(mSampledWakeCountSum) / mSampledWakeCycles);
- mSampledWakeCycles = 0;
- mSampledWakeCountSum = 0;
- mSampledWakeLatencySum = 0;
- }
- }
-#endif
-
- char buffer[16];
- ssize_t nRead;
- do {
- nRead = read(mWakeReadPipeFd, buffer, sizeof(buffer));
- } while ((nRead == -1 && errno == EINTR) || nRead == sizeof(buffer));
-}
-
-void Looper::pushResponse(int events, const Request& request) {
- Response response;
- response.events = events;
- response.request = request;
- mResponses.push(response);
-}
-
-int Looper::addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data) {
-#if DEBUG_CALLBACKS
- ALOGD("%p ~ addFd - fd=%d, ident=%d, events=0x%x, callback=%p, data=%p", this, fd, ident,
- events, callback, data);
-#endif
-
- if (! callback) {
- if (! mAllowNonCallbacks) {
- ALOGE("Invalid attempt to set NULL callback but not allowed for this looper.");
- return -1;
- }
-
- if (ident < 0) {
- ALOGE("Invalid attempt to set NULL callback with ident <= 0.");
- return -1;
- }
- }
-
-#ifdef LOOPER_USES_EPOLL
- int epollEvents = 0;
- if (events & ALOOPER_EVENT_INPUT) epollEvents |= EPOLLIN;
- if (events & ALOOPER_EVENT_OUTPUT) epollEvents |= EPOLLOUT;
-
- { // acquire lock
- AutoMutex _l(mLock);
-
- Request request;
- request.fd = fd;
- request.ident = ident;
- request.callback = callback;
- request.data = data;
-
- struct epoll_event eventItem;
- memset(& eventItem, 0, sizeof(epoll_event)); // zero out unused members of data field union
- eventItem.events = epollEvents;
- eventItem.data.fd = fd;
-
- ssize_t requestIndex = mRequests.indexOfKey(fd);
- if (requestIndex < 0) {
- int epollResult = epoll_ctl(mEpollFd, EPOLL_CTL_ADD, fd, & eventItem);
- if (epollResult < 0) {
- ALOGE("Error adding epoll events for fd %d, errno=%d", fd, errno);
- return -1;
- }
- mRequests.add(fd, request);
- } else {
- int epollResult = epoll_ctl(mEpollFd, EPOLL_CTL_MOD, fd, & eventItem);
- if (epollResult < 0) {
- ALOGE("Error modifying epoll events for fd %d, errno=%d", fd, errno);
- return -1;
- }
- mRequests.replaceValueAt(requestIndex, request);
- }
- } // release lock
-#else
- int pollEvents = 0;
- if (events & ALOOPER_EVENT_INPUT) pollEvents |= POLLIN;
- if (events & ALOOPER_EVENT_OUTPUT) pollEvents |= POLLOUT;
-
- wakeAndLock(); // acquire lock
-
- struct pollfd requestedFd;
- requestedFd.fd = fd;
- requestedFd.events = pollEvents;
-
- Request request;
- request.fd = fd;
- request.ident = ident;
- request.callback = callback;
- request.data = data;
- ssize_t index = getRequestIndexLocked(fd);
- if (index < 0) {
- mRequestedFds.push(requestedFd);
- mRequests.push(request);
- } else {
- mRequestedFds.replaceAt(requestedFd, size_t(index));
- mRequests.replaceAt(request, size_t(index));
- }
-
- mLock.unlock(); // release lock
-#endif
- return 1;
-}
-
-int Looper::removeFd(int fd) {
-#if DEBUG_CALLBACKS
- ALOGD("%p ~ removeFd - fd=%d", this, fd);
-#endif
-
-#ifdef LOOPER_USES_EPOLL
- { // acquire lock
- AutoMutex _l(mLock);
- ssize_t requestIndex = mRequests.indexOfKey(fd);
- if (requestIndex < 0) {
- return 0;
- }
-
- int epollResult = epoll_ctl(mEpollFd, EPOLL_CTL_DEL, fd, NULL);
- if (epollResult < 0) {
- ALOGE("Error removing epoll events for fd %d, errno=%d", fd, errno);
- return -1;
- }
-
- mRequests.removeItemsAt(requestIndex);
- } // release lock
- return 1;
-#else
- wakeAndLock(); // acquire lock
-
- ssize_t index = getRequestIndexLocked(fd);
- if (index >= 0) {
- mRequestedFds.removeAt(size_t(index));
- mRequests.removeAt(size_t(index));
- }
-
- mLock.unlock(); // release lock
- return index >= 0;
-#endif
-}
-
-#ifndef LOOPER_USES_EPOLL
-ssize_t Looper::getRequestIndexLocked(int fd) {
- size_t requestCount = mRequestedFds.size();
-
- for (size_t i = 0; i < requestCount; i++) {
- if (mRequestedFds.itemAt(i).fd == fd) {
- return i;
- }
- }
-
- return -1;
-}
-
-void Looper::wakeAndLock() {
- mLock.lock();
-
- mWaiters += 1;
- while (mPolling) {
- wake();
- mAwake.wait(mLock);
- }
-
- mWaiters -= 1;
- if (mWaiters == 0) {
- mResume.signal();
- }
-}
-#endif
-
-void Looper::sendMessage(const sp<MessageHandler>& handler, const Message& message) {
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- sendMessageAtTime(now, handler, message);
-}
-
-void Looper::sendMessageDelayed(nsecs_t uptimeDelay, const sp<MessageHandler>& handler,
- const Message& message) {
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- sendMessageAtTime(now + uptimeDelay, handler, message);
-}
-
-void Looper::sendMessageAtTime(nsecs_t uptime, const sp<MessageHandler>& handler,
- const Message& message) {
-#if DEBUG_CALLBACKS
- ALOGD("%p ~ sendMessageAtTime - uptime=%lld, handler=%p, what=%d",
- this, uptime, handler.get(), message.what);
-#endif
-
- size_t i = 0;
- { // acquire lock
- AutoMutex _l(mLock);
-
- size_t messageCount = mMessageEnvelopes.size();
- while (i < messageCount && uptime >= mMessageEnvelopes.itemAt(i).uptime) {
- i += 1;
- }
-
- MessageEnvelope messageEnvelope(uptime, handler, message);
- mMessageEnvelopes.insertAt(messageEnvelope, i, 1);
-
- // Optimization: If the Looper is currently sending a message, then we can skip
- // the call to wake() because the next thing the Looper will do after processing
- // messages is to decide when the next wakeup time should be. In fact, it does
- // not even matter whether this code is running on the Looper thread.
- if (mSendingMessage) {
- return;
- }
- } // release lock
-
- // Wake the poll loop only when we enqueue a new message at the head.
- if (i == 0) {
- wake();
- }
-}
-
-void Looper::removeMessages(const sp<MessageHandler>& handler) {
-#if DEBUG_CALLBACKS
- ALOGD("%p ~ removeMessages - handler=%p", this, handler.get());
-#endif
-
- { // acquire lock
- AutoMutex _l(mLock);
-
- for (size_t i = mMessageEnvelopes.size(); i != 0; ) {
- const MessageEnvelope& messageEnvelope = mMessageEnvelopes.itemAt(--i);
- if (messageEnvelope.handler == handler) {
- mMessageEnvelopes.removeAt(i);
- }
- }
- } // release lock
-}
-
-void Looper::removeMessages(const sp<MessageHandler>& handler, int what) {
-#if DEBUG_CALLBACKS
- ALOGD("%p ~ removeMessages - handler=%p, what=%d", this, handler.get(), what);
-#endif
-
- { // acquire lock
- AutoMutex _l(mLock);
-
- for (size_t i = mMessageEnvelopes.size(); i != 0; ) {
- const MessageEnvelope& messageEnvelope = mMessageEnvelopes.itemAt(--i);
- if (messageEnvelope.handler == handler
- && messageEnvelope.message.what == what) {
- mMessageEnvelopes.removeAt(i);
- }
- }
- } // release lock
-}
-
-} // namespace android
diff --git a/libs/utils/MODULE_LICENSE_APACHE2 b/libs/utils/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/libs/utils/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/libs/utils/NOTICE b/libs/utils/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/libs/utils/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
- Copyright (c) 2005-2008, 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.
-
- 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.
-
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
diff --git a/libs/utils/PropertyMap.cpp b/libs/utils/PropertyMap.cpp
deleted file mode 100644
index 5520702..0000000
--- a/libs/utils/PropertyMap.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#define LOG_TAG "PropertyMap"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <utils/PropertyMap.h>
-#include <utils/Log.h>
-
-// Enables debug output for the parser.
-#define DEBUG_PARSER 0
-
-// Enables debug output for parser performance.
-#define DEBUG_PARSER_PERFORMANCE 0
-
-
-namespace android {
-
-static const char* WHITESPACE = " \t\r";
-static const char* WHITESPACE_OR_PROPERTY_DELIMITER = " \t\r=";
-
-
-// --- PropertyMap ---
-
-PropertyMap::PropertyMap() {
-}
-
-PropertyMap::~PropertyMap() {
-}
-
-void PropertyMap::clear() {
- mProperties.clear();
-}
-
-void PropertyMap::addProperty(const String8& key, const String8& value) {
- mProperties.add(key, value);
-}
-
-bool PropertyMap::hasProperty(const String8& key) const {
- return mProperties.indexOfKey(key) >= 0;
-}
-
-bool PropertyMap::tryGetProperty(const String8& key, String8& outValue) const {
- ssize_t index = mProperties.indexOfKey(key);
- if (index < 0) {
- return false;
- }
-
- outValue = mProperties.valueAt(index);
- return true;
-}
-
-bool PropertyMap::tryGetProperty(const String8& key, bool& outValue) const {
- int32_t intValue;
- if (!tryGetProperty(key, intValue)) {
- return false;
- }
-
- outValue = intValue;
- return true;
-}
-
-bool PropertyMap::tryGetProperty(const String8& key, int32_t& outValue) const {
- String8 stringValue;
- if (! tryGetProperty(key, stringValue) || stringValue.length() == 0) {
- return false;
- }
-
- char* end;
- int value = strtol(stringValue.string(), & end, 10);
- if (*end != '\0') {
- ALOGW("Property key '%s' has invalid value '%s'. Expected an integer.",
- key.string(), stringValue.string());
- return false;
- }
- outValue = value;
- return true;
-}
-
-bool PropertyMap::tryGetProperty(const String8& key, float& outValue) const {
- String8 stringValue;
- if (! tryGetProperty(key, stringValue) || stringValue.length() == 0) {
- return false;
- }
-
- char* end;
- float value = strtof(stringValue.string(), & end);
- if (*end != '\0') {
- ALOGW("Property key '%s' has invalid value '%s'. Expected a float.",
- key.string(), stringValue.string());
- return false;
- }
- outValue = value;
- return true;
-}
-
-void PropertyMap::addAll(const PropertyMap* map) {
- for (size_t i = 0; i < map->mProperties.size(); i++) {
- mProperties.add(map->mProperties.keyAt(i), map->mProperties.valueAt(i));
- }
-}
-
-status_t PropertyMap::load(const String8& filename, PropertyMap** outMap) {
- *outMap = NULL;
-
- Tokenizer* tokenizer;
- status_t status = Tokenizer::open(filename, &tokenizer);
- if (status) {
- ALOGE("Error %d opening property file %s.", status, filename.string());
- } else {
- PropertyMap* map = new PropertyMap();
- if (!map) {
- ALOGE("Error allocating property map.");
- status = NO_MEMORY;
- } else {
-#if DEBUG_PARSER_PERFORMANCE
- nsecs_t startTime = systemTime(SYSTEM_TIME_MONOTONIC);
-#endif
- Parser parser(map, tokenizer);
- status = parser.parse();
-#if DEBUG_PARSER_PERFORMANCE
- nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
- ALOGD("Parsed property file '%s' %d lines in %0.3fms.",
- tokenizer->getFilename().string(), tokenizer->getLineNumber(),
- elapsedTime / 1000000.0);
-#endif
- if (status) {
- delete map;
- } else {
- *outMap = map;
- }
- }
- delete tokenizer;
- }
- return status;
-}
-
-
-// --- PropertyMap::Parser ---
-
-PropertyMap::Parser::Parser(PropertyMap* map, Tokenizer* tokenizer) :
- mMap(map), mTokenizer(tokenizer) {
-}
-
-PropertyMap::Parser::~Parser() {
-}
-
-status_t PropertyMap::Parser::parse() {
- while (!mTokenizer->isEof()) {
-#if DEBUG_PARSER
- ALOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(),
- mTokenizer->peekRemainderOfLine().string());
-#endif
-
- mTokenizer->skipDelimiters(WHITESPACE);
-
- if (!mTokenizer->isEol() && mTokenizer->peekChar() != '#') {
- String8 keyToken = mTokenizer->nextToken(WHITESPACE_OR_PROPERTY_DELIMITER);
- if (keyToken.isEmpty()) {
- ALOGE("%s: Expected non-empty property key.", mTokenizer->getLocation().string());
- return BAD_VALUE;
- }
-
- mTokenizer->skipDelimiters(WHITESPACE);
-
- if (mTokenizer->nextChar() != '=') {
- ALOGE("%s: Expected '=' between property key and value.",
- mTokenizer->getLocation().string());
- return BAD_VALUE;
- }
-
- mTokenizer->skipDelimiters(WHITESPACE);
-
- String8 valueToken = mTokenizer->nextToken(WHITESPACE);
- if (valueToken.find("\\", 0) >= 0 || valueToken.find("\"", 0) >= 0) {
- ALOGE("%s: Found reserved character '\\' or '\"' in property value.",
- mTokenizer->getLocation().string());
- return BAD_VALUE;
- }
-
- mTokenizer->skipDelimiters(WHITESPACE);
- if (!mTokenizer->isEol()) {
- ALOGE("%s: Expected end of line, got '%s'.",
- mTokenizer->getLocation().string(),
- mTokenizer->peekRemainderOfLine().string());
- return BAD_VALUE;
- }
-
- if (mMap->hasProperty(keyToken)) {
- ALOGE("%s: Duplicate property value for key '%s'.",
- mTokenizer->getLocation().string(), keyToken.string());
- return BAD_VALUE;
- }
-
- mMap->addProperty(keyToken, valueToken);
- }
-
- mTokenizer->nextLine();
- }
- return NO_ERROR;
-}
-
-} // namespace android
diff --git a/libs/utils/README b/libs/utils/README
deleted file mode 100644
index 01741e0..0000000
--- a/libs/utils/README
+++ /dev/null
@@ -1,289 +0,0 @@
-Android Utility Function Library
-================================
-
-
-If you need a feature that is native to Linux but not present on other
-platforms, construct a platform-dependent implementation that shares
-the Linux interface. That way the actual device runs as "light" as
-possible.
-
-If that isn't feasible, create a system-independent interface and hide
-the details.
-
-The ultimate goal is *not* to create a super-duper platform abstraction
-layer. The goal is to provide an optimized solution for Linux with
-reasonable implementations for other platforms.
-
-
-
-Resource overlay
-================
-
-
-Introduction
-------------
-
-Overlay packages are special .apk files which provide no code but
-additional resource values (and possibly new configurations) for
-resources in other packages. When an application requests resources,
-the system will return values from either the application's original
-package or any associated overlay package. Any redirection is completely
-transparent to the calling application.
-
-Resource values have the following precedence table, listed in
-descending precedence.
-
- * overlay package, matching config (eg res/values-en-land)
-
- * original package, matching config
-
- * overlay package, no config (eg res/values)
-
- * original package, no config
-
-During compilation, overlay packages are differentiated from regular
-packages by passing the -o flag to aapt.
-
-
-Background
-----------
-
-This section provides generic background material on resources in
-Android.
-
-
-How resources are bundled in .apk files
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Android .apk files are .zip files, usually housing .dex code,
-certificates and resources, though packages containing resources but
-no code are possible. Resources can be divided into the following
-categories; a `configuration' indicates a set of phone language, display
-density, network operator, etc.
-
- * assets: uncompressed, raw files packaged as part of an .apk and
- explicitly referenced by filename. These files are
- independent of configuration.
-
- * res/drawable: bitmap or xml graphics. Each file may have different
- values depending on configuration.
-
- * res/values: integers, strings, etc. Each resource may have different
- values depending on configuration.
-
-Resource meta information and information proper is stored in a binary
-format in a named file resources.arsc, bundled as part of the .apk.
-
-Resource IDs and lookup
-~~~~~~~~~~~~~~~~~~~~~~~
-During compilation, the aapt tool gathers application resources and
-generates a resources.arsc file. Each resource name is assigned an
-integer ID 0xppttiii (translated to a symbolic name via R.java), where
-
- * pp: corresponds to the package namespace (details below).
-
- * tt: corresponds to the resource type (string, int, etc). Every
- resource of the same type within the same package has the same
- tt value, but depending on available types, the actual numerical
- value may be different between packages.
-
- * iiii: sequential number, assigned in the order resources are found.
-
-Resource values are specified paired with a set of configuration
-constraints (the default being the empty set), eg res/values-sv-port
-which imposes restrictions on language (Swedish) and display orientation
-(portrait). During lookup, every constraint set is matched against the
-current configuration, and the value corresponding to the best matching
-constraint set is returned (ResourceTypes.{h,cpp}).
-
-Parsing of resources.arsc is handled by ResourceTypes.cpp; this utility
-is governed by AssetManager.cpp, which tracks loaded resources per
-process.
-
-Assets are looked up by path and filename in AssetManager.cpp. The path
-to resources in res/drawable are located by ResourceTypes.cpp and then
-handled like assets by AssetManager.cpp. Other resources are handled
-solely by ResourceTypes.cpp.
-
-Package ID as namespace
-~~~~~~~~~~~~~~~~~~~~~~~
-The pp part of a resource ID defines a namespace. Android currently
-defines two namespaces:
-
- * 0x01: system resources (pre-installed in framework-res.apk)
-
- * 0x7f: application resources (bundled in the application .apk)
-
-ResourceTypes.cpp supports package IDs between 0x01 and 0x7f
-(inclusive); values outside this range are invalid.
-
-Each running (Dalvik) process is assigned a unique instance of
-AssetManager, which in turn keeps a forest structure of loaded
-resource.arsc files. Normally, this forest is structured as follows,
-where mPackageMap is the internal vector employed in ResourceTypes.cpp.
-
-mPackageMap[0x00] -> system package
-mPackageMap[0x01] -> NULL
-mPackageMap[0x02] -> NULL
-...
-mPackageMap[0x7f - 2] -> NULL
-mPackageMap[0x7f - 1] -> application package
-
-
-
-The resource overlay extension
-------------------------------
-
-The resource overlay mechanism aims to (partly) shadow and extend
-existing resources with new values for defined and new configurations.
-Technically, this is achieved by adding resource-only packages (called
-overlay packages) to existing resource namespaces, like so:
-
-mPackageMap[0x00] -> system package -> system overlay package
-mPackageMap[0x01] -> NULL
-mPackageMap[0x02] -> NULL
-...
-mPackageMap[0x7f - 2] -> NULL
-mPackageMap[0x7f - 1] -> application package -> overlay 1 -> overlay 2
-
-The use of overlay resources is completely transparent to
-applications; no additional resource identifiers are introduced, only
-configuration/value pairs. Any number of overlay packages may be loaded
-at a time; overlay packages are agnostic to what they target -- both
-system and application resources are fair game.
-
-The package targeted by an overlay package is called the target or
-original package.
-
-Resource overlay operates on symbolic resources names. Hence, to
-override the string/str1 resources in a package, the overlay package
-would include a resource also named string/str1. The end user does not
-have to worry about the numeric resources IDs assigned by aapt, as this
-is resolved automatically by the system.
-
-As of this writing, the use of resource overlay has not been fully
-explored. Until it has, only OEMs are trusted to use resource overlay.
-For this reason, overlay packages must reside in /system/overlay.
-
-
-Resource ID mapping
-~~~~~~~~~~~~~~~~~~~
-Resource identifiers must be coherent within the same namespace (ie
-PackageGroup in ResourceTypes.cpp). Calling applications will refer to
-resources using the IDs defined in the original package, but there is no
-guarantee aapt has assigned the same ID to the corresponding resource in
-an overlay package. To translate between the two, a resource ID mapping
-{original ID -> overlay ID} is created during package installation
-(PackageManagerService.java) and used during resource lookup. The
-mapping is stored in /data/resource-cache, with a @idmap file name
-suffix.
-
-The idmap file format is documented in a separate section, below.
-
-
-Package management
-~~~~~~~~~~~~~~~~~~
-Packages are managed by the PackageManagerService. Addition and removal
-of packages are monitored via the inotify framework, exposed via
-android.os.FileObserver.
-
-During initialization of a Dalvik process, ActivityThread.java requests
-the process' AssetManager (by proxy, via AssetManager.java and JNI)
-to load a list of packages. This list includes overlay packages, if
-present.
-
-When a target package or a corresponding overlay package is installed,
-the target package's process is stopped and a new idmap is generated.
-This is similar to how applications are stopped when their packages are
-upgraded.
-
-
-Creating overlay packages
--------------------------
-
-Overlay packages should contain no code, define (some) resources with
-the same type and name as in the original package, and be compiled with
-the -o flag passed to aapt.
-
-The aapt -o flag instructs aapt to create an overlay package.
-Technically, this means the package will be assigned package id 0x00.
-
-There are no restrictions on overlay packages names, though the naming
-convention <original.package.name>.overlay.<name> is recommended.
-
-
-Example overlay package
-~~~~~~~~~~~~~~~~~~~~~~~
-
-To overlay the resource bool/b in package com.foo.bar, to be applied
-when the display is in landscape mode, create a new package with
-no source code and a single .xml file under res/values-land, with
-an entry for bool/b. Compile with aapt -o and place the results in
-/system/overlay by adding the following to Android.mk:
-
-LOCAL_AAPT_FLAGS := -o com.foo.bar
-LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
-
-
-The ID map (idmap) file format
-------------------------------
-
-The idmap format is designed for lookup performance. However, leading
-and trailing undefined overlay values are discarded to reduce the memory
-footprint.
-
-
-idmap grammar
-~~~~~~~~~~~~~
-All atoms (names in square brackets) are uint32_t integers. The
-idmap-magic constant spells "idmp" in ASCII. Offsets are given relative
-to the data_header, not to the beginning of the file.
-
-map := header data
-header := idmap-magic <crc32-original-pkg> <crc32-overlay-pkg>
-idmap-magic := <0x706d6469>
-data := data_header type_block+
-data_header := <m> header_block{m}
-header_block := <0> | <type_block_offset>
-type_block := <n> <id_offset> entry{n}
-entry := <resource_id_in_target_package>
-
-
-idmap example
-~~~~~~~~~~~~~
-Given a pair of target and overlay packages with CRC sums 0x216a8fe2
-and 0x6b9beaec, each defining the following resources
-
-Name Target package Overlay package
-string/str0 0x7f010000 -
-string/str1 0x7f010001 0x7f010000
-string/str2 0x7f010002 -
-string/str3 0x7f010003 0x7f010001
-string/str4 0x7f010004 -
-bool/bool0 0x7f020000 -
-integer/int0 0x7f030000 0x7f020000
-integer/int1 0x7f030001 -
-
-the corresponding resource map is
-
-0x706d6469 0x216a8fe2 0x6b9beaec 0x00000003 \
-0x00000004 0x00000000 0x00000009 0x00000003 \
-0x00000001 0x7f010000 0x00000000 0x7f010001 \
-0x00000001 0x00000000 0x7f020000
-
-or, formatted differently
-
-0x706d6469 # magic: all idmap files begin with this constant
-0x216a8fe2 # CRC32 of the resources.arsc file in the original package
-0x6b9beaec # CRC32 of the resources.arsc file in the overlay package
-0x00000003 # header; three types (string, bool, integer) in the target package
-0x00000004 # header_block for type 0 (string) is located at offset 4
-0x00000000 # no bool type exists in overlay package -> no header_block
-0x00000009 # header_block for type 2 (integer) is located at offset 9
-0x00000003 # header_block for string; overlay IDs span 3 elements
-0x00000001 # the first string in target package is entry 1 == offset
-0x7f010000 # target 0x7f01001 -> overlay 0x7f010000
-0x00000000 # str2 not defined in overlay package
-0x7f010001 # target 0x7f010003 -> overlay 0x7f010001
-0x00000001 # header_block for integer; overlay IDs span 1 element
-0x00000000 # offset == 0
-0x7f020000 # target 0x7f030000 -> overlay 0x7f020000
diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp
deleted file mode 100644
index e80a795..0000000
--- a/libs/utils/RefBase.cpp
+++ /dev/null
@@ -1,628 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#define LOG_TAG "RefBase"
-
-#include <utils/RefBase.h>
-
-#include <utils/Atomic.h>
-#include <utils/CallStack.h>
-#include <utils/Log.h>
-#include <utils/threads.h>
-#include <utils/TextOutput.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <typeinfo>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-// compile with refcounting debugging enabled
-#define DEBUG_REFS 0
-#define DEBUG_REFS_FATAL_SANITY_CHECKS 0
-#define DEBUG_REFS_ENABLED_BY_DEFAULT 1
-#define DEBUG_REFS_CALLSTACK_ENABLED 1
-
-// log all reference counting operations
-#define PRINT_REFS 0
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-#define INITIAL_STRONG_VALUE (1<<28)
-
-// ---------------------------------------------------------------------------
-
-class RefBase::weakref_impl : public RefBase::weakref_type
-{
-public:
- volatile int32_t mStrong;
- volatile int32_t mWeak;
- RefBase* const mBase;
- volatile int32_t mFlags;
-
-#if !DEBUG_REFS
-
- weakref_impl(RefBase* base)
- : mStrong(INITIAL_STRONG_VALUE)
- , mWeak(0)
- , mBase(base)
- , mFlags(0)
- {
- }
-
- void addStrongRef(const void* /*id*/) { }
- void removeStrongRef(const void* /*id*/) { }
- void renameStrongRefId(const void* /*old_id*/, const void* /*new_id*/) { }
- void addWeakRef(const void* /*id*/) { }
- void removeWeakRef(const void* /*id*/) { }
- void renameWeakRefId(const void* /*old_id*/, const void* /*new_id*/) { }
- void printRefs() const { }
- void trackMe(bool, bool) { }
-
-#else
-
- weakref_impl(RefBase* base)
- : mStrong(INITIAL_STRONG_VALUE)
- , mWeak(0)
- , mBase(base)
- , mFlags(0)
- , mStrongRefs(NULL)
- , mWeakRefs(NULL)
- , mTrackEnabled(!!DEBUG_REFS_ENABLED_BY_DEFAULT)
- , mRetain(false)
- {
- }
-
- ~weakref_impl()
- {
- bool dumpStack = false;
- if (!mRetain && mStrongRefs != NULL) {
- dumpStack = true;
-#if DEBUG_REFS_FATAL_SANITY_CHECKS
- LOG_ALWAYS_FATAL("Strong references remain!");
-#else
- ALOGE("Strong references remain:");
-#endif
- ref_entry* refs = mStrongRefs;
- while (refs) {
- char inc = refs->ref >= 0 ? '+' : '-';
- ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
-#if DEBUG_REFS_CALLSTACK_ENABLED
- refs->stack.dump();
-#endif
- refs = refs->next;
- }
- }
-
- if (!mRetain && mWeakRefs != NULL) {
- dumpStack = true;
-#if DEBUG_REFS_FATAL_SANITY_CHECKS
- LOG_ALWAYS_FATAL("Weak references remain:");
-#else
- ALOGE("Weak references remain!");
-#endif
- ref_entry* refs = mWeakRefs;
- while (refs) {
- char inc = refs->ref >= 0 ? '+' : '-';
- ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
-#if DEBUG_REFS_CALLSTACK_ENABLED
- refs->stack.dump();
-#endif
- refs = refs->next;
- }
- }
- if (dumpStack) {
- ALOGE("above errors at:");
- CallStack stack;
- stack.update();
- stack.dump();
- }
- }
-
- void addStrongRef(const void* id) {
- //ALOGD_IF(mTrackEnabled,
- // "addStrongRef: RefBase=%p, id=%p", mBase, id);
- addRef(&mStrongRefs, id, mStrong);
- }
-
- void removeStrongRef(const void* id) {
- //ALOGD_IF(mTrackEnabled,
- // "removeStrongRef: RefBase=%p, id=%p", mBase, id);
- if (!mRetain) {
- removeRef(&mStrongRefs, id);
- } else {
- addRef(&mStrongRefs, id, -mStrong);
- }
- }
-
- void renameStrongRefId(const void* old_id, const void* new_id) {
- //ALOGD_IF(mTrackEnabled,
- // "renameStrongRefId: RefBase=%p, oid=%p, nid=%p",
- // mBase, old_id, new_id);
- renameRefsId(mStrongRefs, old_id, new_id);
- }
-
- void addWeakRef(const void* id) {
- addRef(&mWeakRefs, id, mWeak);
- }
-
- void removeWeakRef(const void* id) {
- if (!mRetain) {
- removeRef(&mWeakRefs, id);
- } else {
- addRef(&mWeakRefs, id, -mWeak);
- }
- }
-
- void renameWeakRefId(const void* old_id, const void* new_id) {
- renameRefsId(mWeakRefs, old_id, new_id);
- }
-
- void trackMe(bool track, bool retain)
- {
- mTrackEnabled = track;
- mRetain = retain;
- }
-
- void printRefs() const
- {
- String8 text;
-
- {
- Mutex::Autolock _l(mMutex);
- char buf[128];
- sprintf(buf, "Strong references on RefBase %p (weakref_type %p):\n", mBase, this);
- text.append(buf);
- printRefsLocked(&text, mStrongRefs);
- sprintf(buf, "Weak references on RefBase %p (weakref_type %p):\n", mBase, this);
- text.append(buf);
- printRefsLocked(&text, mWeakRefs);
- }
-
- {
- char name[100];
- snprintf(name, 100, "/data/%p.stack", this);
- int rc = open(name, O_RDWR | O_CREAT | O_APPEND);
- if (rc >= 0) {
- write(rc, text.string(), text.length());
- close(rc);
- ALOGD("STACK TRACE for %p saved in %s", this, name);
- }
- else ALOGE("FAILED TO PRINT STACK TRACE for %p in %s: %s", this,
- name, strerror(errno));
- }
- }
-
-private:
- struct ref_entry
- {
- ref_entry* next;
- const void* id;
-#if DEBUG_REFS_CALLSTACK_ENABLED
- CallStack stack;
-#endif
- int32_t ref;
- };
-
- void addRef(ref_entry** refs, const void* id, int32_t mRef)
- {
- if (mTrackEnabled) {
- AutoMutex _l(mMutex);
-
- ref_entry* ref = new ref_entry;
- // Reference count at the time of the snapshot, but before the
- // update. Positive value means we increment, negative--we
- // decrement the reference count.
- ref->ref = mRef;
- ref->id = id;
-#if DEBUG_REFS_CALLSTACK_ENABLED
- ref->stack.update(2);
-#endif
- ref->next = *refs;
- *refs = ref;
- }
- }
-
- void removeRef(ref_entry** refs, const void* id)
- {
- if (mTrackEnabled) {
- AutoMutex _l(mMutex);
-
- ref_entry* const head = *refs;
- ref_entry* ref = head;
- while (ref != NULL) {
- if (ref->id == id) {
- *refs = ref->next;
- delete ref;
- return;
- }
- refs = &ref->next;
- ref = *refs;
- }
-
-#if DEBUG_REFS_FATAL_SANITY_CHECKS
- LOG_ALWAYS_FATAL("RefBase: removing id %p on RefBase %p"
- "(weakref_type %p) that doesn't exist!",
- id, mBase, this);
-#endif
-
- ALOGE("RefBase: removing id %p on RefBase %p"
- "(weakref_type %p) that doesn't exist!",
- id, mBase, this);
-
- ref = head;
- while (ref) {
- char inc = ref->ref >= 0 ? '+' : '-';
- ALOGD("\t%c ID %p (ref %d):", inc, ref->id, ref->ref);
- ref = ref->next;
- }
-
- CallStack stack;
- stack.update();
- stack.dump();
- }
- }
-
- void renameRefsId(ref_entry* r, const void* old_id, const void* new_id)
- {
- if (mTrackEnabled) {
- AutoMutex _l(mMutex);
- ref_entry* ref = r;
- while (ref != NULL) {
- if (ref->id == old_id) {
- ref->id = new_id;
- }
- ref = ref->next;
- }
- }
- }
-
- void printRefsLocked(String8* out, const ref_entry* refs) const
- {
- char buf[128];
- while (refs) {
- char inc = refs->ref >= 0 ? '+' : '-';
- sprintf(buf, "\t%c ID %p (ref %d):\n",
- inc, refs->id, refs->ref);
- out->append(buf);
-#if DEBUG_REFS_CALLSTACK_ENABLED
- out->append(refs->stack.toString("\t\t"));
-#else
- out->append("\t\t(call stacks disabled)");
-#endif
- refs = refs->next;
- }
- }
-
- mutable Mutex mMutex;
- ref_entry* mStrongRefs;
- ref_entry* mWeakRefs;
-
- bool mTrackEnabled;
- // Collect stack traces on addref and removeref, instead of deleting the stack references
- // on removeref that match the address ones.
- bool mRetain;
-
-#endif
-};
-
-// ---------------------------------------------------------------------------
-
-void RefBase::incStrong(const void* id) const
-{
- weakref_impl* const refs = mRefs;
- refs->incWeak(id);
-
- refs->addStrongRef(id);
- const int32_t c = android_atomic_inc(&refs->mStrong);
- ALOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs);
-#if PRINT_REFS
- ALOGD("incStrong of %p from %p: cnt=%d\n", this, id, c);
-#endif
- if (c != INITIAL_STRONG_VALUE) {
- return;
- }
-
- android_atomic_add(-INITIAL_STRONG_VALUE, &refs->mStrong);
- refs->mBase->onFirstRef();
-}
-
-void RefBase::decStrong(const void* id) const
-{
- weakref_impl* const refs = mRefs;
- refs->removeStrongRef(id);
- const int32_t c = android_atomic_dec(&refs->mStrong);
-#if PRINT_REFS
- ALOGD("decStrong of %p from %p: cnt=%d\n", this, id, c);
-#endif
- ALOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs);
- if (c == 1) {
- refs->mBase->onLastStrongRef(id);
- if ((refs->mFlags&OBJECT_LIFETIME_MASK) == OBJECT_LIFETIME_STRONG) {
- delete this;
- }
- }
- refs->decWeak(id);
-}
-
-void RefBase::forceIncStrong(const void* id) const
-{
- weakref_impl* const refs = mRefs;
- refs->incWeak(id);
-
- refs->addStrongRef(id);
- const int32_t c = android_atomic_inc(&refs->mStrong);
- ALOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow",
- refs);
-#if PRINT_REFS
- ALOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c);
-#endif
-
- switch (c) {
- case INITIAL_STRONG_VALUE:
- android_atomic_add(-INITIAL_STRONG_VALUE, &refs->mStrong);
- // fall through...
- case 0:
- refs->mBase->onFirstRef();
- }
-}
-
-int32_t RefBase::getStrongCount() const
-{
- return mRefs->mStrong;
-}
-
-RefBase* RefBase::weakref_type::refBase() const
-{
- return static_cast<const weakref_impl*>(this)->mBase;
-}
-
-void RefBase::weakref_type::incWeak(const void* id)
-{
- weakref_impl* const impl = static_cast<weakref_impl*>(this);
- impl->addWeakRef(id);
- const int32_t c = android_atomic_inc(&impl->mWeak);
- ALOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this);
-}
-
-
-void RefBase::weakref_type::decWeak(const void* id)
-{
- weakref_impl* const impl = static_cast<weakref_impl*>(this);
- impl->removeWeakRef(id);
- const int32_t c = android_atomic_dec(&impl->mWeak);
- ALOG_ASSERT(c >= 1, "decWeak called on %p too many times", this);
- if (c != 1) return;
-
- if ((impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_STRONG) {
- // This is the regular lifetime case. The object is destroyed
- // when the last strong reference goes away. Since weakref_impl
- // outlive the object, it is not destroyed in the dtor, and
- // we'll have to do it here.
- if (impl->mStrong == INITIAL_STRONG_VALUE) {
- // Special case: we never had a strong reference, so we need to
- // destroy the object now.
- delete impl->mBase;
- } else {
- // ALOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase);
- delete impl;
- }
- } else {
- // less common case: lifetime is OBJECT_LIFETIME_{WEAK|FOREVER}
- impl->mBase->onLastWeakRef(id);
- if ((impl->mFlags&OBJECT_LIFETIME_MASK) == OBJECT_LIFETIME_WEAK) {
- // this is the OBJECT_LIFETIME_WEAK case. The last weak-reference
- // is gone, we can destroy the object.
- delete impl->mBase;
- }
- }
-}
-
-bool RefBase::weakref_type::attemptIncStrong(const void* id)
-{
- incWeak(id);
-
- weakref_impl* const impl = static_cast<weakref_impl*>(this);
-
- int32_t curCount = impl->mStrong;
- ALOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow",
- this);
- while (curCount > 0 && curCount != INITIAL_STRONG_VALUE) {
- if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mStrong) == 0) {
- break;
- }
- curCount = impl->mStrong;
- }
-
- if (curCount <= 0 || curCount == INITIAL_STRONG_VALUE) {
- bool allow;
- if (curCount == INITIAL_STRONG_VALUE) {
- // Attempting to acquire first strong reference... this is allowed
- // if the object does NOT have a longer lifetime (meaning the
- // implementation doesn't need to see this), or if the implementation
- // allows it to happen.
- allow = (impl->mFlags&OBJECT_LIFETIME_WEAK) != OBJECT_LIFETIME_WEAK
- || impl->mBase->onIncStrongAttempted(FIRST_INC_STRONG, id);
- } else {
- // Attempting to revive the object... this is allowed
- // if the object DOES have a longer lifetime (so we can safely
- // call the object with only a weak ref) and the implementation
- // allows it to happen.
- allow = (impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_WEAK
- && impl->mBase->onIncStrongAttempted(FIRST_INC_STRONG, id);
- }
- if (!allow) {
- decWeak(id);
- return false;
- }
- curCount = android_atomic_inc(&impl->mStrong);
-
- // If the strong reference count has already been incremented by
- // someone else, the implementor of onIncStrongAttempted() is holding
- // an unneeded reference. So call onLastStrongRef() here to remove it.
- // (No, this is not pretty.) Note that we MUST NOT do this if we
- // are in fact acquiring the first reference.
- if (curCount > 0 && curCount < INITIAL_STRONG_VALUE) {
- impl->mBase->onLastStrongRef(id);
- }
- }
-
- impl->addStrongRef(id);
-
-#if PRINT_REFS
- ALOGD("attemptIncStrong of %p from %p: cnt=%d\n", this, id, curCount);
-#endif
-
- if (curCount == INITIAL_STRONG_VALUE) {
- android_atomic_add(-INITIAL_STRONG_VALUE, &impl->mStrong);
- impl->mBase->onFirstRef();
- }
-
- return true;
-}
-
-bool RefBase::weakref_type::attemptIncWeak(const void* id)
-{
- weakref_impl* const impl = static_cast<weakref_impl*>(this);
-
- int32_t curCount = impl->mWeak;
- ALOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow",
- this);
- while (curCount > 0) {
- if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mWeak) == 0) {
- break;
- }
- curCount = impl->mWeak;
- }
-
- if (curCount > 0) {
- impl->addWeakRef(id);
- }
-
- return curCount > 0;
-}
-
-int32_t RefBase::weakref_type::getWeakCount() const
-{
- return static_cast<const weakref_impl*>(this)->mWeak;
-}
-
-void RefBase::weakref_type::printRefs() const
-{
- static_cast<const weakref_impl*>(this)->printRefs();
-}
-
-void RefBase::weakref_type::trackMe(bool enable, bool retain)
-{
- static_cast<weakref_impl*>(this)->trackMe(enable, retain);
-}
-
-RefBase::weakref_type* RefBase::createWeak(const void* id) const
-{
- mRefs->incWeak(id);
- return mRefs;
-}
-
-RefBase::weakref_type* RefBase::getWeakRefs() const
-{
- return mRefs;
-}
-
-RefBase::RefBase()
- : mRefs(new weakref_impl(this))
-{
-}
-
-RefBase::~RefBase()
-{
- if (mRefs->mStrong == INITIAL_STRONG_VALUE) {
- // we never acquired a strong (and/or weak) reference on this object.
- delete mRefs;
- } else {
- // life-time of this object is extended to WEAK or FOREVER, in
- // which case weakref_impl doesn't out-live the object and we
- // can free it now.
- if ((mRefs->mFlags & OBJECT_LIFETIME_MASK) != OBJECT_LIFETIME_STRONG) {
- // It's possible that the weak count is not 0 if the object
- // re-acquired a weak reference in its destructor
- if (mRefs->mWeak == 0) {
- delete mRefs;
- }
- }
- }
- // for debugging purposes, clear this.
- const_cast<weakref_impl*&>(mRefs) = NULL;
-}
-
-void RefBase::extendObjectLifetime(int32_t mode)
-{
- android_atomic_or(mode, &mRefs->mFlags);
-}
-
-void RefBase::onFirstRef()
-{
-}
-
-void RefBase::onLastStrongRef(const void* /*id*/)
-{
-}
-
-bool RefBase::onIncStrongAttempted(uint32_t flags, const void* id)
-{
- return (flags&FIRST_INC_STRONG) ? true : false;
-}
-
-void RefBase::onLastWeakRef(const void* /*id*/)
-{
-}
-
-// ---------------------------------------------------------------------------
-
-void RefBase::moveReferences(void* dst, void const* src, size_t n,
- const ReferenceConverterBase& caster)
-{
-#if DEBUG_REFS
- const size_t itemSize = caster.getReferenceTypeSize();
- for (size_t i=0 ; i<n ; i++) {
- void* d = reinterpret_cast<void *>(intptr_t(dst) + i*itemSize);
- void const* s = reinterpret_cast<void const*>(intptr_t(src) + i*itemSize);
- RefBase* ref(reinterpret_cast<RefBase*>(caster.getReferenceBase(d)));
- ref->mRefs->renameStrongRefId(s, d);
- ref->mRefs->renameWeakRefId(s, d);
- }
-#endif
-}
-
-// ---------------------------------------------------------------------------
-
-TextOutput& printStrongPointer(TextOutput& to, const void* val)
-{
- to << "sp<>(" << val << ")";
- return to;
-}
-
-TextOutput& printWeakPointer(TextOutput& to, const void* val)
-{
- to << "wp<>(" << val << ")";
- return to;
-}
-
-
-}; // namespace android
diff --git a/libs/utils/SharedBuffer.cpp b/libs/utils/SharedBuffer.cpp
deleted file mode 100644
index 3555fb7..0000000
--- a/libs/utils/SharedBuffer.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <utils/SharedBuffer.h>
-#include <utils/Atomic.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-SharedBuffer* SharedBuffer::alloc(size_t size)
-{
- SharedBuffer* sb = static_cast<SharedBuffer *>(malloc(sizeof(SharedBuffer) + size));
- if (sb) {
- sb->mRefs = 1;
- sb->mSize = size;
- }
- return sb;
-}
-
-
-ssize_t SharedBuffer::dealloc(const SharedBuffer* released)
-{
- if (released->mRefs != 0) return -1; // XXX: invalid operation
- free(const_cast<SharedBuffer*>(released));
- return 0;
-}
-
-SharedBuffer* SharedBuffer::edit() const
-{
- if (onlyOwner()) {
- return const_cast<SharedBuffer*>(this);
- }
- SharedBuffer* sb = alloc(mSize);
- if (sb) {
- memcpy(sb->data(), data(), size());
- release();
- }
- return sb;
-}
-
-SharedBuffer* SharedBuffer::editResize(size_t newSize) const
-{
- if (onlyOwner()) {
- SharedBuffer* buf = const_cast<SharedBuffer*>(this);
- if (buf->mSize == newSize) return buf;
- buf = (SharedBuffer*)realloc(buf, sizeof(SharedBuffer) + newSize);
- if (buf != NULL) {
- buf->mSize = newSize;
- return buf;
- }
- }
- SharedBuffer* sb = alloc(newSize);
- if (sb) {
- const size_t mySize = mSize;
- memcpy(sb->data(), data(), newSize < mySize ? newSize : mySize);
- release();
- }
- return sb;
-}
-
-SharedBuffer* SharedBuffer::attemptEdit() const
-{
- if (onlyOwner()) {
- return const_cast<SharedBuffer*>(this);
- }
- return 0;
-}
-
-SharedBuffer* SharedBuffer::reset(size_t new_size) const
-{
- // cheap-o-reset.
- SharedBuffer* sb = alloc(new_size);
- if (sb) {
- release();
- }
- return sb;
-}
-
-void SharedBuffer::acquire() const {
- android_atomic_inc(&mRefs);
-}
-
-int32_t SharedBuffer::release(uint32_t flags) const
-{
- int32_t prev = 1;
- if (onlyOwner() || ((prev = android_atomic_dec(&mRefs)) == 1)) {
- mRefs = 0;
- if ((flags & eKeepStorage) == 0) {
- free(const_cast<SharedBuffer*>(this));
- }
- }
- return prev;
-}
-
-
-}; // namespace android
diff --git a/libs/utils/Static.cpp b/libs/utils/Static.cpp
deleted file mode 100644
index 624e917..0000000
--- a/libs/utils/Static.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-// All static variables go here, to control initialization and
-// destruction order in the library.
-
-#include <private/utils/Static.h>
-
-#include <utils/BufferedTextOutput.h>
-#include <utils/Log.h>
-
-namespace android {
-
-class LibUtilsFirstStatics
-{
-public:
- LibUtilsFirstStatics()
- {
- initialize_string8();
- initialize_string16();
- }
-
- ~LibUtilsFirstStatics()
- {
- terminate_string16();
- terminate_string8();
- }
-};
-
-static LibUtilsFirstStatics gFirstStatics;
-int gDarwinCantLoadAllObjects = 1;
-
-// ------------ Text output streams
-
-Vector<int32_t> gTextBuffers;
-
-class LogTextOutput : public BufferedTextOutput
-{
-public:
- LogTextOutput() : BufferedTextOutput(MULTITHREADED) { }
- virtual ~LogTextOutput() { };
-
-protected:
- virtual status_t writeLines(const struct iovec& vec, size_t N)
- {
- //android_writevLog(&vec, N); <-- this is now a no-op
- if (N != 1) ALOGI("WARNING: writeLines N=%zu\n", N);
- ALOGI("%.*s", (int)vec.iov_len, (const char*) vec.iov_base);
- return NO_ERROR;
- }
-};
-
-class FdTextOutput : public BufferedTextOutput
-{
-public:
- FdTextOutput(int fd) : BufferedTextOutput(MULTITHREADED), mFD(fd) { }
- virtual ~FdTextOutput() { };
-
-protected:
- virtual status_t writeLines(const struct iovec& vec, size_t N)
- {
- writev(mFD, &vec, N);
- return NO_ERROR;
- }
-
-private:
- int mFD;
-};
-
-static LogTextOutput gLogTextOutput;
-static FdTextOutput gStdoutTextOutput(STDOUT_FILENO);
-static FdTextOutput gStderrTextOutput(STDERR_FILENO);
-
-TextOutput& alog(gLogTextOutput);
-TextOutput& aout(gStdoutTextOutput);
-TextOutput& aerr(gStderrTextOutput);
-
-} // namespace android
diff --git a/libs/utils/StopWatch.cpp b/libs/utils/StopWatch.cpp
deleted file mode 100644
index b1708d62..0000000
--- a/libs/utils/StopWatch.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#define LOG_TAG "StopWatch"
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-/* for PRId64 */
-#define __STDC_FORMAT_MACROS 1
-#include <inttypes.h>
-
-#include <utils/Log.h>
-#include <utils/Errors.h>
-#include <utils/StopWatch.h>
-
-/*****************************************************************************/
-
-namespace android {
-
-
-StopWatch::StopWatch(const char *name, int clock, uint32_t flags)
- : mName(name), mClock(clock), mFlags(flags)
-{
- reset();
-}
-
-StopWatch::~StopWatch()
-{
- nsecs_t elapsed = elapsedTime();
- const int n = mNumLaps;
- ALOGD("StopWatch %s (us): %" PRId64 " ", mName, ns2us(elapsed));
- for (int i=0 ; i<n ; i++) {
- const nsecs_t soFar = mLaps[i].soFar;
- const nsecs_t thisLap = mLaps[i].thisLap;
- ALOGD(" [%d: %" PRId64 ", %" PRId64, i, ns2us(soFar), ns2us(thisLap));
- }
-}
-
-const char* StopWatch::name() const
-{
- return mName;
-}
-
-nsecs_t StopWatch::lap()
-{
- nsecs_t elapsed = elapsedTime();
- if (mNumLaps >= 8) {
- elapsed = 0;
- } else {
- const int n = mNumLaps;
- mLaps[n].soFar = elapsed;
- mLaps[n].thisLap = n ? (elapsed - mLaps[n-1].soFar) : elapsed;
- mNumLaps = n+1;
- }
- return elapsed;
-}
-
-nsecs_t StopWatch::elapsedTime() const
-{
- return systemTime(mClock) - mStartTime;
-}
-
-void StopWatch::reset()
-{
- mNumLaps = 0;
- mStartTime = systemTime(mClock);
-}
-
-
-/*****************************************************************************/
-
-}; // namespace android
-
diff --git a/libs/utils/String16.cpp b/libs/utils/String16.cpp
deleted file mode 100644
index 94e072f..0000000
--- a/libs/utils/String16.cpp
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#include <utils/String16.h>
-
-#include <utils/Debug.h>
-#include <utils/Log.h>
-#include <utils/Unicode.h>
-#include <utils/String8.h>
-#include <utils/TextOutput.h>
-#include <utils/threads.h>
-
-#include <private/utils/Static.h>
-
-#include <memory.h>
-#include <stdio.h>
-#include <ctype.h>
-
-
-namespace android {
-
-static SharedBuffer* gEmptyStringBuf = NULL;
-static char16_t* gEmptyString = NULL;
-
-static inline char16_t* getEmptyString()
-{
- gEmptyStringBuf->acquire();
- return gEmptyString;
-}
-
-void initialize_string16()
-{
- SharedBuffer* buf = SharedBuffer::alloc(sizeof(char16_t));
- char16_t* str = (char16_t*)buf->data();
- *str = 0;
- gEmptyStringBuf = buf;
- gEmptyString = str;
-}
-
-void terminate_string16()
-{
- SharedBuffer::bufferFromData(gEmptyString)->release();
- gEmptyStringBuf = NULL;
- gEmptyString = NULL;
-}
-
-// ---------------------------------------------------------------------------
-
-static char16_t* allocFromUTF8(const char* u8str, size_t u8len)
-{
- if (u8len == 0) return getEmptyString();
-
- const uint8_t* u8cur = (const uint8_t*) u8str;
-
- const ssize_t u16len = utf8_to_utf16_length(u8cur, u8len);
- if (u16len < 0) {
- return getEmptyString();
- }
-
- const uint8_t* const u8end = u8cur + u8len;
-
- SharedBuffer* buf = SharedBuffer::alloc(sizeof(char16_t)*(u16len+1));
- if (buf) {
- u8cur = (const uint8_t*) u8str;
- char16_t* u16str = (char16_t*)buf->data();
-
- utf8_to_utf16(u8cur, u8len, u16str);
-
- //printf("Created UTF-16 string from UTF-8 \"%s\":", in);
- //printHexData(1, str, buf->size(), 16, 1);
- //printf("\n");
-
- return u16str;
- }
-
- return getEmptyString();
-}
-
-// ---------------------------------------------------------------------------
-
-String16::String16()
- : mString(getEmptyString())
-{
-}
-
-String16::String16(const String16& o)
- : mString(o.mString)
-{
- SharedBuffer::bufferFromData(mString)->acquire();
-}
-
-String16::String16(const String16& o, size_t len, size_t begin)
- : mString(getEmptyString())
-{
- setTo(o, len, begin);
-}
-
-String16::String16(const char16_t* o)
-{
- size_t len = strlen16(o);
- SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t));
- ALOG_ASSERT(buf, "Unable to allocate shared buffer");
- if (buf) {
- char16_t* str = (char16_t*)buf->data();
- strcpy16(str, o);
- mString = str;
- return;
- }
-
- mString = getEmptyString();
-}
-
-String16::String16(const char16_t* o, size_t len)
-{
- SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t));
- ALOG_ASSERT(buf, "Unable to allocate shared buffer");
- if (buf) {
- char16_t* str = (char16_t*)buf->data();
- memcpy(str, o, len*sizeof(char16_t));
- str[len] = 0;
- mString = str;
- return;
- }
-
- mString = getEmptyString();
-}
-
-String16::String16(const String8& o)
- : mString(allocFromUTF8(o.string(), o.size()))
-{
-}
-
-String16::String16(const char* o)
- : mString(allocFromUTF8(o, strlen(o)))
-{
-}
-
-String16::String16(const char* o, size_t len)
- : mString(allocFromUTF8(o, len))
-{
-}
-
-String16::~String16()
-{
- SharedBuffer::bufferFromData(mString)->release();
-}
-
-void String16::setTo(const String16& other)
-{
- SharedBuffer::bufferFromData(other.mString)->acquire();
- SharedBuffer::bufferFromData(mString)->release();
- mString = other.mString;
-}
-
-status_t String16::setTo(const String16& other, size_t len, size_t begin)
-{
- const size_t N = other.size();
- if (begin >= N) {
- SharedBuffer::bufferFromData(mString)->release();
- mString = getEmptyString();
- return NO_ERROR;
- }
- if ((begin+len) > N) len = N-begin;
- if (begin == 0 && len == N) {
- setTo(other);
- return NO_ERROR;
- }
-
- if (&other == this) {
- LOG_ALWAYS_FATAL("Not implemented");
- }
-
- return setTo(other.string()+begin, len);
-}
-
-status_t String16::setTo(const char16_t* other)
-{
- return setTo(other, strlen16(other));
-}
-
-status_t String16::setTo(const char16_t* other, size_t len)
-{
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)
- ->editResize((len+1)*sizeof(char16_t));
- if (buf) {
- char16_t* str = (char16_t*)buf->data();
- memmove(str, other, len*sizeof(char16_t));
- str[len] = 0;
- mString = str;
- return NO_ERROR;
- }
- return NO_MEMORY;
-}
-
-status_t String16::append(const String16& other)
-{
- const size_t myLen = size();
- const size_t otherLen = other.size();
- if (myLen == 0) {
- setTo(other);
- return NO_ERROR;
- } else if (otherLen == 0) {
- return NO_ERROR;
- }
-
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)
- ->editResize((myLen+otherLen+1)*sizeof(char16_t));
- if (buf) {
- char16_t* str = (char16_t*)buf->data();
- memcpy(str+myLen, other, (otherLen+1)*sizeof(char16_t));
- mString = str;
- return NO_ERROR;
- }
- return NO_MEMORY;
-}
-
-status_t String16::append(const char16_t* chrs, size_t otherLen)
-{
- const size_t myLen = size();
- if (myLen == 0) {
- setTo(chrs, otherLen);
- return NO_ERROR;
- } else if (otherLen == 0) {
- return NO_ERROR;
- }
-
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)
- ->editResize((myLen+otherLen+1)*sizeof(char16_t));
- if (buf) {
- char16_t* str = (char16_t*)buf->data();
- memcpy(str+myLen, chrs, otherLen*sizeof(char16_t));
- str[myLen+otherLen] = 0;
- mString = str;
- return NO_ERROR;
- }
- return NO_MEMORY;
-}
-
-status_t String16::insert(size_t pos, const char16_t* chrs)
-{
- return insert(pos, chrs, strlen16(chrs));
-}
-
-status_t String16::insert(size_t pos, const char16_t* chrs, size_t len)
-{
- const size_t myLen = size();
- if (myLen == 0) {
- return setTo(chrs, len);
- return NO_ERROR;
- } else if (len == 0) {
- return NO_ERROR;
- }
-
- if (pos > myLen) pos = myLen;
-
- #if 0
- printf("Insert in to %s: pos=%d, len=%d, myLen=%d, chrs=%s\n",
- String8(*this).string(), pos,
- len, myLen, String8(chrs, len).string());
- #endif
-
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)
- ->editResize((myLen+len+1)*sizeof(char16_t));
- if (buf) {
- char16_t* str = (char16_t*)buf->data();
- if (pos < myLen) {
- memmove(str+pos+len, str+pos, (myLen-pos)*sizeof(char16_t));
- }
- memcpy(str+pos, chrs, len*sizeof(char16_t));
- str[myLen+len] = 0;
- mString = str;
- #if 0
- printf("Result (%d chrs): %s\n", size(), String8(*this).string());
- #endif
- return NO_ERROR;
- }
- return NO_MEMORY;
-}
-
-ssize_t String16::findFirst(char16_t c) const
-{
- const char16_t* str = string();
- const char16_t* p = str;
- const char16_t* e = p + size();
- while (p < e) {
- if (*p == c) {
- return p-str;
- }
- p++;
- }
- return -1;
-}
-
-ssize_t String16::findLast(char16_t c) const
-{
- const char16_t* str = string();
- const char16_t* p = str;
- const char16_t* e = p + size();
- while (p < e) {
- e--;
- if (*e == c) {
- return e-str;
- }
- }
- return -1;
-}
-
-bool String16::startsWith(const String16& prefix) const
-{
- const size_t ps = prefix.size();
- if (ps > size()) return false;
- return strzcmp16(mString, ps, prefix.string(), ps) == 0;
-}
-
-bool String16::startsWith(const char16_t* prefix) const
-{
- const size_t ps = strlen16(prefix);
- if (ps > size()) return false;
- return strncmp16(mString, prefix, ps) == 0;
-}
-
-status_t String16::makeLower()
-{
- const size_t N = size();
- const char16_t* str = string();
- char16_t* edit = NULL;
- for (size_t i=0; i<N; i++) {
- const char16_t v = str[i];
- if (v >= 'A' && v <= 'Z') {
- if (!edit) {
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)->edit();
- if (!buf) {
- return NO_MEMORY;
- }
- edit = (char16_t*)buf->data();
- mString = str = edit;
- }
- edit[i] = tolower((char)v);
- }
- }
- return NO_ERROR;
-}
-
-status_t String16::replaceAll(char16_t replaceThis, char16_t withThis)
-{
- const size_t N = size();
- const char16_t* str = string();
- char16_t* edit = NULL;
- for (size_t i=0; i<N; i++) {
- if (str[i] == replaceThis) {
- if (!edit) {
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)->edit();
- if (!buf) {
- return NO_MEMORY;
- }
- edit = (char16_t*)buf->data();
- mString = str = edit;
- }
- edit[i] = withThis;
- }
- }
- return NO_ERROR;
-}
-
-status_t String16::remove(size_t len, size_t begin)
-{
- const size_t N = size();
- if (begin >= N) {
- SharedBuffer::bufferFromData(mString)->release();
- mString = getEmptyString();
- return NO_ERROR;
- }
- if ((begin+len) > N) len = N-begin;
- if (begin == 0 && len == N) {
- return NO_ERROR;
- }
-
- if (begin > 0) {
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)
- ->editResize((N+1)*sizeof(char16_t));
- if (!buf) {
- return NO_MEMORY;
- }
- char16_t* str = (char16_t*)buf->data();
- memmove(str, str+begin, (N-begin+1)*sizeof(char16_t));
- mString = str;
- }
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)
- ->editResize((len+1)*sizeof(char16_t));
- if (buf) {
- char16_t* str = (char16_t*)buf->data();
- str[len] = 0;
- mString = str;
- return NO_ERROR;
- }
- return NO_MEMORY;
-}
-
-TextOutput& operator<<(TextOutput& to, const String16& val)
-{
- to << String8(val).string();
- return to;
-}
-
-}; // namespace android
diff --git a/libs/utils/String8.cpp b/libs/utils/String8.cpp
deleted file mode 100644
index 562f026..0000000
--- a/libs/utils/String8.cpp
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#include <utils/String8.h>
-
-#include <utils/Log.h>
-#include <utils/Unicode.h>
-#include <utils/SharedBuffer.h>
-#include <utils/String16.h>
-#include <utils/TextOutput.h>
-#include <utils/threads.h>
-
-#include <private/utils/Static.h>
-
-#include <ctype.h>
-
-/*
- * Functions outside android is below the namespace android, since they use
- * functions and constants in android namespace.
- */
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-// Separator used by resource paths. This is not platform dependent contrary
-// to OS_PATH_SEPARATOR.
-#define RES_PATH_SEPARATOR '/'
-
-static SharedBuffer* gEmptyStringBuf = NULL;
-static char* gEmptyString = NULL;
-
-extern int gDarwinCantLoadAllObjects;
-int gDarwinIsReallyAnnoying;
-
-static inline char* getEmptyString()
-{
- gEmptyStringBuf->acquire();
- return gEmptyString;
-}
-
-void initialize_string8()
-{
- // HACK: This dummy dependency forces linking libutils Static.cpp,
- // which is needed to initialize String8/String16 classes.
- // These variables are named for Darwin, but are needed elsewhere too,
- // including static linking on any platform.
- gDarwinIsReallyAnnoying = gDarwinCantLoadAllObjects;
-
- SharedBuffer* buf = SharedBuffer::alloc(1);
- char* str = (char*)buf->data();
- *str = 0;
- gEmptyStringBuf = buf;
- gEmptyString = str;
-}
-
-void terminate_string8()
-{
- SharedBuffer::bufferFromData(gEmptyString)->release();
- gEmptyStringBuf = NULL;
- gEmptyString = NULL;
-}
-
-// ---------------------------------------------------------------------------
-
-static char* allocFromUTF8(const char* in, size_t len)
-{
- if (len > 0) {
- SharedBuffer* buf = SharedBuffer::alloc(len+1);
- ALOG_ASSERT(buf, "Unable to allocate shared buffer");
- if (buf) {
- char* str = (char*)buf->data();
- memcpy(str, in, len);
- str[len] = 0;
- return str;
- }
- return NULL;
- }
-
- return getEmptyString();
-}
-
-static char* allocFromUTF16(const char16_t* in, size_t len)
-{
- if (len == 0) return getEmptyString();
-
- const ssize_t bytes = utf16_to_utf8_length(in, len);
- if (bytes < 0) {
- return getEmptyString();
- }
-
- SharedBuffer* buf = SharedBuffer::alloc(bytes+1);
- ALOG_ASSERT(buf, "Unable to allocate shared buffer");
- if (!buf) {
- return getEmptyString();
- }
-
- char* str = (char*)buf->data();
- utf16_to_utf8(in, len, str);
- return str;
-}
-
-static char* allocFromUTF32(const char32_t* in, size_t len)
-{
- if (len == 0) {
- return getEmptyString();
- }
-
- const ssize_t bytes = utf32_to_utf8_length(in, len);
- if (bytes < 0) {
- return getEmptyString();
- }
-
- SharedBuffer* buf = SharedBuffer::alloc(bytes+1);
- ALOG_ASSERT(buf, "Unable to allocate shared buffer");
- if (!buf) {
- return getEmptyString();
- }
-
- char* str = (char*) buf->data();
- utf32_to_utf8(in, len, str);
-
- return str;
-}
-
-// ---------------------------------------------------------------------------
-
-String8::String8()
- : mString(getEmptyString())
-{
-}
-
-String8::String8(const String8& o)
- : mString(o.mString)
-{
- SharedBuffer::bufferFromData(mString)->acquire();
-}
-
-String8::String8(const char* o)
- : mString(allocFromUTF8(o, strlen(o)))
-{
- if (mString == NULL) {
- mString = getEmptyString();
- }
-}
-
-String8::String8(const char* o, size_t len)
- : mString(allocFromUTF8(o, len))
-{
- if (mString == NULL) {
- mString = getEmptyString();
- }
-}
-
-String8::String8(const String16& o)
- : mString(allocFromUTF16(o.string(), o.size()))
-{
-}
-
-String8::String8(const char16_t* o)
- : mString(allocFromUTF16(o, strlen16(o)))
-{
-}
-
-String8::String8(const char16_t* o, size_t len)
- : mString(allocFromUTF16(o, len))
-{
-}
-
-String8::String8(const char32_t* o)
- : mString(allocFromUTF32(o, strlen32(o)))
-{
-}
-
-String8::String8(const char32_t* o, size_t len)
- : mString(allocFromUTF32(o, len))
-{
-}
-
-String8::~String8()
-{
- SharedBuffer::bufferFromData(mString)->release();
-}
-
-String8 String8::format(const char* fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
-
- String8 result(formatV(fmt, args));
-
- va_end(args);
- return result;
-}
-
-String8 String8::formatV(const char* fmt, va_list args)
-{
- String8 result;
- result.appendFormatV(fmt, args);
- return result;
-}
-
-void String8::clear() {
- SharedBuffer::bufferFromData(mString)->release();
- mString = getEmptyString();
-}
-
-void String8::setTo(const String8& other)
-{
- SharedBuffer::bufferFromData(other.mString)->acquire();
- SharedBuffer::bufferFromData(mString)->release();
- mString = other.mString;
-}
-
-status_t String8::setTo(const char* other)
-{
- const char *newString = allocFromUTF8(other, strlen(other));
- SharedBuffer::bufferFromData(mString)->release();
- mString = newString;
- if (mString) return NO_ERROR;
-
- mString = getEmptyString();
- return NO_MEMORY;
-}
-
-status_t String8::setTo(const char* other, size_t len)
-{
- const char *newString = allocFromUTF8(other, len);
- SharedBuffer::bufferFromData(mString)->release();
- mString = newString;
- if (mString) return NO_ERROR;
-
- mString = getEmptyString();
- return NO_MEMORY;
-}
-
-status_t String8::setTo(const char16_t* other, size_t len)
-{
- const char *newString = allocFromUTF16(other, len);
- SharedBuffer::bufferFromData(mString)->release();
- mString = newString;
- if (mString) return NO_ERROR;
-
- mString = getEmptyString();
- return NO_MEMORY;
-}
-
-status_t String8::setTo(const char32_t* other, size_t len)
-{
- const char *newString = allocFromUTF32(other, len);
- SharedBuffer::bufferFromData(mString)->release();
- mString = newString;
- if (mString) return NO_ERROR;
-
- mString = getEmptyString();
- return NO_MEMORY;
-}
-
-status_t String8::append(const String8& other)
-{
- const size_t otherLen = other.bytes();
- if (bytes() == 0) {
- setTo(other);
- return NO_ERROR;
- } else if (otherLen == 0) {
- return NO_ERROR;
- }
-
- return real_append(other.string(), otherLen);
-}
-
-status_t String8::append(const char* other)
-{
- return append(other, strlen(other));
-}
-
-status_t String8::append(const char* other, size_t otherLen)
-{
- if (bytes() == 0) {
- return setTo(other, otherLen);
- } else if (otherLen == 0) {
- return NO_ERROR;
- }
-
- return real_append(other, otherLen);
-}
-
-status_t String8::appendFormat(const char* fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
-
- status_t result = appendFormatV(fmt, args);
-
- va_end(args);
- return result;
-}
-
-status_t String8::appendFormatV(const char* fmt, va_list args)
-{
- int result = NO_ERROR;
- int n = vsnprintf(NULL, 0, fmt, args);
- if (n != 0) {
- size_t oldLength = length();
- char* buf = lockBuffer(oldLength + n);
- if (buf) {
- vsnprintf(buf + oldLength, n + 1, fmt, args);
- } else {
- result = NO_MEMORY;
- }
- }
- return result;
-}
-
-status_t String8::real_append(const char* other, size_t otherLen)
-{
- const size_t myLen = bytes();
-
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)
- ->editResize(myLen+otherLen+1);
- if (buf) {
- char* str = (char*)buf->data();
- mString = str;
- str += myLen;
- memcpy(str, other, otherLen);
- str[otherLen] = '\0';
- return NO_ERROR;
- }
- return NO_MEMORY;
-}
-
-char* String8::lockBuffer(size_t size)
-{
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)
- ->editResize(size+1);
- if (buf) {
- char* str = (char*)buf->data();
- mString = str;
- return str;
- }
- return NULL;
-}
-
-void String8::unlockBuffer()
-{
- unlockBuffer(strlen(mString));
-}
-
-status_t String8::unlockBuffer(size_t size)
-{
- if (size != this->size()) {
- SharedBuffer* buf = SharedBuffer::bufferFromData(mString)
- ->editResize(size+1);
- if (! buf) {
- return NO_MEMORY;
- }
-
- char* str = (char*)buf->data();
- str[size] = 0;
- mString = str;
- }
-
- return NO_ERROR;
-}
-
-ssize_t String8::find(const char* other, size_t start) const
-{
- size_t len = size();
- if (start >= len) {
- return -1;
- }
- const char* s = mString+start;
- const char* p = strstr(s, other);
- return p ? p-mString : -1;
-}
-
-void String8::toLower()
-{
- toLower(0, size());
-}
-
-void String8::toLower(size_t start, size_t length)
-{
- const size_t len = size();
- if (start >= len) {
- return;
- }
- if (start+length > len) {
- length = len-start;
- }
- char* buf = lockBuffer(len);
- buf += start;
- while (length > 0) {
- *buf = tolower(*buf);
- buf++;
- length--;
- }
- unlockBuffer(len);
-}
-
-void String8::toUpper()
-{
- toUpper(0, size());
-}
-
-void String8::toUpper(size_t start, size_t length)
-{
- const size_t len = size();
- if (start >= len) {
- return;
- }
- if (start+length > len) {
- length = len-start;
- }
- char* buf = lockBuffer(len);
- buf += start;
- while (length > 0) {
- *buf = toupper(*buf);
- buf++;
- length--;
- }
- unlockBuffer(len);
-}
-
-size_t String8::getUtf32Length() const
-{
- return utf8_to_utf32_length(mString, length());
-}
-
-int32_t String8::getUtf32At(size_t index, size_t *next_index) const
-{
- return utf32_from_utf8_at(mString, length(), index, next_index);
-}
-
-void String8::getUtf32(char32_t* dst) const
-{
- utf8_to_utf32(mString, length(), dst);
-}
-
-TextOutput& operator<<(TextOutput& to, const String8& val)
-{
- to << val.string();
- return to;
-}
-
-// ---------------------------------------------------------------------------
-// Path functions
-
-void String8::setPathName(const char* name)
-{
- setPathName(name, strlen(name));
-}
-
-void String8::setPathName(const char* name, size_t len)
-{
- char* buf = lockBuffer(len);
-
- memcpy(buf, name, len);
-
- // remove trailing path separator, if present
- if (len > 0 && buf[len-1] == OS_PATH_SEPARATOR)
- len--;
-
- buf[len] = '\0';
-
- unlockBuffer(len);
-}
-
-String8 String8::getPathLeaf(void) const
-{
- const char* cp;
- const char*const buf = mString;
-
- cp = strrchr(buf, OS_PATH_SEPARATOR);
- if (cp == NULL)
- return String8(*this);
- else
- return String8(cp+1);
-}
-
-String8 String8::getPathDir(void) const
-{
- const char* cp;
- const char*const str = mString;
-
- cp = strrchr(str, OS_PATH_SEPARATOR);
- if (cp == NULL)
- return String8("");
- else
- return String8(str, cp - str);
-}
-
-String8 String8::walkPath(String8* outRemains) const
-{
- const char* cp;
- const char*const str = mString;
- const char* buf = str;
-
- cp = strchr(buf, OS_PATH_SEPARATOR);
- if (cp == buf) {
- // don't include a leading '/'.
- buf = buf+1;
- cp = strchr(buf, OS_PATH_SEPARATOR);
- }
-
- if (cp == NULL) {
- String8 res = buf != str ? String8(buf) : *this;
- if (outRemains) *outRemains = String8("");
- return res;
- }
-
- String8 res(buf, cp-buf);
- if (outRemains) *outRemains = String8(cp+1);
- return res;
-}
-
-/*
- * Helper function for finding the start of an extension in a pathname.
- *
- * Returns a pointer inside mString, or NULL if no extension was found.
- */
-char* String8::find_extension(void) const
-{
- const char* lastSlash;
- const char* lastDot;
- int extLen;
- const char* const str = mString;
-
- // only look at the filename
- lastSlash = strrchr(str, OS_PATH_SEPARATOR);
- if (lastSlash == NULL)
- lastSlash = str;
- else
- lastSlash++;
-
- // find the last dot
- lastDot = strrchr(lastSlash, '.');
- if (lastDot == NULL)
- return NULL;
-
- // looks good, ship it
- return const_cast<char*>(lastDot);
-}
-
-String8 String8::getPathExtension(void) const
-{
- char* ext;
-
- ext = find_extension();
- if (ext != NULL)
- return String8(ext);
- else
- return String8("");
-}
-
-String8 String8::getBasePath(void) const
-{
- char* ext;
- const char* const str = mString;
-
- ext = find_extension();
- if (ext == NULL)
- return String8(*this);
- else
- return String8(str, ext - str);
-}
-
-String8& String8::appendPath(const char* name)
-{
- // TODO: The test below will fail for Win32 paths. Fix later or ignore.
- if (name[0] != OS_PATH_SEPARATOR) {
- if (*name == '\0') {
- // nothing to do
- return *this;
- }
-
- size_t len = length();
- if (len == 0) {
- // no existing filename, just use the new one
- setPathName(name);
- return *this;
- }
-
- // make room for oldPath + '/' + newPath
- int newlen = strlen(name);
-
- char* buf = lockBuffer(len+1+newlen);
-
- // insert a '/' if needed
- if (buf[len-1] != OS_PATH_SEPARATOR)
- buf[len++] = OS_PATH_SEPARATOR;
-
- memcpy(buf+len, name, newlen+1);
- len += newlen;
-
- unlockBuffer(len);
-
- return *this;
- } else {
- setPathName(name);
- return *this;
- }
-}
-
-String8& String8::convertToResPath()
-{
-#if OS_PATH_SEPARATOR != RES_PATH_SEPARATOR
- size_t len = length();
- if (len > 0) {
- char * buf = lockBuffer(len);
- for (char * end = buf + len; buf < end; ++buf) {
- if (*buf == OS_PATH_SEPARATOR)
- *buf = RES_PATH_SEPARATOR;
- }
- unlockBuffer(len);
- }
-#endif
- return *this;
-}
-
-}; // namespace android
diff --git a/libs/utils/StringArray.cpp b/libs/utils/StringArray.cpp
deleted file mode 100644
index aa42d68..0000000
--- a/libs/utils/StringArray.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-//
-// Sortable array of strings. STL-ish, but STL-free.
-//
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <utils/StringArray.h>
-
-namespace android {
-
-//
-// An expanding array of strings. Add, get, sort, delete.
-//
-StringArray::StringArray()
- : mMax(0), mCurrent(0), mArray(NULL)
-{
-}
-
-StringArray:: ~StringArray() {
- for (int i = 0; i < mCurrent; i++)
- delete[] mArray[i];
- delete[] mArray;
-}
-
-//
-// Add a string. A copy of the string is made.
-//
-bool StringArray::push_back(const char* str) {
- if (mCurrent >= mMax) {
- char** tmp;
-
- if (mMax == 0)
- mMax = 16; // initial storage
- else
- mMax *= 2;
-
- tmp = new char*[mMax];
- if (tmp == NULL)
- return false;
-
- memcpy(tmp, mArray, mCurrent * sizeof(char*));
- delete[] mArray;
- mArray = tmp;
- }
-
- int len = strlen(str);
- mArray[mCurrent] = new char[len+1];
- memcpy(mArray[mCurrent], str, len+1);
- mCurrent++;
-
- return true;
-}
-
-//
-// Delete an entry.
-//
-void StringArray::erase(int idx) {
- if (idx < 0 || idx >= mCurrent)
- return;
- delete[] mArray[idx];
- if (idx < mCurrent-1) {
- memmove(&mArray[idx], &mArray[idx+1],
- (mCurrent-1 - idx) * sizeof(char*));
- }
- mCurrent--;
-}
-
-//
-// Sort the array.
-//
-void StringArray::sort(int (*compare)(const void*, const void*)) {
- qsort(mArray, mCurrent, sizeof(char*), compare);
-}
-
-//
-// Pass this to the sort routine to do an ascending alphabetical sort.
-//
-int StringArray::cmpAscendingAlpha(const void* pstr1, const void* pstr2) {
- return strcmp(*(const char**)pstr1, *(const char**)pstr2);
-}
-
-//
-// Set entry N to specified string.
-// [should use operator[] here]
-//
-void StringArray::setEntry(int idx, const char* str) {
- if (idx < 0 || idx >= mCurrent)
- return;
- delete[] mArray[idx];
- int len = strlen(str);
- mArray[idx] = new char[len+1];
- memcpy(mArray[idx], str, len+1);
-}
-
-
-}; // namespace android
diff --git a/libs/utils/SystemClock.cpp b/libs/utils/SystemClock.cpp
deleted file mode 100644
index 8b8ac10..0000000
--- a/libs/utils/SystemClock.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-
-/*
- * System clock functions.
- */
-
-#ifdef HAVE_ANDROID_OS
-#include <linux/ioctl.h>
-#include <linux/rtc.h>
-#include <utils/Atomic.h>
-#include <linux/android_alarm.h>
-#endif
-
-#include <sys/time.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-
-#include <utils/SystemClock.h>
-#include <utils/Timers.h>
-
-#define LOG_TAG "SystemClock"
-#include "utils/Log.h"
-
-namespace android {
-
-/*
- * Set the current time. This only works when running as root.
- */
-int setCurrentTimeMillis(int64_t millis)
-{
-#if WIN32
- // not implemented
- return -1;
-#else
- struct timeval tv;
-#ifdef HAVE_ANDROID_OS
- struct timespec ts;
- int fd;
- int res;
-#endif
- int ret = 0;
-
- if (millis <= 0 || millis / 1000LL >= INT_MAX) {
- return -1;
- }
-
- tv.tv_sec = (time_t) (millis / 1000LL);
- tv.tv_usec = (suseconds_t) ((millis % 1000LL) * 1000LL);
-
- ALOGD("Setting time of day to sec=%d\n", (int) tv.tv_sec);
-
-#ifdef HAVE_ANDROID_OS
- fd = open("/dev/alarm", O_RDWR);
- if(fd < 0) {
- ALOGW("Unable to open alarm driver: %s\n", strerror(errno));
- return -1;
- }
- ts.tv_sec = tv.tv_sec;
- ts.tv_nsec = tv.tv_usec * 1000;
- res = ioctl(fd, ANDROID_ALARM_SET_RTC, &ts);
- if(res < 0) {
- ALOGW("Unable to set rtc to %ld: %s\n", tv.tv_sec, strerror(errno));
- ret = -1;
- }
- close(fd);
-#else
- if (settimeofday(&tv, NULL) != 0) {
- ALOGW("Unable to set clock to %d.%d: %s\n",
- (int) tv.tv_sec, (int) tv.tv_usec, strerror(errno));
- ret = -1;
- }
-#endif
-
- return ret;
-#endif // WIN32
-}
-
-/*
- * native public static long uptimeMillis();
- */
-int64_t uptimeMillis()
-{
- int64_t when = systemTime(SYSTEM_TIME_MONOTONIC);
- return (int64_t) nanoseconds_to_milliseconds(when);
-}
-
-/*
- * native public static long elapsedRealtime();
- */
-int64_t elapsedRealtime()
-{
-#ifdef HAVE_ANDROID_OS
- static int s_fd = -1;
-
- if (s_fd == -1) {
- int fd = open("/dev/alarm", O_RDONLY);
- if (android_atomic_cmpxchg(-1, fd, &s_fd)) {
- close(fd);
- }
- }
-
- struct timespec ts;
- int result = ioctl(s_fd,
- ANDROID_ALARM_GET_TIME(ANDROID_ALARM_ELAPSED_REALTIME), &ts);
-
- if (result == 0) {
- int64_t when = seconds_to_nanoseconds(ts.tv_sec) + ts.tv_nsec;
- return (int64_t) nanoseconds_to_milliseconds(when);
- } else {
- // XXX: there was an error, probably because the driver didn't
- // exist ... this should return
- // a real error, like an exception!
- int64_t when = systemTime(SYSTEM_TIME_MONOTONIC);
- return (int64_t) nanoseconds_to_milliseconds(when);
- }
-#else
- int64_t when = systemTime(SYSTEM_TIME_MONOTONIC);
- return (int64_t) nanoseconds_to_milliseconds(when);
-#endif
-}
-
-}; // namespace android
diff --git a/libs/utils/TextOutput.cpp b/libs/utils/TextOutput.cpp
deleted file mode 100644
index e04823d..0000000
--- a/libs/utils/TextOutput.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#include <utils/TextOutput.h>
-
-#include <utils/Debug.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-TextOutput::TextOutput() {
-}
-
-TextOutput::~TextOutput() {
-}
-
-// ---------------------------------------------------------------------------
-
-TextOutput& operator<<(TextOutput& to, bool val)
-{
- if (val) to.print("true", 4);
- else to.print("false", 5);
- return to;
-}
-
-TextOutput& operator<<(TextOutput& to, int val)
-{
- char buf[16];
- sprintf(buf, "%d", val);
- to.print(buf, strlen(buf));
- return to;
-}
-
-TextOutput& operator<<(TextOutput& to, long val)
-{
- char buf[16];
- sprintf(buf, "%ld", val);
- to.print(buf, strlen(buf));
- return to;
-}
-
-TextOutput& operator<<(TextOutput& to, unsigned int val)
-{
- char buf[16];
- sprintf(buf, "%u", val);
- to.print(buf, strlen(buf));
- return to;
-}
-
-TextOutput& operator<<(TextOutput& to, unsigned long val)
-{
- char buf[16];
- sprintf(buf, "%lu", val);
- to.print(buf, strlen(buf));
- return to;
-}
-
-TextOutput& operator<<(TextOutput& to, long long val)
-{
- char buf[32];
- sprintf(buf, "%Ld", val);
- to.print(buf, strlen(buf));
- return to;
-}
-
-TextOutput& operator<<(TextOutput& to, unsigned long long val)
-{
- char buf[32];
- sprintf(buf, "%Lu", val);
- to.print(buf, strlen(buf));
- return to;
-}
-
-static TextOutput& print_float(TextOutput& to, double value)
-{
- char buf[64];
- sprintf(buf, "%g", value);
- if( !strchr(buf, '.') && !strchr(buf, 'e') &&
- !strchr(buf, 'E') ) {
- strncat(buf, ".0", sizeof(buf)-1);
- }
- to.print(buf, strlen(buf));
- return to;
-}
-
-TextOutput& operator<<(TextOutput& to, float val)
-{
- return print_float(to,val);
-}
-
-TextOutput& operator<<(TextOutput& to, double val)
-{
- return print_float(to,val);
-}
-
-TextOutput& operator<<(TextOutput& to, const void* val)
-{
- char buf[16];
- sprintf(buf, "%p", val);
- to.print(buf, strlen(buf));
- return to;
-}
-
-static void textOutputPrinter(void* cookie, const char* txt)
-{
- ((TextOutput*)cookie)->print(txt, strlen(txt));
-}
-
-TextOutput& operator<<(TextOutput& to, const TypeCode& val)
-{
- printTypeCode(val.typeCode(), textOutputPrinter, (void*)&to);
- return to;
-}
-
-HexDump::HexDump(const void *buf, size_t size, size_t bytesPerLine)
- : mBuffer(buf)
- , mSize(size)
- , mBytesPerLine(bytesPerLine)
- , mSingleLineCutoff(16)
- , mAlignment(4)
- , mCArrayStyle(false)
-{
- if (bytesPerLine >= 16) mAlignment = 4;
- else if (bytesPerLine >= 8) mAlignment = 2;
- else mAlignment = 1;
-}
-
-TextOutput& operator<<(TextOutput& to, const HexDump& val)
-{
- printHexData(0, val.buffer(), val.size(), val.bytesPerLine(),
- val.singleLineCutoff(), val.alignment(), val.carrayStyle(),
- textOutputPrinter, (void*)&to);
- return to;
-}
-
-}; // namespace android
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
deleted file mode 100644
index ab207f5..0000000
--- a/libs/utils/Threads.cpp
+++ /dev/null
@@ -1,952 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-// #define LOG_NDEBUG 0
-#define LOG_TAG "libutils.threads"
-
-#include <utils/threads.h>
-#include <utils/Log.h>
-
-#include <cutils/sched_policy.h>
-#include <cutils/properties.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <memory.h>
-#include <errno.h>
-#include <assert.h>
-#include <unistd.h>
-
-#if defined(HAVE_PTHREADS)
-# include <pthread.h>
-# include <sched.h>
-# include <sys/resource.h>
-#ifdef HAVE_ANDROID_OS
-# include <bionic_pthread.h>
-#endif
-#elif defined(HAVE_WIN32_THREADS)
-# include <windows.h>
-# include <stdint.h>
-# include <process.h>
-# define HAVE_CREATETHREAD // Cygwin, vs. HAVE__BEGINTHREADEX for MinGW
-#endif
-
-#if defined(HAVE_PRCTL)
-#include <sys/prctl.h>
-#endif
-
-/*
- * ===========================================================================
- * Thread wrappers
- * ===========================================================================
- */
-
-using namespace android;
-
-// ----------------------------------------------------------------------------
-#if defined(HAVE_PTHREADS)
-// ----------------------------------------------------------------------------
-
-/*
- * Create and run a new thread.
- *
- * We create it "detached", so it cleans up after itself.
- */
-
-typedef void* (*android_pthread_entry)(void*);
-
-static pthread_once_t gDoSchedulingGroupOnce = PTHREAD_ONCE_INIT;
-static bool gDoSchedulingGroup = true;
-
-static void checkDoSchedulingGroup(void) {
- char buf[PROPERTY_VALUE_MAX];
- int len = property_get("debug.sys.noschedgroups", buf, "");
- if (len > 0) {
- int temp;
- if (sscanf(buf, "%d", &temp) == 1) {
- gDoSchedulingGroup = temp == 0;
- }
- }
-}
-
-struct thread_data_t {
- thread_func_t entryFunction;
- void* userData;
- int priority;
- char * threadName;
-
- // we use this trampoline when we need to set the priority with
- // nice/setpriority, and name with prctl.
- static int trampoline(const thread_data_t* t) {
- thread_func_t f = t->entryFunction;
- void* u = t->userData;
- int prio = t->priority;
- char * name = t->threadName;
- delete t;
- setpriority(PRIO_PROCESS, 0, prio);
- pthread_once(&gDoSchedulingGroupOnce, checkDoSchedulingGroup);
- if (gDoSchedulingGroup) {
- if (prio >= ANDROID_PRIORITY_BACKGROUND) {
- set_sched_policy(androidGetTid(), SP_BACKGROUND);
- } else {
- set_sched_policy(androidGetTid(), SP_FOREGROUND);
- }
- }
-
- if (name) {
-#if defined(HAVE_PRCTL)
- // Mac OS doesn't have this, and we build libutil for the host too
- int hasAt = 0;
- int hasDot = 0;
- char *s = name;
- while (*s) {
- if (*s == '.') hasDot = 1;
- else if (*s == '@') hasAt = 1;
- s++;
- }
- int len = s - name;
- if (len < 15 || hasAt || !hasDot) {
- s = name;
- } else {
- s = name + len - 15;
- }
- prctl(PR_SET_NAME, (unsigned long) s, 0, 0, 0);
-#endif
- free(name);
- }
- return f(u);
- }
-};
-
-int androidCreateRawThreadEtc(android_thread_func_t entryFunction,
- void *userData,
- const char* threadName,
- int32_t threadPriority,
- size_t threadStackSize,
- android_thread_id_t *threadId)
-{
- pthread_attr_t attr;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-
-#ifdef HAVE_ANDROID_OS /* valgrind is rejecting RT-priority create reqs */
- if (threadPriority != PRIORITY_DEFAULT || threadName != NULL) {
- // Now that the pthread_t has a method to find the associated
- // android_thread_id_t (pid) from pthread_t, it would be possible to avoid
- // this trampoline in some cases as the parent could set the properties
- // for the child. However, there would be a race condition because the
- // child becomes ready immediately, and it doesn't work for the name.
- // prctl(PR_SET_NAME) only works for self; prctl(PR_SET_THREAD_NAME) was
- // proposed but not yet accepted.
- thread_data_t* t = new thread_data_t;
- t->priority = threadPriority;
- t->threadName = threadName ? strdup(threadName) : NULL;
- t->entryFunction = entryFunction;
- t->userData = userData;
- entryFunction = (android_thread_func_t)&thread_data_t::trampoline;
- userData = t;
- }
-#endif
-
- if (threadStackSize) {
- pthread_attr_setstacksize(&attr, threadStackSize);
- }
-
- errno = 0;
- pthread_t thread;
- int result = pthread_create(&thread, &attr,
- (android_pthread_entry)entryFunction, userData);
- pthread_attr_destroy(&attr);
- if (result != 0) {
- ALOGE("androidCreateRawThreadEtc failed (entry=%p, res=%d, errno=%d)\n"
- "(android threadPriority=%d)",
- entryFunction, result, errno, threadPriority);
- return 0;
- }
-
- // Note that *threadID is directly available to the parent only, as it is
- // assigned after the child starts. Use memory barrier / lock if the child
- // or other threads also need access.
- if (threadId != NULL) {
- *threadId = (android_thread_id_t)thread; // XXX: this is not portable
- }
- return 1;
-}
-
-#ifdef HAVE_ANDROID_OS
-static pthread_t android_thread_id_t_to_pthread(android_thread_id_t thread)
-{
- return (pthread_t) thread;
-}
-#endif
-
-android_thread_id_t androidGetThreadId()
-{
- return (android_thread_id_t)pthread_self();
-}
-
-// ----------------------------------------------------------------------------
-#elif defined(HAVE_WIN32_THREADS)
-// ----------------------------------------------------------------------------
-
-/*
- * Trampoline to make us __stdcall-compliant.
- *
- * We're expected to delete "vDetails" when we're done.
- */
-struct threadDetails {
- int (*func)(void*);
- void* arg;
-};
-static __stdcall unsigned int threadIntermediary(void* vDetails)
-{
- struct threadDetails* pDetails = (struct threadDetails*) vDetails;
- int result;
-
- result = (*(pDetails->func))(pDetails->arg);
-
- delete pDetails;
-
- ALOG(LOG_VERBOSE, "thread", "thread exiting\n");
- return (unsigned int) result;
-}
-
-/*
- * Create and run a new thread.
- */
-static bool doCreateThread(android_thread_func_t fn, void* arg, android_thread_id_t *id)
-{
- HANDLE hThread;
- struct threadDetails* pDetails = new threadDetails; // must be on heap
- unsigned int thrdaddr;
-
- pDetails->func = fn;
- pDetails->arg = arg;
-
-#if defined(HAVE__BEGINTHREADEX)
- hThread = (HANDLE) _beginthreadex(NULL, 0, threadIntermediary, pDetails, 0,
- &thrdaddr);
- if (hThread == 0)
-#elif defined(HAVE_CREATETHREAD)
- hThread = CreateThread(NULL, 0,
- (LPTHREAD_START_ROUTINE) threadIntermediary,
- (void*) pDetails, 0, (DWORD*) &thrdaddr);
- if (hThread == NULL)
-#endif
- {
- ALOG(LOG_WARN, "thread", "WARNING: thread create failed\n");
- return false;
- }
-
-#if defined(HAVE_CREATETHREAD)
- /* close the management handle */
- CloseHandle(hThread);
-#endif
-
- if (id != NULL) {
- *id = (android_thread_id_t)thrdaddr;
- }
-
- return true;
-}
-
-int androidCreateRawThreadEtc(android_thread_func_t fn,
- void *userData,
- const char* threadName,
- int32_t threadPriority,
- size_t threadStackSize,
- android_thread_id_t *threadId)
-{
- return doCreateThread( fn, userData, threadId);
-}
-
-android_thread_id_t androidGetThreadId()
-{
- return (android_thread_id_t)GetCurrentThreadId();
-}
-
-// ----------------------------------------------------------------------------
-#else
-#error "Threads not supported"
-#endif
-
-// ----------------------------------------------------------------------------
-
-int androidCreateThread(android_thread_func_t fn, void* arg)
-{
- return createThreadEtc(fn, arg);
-}
-
-int androidCreateThreadGetID(android_thread_func_t fn, void *arg, android_thread_id_t *id)
-{
- return createThreadEtc(fn, arg, "android:unnamed_thread",
- PRIORITY_DEFAULT, 0, id);
-}
-
-static android_create_thread_fn gCreateThreadFn = androidCreateRawThreadEtc;
-
-int androidCreateThreadEtc(android_thread_func_t entryFunction,
- void *userData,
- const char* threadName,
- int32_t threadPriority,
- size_t threadStackSize,
- android_thread_id_t *threadId)
-{
- return gCreateThreadFn(entryFunction, userData, threadName,
- threadPriority, threadStackSize, threadId);
-}
-
-void androidSetCreateThreadFunc(android_create_thread_fn func)
-{
- gCreateThreadFn = func;
-}
-
-pid_t androidGetTid()
-{
-#ifdef HAVE_GETTID
- return gettid();
-#else
- return getpid();
-#endif
-}
-
-int androidSetThreadSchedulingGroup(pid_t tid, int grp)
-{
- if (grp > ANDROID_TGROUP_MAX || grp < 0) {
- return BAD_VALUE;
- }
-
-#if defined(HAVE_PTHREADS)
- pthread_once(&gDoSchedulingGroupOnce, checkDoSchedulingGroup);
- if (gDoSchedulingGroup) {
- // set_sched_policy does not support tid == 0
- if (tid == 0) {
- tid = androidGetTid();
- }
- if (set_sched_policy(tid, (grp == ANDROID_TGROUP_BG_NONINTERACT) ?
- SP_BACKGROUND : SP_FOREGROUND)) {
- return PERMISSION_DENIED;
- }
- }
-#endif
-
- return NO_ERROR;
-}
-
-int androidSetThreadPriority(pid_t tid, int pri)
-{
- int rc = 0;
-
-#if defined(HAVE_PTHREADS)
- int lasterr = 0;
-
- pthread_once(&gDoSchedulingGroupOnce, checkDoSchedulingGroup);
- if (gDoSchedulingGroup) {
- // set_sched_policy does not support tid == 0
- int policy_tid;
- if (tid == 0) {
- policy_tid = androidGetTid();
- } else {
- policy_tid = tid;
- }
- if (pri >= ANDROID_PRIORITY_BACKGROUND) {
- rc = set_sched_policy(policy_tid, SP_BACKGROUND);
- } else if (getpriority(PRIO_PROCESS, tid) >= ANDROID_PRIORITY_BACKGROUND) {
- rc = set_sched_policy(policy_tid, SP_FOREGROUND);
- }
- }
-
- if (rc) {
- lasterr = errno;
- }
-
- if (setpriority(PRIO_PROCESS, tid, pri) < 0) {
- rc = INVALID_OPERATION;
- } else {
- errno = lasterr;
- }
-#endif
-
- return rc;
-}
-
-int androidGetThreadPriority(pid_t tid) {
-#if defined(HAVE_PTHREADS)
- return getpriority(PRIO_PROCESS, tid);
-#else
- return ANDROID_PRIORITY_NORMAL;
-#endif
-}
-
-int androidGetThreadSchedulingGroup(pid_t tid)
-{
- int ret = ANDROID_TGROUP_DEFAULT;
-
-#if defined(HAVE_PTHREADS)
- // convention is to not call get/set_sched_policy methods if disabled by property
- pthread_once(&gDoSchedulingGroupOnce, checkDoSchedulingGroup);
- if (gDoSchedulingGroup) {
- SchedPolicy policy;
- // get_sched_policy does not support tid == 0
- if (tid == 0) {
- tid = androidGetTid();
- }
- if (get_sched_policy(tid, &policy) < 0) {
- ret = INVALID_OPERATION;
- } else {
- switch (policy) {
- case SP_BACKGROUND:
- ret = ANDROID_TGROUP_BG_NONINTERACT;
- break;
- case SP_FOREGROUND:
- ret = ANDROID_TGROUP_FG_BOOST;
- break;
- default:
- // should not happen, as enum SchedPolicy does not have any other values
- ret = INVALID_OPERATION;
- break;
- }
- }
- }
-#endif
-
- return ret;
-}
-
-namespace android {
-
-/*
- * ===========================================================================
- * Mutex class
- * ===========================================================================
- */
-
-#if defined(HAVE_PTHREADS)
-// implemented as inlines in threads.h
-#elif defined(HAVE_WIN32_THREADS)
-
-Mutex::Mutex()
-{
- HANDLE hMutex;
-
- assert(sizeof(hMutex) == sizeof(mState));
-
- hMutex = CreateMutex(NULL, FALSE, NULL);
- mState = (void*) hMutex;
-}
-
-Mutex::Mutex(const char* name)
-{
- // XXX: name not used for now
- HANDLE hMutex;
-
- assert(sizeof(hMutex) == sizeof(mState));
-
- hMutex = CreateMutex(NULL, FALSE, NULL);
- mState = (void*) hMutex;
-}
-
-Mutex::Mutex(int type, const char* name)
-{
- // XXX: type and name not used for now
- HANDLE hMutex;
-
- assert(sizeof(hMutex) == sizeof(mState));
-
- hMutex = CreateMutex(NULL, FALSE, NULL);
- mState = (void*) hMutex;
-}
-
-Mutex::~Mutex()
-{
- CloseHandle((HANDLE) mState);
-}
-
-status_t Mutex::lock()
-{
- DWORD dwWaitResult;
- dwWaitResult = WaitForSingleObject((HANDLE) mState, INFINITE);
- return dwWaitResult != WAIT_OBJECT_0 ? -1 : NO_ERROR;
-}
-
-void Mutex::unlock()
-{
- if (!ReleaseMutex((HANDLE) mState))
- ALOG(LOG_WARN, "thread", "WARNING: bad result from unlocking mutex\n");
-}
-
-status_t Mutex::tryLock()
-{
- DWORD dwWaitResult;
-
- dwWaitResult = WaitForSingleObject((HANDLE) mState, 0);
- if (dwWaitResult != WAIT_OBJECT_0 && dwWaitResult != WAIT_TIMEOUT)
- ALOG(LOG_WARN, "thread", "WARNING: bad result from try-locking mutex\n");
- return (dwWaitResult == WAIT_OBJECT_0) ? 0 : -1;
-}
-
-#else
-#error "Somebody forgot to implement threads for this platform."
-#endif
-
-
-/*
- * ===========================================================================
- * Condition class
- * ===========================================================================
- */
-
-#if defined(HAVE_PTHREADS)
-// implemented as inlines in threads.h
-#elif defined(HAVE_WIN32_THREADS)
-
-/*
- * Windows doesn't have a condition variable solution. It's possible
- * to create one, but it's easy to get it wrong. For a discussion, and
- * the origin of this implementation, see:
- *
- * http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
- *
- * The implementation shown on the page does NOT follow POSIX semantics.
- * As an optimization they require acquiring the external mutex before
- * calling signal() and broadcast(), whereas POSIX only requires grabbing
- * it before calling wait(). The implementation here has been un-optimized
- * to have the correct behavior.
- */
-typedef struct WinCondition {
- // Number of waiting threads.
- int waitersCount;
-
- // Serialize access to waitersCount.
- CRITICAL_SECTION waitersCountLock;
-
- // Semaphore used to queue up threads waiting for the condition to
- // become signaled.
- HANDLE sema;
-
- // An auto-reset event used by the broadcast/signal thread to wait
- // for all the waiting thread(s) to wake up and be released from
- // the semaphore.
- HANDLE waitersDone;
-
- // This mutex wouldn't be necessary if we required that the caller
- // lock the external mutex before calling signal() and broadcast().
- // I'm trying to mimic pthread semantics though.
- HANDLE internalMutex;
-
- // Keeps track of whether we were broadcasting or signaling. This
- // allows us to optimize the code if we're just signaling.
- bool wasBroadcast;
-
- status_t wait(WinCondition* condState, HANDLE hMutex, nsecs_t* abstime)
- {
- // Increment the wait count, avoiding race conditions.
- EnterCriticalSection(&condState->waitersCountLock);
- condState->waitersCount++;
- //printf("+++ wait: incr waitersCount to %d (tid=%ld)\n",
- // condState->waitersCount, getThreadId());
- LeaveCriticalSection(&condState->waitersCountLock);
-
- DWORD timeout = INFINITE;
- if (abstime) {
- nsecs_t reltime = *abstime - systemTime();
- if (reltime < 0)
- reltime = 0;
- timeout = reltime/1000000;
- }
-
- // Atomically release the external mutex and wait on the semaphore.
- DWORD res =
- SignalObjectAndWait(hMutex, condState->sema, timeout, FALSE);
-
- //printf("+++ wait: awake (tid=%ld)\n", getThreadId());
-
- // Reacquire lock to avoid race conditions.
- EnterCriticalSection(&condState->waitersCountLock);
-
- // No longer waiting.
- condState->waitersCount--;
-
- // Check to see if we're the last waiter after a broadcast.
- bool lastWaiter = (condState->wasBroadcast && condState->waitersCount == 0);
-
- //printf("+++ wait: lastWaiter=%d (wasBc=%d wc=%d)\n",
- // lastWaiter, condState->wasBroadcast, condState->waitersCount);
-
- LeaveCriticalSection(&condState->waitersCountLock);
-
- // If we're the last waiter thread during this particular broadcast
- // then signal broadcast() that we're all awake. It'll drop the
- // internal mutex.
- if (lastWaiter) {
- // Atomically signal the "waitersDone" event and wait until we
- // can acquire the internal mutex. We want to do this in one step
- // because it ensures that everybody is in the mutex FIFO before
- // any thread has a chance to run. Without it, another thread
- // could wake up, do work, and hop back in ahead of us.
- SignalObjectAndWait(condState->waitersDone, condState->internalMutex,
- INFINITE, FALSE);
- } else {
- // Grab the internal mutex.
- WaitForSingleObject(condState->internalMutex, INFINITE);
- }
-
- // Release the internal and grab the external.
- ReleaseMutex(condState->internalMutex);
- WaitForSingleObject(hMutex, INFINITE);
-
- return res == WAIT_OBJECT_0 ? NO_ERROR : -1;
- }
-} WinCondition;
-
-/*
- * Constructor. Set up the WinCondition stuff.
- */
-Condition::Condition()
-{
- WinCondition* condState = new WinCondition;
-
- condState->waitersCount = 0;
- condState->wasBroadcast = false;
- // semaphore: no security, initial value of 0
- condState->sema = CreateSemaphore(NULL, 0, 0x7fffffff, NULL);
- InitializeCriticalSection(&condState->waitersCountLock);
- // auto-reset event, not signaled initially
- condState->waitersDone = CreateEvent(NULL, FALSE, FALSE, NULL);
- // used so we don't have to lock external mutex on signal/broadcast
- condState->internalMutex = CreateMutex(NULL, FALSE, NULL);
-
- mState = condState;
-}
-
-/*
- * Destructor. Free Windows resources as well as our allocated storage.
- */
-Condition::~Condition()
-{
- WinCondition* condState = (WinCondition*) mState;
- if (condState != NULL) {
- CloseHandle(condState->sema);
- CloseHandle(condState->waitersDone);
- delete condState;
- }
-}
-
-
-status_t Condition::wait(Mutex& mutex)
-{
- WinCondition* condState = (WinCondition*) mState;
- HANDLE hMutex = (HANDLE) mutex.mState;
-
- return ((WinCondition*)mState)->wait(condState, hMutex, NULL);
-}
-
-status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime)
-{
- WinCondition* condState = (WinCondition*) mState;
- HANDLE hMutex = (HANDLE) mutex.mState;
- nsecs_t absTime = systemTime()+reltime;
-
- return ((WinCondition*)mState)->wait(condState, hMutex, &absTime);
-}
-
-/*
- * Signal the condition variable, allowing one thread to continue.
- */
-void Condition::signal()
-{
- WinCondition* condState = (WinCondition*) mState;
-
- // Lock the internal mutex. This ensures that we don't clash with
- // broadcast().
- WaitForSingleObject(condState->internalMutex, INFINITE);
-
- EnterCriticalSection(&condState->waitersCountLock);
- bool haveWaiters = (condState->waitersCount > 0);
- LeaveCriticalSection(&condState->waitersCountLock);
-
- // If no waiters, then this is a no-op. Otherwise, knock the semaphore
- // down a notch.
- if (haveWaiters)
- ReleaseSemaphore(condState->sema, 1, 0);
-
- // Release internal mutex.
- ReleaseMutex(condState->internalMutex);
-}
-
-/*
- * Signal the condition variable, allowing all threads to continue.
- *
- * First we have to wake up all threads waiting on the semaphore, then
- * we wait until all of the threads have actually been woken before
- * releasing the internal mutex. This ensures that all threads are woken.
- */
-void Condition::broadcast()
-{
- WinCondition* condState = (WinCondition*) mState;
-
- // Lock the internal mutex. This keeps the guys we're waking up
- // from getting too far.
- WaitForSingleObject(condState->internalMutex, INFINITE);
-
- EnterCriticalSection(&condState->waitersCountLock);
- bool haveWaiters = false;
-
- if (condState->waitersCount > 0) {
- haveWaiters = true;
- condState->wasBroadcast = true;
- }
-
- if (haveWaiters) {
- // Wake up all the waiters.
- ReleaseSemaphore(condState->sema, condState->waitersCount, 0);
-
- LeaveCriticalSection(&condState->waitersCountLock);
-
- // Wait for all awakened threads to acquire the counting semaphore.
- // The last guy who was waiting sets this.
- WaitForSingleObject(condState->waitersDone, INFINITE);
-
- // Reset wasBroadcast. (No crit section needed because nobody
- // else can wake up to poke at it.)
- condState->wasBroadcast = 0;
- } else {
- // nothing to do
- LeaveCriticalSection(&condState->waitersCountLock);
- }
-
- // Release internal mutex.
- ReleaseMutex(condState->internalMutex);
-}
-
-#else
-#error "condition variables not supported on this platform"
-#endif
-
-// ----------------------------------------------------------------------------
-
-/*
- * This is our thread object!
- */
-
-Thread::Thread(bool canCallJava)
- : mCanCallJava(canCallJava),
- mThread(thread_id_t(-1)),
- mLock("Thread::mLock"),
- mStatus(NO_ERROR),
- mExitPending(false), mRunning(false)
-#ifdef HAVE_ANDROID_OS
- , mTid(-1)
-#endif
-{
-}
-
-Thread::~Thread()
-{
-}
-
-status_t Thread::readyToRun()
-{
- return NO_ERROR;
-}
-
-status_t Thread::run(const char* name, int32_t priority, size_t stack)
-{
- Mutex::Autolock _l(mLock);
-
- if (mRunning) {
- // thread already started
- return INVALID_OPERATION;
- }
-
- // reset status and exitPending to their default value, so we can
- // try again after an error happened (either below, or in readyToRun())
- mStatus = NO_ERROR;
- mExitPending = false;
- mThread = thread_id_t(-1);
-
- // hold a strong reference on ourself
- mHoldSelf = this;
-
- mRunning = true;
-
- bool res;
- if (mCanCallJava) {
- res = createThreadEtc(_threadLoop,
- this, name, priority, stack, &mThread);
- } else {
- res = androidCreateRawThreadEtc(_threadLoop,
- this, name, priority, stack, &mThread);
- }
-
- if (res == false) {
- mStatus = UNKNOWN_ERROR; // something happened!
- mRunning = false;
- mThread = thread_id_t(-1);
- mHoldSelf.clear(); // "this" may have gone away after this.
-
- return UNKNOWN_ERROR;
- }
-
- // Do not refer to mStatus here: The thread is already running (may, in fact
- // already have exited with a valid mStatus result). The NO_ERROR indication
- // here merely indicates successfully starting the thread and does not
- // imply successful termination/execution.
- return NO_ERROR;
-
- // Exiting scope of mLock is a memory barrier and allows new thread to run
-}
-
-int Thread::_threadLoop(void* user)
-{
- Thread* const self = static_cast<Thread*>(user);
-
- sp<Thread> strong(self->mHoldSelf);
- wp<Thread> weak(strong);
- self->mHoldSelf.clear();
-
-#ifdef HAVE_ANDROID_OS
- // this is very useful for debugging with gdb
- self->mTid = gettid();
-#endif
-
- bool first = true;
-
- do {
- bool result;
- if (first) {
- first = false;
- self->mStatus = self->readyToRun();
- result = (self->mStatus == NO_ERROR);
-
- if (result && !self->exitPending()) {
- // Binder threads (and maybe others) rely on threadLoop
- // running at least once after a successful ::readyToRun()
- // (unless, of course, the thread has already been asked to exit
- // at that point).
- // This is because threads are essentially used like this:
- // (new ThreadSubclass())->run();
- // The caller therefore does not retain a strong reference to
- // the thread and the thread would simply disappear after the
- // successful ::readyToRun() call instead of entering the
- // threadLoop at least once.
- result = self->threadLoop();
- }
- } else {
- result = self->threadLoop();
- }
-
- // establish a scope for mLock
- {
- Mutex::Autolock _l(self->mLock);
- if (result == false || self->mExitPending) {
- self->mExitPending = true;
- self->mRunning = false;
- // clear thread ID so that requestExitAndWait() does not exit if
- // called by a new thread using the same thread ID as this one.
- self->mThread = thread_id_t(-1);
- // note that interested observers blocked in requestExitAndWait are
- // awoken by broadcast, but blocked on mLock until break exits scope
- self->mThreadExitedCondition.broadcast();
- break;
- }
- }
-
- // Release our strong reference, to let a chance to the thread
- // to die a peaceful death.
- strong.clear();
- // And immediately, re-acquire a strong reference for the next loop
- strong = weak.promote();
- } while(strong != 0);
-
- return 0;
-}
-
-void Thread::requestExit()
-{
- Mutex::Autolock _l(mLock);
- mExitPending = true;
-}
-
-status_t Thread::requestExitAndWait()
-{
- Mutex::Autolock _l(mLock);
- if (mThread == getThreadId()) {
- ALOGW(
- "Thread (this=%p): don't call waitForExit() from this "
- "Thread object's thread. It's a guaranteed deadlock!",
- this);
-
- return WOULD_BLOCK;
- }
-
- mExitPending = true;
-
- while (mRunning == true) {
- mThreadExitedCondition.wait(mLock);
- }
- // This next line is probably not needed any more, but is being left for
- // historical reference. Note that each interested party will clear flag.
- mExitPending = false;
-
- return mStatus;
-}
-
-status_t Thread::join()
-{
- Mutex::Autolock _l(mLock);
- if (mThread == getThreadId()) {
- ALOGW(
- "Thread (this=%p): don't call join() from this "
- "Thread object's thread. It's a guaranteed deadlock!",
- this);
-
- return WOULD_BLOCK;
- }
-
- while (mRunning == true) {
- mThreadExitedCondition.wait(mLock);
- }
-
- return mStatus;
-}
-
-#ifdef HAVE_ANDROID_OS
-pid_t Thread::getTid() const
-{
- // mTid is not defined until the child initializes it, and the caller may need it earlier
- Mutex::Autolock _l(mLock);
- pid_t tid;
- if (mRunning) {
- pthread_t pthread = android_thread_id_t_to_pthread(mThread);
- tid = __pthread_gettid(pthread);
- } else {
- ALOGW("Thread (this=%p): getTid() is undefined before run()", this);
- tid = -1;
- }
- return tid;
-}
-#endif
-
-bool Thread::exitPending() const
-{
- Mutex::Autolock _l(mLock);
- return mExitPending;
-}
-
-
-
-}; // namespace android
diff --git a/libs/utils/Timers.cpp b/libs/utils/Timers.cpp
deleted file mode 100644
index 64b4701..0000000
--- a/libs/utils/Timers.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-// Timer functions.
-//
-#include <utils/Timers.h>
-#include <utils/Log.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <time.h>
-#include <errno.h>
-#include <limits.h>
-
-#ifdef HAVE_WIN32_THREADS
-#include <windows.h>
-#endif
-
-nsecs_t systemTime(int clock)
-{
-#if defined(HAVE_POSIX_CLOCKS)
- static const clockid_t clocks[] = {
- CLOCK_REALTIME,
- CLOCK_MONOTONIC,
- CLOCK_PROCESS_CPUTIME_ID,
- CLOCK_THREAD_CPUTIME_ID
- };
- struct timespec t;
- t.tv_sec = t.tv_nsec = 0;
- clock_gettime(clocks[clock], &t);
- return nsecs_t(t.tv_sec)*1000000000LL + t.tv_nsec;
-#else
- // we don't support the clocks here.
- struct timeval t;
- t.tv_sec = t.tv_usec = 0;
- gettimeofday(&t, NULL);
- return nsecs_t(t.tv_sec)*1000000000LL + nsecs_t(t.tv_usec)*1000LL;
-#endif
-}
-
-int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime)
-{
- int timeoutDelayMillis;
- if (timeoutTime > referenceTime) {
- uint64_t timeoutDelay = uint64_t(timeoutTime - referenceTime);
- if (timeoutDelay > uint64_t((INT_MAX - 1) * 1000000LL)) {
- timeoutDelayMillis = -1;
- } else {
- timeoutDelayMillis = (timeoutDelay + 999999LL) / 1000000LL;
- }
- } else {
- timeoutDelayMillis = 0;
- }
- return timeoutDelayMillis;
-}
-
-
-/*
- * ===========================================================================
- * DurationTimer
- * ===========================================================================
- */
-
-using namespace android;
-
-// Start the timer.
-void DurationTimer::start(void)
-{
- gettimeofday(&mStartWhen, NULL);
-}
-
-// Stop the timer.
-void DurationTimer::stop(void)
-{
- gettimeofday(&mStopWhen, NULL);
-}
-
-// Get the duration in microseconds.
-long long DurationTimer::durationUsecs(void) const
-{
- return (long) subtractTimevals(&mStopWhen, &mStartWhen);
-}
-
-// Subtract two timevals. Returns the difference (ptv1-ptv2) in
-// microseconds.
-/*static*/ long long DurationTimer::subtractTimevals(const struct timeval* ptv1,
- const struct timeval* ptv2)
-{
- long long stop = ((long long) ptv1->tv_sec) * 1000000LL +
- ((long long) ptv1->tv_usec);
- long long start = ((long long) ptv2->tv_sec) * 1000000LL +
- ((long long) ptv2->tv_usec);
- return stop - start;
-}
-
-// Add the specified amount of time to the timeval.
-/*static*/ void DurationTimer::addToTimeval(struct timeval* ptv, long usec)
-{
- if (usec < 0) {
- ALOG(LOG_WARN, "", "Negative values not supported in addToTimeval\n");
- return;
- }
-
- // normalize tv_usec if necessary
- if (ptv->tv_usec >= 1000000) {
- ptv->tv_sec += ptv->tv_usec / 1000000;
- ptv->tv_usec %= 1000000;
- }
-
- ptv->tv_usec += usec % 1000000;
- if (ptv->tv_usec >= 1000000) {
- ptv->tv_usec -= 1000000;
- ptv->tv_sec++;
- }
- ptv->tv_sec += usec / 1000000;
-}
-
diff --git a/libs/utils/Tokenizer.cpp b/libs/utils/Tokenizer.cpp
deleted file mode 100644
index efda2bf..0000000
--- a/libs/utils/Tokenizer.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#define LOG_TAG "Tokenizer"
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <utils/Log.h>
-#include <utils/Tokenizer.h>
-
-// Enables debug output for the tokenizer.
-#define DEBUG_TOKENIZER 0
-
-
-namespace android {
-
-static inline bool isDelimiter(char ch, const char* delimiters) {
- return strchr(delimiters, ch) != NULL;
-}
-
-Tokenizer::Tokenizer(const String8& filename, FileMap* fileMap, char* buffer, size_t length) :
- mFilename(filename), mFileMap(fileMap),
- mBuffer(buffer), mLength(length), mCurrent(buffer), mLineNumber(1) {
-}
-
-Tokenizer::~Tokenizer() {
- if (mFileMap) {
- mFileMap->release();
- } else {
- delete[] mBuffer;
- }
-}
-
-status_t Tokenizer::open(const String8& filename, Tokenizer** outTokenizer) {
- *outTokenizer = NULL;
-
- int result = NO_ERROR;
- int fd = ::open(filename.string(), O_RDONLY);
- if (fd < 0) {
- result = -errno;
- ALOGE("Error opening file '%s', %s.", filename.string(), strerror(errno));
- } else {
- struct stat stat;
- if (fstat(fd, &stat)) {
- result = -errno;
- ALOGE("Error getting size of file '%s', %s.", filename.string(), strerror(errno));
- } else {
- size_t length = size_t(stat.st_size);
-
- FileMap* fileMap = new FileMap();
- char* buffer;
- if (fileMap->create(NULL, fd, 0, length, true)) {
- fileMap->advise(FileMap::SEQUENTIAL);
- buffer = static_cast<char*>(fileMap->getDataPtr());
- } else {
- fileMap->release();
- fileMap = NULL;
-
- // Fall back to reading into a buffer since we can't mmap files in sysfs.
- // The length we obtained from stat is wrong too (it will always be 4096)
- // so we must trust that read will read the entire file.
- buffer = new char[length];
- ssize_t nrd = read(fd, buffer, length);
- if (nrd < 0) {
- result = -errno;
- ALOGE("Error reading file '%s', %s.", filename.string(), strerror(errno));
- delete[] buffer;
- buffer = NULL;
- } else {
- length = size_t(nrd);
- }
- }
-
- if (!result) {
- *outTokenizer = new Tokenizer(filename, fileMap, buffer, length);
- }
- }
- close(fd);
- }
- return result;
-}
-
-String8 Tokenizer::getLocation() const {
- String8 result;
- result.appendFormat("%s:%d", mFilename.string(), mLineNumber);
- return result;
-}
-
-String8 Tokenizer::peekRemainderOfLine() const {
- const char* end = getEnd();
- const char* eol = mCurrent;
- while (eol != end) {
- char ch = *eol;
- if (ch == '\n') {
- break;
- }
- eol += 1;
- }
- return String8(mCurrent, eol - mCurrent);
-}
-
-String8 Tokenizer::nextToken(const char* delimiters) {
-#if DEBUG_TOKENIZER
- ALOGD("nextToken");
-#endif
- const char* end = getEnd();
- const char* tokenStart = mCurrent;
- while (mCurrent != end) {
- char ch = *mCurrent;
- if (ch == '\n' || isDelimiter(ch, delimiters)) {
- break;
- }
- mCurrent += 1;
- }
- return String8(tokenStart, mCurrent - tokenStart);
-}
-
-void Tokenizer::nextLine() {
-#if DEBUG_TOKENIZER
- ALOGD("nextLine");
-#endif
- const char* end = getEnd();
- while (mCurrent != end) {
- char ch = *(mCurrent++);
- if (ch == '\n') {
- mLineNumber += 1;
- break;
- }
- }
-}
-
-void Tokenizer::skipDelimiters(const char* delimiters) {
-#if DEBUG_TOKENIZER
- ALOGD("skipDelimiters");
-#endif
- const char* end = getEnd();
- while (mCurrent != end) {
- char ch = *mCurrent;
- if (ch == '\n' || !isDelimiter(ch, delimiters)) {
- break;
- }
- mCurrent += 1;
- }
-}
-
-} // namespace android
diff --git a/libs/utils/Trace.cpp b/libs/utils/Trace.cpp
deleted file mode 100644
index c49278a..0000000
--- a/libs/utils/Trace.cpp
+++ /dev/null
@@ -1,47 +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.
- */
-
-#include <cutils/properties.h>
-#include <utils/Log.h>
-#include <utils/Trace.h>
-
-namespace android {
-
-volatile int32_t Tracer::sIsReady = 0;
-int Tracer::sTraceFD = -1;
-uint64_t Tracer::sEnabledTags = 0;
-Mutex Tracer::sMutex;
-
-void Tracer::init() {
- Mutex::Autolock lock(sMutex);
-
- if (!sIsReady) {
- const char* const traceFileName =
- "/sys/kernel/debug/tracing/trace_marker";
- sTraceFD = open(traceFileName, O_WRONLY);
- if (sTraceFD == -1) {
- ALOGE("error opening trace file: %s (%d)", strerror(errno), errno);
- } else {
- char value[PROPERTY_VALUE_MAX];
- property_get("atrace.tags.enableflags", value, "0");
- sEnabledTags = strtoll(value, NULL, 0) | ATRACE_TAG_ALWAYS;
- }
-
- android_atomic_release_store(1, &sIsReady);
- }
-}
-
-} // namespace andoid
diff --git a/libs/utils/Unicode.cpp b/libs/utils/Unicode.cpp
deleted file mode 100644
index 41cbf03..0000000
--- a/libs/utils/Unicode.cpp
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#include <utils/Unicode.h>
-
-#include <stddef.h>
-
-#ifdef HAVE_WINSOCK
-# undef nhtol
-# undef htonl
-# undef nhtos
-# undef htons
-
-# ifdef HAVE_LITTLE_ENDIAN
-# define ntohl(x) ( ((x) << 24) | (((x) >> 24) & 255) | (((x) << 8) & 0xff0000) | (((x) >> 8) & 0xff00) )
-# define htonl(x) ntohl(x)
-# define ntohs(x) ( (((x) << 8) & 0xff00) | (((x) >> 8) & 255) )
-# define htons(x) ntohs(x)
-# else
-# define ntohl(x) (x)
-# define htonl(x) (x)
-# define ntohs(x) (x)
-# define htons(x) (x)
-# endif
-#else
-# include <netinet/in.h>
-#endif
-
-extern "C" {
-
-static const char32_t kByteMask = 0x000000BF;
-static const char32_t kByteMark = 0x00000080;
-
-// Surrogates aren't valid for UTF-32 characters, so define some
-// constants that will let us screen them out.
-static const char32_t kUnicodeSurrogateHighStart = 0x0000D800;
-static const char32_t kUnicodeSurrogateHighEnd = 0x0000DBFF;
-static const char32_t kUnicodeSurrogateLowStart = 0x0000DC00;
-static const char32_t kUnicodeSurrogateLowEnd = 0x0000DFFF;
-static const char32_t kUnicodeSurrogateStart = kUnicodeSurrogateHighStart;
-static const char32_t kUnicodeSurrogateEnd = kUnicodeSurrogateLowEnd;
-static const char32_t kUnicodeMaxCodepoint = 0x0010FFFF;
-
-// Mask used to set appropriate bits in first byte of UTF-8 sequence,
-// indexed by number of bytes in the sequence.
-// 0xxxxxxx
-// -> (00-7f) 7bit. Bit mask for the first byte is 0x00000000
-// 110yyyyx 10xxxxxx
-// -> (c0-df)(80-bf) 11bit. Bit mask is 0x000000C0
-// 1110yyyy 10yxxxxx 10xxxxxx
-// -> (e0-ef)(80-bf)(80-bf) 16bit. Bit mask is 0x000000E0
-// 11110yyy 10yyxxxx 10xxxxxx 10xxxxxx
-// -> (f0-f7)(80-bf)(80-bf)(80-bf) 21bit. Bit mask is 0x000000F0
-static const char32_t kFirstByteMark[] = {
- 0x00000000, 0x00000000, 0x000000C0, 0x000000E0, 0x000000F0
-};
-
-// --------------------------------------------------------------------------
-// UTF-32
-// --------------------------------------------------------------------------
-
-/**
- * Return number of UTF-8 bytes required for the character. If the character
- * is invalid, return size of 0.
- */
-static inline size_t utf32_codepoint_utf8_length(char32_t srcChar)
-{
- // Figure out how many bytes the result will require.
- if (srcChar < 0x00000080) {
- return 1;
- } else if (srcChar < 0x00000800) {
- return 2;
- } else if (srcChar < 0x00010000) {
- if ((srcChar < kUnicodeSurrogateStart) || (srcChar > kUnicodeSurrogateEnd)) {
- return 3;
- } else {
- // Surrogates are invalid UTF-32 characters.
- return 0;
- }
- }
- // Max code point for Unicode is 0x0010FFFF.
- else if (srcChar <= kUnicodeMaxCodepoint) {
- return 4;
- } else {
- // Invalid UTF-32 character.
- return 0;
- }
-}
-
-// Write out the source character to <dstP>.
-
-static inline void utf32_codepoint_to_utf8(uint8_t* dstP, char32_t srcChar, size_t bytes)
-{
- dstP += bytes;
- switch (bytes)
- { /* note: everything falls through. */
- case 4: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
- case 3: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
- case 2: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
- case 1: *--dstP = (uint8_t)(srcChar | kFirstByteMark[bytes]);
- }
-}
-
-size_t strlen32(const char32_t *s)
-{
- const char32_t *ss = s;
- while ( *ss )
- ss++;
- return ss-s;
-}
-
-size_t strnlen32(const char32_t *s, size_t maxlen)
-{
- const char32_t *ss = s;
- while ((maxlen > 0) && *ss) {
- ss++;
- maxlen--;
- }
- return ss-s;
-}
-
-static inline int32_t utf32_at_internal(const char* cur, size_t *num_read)
-{
- const char first_char = *cur;
- if ((first_char & 0x80) == 0) { // ASCII
- *num_read = 1;
- return *cur;
- }
- cur++;
- char32_t mask, to_ignore_mask;
- size_t num_to_read = 0;
- char32_t utf32 = first_char;
- for (num_to_read = 1, mask = 0x40, to_ignore_mask = 0xFFFFFF80;
- (first_char & mask);
- num_to_read++, to_ignore_mask |= mask, mask >>= 1) {
- // 0x3F == 00111111
- utf32 = (utf32 << 6) + (*cur++ & 0x3F);
- }
- to_ignore_mask |= mask;
- utf32 &= ~(to_ignore_mask << (6 * (num_to_read - 1)));
-
- *num_read = num_to_read;
- return static_cast<int32_t>(utf32);
-}
-
-int32_t utf32_from_utf8_at(const char *src, size_t src_len, size_t index, size_t *next_index)
-{
- if (index >= src_len) {
- return -1;
- }
- size_t dummy_index;
- if (next_index == NULL) {
- next_index = &dummy_index;
- }
- size_t num_read;
- int32_t ret = utf32_at_internal(src + index, &num_read);
- if (ret >= 0) {
- *next_index = index + num_read;
- }
-
- return ret;
-}
-
-ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len)
-{
- if (src == NULL || src_len == 0) {
- return -1;
- }
-
- size_t ret = 0;
- const char32_t *end = src + src_len;
- while (src < end) {
- ret += utf32_codepoint_utf8_length(*src++);
- }
- return ret;
-}
-
-void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst)
-{
- if (src == NULL || src_len == 0 || dst == NULL) {
- return;
- }
-
- const char32_t *cur_utf32 = src;
- const char32_t *end_utf32 = src + src_len;
- char *cur = dst;
- while (cur_utf32 < end_utf32) {
- size_t len = utf32_codepoint_utf8_length(*cur_utf32);
- utf32_codepoint_to_utf8((uint8_t *)cur, *cur_utf32++, len);
- cur += len;
- }
- *cur = '\0';
-}
-
-// --------------------------------------------------------------------------
-// UTF-16
-// --------------------------------------------------------------------------
-
-int strcmp16(const char16_t *s1, const char16_t *s2)
-{
- char16_t ch;
- int d = 0;
-
- while ( 1 ) {
- d = (int)(ch = *s1++) - (int)*s2++;
- if ( d || !ch )
- break;
- }
-
- return d;
-}
-
-int strncmp16(const char16_t *s1, const char16_t *s2, size_t n)
-{
- char16_t ch;
- int d = 0;
-
- while ( n-- ) {
- d = (int)(ch = *s1++) - (int)*s2++;
- if ( d || !ch )
- break;
- }
-
- return d;
-}
-
-char16_t *strcpy16(char16_t *dst, const char16_t *src)
-{
- char16_t *q = dst;
- const char16_t *p = src;
- char16_t ch;
-
- do {
- *q++ = ch = *p++;
- } while ( ch );
-
- return dst;
-}
-
-size_t strlen16(const char16_t *s)
-{
- const char16_t *ss = s;
- while ( *ss )
- ss++;
- return ss-s;
-}
-
-
-char16_t *strncpy16(char16_t *dst, const char16_t *src, size_t n)
-{
- char16_t *q = dst;
- const char16_t *p = src;
- char ch;
-
- while (n) {
- n--;
- *q++ = ch = *p++;
- if ( !ch )
- break;
- }
-
- *q = 0;
-
- return dst;
-}
-
-size_t strnlen16(const char16_t *s, size_t maxlen)
-{
- const char16_t *ss = s;
-
- /* Important: the maxlen test must precede the reference through ss;
- since the byte beyond the maximum may segfault */
- while ((maxlen > 0) && *ss) {
- ss++;
- maxlen--;
- }
- return ss-s;
-}
-
-int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2)
-{
- const char16_t* e1 = s1+n1;
- const char16_t* e2 = s2+n2;
-
- while (s1 < e1 && s2 < e2) {
- const int d = (int)*s1++ - (int)*s2++;
- if (d) {
- return d;
- }
- }
-
- return n1 < n2
- ? (0 - (int)*s2)
- : (n1 > n2
- ? ((int)*s1 - 0)
- : 0);
-}
-
-int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2)
-{
- const char16_t* e1 = s1H+n1;
- const char16_t* e2 = s2N+n2;
-
- while (s1H < e1 && s2N < e2) {
- const char16_t c2 = ntohs(*s2N);
- const int d = (int)*s1H++ - (int)c2;
- s2N++;
- if (d) {
- return d;
- }
- }
-
- return n1 < n2
- ? (0 - (int)ntohs(*s2N))
- : (n1 > n2
- ? ((int)*s1H - 0)
- : 0);
-}
-
-void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst)
-{
- if (src == NULL || src_len == 0 || dst == NULL) {
- return;
- }
-
- const char16_t* cur_utf16 = src;
- const char16_t* const end_utf16 = src + src_len;
- char *cur = dst;
- while (cur_utf16 < end_utf16) {
- char32_t utf32;
- // surrogate pairs
- if ((*cur_utf16 & 0xFC00) == 0xD800) {
- utf32 = (*cur_utf16++ - 0xD800) << 10;
- utf32 |= *cur_utf16++ - 0xDC00;
- utf32 += 0x10000;
- } else {
- utf32 = (char32_t) *cur_utf16++;
- }
- const size_t len = utf32_codepoint_utf8_length(utf32);
- utf32_codepoint_to_utf8((uint8_t*)cur, utf32, len);
- cur += len;
- }
- *cur = '\0';
-}
-
-// --------------------------------------------------------------------------
-// UTF-8
-// --------------------------------------------------------------------------
-
-ssize_t utf8_length(const char *src)
-{
- const char *cur = src;
- size_t ret = 0;
- while (*cur != '\0') {
- const char first_char = *cur++;
- if ((first_char & 0x80) == 0) { // ASCII
- ret += 1;
- continue;
- }
- // (UTF-8's character must not be like 10xxxxxx,
- // but 110xxxxx, 1110xxxx, ... or 1111110x)
- if ((first_char & 0x40) == 0) {
- return -1;
- }
-
- int32_t mask, to_ignore_mask;
- size_t num_to_read = 0;
- char32_t utf32 = 0;
- for (num_to_read = 1, mask = 0x40, to_ignore_mask = 0x80;
- num_to_read < 5 && (first_char & mask);
- num_to_read++, to_ignore_mask |= mask, mask >>= 1) {
- if ((*cur & 0xC0) != 0x80) { // must be 10xxxxxx
- return -1;
- }
- // 0x3F == 00111111
- utf32 = (utf32 << 6) + (*cur++ & 0x3F);
- }
- // "first_char" must be (110xxxxx - 11110xxx)
- if (num_to_read == 5) {
- return -1;
- }
- to_ignore_mask |= mask;
- utf32 |= ((~to_ignore_mask) & first_char) << (6 * (num_to_read - 1));
- if (utf32 > kUnicodeMaxCodepoint) {
- return -1;
- }
-
- ret += num_to_read;
- }
- return ret;
-}
-
-ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len)
-{
- if (src == NULL || src_len == 0) {
- return -1;
- }
-
- size_t ret = 0;
- const char16_t* const end = src + src_len;
- while (src < end) {
- if ((*src & 0xFC00) == 0xD800 && (src + 1) < end
- && (*++src & 0xFC00) == 0xDC00) {
- // surrogate pairs are always 4 bytes.
- ret += 4;
- src++;
- } else {
- ret += utf32_codepoint_utf8_length((char32_t) *src++);
- }
- }
- return ret;
-}
-
-/**
- * Returns 1-4 based on the number of leading bits.
- *
- * 1111 -> 4
- * 1110 -> 3
- * 110x -> 2
- * 10xx -> 1
- * 0xxx -> 1
- */
-static inline size_t utf8_codepoint_len(uint8_t ch)
-{
- return ((0xe5000000 >> ((ch >> 3) & 0x1e)) & 3) + 1;
-}
-
-static inline void utf8_shift_and_mask(uint32_t* codePoint, const uint8_t byte)
-{
- *codePoint <<= 6;
- *codePoint |= 0x3F & byte;
-}
-
-size_t utf8_to_utf32_length(const char *src, size_t src_len)
-{
- if (src == NULL || src_len == 0) {
- return 0;
- }
- size_t ret = 0;
- const char* cur;
- const char* end;
- size_t num_to_skip;
- for (cur = src, end = src + src_len, num_to_skip = 1;
- cur < end;
- cur += num_to_skip, ret++) {
- const char first_char = *cur;
- num_to_skip = 1;
- if ((first_char & 0x80) == 0) { // ASCII
- continue;
- }
- int32_t mask;
-
- for (mask = 0x40; (first_char & mask); num_to_skip++, mask >>= 1) {
- }
- }
- return ret;
-}
-
-void utf8_to_utf32(const char* src, size_t src_len, char32_t* dst)
-{
- if (src == NULL || src_len == 0 || dst == NULL) {
- return;
- }
-
- const char* cur = src;
- const char* const end = src + src_len;
- char32_t* cur_utf32 = dst;
- while (cur < end) {
- size_t num_read;
- *cur_utf32++ = static_cast<char32_t>(utf32_at_internal(cur, &num_read));
- cur += num_read;
- }
- *cur_utf32 = 0;
-}
-
-static inline uint32_t utf8_to_utf32_codepoint(const uint8_t *src, size_t length)
-{
- uint32_t unicode;
-
- switch (length)
- {
- case 1:
- return src[0];
- case 2:
- unicode = src[0] & 0x1f;
- utf8_shift_and_mask(&unicode, src[1]);
- return unicode;
- case 3:
- unicode = src[0] & 0x0f;
- utf8_shift_and_mask(&unicode, src[1]);
- utf8_shift_and_mask(&unicode, src[2]);
- return unicode;
- case 4:
- unicode = src[0] & 0x07;
- utf8_shift_and_mask(&unicode, src[1]);
- utf8_shift_and_mask(&unicode, src[2]);
- utf8_shift_and_mask(&unicode, src[3]);
- return unicode;
- default:
- return 0xffff;
- }
-
- //printf("Char at %p: len=%d, utf-16=%p\n", src, length, (void*)result);
-}
-
-ssize_t utf8_to_utf16_length(const uint8_t* u8str, size_t u8len)
-{
- const uint8_t* const u8end = u8str + u8len;
- const uint8_t* u8cur = u8str;
-
- /* Validate that the UTF-8 is the correct len */
- size_t u16measuredLen = 0;
- while (u8cur < u8end) {
- u16measuredLen++;
- int u8charLen = utf8_codepoint_len(*u8cur);
- uint32_t codepoint = utf8_to_utf32_codepoint(u8cur, u8charLen);
- if (codepoint > 0xFFFF) u16measuredLen++; // this will be a surrogate pair in utf16
- u8cur += u8charLen;
- }
-
- /**
- * Make sure that we ended where we thought we would and the output UTF-16
- * will be exactly how long we were told it would be.
- */
- if (u8cur != u8end) {
- return -1;
- }
-
- return u16measuredLen;
-}
-
-char16_t* utf8_to_utf16_no_null_terminator(const uint8_t* u8str, size_t u8len, char16_t* u16str)
-{
- const uint8_t* const u8end = u8str + u8len;
- const uint8_t* u8cur = u8str;
- char16_t* u16cur = u16str;
-
- while (u8cur < u8end) {
- size_t u8len = utf8_codepoint_len(*u8cur);
- uint32_t codepoint = utf8_to_utf32_codepoint(u8cur, u8len);
-
- // Convert the UTF32 codepoint to one or more UTF16 codepoints
- if (codepoint <= 0xFFFF) {
- // Single UTF16 character
- *u16cur++ = (char16_t) codepoint;
- } else {
- // Multiple UTF16 characters with surrogates
- codepoint = codepoint - 0x10000;
- *u16cur++ = (char16_t) ((codepoint >> 10) + 0xD800);
- *u16cur++ = (char16_t) ((codepoint & 0x3FF) + 0xDC00);
- }
-
- u8cur += u8len;
- }
- return u16cur;
-}
-
-void utf8_to_utf16(const uint8_t* u8str, size_t u8len, char16_t* u16str) {
- char16_t* end = utf8_to_utf16_no_null_terminator(u8str, u8len, u16str);
- *end = 0;
-}
-
-}
diff --git a/libs/utils/VectorImpl.cpp b/libs/utils/VectorImpl.cpp
deleted file mode 100644
index 220ae3e..0000000
--- a/libs/utils/VectorImpl.cpp
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-#define LOG_TAG "Vector"
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <utils/Log.h>
-#include <utils/Errors.h>
-#include <utils/SharedBuffer.h>
-#include <utils/VectorImpl.h>
-
-/*****************************************************************************/
-
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-const size_t kMinVectorCapacity = 4;
-
-static inline size_t max(size_t a, size_t b) {
- return a>b ? a : b;
-}
-
-// ----------------------------------------------------------------------------
-
-VectorImpl::VectorImpl(size_t itemSize, uint32_t flags)
- : mStorage(0), mCount(0), mFlags(flags), mItemSize(itemSize)
-{
-}
-
-VectorImpl::VectorImpl(const VectorImpl& rhs)
- : mStorage(rhs.mStorage), mCount(rhs.mCount),
- mFlags(rhs.mFlags), mItemSize(rhs.mItemSize)
-{
- if (mStorage) {
- SharedBuffer::sharedBuffer(mStorage)->acquire();
- }
-}
-
-VectorImpl::~VectorImpl()
-{
- ALOG_ASSERT(!mCount,
- "[%p] "
- "subclasses of VectorImpl must call finish_vector()"
- " in their destructor. Leaking %d bytes.",
- this, (int)(mCount*mItemSize));
- // We can't call _do_destroy() here because the vtable is already gone.
-}
-
-VectorImpl& VectorImpl::operator = (const VectorImpl& rhs)
-{
- ALOG_ASSERT(mItemSize == rhs.mItemSize,
- "Vector<> have different types (this=%p, rhs=%p)", this, &rhs);
- if (this != &rhs) {
- release_storage();
- if (rhs.mCount) {
- mStorage = rhs.mStorage;
- mCount = rhs.mCount;
- SharedBuffer::sharedBuffer(mStorage)->acquire();
- } else {
- mStorage = 0;
- mCount = 0;
- }
- }
- return *this;
-}
-
-void* VectorImpl::editArrayImpl()
-{
- if (mStorage) {
- SharedBuffer* sb = SharedBuffer::sharedBuffer(mStorage)->attemptEdit();
- if (sb == 0) {
- sb = SharedBuffer::alloc(capacity() * mItemSize);
- if (sb) {
- _do_copy(sb->data(), mStorage, mCount);
- release_storage();
- mStorage = sb->data();
- }
- }
- }
- return mStorage;
-}
-
-size_t VectorImpl::capacity() const
-{
- if (mStorage) {
- return SharedBuffer::sharedBuffer(mStorage)->size() / mItemSize;
- }
- return 0;
-}
-
-ssize_t VectorImpl::insertVectorAt(const VectorImpl& vector, size_t index)
-{
- return insertArrayAt(vector.arrayImpl(), index, vector.size());
-}
-
-ssize_t VectorImpl::appendVector(const VectorImpl& vector)
-{
- return insertVectorAt(vector, size());
-}
-
-ssize_t VectorImpl::insertArrayAt(const void* array, size_t index, size_t length)
-{
- if (index > size())
- return BAD_INDEX;
- void* where = _grow(index, length);
- if (where) {
- _do_copy(where, array, length);
- }
- return where ? index : (ssize_t)NO_MEMORY;
-}
-
-ssize_t VectorImpl::appendArray(const void* array, size_t length)
-{
- return insertArrayAt(array, size(), length);
-}
-
-ssize_t VectorImpl::insertAt(size_t index, size_t numItems)
-{
- return insertAt(0, index, numItems);
-}
-
-ssize_t VectorImpl::insertAt(const void* item, size_t index, size_t numItems)
-{
- if (index > size())
- return BAD_INDEX;
- void* where = _grow(index, numItems);
- if (where) {
- if (item) {
- _do_splat(where, item, numItems);
- } else {
- _do_construct(where, numItems);
- }
- }
- return where ? index : (ssize_t)NO_MEMORY;
-}
-
-static int sortProxy(const void* lhs, const void* rhs, void* func)
-{
- return (*(VectorImpl::compar_t)func)(lhs, rhs);
-}
-
-status_t VectorImpl::sort(VectorImpl::compar_t cmp)
-{
- return sort(sortProxy, (void*)cmp);
-}
-
-status_t VectorImpl::sort(VectorImpl::compar_r_t cmp, void* state)
-{
- // the sort must be stable. we're using insertion sort which
- // is well suited for small and already sorted arrays
- // for big arrays, it could be better to use mergesort
- const ssize_t count = size();
- if (count > 1) {
- void* array = const_cast<void*>(arrayImpl());
- void* temp = 0;
- ssize_t i = 1;
- while (i < count) {
- void* item = reinterpret_cast<char*>(array) + mItemSize*(i);
- void* curr = reinterpret_cast<char*>(array) + mItemSize*(i-1);
- if (cmp(curr, item, state) > 0) {
-
- if (!temp) {
- // we're going to have to modify the array...
- array = editArrayImpl();
- if (!array) return NO_MEMORY;
- temp = malloc(mItemSize);
- if (!temp) return NO_MEMORY;
- item = reinterpret_cast<char*>(array) + mItemSize*(i);
- curr = reinterpret_cast<char*>(array) + mItemSize*(i-1);
- } else {
- _do_destroy(temp, 1);
- }
-
- _do_copy(temp, item, 1);
-
- ssize_t j = i-1;
- void* next = reinterpret_cast<char*>(array) + mItemSize*(i);
- do {
- _do_destroy(next, 1);
- _do_copy(next, curr, 1);
- next = curr;
- --j;
- curr = reinterpret_cast<char*>(array) + mItemSize*(j);
- } while (j>=0 && (cmp(curr, temp, state) > 0));
-
- _do_destroy(next, 1);
- _do_copy(next, temp, 1);
- }
- i++;
- }
-
- if (temp) {
- _do_destroy(temp, 1);
- free(temp);
- }
- }
- return NO_ERROR;
-}
-
-void VectorImpl::pop()
-{
- if (size())
- removeItemsAt(size()-1, 1);
-}
-
-void VectorImpl::push()
-{
- push(0);
-}
-
-void VectorImpl::push(const void* item)
-{
- insertAt(item, size());
-}
-
-ssize_t VectorImpl::add()
-{
- return add(0);
-}
-
-ssize_t VectorImpl::add(const void* item)
-{
- return insertAt(item, size());
-}
-
-ssize_t VectorImpl::replaceAt(size_t index)
-{
- return replaceAt(0, index);
-}
-
-ssize_t VectorImpl::replaceAt(const void* prototype, size_t index)
-{
- ALOG_ASSERT(index<size(),
- "[%p] replace: index=%d, size=%d", this, (int)index, (int)size());
-
- void* item = editItemLocation(index);
- if (item != prototype) {
- if (item == 0)
- return NO_MEMORY;
- _do_destroy(item, 1);
- if (prototype == 0) {
- _do_construct(item, 1);
- } else {
- _do_copy(item, prototype, 1);
- }
- }
- return ssize_t(index);
-}
-
-ssize_t VectorImpl::removeItemsAt(size_t index, size_t count)
-{
- ALOG_ASSERT((index+count)<=size(),
- "[%p] remove: index=%d, count=%d, size=%d",
- this, (int)index, (int)count, (int)size());
-
- if ((index+count) > size())
- return BAD_VALUE;
- _shrink(index, count);
- return index;
-}
-
-void VectorImpl::finish_vector()
-{
- release_storage();
- mStorage = 0;
- mCount = 0;
-}
-
-void VectorImpl::clear()
-{
- _shrink(0, mCount);
-}
-
-void* VectorImpl::editItemLocation(size_t index)
-{
- ALOG_ASSERT(index<capacity(),
- "[%p] editItemLocation: index=%d, capacity=%d, count=%d",
- this, (int)index, (int)capacity(), (int)mCount);
-
- void* buffer = editArrayImpl();
- if (buffer)
- return reinterpret_cast<char*>(buffer) + index*mItemSize;
- return 0;
-}
-
-const void* VectorImpl::itemLocation(size_t index) const
-{
- ALOG_ASSERT(index<capacity(),
- "[%p] itemLocation: index=%d, capacity=%d, count=%d",
- this, (int)index, (int)capacity(), (int)mCount);
-
- const void* buffer = arrayImpl();
- if (buffer)
- return reinterpret_cast<const char*>(buffer) + index*mItemSize;
- return 0;
-}
-
-ssize_t VectorImpl::setCapacity(size_t new_capacity)
-{
- size_t current_capacity = capacity();
- ssize_t amount = new_capacity - size();
- if (amount <= 0) {
- // we can't reduce the capacity
- return current_capacity;
- }
- SharedBuffer* sb = SharedBuffer::alloc(new_capacity * mItemSize);
- if (sb) {
- void* array = sb->data();
- _do_copy(array, mStorage, size());
- release_storage();
- mStorage = const_cast<void*>(array);
- } else {
- return NO_MEMORY;
- }
- return new_capacity;
-}
-
-void VectorImpl::release_storage()
-{
- if (mStorage) {
- const SharedBuffer* sb = SharedBuffer::sharedBuffer(mStorage);
- if (sb->release(SharedBuffer::eKeepStorage) == 1) {
- _do_destroy(mStorage, mCount);
- SharedBuffer::dealloc(sb);
- }
- }
-}
-
-void* VectorImpl::_grow(size_t where, size_t amount)
-{
-// ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
-// this, (int)where, (int)amount, (int)mCount, (int)capacity());
-
- ALOG_ASSERT(where <= mCount,
- "[%p] _grow: where=%d, amount=%d, count=%d",
- this, (int)where, (int)amount, (int)mCount); // caller already checked
-
- const size_t new_size = mCount + amount;
- if (capacity() < new_size) {
- const size_t new_capacity = max(kMinVectorCapacity, ((new_size*3)+1)/2);
-// ALOGV("grow vector %p, new_capacity=%d", this, (int)new_capacity);
- if ((mStorage) &&
- (mCount==where) &&
- (mFlags & HAS_TRIVIAL_COPY) &&
- (mFlags & HAS_TRIVIAL_DTOR))
- {
- const SharedBuffer* cur_sb = SharedBuffer::sharedBuffer(mStorage);
- SharedBuffer* sb = cur_sb->editResize(new_capacity * mItemSize);
- mStorage = sb->data();
- } else {
- SharedBuffer* sb = SharedBuffer::alloc(new_capacity * mItemSize);
- if (sb) {
- void* array = sb->data();
- if (where != 0) {
- _do_copy(array, mStorage, where);
- }
- if (where != mCount) {
- const void* from = reinterpret_cast<const uint8_t *>(mStorage) + where*mItemSize;
- void* dest = reinterpret_cast<uint8_t *>(array) + (where+amount)*mItemSize;
- _do_copy(dest, from, mCount-where);
- }
- release_storage();
- mStorage = const_cast<void*>(array);
- }
- }
- } else {
- if (where != mCount) {
- void* array = editArrayImpl();
- const void* from = reinterpret_cast<const uint8_t *>(array) + where*mItemSize;
- void* to = reinterpret_cast<uint8_t *>(array) + (where+amount)*mItemSize;
- _do_move_forward(to, from, mCount - where);
- }
- }
- mCount = new_size;
- void* free_space = const_cast<void*>(itemLocation(where));
- return free_space;
-}
-
-void VectorImpl::_shrink(size_t where, size_t amount)
-{
- if (!mStorage)
- return;
-
-// ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
-// this, (int)where, (int)amount, (int)mCount, (int)capacity());
-
- ALOG_ASSERT(where + amount <= mCount,
- "[%p] _shrink: where=%d, amount=%d, count=%d",
- this, (int)where, (int)amount, (int)mCount); // caller already checked
-
- const size_t new_size = mCount - amount;
- if (new_size*3 < capacity()) {
- const size_t new_capacity = max(kMinVectorCapacity, new_size*2);
-// ALOGV("shrink vector %p, new_capacity=%d", this, (int)new_capacity);
- if ((where == new_size) &&
- (mFlags & HAS_TRIVIAL_COPY) &&
- (mFlags & HAS_TRIVIAL_DTOR))
- {
- const SharedBuffer* cur_sb = SharedBuffer::sharedBuffer(mStorage);
- SharedBuffer* sb = cur_sb->editResize(new_capacity * mItemSize);
- mStorage = sb->data();
- } else {
- SharedBuffer* sb = SharedBuffer::alloc(new_capacity * mItemSize);
- if (sb) {
- void* array = sb->data();
- if (where != 0) {
- _do_copy(array, mStorage, where);
- }
- if (where != new_size) {
- const void* from = reinterpret_cast<const uint8_t *>(mStorage) + (where+amount)*mItemSize;
- void* dest = reinterpret_cast<uint8_t *>(array) + where*mItemSize;
- _do_copy(dest, from, new_size - where);
- }
- release_storage();
- mStorage = const_cast<void*>(array);
- }
- }
- } else {
- void* array = editArrayImpl();
- void* to = reinterpret_cast<uint8_t *>(array) + where*mItemSize;
- _do_destroy(to, amount);
- if (where != new_size) {
- const void* from = reinterpret_cast<uint8_t *>(array) + (where+amount)*mItemSize;
- _do_move_backward(to, from, new_size - where);
- }
- }
- mCount = new_size;
-}
-
-size_t VectorImpl::itemSize() const {
- return mItemSize;
-}
-
-void VectorImpl::_do_construct(void* storage, size_t num) const
-{
- if (!(mFlags & HAS_TRIVIAL_CTOR)) {
- do_construct(storage, num);
- }
-}
-
-void VectorImpl::_do_destroy(void* storage, size_t num) const
-{
- if (!(mFlags & HAS_TRIVIAL_DTOR)) {
- do_destroy(storage, num);
- }
-}
-
-void VectorImpl::_do_copy(void* dest, const void* from, size_t num) const
-{
- if (!(mFlags & HAS_TRIVIAL_COPY)) {
- do_copy(dest, from, num);
- } else {
- memcpy(dest, from, num*itemSize());
- }
-}
-
-void VectorImpl::_do_splat(void* dest, const void* item, size_t num) const {
- do_splat(dest, item, num);
-}
-
-void VectorImpl::_do_move_forward(void* dest, const void* from, size_t num) const {
- do_move_forward(dest, from, num);
-}
-
-void VectorImpl::_do_move_backward(void* dest, const void* from, size_t num) const {
- do_move_backward(dest, from, num);
-}
-
-void VectorImpl::reservedVectorImpl1() { }
-void VectorImpl::reservedVectorImpl2() { }
-void VectorImpl::reservedVectorImpl3() { }
-void VectorImpl::reservedVectorImpl4() { }
-void VectorImpl::reservedVectorImpl5() { }
-void VectorImpl::reservedVectorImpl6() { }
-void VectorImpl::reservedVectorImpl7() { }
-void VectorImpl::reservedVectorImpl8() { }
-
-/*****************************************************************************/
-
-SortedVectorImpl::SortedVectorImpl(size_t itemSize, uint32_t flags)
- : VectorImpl(itemSize, flags)
-{
-}
-
-SortedVectorImpl::SortedVectorImpl(const VectorImpl& rhs)
-: VectorImpl(rhs)
-{
-}
-
-SortedVectorImpl::~SortedVectorImpl()
-{
-}
-
-SortedVectorImpl& SortedVectorImpl::operator = (const SortedVectorImpl& rhs)
-{
- return static_cast<SortedVectorImpl&>( VectorImpl::operator = (static_cast<const VectorImpl&>(rhs)) );
-}
-
-ssize_t SortedVectorImpl::indexOf(const void* item) const
-{
- return _indexOrderOf(item);
-}
-
-size_t SortedVectorImpl::orderOf(const void* item) const
-{
- size_t o;
- _indexOrderOf(item, &o);
- return o;
-}
-
-ssize_t SortedVectorImpl::_indexOrderOf(const void* item, size_t* order) const
-{
- // binary search
- ssize_t err = NAME_NOT_FOUND;
- ssize_t l = 0;
- ssize_t h = size()-1;
- ssize_t mid;
- const void* a = arrayImpl();
- const size_t s = itemSize();
- while (l <= h) {
- mid = l + (h - l)/2;
- const void* const curr = reinterpret_cast<const char *>(a) + (mid*s);
- const int c = do_compare(curr, item);
- if (c == 0) {
- err = l = mid;
- break;
- } else if (c < 0) {
- l = mid + 1;
- } else {
- h = mid - 1;
- }
- }
- if (order) *order = l;
- return err;
-}
-
-ssize_t SortedVectorImpl::add(const void* item)
-{
- size_t order;
- ssize_t index = _indexOrderOf(item, &order);
- if (index < 0) {
- index = VectorImpl::insertAt(item, order, 1);
- } else {
- index = VectorImpl::replaceAt(item, index);
- }
- return index;
-}
-
-ssize_t SortedVectorImpl::merge(const VectorImpl& vector)
-{
- // naive merge...
- if (!vector.isEmpty()) {
- const void* buffer = vector.arrayImpl();
- const size_t is = itemSize();
- size_t s = vector.size();
- for (size_t i=0 ; i<s ; i++) {
- ssize_t err = add( reinterpret_cast<const char*>(buffer) + i*is );
- if (err<0) {
- return err;
- }
- }
- }
- return NO_ERROR;
-}
-
-ssize_t SortedVectorImpl::merge(const SortedVectorImpl& vector)
-{
- // we've merging a sorted vector... nice!
- ssize_t err = NO_ERROR;
- if (!vector.isEmpty()) {
- // first take care of the case where the vectors are sorted together
- if (do_compare(vector.itemLocation(vector.size()-1), arrayImpl()) <= 0) {
- err = VectorImpl::insertVectorAt(static_cast<const VectorImpl&>(vector), 0);
- } else if (do_compare(vector.arrayImpl(), itemLocation(size()-1)) >= 0) {
- err = VectorImpl::appendVector(static_cast<const VectorImpl&>(vector));
- } else {
- // this could be made a little better
- err = merge(static_cast<const VectorImpl&>(vector));
- }
- }
- return err;
-}
-
-ssize_t SortedVectorImpl::remove(const void* item)
-{
- ssize_t i = indexOf(item);
- if (i>=0) {
- VectorImpl::removeItemsAt(i, 1);
- }
- return i;
-}
-
-void SortedVectorImpl::reservedSortedVectorImpl1() { };
-void SortedVectorImpl::reservedSortedVectorImpl2() { };
-void SortedVectorImpl::reservedSortedVectorImpl3() { };
-void SortedVectorImpl::reservedSortedVectorImpl4() { };
-void SortedVectorImpl::reservedSortedVectorImpl5() { };
-void SortedVectorImpl::reservedSortedVectorImpl6() { };
-void SortedVectorImpl::reservedSortedVectorImpl7() { };
-void SortedVectorImpl::reservedSortedVectorImpl8() { };
-
-
-/*****************************************************************************/
-
-}; // namespace android
-
diff --git a/libs/utils/misc.cpp b/libs/utils/misc.cpp
deleted file mode 100644
index dc89d15..0000000
--- a/libs/utils/misc.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-//
-// Miscellaneous utility functions.
-//
-#include <utils/misc.h>
-
-#include <sys/stat.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-#include <stdio.h>
-
-using namespace android;
-
-namespace android {
-
-/*
- * Like strdup(), but uses C++ "new" operator instead of malloc.
- */
-char* strdupNew(const char* str)
-{
- char* newStr;
- int len;
-
- if (str == NULL)
- return NULL;
-
- len = strlen(str);
- newStr = new char[len+1];
- memcpy(newStr, str, len+1);
-
- return newStr;
-}
-
-/*
- * Concatenate an argument vector.
- */
-char* concatArgv(int argc, const char* const argv[])
-{
- char* newStr = NULL;
- int len, totalLen, posn, idx;
-
- /*
- * First, figure out the total length.
- */
- totalLen = idx = 0;
- while (1) {
- if (idx == argc || argv[idx] == NULL)
- break;
- if (idx)
- totalLen++; // leave a space between args
- totalLen += strlen(argv[idx]);
- idx++;
- }
-
- /*
- * Alloc the string.
- */
- newStr = new char[totalLen +1];
- if (newStr == NULL)
- return NULL;
-
- /*
- * Finally, allocate the string and copy data over.
- */
- idx = posn = 0;
- while (1) {
- if (idx == argc || argv[idx] == NULL)
- break;
- if (idx)
- newStr[posn++] = ' ';
-
- len = strlen(argv[idx]);
- memcpy(&newStr[posn], argv[idx], len);
- posn += len;
-
- idx++;
- }
-
- assert(posn == totalLen);
- newStr[posn] = '\0';
-
- return newStr;
-}
-
-/*
- * Count the #of args in an argument vector. Don't count the final NULL.
- */
-int countArgv(const char* const argv[])
-{
- int count = 0;
-
- while (argv[count] != NULL)
- count++;
-
- return count;
-}
-
-
-#include <stdio.h>
-/*
- * Get a file's type.
- */
-FileType getFileType(const char* fileName)
-{
- struct stat sb;
-
- if (stat(fileName, &sb) < 0) {
- if (errno == ENOENT || errno == ENOTDIR)
- return kFileTypeNonexistent;
- else {
- fprintf(stderr, "getFileType got errno=%d on '%s'\n",
- errno, fileName);
- return kFileTypeUnknown;
- }
- } else {
- if (S_ISREG(sb.st_mode))
- return kFileTypeRegular;
- else if (S_ISDIR(sb.st_mode))
- return kFileTypeDirectory;
- else if (S_ISCHR(sb.st_mode))
- return kFileTypeCharDev;
- else if (S_ISBLK(sb.st_mode))
- return kFileTypeBlockDev;
- else if (S_ISFIFO(sb.st_mode))
- return kFileTypeFifo;
-#ifdef HAVE_SYMLINKS
- else if (S_ISLNK(sb.st_mode))
- return kFileTypeSymlink;
- else if (S_ISSOCK(sb.st_mode))
- return kFileTypeSocket;
-#endif
- else
- return kFileTypeUnknown;
- }
-}
-
-/*
- * Get a file's modification date.
- */
-time_t getFileModDate(const char* fileName)
-{
- struct stat sb;
-
- if (stat(fileName, &sb) < 0)
- return (time_t) -1;
-
- return sb.st_mtime;
-}
-
-/*
- * Round up to the next highest power of 2.
- *
- * Found on http://graphics.stanford.edu/~seander/bithacks.html.
- */
-unsigned int roundUpPower2(unsigned int val)
-{
- val--;
- val |= val >> 1;
- val |= val >> 2;
- val |= val >> 4;
- val |= val >> 8;
- val |= val >> 16;
- val++;
-
- return val;
-}
-
-}; // namespace android
-
diff --git a/libs/utils/primes.py b/libs/utils/primes.py
deleted file mode 100755
index e161dd8..0000000
--- a/libs/utils/primes.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python2.6
-#
-# Copyright (C) 2011 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.
-#
-
-#
-# Generates a table of prime numbers for use in BasicHashtable.cpp.
-#
-# Each prime is chosen such that it is a little more than twice as large as
-# the previous prime in the table. This makes it easier to choose a new
-# hashtable size when the underlying array is grown by as nominal factor
-# of two each time.
-#
-
-def is_odd_prime(n):
- limit = (n - 1) / 2
- d = 3
- while d <= limit:
- if n % d == 0:
- return False
- d += 2
- return True
-
-print "static size_t PRIMES[] = {"
-
-n = 5
-max = 2**31 - 1
-while n < max:
- print " %d," % (n)
- n = n * 2 + 1
- while not is_odd_prime(n):
- n += 2
-
-print " 0,"
-print "};"
diff --git a/libs/utils/tests/Android.mk b/libs/utils/tests/Android.mk
deleted file mode 100644
index a6811fc..0000000
--- a/libs/utils/tests/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Build the unit tests.
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Build the unit tests.
-test_src_files := \
- BasicHashtable_test.cpp \
- BlobCache_test.cpp \
- Looper_test.cpp \
- String8_test.cpp \
- Unicode_test.cpp \
-
-shared_libraries := \
- libz \
- liblog \
- libcutils \
- libutils \
- libstlport
-
-static_libraries := \
- libgtest \
- libgtest_main
-
-c_includes := \
- external/zlib \
- external/icu4c/common \
- bionic \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport
-
-module_tags := eng tests
-
-$(foreach file,$(test_src_files), \
- $(eval include $(CLEAR_VARS)) \
- $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
- $(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \
- $(eval LOCAL_C_INCLUDES := $(c_includes)) \
- $(eval LOCAL_SRC_FILES := $(file)) \
- $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
- $(eval LOCAL_MODULE_TAGS := $(module_tags)) \
- $(eval include $(BUILD_EXECUTABLE)) \
-)
diff --git a/libs/utils/tests/BasicHashtable_test.cpp b/libs/utils/tests/BasicHashtable_test.cpp
deleted file mode 100644
index 7dcf750..0000000
--- a/libs/utils/tests/BasicHashtable_test.cpp
+++ /dev/null
@@ -1,577 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#define LOG_TAG "BasicHashtable_test"
-
-#include <utils/BasicHashtable.h>
-#include <cutils/log.h>
-#include <gtest/gtest.h>
-#include <unistd.h>
-
-namespace android {
-
-typedef int SimpleKey;
-typedef int SimpleValue;
-typedef key_value_pair_t<SimpleKey, SimpleValue> SimpleEntry;
-typedef BasicHashtable<SimpleKey, SimpleEntry> SimpleHashtable;
-
-struct ComplexKey {
- int k;
-
- explicit ComplexKey(int k) : k(k) {
- instanceCount += 1;
- }
-
- ComplexKey(const ComplexKey& other) : k(other.k) {
- instanceCount += 1;
- }
-
- ~ComplexKey() {
- instanceCount -= 1;
- }
-
- bool operator ==(const ComplexKey& other) const {
- return k == other.k;
- }
-
- bool operator !=(const ComplexKey& other) const {
- return k != other.k;
- }
-
- static ssize_t instanceCount;
-};
-
-ssize_t ComplexKey::instanceCount = 0;
-
-template<> inline hash_t hash_type(const ComplexKey& value) {
- return hash_type(value.k);
-}
-
-struct ComplexValue {
- int v;
-
- explicit ComplexValue(int v) : v(v) {
- instanceCount += 1;
- }
-
- ComplexValue(const ComplexValue& other) : v(other.v) {
- instanceCount += 1;
- }
-
- ~ComplexValue() {
- instanceCount -= 1;
- }
-
- static ssize_t instanceCount;
-};
-
-ssize_t ComplexValue::instanceCount = 0;
-
-typedef key_value_pair_t<ComplexKey, ComplexValue> ComplexEntry;
-typedef BasicHashtable<ComplexKey, ComplexEntry> ComplexHashtable;
-
-class BasicHashtableTest : public testing::Test {
-protected:
- virtual void SetUp() {
- ComplexKey::instanceCount = 0;
- ComplexValue::instanceCount = 0;
- }
-
- virtual void TearDown() {
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
- }
-
- void assertInstanceCount(ssize_t keys, ssize_t values) {
- if (keys != ComplexKey::instanceCount || values != ComplexValue::instanceCount) {
- FAIL() << "Expected " << keys << " keys and " << values << " values "
- "but there were actually " << ComplexKey::instanceCount << " keys and "
- << ComplexValue::instanceCount << " values";
- }
- }
-
-public:
- template <typename TKey, typename TEntry>
- static void cookieAt(const BasicHashtable<TKey, TEntry>& h, size_t index,
- bool* collision, bool* present, hash_t* hash) {
- uint32_t cookie = h.cookieAt(index);
- *collision = cookie & BasicHashtable<TKey, TEntry>::Bucket::COLLISION;
- *present = cookie & BasicHashtable<TKey, TEntry>::Bucket::PRESENT;
- *hash = cookie & BasicHashtable<TKey, TEntry>::Bucket::HASH_MASK;
- }
-
- template <typename TKey, typename TEntry>
- static const void* getBuckets(const BasicHashtable<TKey, TEntry>& h) {
- return h.mBuckets;
- }
-};
-
-template <typename TKey, typename TValue>
-static size_t add(BasicHashtable<TKey, key_value_pair_t<TKey, TValue> >& h,
- const TKey& key, const TValue& value) {
- return h.add(hash_type(key), key_value_pair_t<TKey, TValue>(key, value));
-}
-
-template <typename TKey, typename TValue>
-static ssize_t find(BasicHashtable<TKey, key_value_pair_t<TKey, TValue> >& h,
- ssize_t index, const TKey& key) {
- return h.find(index, hash_type(key), key);
-}
-
-template <typename TKey, typename TValue>
-static bool remove(BasicHashtable<TKey, key_value_pair_t<TKey, TValue> >& h,
- const TKey& key) {
- ssize_t index = find(h, -1, key);
- if (index >= 0) {
- h.removeAt(index);
- return true;
- }
- return false;
-}
-
-template <typename TEntry>
-static void getKeyValue(const TEntry& entry, int* key, int* value);
-
-template <> void getKeyValue(const SimpleEntry& entry, int* key, int* value) {
- *key = entry.key;
- *value = entry.value;
-}
-
-template <> void getKeyValue(const ComplexEntry& entry, int* key, int* value) {
- *key = entry.key.k;
- *value = entry.value.v;
-}
-
-template <typename TKey, typename TValue>
-static void dump(BasicHashtable<TKey, key_value_pair_t<TKey, TValue> >& h) {
- ALOGD("hashtable %p, size=%u, capacity=%u, bucketCount=%u",
- &h, h.size(), h.capacity(), h.bucketCount());
- for (size_t i = 0; i < h.bucketCount(); i++) {
- bool collision, present;
- hash_t hash;
- BasicHashtableTest::cookieAt(h, i, &collision, &present, &hash);
- if (present) {
- int key, value;
- getKeyValue(h.entryAt(i), &key, &value);
- ALOGD(" [%3u] = collision=%d, present=%d, hash=0x%08x, key=%3d, value=%3d, "
- "hash_type(key)=0x%08x",
- i, collision, present, hash, key, value, hash_type(key));
- } else {
- ALOGD(" [%3u] = collision=%d, present=%d",
- i, collision, present);
- }
- }
-}
-
-TEST_F(BasicHashtableTest, DefaultConstructor_WithDefaultProperties) {
- SimpleHashtable h;
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(3U, h.capacity());
- EXPECT_EQ(5U, h.bucketCount());
- EXPECT_EQ(0.75f, h.loadFactor());
-}
-
-TEST_F(BasicHashtableTest, Constructor_WithNonUnityLoadFactor) {
- SimpleHashtable h(52, 0.8f);
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(77U, h.capacity());
- EXPECT_EQ(97U, h.bucketCount());
- EXPECT_EQ(0.8f, h.loadFactor());
-}
-
-TEST_F(BasicHashtableTest, Constructor_WithUnityLoadFactorAndExactCapacity) {
- SimpleHashtable h(46, 1.0f);
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(46U, h.capacity()); // must be one less than bucketCount because loadFactor == 1.0f
- EXPECT_EQ(47U, h.bucketCount());
- EXPECT_EQ(1.0f, h.loadFactor());
-}
-
-TEST_F(BasicHashtableTest, Constructor_WithUnityLoadFactorAndInexactCapacity) {
- SimpleHashtable h(42, 1.0f);
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(46U, h.capacity()); // must be one less than bucketCount because loadFactor == 1.0f
- EXPECT_EQ(47U, h.bucketCount());
- EXPECT_EQ(1.0f, h.loadFactor());
-}
-
-TEST_F(BasicHashtableTest, FindAddFindRemoveFind_OneEntry) {
- SimpleHashtable h;
- ssize_t index = find(h, -1, 8);
- ASSERT_EQ(-1, index);
-
- index = add(h, 8, 1);
- ASSERT_EQ(1U, h.size());
-
- ASSERT_EQ(index, find(h, -1, 8));
- ASSERT_EQ(8, h.entryAt(index).key);
- ASSERT_EQ(1, h.entryAt(index).value);
-
- index = find(h, index, 8);
- ASSERT_EQ(-1, index);
-
- ASSERT_TRUE(remove(h, 8));
- ASSERT_EQ(0U, h.size());
-
- index = find(h, -1, 8);
- ASSERT_EQ(-1, index);
-}
-
-TEST_F(BasicHashtableTest, FindAddFindRemoveFind_MultipleEntryWithUniqueKey) {
- const size_t N = 11;
-
- SimpleHashtable h;
- for (size_t i = 0; i < N; i++) {
- ssize_t index = find(h, -1, int(i));
- ASSERT_EQ(-1, index);
-
- index = add(h, int(i), int(i * 10));
- ASSERT_EQ(i + 1, h.size());
-
- ASSERT_EQ(index, find(h, -1, int(i)));
- ASSERT_EQ(int(i), h.entryAt(index).key);
- ASSERT_EQ(int(i * 10), h.entryAt(index).value);
-
- index = find(h, index, int(i));
- ASSERT_EQ(-1, index);
- }
-
- for (size_t i = N; --i > 0; ) {
- ASSERT_TRUE(remove(h, int(i))) << "i = " << i;
- ASSERT_EQ(i, h.size());
-
- ssize_t index = find(h, -1, int(i));
- ASSERT_EQ(-1, index);
- }
-}
-
-TEST_F(BasicHashtableTest, FindAddFindRemoveFind_MultipleEntryWithDuplicateKey) {
- const size_t N = 11;
- const int K = 1;
-
- SimpleHashtable h;
- for (size_t i = 0; i < N; i++) {
- ssize_t index = find(h, -1, K);
- if (i == 0) {
- ASSERT_EQ(-1, index);
- } else {
- ASSERT_NE(-1, index);
- }
-
- add(h, K, int(i));
- ASSERT_EQ(i + 1, h.size());
-
- index = -1;
- int values = 0;
- for (size_t j = 0; j <= i; j++) {
- index = find(h, index, K);
- ASSERT_GE(index, 0);
- ASSERT_EQ(K, h.entryAt(index).key);
- values |= 1 << h.entryAt(index).value;
- }
- ASSERT_EQ(values, (1 << (i + 1)) - 1);
-
- index = find(h, index, K);
- ASSERT_EQ(-1, index);
- }
-
- for (size_t i = N; --i > 0; ) {
- ASSERT_TRUE(remove(h, K)) << "i = " << i;
- ASSERT_EQ(i, h.size());
-
- ssize_t index = -1;
- for (size_t j = 0; j < i; j++) {
- index = find(h, index, K);
- ASSERT_GE(index, 0);
- ASSERT_EQ(K, h.entryAt(index).key);
- }
-
- index = find(h, index, K);
- ASSERT_EQ(-1, index);
- }
-}
-
-TEST_F(BasicHashtableTest, Clear_WhenAlreadyEmpty_DoesNothing) {
- SimpleHashtable h;
- h.clear();
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(3U, h.capacity());
- EXPECT_EQ(5U, h.bucketCount());
- EXPECT_EQ(0.75f, h.loadFactor());
-}
-
-TEST_F(BasicHashtableTest, Clear_AfterElementsAdded_RemovesThem) {
- SimpleHashtable h;
- add(h, 0, 0);
- add(h, 1, 0);
- h.clear();
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(3U, h.capacity());
- EXPECT_EQ(5U, h.bucketCount());
- EXPECT_EQ(0.75f, h.loadFactor());
-}
-
-TEST_F(BasicHashtableTest, Clear_AfterElementsAdded_DestroysThem) {
- ComplexHashtable h;
- add(h, ComplexKey(0), ComplexValue(0));
- add(h, ComplexKey(1), ComplexValue(0));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
-
- h.clear();
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(3U, h.capacity());
- EXPECT_EQ(5U, h.bucketCount());
- EXPECT_EQ(0.75f, h.loadFactor());
-}
-
-TEST_F(BasicHashtableTest, Remove_AfterElementsAdded_DestroysThem) {
- ComplexHashtable h;
- add(h, ComplexKey(0), ComplexValue(0));
- add(h, ComplexKey(1), ComplexValue(0));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
-
- ASSERT_TRUE(remove(h, ComplexKey(0)));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(1, 1));
-
- ASSERT_TRUE(remove(h, ComplexKey(1)));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(3U, h.capacity());
- EXPECT_EQ(5U, h.bucketCount());
- EXPECT_EQ(0.75f, h.loadFactor());
-}
-
-TEST_F(BasicHashtableTest, Destructor_AfterElementsAdded_DestroysThem) {
- {
- ComplexHashtable h;
- add(h, ComplexKey(0), ComplexValue(0));
- add(h, ComplexKey(1), ComplexValue(0));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
- } // h is destroyed here
-
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
-}
-
-TEST_F(BasicHashtableTest, Next_WhenEmpty_ReturnsMinusOne) {
- SimpleHashtable h;
-
- ASSERT_EQ(-1, h.next(-1));
-}
-
-TEST_F(BasicHashtableTest, Next_WhenNonEmpty_IteratesOverAllEntries) {
- const int N = 88;
-
- SimpleHashtable h;
- for (int i = 0; i < N; i++) {
- add(h, i, i * 10);
- }
-
- bool set[N];
- memset(set, 0, sizeof(bool) * N);
- int count = 0;
- for (ssize_t index = -1; (index = h.next(index)) != -1; ) {
- ASSERT_GE(index, 0);
- ASSERT_LT(size_t(index), h.bucketCount());
-
- const SimpleEntry& entry = h.entryAt(index);
- ASSERT_GE(entry.key, 0);
- ASSERT_LT(entry.key, N);
- ASSERT_EQ(false, set[entry.key]);
- ASSERT_EQ(entry.key * 10, entry.value);
-
- set[entry.key] = true;
- count += 1;
- }
- ASSERT_EQ(N, count);
-}
-
-TEST_F(BasicHashtableTest, Add_RehashesOnDemand) {
- SimpleHashtable h;
- size_t initialCapacity = h.capacity();
- size_t initialBucketCount = h.bucketCount();
-
- for (size_t i = 0; i < initialCapacity; i++) {
- add(h, int(i), 0);
- }
-
- EXPECT_EQ(initialCapacity, h.size());
- EXPECT_EQ(initialCapacity, h.capacity());
- EXPECT_EQ(initialBucketCount, h.bucketCount());
-
- add(h, -1, -1);
-
- EXPECT_EQ(initialCapacity + 1, h.size());
- EXPECT_GT(h.capacity(), initialCapacity);
- EXPECT_GT(h.bucketCount(), initialBucketCount);
- EXPECT_GT(h.bucketCount(), h.capacity());
-}
-
-TEST_F(BasicHashtableTest, Rehash_WhenCapacityAndBucketCountUnchanged_DoesNothing) {
- ComplexHashtable h;
- add(h, ComplexKey(0), ComplexValue(0));
- const void* oldBuckets = getBuckets(h);
- ASSERT_NE((void*)NULL, oldBuckets);
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(1, 1));
-
- h.rehash(h.capacity(), h.loadFactor());
-
- ASSERT_EQ(oldBuckets, getBuckets(h));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(1, 1));
-}
-
-TEST_F(BasicHashtableTest, Rehash_WhenEmptyAndHasNoBuckets_ButDoesNotAllocateBuckets) {
- ComplexHashtable h;
- ASSERT_EQ((void*)NULL, getBuckets(h));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
-
- h.rehash(9, 1.0f);
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(10U, h.capacity());
- EXPECT_EQ(11U, h.bucketCount());
- EXPECT_EQ(1.0f, h.loadFactor());
- EXPECT_EQ((void*)NULL, getBuckets(h));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
-}
-
-TEST_F(BasicHashtableTest, Rehash_WhenEmptyAndHasBuckets_ReleasesBucketsAndSetsCapacity) {
- ComplexHashtable h(10);
- add(h, ComplexKey(0), ComplexValue(0));
- ASSERT_TRUE(remove(h, ComplexKey(0)));
- ASSERT_NE((void*)NULL, getBuckets(h));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
-
- h.rehash(0, 0.75f);
-
- EXPECT_EQ(0U, h.size());
- EXPECT_EQ(3U, h.capacity());
- EXPECT_EQ(5U, h.bucketCount());
- EXPECT_EQ(0.75f, h.loadFactor());
- EXPECT_EQ((void*)NULL, getBuckets(h));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
-}
-
-TEST_F(BasicHashtableTest, Rehash_WhenLessThanCurrentCapacity_ShrinksBuckets) {
- ComplexHashtable h(10);
- add(h, ComplexKey(0), ComplexValue(0));
- add(h, ComplexKey(1), ComplexValue(1));
- const void* oldBuckets = getBuckets(h);
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
-
- h.rehash(0, 0.75f);
-
- EXPECT_EQ(2U, h.size());
- EXPECT_EQ(3U, h.capacity());
- EXPECT_EQ(5U, h.bucketCount());
- EXPECT_EQ(0.75f, h.loadFactor());
- EXPECT_NE(oldBuckets, getBuckets(h));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
-}
-
-TEST_F(BasicHashtableTest, CopyOnWrite) {
- ComplexHashtable h1;
- add(h1, ComplexKey(0), ComplexValue(0));
- add(h1, ComplexKey(1), ComplexValue(1));
- const void* originalBuckets = getBuckets(h1);
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
- ssize_t index0 = find(h1, -1, ComplexKey(0));
- EXPECT_GE(index0, 0);
-
- // copy constructor acquires shared reference
- ComplexHashtable h2(h1);
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
- ASSERT_EQ(originalBuckets, getBuckets(h2));
- EXPECT_EQ(h1.size(), h2.size());
- EXPECT_EQ(h1.capacity(), h2.capacity());
- EXPECT_EQ(h1.bucketCount(), h2.bucketCount());
- EXPECT_EQ(h1.loadFactor(), h2.loadFactor());
- EXPECT_EQ(index0, find(h2, -1, ComplexKey(0)));
-
- // operator= acquires shared reference
- ComplexHashtable h3;
- h3 = h2;
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
- ASSERT_EQ(originalBuckets, getBuckets(h3));
- EXPECT_EQ(h1.size(), h3.size());
- EXPECT_EQ(h1.capacity(), h3.capacity());
- EXPECT_EQ(h1.bucketCount(), h3.bucketCount());
- EXPECT_EQ(h1.loadFactor(), h3.loadFactor());
- EXPECT_EQ(index0, find(h3, -1, ComplexKey(0)));
-
- // editEntryAt copies shared contents
- h1.editEntryAt(index0).value.v = 42;
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(4, 4));
- ASSERT_NE(originalBuckets, getBuckets(h1));
- EXPECT_EQ(42, h1.entryAt(index0).value.v);
- EXPECT_EQ(0, h2.entryAt(index0).value.v);
- EXPECT_EQ(0, h3.entryAt(index0).value.v);
-
- // clear releases reference to shared contents
- h2.clear();
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(4, 4));
- EXPECT_EQ(0U, h2.size());
- ASSERT_NE(originalBuckets, getBuckets(h2));
-
- // operator= acquires shared reference, destroys unshared contents
- h1 = h3;
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
- ASSERT_EQ(originalBuckets, getBuckets(h1));
- EXPECT_EQ(h3.size(), h1.size());
- EXPECT_EQ(h3.capacity(), h1.capacity());
- EXPECT_EQ(h3.bucketCount(), h1.bucketCount());
- EXPECT_EQ(h3.loadFactor(), h1.loadFactor());
- EXPECT_EQ(index0, find(h1, -1, ComplexKey(0)));
-
- // add copies shared contents
- add(h1, ComplexKey(2), ComplexValue(2));
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(5, 5));
- ASSERT_NE(originalBuckets, getBuckets(h1));
- EXPECT_EQ(3U, h1.size());
- EXPECT_EQ(0U, h2.size());
- EXPECT_EQ(2U, h3.size());
-
- // remove copies shared contents
- h1 = h3;
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
- ASSERT_EQ(originalBuckets, getBuckets(h1));
- h1.removeAt(index0);
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(3, 3));
- ASSERT_NE(originalBuckets, getBuckets(h1));
- EXPECT_EQ(1U, h1.size());
- EXPECT_EQ(0U, h2.size());
- EXPECT_EQ(2U, h3.size());
-
- // rehash copies shared contents
- h1 = h3;
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
- ASSERT_EQ(originalBuckets, getBuckets(h1));
- h1.rehash(10, 1.0f);
- ASSERT_NO_FATAL_FAILURE(assertInstanceCount(4, 4));
- ASSERT_NE(originalBuckets, getBuckets(h1));
- EXPECT_EQ(2U, h1.size());
- EXPECT_EQ(0U, h2.size());
- EXPECT_EQ(2U, h3.size());
-}
-
-} // namespace android
diff --git a/libs/utils/tests/BlobCache_test.cpp b/libs/utils/tests/BlobCache_test.cpp
deleted file mode 100644
index b64cc39..0000000
--- a/libs/utils/tests/BlobCache_test.cpp
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#include <fcntl.h>
-#include <stdio.h>
-
-#include <gtest/gtest.h>
-
-#include <utils/BlobCache.h>
-#include <utils/Errors.h>
-
-namespace android {
-
-class BlobCacheTest : public ::testing::Test {
-protected:
- enum {
- MAX_KEY_SIZE = 6,
- MAX_VALUE_SIZE = 8,
- MAX_TOTAL_SIZE = 13,
- };
-
- virtual void SetUp() {
- mBC = new BlobCache(MAX_KEY_SIZE, MAX_VALUE_SIZE, MAX_TOTAL_SIZE);
- }
-
- virtual void TearDown() {
- mBC.clear();
- }
-
- sp<BlobCache> mBC;
-};
-
-TEST_F(BlobCacheTest, CacheSingleValueSucceeds) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
- ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4));
- ASSERT_EQ('e', buf[0]);
- ASSERT_EQ('f', buf[1]);
- ASSERT_EQ('g', buf[2]);
- ASSERT_EQ('h', buf[3]);
-}
-
-TEST_F(BlobCacheTest, CacheTwoValuesSucceeds) {
- char buf[2] = { 0xee, 0xee };
- mBC->set("ab", 2, "cd", 2);
- mBC->set("ef", 2, "gh", 2);
- ASSERT_EQ(size_t(2), mBC->get("ab", 2, buf, 2));
- ASSERT_EQ('c', buf[0]);
- ASSERT_EQ('d', buf[1]);
- ASSERT_EQ(size_t(2), mBC->get("ef", 2, buf, 2));
- ASSERT_EQ('g', buf[0]);
- ASSERT_EQ('h', buf[1]);
-}
-
-TEST_F(BlobCacheTest, GetOnlyWritesInsideBounds) {
- char buf[6] = { 0xee, 0xee, 0xee, 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
- ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf+1, 4));
- ASSERT_EQ(0xee, buf[0]);
- ASSERT_EQ('e', buf[1]);
- ASSERT_EQ('f', buf[2]);
- ASSERT_EQ('g', buf[3]);
- ASSERT_EQ('h', buf[4]);
- ASSERT_EQ(0xee, buf[5]);
-}
-
-TEST_F(BlobCacheTest, GetOnlyWritesIfBufferIsLargeEnough) {
- char buf[3] = { 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
- ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 3));
- ASSERT_EQ(0xee, buf[0]);
- ASSERT_EQ(0xee, buf[1]);
- ASSERT_EQ(0xee, buf[2]);
-}
-
-TEST_F(BlobCacheTest, GetDoesntAccessNullBuffer) {
- mBC->set("abcd", 4, "efgh", 4);
- ASSERT_EQ(size_t(4), mBC->get("abcd", 4, NULL, 0));
-}
-
-TEST_F(BlobCacheTest, MultipleSetsCacheLatestValue) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
- mBC->set("abcd", 4, "ijkl", 4);
- ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4));
- ASSERT_EQ('i', buf[0]);
- ASSERT_EQ('j', buf[1]);
- ASSERT_EQ('k', buf[2]);
- ASSERT_EQ('l', buf[3]);
-}
-
-TEST_F(BlobCacheTest, SecondSetKeepsFirstValueIfTooLarge) {
- char buf[MAX_VALUE_SIZE+1] = { 0xee, 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
- mBC->set("abcd", 4, buf, MAX_VALUE_SIZE+1);
- ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4));
- ASSERT_EQ('e', buf[0]);
- ASSERT_EQ('f', buf[1]);
- ASSERT_EQ('g', buf[2]);
- ASSERT_EQ('h', buf[3]);
-}
-
-TEST_F(BlobCacheTest, DoesntCacheIfKeyIsTooBig) {
- char key[MAX_KEY_SIZE+1];
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- for (int i = 0; i < MAX_KEY_SIZE+1; i++) {
- key[i] = 'a';
- }
- mBC->set(key, MAX_KEY_SIZE+1, "bbbb", 4);
- ASSERT_EQ(size_t(0), mBC->get(key, MAX_KEY_SIZE+1, buf, 4));
- ASSERT_EQ(0xee, buf[0]);
- ASSERT_EQ(0xee, buf[1]);
- ASSERT_EQ(0xee, buf[2]);
- ASSERT_EQ(0xee, buf[3]);
-}
-
-TEST_F(BlobCacheTest, DoesntCacheIfValueIsTooBig) {
- char buf[MAX_VALUE_SIZE+1];
- for (int i = 0; i < MAX_VALUE_SIZE+1; i++) {
- buf[i] = 'b';
- }
- mBC->set("abcd", 4, buf, MAX_VALUE_SIZE+1);
- for (int i = 0; i < MAX_VALUE_SIZE+1; i++) {
- buf[i] = 0xee;
- }
- ASSERT_EQ(size_t(0), mBC->get("abcd", 4, buf, MAX_VALUE_SIZE+1));
- for (int i = 0; i < MAX_VALUE_SIZE+1; i++) {
- SCOPED_TRACE(i);
- ASSERT_EQ(0xee, buf[i]);
- }
-}
-
-TEST_F(BlobCacheTest, DoesntCacheIfKeyValuePairIsTooBig) {
- // Check a testing assumptions
- ASSERT_TRUE(MAX_TOTAL_SIZE < MAX_KEY_SIZE + MAX_VALUE_SIZE);
- ASSERT_TRUE(MAX_KEY_SIZE < MAX_TOTAL_SIZE);
-
- enum { bufSize = MAX_TOTAL_SIZE - MAX_KEY_SIZE + 1 };
-
- char key[MAX_KEY_SIZE];
- char buf[bufSize];
- for (int i = 0; i < MAX_KEY_SIZE; i++) {
- key[i] = 'a';
- }
- for (int i = 0; i < bufSize; i++) {
- buf[i] = 'b';
- }
-
- mBC->set(key, MAX_KEY_SIZE, buf, MAX_VALUE_SIZE);
- ASSERT_EQ(size_t(0), mBC->get(key, MAX_KEY_SIZE, NULL, 0));
-}
-
-TEST_F(BlobCacheTest, CacheMaxKeySizeSucceeds) {
- char key[MAX_KEY_SIZE];
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- for (int i = 0; i < MAX_KEY_SIZE; i++) {
- key[i] = 'a';
- }
- mBC->set(key, MAX_KEY_SIZE, "wxyz", 4);
- ASSERT_EQ(size_t(4), mBC->get(key, MAX_KEY_SIZE, buf, 4));
- ASSERT_EQ('w', buf[0]);
- ASSERT_EQ('x', buf[1]);
- ASSERT_EQ('y', buf[2]);
- ASSERT_EQ('z', buf[3]);
-}
-
-TEST_F(BlobCacheTest, CacheMaxValueSizeSucceeds) {
- char buf[MAX_VALUE_SIZE];
- for (int i = 0; i < MAX_VALUE_SIZE; i++) {
- buf[i] = 'b';
- }
- mBC->set("abcd", 4, buf, MAX_VALUE_SIZE);
- for (int i = 0; i < MAX_VALUE_SIZE; i++) {
- buf[i] = 0xee;
- }
- ASSERT_EQ(size_t(MAX_VALUE_SIZE), mBC->get("abcd", 4, buf,
- MAX_VALUE_SIZE));
- for (int i = 0; i < MAX_VALUE_SIZE; i++) {
- SCOPED_TRACE(i);
- ASSERT_EQ('b', buf[i]);
- }
-}
-
-TEST_F(BlobCacheTest, CacheMaxKeyValuePairSizeSucceeds) {
- // Check a testing assumption
- ASSERT_TRUE(MAX_KEY_SIZE < MAX_TOTAL_SIZE);
-
- enum { bufSize = MAX_TOTAL_SIZE - MAX_KEY_SIZE };
-
- char key[MAX_KEY_SIZE];
- char buf[bufSize];
- for (int i = 0; i < MAX_KEY_SIZE; i++) {
- key[i] = 'a';
- }
- for (int i = 0; i < bufSize; i++) {
- buf[i] = 'b';
- }
-
- mBC->set(key, MAX_KEY_SIZE, buf, bufSize);
- ASSERT_EQ(size_t(bufSize), mBC->get(key, MAX_KEY_SIZE, NULL, 0));
-}
-
-TEST_F(BlobCacheTest, CacheMinKeyAndValueSizeSucceeds) {
- char buf[1] = { 0xee };
- mBC->set("x", 1, "y", 1);
- ASSERT_EQ(size_t(1), mBC->get("x", 1, buf, 1));
- ASSERT_EQ('y', buf[0]);
-}
-
-TEST_F(BlobCacheTest, CacheSizeDoesntExceedTotalLimit) {
- for (int i = 0; i < 256; i++) {
- uint8_t k = i;
- mBC->set(&k, 1, "x", 1);
- }
- int numCached = 0;
- for (int i = 0; i < 256; i++) {
- uint8_t k = i;
- if (mBC->get(&k, 1, NULL, 0) == 1) {
- numCached++;
- }
- }
- ASSERT_GE(MAX_TOTAL_SIZE / 2, numCached);
-}
-
-TEST_F(BlobCacheTest, ExceedingTotalLimitHalvesCacheSize) {
- // Fill up the entire cache with 1 char key/value pairs.
- const int maxEntries = MAX_TOTAL_SIZE / 2;
- for (int i = 0; i < maxEntries; i++) {
- uint8_t k = i;
- mBC->set(&k, 1, "x", 1);
- }
- // Insert one more entry, causing a cache overflow.
- {
- uint8_t k = maxEntries;
- mBC->set(&k, 1, "x", 1);
- }
- // Count the number of entries in the cache.
- int numCached = 0;
- for (int i = 0; i < maxEntries+1; i++) {
- uint8_t k = i;
- if (mBC->get(&k, 1, NULL, 0) == 1) {
- numCached++;
- }
- }
- ASSERT_EQ(maxEntries/2 + 1, numCached);
-}
-
-class BlobCacheFlattenTest : public BlobCacheTest {
-protected:
- virtual void SetUp() {
- BlobCacheTest::SetUp();
- mBC2 = new BlobCache(MAX_KEY_SIZE, MAX_VALUE_SIZE, MAX_TOTAL_SIZE);
- }
-
- virtual void TearDown() {
- mBC2.clear();
- BlobCacheTest::TearDown();
- }
-
- void roundTrip() {
- size_t size = mBC->getFlattenedSize();
- uint8_t* flat = new uint8_t[size];
- ASSERT_EQ(OK, mBC->flatten(flat, size, NULL, 0));
- ASSERT_EQ(OK, mBC2->unflatten(flat, size, NULL, 0));
- delete[] flat;
- }
-
- sp<BlobCache> mBC2;
-};
-
-TEST_F(BlobCacheFlattenTest, FlattenOneValue) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
- roundTrip();
- ASSERT_EQ(size_t(4), mBC2->get("abcd", 4, buf, 4));
- ASSERT_EQ('e', buf[0]);
- ASSERT_EQ('f', buf[1]);
- ASSERT_EQ('g', buf[2]);
- ASSERT_EQ('h', buf[3]);
-}
-
-TEST_F(BlobCacheFlattenTest, FlattenFullCache) {
- // Fill up the entire cache with 1 char key/value pairs.
- const int maxEntries = MAX_TOTAL_SIZE / 2;
- for (int i = 0; i < maxEntries; i++) {
- uint8_t k = i;
- mBC->set(&k, 1, &k, 1);
- }
-
- roundTrip();
-
- // Verify the deserialized cache
- for (int i = 0; i < maxEntries; i++) {
- uint8_t k = i;
- uint8_t v = 0xee;
- ASSERT_EQ(size_t(1), mBC2->get(&k, 1, &v, 1));
- ASSERT_EQ(k, v);
- }
-}
-
-TEST_F(BlobCacheFlattenTest, FlattenDoesntChangeCache) {
- // Fill up the entire cache with 1 char key/value pairs.
- const int maxEntries = MAX_TOTAL_SIZE / 2;
- for (int i = 0; i < maxEntries; i++) {
- uint8_t k = i;
- mBC->set(&k, 1, &k, 1);
- }
-
- size_t size = mBC->getFlattenedSize();
- uint8_t* flat = new uint8_t[size];
- ASSERT_EQ(OK, mBC->flatten(flat, size, NULL, 0));
- delete[] flat;
-
- // Verify the cache that we just serialized
- for (int i = 0; i < maxEntries; i++) {
- uint8_t k = i;
- uint8_t v = 0xee;
- ASSERT_EQ(size_t(1), mBC->get(&k, 1, &v, 1));
- ASSERT_EQ(k, v);
- }
-}
-
-TEST_F(BlobCacheFlattenTest, FlattenCatchesBufferTooSmall) {
- // Fill up the entire cache with 1 char key/value pairs.
- const int maxEntries = MAX_TOTAL_SIZE / 2;
- for (int i = 0; i < maxEntries; i++) {
- uint8_t k = i;
- mBC->set(&k, 1, &k, 1);
- }
-
- size_t size = mBC->getFlattenedSize() - 1;
- uint8_t* flat = new uint8_t[size];
- ASSERT_EQ(BAD_VALUE, mBC->flatten(flat, size, NULL, 0));
- delete[] flat;
-}
-
-TEST_F(BlobCacheFlattenTest, UnflattenCatchesBadMagic) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
-
- size_t size = mBC->getFlattenedSize();
- uint8_t* flat = new uint8_t[size];
- ASSERT_EQ(OK, mBC->flatten(flat, size, NULL, 0));
- flat[1] = ~flat[1];
-
- // Bad magic should cause an error.
- ASSERT_EQ(BAD_VALUE, mBC2->unflatten(flat, size, NULL, 0));
- delete[] flat;
-
- // The error should cause the unflatten to result in an empty cache
- ASSERT_EQ(size_t(0), mBC2->get("abcd", 4, buf, 4));
-}
-
-TEST_F(BlobCacheFlattenTest, UnflattenCatchesBadBlobCacheVersion) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
-
- size_t size = mBC->getFlattenedSize();
- uint8_t* flat = new uint8_t[size];
- ASSERT_EQ(OK, mBC->flatten(flat, size, NULL, 0));
- flat[5] = ~flat[5];
-
- // Version mismatches shouldn't cause errors, but should not use the
- // serialized entries
- ASSERT_EQ(OK, mBC2->unflatten(flat, size, NULL, 0));
- delete[] flat;
-
- // The version mismatch should cause the unflatten to result in an empty
- // cache
- ASSERT_EQ(size_t(0), mBC2->get("abcd", 4, buf, 4));
-}
-
-TEST_F(BlobCacheFlattenTest, UnflattenCatchesBadBlobCacheDeviceVersion) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
-
- size_t size = mBC->getFlattenedSize();
- uint8_t* flat = new uint8_t[size];
- ASSERT_EQ(OK, mBC->flatten(flat, size, NULL, 0));
- flat[10] = ~flat[10];
-
- // Version mismatches shouldn't cause errors, but should not use the
- // serialized entries
- ASSERT_EQ(OK, mBC2->unflatten(flat, size, NULL, 0));
- delete[] flat;
-
- // The version mismatch should cause the unflatten to result in an empty
- // cache
- ASSERT_EQ(size_t(0), mBC2->get("abcd", 4, buf, 4));
-}
-
-TEST_F(BlobCacheFlattenTest, UnflattenCatchesBufferTooSmall) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mBC->set("abcd", 4, "efgh", 4);
-
- size_t size = mBC->getFlattenedSize();
- uint8_t* flat = new uint8_t[size];
- ASSERT_EQ(OK, mBC->flatten(flat, size, NULL, 0));
-
- // A buffer truncation shouldt cause an error
- ASSERT_EQ(BAD_VALUE, mBC2->unflatten(flat, size-1, NULL, 0));
- delete[] flat;
-
- // The error should cause the unflatten to result in an empty cache
- ASSERT_EQ(size_t(0), mBC2->get("abcd", 4, buf, 4));
-}
-
-} // namespace android
diff --git a/libs/utils/tests/Looper_test.cpp b/libs/utils/tests/Looper_test.cpp
deleted file mode 100644
index 8bf2ba2..0000000
--- a/libs/utils/tests/Looper_test.cpp
+++ /dev/null
@@ -1,693 +0,0 @@
-//
-// Copyright 2010 The Android Open Source Project
-//
-
-#include <utils/Looper.h>
-#include <utils/Timers.h>
-#include <utils/StopWatch.h>
-#include <gtest/gtest.h>
-#include <unistd.h>
-#include <time.h>
-
-#include "TestHelpers.h"
-
-// # of milliseconds to fudge stopwatch measurements
-#define TIMING_TOLERANCE_MS 25
-
-namespace android {
-
-enum {
- MSG_TEST1 = 1,
- MSG_TEST2 = 2,
- MSG_TEST3 = 3,
- MSG_TEST4 = 4,
-};
-
-class DelayedWake : public DelayedTask {
- sp<Looper> mLooper;
-
-public:
- DelayedWake(int delayMillis, const sp<Looper> looper) :
- DelayedTask(delayMillis), mLooper(looper) {
- }
-
-protected:
- virtual void doTask() {
- mLooper->wake();
- }
-};
-
-class DelayedWriteSignal : public DelayedTask {
- Pipe* mPipe;
-
-public:
- DelayedWriteSignal(int delayMillis, Pipe* pipe) :
- DelayedTask(delayMillis), mPipe(pipe) {
- }
-
-protected:
- virtual void doTask() {
- mPipe->writeSignal();
- }
-};
-
-class CallbackHandler {
-public:
- void setCallback(const sp<Looper>& looper, int fd, int events) {
- looper->addFd(fd, 0, events, staticHandler, this);
- }
-
-protected:
- virtual ~CallbackHandler() { }
-
- virtual int handler(int fd, int events) = 0;
-
-private:
- static int staticHandler(int fd, int events, void* data) {
- return static_cast<CallbackHandler*>(data)->handler(fd, events);
- }
-};
-
-class StubCallbackHandler : public CallbackHandler {
-public:
- int nextResult;
- int callbackCount;
-
- int fd;
- int events;
-
- StubCallbackHandler(int nextResult) : nextResult(nextResult),
- callbackCount(0), fd(-1), events(-1) {
- }
-
-protected:
- virtual int handler(int fd, int events) {
- callbackCount += 1;
- this->fd = fd;
- this->events = events;
- return nextResult;
- }
-};
-
-class StubMessageHandler : public MessageHandler {
-public:
- Vector<Message> messages;
-
- virtual void handleMessage(const Message& message) {
- messages.push(message);
- }
-};
-
-class LooperTest : public testing::Test {
-protected:
- sp<Looper> mLooper;
-
- virtual void SetUp() {
- mLooper = new Looper(true);
- }
-
- virtual void TearDown() {
- mLooper.clear();
- }
-};
-
-
-TEST_F(LooperTest, PollOnce_WhenNonZeroTimeoutAndNotAwoken_WaitsForTimeout) {
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(100, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. equal timeout";
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT";
-}
-
-TEST_F(LooperTest, PollOnce_WhenNonZeroTimeoutAndAwokenBeforeWaiting_ImmediatelyReturns) {
- mLooper->wake();
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(1000);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because wake() was called before waiting";
- EXPECT_EQ(ALOOPER_POLL_WAKE, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because loop was awoken";
-}
-
-TEST_F(LooperTest, PollOnce_WhenNonZeroTimeoutAndAwokenWhileWaiting_PromptlyReturns) {
- sp<DelayedWake> delayedWake = new DelayedWake(100, mLooper);
- delayedWake->run();
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(1000);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(100, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. equal wake delay";
- EXPECT_EQ(ALOOPER_POLL_WAKE, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because loop was awoken";
-}
-
-TEST_F(LooperTest, PollOnce_WhenZeroTimeoutAndNoRegisteredFDs_ImmediatelyReturns) {
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(0);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should be approx. zero";
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT";
-}
-
-TEST_F(LooperTest, PollOnce_WhenZeroTimeoutAndNoSignalledFDs_ImmediatelyReturns) {
- Pipe pipe;
- StubCallbackHandler handler(true);
-
- handler.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT);
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(0);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should be approx. zero";
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT";
- EXPECT_EQ(0, handler.callbackCount)
- << "callback should not have been invoked because FD was not signalled";
-}
-
-TEST_F(LooperTest, PollOnce_WhenZeroTimeoutAndSignalledFD_ImmediatelyInvokesCallbackAndReturns) {
- Pipe pipe;
- StubCallbackHandler handler(true);
-
- ASSERT_EQ(OK, pipe.writeSignal());
- handler.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT);
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(0);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should be approx. zero";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because FD was signalled";
- EXPECT_EQ(1, handler.callbackCount)
- << "callback should be invoked exactly once";
- EXPECT_EQ(pipe.receiveFd, handler.fd)
- << "callback should have received pipe fd as parameter";
- EXPECT_EQ(ALOOPER_EVENT_INPUT, handler.events)
- << "callback should have received ALOOPER_EVENT_INPUT as events";
-}
-
-TEST_F(LooperTest, PollOnce_WhenNonZeroTimeoutAndNoSignalledFDs_WaitsForTimeoutAndReturns) {
- Pipe pipe;
- StubCallbackHandler handler(true);
-
- handler.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT);
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(100, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. equal timeout";
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT";
- EXPECT_EQ(0, handler.callbackCount)
- << "callback should not have been invoked because FD was not signalled";
-}
-
-TEST_F(LooperTest, PollOnce_WhenNonZeroTimeoutAndSignalledFDBeforeWaiting_ImmediatelyInvokesCallbackAndReturns) {
- Pipe pipe;
- StubCallbackHandler handler(true);
-
- pipe.writeSignal();
- handler.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT);
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- ASSERT_EQ(OK, pipe.readSignal())
- << "signal should actually have been written";
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should be approx. zero";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because FD was signalled";
- EXPECT_EQ(1, handler.callbackCount)
- << "callback should be invoked exactly once";
- EXPECT_EQ(pipe.receiveFd, handler.fd)
- << "callback should have received pipe fd as parameter";
- EXPECT_EQ(ALOOPER_EVENT_INPUT, handler.events)
- << "callback should have received ALOOPER_EVENT_INPUT as events";
-}
-
-TEST_F(LooperTest, PollOnce_WhenNonZeroTimeoutAndSignalledFDWhileWaiting_PromptlyInvokesCallbackAndReturns) {
- Pipe pipe;
- StubCallbackHandler handler(true);
- sp<DelayedWriteSignal> delayedWriteSignal = new DelayedWriteSignal(100, & pipe);
-
- handler.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT);
- delayedWriteSignal->run();
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(1000);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- ASSERT_EQ(OK, pipe.readSignal())
- << "signal should actually have been written";
- EXPECT_NEAR(100, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. equal signal delay";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because FD was signalled";
- EXPECT_EQ(1, handler.callbackCount)
- << "callback should be invoked exactly once";
- EXPECT_EQ(pipe.receiveFd, handler.fd)
- << "callback should have received pipe fd as parameter";
- EXPECT_EQ(ALOOPER_EVENT_INPUT, handler.events)
- << "callback should have received ALOOPER_EVENT_INPUT as events";
-}
-
-TEST_F(LooperTest, PollOnce_WhenCallbackAddedThenRemoved_CallbackShouldNotBeInvoked) {
- Pipe pipe;
- StubCallbackHandler handler(true);
-
- handler.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT);
- pipe.writeSignal(); // would cause FD to be considered signalled
- mLooper->removeFd(pipe.receiveFd);
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- ASSERT_EQ(OK, pipe.readSignal())
- << "signal should actually have been written";
- EXPECT_NEAR(100, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. equal timeout because FD was no longer registered";
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT";
- EXPECT_EQ(0, handler.callbackCount)
- << "callback should not be invoked";
-}
-
-TEST_F(LooperTest, PollOnce_WhenCallbackReturnsFalse_CallbackShouldNotBeInvokedAgainLater) {
- Pipe pipe;
- StubCallbackHandler handler(false);
-
- handler.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT);
-
- // First loop: Callback is registered and FD is signalled.
- pipe.writeSignal();
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(0);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- ASSERT_EQ(OK, pipe.readSignal())
- << "signal should actually have been written";
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. equal zero because FD was already signalled";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because FD was signalled";
- EXPECT_EQ(1, handler.callbackCount)
- << "callback should be invoked";
-
- // Second loop: Callback is no longer registered and FD is signalled.
- pipe.writeSignal();
-
- stopWatch.reset();
- result = mLooper->pollOnce(0);
- elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- ASSERT_EQ(OK, pipe.readSignal())
- << "signal should actually have been written";
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. equal zero because timeout was zero";
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT";
- EXPECT_EQ(1, handler.callbackCount)
- << "callback should not be invoked this time";
-}
-
-TEST_F(LooperTest, PollOnce_WhenNonCallbackFdIsSignalled_ReturnsIdent) {
- const int expectedIdent = 5;
- void* expectedData = this;
-
- Pipe pipe;
-
- pipe.writeSignal();
- mLooper->addFd(pipe.receiveFd, expectedIdent, ALOOPER_EVENT_INPUT, NULL, expectedData);
-
- StopWatch stopWatch("pollOnce");
- int fd;
- int events;
- void* data;
- int result = mLooper->pollOnce(100, &fd, &events, &data);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- ASSERT_EQ(OK, pipe.readSignal())
- << "signal should actually have been written";
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should be approx. zero";
- EXPECT_EQ(expectedIdent, result)
- << "pollOnce result should be the ident of the FD that was signalled";
- EXPECT_EQ(pipe.receiveFd, fd)
- << "pollOnce should have returned the received pipe fd";
- EXPECT_EQ(ALOOPER_EVENT_INPUT, events)
- << "pollOnce should have returned ALOOPER_EVENT_INPUT as events";
- EXPECT_EQ(expectedData, data)
- << "pollOnce should have returned the data";
-}
-
-TEST_F(LooperTest, AddFd_WhenCallbackAdded_ReturnsOne) {
- Pipe pipe;
- int result = mLooper->addFd(pipe.receiveFd, 0, ALOOPER_EVENT_INPUT, NULL, NULL);
-
- EXPECT_EQ(1, result)
- << "addFd should return 1 because FD was added";
-}
-
-TEST_F(LooperTest, AddFd_WhenIdentIsNegativeAndCallbackIsNull_ReturnsError) {
- Pipe pipe;
- int result = mLooper->addFd(pipe.receiveFd, -1, ALOOPER_EVENT_INPUT, NULL, NULL);
-
- EXPECT_EQ(-1, result)
- << "addFd should return -1 because arguments were invalid";
-}
-
-TEST_F(LooperTest, AddFd_WhenNoCallbackAndAllowNonCallbacksIsFalse_ReturnsError) {
- Pipe pipe;
- sp<Looper> looper = new Looper(false /*allowNonCallbacks*/);
- int result = looper->addFd(pipe.receiveFd, 0, 0, NULL, NULL);
-
- EXPECT_EQ(-1, result)
- << "addFd should return -1 because arguments were invalid";
-}
-
-TEST_F(LooperTest, RemoveFd_WhenCallbackNotAdded_ReturnsZero) {
- int result = mLooper->removeFd(1);
-
- EXPECT_EQ(0, result)
- << "removeFd should return 0 because FD not registered";
-}
-
-TEST_F(LooperTest, RemoveFd_WhenCallbackAddedThenRemovedTwice_ReturnsOnceFirstTimeAndReturnsZeroSecondTime) {
- Pipe pipe;
- StubCallbackHandler handler(false);
- handler.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT);
-
- // First time.
- int result = mLooper->removeFd(pipe.receiveFd);
-
- EXPECT_EQ(1, result)
- << "removeFd should return 1 first time because FD was registered";
-
- // Second time.
- result = mLooper->removeFd(pipe.receiveFd);
-
- EXPECT_EQ(0, result)
- << "removeFd should return 0 second time because FD was no longer registered";
-}
-
-TEST_F(LooperTest, PollOnce_WhenCallbackAddedTwice_OnlySecondCallbackShouldBeInvoked) {
- Pipe pipe;
- StubCallbackHandler handler1(true);
- StubCallbackHandler handler2(true);
-
- handler1.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT);
- handler2.setCallback(mLooper, pipe.receiveFd, ALOOPER_EVENT_INPUT); // replace it
- pipe.writeSignal(); // would cause FD to be considered signalled
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- ASSERT_EQ(OK, pipe.readSignal())
- << "signal should actually have been written";
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because FD was already signalled";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because FD was signalled";
- EXPECT_EQ(0, handler1.callbackCount)
- << "original handler callback should not be invoked because it was replaced";
- EXPECT_EQ(1, handler2.callbackCount)
- << "replacement handler callback should be invoked";
-}
-
-TEST_F(LooperTest, SendMessage_WhenOneMessageIsEnqueue_ShouldInvokeHandlerDuringNextPoll) {
- sp<StubMessageHandler> handler = new StubMessageHandler();
- mLooper->sendMessage(handler, Message(MSG_TEST1));
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because message was already sent";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because message was sent";
- EXPECT_EQ(size_t(1), handler->messages.size())
- << "handled message";
- EXPECT_EQ(MSG_TEST1, handler->messages[0].what)
- << "handled message";
-}
-
-TEST_F(LooperTest, SendMessage_WhenMultipleMessagesAreEnqueued_ShouldInvokeHandlersInOrderDuringNextPoll) {
- sp<StubMessageHandler> handler1 = new StubMessageHandler();
- sp<StubMessageHandler> handler2 = new StubMessageHandler();
- mLooper->sendMessage(handler1, Message(MSG_TEST1));
- mLooper->sendMessage(handler2, Message(MSG_TEST2));
- mLooper->sendMessage(handler1, Message(MSG_TEST3));
- mLooper->sendMessage(handler1, Message(MSG_TEST4));
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(1000);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because message was already sent";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because message was sent";
- EXPECT_EQ(size_t(3), handler1->messages.size())
- << "handled message";
- EXPECT_EQ(MSG_TEST1, handler1->messages[0].what)
- << "handled message";
- EXPECT_EQ(MSG_TEST3, handler1->messages[1].what)
- << "handled message";
- EXPECT_EQ(MSG_TEST4, handler1->messages[2].what)
- << "handled message";
- EXPECT_EQ(size_t(1), handler2->messages.size())
- << "handled message";
- EXPECT_EQ(MSG_TEST2, handler2->messages[0].what)
- << "handled message";
-}
-
-TEST_F(LooperTest, SendMessageDelayed_WhenSentToTheFuture_ShouldInvokeHandlerAfterDelayTime) {
- sp<StubMessageHandler> handler = new StubMessageHandler();
- mLooper->sendMessageDelayed(ms2ns(100), handler, Message(MSG_TEST1));
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(1000);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "first poll should end quickly because next message timeout was computed";
- EXPECT_EQ(ALOOPER_POLL_WAKE, result)
- << "pollOnce result should be ALOOPER_POLL_WAKE due to wakeup";
- EXPECT_EQ(size_t(0), handler->messages.size())
- << "no message handled yet";
-
- result = mLooper->pollOnce(1000);
- elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_EQ(size_t(1), handler->messages.size())
- << "handled message";
- EXPECT_EQ(MSG_TEST1, handler->messages[0].what)
- << "handled message";
- EXPECT_NEAR(100, elapsedMillis, TIMING_TOLERANCE_MS)
- << "second poll should end around the time of the delayed message dispatch";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because message was sent";
-
- result = mLooper->pollOnce(100);
- elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(100 + 100, elapsedMillis, TIMING_TOLERANCE_MS)
- << "third poll should timeout";
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT because there were no messages left";
-}
-
-TEST_F(LooperTest, SendMessageDelayed_WhenSentToThePast_ShouldInvokeHandlerDuringNextPoll) {
- sp<StubMessageHandler> handler = new StubMessageHandler();
- mLooper->sendMessageDelayed(ms2ns(-1000), handler, Message(MSG_TEST1));
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because message was already sent";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because message was sent";
- EXPECT_EQ(size_t(1), handler->messages.size())
- << "handled message";
- EXPECT_EQ(MSG_TEST1, handler->messages[0].what)
- << "handled message";
-}
-
-TEST_F(LooperTest, SendMessageDelayed_WhenSentToThePresent_ShouldInvokeHandlerDuringNextPoll) {
- sp<StubMessageHandler> handler = new StubMessageHandler();
- mLooper->sendMessageDelayed(0, handler, Message(MSG_TEST1));
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because message was already sent";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because message was sent";
- EXPECT_EQ(size_t(1), handler->messages.size())
- << "handled message";
- EXPECT_EQ(MSG_TEST1, handler->messages[0].what)
- << "handled message";
-}
-
-TEST_F(LooperTest, SendMessageAtTime_WhenSentToTheFuture_ShouldInvokeHandlerAfterDelayTime) {
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- sp<StubMessageHandler> handler = new StubMessageHandler();
- mLooper->sendMessageAtTime(now + ms2ns(100), handler, Message(MSG_TEST1));
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(1000);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "first poll should end quickly because next message timeout was computed";
- EXPECT_EQ(ALOOPER_POLL_WAKE, result)
- << "pollOnce result should be ALOOPER_POLL_WAKE due to wakeup";
- EXPECT_EQ(size_t(0), handler->messages.size())
- << "no message handled yet";
-
- result = mLooper->pollOnce(1000);
- elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_EQ(size_t(1), handler->messages.size())
- << "handled message";
- EXPECT_EQ(MSG_TEST1, handler->messages[0].what)
- << "handled message";
- EXPECT_NEAR(100, elapsedMillis, TIMING_TOLERANCE_MS)
- << "second poll should end around the time of the delayed message dispatch";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because message was sent";
-
- result = mLooper->pollOnce(100);
- elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(100 + 100, elapsedMillis, TIMING_TOLERANCE_MS)
- << "third poll should timeout";
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT because there were no messages left";
-}
-
-TEST_F(LooperTest, SendMessageAtTime_WhenSentToThePast_ShouldInvokeHandlerDuringNextPoll) {
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- sp<StubMessageHandler> handler = new StubMessageHandler();
- mLooper->sendMessageAtTime(now - ms2ns(1000), handler, Message(MSG_TEST1));
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because message was already sent";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because message was sent";
- EXPECT_EQ(size_t(1), handler->messages.size())
- << "handled message";
- EXPECT_EQ(MSG_TEST1, handler->messages[0].what)
- << "handled message";
-}
-
-TEST_F(LooperTest, SendMessageAtTime_WhenSentToThePresent_ShouldInvokeHandlerDuringNextPoll) {
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- sp<StubMessageHandler> handler = new StubMessageHandler();
- mLooper->sendMessageAtTime(now, handler, Message(MSG_TEST1));
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(100);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because message was already sent";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because message was sent";
- EXPECT_EQ(size_t(1), handler->messages.size())
- << "handled message";
- EXPECT_EQ(MSG_TEST1, handler->messages[0].what)
- << "handled message";
-}
-
-TEST_F(LooperTest, RemoveMessage_WhenRemovingAllMessagesForHandler_ShouldRemoveThoseMessage) {
- sp<StubMessageHandler> handler = new StubMessageHandler();
- mLooper->sendMessage(handler, Message(MSG_TEST1));
- mLooper->sendMessage(handler, Message(MSG_TEST2));
- mLooper->sendMessage(handler, Message(MSG_TEST3));
- mLooper->removeMessages(handler);
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(0);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because message was sent so looper was awoken";
- EXPECT_EQ(ALOOPER_POLL_WAKE, result)
- << "pollOnce result should be ALOOPER_POLL_WAKE because looper was awoken";
- EXPECT_EQ(size_t(0), handler->messages.size())
- << "no messages to handle";
-
- result = mLooper->pollOnce(0);
-
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT because there was nothing to do";
- EXPECT_EQ(size_t(0), handler->messages.size())
- << "no messages to handle";
-}
-
-TEST_F(LooperTest, RemoveMessage_WhenRemovingSomeMessagesForHandler_ShouldRemoveThoseMessage) {
- sp<StubMessageHandler> handler = new StubMessageHandler();
- mLooper->sendMessage(handler, Message(MSG_TEST1));
- mLooper->sendMessage(handler, Message(MSG_TEST2));
- mLooper->sendMessage(handler, Message(MSG_TEST3));
- mLooper->sendMessage(handler, Message(MSG_TEST4));
- mLooper->removeMessages(handler, MSG_TEST3);
- mLooper->removeMessages(handler, MSG_TEST1);
-
- StopWatch stopWatch("pollOnce");
- int result = mLooper->pollOnce(0);
- int32_t elapsedMillis = ns2ms(stopWatch.elapsedTime());
-
- EXPECT_NEAR(0, elapsedMillis, TIMING_TOLERANCE_MS)
- << "elapsed time should approx. zero because message was sent so looper was awoken";
- EXPECT_EQ(ALOOPER_POLL_CALLBACK, result)
- << "pollOnce result should be ALOOPER_POLL_CALLBACK because two messages were sent";
- EXPECT_EQ(size_t(2), handler->messages.size())
- << "no messages to handle";
- EXPECT_EQ(MSG_TEST2, handler->messages[0].what)
- << "handled message";
- EXPECT_EQ(MSG_TEST4, handler->messages[1].what)
- << "handled message";
-
- result = mLooper->pollOnce(0);
-
- EXPECT_EQ(ALOOPER_POLL_TIMEOUT, result)
- << "pollOnce result should be ALOOPER_POLL_TIMEOUT because there was nothing to do";
- EXPECT_EQ(size_t(2), handler->messages.size())
- << "no more messages to handle";
-}
-
-} // namespace android
diff --git a/libs/utils/tests/String8_test.cpp b/libs/utils/tests/String8_test.cpp
deleted file mode 100644
index c42c68d..0000000
--- a/libs/utils/tests/String8_test.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#define LOG_TAG "String8_test"
-#include <utils/Log.h>
-#include <utils/String8.h>
-
-#include <gtest/gtest.h>
-
-namespace android {
-
-class String8Test : public testing::Test {
-protected:
- virtual void SetUp() {
- }
-
- virtual void TearDown() {
- }
-};
-
-TEST_F(String8Test, Cstr) {
- String8 tmp("Hello, world!");
-
- EXPECT_STREQ(tmp.string(), "Hello, world!");
-}
-
-TEST_F(String8Test, OperatorPlus) {
- String8 src1("Hello, ");
-
- // Test adding String8 + const char*
- const char* ccsrc2 = "world!";
- String8 dst1 = src1 + ccsrc2;
- EXPECT_STREQ(dst1.string(), "Hello, world!");
- EXPECT_STREQ(src1.string(), "Hello, ");
- EXPECT_STREQ(ccsrc2, "world!");
-
- // Test adding String8 + String8
- String8 ssrc2("world!");
- String8 dst2 = src1 + ssrc2;
- EXPECT_STREQ(dst2.string(), "Hello, world!");
- EXPECT_STREQ(src1.string(), "Hello, ");
- EXPECT_STREQ(ssrc2.string(), "world!");
-}
-
-TEST_F(String8Test, OperatorPlusEquals) {
- String8 src1("My voice");
-
- // Testing String8 += String8
- String8 src2(" is my passport.");
- src1 += src2;
- EXPECT_STREQ(src1.string(), "My voice is my passport.");
- EXPECT_STREQ(src2.string(), " is my passport.");
-
- // Adding const char* to the previous string.
- const char* src3 = " Verify me.";
- src1 += src3;
- EXPECT_STREQ(src1.string(), "My voice is my passport. Verify me.");
- EXPECT_STREQ(src2.string(), " is my passport.");
- EXPECT_STREQ(src3, " Verify me.");
-}
-
-}
diff --git a/libs/utils/tests/Unicode_test.cpp b/libs/utils/tests/Unicode_test.cpp
deleted file mode 100644
index 18c130c..0000000
--- a/libs/utils/tests/Unicode_test.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#define LOG_TAG "Unicode_test"
-#include <utils/Log.h>
-#include <utils/Unicode.h>
-
-#include <gtest/gtest.h>
-
-namespace android {
-
-class UnicodeTest : public testing::Test {
-protected:
- virtual void SetUp() {
- }
-
- virtual void TearDown() {
- }
-};
-
-TEST_F(UnicodeTest, UTF8toUTF16ZeroLength) {
- ssize_t measured;
-
- const uint8_t str[] = { };
-
- measured = utf8_to_utf16_length(str, 0);
- EXPECT_EQ(0, measured)
- << "Zero length input should return zero length output.";
-}
-
-TEST_F(UnicodeTest, UTF8toUTF16ASCIILength) {
- ssize_t measured;
-
- // U+0030 or ASCII '0'
- const uint8_t str[] = { 0x30 };
-
- measured = utf8_to_utf16_length(str, sizeof(str));
- EXPECT_EQ(1, measured)
- << "ASCII glyphs should have a length of 1 char16_t";
-}
-
-TEST_F(UnicodeTest, UTF8toUTF16Plane1Length) {
- ssize_t measured;
-
- // U+2323 SMILE
- const uint8_t str[] = { 0xE2, 0x8C, 0xA3 };
-
- measured = utf8_to_utf16_length(str, sizeof(str));
- EXPECT_EQ(1, measured)
- << "Plane 1 glyphs should have a length of 1 char16_t";
-}
-
-TEST_F(UnicodeTest, UTF8toUTF16SurrogateLength) {
- ssize_t measured;
-
- // U+10000
- const uint8_t str[] = { 0xF0, 0x90, 0x80, 0x80 };
-
- measured = utf8_to_utf16_length(str, sizeof(str));
- EXPECT_EQ(2, measured)
- << "Surrogate pairs should have a length of 2 char16_t";
-}
-
-TEST_F(UnicodeTest, UTF8toUTF16TruncatedUTF8) {
- ssize_t measured;
-
- // Truncated U+2323 SMILE
- // U+2323 SMILE
- const uint8_t str[] = { 0xE2, 0x8C };
-
- measured = utf8_to_utf16_length(str, sizeof(str));
- EXPECT_EQ(-1, measured)
- << "Truncated UTF-8 should return -1 to indicate invalid";
-}
-
-TEST_F(UnicodeTest, UTF8toUTF16Normal) {
- const uint8_t str[] = {
- 0x30, // U+0030, 1 UTF-16 character
- 0xC4, 0x80, // U+0100, 1 UTF-16 character
- 0xE2, 0x8C, 0xA3, // U+2323, 1 UTF-16 character
- 0xF0, 0x90, 0x80, 0x80, // U+10000, 2 UTF-16 character
- };
-
- char16_t output[1 + 1 + 1 + 2 + 1]; // Room for NULL
-
- utf8_to_utf16(str, sizeof(str), output);
-
- EXPECT_EQ(0x0030, output[0])
- << "should be U+0030";
- EXPECT_EQ(0x0100, output[1])
- << "should be U+0100";
- EXPECT_EQ(0x2323, output[2])
- << "should be U+2323";
- EXPECT_EQ(0xD800, output[3])
- << "should be first half of surrogate U+10000";
- EXPECT_EQ(0xDC00, output[4])
- << "should be second half of surrogate U+10000";
- EXPECT_EQ(NULL, output[5])
- << "should be NULL terminated";
-}
-
-}
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 1c7f577..aa60d0a 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -2035,20 +2035,11 @@
}
public void readSettings() {
- int index = Settings.System.getInt(mContentResolver,
- mVolumeIndexSettingName,
- AudioManager.DEFAULT_STREAM_VOLUME[mStreamType]);
-
- mIndex.clear();
- mIndex.put(AudioSystem.DEVICE_OUT_DEFAULT, index);
-
- index = Settings.System.getInt(mContentResolver,
- mLastAudibleVolumeIndexSettingName,
- (index > 0) ? index : AudioManager.DEFAULT_STREAM_VOLUME[mStreamType]);
- mLastAudibleIndex.clear();
- mLastAudibleIndex.put(AudioSystem.DEVICE_OUT_DEFAULT, index);
+ boolean checkSilentVolume = (mRingerMode == AudioManager.RINGER_MODE_NORMAL) &&
+ isStreamAffectedByRingerMode(mStreamType);
int remainingDevices = AudioSystem.DEVICE_OUT_ALL;
+
for (int i = 0; remainingDevices != 0; i++) {
int device = (1 << i);
if ((device & remainingDevices) == 0) {
@@ -2057,17 +2048,58 @@
remainingDevices &= ~device;
// retrieve current volume for device
- String name = getSettingNameForDevice(false, device);
- index = Settings.System.getInt(mContentResolver, name, -1);
+ String name = getSettingNameForDevice(false /* lastAudible */, device);
+ // if no volume stored for current stream and device, use default volume if default
+ // device, continue otherwise
+ int defaultIndex = (device == AudioSystem.DEVICE_OUT_DEFAULT) ?
+ AudioManager.DEFAULT_STREAM_VOLUME[mStreamType] : -1;
+ int index = Settings.System.getInt(mContentResolver, name, defaultIndex);
if (index == -1) {
continue;
}
- mIndex.put(device, getValidIndex(10 * index));
// retrieve last audible volume for device
- name = getSettingNameForDevice(true, device);
- index = Settings.System.getInt(mContentResolver, name, -1);
- mLastAudibleIndex.put(device, getValidIndex(10 * index));
+ name = getSettingNameForDevice(true /* lastAudible */, device);
+ // use stored last audible index if present, otherwise use current index if not 0
+ // or default index
+ defaultIndex = (index > 0) ?
+ index : AudioManager.DEFAULT_STREAM_VOLUME[mStreamType];
+ int lastAudibleIndex = Settings.System.getInt(mContentResolver, name, defaultIndex);
+
+ // a last audible index of 0 is never stored, except on non-voice capable devices
+ // (e.g. tablets) for the music stream type, where the music stream volume can reach
+ // 0 without the device being in silent mode
+ if ((lastAudibleIndex == 0) &&
+ (mVoiceCapable ||
+ (STREAM_VOLUME_ALIAS[mStreamType] != AudioSystem.STREAM_MUSIC))) {
+ lastAudibleIndex = AudioManager.DEFAULT_STREAM_VOLUME[mStreamType];
+ // Correct the data base
+ sendMsg(mAudioHandler,
+ MSG_PERSIST_VOLUME,
+ SENDMSG_QUEUE,
+ PERSIST_LAST_AUDIBLE,
+ device,
+ this,
+ PERSIST_DELAY);
+ }
+ mLastAudibleIndex.put(device, getValidIndex(10 * lastAudibleIndex));
+ // the initial index should never be 0 for a stream affected by ringer mode if not
+ // in silent or vibrate mode.
+ // this is permitted on tablets for music stream type.
+ if (checkSilentVolume && (index == 0) &&
+ (mVoiceCapable ||
+ (STREAM_VOLUME_ALIAS[mStreamType] != AudioSystem.STREAM_MUSIC))) {
+ index = lastAudibleIndex;
+ // Correct the data base
+ sendMsg(mAudioHandler,
+ MSG_PERSIST_VOLUME,
+ SENDMSG_QUEUE,
+ PERSIST_CURRENT,
+ device,
+ this,
+ PERSIST_DELAY);
+ }
+ mIndex.put(device, getValidIndex(10 * index));
}
}
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index d354cdb..b5e832c 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -279,6 +279,7 @@
return DEVICE_OUT_ANLG_DOCK_HEADSET_NAME;
case DEVICE_OUT_DGTL_DOCK_HEADSET:
return DEVICE_OUT_DGTL_DOCK_HEADSET_NAME;
+ case DEVICE_IN_DEFAULT:
default:
return "";
}
diff --git a/media/java/android/media/CamcorderProfile.java b/media/java/android/media/CamcorderProfile.java
index e94bddc..511111c 100644
--- a/media/java/android/media/CamcorderProfile.java
+++ b/media/java/android/media/CamcorderProfile.java
@@ -67,6 +67,8 @@
/**
* Quality level corresponding to the 480p (720 x 480) resolution.
+ * Note that the horizontal resolution for 480p can also be other
+ * values, such as 640 or 704, instead of 720.
*/
public static final int QUALITY_480P = 4;
@@ -76,7 +78,10 @@
public static final int QUALITY_720P = 5;
/**
- * Quality level corresponding to the 1080p (1920 x 1088) resolution.
+ * Quality level corresponding to the 1080p (1920 x 1080) resolution.
+ * Note that the vertical resolution for 1080p can also be 1088,
+ * instead of 1080 (used by some vendors to avoid cropping during
+ * video playback).
*/
public static final int QUALITY_1080P = 6;
diff --git a/media/java/android/media/MediaActionSound.java b/media/java/android/media/MediaActionSound.java
new file mode 100644
index 0000000..7a520fe
--- /dev/null
+++ b/media/java/android/media/MediaActionSound.java
@@ -0,0 +1,198 @@
+/*
+ * 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 android.media;
+
+import android.media.AudioManager;
+import android.media.SoundPool;
+import android.util.Log;
+
+/**
+ * <p>A class for producing sounds that match those produced by various actions
+ * taken by the media and camera APIs. </p>
+ *
+ * <p>Use this class to play an appropriate camera operation sound when
+ * implementing a custom still or video recording mechanism (through the Camera
+ * preview callbacks with {@link android.hardware.Camera#setPreviewCallback
+ * Camera.setPreviewCallback}, or through GPU processing with {@link
+ * android.hardware.Camera#setPreviewTexture Camera.setPreviewTexture}, for
+ * example), or when implementing some other camera-like function in your
+ * application.</p>
+ *
+ * <p>There is no need to play sounds when using
+ * {@link android.hardware.Camera#takePicture Camera.takePicture} or
+ * {@link android.media.MediaRecorder} for still images or video, respectively,
+ * as the Android framework will play the appropriate sounds when needed for
+ * these calls.</p>
+ *
+ */
+public class MediaActionSound {
+ private static final int NUM_MEDIA_SOUND_STREAMS = 1;
+
+ private SoundPool mSoundPool;
+ private int[] mSoundIds;
+ private int mSoundIdToPlay;
+
+ private static final String[] SOUND_FILES = {
+ "/system/media/audio/ui/camera_click.ogg",
+ "/system/media/audio/ui/camera_focus.ogg",
+ "/system/media/audio/ui/VideoRecord.ogg",
+ "/system/media/audio/ui/VideoRecord.ogg"
+ };
+
+ private static final String TAG = "MediaActionSound";
+ /**
+ * The sound used by
+ * {@link android.hardware.Camera#takePicture Camera.takePicture} to
+ * indicate still image capture.
+ * @see #play
+ */
+ public static final int SHUTTER_CLICK = 0;
+
+ /**
+ * A sound to indicate that focusing has completed. Because deciding
+ * when this occurs is application-dependent, this sound is not used by
+ * any methods in the media or camera APIs.
+ * @see #play
+ */
+ public static final int FOCUS_COMPLETE = 1;
+
+ /**
+ * The sound used by
+ * {@link android.media.MediaRecorder#start MediaRecorder.start()} to
+ * indicate the start of video recording.
+ * @see #play
+ */
+ public static final int START_VIDEO_RECORDING = 2;
+
+ /**
+ * The sound used by
+ * {@link android.media.MediaRecorder#stop MediaRecorder.stop()} to
+ * indicate the end of video recording.
+ * @see #play
+ */
+ public static final int STOP_VIDEO_RECORDING = 3;
+
+ private static final int SOUND_NOT_LOADED = -1;
+
+ /**
+ * Construct a new MediaActionSound instance. Only a single instance is
+ * needed for playing any platform media action sound; you do not need a
+ * separate instance for each sound type.
+ */
+ public MediaActionSound() {
+ mSoundPool = new SoundPool(NUM_MEDIA_SOUND_STREAMS,
+ AudioManager.STREAM_SYSTEM_ENFORCED, 0);
+ mSoundPool.setOnLoadCompleteListener(mLoadCompleteListener);
+ mSoundIds = new int[SOUND_FILES.length];
+ for (int i = 0; i < mSoundIds.length; i++) {
+ mSoundIds[i] = SOUND_NOT_LOADED;
+ }
+ mSoundIdToPlay = SOUND_NOT_LOADED;
+ }
+
+ /**
+ * Preload a predefined platform sound to minimize latency when the sound is
+ * played later by {@link #play}.
+ * @param soundName The type of sound to preload, selected from
+ * SHUTTER_CLICK, FOCUS_COMPLETE, START_VIDEO_RECORDING, or
+ * STOP_VIDEO_RECORDING.
+ * @see #play
+ * @see #SHUTTER_CLICK
+ * @see #FOCUS_COMPLETE
+ * @see #START_VIDEO_RECORDING
+ * @see #STOP_VIDEO_RECORDING
+ */
+ public synchronized void load(int soundName) {
+ if (soundName < 0 || soundName >= SOUND_FILES.length) {
+ throw new RuntimeException("Unknown sound requested: " + soundName);
+ }
+ if (mSoundIds[soundName] == SOUND_NOT_LOADED) {
+ mSoundIds[soundName] =
+ mSoundPool.load(SOUND_FILES[soundName], 1);
+ }
+ }
+
+ /**
+ * <p>Play one of the predefined platform sounds for media actions.</p>
+ *
+ * <p>Use this method to play a platform-specific sound for various media
+ * actions. The sound playback is done asynchronously, with the same
+ * behavior and content as the sounds played by
+ * {@link android.hardware.Camera#takePicture Camera.takePicture},
+ * {@link android.media.MediaRecorder#start MediaRecorder.start}, and
+ * {@link android.media.MediaRecorder#stop MediaRecorder.stop}.</p>
+ *
+ * <p>Using this method makes it easy to match the default device sounds
+ * when recording or capturing data through the preview callbacks, or when
+ * implementing custom camera-like features in your
+ * application.</p>
+ *
+ * <p>If the sound has not been loaded by {@link #load} before calling play,
+ * play will load the sound at the cost of some additional latency before
+ * sound playback begins. </p>
+ *
+ * @param soundName The type of sound to play, selected from
+ * SHUTTER_CLICK, FOCUS_COMPLETE, START_VIDEO_RECORDING, or
+ * STOP_VIDEO_RECORDING.
+ * @see android.hardware.Camera#takePicture
+ * @see android.media.MediaRecorder
+ * @see #SHUTTER_CLICK
+ * @see #FOCUS_COMPLETE
+ * @see #START_VIDEO_RECORDING
+ * @see #STOP_VIDEO_RECORDING
+ */
+ public synchronized void play(int soundName) {
+ if (soundName < 0 || soundName >= SOUND_FILES.length) {
+ throw new RuntimeException("Unknown sound requested: " + soundName);
+ }
+ if (mSoundIds[soundName] == SOUND_NOT_LOADED) {
+ mSoundIdToPlay =
+ mSoundPool.load(SOUND_FILES[soundName], 1);
+ mSoundIds[soundName] = mSoundIdToPlay;
+ } else {
+ mSoundPool.play(mSoundIds[soundName], 1.0f, 1.0f, 0, 0, 1.0f);
+ }
+ }
+
+ private SoundPool.OnLoadCompleteListener mLoadCompleteListener =
+ new SoundPool.OnLoadCompleteListener() {
+ public void onLoadComplete(SoundPool soundPool,
+ int sampleId, int status) {
+ if (status == 0) {
+ if (mSoundIdToPlay == sampleId) {
+ soundPool.play(sampleId, 1.0f, 1.0f, 0, 0, 1.0f);
+ mSoundIdToPlay = SOUND_NOT_LOADED;
+ }
+ } else {
+ Log.e(TAG, "Unable to load sound for playback (status: " +
+ status + ")");
+ }
+ }
+ };
+
+ /**
+ * Free up all audio resources used by this MediaActionSound instance. Do
+ * not call any other methods on a MediaActionSound instance after calling
+ * release().
+ */
+ public void release() {
+ if (mSoundPool != null) {
+ mSoundPool.release();
+ mSoundPool = null;
+ }
+ }
+}
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index 404853c..a1cbf0f 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -405,9 +405,9 @@
}
void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, audio_io_handle_t ioHandle,
- void *param2) {
+ const void *param2) {
ALOGV("ioConfigChanged() event %d", event);
- OutputDescriptor *desc;
+ const OutputDescriptor *desc;
audio_stream_type_t stream;
if (ioHandle == 0) return;
@@ -417,7 +417,7 @@
switch (event) {
case STREAM_CONFIG_CHANGED:
if (param2 == NULL) break;
- stream = *(audio_stream_type_t *)param2;
+ stream = *(const audio_stream_type_t *)param2;
ALOGV("ioConfigChanged() STREAM_CONFIG_CHANGED stream %d, output %d", stream, ioHandle);
if (gStreamOutputMap.indexOfKey(stream) >= 0) {
gStreamOutputMap.replaceValueFor(stream, ioHandle);
@@ -429,7 +429,7 @@
break;
}
if (param2 == NULL) break;
- desc = (OutputDescriptor *)param2;
+ desc = (const OutputDescriptor *)param2;
OutputDescriptor *outputDesc = new OutputDescriptor(*desc);
gOutputs.add(ioHandle, outputDesc);
@@ -458,7 +458,7 @@
break;
}
if (param2 == NULL) break;
- desc = (OutputDescriptor *)param2;
+ desc = (const OutputDescriptor *)param2;
ALOGV("ioConfigChanged() new config for output %d samplingRate %d, format %d channels %d frameCount %d latency %d",
ioHandle, desc->samplingRate, desc->format,
diff --git a/media/libmedia/IAudioFlingerClient.cpp b/media/libmedia/IAudioFlingerClient.cpp
index ce28b33..1db39a3 100644
--- a/media/libmedia/IAudioFlingerClient.cpp
+++ b/media/libmedia/IAudioFlingerClient.cpp
@@ -39,18 +39,18 @@
{
}
- void ioConfigChanged(int event, audio_io_handle_t ioHandle, void *param2)
+ void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2)
{
Parcel data, reply;
data.writeInterfaceToken(IAudioFlingerClient::getInterfaceDescriptor());
data.writeInt32(event);
data.writeInt32((int32_t) ioHandle);
if (event == AudioSystem::STREAM_CONFIG_CHANGED) {
- uint32_t stream = *(uint32_t *)param2;
+ uint32_t stream = *(const uint32_t *)param2;
ALOGV("ioConfigChanged stream %d", stream);
data.writeInt32(stream);
} else if (event != AudioSystem::OUTPUT_CLOSED && event != AudioSystem::INPUT_CLOSED) {
- AudioSystem::OutputDescriptor *desc = (AudioSystem::OutputDescriptor *)param2;
+ const AudioSystem::OutputDescriptor *desc = (const AudioSystem::OutputDescriptor *)param2;
data.writeInt32(desc->samplingRate);
data.writeInt32(desc->format);
data.writeInt32(desc->channels);
@@ -73,7 +73,7 @@
CHECK_INTERFACE(IAudioFlingerClient, data, reply);
int event = data.readInt32();
audio_io_handle_t ioHandle = (audio_io_handle_t) data.readInt32();
- void *param2 = NULL;
+ const void *param2 = NULL;
AudioSystem::OutputDescriptor desc;
uint32_t stream;
if (event == AudioSystem::STREAM_CONFIG_CHANGED) {
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index b21e86a..9e00bb3 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -2108,6 +2108,8 @@
mWVMExtractor = new WVMExtractor(dataSource);
mWVMExtractor->setAdaptiveStreamingMode(true);
+ if (mUIDValid)
+ mWVMExtractor->setUID(mUID);
extractor = mWVMExtractor;
} else {
extractor = MediaExtractor::Create(
diff --git a/media/libstagefright/WVMExtractor.cpp b/media/libstagefright/WVMExtractor.cpp
index c7ad513..dac8106 100644
--- a/media/libstagefright/WVMExtractor.cpp
+++ b/media/libstagefright/WVMExtractor.cpp
@@ -123,6 +123,12 @@
}
}
+void WVMExtractor::setUID(uid_t uid) {
+ if (mImpl != NULL) {
+ mImpl->setUID(uid);
+ }
+}
+
bool SniffWVM(
const sp<DataSource> &source, String8 *mimeType, float *confidence,
sp<AMessage> *) {
diff --git a/media/libstagefright/codecs/m4v_h263/dec/src/vop.cpp b/media/libstagefright/codecs/m4v_h263/dec/src/vop.cpp
index 74fe478..b3c350f 100644
--- a/media/libstagefright/codecs/m4v_h263/dec/src/vop.cpp
+++ b/media/libstagefright/codecs/m4v_h263/dec/src/vop.cpp
@@ -1041,7 +1041,7 @@
/* Marker Bit */
if (!BitstreamRead1Bits(stream))
{
- mp4dec_log("DecodeShortHeader(): Market bit wrong.\n");
+ mp4dec_log("DecodeShortHeader(): Marker bit wrong.\n");
status = PV_FAIL;
goto return_point;
}
diff --git a/media/libstagefright/include/WVMExtractor.h b/media/libstagefright/include/WVMExtractor.h
index 9f763f9..3c3ca89 100644
--- a/media/libstagefright/include/WVMExtractor.h
+++ b/media/libstagefright/include/WVMExtractor.h
@@ -34,6 +34,7 @@
virtual int64_t getCachedDurationUs(status_t *finalStatus) = 0;
virtual void setAdaptiveStreamingMode(bool adaptive) = 0;
+ virtual void setUID(uid_t uid) = 0;
};
class WVMExtractor : public MediaExtractor {
@@ -60,6 +61,8 @@
// is used.
void setAdaptiveStreamingMode(bool adaptive);
+ void setUID(uid_t uid);
+
static bool getVendorLibHandle();
protected:
diff --git a/opengl/include/EGL/egl.h b/opengl/include/EGL/egl.h
deleted file mode 100644
index 99ea342..0000000
--- a/opengl/include/EGL/egl.h
+++ /dev/null
@@ -1,329 +0,0 @@
-/* -*- mode: c; tab-width: 8; -*- */
-/* vi: set sw=4 ts=8: */
-/* Reference version of egl.h for EGL 1.4.
- * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
- */
-
-/*
-** Copyright (c) 2007-2009 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#ifndef __egl_h_
-#define __egl_h_
-
-/* All platform-dependent types and macro boilerplate (such as EGLAPI
- * and EGLAPIENTRY) should go in eglplatform.h.
- */
-#include <EGL/eglplatform.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* EGL Types */
-/* EGLint is defined in eglplatform.h */
-typedef unsigned int EGLBoolean;
-typedef unsigned int EGLenum;
-typedef void *EGLConfig;
-typedef void *EGLContext;
-typedef void *EGLDisplay;
-typedef void *EGLSurface;
-typedef void *EGLClientBuffer;
-
-/* EGL Versioning */
-#define EGL_VERSION_1_0 1
-#define EGL_VERSION_1_1 1
-#define EGL_VERSION_1_2 1
-#define EGL_VERSION_1_3 1
-#define EGL_VERSION_1_4 1
-
-/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
- * enums are assigned unique values starting at 0x3000.
- */
-
-/* EGL aliases */
-#define EGL_FALSE 0
-#define EGL_TRUE 1
-
-/* Out-of-band handle values */
-#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
-#define EGL_NO_CONTEXT ((EGLContext)0)
-#define EGL_NO_DISPLAY ((EGLDisplay)0)
-#define EGL_NO_SURFACE ((EGLSurface)0)
-
-/* Out-of-band attribute value */
-#define EGL_DONT_CARE ((EGLint)-1)
-
-/* Errors / GetError return values */
-#define EGL_SUCCESS 0x3000
-#define EGL_NOT_INITIALIZED 0x3001
-#define EGL_BAD_ACCESS 0x3002
-#define EGL_BAD_ALLOC 0x3003
-#define EGL_BAD_ATTRIBUTE 0x3004
-#define EGL_BAD_CONFIG 0x3005
-#define EGL_BAD_CONTEXT 0x3006
-#define EGL_BAD_CURRENT_SURFACE 0x3007
-#define EGL_BAD_DISPLAY 0x3008
-#define EGL_BAD_MATCH 0x3009
-#define EGL_BAD_NATIVE_PIXMAP 0x300A
-#define EGL_BAD_NATIVE_WINDOW 0x300B
-#define EGL_BAD_PARAMETER 0x300C
-#define EGL_BAD_SURFACE 0x300D
-#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
-
-/* Reserved 0x300F-0x301F for additional errors */
-
-/* Config attributes */
-#define EGL_BUFFER_SIZE 0x3020
-#define EGL_ALPHA_SIZE 0x3021
-#define EGL_BLUE_SIZE 0x3022
-#define EGL_GREEN_SIZE 0x3023
-#define EGL_RED_SIZE 0x3024
-#define EGL_DEPTH_SIZE 0x3025
-#define EGL_STENCIL_SIZE 0x3026
-#define EGL_CONFIG_CAVEAT 0x3027
-#define EGL_CONFIG_ID 0x3028
-#define EGL_LEVEL 0x3029
-#define EGL_MAX_PBUFFER_HEIGHT 0x302A
-#define EGL_MAX_PBUFFER_PIXELS 0x302B
-#define EGL_MAX_PBUFFER_WIDTH 0x302C
-#define EGL_NATIVE_RENDERABLE 0x302D
-#define EGL_NATIVE_VISUAL_ID 0x302E
-#define EGL_NATIVE_VISUAL_TYPE 0x302F
-#define EGL_SAMPLES 0x3031
-#define EGL_SAMPLE_BUFFERS 0x3032
-#define EGL_SURFACE_TYPE 0x3033
-#define EGL_TRANSPARENT_TYPE 0x3034
-#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
-#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
-#define EGL_TRANSPARENT_RED_VALUE 0x3037
-#define EGL_NONE 0x3038 /* Attrib list terminator */
-#define EGL_BIND_TO_TEXTURE_RGB 0x3039
-#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
-#define EGL_MIN_SWAP_INTERVAL 0x303B
-#define EGL_MAX_SWAP_INTERVAL 0x303C
-#define EGL_LUMINANCE_SIZE 0x303D
-#define EGL_ALPHA_MASK_SIZE 0x303E
-#define EGL_COLOR_BUFFER_TYPE 0x303F
-#define EGL_RENDERABLE_TYPE 0x3040
-#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
-#define EGL_CONFORMANT 0x3042
-
-/* Reserved 0x3041-0x304F for additional config attributes */
-
-/* Config attribute values */
-#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
-#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
-#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
-#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
-#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
-
-/* More config attribute values, for EGL_TEXTURE_FORMAT */
-#define EGL_NO_TEXTURE 0x305C
-#define EGL_TEXTURE_RGB 0x305D
-#define EGL_TEXTURE_RGBA 0x305E
-#define EGL_TEXTURE_2D 0x305F
-
-/* Config attribute mask bits */
-#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
-
-#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
-#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
-#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
-#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
-
-/* QueryString targets */
-#define EGL_VENDOR 0x3053
-#define EGL_VERSION 0x3054
-#define EGL_EXTENSIONS 0x3055
-#define EGL_CLIENT_APIS 0x308D
-
-/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
-#define EGL_HEIGHT 0x3056
-#define EGL_WIDTH 0x3057
-#define EGL_LARGEST_PBUFFER 0x3058
-#define EGL_TEXTURE_FORMAT 0x3080
-#define EGL_TEXTURE_TARGET 0x3081
-#define EGL_MIPMAP_TEXTURE 0x3082
-#define EGL_MIPMAP_LEVEL 0x3083
-#define EGL_RENDER_BUFFER 0x3086
-#define EGL_VG_COLORSPACE 0x3087
-#define EGL_VG_ALPHA_FORMAT 0x3088
-#define EGL_HORIZONTAL_RESOLUTION 0x3090
-#define EGL_VERTICAL_RESOLUTION 0x3091
-#define EGL_PIXEL_ASPECT_RATIO 0x3092
-#define EGL_SWAP_BEHAVIOR 0x3093
-#define EGL_MULTISAMPLE_RESOLVE 0x3099
-
-/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
-#define EGL_BACK_BUFFER 0x3084
-#define EGL_SINGLE_BUFFER 0x3085
-
-/* OpenVG color spaces */
-#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
-#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
-
-/* OpenVG alpha formats */
-#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
-#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
-
-/* Constant scale factor by which fractional display resolutions &
- * aspect ratio are scaled when queried as integer values.
- */
-#define EGL_DISPLAY_SCALING 10000
-
-/* Unknown display resolution/aspect ratio */
-#define EGL_UNKNOWN ((EGLint)-1)
-
-/* Back buffer swap behaviors */
-#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
-#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
-
-/* CreatePbufferFromClientBuffer buffer types */
-#define EGL_OPENVG_IMAGE 0x3096
-
-/* QueryContext targets */
-#define EGL_CONTEXT_CLIENT_TYPE 0x3097
-
-/* CreateContext attributes */
-#define EGL_CONTEXT_CLIENT_VERSION 0x3098
-
-/* Multisample resolution behaviors */
-#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
-#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
-
-/* BindAPI/QueryAPI targets */
-#define EGL_OPENGL_ES_API 0x30A0
-#define EGL_OPENVG_API 0x30A1
-#define EGL_OPENGL_API 0x30A2
-
-/* GetCurrentSurface targets */
-#define EGL_DRAW 0x3059
-#define EGL_READ 0x305A
-
-/* WaitNative engines */
-#define EGL_CORE_NATIVE_ENGINE 0x305B
-
-/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
-#define EGL_COLORSPACE EGL_VG_COLORSPACE
-#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
-#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
-#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
-#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
-#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
-
-/* EGL extensions must request enum blocks from the Khronos
- * API Registrar, who maintains the enumerant registry. Submit
- * a bug in Khronos Bugzilla against task "Registry".
- */
-
-
-
-/* EGL Functions */
-
-EGLAPI EGLint EGLAPIENTRY eglGetError(void);
-
-EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
-EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
-EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
-
-EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
-
-EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
- EGLint config_size, EGLint *num_config);
-EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
- EGLConfig *configs, EGLint config_size,
- EGLint *num_config);
-EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
- EGLint attribute, EGLint *value);
-
-EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
- EGLNativeWindowType win,
- const EGLint *attrib_list);
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list);
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
- EGLNativePixmapType pixmap,
- const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
-EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
- EGLint attribute, EGLint *value);
-
-EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
-EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
-
-EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
-
-EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
-
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
- EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
- EGLConfig config, const EGLint *attrib_list);
-
-EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
- EGLint attribute, EGLint value);
-EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-
-
-EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
-
-
-EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
- EGLContext share_context,
- const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
-EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
- EGLSurface read, EGLContext ctx);
-
-EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
-EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
-EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
- EGLint attribute, EGLint *value);
-
-EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
-EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
-EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
-EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
- EGLNativePixmapType target);
-
-/* This is a generic function pointer type, whose name indicates it must
- * be cast to the proper type *and calling convention* before use.
- */
-typedef void (*__eglMustCastToProperFunctionPointerType)(void);
-
-/* Now, define eglGetProcAddress using the generic function ptr. type */
-EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
- eglGetProcAddress(const char *procname);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __egl_h_ */
diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h
deleted file mode 100644
index ca11863..0000000
--- a/opengl/include/EGL/eglext.h
+++ /dev/null
@@ -1,270 +0,0 @@
-#ifndef __eglext_h_
-#define __eglext_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2007-2010 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#include <EGL/eglplatform.h>
-
-/*************************************************************/
-
-/* Header file version number */
-/* Current version at http://www.khronos.org/registry/egl/ */
-/* $Revision: 11249 $ on $Date: 2010-05-05 09:54:28 -0700 (Wed, 05 May 2010) $ */
-#define EGL_EGLEXT_VERSION 5
-
-#ifndef EGL_KHR_config_attribs
-#define EGL_KHR_config_attribs 1
-#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
-#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
-#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
-#endif
-
-#ifndef EGL_KHR_lock_surface
-#define EGL_KHR_lock_surface 1
-#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
-#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
-#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
-#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
-#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
-#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
-#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
-#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
-#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
-#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
-#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
-#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
-#endif
-
-#ifndef EGL_KHR_image
-#define EGL_KHR_image 1
-#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
-typedef void *EGLImageKHR;
-#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
-#endif
-
-#ifndef EGL_KHR_vg_parent_image
-#define EGL_KHR_vg_parent_image 1
-#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
-#endif
-
-#ifndef EGL_KHR_gl_texture_2D_image
-#define EGL_KHR_gl_texture_2D_image 1
-#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */
-#endif
-
-#ifndef EGL_KHR_gl_texture_cubemap_image
-#define EGL_KHR_gl_texture_cubemap_image 1
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */
-#endif
-
-#ifndef EGL_KHR_gl_texture_3D_image
-#define EGL_KHR_gl_texture_3D_image 1
-#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */
-#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */
-#endif
-
-#ifndef EGL_KHR_gl_renderbuffer_image
-#define EGL_KHR_gl_renderbuffer_image 1
-#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
-#endif
-
-#ifndef EGL_KHR_reusable_sync
-#define EGL_KHR_reusable_sync 1
-
-typedef void* EGLSyncKHR;
-typedef khronos_utime_nanoseconds_t EGLTimeKHR;
-
-#define EGL_SYNC_STATUS_KHR 0x30F1
-#define EGL_SIGNALED_KHR 0x30F2
-#define EGL_UNSIGNALED_KHR 0x30F3
-#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
-#define EGL_CONDITION_SATISFIED_KHR 0x30F6
-#define EGL_SYNC_TYPE_KHR 0x30F7
-#define EGL_SYNC_REUSABLE_KHR 0x30FA
-#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR <flags> bitfield */
-#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
-#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
-EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
-EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
-EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
-typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
-#endif
-
-#ifndef EGL_KHR_image_base
-#define EGL_KHR_image_base 1
-/* Most interfaces defined by EGL_KHR_image_pixmap above */
-#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */
-#endif
-
-#ifndef EGL_KHR_image_pixmap
-#define EGL_KHR_image_pixmap 1
-/* Interfaces defined by EGL_KHR_image above */
-#endif
-
-#ifndef EGL_IMG_context_priority
-#define EGL_IMG_context_priority 1
-#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
-#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
-#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
-#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
-#endif
-
-#ifndef EGL_NV_coverage_sample
-#define EGL_NV_coverage_sample 1
-#define EGL_COVERAGE_BUFFERS_NV 0x30E0
-#define EGL_COVERAGE_SAMPLES_NV 0x30E1
-#endif
-
-#ifndef EGL_NV_depth_nonlinear
-#define EGL_NV_depth_nonlinear 1
-#define EGL_DEPTH_ENCODING_NV 0x30E2
-#define EGL_DEPTH_ENCODING_NONE_NV 0
-#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
-#endif
-
-#ifndef EGL_NV_sync
-#define EGL_NV_sync 1
-#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
-#define EGL_SYNC_STATUS_NV 0x30E7
-#define EGL_SIGNALED_NV 0x30E8
-#define EGL_UNSIGNALED_NV 0x30E9
-#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001
-#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull
-#define EGL_ALREADY_SIGNALED_NV 0x30EA
-#define EGL_TIMEOUT_EXPIRED_NV 0x30EB
-#define EGL_CONDITION_SATISFIED_NV 0x30EC
-#define EGL_SYNC_TYPE_NV 0x30ED
-#define EGL_SYNC_CONDITION_NV 0x30EE
-#define EGL_SYNC_FENCE_NV 0x30EF
-#define EGL_NO_SYNC_NV ((EGLSyncNV)0)
-typedef void* EGLSyncNV;
-typedef unsigned long long EGLTimeNV;
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
-EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
-EGLBoolean eglFenceNV (EGLSyncNV sync);
-EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
-EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
-EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
-typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
-#endif
-
-#ifndef EGL_KHR_fence_sync
-#define EGL_KHR_fence_sync 1
-/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
-#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
-#define EGL_SYNC_CONDITION_KHR 0x30F8
-#define EGL_SYNC_FENCE_KHR 0x30F9
-#endif
-
-#ifndef EGL_ANDROID_image_native_buffer
-#define EGL_ANDROID_image_native_buffer 1
-struct ANativeWindowBuffer;
-#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
-#endif
-
-#ifndef EGL_ANDROID_recordable
-#define EGL_ANDROID_recordable 1
-#define EGL_RECORDABLE_ANDROID 0x3142 /* EGLConfig attribute */
-#endif
-
-/* EGL_NV_system_time
- */
-#ifndef EGL_NV_system_time
-#define EGL_NV_system_time 1
-typedef khronos_int64_t EGLint64NV;
-typedef khronos_uint64_t EGLuint64NV;
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);
-EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);
-#endif
-typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC)(void);
-typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC)(void);
-#endif
-
-
-/* EGL_ANDROID_blob_cache
- */
-#ifndef EGL_ANDROID_blob_cache
-#define EGL_ANDROID_blob_cache 1
-typedef khronos_ssize_t EGLsizeiANDROID;
-typedef void (*EGLSetBlobFuncANDROID) (const void* key, EGLsizeiANDROID keySize, const void* value, EGLsizeiANDROID valueSize);
-typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void* key, EGLsizeiANDROID keySize, void* value, EGLsizeiANDROID valueSize);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy,
- EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/opengl/include/EGL/eglplatform.h b/opengl/include/EGL/eglplatform.h
deleted file mode 100644
index bfac71b..0000000
--- a/opengl/include/EGL/eglplatform.h
+++ /dev/null
@@ -1,120 +0,0 @@
-#ifndef __eglplatform_h_
-#define __eglplatform_h_
-
-/*
-** Copyright (c) 2007-2009 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-/* Platform-specific types and definitions for egl.h
- * $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $
- *
- * Adopters may modify khrplatform.h and this file to suit their platform.
- * You are encouraged to submit all modifications to the Khronos group so that
- * they can be included in future versions of this file. Please submit changes
- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
- * by filing a bug against product "EGL" component "Registry".
- */
-
-#include <KHR/khrplatform.h>
-
-/* Macros used in EGL function prototype declarations.
- *
- * EGL functions should be prototyped as:
- *
- * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
- * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
- *
- * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
- */
-
-#ifndef EGLAPI
-#define EGLAPI KHRONOS_APICALL
-#endif
-
-#ifndef EGLAPIENTRY
-#define EGLAPIENTRY KHRONOS_APIENTRY
-#endif
-#define EGLAPIENTRYP EGLAPIENTRY*
-
-/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
- * are aliases of window-system-dependent types, such as X Display * or
- * Windows Device Context. They must be defined in platform-specific
- * code below. The EGL-prefixed versions of Native*Type are the same
- * types, renamed in EGL 1.3 so all types in the API start with "EGL".
- */
-
-#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN 1
-#endif
-#include <windows.h>
-
-typedef HDC EGLNativeDisplayType;
-typedef HBITMAP EGLNativePixmapType;
-typedef HWND EGLNativeWindowType;
-
-#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
-
-typedef int EGLNativeDisplayType;
-typedef void *EGLNativeWindowType;
-typedef void *EGLNativePixmapType;
-
-#elif defined(__ANDROID__) || defined(ANDROID)
-
-#include <android/native_window.h>
-
-struct egl_native_pixmap_t;
-
-typedef struct ANativeWindow* EGLNativeWindowType;
-typedef struct egl_native_pixmap_t* EGLNativePixmapType;
-typedef void* EGLNativeDisplayType;
-
-#elif defined(__unix__)
-
-/* X11 (tentative) */
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-typedef Display *EGLNativeDisplayType;
-typedef Pixmap EGLNativePixmapType;
-typedef Window EGLNativeWindowType;
-
-#else
-#error "Platform not recognized"
-#endif
-
-/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
-typedef EGLNativeDisplayType NativeDisplayType;
-typedef EGLNativePixmapType NativePixmapType;
-typedef EGLNativeWindowType NativeWindowType;
-
-
-/* Define EGLint. This must be a signed integral type large enough to contain
- * all legal attribute names and values passed into and out of EGL, whether
- * their type is boolean, bitmask, enumerant (symbolic constant), integer,
- * handle, or other. While in general a 32-bit integer will suffice, if
- * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
- * integer type.
- */
-typedef khronos_int32_t EGLint;
-
-#endif /* __eglplatform_h */
diff --git a/opengl/include/ETC1/etc1.h b/opengl/include/ETC1/etc1.h
deleted file mode 100644
index 0d38905..0000000
--- a/opengl/include/ETC1/etc1.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2009 Google Inc.
-//
-// 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.
-
-#ifndef __etc1_h__
-#define __etc1_h__
-
-#define ETC1_ENCODED_BLOCK_SIZE 8
-#define ETC1_DECODED_BLOCK_SIZE 48
-
-#ifndef ETC1_RGB8_OES
-#define ETC1_RGB8_OES 0x8D64
-#endif
-
-typedef unsigned char etc1_byte;
-typedef int etc1_bool;
-typedef unsigned int etc1_uint32;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Encode a block of pixels.
-//
-// pIn is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a
-// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R
-// value of pixel (x, y).
-//
-// validPixelMask is a 16-bit mask where bit (1 << (x + y * 4)) indicates whether
-// the corresponding (x,y) pixel is valid. Invalid pixel color values are ignored when compressing.
-//
-// pOut is an ETC1 compressed version of the data.
-
-void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 validPixelMask, etc1_byte* pOut);
-
-// Decode a block of pixels.
-//
-// pIn is an ETC1 compressed version of the data.
-//
-// pOut is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a
-// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R
-// value of pixel (x, y).
-
-void etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut);
-
-// Return the size of the encoded image data (does not include size of PKM header).
-
-etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height);
-
-// Encode an entire image.
-// pIn - pointer to the image data. Formatted such that
-// pixel (x,y) is at pIn + pixelSize * x + stride * y;
-// pOut - pointer to encoded data. Must be large enough to store entire encoded image.
-// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image.
-// returns non-zero if there is an error.
-
-int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height,
- etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut);
-
-// Decode an entire image.
-// pIn - pointer to encoded data.
-// pOut - pointer to the image data. Will be written such that
-// pixel (x,y) is at pIn + pixelSize * x + stride * y. Must be
-// large enough to store entire image.
-// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image.
-// returns non-zero if there is an error.
-
-int etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut,
- etc1_uint32 width, etc1_uint32 height,
- etc1_uint32 pixelSize, etc1_uint32 stride);
-
-// Size of a PKM header, in bytes.
-
-#define ETC_PKM_HEADER_SIZE 16
-
-// Format a PKM header
-
-void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height);
-
-// Check if a PKM header is correctly formatted.
-
-etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader);
-
-// Read the image width from a PKM header
-
-etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader);
-
-// Read the image height from a PKM header
-
-etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/opengl/include/GLES/egl.h b/opengl/include/GLES/egl.h
deleted file mode 100644
index 5778e00..0000000
--- a/opengl/include/GLES/egl.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Skeleton egl.h to provide compatibility for early GLES 1.0
- * applications. Several early implementations included gl.h
- * in egl.h leading applications to include only egl.h
- *
- * $Revision: 6252 $ on $Date:: 2008-08-06 16:35:08 -0700 #$
- */
-
-#ifndef __legacy_egl_h_
-#define __legacy_egl_h_
-
-#include <EGL/egl.h>
-#include <GLES/gl.h>
-
-#endif /* __legacy_egl_h_ */
diff --git a/opengl/include/GLES/gl.h b/opengl/include/GLES/gl.h
deleted file mode 100644
index 5b8d85a..0000000
--- a/opengl/include/GLES/gl.h
+++ /dev/null
@@ -1,770 +0,0 @@
-#ifndef __gl_h_
-#define __gl_h_
-
-/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
-
-#include <GLES/glplatform.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
-
-typedef void GLvoid;
-typedef char GLchar;
-typedef unsigned int GLenum;
-typedef unsigned char GLboolean;
-typedef unsigned int GLbitfield;
-typedef khronos_int8_t GLbyte;
-typedef short GLshort;
-typedef int GLint;
-typedef int GLsizei;
-typedef khronos_uint8_t GLubyte;
-typedef unsigned short GLushort;
-typedef unsigned int GLuint;
-typedef khronos_float_t GLfloat;
-typedef khronos_float_t GLclampf;
-typedef khronos_int32_t GLfixed;
-typedef khronos_int32_t GLclampx;
-
-typedef khronos_intptr_t GLintptr;
-typedef khronos_ssize_t GLsizeiptr;
-
-
-/*************************************************************/
-
-/* OpenGL ES core versions */
-#define GL_VERSION_ES_CM_1_0 1
-#define GL_VERSION_ES_CL_1_0 1
-#define GL_VERSION_ES_CM_1_1 1
-#define GL_VERSION_ES_CL_1_1 1
-
-/* ClearBufferMask */
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_COLOR_BUFFER_BIT 0x00004000
-
-/* Boolean */
-#define GL_FALSE 0
-#define GL_TRUE 1
-
-/* BeginMode */
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-
-/* AlphaFunction */
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-
-/* BlendingFactorDest */
-#define GL_ZERO 0
-#define GL_ONE 1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-
-/* BlendingFactorSrc */
-/* GL_ZERO */
-/* GL_ONE */
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-/* GL_SRC_ALPHA */
-/* GL_ONE_MINUS_SRC_ALPHA */
-/* GL_DST_ALPHA */
-/* GL_ONE_MINUS_DST_ALPHA */
-
-/* ClipPlaneName */
-#define GL_CLIP_PLANE0 0x3000
-#define GL_CLIP_PLANE1 0x3001
-#define GL_CLIP_PLANE2 0x3002
-#define GL_CLIP_PLANE3 0x3003
-#define GL_CLIP_PLANE4 0x3004
-#define GL_CLIP_PLANE5 0x3005
-
-/* ColorMaterialFace */
-/* GL_FRONT_AND_BACK */
-
-/* ColorMaterialParameter */
-/* GL_AMBIENT_AND_DIFFUSE */
-
-/* ColorPointerType */
-/* GL_UNSIGNED_BYTE */
-/* GL_FLOAT */
-/* GL_FIXED */
-
-/* CullFaceMode */
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_FRONT_AND_BACK 0x0408
-
-/* DepthFunction */
-/* GL_NEVER */
-/* GL_LESS */
-/* GL_EQUAL */
-/* GL_LEQUAL */
-/* GL_GREATER */
-/* GL_NOTEQUAL */
-/* GL_GEQUAL */
-/* GL_ALWAYS */
-
-/* EnableCap */
-#define GL_FOG 0x0B60
-#define GL_LIGHTING 0x0B50
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_CULL_FACE 0x0B44
-#define GL_ALPHA_TEST 0x0BC0
-#define GL_BLEND 0x0BE2
-#define GL_COLOR_LOGIC_OP 0x0BF2
-#define GL_DITHER 0x0BD0
-#define GL_STENCIL_TEST 0x0B90
-#define GL_DEPTH_TEST 0x0B71
-/* GL_LIGHT0 */
-/* GL_LIGHT1 */
-/* GL_LIGHT2 */
-/* GL_LIGHT3 */
-/* GL_LIGHT4 */
-/* GL_LIGHT5 */
-/* GL_LIGHT6 */
-/* GL_LIGHT7 */
-#define GL_POINT_SMOOTH 0x0B10
-#define GL_LINE_SMOOTH 0x0B20
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_COLOR_MATERIAL 0x0B57
-#define GL_NORMALIZE 0x0BA1
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_NORMAL_ARRAY 0x8075
-#define GL_COLOR_ARRAY 0x8076
-#define GL_TEXTURE_COORD_ARRAY 0x8078
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-
-/* ErrorCode */
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_OUT_OF_MEMORY 0x0505
-
-/* FogMode */
-/* GL_LINEAR */
-#define GL_EXP 0x0800
-#define GL_EXP2 0x0801
-
-/* FogParameter */
-#define GL_FOG_DENSITY 0x0B62
-#define GL_FOG_START 0x0B63
-#define GL_FOG_END 0x0B64
-#define GL_FOG_MODE 0x0B65
-#define GL_FOG_COLOR 0x0B66
-
-/* FrontFaceDirection */
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-
-/* GetPName */
-#define GL_CURRENT_COLOR 0x0B00
-#define GL_CURRENT_NORMAL 0x0B02
-#define GL_CURRENT_TEXTURE_COORDS 0x0B03
-#define GL_POINT_SIZE 0x0B11
-#define GL_POINT_SIZE_MIN 0x8126
-#define GL_POINT_SIZE_MAX 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION 0x8129
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_LINE_WIDTH 0x0B21
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_SHADE_MODEL 0x0B54
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_MATRIX_MODE 0x0BA0
-#define GL_VIEWPORT 0x0BA2
-#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
-#define GL_PROJECTION_STACK_DEPTH 0x0BA4
-#define GL_TEXTURE_STACK_DEPTH 0x0BA5
-#define GL_MODELVIEW_MATRIX 0x0BA6
-#define GL_PROJECTION_MATRIX 0x0BA7
-#define GL_TEXTURE_MATRIX 0x0BA8
-#define GL_ALPHA_TEST_FUNC 0x0BC1
-#define GL_ALPHA_TEST_REF 0x0BC2
-#define GL_BLEND_DST 0x0BE0
-#define GL_BLEND_SRC 0x0BE1
-#define GL_LOGIC_OP_MODE 0x0BF0
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAX_LIGHTS 0x0D31
-#define GL_MAX_CLIP_PLANES 0x0D32
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
-#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
-#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_VERTEX_ARRAY_SIZE 0x807A
-#define GL_VERTEX_ARRAY_TYPE 0x807B
-#define GL_VERTEX_ARRAY_STRIDE 0x807C
-#define GL_NORMAL_ARRAY_TYPE 0x807E
-#define GL_NORMAL_ARRAY_STRIDE 0x807F
-#define GL_COLOR_ARRAY_SIZE 0x8081
-#define GL_COLOR_ARRAY_TYPE 0x8082
-#define GL_COLOR_ARRAY_STRIDE 0x8083
-#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
-#define GL_VERTEX_ARRAY_POINTER 0x808E
-#define GL_NORMAL_ARRAY_POINTER 0x808F
-#define GL_COLOR_ARRAY_POINTER 0x8090
-#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-
-/* GetTextureParameter */
-/* GL_TEXTURE_MAG_FILTER */
-/* GL_TEXTURE_MIN_FILTER */
-/* GL_TEXTURE_WRAP_S */
-/* GL_TEXTURE_WRAP_T */
-
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-
-/* HintMode */
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-
-/* HintTarget */
-#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
-#define GL_POINT_SMOOTH_HINT 0x0C51
-#define GL_LINE_SMOOTH_HINT 0x0C52
-#define GL_FOG_HINT 0x0C54
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-
-/* LightModelParameter */
-#define GL_LIGHT_MODEL_AMBIENT 0x0B53
-#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
-
-/* LightParameter */
-#define GL_AMBIENT 0x1200
-#define GL_DIFFUSE 0x1201
-#define GL_SPECULAR 0x1202
-#define GL_POSITION 0x1203
-#define GL_SPOT_DIRECTION 0x1204
-#define GL_SPOT_EXPONENT 0x1205
-#define GL_SPOT_CUTOFF 0x1206
-#define GL_CONSTANT_ATTENUATION 0x1207
-#define GL_LINEAR_ATTENUATION 0x1208
-#define GL_QUADRATIC_ATTENUATION 0x1209
-
-/* DataType */
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_FLOAT 0x1406
-#define GL_FIXED 0x140C
-
-/* LogicOp */
-#define GL_CLEAR 0x1500
-#define GL_AND 0x1501
-#define GL_AND_REVERSE 0x1502
-#define GL_COPY 0x1503
-#define GL_AND_INVERTED 0x1504
-#define GL_NOOP 0x1505
-#define GL_XOR 0x1506
-#define GL_OR 0x1507
-#define GL_NOR 0x1508
-#define GL_EQUIV 0x1509
-#define GL_INVERT 0x150A
-#define GL_OR_REVERSE 0x150B
-#define GL_COPY_INVERTED 0x150C
-#define GL_OR_INVERTED 0x150D
-#define GL_NAND 0x150E
-#define GL_SET 0x150F
-
-/* MaterialFace */
-/* GL_FRONT_AND_BACK */
-
-/* MaterialParameter */
-#define GL_EMISSION 0x1600
-#define GL_SHININESS 0x1601
-#define GL_AMBIENT_AND_DIFFUSE 0x1602
-/* GL_AMBIENT */
-/* GL_DIFFUSE */
-/* GL_SPECULAR */
-
-/* MatrixMode */
-#define GL_MODELVIEW 0x1700
-#define GL_PROJECTION 0x1701
-#define GL_TEXTURE 0x1702
-
-/* NormalPointerType */
-/* GL_BYTE */
-/* GL_SHORT */
-/* GL_FLOAT */
-/* GL_FIXED */
-
-/* PixelFormat */
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-
-/* PixelStoreParameter */
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_ALIGNMENT 0x0D05
-
-/* PixelType */
-/* GL_UNSIGNED_BYTE */
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-
-/* ShadingModel */
-#define GL_FLAT 0x1D00
-#define GL_SMOOTH 0x1D01
-
-/* StencilFunction */
-/* GL_NEVER */
-/* GL_LESS */
-/* GL_EQUAL */
-/* GL_LEQUAL */
-/* GL_GREATER */
-/* GL_NOTEQUAL */
-/* GL_GEQUAL */
-/* GL_ALWAYS */
-
-/* StencilOp */
-/* GL_ZERO */
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-/* GL_INVERT */
-
-/* StringName */
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-
-/* TexCoordPointerType */
-/* GL_SHORT */
-/* GL_FLOAT */
-/* GL_FIXED */
-/* GL_BYTE */
-
-/* TextureEnvMode */
-#define GL_MODULATE 0x2100
-#define GL_DECAL 0x2101
-/* GL_BLEND */
-#define GL_ADD 0x0104
-/* GL_REPLACE */
-
-/* TextureEnvParameter */
-#define GL_TEXTURE_ENV_MODE 0x2200
-#define GL_TEXTURE_ENV_COLOR 0x2201
-
-/* TextureEnvTarget */
-#define GL_TEXTURE_ENV 0x2300
-
-/* TextureMagFilter */
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-
-/* TextureMinFilter */
-/* GL_NEAREST */
-/* GL_LINEAR */
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-
-/* TextureParameterName */
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_GENERATE_MIPMAP 0x8191
-
-/* TextureTarget */
-/* GL_TEXTURE_2D */
-
-/* TextureUnit */
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-
-/* TextureWrapMode */
-#define GL_REPEAT 0x2901
-#define GL_CLAMP_TO_EDGE 0x812F
-
-/* VertexPointerType */
-/* GL_SHORT */
-/* GL_FLOAT */
-/* GL_FIXED */
-/* GL_BYTE */
-
-/* LightName */
-#define GL_LIGHT0 0x4000
-#define GL_LIGHT1 0x4001
-#define GL_LIGHT2 0x4002
-#define GL_LIGHT3 0x4003
-#define GL_LIGHT4 0x4004
-#define GL_LIGHT5 0x4005
-#define GL_LIGHT6 0x4006
-#define GL_LIGHT7 0x4007
-
-/* Buffer Objects */
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-
-#define GL_STATIC_DRAW 0x88E4
-#define GL_DYNAMIC_DRAW 0x88E8
-
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-
-/* Texture combine + dot3 */
-#define GL_SUBTRACT 0x84E7
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PREVIOUS 0x8578
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-
-#define GL_ALPHA_SCALE 0x0D1C
-
-#define GL_SRC0_RGB 0x8580
-#define GL_SRC1_RGB 0x8581
-#define GL_SRC2_RGB 0x8582
-#define GL_SRC0_ALPHA 0x8588
-#define GL_SRC1_ALPHA 0x8589
-#define GL_SRC2_ALPHA 0x858A
-
-#define GL_DOT3_RGB 0x86AE
-#define GL_DOT3_RGBA 0x86AF
-
-/*------------------------------------------------------------------------*
- * required OES extension tokens
- *------------------------------------------------------------------------*/
-
-/* OES_read_format */
-#ifndef GL_OES_read_format
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-#endif
-
-/* GL_OES_compressed_paletted_texture */
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_PALETTE4_RGB8_OES 0x8B90
-#define GL_PALETTE4_RGBA8_OES 0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
-#define GL_PALETTE4_RGBA4_OES 0x8B93
-#define GL_PALETTE4_RGB5_A1_OES 0x8B94
-#define GL_PALETTE8_RGB8_OES 0x8B95
-#define GL_PALETTE8_RGBA8_OES 0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
-#define GL_PALETTE8_RGBA4_OES 0x8B98
-#define GL_PALETTE8_RGB5_A1_OES 0x8B99
-#endif
-
-/* OES_point_size_array */
-#ifndef GL_OES_point_size_array
-#define GL_POINT_SIZE_ARRAY_OES 0x8B9C
-#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A
-#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B
-#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C
-#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F
-#endif
-
-/* GL_OES_point_sprite */
-#ifndef GL_OES_point_sprite
-#define GL_POINT_SPRITE_OES 0x8861
-#define GL_COORD_REPLACE_OES 0x8862
-#endif
-
-/*************************************************************/
-
-/* Available only in Common profile */
-GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
-GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
-GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);
-GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
-GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param);
-GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params);
-GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]);
-GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
-GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
-GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
-GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params);
-GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param);
-GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
-GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
-GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
-GL_API void GL_APIENTRY glLineWidth (GLfloat width);
-GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m);
-GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
-GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
-GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m);
-GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
-GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param);
-GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
-GL_API void GL_APIENTRY glPointSize (GLfloat size);
-GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
-GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
-GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
-GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
-
-/* Available in both Common and Common-Lite profiles */
-GL_API void GL_APIENTRY glActiveTexture (GLenum texture);
-GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
-GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
-GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-GL_API void GL_APIENTRY glClear (GLbitfield mask);
-GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
-GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);
-GL_API void GL_APIENTRY glClearStencil (GLint s);
-GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture);
-GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
-GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_API void GL_APIENTRY glCullFace (GLenum mode);
-GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
-GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-GL_API void GL_APIENTRY glDepthFunc (GLenum func);
-GL_API void GL_APIENTRY glDepthMask (GLboolean flag);
-GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
-GL_API void GL_APIENTRY glDisable (GLenum cap);
-GL_API void GL_APIENTRY glDisableClientState (GLenum array);
-GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-GL_API void GL_APIENTRY glEnable (GLenum cap);
-GL_API void GL_APIENTRY glEnableClientState (GLenum array);
-GL_API void GL_APIENTRY glFinish (void);
-GL_API void GL_APIENTRY glFlush (void);
-GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glFrontFace (GLenum mode);
-GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
-GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]);
-GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
-GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
-GL_API GLenum GL_APIENTRY glGetError (void);
-GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
-GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params);
-GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name);
-GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params);
-GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode);
-GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
-GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
-GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture);
-GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
-GL_API void GL_APIENTRY glLoadIdentity (void);
-GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
-GL_API void GL_APIENTRY glLogicOp (GLenum opcode);
-GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glMatrixMode (GLenum mode);
-GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
-GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
-GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
-GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glPointSizex (GLfixed size);
-GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
-GL_API void GL_APIENTRY glPopMatrix (void);
-GL_API void GL_APIENTRY glPushMatrix (void);
-GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
-GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
-GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
-GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GL_API void GL_APIENTRY glShadeModel (GLenum mode);
-GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GL_API void GL_APIENTRY glStencilMask (GLuint mask);
-GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
-GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
-GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
-GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
-GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-
-/*------------------------------------------------------------------------*
- * Required OES extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_OES_read_format */
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-#endif
-
-/* GL_OES_compressed_paletted_texture */
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_OES_compressed_paletted_texture 1
-#endif
-
-/* GL_OES_point_size_array */
-#ifndef GL_OES_point_size_array
-#define GL_OES_point_size_array 1
-GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-/* GL_OES_point_sprite */
-#ifndef GL_OES_point_sprite
-#define GL_OES_point_sprite 1
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gl_h_ */
-
diff --git a/opengl/include/GLES/glext.h b/opengl/include/GLES/glext.h
deleted file mode 100644
index 54afaab..0000000
--- a/opengl/include/GLES/glext.h
+++ /dev/null
@@ -1,1183 +0,0 @@
-#ifndef __glext_h_
-#define __glext_h_
-
-/* $Revision: 16481 $ on $Date:: 2012-01-04 10:43:56 -0800 #$ */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
-
-#ifndef GL_APIENTRYP
-# define GL_APIENTRYP GL_APIENTRY*
-#endif
-
-/*------------------------------------------------------------------------*
- * OES extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_OES_blend_equation_separate */
-#ifndef GL_OES_blend_equation_separate
-/* BLEND_EQUATION_RGB_OES same as BLEND_EQUATION_OES */
-#define GL_BLEND_EQUATION_RGB_OES 0x8009
-#define GL_BLEND_EQUATION_ALPHA_OES 0x883D
-#endif
-
-/* GL_OES_blend_func_separate */
-#ifndef GL_OES_blend_func_separate
-#define GL_BLEND_DST_RGB_OES 0x80C8
-#define GL_BLEND_SRC_RGB_OES 0x80C9
-#define GL_BLEND_DST_ALPHA_OES 0x80CA
-#define GL_BLEND_SRC_ALPHA_OES 0x80CB
-#endif
-
-/* GL_OES_blend_subtract */
-#ifndef GL_OES_blend_subtract
-#define GL_BLEND_EQUATION_OES 0x8009
-#define GL_FUNC_ADD_OES 0x8006
-#define GL_FUNC_SUBTRACT_OES 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_OES 0x800B
-#endif
-
-/* GL_OES_compressed_ETC1_RGB8_texture */
-#ifndef GL_OES_compressed_ETC1_RGB8_texture
-#define GL_ETC1_RGB8_OES 0x8D64
-#endif
-
-/* GL_OES_depth24 */
-#ifndef GL_OES_depth24
-#define GL_DEPTH_COMPONENT24_OES 0x81A6
-#endif
-
-/* GL_OES_depth32 */
-#ifndef GL_OES_depth32
-#define GL_DEPTH_COMPONENT32_OES 0x81A7
-#endif
-
-/* GL_OES_draw_texture */
-#ifndef GL_OES_draw_texture
-#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
-#endif
-
-/* GL_OES_EGL_image */
-#ifndef GL_OES_EGL_image
-typedef void* GLeglImageOES;
-#endif
-
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-/* GLeglImageOES defined in GL_OES_EGL_image already. */
-#define GL_TEXTURE_EXTERNAL_OES 0x8D65
-#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
-#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
-#endif
-
-/* GL_OES_element_index_uint */
-#ifndef GL_OES_element_index_uint
-#define GL_UNSIGNED_INT 0x1405
-#endif
-
-/* GL_OES_fixed_point */
-#ifndef GL_OES_fixed_point
-#define GL_FIXED_OES 0x140C
-#endif
-
-/* GL_OES_framebuffer_object */
-#ifndef GL_OES_framebuffer_object
-#define GL_NONE_OES 0
-#define GL_FRAMEBUFFER_OES 0x8D40
-#define GL_RENDERBUFFER_OES 0x8D41
-#define GL_RGBA4_OES 0x8056
-#define GL_RGB5_A1_OES 0x8057
-#define GL_RGB565_OES 0x8D62
-#define GL_DEPTH_COMPONENT16_OES 0x81A5
-#define GL_RENDERBUFFER_WIDTH_OES 0x8D42
-#define GL_RENDERBUFFER_HEIGHT_OES 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44
-#define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3
-#define GL_COLOR_ATTACHMENT0_OES 0x8CE0
-#define GL_DEPTH_ATTACHMENT_OES 0x8D00
-#define GL_STENCIL_ATTACHMENT_OES 0x8D20
-#define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA
-#define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD
-#define GL_FRAMEBUFFER_BINDING_OES 0x8CA6
-#define GL_RENDERBUFFER_BINDING_OES 0x8CA7
-#define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8
-#define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506
-#endif
-
-/* GL_OES_mapbuffer */
-#ifndef GL_OES_mapbuffer
-#define GL_WRITE_ONLY_OES 0x88B9
-#define GL_BUFFER_ACCESS_OES 0x88BB
-#define GL_BUFFER_MAPPED_OES 0x88BC
-#define GL_BUFFER_MAP_POINTER_OES 0x88BD
-#endif
-
-/* GL_OES_matrix_get */
-#ifndef GL_OES_matrix_get
-#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D
-#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E
-#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F
-#endif
-
-/* GL_OES_matrix_palette */
-#ifndef GL_OES_matrix_palette
-#define GL_MAX_VERTEX_UNITS_OES 0x86A4
-#define GL_MAX_PALETTE_MATRICES_OES 0x8842
-#define GL_MATRIX_PALETTE_OES 0x8840
-#define GL_MATRIX_INDEX_ARRAY_OES 0x8844
-#define GL_WEIGHT_ARRAY_OES 0x86AD
-#define GL_CURRENT_PALETTE_MATRIX_OES 0x8843
-#define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846
-#define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847
-#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848
-#define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849
-#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E
-#define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB
-#define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9
-#define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA
-#define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E
-#endif
-
-/* GL_OES_packed_depth_stencil */
-#ifndef GL_OES_packed_depth_stencil
-#define GL_DEPTH_STENCIL_OES 0x84F9
-#define GL_UNSIGNED_INT_24_8_OES 0x84FA
-#define GL_DEPTH24_STENCIL8_OES 0x88F0
-#endif
-
-/* GL_OES_rgb8_rgba8 */
-#ifndef GL_OES_rgb8_rgba8
-#define GL_RGB8_OES 0x8051
-#define GL_RGBA8_OES 0x8058
-#endif
-
-/* GL_OES_stencil1 */
-#ifndef GL_OES_stencil1
-#define GL_STENCIL_INDEX1_OES 0x8D46
-#endif
-
-/* GL_OES_stencil4 */
-#ifndef GL_OES_stencil4
-#define GL_STENCIL_INDEX4_OES 0x8D47
-#endif
-
-/* GL_OES_stencil8 */
-#ifndef GL_OES_stencil8
-#define GL_STENCIL_INDEX8_OES 0x8D48
-#endif
-
-/* GL_OES_stencil_wrap */
-#ifndef GL_OES_stencil_wrap
-#define GL_INCR_WRAP_OES 0x8507
-#define GL_DECR_WRAP_OES 0x8508
-#endif
-
-/* GL_OES_texture_cube_map */
-#ifndef GL_OES_texture_cube_map
-#define GL_NORMAL_MAP_OES 0x8511
-#define GL_REFLECTION_MAP_OES 0x8512
-#define GL_TEXTURE_CUBE_MAP_OES 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_OES 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x851A
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES 0x851C
-#define GL_TEXTURE_GEN_MODE_OES 0x2500
-#define GL_TEXTURE_GEN_STR_OES 0x8D60
-#endif
-
-/* GL_OES_texture_mirrored_repeat */
-#ifndef GL_OES_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_OES 0x8370
-#endif
-
-/* GL_OES_vertex_array_object */
-#ifndef GL_OES_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
-#endif
-
-/*------------------------------------------------------------------------*
- * AMD extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_AMD_compressed_3DC_texture */
-#ifndef GL_AMD_compressed_3DC_texture
-#define GL_3DC_X_AMD 0x87F9
-#define GL_3DC_XY_AMD 0x87FA
-#endif
-
-/* GL_AMD_compressed_ATC_texture */
-#ifndef GL_AMD_compressed_ATC_texture
-#define GL_ATC_RGB_AMD 0x8C92
-#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
-#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
-#endif
-
-/*------------------------------------------------------------------------*
- * APPLE extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_APPLE_texture_2D_limited_npot */
-/* No new tokens introduced by this extension. */
-
-/* GL_APPLE_framebuffer_multisample */
-#ifndef GL_APPLE_framebuffer_multisample
-#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
-#define GL_MAX_SAMPLES_APPLE 0x8D57
-#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
-#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
-#endif
-
-/* GL_APPLE_texture_format_BGRA8888 */
-#ifndef GL_APPLE_texture_format_BGRA8888
-#define GL_BGRA_EXT 0x80E1
-#endif
-
-/* GL_APPLE_texture_max_level */
-#ifndef GL_APPLE_texture_max_level
-#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
-#endif
-
-/*------------------------------------------------------------------------*
- * ARM extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_ARM_rgba8 */
-/* No new tokens introduced by this extension. */
-
-/*------------------------------------------------------------------------*
- * EXT extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_EXT_blend_minmax */
-#ifndef GL_EXT_blend_minmax
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#endif
-
-/* GL_EXT_discard_framebuffer */
-#ifndef GL_EXT_discard_framebuffer
-#define GL_COLOR_EXT 0x1800
-#define GL_DEPTH_EXT 0x1801
-#define GL_STENCIL_EXT 0x1802
-#endif
-
-/* GL_EXT_multisampled_render_to_texture */
-#ifndef GL_EXT_multisampled_render_to_texture
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
-#define GL_RENDERBUFFER_SAMPLES_EXT 0x9133
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x9134
-#define GL_MAX_SAMPLES_EXT 0x9135
-#endif
-
-/* GL_EXT_multi_draw_arrays */
-/* No new tokens introduced by this extension. */
-
-/* GL_EXT_read_format_bgra */
-#ifndef GL_EXT_read_format_bgra
-#define GL_BGRA_EXT 0x80E1
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
-#endif
-
-/* GL_EXT_robustness */
-#ifndef GL_EXT_robustness
-/* reuse GL_NO_ERROR */
-#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253
-#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255
-#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3
-#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
-#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
-#define GL_NO_RESET_NOTIFICATION_EXT 0x8261
-#endif
-
-/* GL_EXT_sRGB */
-#ifndef GL_EXT_sRGB
-#define GL_SRGB_EXT 0x8C40
-#define GL_SRGB_ALPHA_EXT 0x8C42
-#define GL_SRGB8_ALPHA8_EXT 0x8C43
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
-#endif
-
-/* GL_EXT_texture_compression_dxt1 */
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#endif
-
-/* GL_EXT_texture_filter_anisotropic */
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif
-
-/* GL_EXT_texture_format_BGRA8888 */
-#ifndef GL_EXT_texture_format_BGRA8888
-#define GL_BGRA_EXT 0x80E1
-#endif
-
-/* GL_EXT_texture_lod_bias */
-#ifndef GL_EXT_texture_lod_bias
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
-#endif
-
-/* GL_EXT_texture_storage */
-#ifndef GL_EXT_texture_storage
-#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
-#define GL_ALPHA8_EXT 0x803C
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_RGBA32F_EXT 0x8814
-#define GL_RGB32F_EXT 0x8815
-#define GL_ALPHA32F_EXT 0x8816
-#define GL_LUMINANCE32F_EXT 0x8818
-#define GL_LUMINANCE_ALPHA32F_EXT 0x8819
-/* reuse GL_RGBA16F_EXT */
-#define GL_RGB16F_EXT 0x881B
-#define GL_ALPHA16F_EXT 0x881C
-#define GL_LUMINANCE16F_EXT 0x881E
-#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
-#define GL_RGB10_A2_EXT 0x8059
-#define GL_RGB10_EXT 0x8052
-#define GL_BGRA8_EXT 0x93A1
-#endif
-
-/*------------------------------------------------------------------------*
- * IMG extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_IMG_read_format */
-#ifndef GL_IMG_read_format
-#define GL_BGRA_IMG 0x80E1
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
-#endif
-
-/* GL_IMG_texture_compression_pvrtc */
-#ifndef GL_IMG_texture_compression_pvrtc
-#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
-#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
-#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
-#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
-#endif
-
-/* GL_IMG_texture_env_enhanced_fixed_function */
-#ifndef GL_IMG_texture_env_enhanced_fixed_function
-#define GL_MODULATE_COLOR_IMG 0x8C04
-#define GL_RECIP_ADD_SIGNED_ALPHA_IMG 0x8C05
-#define GL_TEXTURE_ALPHA_MODULATE_IMG 0x8C06
-#define GL_FACTOR_ALPHA_MODULATE_IMG 0x8C07
-#define GL_FRAGMENT_ALPHA_MODULATE_IMG 0x8C08
-#define GL_ADD_BLEND_IMG 0x8C09
-#define GL_DOT3_RGBA_IMG 0x86AF
-#endif
-
-/* GL_IMG_user_clip_plane */
-#ifndef GL_IMG_user_clip_plane
-#define GL_CLIP_PLANE0_IMG 0x3000
-#define GL_CLIP_PLANE1_IMG 0x3001
-#define GL_CLIP_PLANE2_IMG 0x3002
-#define GL_CLIP_PLANE3_IMG 0x3003
-#define GL_CLIP_PLANE4_IMG 0x3004
-#define GL_CLIP_PLANE5_IMG 0x3005
-#define GL_MAX_CLIP_PLANES_IMG 0x0D32
-#endif
-
-/* GL_IMG_multisampled_render_to_texture */
-#ifndef GL_IMG_multisampled_render_to_texture
-#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
-#define GL_MAX_SAMPLES_IMG 0x9135
-#define GL_TEXTURE_SAMPLES_IMG 0x9136
-#endif
-
-/*------------------------------------------------------------------------*
- * NV extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_NV_fence */
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-#endif
-
-/*------------------------------------------------------------------------*
- * QCOM extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_QCOM_driver_control */
-/* No new tokens introduced by this extension. */
-
-/* GL_QCOM_extended_get */
-#ifndef GL_QCOM_extended_get
-#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
-#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
-#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
-#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
-#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
-#define GL_TEXTURE_TYPE_QCOM 0x8BD7
-#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
-#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
-#define GL_TEXTURE_TARGET_QCOM 0x8BDA
-#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
-#define GL_STATE_RESTORE 0x8BDC
-#endif
-
-/* GL_QCOM_extended_get2 */
-/* No new tokens introduced by this extension. */
-
-/* GL_QCOM_perfmon_global_mode */
-#ifndef GL_QCOM_perfmon_global_mode
-#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
-#endif
-
-/* GL_QCOM_writeonly_rendering */
-#ifndef GL_QCOM_writeonly_rendering
-#define GL_WRITEONLY_RENDERING_QCOM 0x8823
-#endif
-
-/* GL_QCOM_tiled_rendering */
-#ifndef GL_QCOM_tiled_rendering
-#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
-#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
-#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
-#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
-#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
-#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
-#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
-#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
-#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
-#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
-#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
-#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
-#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
-#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
-#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
-#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
-#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
-#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
-#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
-#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
-#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
-#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
-#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
-#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
-#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
-#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
-#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
-#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
-#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
-#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
-#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
-#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
-#endif
-
-/*------------------------------------------------------------------------*
- * End of extension tokens, start of corresponding extension functions
- *------------------------------------------------------------------------*/
-
-/*------------------------------------------------------------------------*
- * OES extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_OES_blend_equation_separate */
-#ifndef GL_OES_blend_equation_separate
-#define GL_OES_blend_equation_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha);
-#endif
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha);
-#endif
-
-/* GL_OES_blend_func_separate */
-#ifndef GL_OES_blend_func_separate
-#define GL_OES_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif
-
-/* GL_OES_blend_subtract */
-#ifndef GL_OES_blend_subtract
-#define GL_OES_blend_subtract 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode);
-#endif
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode);
-#endif
-
-/* GL_OES_byte_coordinates */
-#ifndef GL_OES_byte_coordinates
-#define GL_OES_byte_coordinates 1
-#endif
-
-/* GL_OES_compressed_ETC1_RGB8_texture */
-#ifndef GL_OES_compressed_ETC1_RGB8_texture
-#define GL_OES_compressed_ETC1_RGB8_texture 1
-#endif
-
-/* GL_OES_depth24 */
-#ifndef GL_OES_depth24
-#define GL_OES_depth24 1
-#endif
-
-/* GL_OES_depth32 */
-#ifndef GL_OES_depth32
-#define GL_OES_depth32 1
-#endif
-
-/* GL_OES_draw_texture */
-#ifndef GL_OES_draw_texture
-#define GL_OES_draw_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
-GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height);
-GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
-GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords);
-GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords);
-GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords);
-GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
-GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords);
-#endif
-typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
-typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height);
-typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
-typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords);
-typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords);
-typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords);
-typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
-typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords);
-#endif
-
-/* GL_OES_EGL_image */
-#ifndef GL_OES_EGL_image
-#define GL_OES_EGL_image 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
-GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
-#endif
-typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
-typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
-#endif
-
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_OES_EGL_image_external 1
-/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
-#endif
-
-/* GL_OES_element_index_uint */
-#ifndef GL_OES_element_index_uint
-#define GL_OES_element_index_uint 1
-#endif
-
-/* GL_OES_extended_matrix_palette */
-#ifndef GL_OES_extended_matrix_palette
-#define GL_OES_extended_matrix_palette 1
-#endif
-
-/* GL_OES_fbo_render_mipmap */
-#ifndef GL_OES_fbo_render_mipmap
-#define GL_OES_fbo_render_mipmap 1
-#endif
-
-/* GL_OES_fixed_point */
-#ifndef GL_OES_fixed_point
-#define GL_OES_fixed_point 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLclampx ref);
-GL_API void GL_APIENTRY glClearColorxOES (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
-GL_API void GL_APIENTRY glClearDepthxOES (GLclampx depth);
-GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation);
-GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-GL_API void GL_APIENTRY glDepthRangexOES (GLclampx zNear, GLclampx zFar);
-GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glFrustumxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed eqn[4]);
-GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum env, GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
-GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width);
-GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m);
-GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m);
-GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz);
-GL_API void GL_APIENTRY glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glPointSizexOES (GLfixed size);
-GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units);
-GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert);
-GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z);
-GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z);
-#endif
-typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLclampx ref);
-typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
-typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLclampx depth);
-typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation);
-typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLclampx zNear, GLclampx zFar);
-typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param);
-typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed eqn[4]);
-typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum env, GLenum pname, GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param);
-typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param);
-typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width);
-typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m);
-typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
-typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m);
-typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz);
-typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param);
-typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size);
-typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units);
-typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert);
-typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
-typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param);
-typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
-#endif
-
-/* GL_OES_framebuffer_object */
-#ifndef GL_OES_framebuffer_object
-#define GL_OES_framebuffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer);
-GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer);
-GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint* renderbuffers);
-GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint* renderbuffers);
-GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint* params);
-GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer);
-GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer);
-GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint* framebuffers);
-GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint* framebuffers);
-GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target);
-GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target);
-#endif
-typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers);
-typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers);
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer);
-typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer);
-typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers);
-typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers);
-typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target);
-#endif
-
-/* GL_OES_mapbuffer */
-#ifndef GL_OES_mapbuffer
-#define GL_OES_mapbuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
-GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
-GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid ** params);
-#endif
-typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
-typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid ** params);
-#endif
-
-/* GL_OES_matrix_get */
-#ifndef GL_OES_matrix_get
-#define GL_OES_matrix_get 1
-#endif
-
-/* GL_OES_matrix_palette */
-#ifndef GL_OES_matrix_palette
-#define GL_OES_matrix_palette 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex);
-GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void);
-GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex);
-typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void);
-typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-/* GL_OES_packed_depth_stencil */
-#ifndef GL_OES_packed_depth_stencil
-#define GL_OES_packed_depth_stencil 1
-#endif
-
-/* GL_OES_query_matrix */
-#ifndef GL_OES_query_matrix
-#define GL_OES_query_matrix 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed mantissa[16], GLint exponent[16]);
-#endif
-typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed mantissa[16], GLint exponent[16]);
-#endif
-
-/* GL_OES_rgb8_rgba8 */
-#ifndef GL_OES_rgb8_rgba8
-#define GL_OES_rgb8_rgba8 1
-#endif
-
-/* GL_OES_single_precision */
-#ifndef GL_OES_single_precision
-#define GL_OES_single_precision 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar);
-GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation);
-GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]);
-GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth);
-#endif
-typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf zNear, GLclampf zFar);
-typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation);
-typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat eqn[4]);
-typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth);
-#endif
-
-/* GL_OES_stencil1 */
-#ifndef GL_OES_stencil1
-#define GL_OES_stencil1 1
-#endif
-
-/* GL_OES_stencil4 */
-#ifndef GL_OES_stencil4
-#define GL_OES_stencil4 1
-#endif
-
-/* GL_OES_stencil8 */
-#ifndef GL_OES_stencil8
-#define GL_OES_stencil8 1
-#endif
-
-/* GL_OES_stencil_wrap */
-#ifndef GL_OES_stencil_wrap
-#define GL_OES_stencil_wrap 1
-#endif
-
-/* GL_OES_texture_cube_map */
-#ifndef GL_OES_texture_cube_map
-#define GL_OES_texture_cube_map 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param);
-GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params);
-GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param);
-GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params);
-GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param);
-GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params);
-GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params);
-GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params);
-GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params);
-#endif
-typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param);
-typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params);
-typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param);
-typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params);
-#endif
-
-/* GL_OES_texture_env_crossbar */
-#ifndef GL_OES_texture_env_crossbar
-#define GL_OES_texture_env_crossbar 1
-#endif
-
-/* GL_OES_texture_mirrored_repeat */
-#ifndef GL_OES_texture_mirrored_repeat
-#define GL_OES_texture_mirrored_repeat 1
-#endif
-
-/* GL_OES_vertex_array_object */
-#ifndef GL_OES_vertex_array_object
-#define GL_OES_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glBindVertexArrayOES (GLuint array);
-GL_API void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
-GL_API void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
-GL_API GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
-#endif
-typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
-typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
-typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
-#endif
-
-/*------------------------------------------------------------------------*
- * AMD extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_AMD_compressed_3DC_texture */
-#ifndef GL_AMD_compressed_3DC_texture
-#define GL_AMD_compressed_3DC_texture 1
-#endif
-
-/* GL_AMD_compressed_ATC_texture */
-#ifndef GL_AMD_compressed_ATC_texture
-#define GL_AMD_compressed_ATC_texture 1
-#endif
-
-/*------------------------------------------------------------------------*
- * APPLE extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_APPLE_texture_2D_limited_npot */
-#ifndef GL_APPLE_texture_2D_limited_npot
-#define GL_APPLE_texture_2D_limited_npot 1
-#endif
-
-/* GL_APPLE_framebuffer_multisample */
-#ifndef GL_APPLE_framebuffer_multisample
-#define GL_APPLE_framebuffer_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_API void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
-#endif
-
-/* GL_APPLE_texture_format_BGRA8888 */
-#ifndef GL_APPLE_texture_format_BGRA8888
-#define GL_APPLE_texture_format_BGRA8888 1
-#endif
-
-/* GL_APPLE_texture_max_level */
-#ifndef GL_APPLE_texture_max_level
-#define GL_APPLE_texture_max_level 1
-#endif
-
-/*------------------------------------------------------------------------*
- * ARM extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_ARM_rgba8 */
-#ifndef GL_ARM_rgba8
-#define GL_ARM_rgba8 1
-#endif
-
-/*------------------------------------------------------------------------*
- * EXT extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_EXT_blend_minmax */
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#endif
-
-/* GL_EXT_discard_framebuffer */
-#ifndef GL_EXT_discard_framebuffer
-#define GL_EXT_discard_framebuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-#endif
-typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-#endif
-
-/* GL_EXT_multisampled_render_to_texture */
-#ifndef GL_EXT_multisampled_render_to_texture
-#define GL_EXT_multisampled_render_to_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-
-/* GL_EXT_multi_draw_arrays */
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-GL_API void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif
-
-/* GL_EXT_read_format_bgra */
-#ifndef GL_EXT_read_format_bgra
-#define GL_EXT_read_format_bgra 1
-#endif
-
-/* GL_EXT_robustness */
-#ifndef GL_EXT_robustness
-#define GL_EXT_robustness 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
-GL_API void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-GL_API void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params);
-GL_API void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-#endif
-typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
-typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-#endif
-
-/* GL_EXT_sRGB */
-#ifndef GL_EXT_sRGB
-#define GL_EXT_sRGB 1
-#endif
-
-/* GL_EXT_texture_compression_dxt1 */
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_EXT_texture_compression_dxt1 1
-#endif
-
-/* GL_EXT_texture_filter_anisotropic */
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#endif
-
-/* GL_EXT_texture_format_BGRA8888 */
-#ifndef GL_EXT_texture_format_BGRA8888
-#define GL_EXT_texture_format_BGRA8888 1
-#endif
-
-/* GL_EXT_texture_lod_bias */
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-#endif
-
-/* GL_EXT_texture_storage */
-#ifndef GL_EXT_texture_storage
-#define GL_EXT_texture_storage 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-GL_API void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_API void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-GL_API void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-GL_API void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_API void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-
-/*------------------------------------------------------------------------*
- * IMG extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_IMG_read_format */
-#ifndef GL_IMG_read_format
-#define GL_IMG_read_format 1
-#endif
-
-/* GL_IMG_texture_compression_pvrtc */
-#ifndef GL_IMG_texture_compression_pvrtc
-#define GL_IMG_texture_compression_pvrtc 1
-#endif
-
-/* GL_IMG_texture_env_enhanced_fixed_function */
-#ifndef GL_IMG_texture_env_enhanced_fixed_function
-#define GL_IMG_texture_env_enhanced_fixed_function 1
-#endif
-
-/* GL_IMG_user_clip_plane */
-#ifndef GL_IMG_user_clip_plane
-#define GL_IMG_user_clip_plane 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glClipPlanefIMG (GLenum p, const GLfloat *eqn);
-GL_API void GL_APIENTRY glClipPlanexIMG (GLenum p, const GLfixed *eqn);
-#endif
-typedef void (GL_APIENTRYP PFNGLCLIPPLANEFIMGPROC) (GLenum p, const GLfloat *eqn);
-typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn);
-#endif
-
-/* GL_IMG_multisampled_render_to_texture */
-#ifndef GL_IMG_multisampled_render_to_texture
-#define GL_IMG_multisampled_render_to_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-
-/*------------------------------------------------------------------------*
- * NV extension functions
- *------------------------------------------------------------------------*/
-
-/* NV_fence */
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
-GL_API void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
-GL_API GLboolean GL_APIENTRY glIsFenceNV (GLuint fence);
-GL_API GLboolean GL_APIENTRY glTestFenceNV (GLuint fence);
-GL_API void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
-GL_API void GL_APIENTRY glFinishFenceNV (GLuint fence);
-GL_API void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
-#endif
-typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-#endif
-
-/*------------------------------------------------------------------------*
- * QCOM extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_QCOM_driver_control */
-#ifndef GL_QCOM_driver_control
-#define GL_QCOM_driver_control 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
-GL_API void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
-GL_API void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
-GL_API void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
-#endif
-typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
-typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
-typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
-typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
-#endif
-
-/* GL_QCOM_extended_get */
-#ifndef GL_QCOM_extended_get
-#define GL_QCOM_extended_get 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
-GL_API void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
-GL_API void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
-GL_API void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
-GL_API void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
-GL_API void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
-GL_API void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
-GL_API void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
-#endif
-typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
-typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
-typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
-typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
-typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
-typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
-#endif
-
-/* GL_QCOM_extended_get2 */
-#ifndef GL_QCOM_extended_get2
-#define GL_QCOM_extended_get2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
-GL_API void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
-GL_API GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
-GL_API void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
-#endif
-typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
-typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
-typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
-#endif
-
-/* GL_QCOM_perfmon_global_mode */
-#ifndef GL_QCOM_perfmon_global_mode
-#define GL_QCOM_perfmon_global_mode 1
-#endif
-
-/* GL_QCOM_writeonly_rendering */
-#ifndef GL_QCOM_writeonly_rendering
-#define GL_QCOM_writeonly_rendering 1
-#endif
-
-/* GL_QCOM_tiled_rendering */
-#ifndef GL_QCOM_tiled_rendering
-#define GL_QCOM_tiled_rendering 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_API void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
-GL_API void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
-#endif
-typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
-typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __glext_h_ */
-
diff --git a/opengl/include/GLES/glplatform.h b/opengl/include/GLES/glplatform.h
deleted file mode 100644
index 2db6ee2..0000000
--- a/opengl/include/GLES/glplatform.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __glplatform_h_
-#define __glplatform_h_
-
-/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
-
-/*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
-
-/* Platform-specific types and definitions for OpenGL ES 1.X gl.h
- *
- * Adopters may modify khrplatform.h and this file to suit their platform.
- * You are encouraged to submit all modifications to the Khronos group so that
- * they can be included in future versions of this file. Please submit changes
- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
- * by filing a bug against product "OpenGL-ES" component "Registry".
- */
-
-#include <KHR/khrplatform.h>
-
-#ifndef GL_API
-#define GL_API KHRONOS_APICALL
-#endif
-
-#ifndef GL_APIENTRY
-#define GL_APIENTRY KHRONOS_APIENTRY
-#endif
-
-#endif /* __glplatform_h_ */
diff --git a/opengl/include/GLES2/gl2.h b/opengl/include/GLES2/gl2.h
deleted file mode 100644
index e1d3b87..0000000
--- a/opengl/include/GLES2/gl2.h
+++ /dev/null
@@ -1,621 +0,0 @@
-#ifndef __gl2_h_
-#define __gl2_h_
-
-/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
-
-#include <GLES2/gl2platform.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
-
-/*-------------------------------------------------------------------------
- * Data type definitions
- *-----------------------------------------------------------------------*/
-
-typedef void GLvoid;
-typedef char GLchar;
-typedef unsigned int GLenum;
-typedef unsigned char GLboolean;
-typedef unsigned int GLbitfield;
-typedef khronos_int8_t GLbyte;
-typedef short GLshort;
-typedef int GLint;
-typedef int GLsizei;
-typedef khronos_uint8_t GLubyte;
-typedef unsigned short GLushort;
-typedef unsigned int GLuint;
-typedef khronos_float_t GLfloat;
-typedef khronos_float_t GLclampf;
-typedef khronos_int32_t GLfixed;
-
-/* GL types for handling large vertex buffer objects */
-typedef khronos_intptr_t GLintptr;
-typedef khronos_ssize_t GLsizeiptr;
-
-/* OpenGL ES core versions */
-#define GL_ES_VERSION_2_0 1
-
-/* ClearBufferMask */
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_COLOR_BUFFER_BIT 0x00004000
-
-/* Boolean */
-#define GL_FALSE 0
-#define GL_TRUE 1
-
-/* BeginMode */
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-
-/* AlphaFunction (not supported in ES20) */
-/* GL_NEVER */
-/* GL_LESS */
-/* GL_EQUAL */
-/* GL_LEQUAL */
-/* GL_GREATER */
-/* GL_NOTEQUAL */
-/* GL_GEQUAL */
-/* GL_ALWAYS */
-
-/* BlendingFactorDest */
-#define GL_ZERO 0
-#define GL_ONE 1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-
-/* BlendingFactorSrc */
-/* GL_ZERO */
-/* GL_ONE */
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-/* GL_SRC_ALPHA */
-/* GL_ONE_MINUS_SRC_ALPHA */
-/* GL_DST_ALPHA */
-/* GL_ONE_MINUS_DST_ALPHA */
-
-/* BlendEquationSeparate */
-#define GL_FUNC_ADD 0x8006
-#define GL_BLEND_EQUATION 0x8009
-#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-
-/* BlendSubtract */
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-
-/* Separate Blend Functions */
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-
-/* Buffer Objects */
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STATIC_DRAW 0x88E4
-#define GL_DYNAMIC_DRAW 0x88E8
-
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-
-/* CullFaceMode */
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_FRONT_AND_BACK 0x0408
-
-/* DepthFunction */
-/* GL_NEVER */
-/* GL_LESS */
-/* GL_EQUAL */
-/* GL_LEQUAL */
-/* GL_GREATER */
-/* GL_NOTEQUAL */
-/* GL_GEQUAL */
-/* GL_ALWAYS */
-
-/* EnableCap */
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_CULL_FACE 0x0B44
-#define GL_BLEND 0x0BE2
-#define GL_DITHER 0x0BD0
-#define GL_STENCIL_TEST 0x0B90
-#define GL_DEPTH_TEST 0x0B71
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_COVERAGE 0x80A0
-
-/* ErrorCode */
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_OUT_OF_MEMORY 0x0505
-
-/* FrontFaceDirection */
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-
-/* GetPName */
-#define GL_LINE_WIDTH 0x0B21
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#define GL_VIEWPORT 0x0BA2
-#define GL_SCISSOR_BOX 0x0C10
-/* GL_SCISSOR_TEST */
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-/* GL_POLYGON_OFFSET_FILL */
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-
-/* GetTextureParameter */
-/* GL_TEXTURE_MAG_FILTER */
-/* GL_TEXTURE_MIN_FILTER */
-/* GL_TEXTURE_WRAP_S */
-/* GL_TEXTURE_WRAP_T */
-
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-
-/* HintMode */
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-
-/* HintTarget */
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-
-/* DataType */
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_FIXED 0x140C
-
-/* PixelFormat */
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-
-/* PixelType */
-/* GL_UNSIGNED_BYTE */
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-
-/* Shaders */
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_DELETE_STATUS 0x8B80
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-
-/* StencilFunction */
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-
-/* StencilOp */
-/* GL_ZERO */
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-#define GL_INVERT 0x150A
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-
-/* StringName */
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-
-/* TextureMagFilter */
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-
-/* TextureMinFilter */
-/* GL_NEAREST */
-/* GL_LINEAR */
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-
-/* TextureParameterName */
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-
-/* TextureTarget */
-/* GL_TEXTURE_2D */
-#define GL_TEXTURE 0x1702
-
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-
-/* TextureUnit */
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-
-/* TextureWrapMode */
-#define GL_REPEAT 0x2901
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_MIRRORED_REPEAT 0x8370
-
-/* Uniform Types */
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_CUBE 0x8B60
-
-/* Vertex Arrays */
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-
-/* Read Format */
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-
-/* Shader Source */
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_SHADER_COMPILER 0x8DFA
-
-/* Shader Binary */
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-
-/* Shader Precision-Specified Types */
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-
-/* Framebuffer Object. */
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGB565 0x8D62
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_STENCIL_INDEX 0x1901
-#define GL_STENCIL_INDEX8 0x8D48
-
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-
-#define GL_NONE 0
-
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-
-/*-------------------------------------------------------------------------
- * GL core functions.
- *-----------------------------------------------------------------------*/
-
-GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
-GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
-GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
-GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
-GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
-GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
-GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
-GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
-GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
-GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
-GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
-GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
-GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
-GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
-GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
-GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
-GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
-GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
-GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
-GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
-GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
-GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
-GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
-GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glFinish (void);
-GL_APICALL void GL_APIENTRY glFlush (void);
-GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
-GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
-GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
-GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
-GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
-GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
-GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
-GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
-GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
-GL_APICALL GLenum GL_APIENTRY glGetError (void);
-GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
-GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
-GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
-GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
-GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
-GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
-GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
-GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
-GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
-GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
-GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
-GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
-GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
-GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
-GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
-GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
-GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
-GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
-GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
-GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
-GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
-GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
-GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
-GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
-GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
-GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
-GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
-GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
-GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
-GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
-GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
-GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
-GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
-GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
-GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
-GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
-GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
-GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
-GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gl2_h_ */
diff --git a/opengl/include/GLES2/gl2ext.h b/opengl/include/GLES2/gl2ext.h
deleted file mode 100644
index 8f8d80a1..0000000
--- a/opengl/include/GLES2/gl2ext.h
+++ /dev/null
@@ -1,1422 +0,0 @@
-#ifndef __gl2ext_h_
-#define __gl2ext_h_
-
-/* $Revision: 16619 $ on $Date:: 2012-01-18 10:00:14 -0800 #$ */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
-
-#ifndef GL_APIENTRYP
-# define GL_APIENTRYP GL_APIENTRY*
-#endif
-
-/*------------------------------------------------------------------------*
- * OES extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_OES_compressed_ETC1_RGB8_texture */
-#ifndef GL_OES_compressed_ETC1_RGB8_texture
-#define GL_ETC1_RGB8_OES 0x8D64
-#endif
-
-/* GL_OES_compressed_paletted_texture */
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_PALETTE4_RGB8_OES 0x8B90
-#define GL_PALETTE4_RGBA8_OES 0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
-#define GL_PALETTE4_RGBA4_OES 0x8B93
-#define GL_PALETTE4_RGB5_A1_OES 0x8B94
-#define GL_PALETTE8_RGB8_OES 0x8B95
-#define GL_PALETTE8_RGBA8_OES 0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
-#define GL_PALETTE8_RGBA4_OES 0x8B98
-#define GL_PALETTE8_RGB5_A1_OES 0x8B99
-#endif
-
-/* GL_OES_depth24 */
-#ifndef GL_OES_depth24
-#define GL_DEPTH_COMPONENT24_OES 0x81A6
-#endif
-
-/* GL_OES_depth32 */
-#ifndef GL_OES_depth32
-#define GL_DEPTH_COMPONENT32_OES 0x81A7
-#endif
-
-/* GL_OES_depth_texture */
-/* No new tokens introduced by this extension. */
-
-/* GL_OES_EGL_image */
-#ifndef GL_OES_EGL_image
-typedef void* GLeglImageOES;
-#endif
-
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-/* GLeglImageOES defined in GL_OES_EGL_image already. */
-#define GL_TEXTURE_EXTERNAL_OES 0x8D65
-#define GL_SAMPLER_EXTERNAL_OES 0x8D66
-#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
-#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
-#endif
-
-/* GL_OES_element_index_uint */
-#ifndef GL_OES_element_index_uint
-#define GL_UNSIGNED_INT 0x1405
-#endif
-
-/* GL_OES_get_program_binary */
-#ifndef GL_OES_get_program_binary
-#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
-#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
-#endif
-
-/* GL_OES_mapbuffer */
-#ifndef GL_OES_mapbuffer
-#define GL_WRITE_ONLY_OES 0x88B9
-#define GL_BUFFER_ACCESS_OES 0x88BB
-#define GL_BUFFER_MAPPED_OES 0x88BC
-#define GL_BUFFER_MAP_POINTER_OES 0x88BD
-#endif
-
-/* GL_OES_packed_depth_stencil */
-#ifndef GL_OES_packed_depth_stencil
-#define GL_DEPTH_STENCIL_OES 0x84F9
-#define GL_UNSIGNED_INT_24_8_OES 0x84FA
-#define GL_DEPTH24_STENCIL8_OES 0x88F0
-#endif
-
-/* GL_OES_rgb8_rgba8 */
-#ifndef GL_OES_rgb8_rgba8
-#define GL_RGB8_OES 0x8051
-#define GL_RGBA8_OES 0x8058
-#endif
-
-/* GL_OES_standard_derivatives */
-#ifndef GL_OES_standard_derivatives
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
-#endif
-
-/* GL_OES_stencil1 */
-#ifndef GL_OES_stencil1
-#define GL_STENCIL_INDEX1_OES 0x8D46
-#endif
-
-/* GL_OES_stencil4 */
-#ifndef GL_OES_stencil4
-#define GL_STENCIL_INDEX4_OES 0x8D47
-#endif
-
-/* GL_OES_texture_3D */
-#ifndef GL_OES_texture_3D
-#define GL_TEXTURE_WRAP_R_OES 0x8072
-#define GL_TEXTURE_3D_OES 0x806F
-#define GL_TEXTURE_BINDING_3D_OES 0x806A
-#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073
-#define GL_SAMPLER_3D_OES 0x8B5F
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
-#endif
-
-/* GL_OES_texture_float */
-/* No new tokens introduced by this extension. */
-
-/* GL_OES_texture_float_linear */
-/* No new tokens introduced by this extension. */
-
-/* GL_OES_texture_half_float */
-#ifndef GL_OES_texture_half_float
-#define GL_HALF_FLOAT_OES 0x8D61
-#endif
-
-/* GL_OES_texture_half_float_linear */
-/* No new tokens introduced by this extension. */
-
-/* GL_OES_texture_npot */
-/* No new tokens introduced by this extension. */
-
-/* GL_OES_vertex_array_object */
-#ifndef GL_OES_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
-#endif
-
-/* GL_OES_vertex_half_float */
-/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
-
-/* GL_OES_vertex_type_10_10_10_2 */
-#ifndef GL_OES_vertex_type_10_10_10_2
-#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6
-#define GL_INT_10_10_10_2_OES 0x8DF7
-#endif
-
-/*------------------------------------------------------------------------*
- * AMD extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_AMD_compressed_3DC_texture */
-#ifndef GL_AMD_compressed_3DC_texture
-#define GL_3DC_X_AMD 0x87F9
-#define GL_3DC_XY_AMD 0x87FA
-#endif
-
-/* GL_AMD_compressed_ATC_texture */
-#ifndef GL_AMD_compressed_ATC_texture
-#define GL_ATC_RGB_AMD 0x8C92
-#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
-#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
-#endif
-
-/* GL_AMD_performance_monitor */
-#ifndef GL_AMD_performance_monitor
-#define GL_COUNTER_TYPE_AMD 0x8BC0
-#define GL_COUNTER_RANGE_AMD 0x8BC1
-#define GL_UNSIGNED_INT64_AMD 0x8BC2
-#define GL_PERCENTAGE_AMD 0x8BC3
-#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
-#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
-#define GL_PERFMON_RESULT_AMD 0x8BC6
-#endif
-
-/* GL_AMD_program_binary_Z400 */
-#ifndef GL_AMD_program_binary_Z400
-#define GL_Z400_BINARY_AMD 0x8740
-#endif
-
-/*------------------------------------------------------------------------*
- * ANGLE extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_ANGLE_framebuffer_blit */
-#ifndef GL_ANGLE_framebuffer_blit
-#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
-#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
-#endif
-
-/* GL_ANGLE_framebuffer_multisample */
-#ifndef GL_ANGLE_framebuffer_multisample
-#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
-#define GL_MAX_SAMPLES_ANGLE 0x8D57
-#endif
-
-/*------------------------------------------------------------------------*
- * APPLE extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_APPLE_rgb_422 */
-#ifndef GL_APPLE_rgb_422
-#define GL_RGB_422_APPLE 0x8A1F
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
-#endif
-
-/* GL_APPLE_framebuffer_multisample */
-#ifndef GL_APPLE_framebuffer_multisample
-#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
-#define GL_MAX_SAMPLES_APPLE 0x8D57
-#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
-#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
-#endif
-
-/* GL_APPLE_texture_format_BGRA8888 */
-#ifndef GL_APPLE_texture_format_BGRA8888
-#define GL_BGRA_EXT 0x80E1
-#endif
-
-/* GL_APPLE_texture_max_level */
-#ifndef GL_APPLE_texture_max_level
-#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
-#endif
-
-/*------------------------------------------------------------------------*
- * ARM extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_ARM_mali_shader_binary */
-#ifndef GL_ARM_mali_shader_binary
-#define GL_MALI_SHADER_BINARY_ARM 0x8F60
-#endif
-
-/* GL_ARM_rgba8 */
-/* No new tokens introduced by this extension. */
-
-/*------------------------------------------------------------------------*
- * EXT extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_EXT_blend_minmax */
-#ifndef GL_EXT_blend_minmax
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#endif
-
-/* GL_EXT_color_buffer_half_float */
-#ifndef GL_EXT_color_buffer_half_float
-#define GL_RGBA16F_EXT 0x881A
-#define GL_RGB16F_EXT 0x881B
-#define GL_RG16F_EXT 0x822F
-#define GL_R16F_EXT 0x822D
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211
-#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17
-#endif
-
-/* GL_EXT_debug_label */
-#ifndef GL_EXT_debug_label
-#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
-#define GL_PROGRAM_OBJECT_EXT 0x8B40
-#define GL_SHADER_OBJECT_EXT 0x8B48
-#define GL_BUFFER_OBJECT_EXT 0x9151
-#define GL_QUERY_OBJECT_EXT 0x9153
-#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154
-#endif
-
-/* GL_EXT_debug_marker */
-/* No new tokens introduced by this extension. */
-
-/* GL_EXT_discard_framebuffer */
-#ifndef GL_EXT_discard_framebuffer
-#define GL_COLOR_EXT 0x1800
-#define GL_DEPTH_EXT 0x1801
-#define GL_STENCIL_EXT 0x1802
-#endif
-
-/* GL_EXT_multisampled_render_to_texture */
-#ifndef GL_EXT_multisampled_render_to_texture
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
-#define GL_RENDERBUFFER_SAMPLES_EXT 0x9133
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x9134
-#define GL_MAX_SAMPLES_EXT 0x9135
-#endif
-
-/* GL_EXT_multi_draw_arrays */
-/* No new tokens introduced by this extension. */
-
-/* GL_EXT_occlusion_query_boolean */
-#ifndef GL_EXT_occlusion_query_boolean
-#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F
-#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A
-#define GL_CURRENT_QUERY_EXT 0x8865
-#define GL_QUERY_RESULT_EXT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867
-#endif
-
-/* GL_EXT_read_format_bgra */
-#ifndef GL_EXT_read_format_bgra
-#define GL_BGRA_EXT 0x80E1
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
-#endif
-
-/* GL_EXT_robustness */
-#ifndef GL_EXT_robustness
-/* reuse GL_NO_ERROR */
-#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253
-#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255
-#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3
-#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
-#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
-#define GL_NO_RESET_NOTIFICATION_EXT 0x8261
-#endif
-
-/* GL_EXT_separate_shader_objects */
-#ifndef GL_EXT_separate_shader_objects
-#define GL_VERTEX_SHADER_BIT_EXT 0x00000001
-#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002
-#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF
-#define GL_PROGRAM_SEPARABLE_EXT 0x8258
-#define GL_ACTIVE_PROGRAM_EXT 0x8259
-#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A
-#endif
-
-/* GL_EXT_shader_texture_lod */
-/* No new tokens introduced by this extension. */
-
-/* GL_EXT_shadow_samplers */
-#ifndef GL_EXT_shadow_samplers
-#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C
-#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D
-#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E
-#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62
-#endif
-
-/* GL_EXT_sRGB */
-#ifndef GL_EXT_sRGB
-#define GL_SRGB_EXT 0x8C40
-#define GL_SRGB_ALPHA_EXT 0x8C42
-#define GL_SRGB8_ALPHA8_EXT 0x8C43
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
-#endif
-
-/* GL_EXT_texture_compression_dxt1 */
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#endif
-
-/* GL_EXT_texture_filter_anisotropic */
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif
-
-/* GL_EXT_texture_format_BGRA8888 */
-#ifndef GL_EXT_texture_format_BGRA8888
-#define GL_BGRA_EXT 0x80E1
-#endif
-
-/* GL_EXT_texture_rg */
-#ifndef GL_EXT_texture_rg
-#define GL_RED_EXT 0x1903
-#define GL_RG_EXT 0x8227
-#define GL_R8_EXT 0x8229
-#define GL_RG8_EXT 0x822B
-#endif
-
-/* GL_EXT_texture_storage */
-#ifndef GL_EXT_texture_storage
-#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
-#define GL_ALPHA8_EXT 0x803C
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_RGBA32F_EXT 0x8814
-#define GL_RGB32F_EXT 0x8815
-#define GL_ALPHA32F_EXT 0x8816
-#define GL_LUMINANCE32F_EXT 0x8818
-#define GL_LUMINANCE_ALPHA32F_EXT 0x8819
-/* reuse GL_RGBA16F_EXT */
-#define GL_RGB16F_EXT 0x881B
-#define GL_ALPHA16F_EXT 0x881C
-#define GL_LUMINANCE16F_EXT 0x881E
-#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
-#define GL_RGB10_A2_EXT 0x8059
-#define GL_RGB10_EXT 0x8052
-#define GL_BGRA8_EXT 0x93A1
-#endif
-
-/* GL_EXT_texture_type_2_10_10_10_REV */
-#ifndef GL_EXT_texture_type_2_10_10_10_REV
-#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
-#endif
-
-/* GL_EXT_unpack_subimage */
-#ifndef GL_EXT_unpack_subimage
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#endif
-
-/*------------------------------------------------------------------------*
- * DMP extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_DMP_shader_binary */
-#ifndef GL_DMP_shader_binary
-#define GL_SHADER_BINARY_DMP 0x9250
-#endif
-
-/*------------------------------------------------------------------------*
- * IMG extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_IMG_program_binary */
-#ifndef GL_IMG_program_binary
-#define GL_SGX_PROGRAM_BINARY_IMG 0x9130
-#endif
-
-/* GL_IMG_read_format */
-#ifndef GL_IMG_read_format
-#define GL_BGRA_IMG 0x80E1
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
-#endif
-
-/* GL_IMG_shader_binary */
-#ifndef GL_IMG_shader_binary
-#define GL_SGX_BINARY_IMG 0x8C0A
-#endif
-
-/* GL_IMG_texture_compression_pvrtc */
-#ifndef GL_IMG_texture_compression_pvrtc
-#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
-#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
-#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
-#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
-#endif
-
-/* GL_IMG_multisampled_render_to_texture */
-#ifndef GL_IMG_multisampled_render_to_texture
-#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
-#define GL_MAX_SAMPLES_IMG 0x9135
-#define GL_TEXTURE_SAMPLES_IMG 0x9136
-#endif
-
-/*------------------------------------------------------------------------*
- * NV extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_NV_coverage_sample */
-#ifndef GL_NV_coverage_sample
-#define GL_COVERAGE_COMPONENT_NV 0x8ED0
-#define GL_COVERAGE_COMPONENT4_NV 0x8ED1
-#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2
-#define GL_COVERAGE_BUFFERS_NV 0x8ED3
-#define GL_COVERAGE_SAMPLES_NV 0x8ED4
-#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5
-#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6
-#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7
-#define GL_COVERAGE_BUFFER_BIT_NV 0x8000
-#endif
-
-/* GL_NV_depth_nonlinear */
-#ifndef GL_NV_depth_nonlinear
-#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
-#endif
-
-/* GL_NV_draw_buffers */
-#ifndef GL_NV_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_NV 0x8824
-#define GL_DRAW_BUFFER0_NV 0x8825
-#define GL_DRAW_BUFFER1_NV 0x8826
-#define GL_DRAW_BUFFER2_NV 0x8827
-#define GL_DRAW_BUFFER3_NV 0x8828
-#define GL_DRAW_BUFFER4_NV 0x8829
-#define GL_DRAW_BUFFER5_NV 0x882A
-#define GL_DRAW_BUFFER6_NV 0x882B
-#define GL_DRAW_BUFFER7_NV 0x882C
-#define GL_DRAW_BUFFER8_NV 0x882D
-#define GL_DRAW_BUFFER9_NV 0x882E
-#define GL_DRAW_BUFFER10_NV 0x882F
-#define GL_DRAW_BUFFER11_NV 0x8830
-#define GL_DRAW_BUFFER12_NV 0x8831
-#define GL_DRAW_BUFFER13_NV 0x8832
-#define GL_DRAW_BUFFER14_NV 0x8833
-#define GL_DRAW_BUFFER15_NV 0x8834
-#define GL_COLOR_ATTACHMENT0_NV 0x8CE0
-#define GL_COLOR_ATTACHMENT1_NV 0x8CE1
-#define GL_COLOR_ATTACHMENT2_NV 0x8CE2
-#define GL_COLOR_ATTACHMENT3_NV 0x8CE3
-#define GL_COLOR_ATTACHMENT4_NV 0x8CE4
-#define GL_COLOR_ATTACHMENT5_NV 0x8CE5
-#define GL_COLOR_ATTACHMENT6_NV 0x8CE6
-#define GL_COLOR_ATTACHMENT7_NV 0x8CE7
-#define GL_COLOR_ATTACHMENT8_NV 0x8CE8
-#define GL_COLOR_ATTACHMENT9_NV 0x8CE9
-#define GL_COLOR_ATTACHMENT10_NV 0x8CEA
-#define GL_COLOR_ATTACHMENT11_NV 0x8CEB
-#define GL_COLOR_ATTACHMENT12_NV 0x8CEC
-#define GL_COLOR_ATTACHMENT13_NV 0x8CED
-#define GL_COLOR_ATTACHMENT14_NV 0x8CEE
-#define GL_COLOR_ATTACHMENT15_NV 0x8CEF
-#endif
-
-/* GL_NV_fbo_color_attachments */
-#ifndef GL_NV_fbo_color_attachments
-#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF
-/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */
-#endif
-
-/* GL_NV_fence */
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-#endif
-
-/* GL_NV_read_buffer */
-#ifndef GL_NV_read_buffer
-#define GL_READ_BUFFER_NV 0x0C02
-#endif
-
-/* GL_NV_read_buffer_front */
-/* No new tokens introduced by this extension. */
-
-/* GL_NV_read_depth */
-/* No new tokens introduced by this extension. */
-
-/* GL_NV_read_depth_stencil */
-/* No new tokens introduced by this extension. */
-
-/* GL_NV_read_stencil */
-/* No new tokens introduced by this extension. */
-
-/* GL_NV_texture_compression_s3tc_update */
-/* No new tokens introduced by this extension. */
-
-/* GL_NV_texture_npot_2D_mipmap */
-/* No new tokens introduced by this extension. */
-
-/*------------------------------------------------------------------------*
- * QCOM extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_QCOM_alpha_test */
-#ifndef GL_QCOM_alpha_test
-#define GL_ALPHA_TEST_QCOM 0x0BC0
-#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1
-#define GL_ALPHA_TEST_REF_QCOM 0x0BC2
-#endif
-
-/* GL_QCOM_driver_control */
-/* No new tokens introduced by this extension. */
-
-/* GL_QCOM_extended_get */
-#ifndef GL_QCOM_extended_get
-#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
-#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
-#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
-#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
-#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
-#define GL_TEXTURE_TYPE_QCOM 0x8BD7
-#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
-#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
-#define GL_TEXTURE_TARGET_QCOM 0x8BDA
-#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
-#define GL_STATE_RESTORE 0x8BDC
-#endif
-
-/* GL_QCOM_extended_get2 */
-/* No new tokens introduced by this extension. */
-
-/* GL_QCOM_perfmon_global_mode */
-#ifndef GL_QCOM_perfmon_global_mode
-#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
-#endif
-
-/* GL_QCOM_writeonly_rendering */
-#ifndef GL_QCOM_writeonly_rendering
-#define GL_WRITEONLY_RENDERING_QCOM 0x8823
-#endif
-
-/* GL_QCOM_tiled_rendering */
-#ifndef GL_QCOM_tiled_rendering
-#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
-#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
-#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
-#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
-#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
-#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
-#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
-#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
-#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
-#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
-#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
-#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
-#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
-#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
-#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
-#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
-#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
-#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
-#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
-#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
-#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
-#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
-#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
-#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
-#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
-#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
-#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
-#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
-#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
-#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
-#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
-#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
-#endif
-
-/*------------------------------------------------------------------------*
- * VIV extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_VIV_shader_binary */
-#ifndef GL_VIV_shader_binary
-#define GL_SHADER_BINARY_VIV 0x8FC4
-#endif
-
-/*------------------------------------------------------------------------*
- * End of extension tokens, start of corresponding extension functions
- *------------------------------------------------------------------------*/
-
-/*------------------------------------------------------------------------*
- * OES extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_OES_compressed_ETC1_RGB8_texture */
-#ifndef GL_OES_compressed_ETC1_RGB8_texture
-#define GL_OES_compressed_ETC1_RGB8_texture 1
-#endif
-
-/* GL_OES_compressed_paletted_texture */
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_OES_compressed_paletted_texture 1
-#endif
-
-/* GL_OES_depth24 */
-#ifndef GL_OES_depth24
-#define GL_OES_depth24 1
-#endif
-
-/* GL_OES_depth32 */
-#ifndef GL_OES_depth32
-#define GL_OES_depth32 1
-#endif
-
-/* GL_OES_depth_texture */
-#ifndef GL_OES_depth_texture
-#define GL_OES_depth_texture 1
-#endif
-
-/* GL_OES_EGL_image */
-#ifndef GL_OES_EGL_image
-#define GL_OES_EGL_image 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
-GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
-#endif
-typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
-typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
-#endif
-
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_OES_EGL_image_external 1
-/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
-#endif
-
-/* GL_OES_element_index_uint */
-#ifndef GL_OES_element_index_uint
-#define GL_OES_element_index_uint 1
-#endif
-
-/* GL_OES_fbo_render_mipmap */
-#ifndef GL_OES_fbo_render_mipmap
-#define GL_OES_fbo_render_mipmap 1
-#endif
-
-/* GL_OES_fragment_precision_high */
-#ifndef GL_OES_fragment_precision_high
-#define GL_OES_fragment_precision_high 1
-#endif
-
-/* GL_OES_get_program_binary */
-#ifndef GL_OES_get_program_binary
-#define GL_OES_get_program_binary 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
-#endif
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
-#endif
-
-/* GL_OES_mapbuffer */
-#ifndef GL_OES_mapbuffer
-#define GL_OES_mapbuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
-GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
-GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params);
-#endif
-typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
-typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params);
-#endif
-
-/* GL_OES_packed_depth_stencil */
-#ifndef GL_OES_packed_depth_stencil
-#define GL_OES_packed_depth_stencil 1
-#endif
-
-/* GL_OES_rgb8_rgba8 */
-#ifndef GL_OES_rgb8_rgba8
-#define GL_OES_rgb8_rgba8 1
-#endif
-
-/* GL_OES_standard_derivatives */
-#ifndef GL_OES_standard_derivatives
-#define GL_OES_standard_derivatives 1
-#endif
-
-/* GL_OES_stencil1 */
-#ifndef GL_OES_stencil1
-#define GL_OES_stencil1 1
-#endif
-
-/* GL_OES_stencil4 */
-#ifndef GL_OES_stencil4
-#define GL_OES_stencil4 1
-#endif
-
-/* GL_OES_texture_3D */
-#ifndef GL_OES_texture_3D
-#define GL_OES_texture_3D 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
-GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
-GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-#endif
-typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
-typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-#endif
-
-/* GL_OES_texture_float */
-#ifndef GL_OES_texture_float
-#define GL_OES_texture_float 1
-#endif
-
-/* GL_OES_texture_float_linear */
-#ifndef GL_OES_texture_float_linear
-#define GL_OES_texture_float_linear 1
-#endif
-
-/* GL_OES_texture_half_float */
-#ifndef GL_OES_texture_half_float
-#define GL_OES_texture_half_float 1
-#endif
-
-/* GL_OES_texture_half_float_linear */
-#ifndef GL_OES_texture_half_float_linear
-#define GL_OES_texture_half_float_linear 1
-#endif
-
-/* GL_OES_texture_npot */
-#ifndef GL_OES_texture_npot
-#define GL_OES_texture_npot 1
-#endif
-
-/* GL_OES_vertex_array_object */
-#ifndef GL_OES_vertex_array_object
-#define GL_OES_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
-GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
-GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
-GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
-#endif
-typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
-typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
-typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
-#endif
-
-/* GL_OES_vertex_half_float */
-#ifndef GL_OES_vertex_half_float
-#define GL_OES_vertex_half_float 1
-#endif
-
-/* GL_OES_vertex_type_10_10_10_2 */
-#ifndef GL_OES_vertex_type_10_10_10_2
-#define GL_OES_vertex_type_10_10_10_2 1
-#endif
-
-/*------------------------------------------------------------------------*
- * AMD extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_AMD_compressed_3DC_texture */
-#ifndef GL_AMD_compressed_3DC_texture
-#define GL_AMD_compressed_3DC_texture 1
-#endif
-
-/* GL_AMD_compressed_ATC_texture */
-#ifndef GL_AMD_compressed_ATC_texture
-#define GL_AMD_compressed_ATC_texture 1
-#endif
-
-/* AMD_performance_monitor */
-#ifndef GL_AMD_performance_monitor
-#define GL_AMD_performance_monitor 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
-GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
-GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
-GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#endif
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
-typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
-typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#endif
-
-/* GL_AMD_program_binary_Z400 */
-#ifndef GL_AMD_program_binary_Z400
-#define GL_AMD_program_binary_Z400 1
-#endif
-
-/*------------------------------------------------------------------------*
- * ANGLE extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_ANGLE_framebuffer_blit */
-#ifndef GL_ANGLE_framebuffer_blit
-#define GL_ANGLE_framebuffer_blit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif
-typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif
-
-/* GL_ANGLE_framebuffer_multisample */
-#ifndef GL_ANGLE_framebuffer_multisample
-#define GL_ANGLE_framebuffer_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-
-/*------------------------------------------------------------------------*
- * APPLE extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_APPLE_rgb_422 */
-#ifndef GL_APPLE_rgb_422
-#define GL_APPLE_rgb_422 1
-#endif
-
-/* GL_APPLE_framebuffer_multisample */
-#ifndef GL_APPLE_framebuffer_multisample
-#define GL_APPLE_framebuffer_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
-#endif
-
-/* GL_APPLE_texture_format_BGRA8888 */
-#ifndef GL_APPLE_texture_format_BGRA8888
-#define GL_APPLE_texture_format_BGRA8888 1
-#endif
-
-/* GL_APPLE_texture_max_level */
-#ifndef GL_APPLE_texture_max_level
-#define GL_APPLE_texture_max_level 1
-#endif
-
-/*------------------------------------------------------------------------*
- * ARM extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_ARM_mali_shader_binary */
-#ifndef GL_ARM_mali_shader_binary
-#define GL_ARM_mali_shader_binary 1
-#endif
-
-/* GL_ARM_rgba8 */
-#ifndef GL_ARM_rgba8
-#define GL_ARM_rgba8 1
-#endif
-
-/*------------------------------------------------------------------------*
- * EXT extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_EXT_blend_minmax */
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#endif
-
-/* GL_EXT_color_buffer_half_float */
-#ifndef GL_EXT_color_buffer_half_float
-#define GL_EXT_color_buffer_half_float 1
-#endif
-
-/* GL_EXT_debug_label */
-#ifndef GL_EXT_debug_label
-#define GL_EXT_debug_label 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
-GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
-#endif
-typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
-typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
-#endif
-
-/* GL_EXT_debug_marker */
-#ifndef GL_EXT_debug_marker
-#define GL_EXT_debug_marker 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
-GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
-GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
-#endif
-typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
-typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
-typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
-#endif
-
-/* GL_EXT_discard_framebuffer */
-#ifndef GL_EXT_discard_framebuffer
-#define GL_EXT_discard_framebuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-#endif
-typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-#endif
-
-/* GL_EXT_multisampled_render_to_texture */
-#ifndef GL_EXT_multisampled_render_to_texture
-#define GL_EXT_multisampled_render_to_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif
-
-/* GL_EXT_occlusion_query_boolean */
-#ifndef GL_EXT_occlusion_query_boolean
-#define GL_EXT_occlusion_query_boolean 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
-GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
-GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
-GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
-GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
-GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
-#endif
-typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
-typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
-typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
-typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-/* GL_EXT_read_format_bgra */
-#ifndef GL_EXT_read_format_bgra
-#define GL_EXT_read_format_bgra 1
-#endif
-
-/* GL_EXT_robustness */
-#ifndef GL_EXT_robustness
-#define GL_EXT_robustness 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
-GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params);
-GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-#endif
-typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
-typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-#endif
-
-/* GL_EXT_separate_shader_objects */
-#ifndef GL_EXT_separate_shader_objects
-#define GL_EXT_separate_shader_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program);
-GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
-GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
-GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
-GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
-GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x);
-GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y);
-GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z);
-GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
-GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x);
-GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y);
-GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-#endif
-typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
-typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
-typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
-typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
-typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-#endif
-
-/* GL_EXT_shader_texture_lod */
-#ifndef GL_EXT_shader_texture_lod
-#define GL_EXT_shader_texture_lod 1
-#endif
-
-/* GL_EXT_shadow_samplers */
-#ifndef GL_EXT_shadow_samplers
-#define GL_EXT_shadow_samplers 1
-#endif
-
-/* GL_EXT_sRGB */
-#ifndef GL_EXT_sRGB
-#define GL_EXT_sRGB 1
-#endif
-
-/* GL_EXT_texture_compression_dxt1 */
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_EXT_texture_compression_dxt1 1
-#endif
-
-/* GL_EXT_texture_filter_anisotropic */
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#endif
-
-/* GL_EXT_texture_format_BGRA8888 */
-#ifndef GL_EXT_texture_format_BGRA8888
-#define GL_EXT_texture_format_BGRA8888 1
-#endif
-
-/* GL_EXT_texture_rg */
-#ifndef GL_EXT_texture_rg
-#define GL_EXT_texture_rg 1
-#endif
-
-/* GL_EXT_texture_storage */
-#ifndef GL_EXT_texture_storage
-#define GL_EXT_texture_storage 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-
-/* GL_EXT_texture_type_2_10_10_10_REV */
-#ifndef GL_EXT_texture_type_2_10_10_10_REV
-#define GL_EXT_texture_type_2_10_10_10_REV 1
-#endif
-
-/* GL_EXT_unpack_subimage */
-#ifndef GL_EXT_unpack_subimage
-#define GL_EXT_unpack_subimage 1
-#endif
-
-/*------------------------------------------------------------------------*
- * DMP extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_DMP_shader_binary */
-#ifndef GL_DMP_shader_binary
-#define GL_DMP_shader_binary 1
-#endif
-
-/*------------------------------------------------------------------------*
- * IMG extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_IMG_program_binary */
-#ifndef GL_IMG_program_binary
-#define GL_IMG_program_binary 1
-#endif
-
-/* GL_IMG_read_format */
-#ifndef GL_IMG_read_format
-#define GL_IMG_read_format 1
-#endif
-
-/* GL_IMG_shader_binary */
-#ifndef GL_IMG_shader_binary
-#define GL_IMG_shader_binary 1
-#endif
-
-/* GL_IMG_texture_compression_pvrtc */
-#ifndef GL_IMG_texture_compression_pvrtc
-#define GL_IMG_texture_compression_pvrtc 1
-#endif
-
-/* GL_IMG_multisampled_render_to_texture */
-#ifndef GL_IMG_multisampled_render_to_texture
-#define GL_IMG_multisampled_render_to_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-
-/*------------------------------------------------------------------------*
- * NV extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_NV_coverage_sample */
-#ifndef GL_NV_coverage_sample
-#define GL_NV_coverage_sample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
-GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
-#endif
-typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
-typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
-#endif
-
-/* GL_NV_depth_nonlinear */
-#ifndef GL_NV_depth_nonlinear
-#define GL_NV_depth_nonlinear 1
-#endif
-
-/* GL_NV_draw_buffers */
-#ifndef GL_NV_draw_buffers
-#define GL_NV_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
-#endif
-typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-/* GL_NV_fbo_color_attachments */
-#ifndef GL_NV_fbo_color_attachments
-#define GL_NV_fbo_color_attachments 1
-#endif
-
-/* GL_NV_fence */
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
-GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
-GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence);
-GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence);
-GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence);
-GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
-#endif
-typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-#endif
-
-/* GL_NV_read_buffer */
-#ifndef GL_NV_read_buffer
-#define GL_NV_read_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
-#endif
-typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
-#endif
-
-/* GL_NV_read_buffer_front */
-#ifndef GL_NV_read_buffer_front
-#define GL_NV_read_buffer_front 1
-#endif
-
-/* GL_NV_read_depth */
-#ifndef GL_NV_read_depth
-#define GL_NV_read_depth 1
-#endif
-
-/* GL_NV_read_depth_stencil */
-#ifndef GL_NV_read_depth_stencil
-#define GL_NV_read_depth_stencil 1
-#endif
-
-/* GL_NV_read_stencil */
-#ifndef GL_NV_read_stencil
-#define GL_NV_read_stencil 1
-#endif
-
-/* GL_NV_texture_compression_s3tc_update */
-#ifndef GL_NV_texture_compression_s3tc_update
-#define GL_NV_texture_compression_s3tc_update 1
-#endif
-
-/* GL_NV_texture_npot_2D_mipmap */
-#ifndef GL_NV_texture_npot_2D_mipmap
-#define GL_NV_texture_npot_2D_mipmap 1
-#endif
-
-/*------------------------------------------------------------------------*
- * QCOM extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_QCOM_alpha_test */
-#ifndef GL_QCOM_alpha_test
-#define GL_QCOM_alpha_test 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
-#endif
-typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
-#endif
-
-/* GL_QCOM_driver_control */
-#ifndef GL_QCOM_driver_control
-#define GL_QCOM_driver_control 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
-GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
-GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
-GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
-#endif
-typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
-typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
-typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
-typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
-#endif
-
-/* GL_QCOM_extended_get */
-#ifndef GL_QCOM_extended_get
-#define GL_QCOM_extended_get 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
-GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
-GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
-GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
-GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
-GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
-#endif
-typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
-typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
-typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
-typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
-typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
-typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
-#endif
-
-/* GL_QCOM_extended_get2 */
-#ifndef GL_QCOM_extended_get2
-#define GL_QCOM_extended_get2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
-GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
-GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
-GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
-#endif
-typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
-typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
-typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
-#endif
-
-/* GL_QCOM_perfmon_global_mode */
-#ifndef GL_QCOM_perfmon_global_mode
-#define GL_QCOM_perfmon_global_mode 1
-#endif
-
-/* GL_QCOM_writeonly_rendering */
-#ifndef GL_QCOM_writeonly_rendering
-#define GL_QCOM_writeonly_rendering 1
-#endif
-
-/* GL_QCOM_tiled_rendering */
-#ifndef GL_QCOM_tiled_rendering
-#define GL_QCOM_tiled_rendering 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
-GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
-#endif
-typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
-typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
-#endif
-
-/*------------------------------------------------------------------------*
- * VIV extension tokens
- *------------------------------------------------------------------------*/
-
-/* GL_VIV_shader_binary */
-#ifndef GL_VIV_shader_binary
-#define GL_VIV_shader_binary 1
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gl2ext_h_ */
diff --git a/opengl/include/GLES2/gl2platform.h b/opengl/include/GLES2/gl2platform.h
deleted file mode 100644
index c9fa3c4..0000000
--- a/opengl/include/GLES2/gl2platform.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __gl2platform_h_
-#define __gl2platform_h_
-
-/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
-
-/*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
-
-/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
- *
- * Adopters may modify khrplatform.h and this file to suit their platform.
- * You are encouraged to submit all modifications to the Khronos group so that
- * they can be included in future versions of this file. Please submit changes
- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
- * by filing a bug against product "OpenGL-ES" component "Registry".
- */
-
-#include <KHR/khrplatform.h>
-
-#ifndef GL_APICALL
-#define GL_APICALL KHRONOS_APICALL
-#endif
-
-#ifndef GL_APIENTRY
-#define GL_APIENTRY KHRONOS_APIENTRY
-#endif
-
-#endif /* __gl2platform_h_ */
diff --git a/opengl/include/KHR/khrplatform.h b/opengl/include/KHR/khrplatform.h
deleted file mode 100644
index 1660bd7..0000000
--- a/opengl/include/KHR/khrplatform.h
+++ /dev/null
@@ -1,243 +0,0 @@
-#ifndef __khrplatform_h_
-#define __khrplatform_h_
-
-/*
-** Copyright (c) 2008-2009 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-/* Platform-specific types and definitions.
- * $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $
- *
- * Adopters may modify this file to suit their platform. Adopters are
- * encouraged to submit platform specific modifications to the Khronos
- * group so that they can be included in future versions of this file.
- * Please submit changes by sending them to the public Khronos Bugzilla
- * (http://khronos.org/bugzilla) by filing a bug against product
- * "Khronos (general)" component "Registry".
- *
- * A predefined template which fills in some of the bug fields can be
- * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
- * must create a Bugzilla login first.
- *
- *
- * See the Implementer's Guidelines for information about where this file
- * should be located on your system.
- * http://www.khronos.org/registry/implementers_guide.pdf
- *
- *
- * This file should be included as
- * #include <KHR/khrplatform.h>
- * by the Khronos API header file that uses its types and defines.
- *
- * The types in this file should only be used to define API-specific types.
- * Types defined in this file:
- * khronos_int8_t signed 8 bit
- * khronos_uint8_t unsigned 8 bit
- * khronos_int16_t signed 16 bit
- * khronos_uint16_t unsigned 16 bit
- * khronos_int32_t signed 32 bit
- * khronos_uint32_t unsigned 32 bit
- * khronos_int64_t signed 64 bit
- * khronos_uint64_t unsigned 64 bit
- * khronos_intptr_t signed same number of bits as a pointer
- * khronos_uintptr_t unsigned same number of bits as a pointer
- * khronos_ssize_t signed size
- * khronos_usize_t unsigned size
- * khronos_float_t signed 32 bit floating point
- * khronos_time_ns_t unsigned 64 bit time in nanoseconds
- * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
- * nanoseconds
- * khronos_stime_nanoseconds_t signed time interval in nanoseconds
- *
- * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
- * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
- *
- *
- * Macros defined in this file:
- * KHRONOS_APICALL
- * KHRONOS_APIENTRY
- * KHRONOS_APIATTRIBUTES
- * These may be used in function prototypes as:
- * KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
- * int arg1,
- * int arg2) KHRONOS_APIATTRIBUTES;
- */
-
-/*-------------------------------------------------------------------------
- * Definition of KHRONOS_APICALL
- *-------------------------------------------------------------------------
- * This precedes the return type of the function in the function prototype.
- */
-#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
-# define KHRONOS_APICALL __declspec(dllimport)
-#elif defined (__SYMBIAN32__)
-# define KHRONOS_APICALL IMPORT_C
-#elif defined(ANDROID)
-# define KHRONOS_APICALL __attribute__((visibility("default")))
-#else
-# define KHRONOS_APICALL
-#endif
-
-/*-------------------------------------------------------------------------
- * Definition of KHRONOS_APIENTRY
- *-------------------------------------------------------------------------
- * This follows the return type of the function and precedes the function
- * name in the function prototype.
- */
-#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
- /* Win32 but not WinCE */
-# define KHRONOS_APIENTRY __stdcall
-#else
-# define KHRONOS_APIENTRY
-#endif
-
-/*-------------------------------------------------------------------------
- * Definition of KHRONOS_APIATTRIBUTES
- *-------------------------------------------------------------------------
- * This follows the closing parenthesis of the function prototype arguments.
- */
-#if defined (__ARMCC_2__)
-#define KHRONOS_APIATTRIBUTES __softfp
-#else
-#define KHRONOS_APIATTRIBUTES
-#endif
-
-/*-------------------------------------------------------------------------
- * basic type definitions
- *-----------------------------------------------------------------------*/
-#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
-
-
-/*
- * Using <stdint.h>
- */
-#include <stdint.h>
-typedef int32_t khronos_int32_t;
-typedef uint32_t khronos_uint32_t;
-typedef int64_t khronos_int64_t;
-typedef uint64_t khronos_uint64_t;
-#define KHRONOS_SUPPORT_INT64 1
-#define KHRONOS_SUPPORT_FLOAT 1
-
-#elif defined(__VMS ) || defined(__sgi)
-
-/*
- * Using <inttypes.h>
- */
-#include <inttypes.h>
-typedef int32_t khronos_int32_t;
-typedef uint32_t khronos_uint32_t;
-typedef int64_t khronos_int64_t;
-typedef uint64_t khronos_uint64_t;
-#define KHRONOS_SUPPORT_INT64 1
-#define KHRONOS_SUPPORT_FLOAT 1
-
-#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
-
-/*
- * Win32
- */
-typedef __int32 khronos_int32_t;
-typedef unsigned __int32 khronos_uint32_t;
-typedef __int64 khronos_int64_t;
-typedef unsigned __int64 khronos_uint64_t;
-#define KHRONOS_SUPPORT_INT64 1
-#define KHRONOS_SUPPORT_FLOAT 1
-
-#elif defined(__sun__) || defined(__digital__)
-
-/*
- * Sun or Digital
- */
-typedef int khronos_int32_t;
-typedef unsigned int khronos_uint32_t;
-#if defined(__arch64__) || defined(_LP64)
-typedef long int khronos_int64_t;
-typedef unsigned long int khronos_uint64_t;
-#else
-typedef long long int khronos_int64_t;
-typedef unsigned long long int khronos_uint64_t;
-#endif /* __arch64__ */
-#define KHRONOS_SUPPORT_INT64 1
-#define KHRONOS_SUPPORT_FLOAT 1
-
-#elif 0
-
-/*
- * Hypothetical platform with no float or int64 support
- */
-typedef int khronos_int32_t;
-typedef unsigned int khronos_uint32_t;
-#define KHRONOS_SUPPORT_INT64 0
-#define KHRONOS_SUPPORT_FLOAT 0
-
-#else
-
-/*
- * Generic fallback
- */
-#include <stdint.h>
-typedef int32_t khronos_int32_t;
-typedef uint32_t khronos_uint32_t;
-typedef int64_t khronos_int64_t;
-typedef uint64_t khronos_uint64_t;
-#define KHRONOS_SUPPORT_INT64 1
-#define KHRONOS_SUPPORT_FLOAT 1
-
-#endif
-
-
-/*
- * Types that are (so far) the same on all platforms
- */
-typedef signed char khronos_int8_t;
-typedef unsigned char khronos_uint8_t;
-typedef signed short int khronos_int16_t;
-typedef unsigned short int khronos_uint16_t;
-typedef signed long int khronos_intptr_t;
-typedef unsigned long int khronos_uintptr_t;
-typedef signed long int khronos_ssize_t;
-typedef unsigned long int khronos_usize_t;
-
-#if KHRONOS_SUPPORT_FLOAT
-/*
- * Float type
- */
-typedef float khronos_float_t;
-#endif
-
-#if KHRONOS_SUPPORT_INT64
-/* Time types
- *
- * These types can be used to represent a time interval in nanoseconds or
- * an absolute Unadjusted System Time. Unadjusted System Time is the number
- * of nanoseconds since some arbitrary system event (e.g. since the last
- * time the system booted). The Unadjusted System Time is an unsigned
- * 64 bit value that wraps back to 0 every 584 years. Time intervals
- * may be either signed or unsigned.
- */
-typedef khronos_uint64_t khronos_utime_nanoseconds_t;
-typedef khronos_int64_t khronos_stime_nanoseconds_t;
-#endif
-
-
-#endif /* __khrplatform_h_ */
diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk
deleted file mode 100644
index 15e58f2..0000000
--- a/opengl/libagl/Android.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-#
-# Build the software OpenGL ES library
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- egl.cpp \
- state.cpp \
- texture.cpp \
- Tokenizer.cpp \
- TokenManager.cpp \
- TextureObjectManager.cpp \
- BufferObjectManager.cpp \
- array.cpp.arm \
- fp.cpp.arm \
- light.cpp.arm \
- matrix.cpp.arm \
- mipmap.cpp.arm \
- primitives.cpp.arm \
- vertex.cpp.arm
-
-LOCAL_CFLAGS += -DLOG_TAG=\"libagl\"
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_CFLAGS += -fvisibility=hidden
-
-LOCAL_SHARED_LIBRARIES := libcutils libhardware libutils libpixelflinger libETC1
-LOCAL_LDLIBS := -lpthread -ldl
-
-ifeq ($(TARGET_ARCH),arm)
- LOCAL_SRC_FILES += fixed_asm.S iterators.S
- LOCAL_CFLAGS += -fstrict-aliasing
-endif
-
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-
-# we need to access the private Bionic header <bionic_tls.h>
-# on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER
-# behavior from the bionic Android.mk file
-ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-LOCAL_C_INCLUDES += bionic/libc/private
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
-LOCAL_MODULE:= libGLES_android
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/opengl/libagl/BufferObjectManager.cpp b/opengl/libagl/BufferObjectManager.cpp
deleted file mode 100644
index 6bf28ee..0000000
--- a/opengl/libagl/BufferObjectManager.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- ** Copyright 2008, 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.
- */
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-#include <utils/Atomic.h>
-#include <utils/RefBase.h>
-#include <utils/KeyedVector.h>
-#include <utils/Errors.h>
-
-#include <GLES/gl.h>
-
-#include "BufferObjectManager.h"
-
-
-namespace android {
-
-using namespace gl;
-
-// ----------------------------------------------------------------------------
-
-EGLBufferObjectManager::EGLBufferObjectManager()
-: TokenManager(), mCount(0)
-{
-}
-
-EGLBufferObjectManager::~EGLBufferObjectManager()
-{
- // destroy all the buffer objects and their storage
- GLsizei n = mBuffers.size();
- for (GLsizei i=0 ; i<n ; i++) {
- buffer_t* bo = mBuffers.valueAt(i);
- free(bo->data);
- delete bo;
- }
-}
-
-buffer_t const* EGLBufferObjectManager::bind(GLuint buffer)
-{
- Mutex::Autolock _l(mLock);
- int32_t i = mBuffers.indexOfKey(buffer);
- if (i >= 0) {
- return mBuffers.valueAt(i);
- }
- buffer_t* bo = new buffer_t;
- bo->data = 0;
- bo->usage = GL_STATIC_DRAW;
- bo->size = 0;
- bo->name = buffer;
- mBuffers.add(buffer, bo);
- return bo;
-}
-
-int EGLBufferObjectManager::allocateStore(buffer_t* bo,
- GLsizeiptr size, GLenum usage)
-{
- Mutex::Autolock _l(mLock);
- if (size != bo->size) {
- uint8_t* data = (uint8_t*)malloc(size);
- if (data == 0)
- return -1;
- free(bo->data);
- bo->data = data;
- bo->size = size;
- }
- bo->usage = usage;
- return 0;
-}
-
-void EGLBufferObjectManager::deleteBuffers(GLsizei n, const GLuint* buffers)
-{
- Mutex::Autolock _l(mLock);
- while (n--) {
- const GLuint t = *buffers++;
- if (t) {
- int32_t index = mBuffers.indexOfKey(t);
- if (index >= 0) {
- buffer_t* bo = mBuffers.valueAt(index);
- free(bo->data);
- mBuffers.removeItemsAt(index);
- delete bo;
- }
- }
- }
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/opengl/libagl/BufferObjectManager.h b/opengl/libagl/BufferObjectManager.h
deleted file mode 100644
index 9e9340a..0000000
--- a/opengl/libagl/BufferObjectManager.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- **
- ** Copyright 2006, 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.
- */
-
-#ifndef ANDROID_OPENGLES_BUFFER_OBJECT_MANAGER_H
-#define ANDROID_OPENGLES_BUFFER_OBJECT_MANAGER_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-#include <utils/Atomic.h>
-#include <utils/RefBase.h>
-#include <utils/KeyedVector.h>
-#include <utils/Errors.h>
-
-#include <GLES/gl.h>
-
-#include "Tokenizer.h"
-#include "TokenManager.h"
-
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-namespace gl {
-
-struct buffer_t {
- GLsizeiptr size;
- GLenum usage;
- uint8_t* data;
- uint32_t name;
-};
-
-};
-
-class EGLBufferObjectManager : public TokenManager
-{
-public:
- EGLBufferObjectManager();
- ~EGLBufferObjectManager();
-
- // protocol for sp<>
- inline void incStrong(const void* id) const;
- inline void decStrong(const void* id) const;
- typedef void weakref_type;
-
- gl::buffer_t const* bind(GLuint buffer);
- int allocateStore(gl::buffer_t* bo, GLsizeiptr size, GLenum usage);
- void deleteBuffers(GLsizei n, const GLuint* buffers);
-
-private:
- mutable volatile int32_t mCount;
- mutable Mutex mLock;
- KeyedVector<GLuint, gl::buffer_t*> mBuffers;
-};
-
-void EGLBufferObjectManager::incStrong(const void* id) const {
- android_atomic_inc(&mCount);
-}
-void EGLBufferObjectManager::decStrong(const void* id) const {
- if (android_atomic_dec(&mCount) == 1) {
- delete this;
- }
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_BUFFER_OBJECT_MANAGER_H
-
diff --git a/opengl/libagl/TextureObjectManager.cpp b/opengl/libagl/TextureObjectManager.cpp
deleted file mode 100644
index 06d45cc..0000000
--- a/opengl/libagl/TextureObjectManager.cpp
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- ** Copyright 2006, 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "context.h"
-#include "TextureObjectManager.h"
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-EGLTextureObject::EGLTextureObject()
- : mSize(0)
-{
- init();
-}
-
-EGLTextureObject::~EGLTextureObject()
-{
- if (!direct) {
- if (mSize && surface.data)
- free(surface.data);
- if (mMipmaps)
- freeMipmaps();
- }
-}
-
-void EGLTextureObject::init()
-{
- memset(&surface, 0, sizeof(surface));
- surface.version = sizeof(surface);
- mMipmaps = 0;
- mNumExtraLod = 0;
- mIsComplete = false;
- wraps = GL_REPEAT;
- wrapt = GL_REPEAT;
- min_filter = GL_LINEAR;
- mag_filter = GL_LINEAR;
- internalformat = 0;
- memset(crop_rect, 0, sizeof(crop_rect));
- generate_mipmap = GL_FALSE;
- direct = GL_FALSE;
- buffer = 0;
-}
-
-void EGLTextureObject::copyParameters(const sp<EGLTextureObject>& old)
-{
- wraps = old->wraps;
- wrapt = old->wrapt;
- min_filter = old->min_filter;
- mag_filter = old->mag_filter;
- memcpy(crop_rect, old->crop_rect, sizeof(crop_rect));
- generate_mipmap = old->generate_mipmap;
- direct = old->direct;
-}
-
-status_t EGLTextureObject::allocateMipmaps()
-{
- // here, by construction, mMipmaps=0 && mNumExtraLod=0
-
- if (!surface.data)
- return NO_INIT;
-
- int w = surface.width;
- int h = surface.height;
- const int numLods = 31 - gglClz(max(w,h));
- if (numLods <= 0)
- return NO_ERROR;
-
- mMipmaps = (GGLSurface*)malloc(numLods * sizeof(GGLSurface));
- if (!mMipmaps)
- return NO_MEMORY;
-
- memset(mMipmaps, 0, numLods * sizeof(GGLSurface));
- mNumExtraLod = numLods;
- return NO_ERROR;
-}
-
-void EGLTextureObject::freeMipmaps()
-{
- if (mMipmaps) {
- for (int i=0 ; i<mNumExtraLod ; i++) {
- if (mMipmaps[i].data) {
- free(mMipmaps[i].data);
- }
- }
- free(mMipmaps);
- mMipmaps = 0;
- mNumExtraLod = 0;
- }
-}
-
-const GGLSurface& EGLTextureObject::mip(int lod) const
-{
- if (lod<=0 || !mMipmaps)
- return surface;
- lod = min(lod-1, mNumExtraLod-1);
- return mMipmaps[lod];
-}
-
-GGLSurface& EGLTextureObject::editMip(int lod)
-{
- return const_cast<GGLSurface&>(mip(lod));
-}
-
-status_t EGLTextureObject::setSurface(GGLSurface const* s)
-{
- // XXX: glFlush() on 's'
- if (mSize && surface.data) {
- free(surface.data);
- }
- surface = *s;
- internalformat = 0;
- buffer = 0;
-
- // we should keep the crop_rect, but it's delicate because
- // the new size of the surface could make it invalid.
- // so for now, we just loose it.
- memset(crop_rect, 0, sizeof(crop_rect));
-
- // it would be nice if we could keep the generate_mipmap flag,
- // we would have to generate them right now though.
- generate_mipmap = GL_FALSE;
-
- direct = GL_TRUE;
- mSize = 0; // we don't own this surface
- if (mMipmaps)
- freeMipmaps();
- mIsComplete = true;
- return NO_ERROR;
-}
-
-status_t EGLTextureObject::setImage(ANativeWindowBuffer* native_buffer)
-{
- GGLSurface sur;
- sur.version = sizeof(GGLSurface);
- sur.width = native_buffer->width;
- sur.height= native_buffer->height;
- sur.stride= native_buffer->stride;
- sur.format= native_buffer->format;
- sur.data = 0;
- setSurface(&sur);
- buffer = native_buffer;
- return NO_ERROR;
-}
-
-status_t EGLTextureObject::reallocate(
- GLint level, int w, int h, int s,
- int format, int compressedFormat, int bpr)
-{
- const size_t size = h * bpr;
- if (level == 0)
- {
- if (size!=mSize || !surface.data) {
- if (mSize && surface.data) {
- free(surface.data);
- }
- surface.data = (GGLubyte*)malloc(size);
- if (!surface.data) {
- mSize = 0;
- mIsComplete = false;
- return NO_MEMORY;
- }
- mSize = size;
- }
- surface.version = sizeof(GGLSurface);
- surface.width = w;
- surface.height = h;
- surface.stride = s;
- surface.format = format;
- surface.compressedFormat = compressedFormat;
- if (mMipmaps)
- freeMipmaps();
- mIsComplete = true;
- }
- else
- {
- if (!mMipmaps) {
- if (allocateMipmaps() != NO_ERROR)
- return NO_MEMORY;
- }
-
- ALOGW_IF(level-1 >= mNumExtraLod,
- "specifying mipmap level %d, but # of level is %d",
- level, mNumExtraLod+1);
-
- GGLSurface& mipmap = editMip(level);
- if (mipmap.data)
- free(mipmap.data);
-
- mipmap.data = (GGLubyte*)malloc(size);
- if (!mipmap.data) {
- memset(&mipmap, 0, sizeof(GGLSurface));
- mIsComplete = false;
- return NO_MEMORY;
- }
-
- mipmap.version = sizeof(GGLSurface);
- mipmap.width = w;
- mipmap.height = h;
- mipmap.stride = s;
- mipmap.format = format;
- mipmap.compressedFormat = compressedFormat;
-
- // check if the texture is complete
- mIsComplete = true;
- const GGLSurface* prev = &surface;
- for (int i=0 ; i<mNumExtraLod ; i++) {
- const GGLSurface* curr = mMipmaps + i;
- if (curr->format != surface.format) {
- mIsComplete = false;
- break;
- }
-
- uint32_t w = (prev->width >> 1) ? : 1;
- uint32_t h = (prev->height >> 1) ? : 1;
- if (w != curr->width || h != curr->height) {
- mIsComplete = false;
- break;
- }
- prev = curr;
- }
- }
- return NO_ERROR;
-}
-
-// ----------------------------------------------------------------------------
-
-EGLSurfaceManager::EGLSurfaceManager()
- : TokenManager()
-{
-}
-
-EGLSurfaceManager::~EGLSurfaceManager()
-{
- // everything gets freed automatically here...
-}
-
-sp<EGLTextureObject> EGLSurfaceManager::createTexture(GLuint name)
-{
- sp<EGLTextureObject> result;
-
- Mutex::Autolock _l(mLock);
- if (mTextures.indexOfKey(name) >= 0)
- return result; // already exists!
-
- result = new EGLTextureObject();
-
- status_t err = mTextures.add(name, result);
- if (err < 0)
- result.clear();
-
- return result;
-}
-
-sp<EGLTextureObject> EGLSurfaceManager::removeTexture(GLuint name)
-{
- Mutex::Autolock _l(mLock);
- const ssize_t index = mTextures.indexOfKey(name);
- if (index >= 0) {
- sp<EGLTextureObject> result(mTextures.valueAt(index));
- mTextures.removeItemsAt(index);
- return result;
- }
- return 0;
-}
-
-sp<EGLTextureObject> EGLSurfaceManager::replaceTexture(GLuint name)
-{
- sp<EGLTextureObject> tex;
- Mutex::Autolock _l(mLock);
- const ssize_t index = mTextures.indexOfKey(name);
- if (index >= 0) {
- const sp<EGLTextureObject>& old = mTextures.valueAt(index);
- const uint32_t refs = old->getStrongCount();
- if (ggl_likely(refs == 1)) {
- // we're the only owner
- tex = old;
- } else {
- // keep the texture's parameters
- tex = new EGLTextureObject();
- tex->copyParameters(old);
- mTextures.removeItemsAt(index);
- mTextures.add(name, tex);
- }
- }
- return tex;
-}
-
-void EGLSurfaceManager::deleteTextures(GLsizei n, const GLuint *tokens)
-{
- // free all textures
- Mutex::Autolock _l(mLock);
- for (GLsizei i=0 ; i<n ; i++) {
- const GLuint t(*tokens++);
- if (t) {
- mTextures.removeItem(t);
- }
- }
-}
-
-sp<EGLTextureObject> EGLSurfaceManager::texture(GLuint name)
-{
- Mutex::Autolock _l(mLock);
- const ssize_t index = mTextures.indexOfKey(name);
- if (index >= 0)
- return mTextures.valueAt(index);
- return 0;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/opengl/libagl/TextureObjectManager.h b/opengl/libagl/TextureObjectManager.h
deleted file mode 100644
index de9e03e..0000000
--- a/opengl/libagl/TextureObjectManager.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_SURFACE_H
-#define ANDROID_OPENGLES_SURFACE_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-#include <utils/Atomic.h>
-#include <utils/threads.h>
-#include <utils/RefBase.h>
-#include <utils/KeyedVector.h>
-#include <utils/Errors.h>
-
-#include <private/pixelflinger/ggl_context.h>
-
-#include <GLES/gl.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#include "Tokenizer.h"
-#include "TokenManager.h"
-
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-class EGLTextureObject : public LightRefBase<EGLTextureObject>
-{
-public:
- EGLTextureObject();
- ~EGLTextureObject();
-
- status_t setSurface(GGLSurface const* s);
- status_t setImage(ANativeWindowBuffer* buffer);
- void setImageBits(void* vaddr) { surface.data = (GGLubyte*)vaddr; }
-
- status_t reallocate(GLint level,
- int w, int h, int s,
- int format, int compressedFormat, int bpr);
- inline size_t size() const { return mSize; }
- const GGLSurface& mip(int lod) const;
- GGLSurface& editMip(int lod);
- bool hasMipmaps() const { return mMipmaps!=0; }
- bool isComplete() const { return mIsComplete; }
- void copyParameters(const sp<EGLTextureObject>& old);
-
-private:
- status_t allocateMipmaps();
- void freeMipmaps();
- void init();
- size_t mSize;
- GGLSurface *mMipmaps;
- int mNumExtraLod;
- bool mIsComplete;
-
-public:
- GGLSurface surface;
- GLenum wraps;
- GLenum wrapt;
- GLenum min_filter;
- GLenum mag_filter;
- GLenum internalformat;
- GLint crop_rect[4];
- GLint generate_mipmap;
- GLint direct;
- ANativeWindowBuffer* buffer;
-};
-
-// ----------------------------------------------------------------------------
-
-class EGLSurfaceManager :
- public LightRefBase<EGLSurfaceManager>,
- public TokenManager
-{
-public:
- EGLSurfaceManager();
- ~EGLSurfaceManager();
-
- sp<EGLTextureObject> createTexture(GLuint name);
- sp<EGLTextureObject> removeTexture(GLuint name);
- sp<EGLTextureObject> replaceTexture(GLuint name);
- void deleteTextures(GLsizei n, const GLuint *tokens);
- sp<EGLTextureObject> texture(GLuint name);
-
-private:
- mutable Mutex mLock;
- KeyedVector< GLuint, sp<EGLTextureObject> > mTextures;
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_SURFACE_H
-
diff --git a/opengl/libagl/TokenManager.cpp b/opengl/libagl/TokenManager.cpp
deleted file mode 100644
index eea6025..0000000
--- a/opengl/libagl/TokenManager.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/* libs/opengles/surface.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "TokenManager.h"
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-TokenManager::TokenManager()
-{
- // token 0 is always reserved
- mTokenizer.reserve(0);
-}
-
-TokenManager::~TokenManager()
-{
-}
-
-status_t TokenManager::getToken(GLsizei n, GLuint *tokens)
-{
- Mutex::Autolock _l(mLock);
- for (GLsizei i=0 ; i<n ; i++)
- *tokens++ = mTokenizer.acquire();
- return NO_ERROR;
-}
-
-void TokenManager::recycleTokens(GLsizei n, const GLuint *tokens)
-{
- Mutex::Autolock _l(mLock);
- for (int i=0 ; i<n ; i++) {
- const GLuint token = *tokens++;
- if (token) {
- mTokenizer.release(token);
- }
- }
-}
-
-bool TokenManager::isTokenValid(GLuint token) const
-{
- Mutex::Autolock _l(mLock);
- return mTokenizer.isAcquired(token);
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
diff --git a/opengl/libagl/TokenManager.h b/opengl/libagl/TokenManager.h
deleted file mode 100644
index 49c1469..0000000
--- a/opengl/libagl/TokenManager.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_TOKEN_MANAGER_H
-#define ANDROID_OPENGLES_TOKEN_MANAGER_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-#include <utils/threads.h>
-
-#include <GLES/gl.h>
-
-#include "Tokenizer.h"
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-class TokenManager
-{
-public:
- TokenManager();
- ~TokenManager();
-
- status_t getToken(GLsizei n, GLuint *tokens);
- void recycleTokens(GLsizei n, const GLuint *tokens);
- bool isTokenValid(GLuint token) const;
-
-private:
- mutable Mutex mLock;
- Tokenizer mTokenizer;
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_TOKEN_MANAGER_H
-
diff --git a/opengl/libagl/Tokenizer.cpp b/opengl/libagl/Tokenizer.cpp
deleted file mode 100644
index eac8d6d..0000000
--- a/opengl/libagl/Tokenizer.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/* libs/opengles/Tokenizer.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdio.h>
-
-#include "Tokenizer.h"
-
-// ----------------------------------------------------------------------------
-
-namespace android {
-
-ANDROID_BASIC_TYPES_TRAITS(Tokenizer::run_t)
-
-Tokenizer::Tokenizer()
-{
-}
-
-Tokenizer::Tokenizer(const Tokenizer& other)
- : mRanges(other.mRanges)
-{
-}
-
-Tokenizer::~Tokenizer()
-{
-}
-
-uint32_t Tokenizer::acquire()
-{
- if (!mRanges.size() || mRanges[0].first) {
- _insertTokenAt(0,0);
- return 0;
- }
-
- // just extend the first run
- const run_t& run = mRanges[0];
- uint32_t token = run.first + run.length;
- _insertTokenAt(token, 1);
- return token;
-}
-
-bool Tokenizer::isAcquired(uint32_t token) const
-{
- return (_indexOrderOf(token) >= 0);
-}
-
-status_t Tokenizer::reserve(uint32_t token)
-{
- size_t o;
- const ssize_t i = _indexOrderOf(token, &o);
- if (i >= 0) {
- return BAD_VALUE; // this token is already taken
- }
- ssize_t err = _insertTokenAt(token, o);
- return (err<0) ? err : status_t(NO_ERROR);
-}
-
-status_t Tokenizer::release(uint32_t token)
-{
- const ssize_t i = _indexOrderOf(token);
- if (i >= 0) {
- const run_t& run = mRanges[i];
- if ((token >= run.first) && (token < run.first+run.length)) {
- // token in this range, we need to split
- run_t& run = mRanges.editItemAt(i);
- if ((token == run.first) || (token == run.first+run.length-1)) {
- if (token == run.first) {
- run.first += 1;
- }
- run.length -= 1;
- if (run.length == 0) {
- // XXX: should we systematically remove a run that's empty?
- mRanges.removeItemsAt(i);
- }
- } else {
- // split the run
- run_t new_run;
- new_run.first = token+1;
- new_run.length = run.first+run.length - new_run.first;
- run.length = token - run.first;
- mRanges.insertAt(new_run, i+1);
- }
- return NO_ERROR;
- }
- }
- return NAME_NOT_FOUND;
-}
-
-ssize_t Tokenizer::_indexOrderOf(uint32_t token, size_t* order) const
-{
- // binary search
- ssize_t err = NAME_NOT_FOUND;
- ssize_t l = 0;
- ssize_t h = mRanges.size()-1;
- ssize_t mid;
- const run_t* a = mRanges.array();
- while (l <= h) {
- mid = l + (h - l)/2;
- const run_t* const curr = a + mid;
- int c = 0;
- if (token < curr->first) c = 1;
- else if (token >= curr->first+curr->length) c = -1;
- if (c == 0) {
- err = l = mid;
- break;
- } else if (c < 0) {
- l = mid + 1;
- } else {
- h = mid - 1;
- }
- }
- if (order) *order = l;
- return err;
-}
-
-ssize_t Tokenizer::_insertTokenAt(uint32_t token, size_t index)
-{
- const size_t c = mRanges.size();
-
- if (index >= 1) {
- // do we need to merge with the previous run?
- run_t& p = mRanges.editItemAt(index-1);
- if (p.first+p.length == token) {
- p.length += 1;
- if (index < c) {
- const run_t& n = mRanges[index];
- if (token+1 == n.first) {
- p.length += n.length;
- mRanges.removeItemsAt(index);
- }
- }
- return index;
- }
- }
-
- if (index < c) {
- // do we need to merge with the next run?
- run_t& n = mRanges.editItemAt(index);
- if (token+1 == n.first) {
- n.first -= 1;
- n.length += 1;
- return index;
- }
- }
-
- return mRanges.insertAt(run_t(token,1), index);
-}
-
-void Tokenizer::dump() const
-{
- const run_t* ranges = mRanges.array();
- const size_t c = mRanges.size();
- ALOGD("Tokenizer (%p, size = %u)\n", this, c);
- for (size_t i=0 ; i<c ; i++) {
- ALOGD("%u: (%u, %u)\n", i, ranges[i].first, ranges[i].length);
- }
-}
-
-}; // namespace android
-
diff --git a/opengl/libagl/Tokenizer.h b/opengl/libagl/Tokenizer.h
deleted file mode 100644
index ac555cb..0000000
--- a/opengl/libagl/Tokenizer.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* libs/opengles/Tokenizer.h
-**
-** Copyright 2006, 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.
-*/
-
-
-#ifndef ANDROID_OPENGLES_TOKENIZER_H
-#define ANDROID_OPENGLES_TOKENIZER_H
-
-#include <utils/Vector.h>
-#include <utils/Errors.h>
-
-// ----------------------------------------------------------------------------
-
-namespace android {
-
-class Tokenizer
-{
-public:
- Tokenizer();
- Tokenizer(const Tokenizer& other);
- ~Tokenizer();
-
- uint32_t acquire();
- status_t reserve(uint32_t token);
- status_t release(uint32_t token);
- bool isAcquired(uint32_t token) const;
-
- void dump() const;
-
- struct run_t {
- run_t() {};
- run_t(uint32_t f, uint32_t l) : first(f), length(l) {}
- uint32_t first;
- uint32_t length;
- };
-private:
- ssize_t _indexOrderOf(uint32_t token, size_t* order=0) const;
- ssize_t _insertTokenAt(uint32_t token, size_t index);
- Vector<run_t> mRanges;
-};
-
-}; // namespace android
-
-// ----------------------------------------------------------------------------
-
-#endif // ANDROID_OPENGLES_TOKENIZER_H
diff --git a/opengl/libagl/array.cpp b/opengl/libagl/array.cpp
deleted file mode 100644
index 7fbe9b5..0000000
--- a/opengl/libagl/array.cpp
+++ /dev/null
@@ -1,1588 +0,0 @@
-/*
-** Copyright 2006, 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.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "context.h"
-#include "fp.h"
-#include "state.h"
-#include "matrix.h"
-#include "vertex.h"
-#include "light.h"
-#include "primitives.h"
-#include "texture.h"
-#include "BufferObjectManager.h"
-
-// ----------------------------------------------------------------------------
-
-#define VC_CACHE_STATISTICS 0
-#define VC_CACHE_TYPE_NONE 0
-#define VC_CACHE_TYPE_INDEXED 1
-#define VC_CACHE_TYPE_LRU 2
-#define VC_CACHE_TYPE VC_CACHE_TYPE_INDEXED
-
-#if VC_CACHE_STATISTICS
-#include <utils/Timers.h>
-#endif
-
-// ----------------------------------------------------------------------------
-
-namespace android {
-
-static void validate_arrays(ogles_context_t* c, GLenum mode);
-
-static void compileElements__generic(ogles_context_t*,
- vertex_t*, GLint, GLsizei);
-static void compileElement__generic(ogles_context_t*,
- vertex_t*, GLint);
-
-static void drawPrimitivesPoints(ogles_context_t*, GLint, GLsizei);
-static void drawPrimitivesLineStrip(ogles_context_t*, GLint, GLsizei);
-static void drawPrimitivesLineLoop(ogles_context_t*, GLint, GLsizei);
-static void drawPrimitivesLines(ogles_context_t*, GLint, GLsizei);
-static void drawPrimitivesTriangleStrip(ogles_context_t*, GLint, GLsizei);
-static void drawPrimitivesTriangleFan(ogles_context_t*, GLint, GLsizei);
-static void drawPrimitivesTriangles(ogles_context_t*, GLint, GLsizei);
-
-static void drawIndexedPrimitivesPoints(ogles_context_t*,
- GLsizei, const GLvoid*);
-static void drawIndexedPrimitivesLineStrip(ogles_context_t*,
- GLsizei, const GLvoid*);
-static void drawIndexedPrimitivesLineLoop(ogles_context_t*,
- GLsizei, const GLvoid*);
-static void drawIndexedPrimitivesLines(ogles_context_t*,
- GLsizei, const GLvoid*);
-static void drawIndexedPrimitivesTriangleStrip(ogles_context_t*,
- GLsizei, const GLvoid*);
-static void drawIndexedPrimitivesTriangleFan(ogles_context_t*,
- GLsizei, const GLvoid*);
-static void drawIndexedPrimitivesTriangles(ogles_context_t*,
- GLsizei, const GLvoid*);
-
-// ----------------------------------------------------------------------------
-
-typedef void (*arrays_prims_fct_t)(ogles_context_t*, GLint, GLsizei);
-static const arrays_prims_fct_t drawArraysPrims[] = {
- drawPrimitivesPoints,
- drawPrimitivesLines,
- drawPrimitivesLineLoop,
- drawPrimitivesLineStrip,
- drawPrimitivesTriangles,
- drawPrimitivesTriangleStrip,
- drawPrimitivesTriangleFan
-};
-
-typedef void (*elements_prims_fct_t)(ogles_context_t*, GLsizei, const GLvoid*);
-static const elements_prims_fct_t drawElementsPrims[] = {
- drawIndexedPrimitivesPoints,
- drawIndexedPrimitivesLines,
- drawIndexedPrimitivesLineLoop,
- drawIndexedPrimitivesLineStrip,
- drawIndexedPrimitivesTriangles,
- drawIndexedPrimitivesTriangleStrip,
- drawIndexedPrimitivesTriangleFan
-};
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-void ogles_init_array(ogles_context_t* c)
-{
- c->arrays.vertex.size = 4;
- c->arrays.vertex.type = GL_FLOAT;
- c->arrays.color.size = 4;
- c->arrays.color.type = GL_FLOAT;
- c->arrays.normal.size = 4;
- c->arrays.normal.type = GL_FLOAT;
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- c->arrays.texture[i].size = 4;
- c->arrays.texture[i].type = GL_FLOAT;
- }
- c->vc.init();
-
- if (!c->vc.vBuffer) {
- // this could have failed
- ogles_error(c, GL_OUT_OF_MEMORY);
- }
-}
-
-void ogles_uninit_array(ogles_context_t* c)
-{
- c->vc.uninit();
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Array fetchers
-#endif
-
-static void currentColor(ogles_context_t* c, GLfixed* v, const GLvoid*) {
- memcpy(v, c->current.color.v, sizeof(vec4_t));
-}
-static void currentColor_clamp(ogles_context_t* c, GLfixed* v, const GLvoid*) {
- memcpy(v, c->currentColorClamped.v, sizeof(vec4_t));
-}
-static void currentNormal(ogles_context_t* c, GLfixed* v, const GLvoid*) {
- memcpy(v, c->currentNormal.v, sizeof(vec3_t));
-}
-static void currentTexCoord(ogles_context_t* c, GLfixed* v, const GLvoid*) {
- memcpy(v, c->current.texture[c->arrays.tmu].v, sizeof(vec4_t));
-}
-
-
-static void fetchNop(ogles_context_t*, GLfixed*, const GLvoid*) {
-}
-static void fetch2b(ogles_context_t*, GLfixed* v, const GLbyte* p) {
- v[0] = gglIntToFixed(p[0]);
- v[1] = gglIntToFixed(p[1]);
-}
-static void fetch2s(ogles_context_t*, GLfixed* v, const GLshort* p) {
- v[0] = gglIntToFixed(p[0]);
- v[1] = gglIntToFixed(p[1]);
-}
-static void fetch2x(ogles_context_t*, GLfixed* v, const GLfixed* p) {
- memcpy(v, p, 2*sizeof(GLfixed));
-}
-static void fetch2f(ogles_context_t*, GLfixed* v, const GLfloat* p) {
- v[0] = gglFloatToFixed(p[0]);
- v[1] = gglFloatToFixed(p[1]);
-}
-static void fetch3b(ogles_context_t*, GLfixed* v, const GLbyte* p) {
- v[0] = gglIntToFixed(p[0]);
- v[1] = gglIntToFixed(p[1]);
- v[2] = gglIntToFixed(p[2]);
-}
-static void fetch3s(ogles_context_t*, GLfixed* v, const GLshort* p) {
- v[0] = gglIntToFixed(p[0]);
- v[1] = gglIntToFixed(p[1]);
- v[2] = gglIntToFixed(p[2]);
-}
-static void fetch3x(ogles_context_t*, GLfixed* v, const GLfixed* p) {
- memcpy(v, p, 3*sizeof(GLfixed));
-}
-static void fetch3f(ogles_context_t*, GLfixed* v, const GLfloat* p) {
- v[0] = gglFloatToFixed(p[0]);
- v[1] = gglFloatToFixed(p[1]);
- v[2] = gglFloatToFixed(p[2]);
-}
-static void fetch4b(ogles_context_t*, GLfixed* v, const GLbyte* p) {
- v[0] = gglIntToFixed(p[0]);
- v[1] = gglIntToFixed(p[1]);
- v[2] = gglIntToFixed(p[2]);
- v[3] = gglIntToFixed(p[3]);
-}
-static void fetch4s(ogles_context_t*, GLfixed* v, const GLshort* p) {
- v[0] = gglIntToFixed(p[0]);
- v[1] = gglIntToFixed(p[1]);
- v[2] = gglIntToFixed(p[2]);
- v[3] = gglIntToFixed(p[3]);
-}
-static void fetch4x(ogles_context_t*, GLfixed* v, const GLfixed* p) {
- memcpy(v, p, 4*sizeof(GLfixed));
-}
-static void fetch4f(ogles_context_t*, GLfixed* v, const GLfloat* p) {
- v[0] = gglFloatToFixed(p[0]);
- v[1] = gglFloatToFixed(p[1]);
- v[2] = gglFloatToFixed(p[2]);
- v[3] = gglFloatToFixed(p[3]);
-}
-static void fetchExpand4ub(ogles_context_t*, GLfixed* v, const GLubyte* p) {
- v[0] = GGL_UB_TO_X(p[0]);
- v[1] = GGL_UB_TO_X(p[1]);
- v[2] = GGL_UB_TO_X(p[2]);
- v[3] = GGL_UB_TO_X(p[3]);
-}
-static void fetchClamp4x(ogles_context_t*, GLfixed* v, const GLfixed* p) {
- v[0] = gglClampx(p[0]);
- v[1] = gglClampx(p[1]);
- v[2] = gglClampx(p[2]);
- v[3] = gglClampx(p[3]);
-}
-static void fetchClamp4f(ogles_context_t*, GLfixed* v, const GLfloat* p) {
- v[0] = gglClampx(gglFloatToFixed(p[0]));
- v[1] = gglClampx(gglFloatToFixed(p[1]));
- v[2] = gglClampx(gglFloatToFixed(p[2]));
- v[3] = gglClampx(gglFloatToFixed(p[3]));
-}
-static void fetchExpand3ub(ogles_context_t*, GLfixed* v, const GLubyte* p) {
- v[0] = GGL_UB_TO_X(p[0]);
- v[1] = GGL_UB_TO_X(p[1]);
- v[2] = GGL_UB_TO_X(p[2]);
- v[3] = 0x10000;
-}
-static void fetchClamp3x(ogles_context_t*, GLfixed* v, const GLfixed* p) {
- v[0] = gglClampx(p[0]);
- v[1] = gglClampx(p[1]);
- v[2] = gglClampx(p[2]);
- v[3] = 0x10000;
-}
-static void fetchClamp3f(ogles_context_t*, GLfixed* v, const GLfloat* p) {
- v[0] = gglClampx(gglFloatToFixed(p[0]));
- v[1] = gglClampx(gglFloatToFixed(p[1]));
- v[2] = gglClampx(gglFloatToFixed(p[2]));
- v[3] = 0x10000;
-}
-static void fetchExpand3b(ogles_context_t*, GLfixed* v, const GLbyte* p) {
- v[0] = GGL_B_TO_X(p[0]);
- v[1] = GGL_B_TO_X(p[1]);
- v[2] = GGL_B_TO_X(p[2]);
-}
-static void fetchExpand3s(ogles_context_t*, GLfixed* v, const GLshort* p) {
- v[0] = GGL_S_TO_X(p[0]);
- v[1] = GGL_S_TO_X(p[1]);
- v[2] = GGL_S_TO_X(p[2]);
-}
-
-typedef array_t::fetcher_t fn_t;
-
-static const fn_t color_fct[2][16] = { // size={3,4}, type={ub,f,x}
- { 0, (fn_t)fetchExpand3ub, 0, 0, 0, 0,
- (fn_t)fetch3f, 0, 0, 0, 0, 0,
- (fn_t)fetch3x },
- { 0, (fn_t)fetchExpand4ub, 0, 0, 0, 0,
- (fn_t)fetch4f, 0, 0, 0, 0, 0,
- (fn_t)fetch4x },
-};
-static const fn_t color_clamp_fct[2][16] = { // size={3,4}, type={ub,f,x}
- { 0, (fn_t)fetchExpand3ub, 0, 0, 0, 0,
- (fn_t)fetchClamp3f, 0, 0, 0, 0, 0,
- (fn_t)fetchClamp3x },
- { 0, (fn_t)fetchExpand4ub, 0, 0, 0, 0,
- (fn_t)fetchClamp4f, 0, 0, 0, 0, 0,
- (fn_t)fetchClamp4x },
-};
-static const fn_t normal_fct[1][16] = { // size={3}, type={b,s,f,x}
- { (fn_t)fetchExpand3b, 0,
- (fn_t)fetchExpand3s, 0, 0, 0,
- (fn_t)fetch3f, 0, 0, 0, 0, 0,
- (fn_t)fetch3x },
-};
-static const fn_t vertex_fct[3][16] = { // size={2,3,4}, type={b,s,f,x}
- { (fn_t)fetch2b, 0,
- (fn_t)fetch2s, 0, 0, 0,
- (fn_t)fetch2f, 0, 0, 0, 0, 0,
- (fn_t)fetch3x },
- { (fn_t)fetch3b, 0,
- (fn_t)fetch3s, 0, 0, 0,
- (fn_t)fetch3f, 0, 0, 0, 0, 0,
- (fn_t)fetch3x },
- { (fn_t)fetch4b, 0,
- (fn_t)fetch4s, 0, 0, 0,
- (fn_t)fetch4f, 0, 0, 0, 0, 0,
- (fn_t)fetch4x }
-};
-static const fn_t texture_fct[3][16] = { // size={2,3,4}, type={b,s,f,x}
- { (fn_t)fetch2b, 0,
- (fn_t)fetch2s, 0, 0, 0,
- (fn_t)fetch2f, 0, 0, 0, 0, 0,
- (fn_t)fetch2x },
- { (fn_t)fetch3b, 0,
- (fn_t)fetch3s, 0, 0, 0,
- (fn_t)fetch3f, 0, 0, 0, 0, 0,
- (fn_t)fetch3x },
- { (fn_t)fetch4b, 0,
- (fn_t)fetch4s, 0, 0, 0,
- (fn_t)fetch4f, 0, 0, 0, 0, 0,
- (fn_t)fetch4x }
-};
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark array_t
-#endif
-
-void array_t::init(
- GLint size, GLenum type, GLsizei stride,
- const GLvoid *pointer, const buffer_t* bo, GLsizei count)
-{
- if (!stride) {
- stride = size;
- switch (type) {
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- stride *= 2;
- break;
- case GL_FLOAT:
- case GL_FIXED:
- stride *= 4;
- break;
- }
- }
- this->size = size;
- this->type = type;
- this->stride = stride;
- this->pointer = pointer;
- this->bo = bo;
- this->bounds = count;
-}
-
-inline void array_t::resolve()
-{
- physical_pointer = (bo) ? (bo->data + uintptr_t(pointer)) : pointer;
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark vertex_cache_t
-#endif
-
-void vertex_cache_t::init()
-{
- // make sure the size of vertex_t allows cache-line alignment
- CTA<(sizeof(vertex_t) & 0x1F) == 0> assertAlignedSize;
-
- const int align = 32;
- const size_t s = VERTEX_BUFFER_SIZE + VERTEX_CACHE_SIZE;
- const size_t size = s*sizeof(vertex_t) + align;
- base = malloc(size);
- if (base) {
- memset(base, 0, size);
- vBuffer = (vertex_t*)((size_t(base) + align - 1) & ~(align-1));
- vCache = vBuffer + VERTEX_BUFFER_SIZE;
- sequence = 0;
- }
-}
-
-void vertex_cache_t::uninit()
-{
- free(base);
- base = vBuffer = vCache = 0;
-}
-
-void vertex_cache_t::clear()
-{
-#if VC_CACHE_STATISTICS
- startTime = systemTime(SYSTEM_TIME_THREAD);
- total = 0;
- misses = 0;
-#endif
-
-#if VC_CACHE_TYPE == VC_CACHE_TYPE_LRU
- vertex_t* v = vBuffer;
- size_t count = VERTEX_BUFFER_SIZE + VERTEX_CACHE_SIZE;
- do {
- v->mru = 0;
- v++;
- } while (--count);
-#endif
-
- sequence += INDEX_SEQ;
- if (sequence >= 0x80000000LU) {
- sequence = INDEX_SEQ;
- vertex_t* v = vBuffer;
- size_t count = VERTEX_BUFFER_SIZE + VERTEX_CACHE_SIZE;
- do {
- v->index = 0;
- v++;
- } while (--count);
- }
-}
-
-void vertex_cache_t::dump_stats(GLenum mode)
-{
-#if VC_CACHE_STATISTICS
- nsecs_t time = systemTime(SYSTEM_TIME_THREAD) - startTime;
- uint32_t hits = total - misses;
- uint32_t prim_count;
- switch (mode) {
- case GL_POINTS: prim_count = total; break;
- case GL_LINE_STRIP: prim_count = total - 1; break;
- case GL_LINE_LOOP: prim_count = total - 1; break;
- case GL_LINES: prim_count = total / 2; break;
- case GL_TRIANGLE_STRIP: prim_count = total - 2; break;
- case GL_TRIANGLE_FAN: prim_count = total - 2; break;
- case GL_TRIANGLES: prim_count = total / 3; break;
- default: return;
- }
- printf( "total=%5u, hits=%5u, miss=%5u, hitrate=%3u%%,"
- " prims=%5u, time=%6u us, prims/s=%d, v/t=%f\n",
- total, hits, misses, (hits*100)/total,
- prim_count, int(ns2us(time)), int(prim_count*float(seconds(1))/time),
- float(misses) / prim_count);
-#endif
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-static __attribute__((noinline))
-void enableDisableClientState(ogles_context_t* c, GLenum array, bool enable)
-{
- const int tmu = c->arrays.activeTexture;
- array_t* a;
- switch (array) {
- case GL_COLOR_ARRAY: a = &c->arrays.color; break;
- case GL_NORMAL_ARRAY: a = &c->arrays.normal; break;
- case GL_TEXTURE_COORD_ARRAY: a = &c->arrays.texture[tmu]; break;
- case GL_VERTEX_ARRAY: a = &c->arrays.vertex; break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- a->enable = enable ? GL_TRUE : GL_FALSE;
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Vertex Cache
-#endif
-
-static __attribute__((noinline))
-vertex_t* cache_vertex(ogles_context_t* c, vertex_t* v, uint32_t index)
-{
- #if VC_CACHE_STATISTICS
- c->vc.misses++;
- #endif
- if (ggl_unlikely(v->locked)) {
- // we're just looking for an entry in the cache that is not locked.
- // and we know that there cannot be more than 2 locked entries
- // because a triangle needs at most 3 vertices.
- // We never use the first and second entries because they might be in
- // use by the striper or faner. Any other entry will do as long as
- // it's not locked.
- // We compute directly the index of a "free" entry from the locked
- // state of v[2] and v[3].
- v = c->vc.vBuffer + 2;
- v += v[0].locked | (v[1].locked<<1);
- }
- // note: compileElement clears v->flags
- c->arrays.compileElement(c, v, index);
- v->locked = 1;
- return v;
-}
-
-static __attribute__((noinline))
-vertex_t* fetch_vertex(ogles_context_t* c, size_t index)
-{
- index |= c->vc.sequence;
-
-#if VC_CACHE_TYPE == VC_CACHE_TYPE_INDEXED
-
- vertex_t* const v = c->vc.vCache +
- (index & (vertex_cache_t::VERTEX_CACHE_SIZE-1));
-
- if (ggl_likely(v->index == index)) {
- v->locked = 1;
- return v;
- }
- return cache_vertex(c, v, index);
-
-#elif VC_CACHE_TYPE == VC_CACHE_TYPE_LRU
-
- vertex_t* v = c->vc.vCache +
- (index & ((vertex_cache_t::VERTEX_CACHE_SIZE-1)>>1))*2;
-
- // always record LRU in v[0]
- if (ggl_likely(v[0].index == index)) {
- v[0].locked = 1;
- v[0].mru = 0;
- return &v[0];
- }
-
- if (ggl_likely(v[1].index == index)) {
- v[1].locked = 1;
- v[0].mru = 1;
- return &v[1];
- }
-
- const int lru = 1 - v[0].mru;
- v[0].mru = lru;
- return cache_vertex(c, &v[lru], index);
-
-#elif VC_CACHE_TYPE == VC_CACHE_TYPE_NONE
-
- // just for debugging...
- vertex_t* v = c->vc.vBuffer + 2;
- return cache_vertex(c, v, index);
-
-#endif
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Primitive Assembly
-#endif
-
-void drawPrimitivesPoints(ogles_context_t* c, GLint first, GLsizei count)
-{
- if (ggl_unlikely(count < 1))
- return;
-
- // vertex cache size must be multiple of 1
- const GLsizei vcs =
- (vertex_cache_t::VERTEX_BUFFER_SIZE +
- vertex_cache_t::VERTEX_CACHE_SIZE);
- do {
- vertex_t* v = c->vc.vBuffer;
- GLsizei num = count > vcs ? vcs : count;
- c->arrays.cull = vertex_t::CLIP_ALL;
- c->arrays.compileElements(c, v, first, num);
- first += num;
- count -= num;
- if (!c->arrays.cull) {
- // quick/trivial reject of the whole batch
- do {
- const uint32_t cc = v[0].flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderPoint(c, v);
- v++;
- num--;
- } while (num);
- }
- } while (count);
-}
-
-// ----------------------------------------------------------------------------
-
-void drawPrimitivesLineStrip(ogles_context_t* c, GLint first, GLsizei count)
-{
- if (ggl_unlikely(count < 2))
- return;
-
- vertex_t *v, *v0, *v1;
- c->arrays.cull = vertex_t::CLIP_ALL;
- c->arrays.compileElement(c, c->vc.vBuffer, first);
- first += 1;
- count -= 1;
-
- // vertex cache size must be multiple of 1
- const GLsizei vcs =
- (vertex_cache_t::VERTEX_BUFFER_SIZE +
- vertex_cache_t::VERTEX_CACHE_SIZE - 1);
- do {
- v0 = c->vc.vBuffer + 0;
- v = c->vc.vBuffer + 1;
- GLsizei num = count > vcs ? vcs : count;
- c->arrays.compileElements(c, v, first, num);
- first += num;
- count -= num;
- if (!c->arrays.cull) {
- // quick/trivial reject of the whole batch
- do {
- v1 = v++;
- const uint32_t cc = v0->flags & v1->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderLine(c, v0, v1);
- v0 = v1;
- num--;
- } while (num);
- }
- // copy back the last processed vertex
- c->vc.vBuffer[0] = *v0;
- c->arrays.cull = v0->flags & vertex_t::CLIP_ALL;
- } while (count);
-}
-
-void drawPrimitivesLineLoop(ogles_context_t* c, GLint first, GLsizei count)
-{
- if (ggl_unlikely(count < 2))
- return;
- drawPrimitivesLineStrip(c, first, count);
- if (ggl_likely(count >= 3)) {
- vertex_t* v0 = c->vc.vBuffer;
- vertex_t* v1 = c->vc.vBuffer + 1;
- c->arrays.compileElement(c, v1, first);
- const uint32_t cc = v0->flags & v1->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderLine(c, v0, v1);
- }
-}
-
-void drawPrimitivesLines(ogles_context_t* c, GLint first, GLsizei count)
-{
- if (ggl_unlikely(count < 2))
- return;
-
- // vertex cache size must be multiple of 2
- const GLsizei vcs =
- ((vertex_cache_t::VERTEX_BUFFER_SIZE +
- vertex_cache_t::VERTEX_CACHE_SIZE) / 2) * 2;
- do {
- vertex_t* v = c->vc.vBuffer;
- GLsizei num = count > vcs ? vcs : count;
- c->arrays.cull = vertex_t::CLIP_ALL;
- c->arrays.compileElements(c, v, first, num);
- first += num;
- count -= num;
- if (!c->arrays.cull) {
- // quick/trivial reject of the whole batch
- num -= 2;
- do {
- const uint32_t cc = v[0].flags & v[1].flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderLine(c, v, v+1);
- v += 2;
- num -= 2;
- } while (num >= 0);
- }
- } while (count >= 2);
-}
-
-// ----------------------------------------------------------------------------
-
-static void drawPrimitivesTriangleFanOrStrip(ogles_context_t* c,
- GLint first, GLsizei count, int winding)
-{
- // winding == 2 : fan
- // winding == 1 : strip
-
- if (ggl_unlikely(count < 3))
- return;
-
- vertex_t *v, *v0, *v1, *v2;
- c->arrays.cull = vertex_t::CLIP_ALL;
- c->arrays.compileElements(c, c->vc.vBuffer, first, 2);
- first += 2;
- count -= 2;
-
- // vertex cache size must be multiple of 2. This is extremely important
- // because it allows us to preserve the same winding when the whole
- // batch is culled. We also need 2 extra vertices in the array, because
- // we always keep the two first ones.
- const GLsizei vcs =
- ((vertex_cache_t::VERTEX_BUFFER_SIZE +
- vertex_cache_t::VERTEX_CACHE_SIZE - 2) / 2) * 2;
- do {
- v0 = c->vc.vBuffer + 0;
- v1 = c->vc.vBuffer + 1;
- v = c->vc.vBuffer + 2;
- GLsizei num = count > vcs ? vcs : count;
- c->arrays.compileElements(c, v, first, num);
- first += num;
- count -= num;
- if (!c->arrays.cull) {
- // quick/trivial reject of the whole batch
- do {
- v2 = v++;
- const uint32_t cc = v0->flags & v1->flags & v2->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderTriangle(c, v0, v1, v2);
- swap(((winding^=1) ? v1 : v0), v2);
- num--;
- } while (num);
- }
- if (count) {
- v0 = c->vc.vBuffer + 2 + vcs - 2;
- v1 = c->vc.vBuffer + 2 + vcs - 1;
- if ((winding&2) == 0) {
- // for strips copy back the two last compiled vertices
- c->vc.vBuffer[0] = *v0;
- }
- c->vc.vBuffer[1] = *v1;
- c->arrays.cull = v0->flags & v1->flags & vertex_t::CLIP_ALL;
- }
- } while (count > 0);
-}
-
-void drawPrimitivesTriangleStrip(ogles_context_t* c,
- GLint first, GLsizei count) {
- drawPrimitivesTriangleFanOrStrip(c, first, count, 1);
-}
-
-void drawPrimitivesTriangleFan(ogles_context_t* c,
- GLint first, GLsizei count) {
- drawPrimitivesTriangleFanOrStrip(c, first, count, 2);
-}
-
-void drawPrimitivesTriangles(ogles_context_t* c, GLint first, GLsizei count)
-{
- if (ggl_unlikely(count < 3))
- return;
-
- // vertex cache size must be multiple of 3
- const GLsizei vcs =
- ((vertex_cache_t::VERTEX_BUFFER_SIZE +
- vertex_cache_t::VERTEX_CACHE_SIZE) / 3) * 3;
- do {
- vertex_t* v = c->vc.vBuffer;
- GLsizei num = count > vcs ? vcs : count;
- c->arrays.cull = vertex_t::CLIP_ALL;
- c->arrays.compileElements(c, v, first, num);
- first += num;
- count -= num;
- if (!c->arrays.cull) {
- // quick/trivial reject of the whole batch
- num -= 3;
- do {
- const uint32_t cc = v[0].flags & v[1].flags & v[2].flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderTriangle(c, v, v+1, v+2);
- v += 3;
- num -= 3;
- } while (num >= 0);
- }
- } while (count >= 3);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-// this looks goofy, but gcc does a great job with this...
-static inline unsigned int read_index(int type, const GLvoid*& p) {
- unsigned int r;
- if (type) {
- r = *(const GLubyte*)p;
- p = (const GLubyte*)p + 1;
- } else {
- r = *(const GLushort*)p;
- p = (const GLushort*)p + 1;
- }
- return r;
-}
-
-// ----------------------------------------------------------------------------
-
-void drawIndexedPrimitivesPoints(ogles_context_t* c,
- GLsizei count, const GLvoid *indices)
-{
- if (ggl_unlikely(count < 1))
- return;
- const int type = (c->arrays.indicesType == GL_UNSIGNED_BYTE);
- do {
- vertex_t * v = fetch_vertex(c, read_index(type, indices));
- if (ggl_likely(!(v->flags & vertex_t::CLIP_ALL)))
- c->prims.renderPoint(c, v);
- v->locked = 0;
- count--;
- } while(count);
-}
-
-// ----------------------------------------------------------------------------
-
-void drawIndexedPrimitivesLineStrip(ogles_context_t* c,
- GLsizei count, const GLvoid *indices)
-{
- if (ggl_unlikely(count < 2))
- return;
-
- vertex_t * const v = c->vc.vBuffer;
- vertex_t* v0 = v;
- vertex_t* v1;
-
- const int type = (c->arrays.indicesType == GL_UNSIGNED_BYTE);
- c->arrays.compileElement(c, v0, read_index(type, indices));
- count -= 1;
- do {
- v1 = fetch_vertex(c, read_index(type, indices));
- const uint32_t cc = v0->flags & v1->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderLine(c, v0, v1);
- v0->locked = 0;
- v0 = v1;
- count--;
- } while (count);
- v1->locked = 0;
-}
-
-void drawIndexedPrimitivesLineLoop(ogles_context_t* c,
- GLsizei count, const GLvoid *indices)
-{
- if (ggl_unlikely(count <= 2)) {
- drawIndexedPrimitivesLines(c, count, indices);
- return;
- }
-
- vertex_t * const v = c->vc.vBuffer;
- vertex_t* v0 = v;
- vertex_t* v1;
-
- const int type = (c->arrays.indicesType == GL_UNSIGNED_BYTE);
- c->arrays.compileElement(c, v0, read_index(type, indices));
- count -= 1;
- do {
- v1 = fetch_vertex(c, read_index(type, indices));
- const uint32_t cc = v0->flags & v1->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderLine(c, v0, v1);
- v0->locked = 0;
- v0 = v1;
- count--;
- } while (count);
- v1->locked = 0;
-
- v1 = c->vc.vBuffer;
- const uint32_t cc = v0->flags & v1->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderLine(c, v0, v1);
-}
-
-void drawIndexedPrimitivesLines(ogles_context_t* c,
- GLsizei count, const GLvoid *indices)
-{
- if (ggl_unlikely(count < 2))
- return;
-
- count -= 2;
- const int type = (c->arrays.indicesType == GL_UNSIGNED_BYTE);
- do {
- vertex_t* const v0 = fetch_vertex(c, read_index(type, indices));
- vertex_t* const v1 = fetch_vertex(c, read_index(type, indices));
- const uint32_t cc = v0->flags & v1->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderLine(c, v0, v1);
- v0->locked = 0;
- v1->locked = 0;
- count -= 2;
- } while (count >= 0);
-}
-
-// ----------------------------------------------------------------------------
-
-static void drawIndexedPrimitivesTriangleFanOrStrip(ogles_context_t* c,
- GLsizei count, const GLvoid *indices, int winding)
-{
- // winding == 2 : fan
- // winding == 1 : strip
-
- if (ggl_unlikely(count < 3))
- return;
-
- vertex_t * const v = c->vc.vBuffer;
- vertex_t* v0 = v;
- vertex_t* v1 = v+1;
- vertex_t* v2;
-
- const int type = (c->arrays.indicesType == GL_UNSIGNED_BYTE);
- c->arrays.compileElement(c, v0, read_index(type, indices));
- c->arrays.compileElement(c, v1, read_index(type, indices));
- count -= 2;
-
- // note: GCC 4.1.1 here makes a prety interesting optimization
- // where it duplicates the loop below based on c->arrays.indicesType
-
- do {
- v2 = fetch_vertex(c, read_index(type, indices));
- const uint32_t cc = v0->flags & v1->flags & v2->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderTriangle(c, v0, v1, v2);
- vertex_t* & consumed = ((winding^=1) ? v1 : v0);
- consumed->locked = 0;
- consumed = v2;
- count--;
- } while (count);
- v0->locked = v1->locked = 0;
- v2->locked = 0;
-}
-
-void drawIndexedPrimitivesTriangleStrip(ogles_context_t* c,
- GLsizei count, const GLvoid *indices) {
- drawIndexedPrimitivesTriangleFanOrStrip(c, count, indices, 1);
-}
-
-void drawIndexedPrimitivesTriangleFan(ogles_context_t* c,
- GLsizei count, const GLvoid *indices) {
- drawIndexedPrimitivesTriangleFanOrStrip(c, count, indices, 2);
-}
-
-void drawIndexedPrimitivesTriangles(ogles_context_t* c,
- GLsizei count, const GLvoid *indices)
-{
- if (ggl_unlikely(count < 3))
- return;
-
- count -= 3;
- if (ggl_likely(c->arrays.indicesType == GL_UNSIGNED_SHORT)) {
- // This case is probably our most common case...
- uint16_t const * p = (uint16_t const *)indices;
- do {
- vertex_t* const v0 = fetch_vertex(c, *p++);
- vertex_t* const v1 = fetch_vertex(c, *p++);
- vertex_t* const v2 = fetch_vertex(c, *p++);
- const uint32_t cc = v0->flags & v1->flags & v2->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderTriangle(c, v0, v1, v2);
- v0->locked = 0;
- v1->locked = 0;
- v2->locked = 0;
- count -= 3;
- } while (count >= 0);
- } else {
- uint8_t const * p = (uint8_t const *)indices;
- do {
- vertex_t* const v0 = fetch_vertex(c, *p++);
- vertex_t* const v1 = fetch_vertex(c, *p++);
- vertex_t* const v2 = fetch_vertex(c, *p++);
- const uint32_t cc = v0->flags & v1->flags & v2->flags;
- if (ggl_likely(!(cc & vertex_t::CLIP_ALL)))
- c->prims.renderTriangle(c, v0, v1, v2);
- v0->locked = 0;
- v1->locked = 0;
- v2->locked = 0;
- count -= 3;
- } while (count >= 0);
- }
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Array compilers
-#endif
-
-void compileElement__generic(ogles_context_t* c,
- vertex_t* v, GLint first)
-{
- v->flags = 0;
- v->index = first;
- first &= vertex_cache_t::INDEX_MASK;
- const GLubyte* vp = c->arrays.vertex.element(first);
- v->obj.z = 0;
- v->obj.w = 0x10000;
- c->arrays.vertex.fetch(c, v->obj.v, vp);
- c->arrays.mvp_transform(&c->transforms.mvp, &v->clip, &v->obj);
- c->arrays.perspective(c, v);
-}
-
-void compileElements__generic(ogles_context_t* c,
- vertex_t* v, GLint first, GLsizei count)
-{
- const GLubyte* vp = c->arrays.vertex.element(
- first & vertex_cache_t::INDEX_MASK);
- const size_t stride = c->arrays.vertex.stride;
- transform_t const* const mvp = &c->transforms.mvp;
- do {
- v->flags = 0;
- v->index = first++;
- v->obj.z = 0;
- v->obj.w = 0x10000;
- c->arrays.vertex.fetch(c, v->obj.v, vp);
- c->arrays.mvp_transform(mvp, &v->clip, &v->obj);
- c->arrays.perspective(c, v);
- vp += stride;
- v++;
- } while (--count);
-}
-
-/*
-void compileElements__3x_full(ogles_context_t* c,
- vertex_t* v, GLint first, GLsizei count)
-{
- const GLfixed* vp = (const GLfixed*)c->arrays.vertex.element(first);
- const size_t stride = c->arrays.vertex.stride / 4;
-// const GLfixed* const& m = c->transforms.mvp.matrix.m;
-
- GLfixed m[16];
- memcpy(&m, c->transforms.mvp.matrix.m, sizeof(m));
-
- do {
- const GLfixed rx = vp[0];
- const GLfixed ry = vp[1];
- const GLfixed rz = vp[2];
- vp += stride;
- v->index = first++;
- v->clip.x = mla3a(rx, m[ 0], ry, m[ 4], rz, m[ 8], m[12]);
- v->clip.y = mla3a(rx, m[ 1], ry, m[ 5], rz, m[ 9], m[13]);
- v->clip.z = mla3a(rx, m[ 2], ry, m[ 6], rz, m[10], m[14]);
- v->clip.w = mla3a(rx, m[ 3], ry, m[ 7], rz, m[11], m[15]);
-
- const GLfixed w = v->clip.w;
- uint32_t clip = 0;
- if (v->clip.x < -w) clip |= vertex_t::CLIP_L;
- if (v->clip.x > w) clip |= vertex_t::CLIP_R;
- if (v->clip.y < -w) clip |= vertex_t::CLIP_B;
- if (v->clip.y > w) clip |= vertex_t::CLIP_T;
- if (v->clip.z < -w) clip |= vertex_t::CLIP_N;
- if (v->clip.z > w) clip |= vertex_t::CLIP_F;
- v->flags = clip;
- c->arrays.cull &= clip;
-
- //c->arrays.perspective(c, v);
- v++;
- } while (--count);
-}
-*/
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark clippers
-#endif
-
-static void clipVec4(vec4_t& nv,
- GLfixed t, const vec4_t& s, const vec4_t& p)
-{
- for (int i=0; i<4 ; i++)
- nv.v[i] = gglMulAddx(t, s.v[i] - p.v[i], p.v[i], 28);
-}
-
-static void clipVertex(ogles_context_t* c, vertex_t* nv,
- GLfixed t, const vertex_t* s, const vertex_t* p)
-{
- clipVec4(nv->clip, t, s->clip, p->clip);
- nv->fog = gglMulAddx(t, s->fog - p->fog, p->fog, 28);
- ogles_vertex_project(c, nv);
- nv->flags |= vertex_t::LIT | vertex_t::EYE | vertex_t::TT;
- nv->flags &= ~vertex_t::CLIP_ALL;
-}
-
-static void clipVertexC(ogles_context_t* c, vertex_t* nv,
- GLfixed t, const vertex_t* s, const vertex_t* p)
-{
- clipVec4(nv->color, t, s->color, p->color);
- clipVertex(c, nv, t, s, p);
-}
-
-static void clipVertexT(ogles_context_t* c, vertex_t* nv,
- GLfixed t, const vertex_t* s, const vertex_t* p)
-{
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- if (c->rasterizer.state.texture[i].enable)
- clipVec4(nv->texture[i], t, s->texture[i], p->texture[i]);
- }
- clipVertex(c, nv, t, s, p);
-}
-
-static void clipVertexAll(ogles_context_t* c, vertex_t* nv,
- GLfixed t, const vertex_t* s, const vertex_t* p)
-{
- clipVec4(nv->color, t, s->color, p->color);
- clipVertexT(c, nv, t, s, p);
-}
-
-static void clipEye(ogles_context_t* c, vertex_t* nv,
- GLfixed t, const vertex_t* s, const vertex_t* p)
-{
- nv->clear();
- c->arrays.clipVertex(c, nv, t, p, s);
- clipVec4(nv->eye, t, s->eye, p->eye);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-void validate_arrays(ogles_context_t* c, GLenum mode)
-{
- uint32_t enables = c->rasterizer.state.enables;
-
- // Perspective correction is not need if Ortho transform, but
- // the user can still provide the w coordinate manually, so we can't
- // automatically turn it off (in fact we could when the 4th coordinate
- // is not spcified in the vertex array).
- // W interpolation is never needed for points.
- GLboolean perspective =
- c->perspective && mode!=GL_POINTS && (enables & GGL_ENABLE_TMUS);
- c->rasterizer.procs.enableDisable(c, GGL_W_LERP, perspective);
-
- // set anti-aliasing
- GLboolean smooth = GL_FALSE;
- switch (mode) {
- case GL_POINTS:
- smooth = c->point.smooth;
- break;
- case GL_LINES:
- case GL_LINE_LOOP:
- case GL_LINE_STRIP:
- smooth = c->line.smooth;
- break;
- }
- if (((enables & GGL_ENABLE_AA)?1:0) != smooth)
- c->rasterizer.procs.enableDisable(c, GGL_AA, smooth);
-
- // set the shade model for this primitive
- c->rasterizer.procs.shadeModel(c,
- (mode == GL_POINTS) ? GL_FLAT : c->lighting.shadeModel);
-
- // compute all the matrices we'll need...
- uint32_t want =
- transform_state_t::MVP |
- transform_state_t::VIEWPORT;
- if (c->lighting.enable) { // needs normal transforms and eye coords
- want |= transform_state_t::MVUI;
- want |= transform_state_t::MODELVIEW;
- }
- if (enables & GGL_ENABLE_TMUS) { // needs texture transforms
- want |= transform_state_t::TEXTURE;
- }
- if (c->clipPlanes.enable || (enables & GGL_ENABLE_FOG)) {
- want |= transform_state_t::MODELVIEW; // needs eye coords
- }
- ogles_validate_transform(c, want);
-
- // textures...
- if (enables & GGL_ENABLE_TMUS)
- ogles_validate_texture(c);
-
- // vertex compilers
- c->arrays.compileElement = compileElement__generic;
- c->arrays.compileElements = compileElements__generic;
-
- // vertex transform
- c->arrays.mvp_transform =
- c->transforms.mvp.pointv[c->arrays.vertex.size - 2];
-
- c->arrays.mv_transform =
- c->transforms.modelview.transform.pointv[c->arrays.vertex.size - 2];
-
- /*
- * ***********************************************************************
- * pick fetchers
- * ***********************************************************************
- */
-
- array_machine_t& am = c->arrays;
- am.vertex.fetch = fetchNop;
- am.normal.fetch = currentNormal;
- am.color.fetch = currentColor;
-
- if (am.vertex.enable) {
- am.vertex.resolve();
- if (am.vertex.bo || am.vertex.pointer) {
- am.vertex.fetch = vertex_fct[am.vertex.size-2][am.vertex.type & 0xF];
- }
- }
-
- if (am.normal.enable) {
- am.normal.resolve();
- if (am.normal.bo || am.normal.pointer) {
- am.normal.fetch = normal_fct[am.normal.size-3][am.normal.type & 0xF];
- }
- }
-
- if (am.color.enable) {
- am.color.resolve();
- if (c->lighting.enable) {
- if (am.color.bo || am.color.pointer) {
- am.color.fetch = color_fct[am.color.size-3][am.color.type & 0xF];
- }
- } else {
- if (am.color.bo || am.color.pointer) {
- am.color.fetch = color_clamp_fct[am.color.size-3][am.color.type & 0xF];
- }
- }
- }
-
- int activeTmuCount = 0;
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- am.texture[i].fetch = currentTexCoord;
- if (c->rasterizer.state.texture[i].enable) {
-
- // texture fetchers...
- if (am.texture[i].enable) {
- am.texture[i].resolve();
- if (am.texture[i].bo || am.texture[i].pointer) {
- am.texture[i].fetch = texture_fct[am.texture[i].size-2][am.texture[i].type & 0xF];
- }
- }
-
- // texture transform...
- const int index = c->arrays.texture[i].size - 2;
- c->arrays.tex_transform[i] =
- c->transforms.texture[i].transform.pointv[index];
-
- am.tmu = i;
- activeTmuCount++;
- }
- }
-
- // pick the vertex-clipper
- uint32_t clipper = 0;
- // we must reload 'enables' here
- enables = c->rasterizer.state.enables;
- if (enables & GGL_ENABLE_SMOOTH)
- clipper |= 1; // we need to interpolate colors
- if (enables & GGL_ENABLE_TMUS)
- clipper |= 2; // we need to interpolate textures
- switch (clipper) {
- case 0: c->arrays.clipVertex = clipVertex; break;
- case 1: c->arrays.clipVertex = clipVertexC; break;
- case 2: c->arrays.clipVertex = clipVertexT; break;
- case 3: c->arrays.clipVertex = clipVertexAll; break;
- }
- c->arrays.clipEye = clipEye;
-
- // pick the primitive rasterizer
- ogles_validate_primitives(c);
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-using namespace android;
-
-#if 0
-#pragma mark -
-#pragma mark array API
-#endif
-
-void glVertexPointer(
- GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (size<2 || size>4 || stride<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- switch (type) {
- case GL_BYTE:
- case GL_SHORT:
- case GL_FIXED:
- case GL_FLOAT:
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->arrays.vertex.init(size, type, stride, pointer, c->arrays.array_buffer, 0);
-}
-
-void glColorPointer(
- GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (size!=4 || stride<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- switch (type) {
- case GL_UNSIGNED_BYTE:
- case GL_FIXED:
- case GL_FLOAT:
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->arrays.color.init(size, type, stride, pointer, c->arrays.array_buffer, 0);
-}
-
-void glNormalPointer(
- GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (stride<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- switch (type) {
- case GL_BYTE:
- case GL_SHORT:
- case GL_FIXED:
- case GL_FLOAT:
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->arrays.normal.init(3, type, stride, pointer, c->arrays.array_buffer, 0);
-}
-
-void glTexCoordPointer(
- GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (size<2 || size>4 || stride<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- switch (type) {
- case GL_BYTE:
- case GL_SHORT:
- case GL_FIXED:
- case GL_FLOAT:
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- const int tmu = c->arrays.activeTexture;
- c->arrays.texture[tmu].init(size, type, stride, pointer,
- c->arrays.array_buffer, 0);
-}
-
-
-void glEnableClientState(GLenum array) {
- ogles_context_t* c = ogles_context_t::get();
- enableDisableClientState(c, array, true);
-}
-
-void glDisableClientState(GLenum array) {
- ogles_context_t* c = ogles_context_t::get();
- enableDisableClientState(c, array, false);
-}
-
-void glClientActiveTexture(GLenum texture)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (texture<GL_TEXTURE0 || texture>=GL_TEXTURE0+GGL_TEXTURE_UNIT_COUNT) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->arrays.activeTexture = texture - GL_TEXTURE0;
-}
-
-void glDrawArrays(GLenum mode, GLint first, GLsizei count)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (count<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- switch (mode) {
- case GL_POINTS:
- case GL_LINE_STRIP:
- case GL_LINE_LOOP:
- case GL_LINES:
- case GL_TRIANGLE_STRIP:
- case GL_TRIANGLE_FAN:
- case GL_TRIANGLES:
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- if (count == 0 || !c->arrays.vertex.enable)
- return;
- if ((c->cull.enable) && (c->cull.cullFace == GL_FRONT_AND_BACK))
- return; // all triangles are culled
-
-
- validate_arrays(c, mode);
-
- const uint32_t enables = c->rasterizer.state.enables;
- if (enables & GGL_ENABLE_TMUS)
- ogles_lock_textures(c);
-
- drawArraysPrims[mode](c, first, count);
-
- if (enables & GGL_ENABLE_TMUS)
- ogles_unlock_textures(c);
-
-#if VC_CACHE_STATISTICS
- c->vc.total = count;
- c->vc.dump_stats(mode);
-#endif
-}
-
-void glDrawElements(
- GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (count<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- switch (mode) {
- case GL_POINTS:
- case GL_LINE_STRIP:
- case GL_LINE_LOOP:
- case GL_LINES:
- case GL_TRIANGLE_STRIP:
- case GL_TRIANGLE_FAN:
- case GL_TRIANGLES:
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- switch (type) {
- case GL_UNSIGNED_BYTE:
- case GL_UNSIGNED_SHORT:
- c->arrays.indicesType = type;
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (count == 0 || !c->arrays.vertex.enable)
- return;
- if ((c->cull.enable) && (c->cull.cullFace == GL_FRONT_AND_BACK))
- return; // all triangles are culled
-
- // clear the vertex-cache
- c->vc.clear();
- validate_arrays(c, mode);
-
- // if indices are in a buffer object, the pointer is treated as an
- // offset in that buffer.
- if (c->arrays.element_array_buffer) {
- indices = c->arrays.element_array_buffer->data + uintptr_t(indices);
- }
-
- const uint32_t enables = c->rasterizer.state.enables;
- if (enables & GGL_ENABLE_TMUS)
- ogles_lock_textures(c);
-
- drawElementsPrims[mode](c, count, indices);
-
- if (enables & GGL_ENABLE_TMUS)
- ogles_unlock_textures(c);
-
-
-#if VC_CACHE_STATISTICS
- c->vc.total = count;
- c->vc.dump_stats(mode);
-#endif
-}
-
-// ----------------------------------------------------------------------------
-// buffers
-// ----------------------------------------------------------------------------
-
-void glBindBuffer(GLenum target, GLuint buffer)
-{
- ogles_context_t* c = ogles_context_t::get();
- if ((target!=GL_ARRAY_BUFFER) && (target!=GL_ELEMENT_ARRAY_BUFFER)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- // create a buffer object, or bind an existing one
- buffer_t const* bo = 0;
- if (buffer) {
- bo = c->bufferObjectManager->bind(buffer);
- if (!bo) {
- ogles_error(c, GL_OUT_OF_MEMORY);
- return;
- }
- }
- ((target == GL_ARRAY_BUFFER) ?
- c->arrays.array_buffer : c->arrays.element_array_buffer) = bo;
-}
-
-void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
-{
- ogles_context_t* c = ogles_context_t::get();
- if ((target!=GL_ARRAY_BUFFER) && (target!=GL_ELEMENT_ARRAY_BUFFER)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (size<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- if ((usage!=GL_STATIC_DRAW) && (usage!=GL_DYNAMIC_DRAW)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- buffer_t const* bo = ((target == GL_ARRAY_BUFFER) ?
- c->arrays.array_buffer : c->arrays.element_array_buffer);
-
- if (bo == 0) {
- // can't modify buffer 0
- ogles_error(c, GL_INVALID_OPERATION);
- return;
- }
-
- buffer_t* edit_bo = const_cast<buffer_t*>(bo);
- if (c->bufferObjectManager->allocateStore(edit_bo, size, usage) != 0) {
- ogles_error(c, GL_OUT_OF_MEMORY);
- return;
- }
- if (data) {
- memcpy(bo->data, data, size);
- }
-}
-
-void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
-{
- ogles_context_t* c = ogles_context_t::get();
- if ((target!=GL_ARRAY_BUFFER) && (target!=GL_ELEMENT_ARRAY_BUFFER)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (offset<0 || size<0 || data==0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- buffer_t const* bo = ((target == GL_ARRAY_BUFFER) ?
- c->arrays.array_buffer : c->arrays.element_array_buffer);
-
- if (bo == 0) {
- // can't modify buffer 0
- ogles_error(c, GL_INVALID_OPERATION);
- return;
- }
- if (offset+size > bo->size) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- memcpy(bo->data + offset, data, size);
-}
-
-void glDeleteBuffers(GLsizei n, const GLuint* buffers)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (n<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- for (int i=0 ; i<n ; i++) {
- GLuint name = buffers[i];
- if (name) {
- // unbind bound deleted buffers...
- if (c->arrays.element_array_buffer) {
- if (c->arrays.element_array_buffer->name == name) {
- c->arrays.element_array_buffer = 0;
- }
- }
- if (c->arrays.array_buffer) {
- if (c->arrays.array_buffer->name == name) {
- c->arrays.array_buffer = 0;
- }
- }
- if (c->arrays.vertex.bo) {
- if (c->arrays.vertex.bo->name == name) {
- c->arrays.vertex.bo = 0;
- }
- }
- if (c->arrays.normal.bo) {
- if (c->arrays.normal.bo->name == name) {
- c->arrays.normal.bo = 0;
- }
- }
- if (c->arrays.color.bo) {
- if (c->arrays.color.bo->name == name) {
- c->arrays.color.bo = 0;
- }
- }
- for (int t=0 ; t<GGL_TEXTURE_UNIT_COUNT ; t++) {
- if (c->arrays.texture[t].bo) {
- if (c->arrays.texture[t].bo->name == name) {
- c->arrays.texture[t].bo = 0;
- }
- }
- }
- }
- }
- c->bufferObjectManager->deleteBuffers(n, buffers);
- c->bufferObjectManager->recycleTokens(n, buffers);
-}
-
-void glGenBuffers(GLsizei n, GLuint* buffers)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (n<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- c->bufferObjectManager->getToken(n, buffers);
-}
diff --git a/opengl/libagl/array.h b/opengl/libagl/array.h
deleted file mode 100644
index e156978..0000000
--- a/opengl/libagl/array.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* libs/opengles/array.h
-**
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_ARRAY_H
-#define ANDROID_OPENGLES_ARRAY_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-namespace android {
-
-namespace gl {
-struct ogles_context_t;
-};
-
-void ogles_init_array(ogles_context_t* c);
-void ogles_uninit_array(ogles_context_t* c);
-
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_ARRAY_H
-
diff --git a/opengl/libagl/context.h b/opengl/libagl/context.h
deleted file mode 100644
index 7065a30..0000000
--- a/opengl/libagl/context.h
+++ /dev/null
@@ -1,642 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-#ifndef ANDROID_OPENGLES_CONTEXT_H
-#define ANDROID_OPENGLES_CONTEXT_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-#include <pthread.h>
-#ifdef HAVE_ANDROID_OS
-#include <bionic_tls.h>
-#endif
-
-#include <private/pixelflinger/ggl_context.h>
-#include <hardware/gralloc.h>
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-namespace android {
-
-
-const unsigned int OGLES_NUM_COMPRESSED_TEXTURE_FORMATS = 10
-#ifdef GL_OES_compressed_ETC1_RGB8_texture
- + 1
-#endif
- ;
-
-class EGLTextureObject;
-class EGLSurfaceManager;
-class EGLBufferObjectManager;
-
-namespace gl {
-
-struct ogles_context_t;
-struct matrixx_t;
-struct transform_t;
-struct buffer_t;
-
-ogles_context_t* getGlContext();
-
-template<typename T>
-static inline void swap(T& a, T& b) {
- T t(a); a = b; b = t;
-}
-template<typename T>
-inline T max(T a, T b) {
- return a<b ? b : a;
-}
-template<typename T>
-inline T max(T a, T b, T c) {
- return max(a, max(b, c));
-}
-template<typename T>
-inline T min(T a, T b) {
- return a<b ? a : b;
-}
-template<typename T>
-inline T min(T a, T b, T c) {
- return min(a, min(b, c));
-}
-template<typename T>
-inline T min(T a, T b, T c, T d) {
- return min(min(a,b), min(c,d));
-}
-
-// ----------------------------------------------------------------------------
-// vertices
-// ----------------------------------------------------------------------------
-
-struct vec3_t {
- union {
- struct { GLfixed x, y, z; };
- struct { GLfixed r, g, b; };
- struct { GLfixed S, T, R; };
- GLfixed v[3];
- };
-};
-
-struct vec4_t {
- union {
- struct { GLfixed x, y, z, w; };
- struct { GLfixed r, g, b, a; };
- struct { GLfixed S, T, R, Q; };
- GLfixed v[4];
- };
-};
-
-struct vertex_t {
- enum {
- // these constant matter for our clipping
- CLIP_L = 0x0001, // clipping flags
- CLIP_R = 0x0002,
- CLIP_B = 0x0004,
- CLIP_T = 0x0008,
- CLIP_N = 0x0010,
- CLIP_F = 0x0020,
-
- EYE = 0x0040,
- RESERVED = 0x0080,
-
- USER_CLIP_0 = 0x0100, // user clipping flags
- USER_CLIP_1 = 0x0200,
- USER_CLIP_2 = 0x0400,
- USER_CLIP_3 = 0x0800,
- USER_CLIP_4 = 0x1000,
- USER_CLIP_5 = 0x2000,
-
- LIT = 0x4000, // lighting has been applied
- TT = 0x8000, // texture coords transformed
-
- FRUSTUM_CLIP_ALL= 0x003F,
- USER_CLIP_ALL = 0x3F00,
- CLIP_ALL = 0x3F3F,
- };
-
- // the fields below are arranged to minimize d-cache usage
- // we group together, by cache-line, the fields most likely to be used
-
- union {
- vec4_t obj;
- vec4_t eye;
- };
- vec4_t clip;
-
- uint32_t flags;
- size_t index; // cache tag, and vertex index
- GLfixed fog;
- uint8_t locked;
- uint8_t mru;
- uint8_t reserved[2];
- vec4_t window;
-
- vec4_t color;
- vec4_t texture[GGL_TEXTURE_UNIT_COUNT];
- uint32_t reserved1[4];
-
- inline void clear() {
- flags = index = locked = mru = 0;
- }
-};
-
-struct point_size_t {
- GGLcoord size;
- GLboolean smooth;
-};
-
-struct line_width_t {
- GGLcoord width;
- GLboolean smooth;
-};
-
-struct polygon_offset_t {
- GLfixed factor;
- GLfixed units;
- GLboolean enable;
-};
-
-// ----------------------------------------------------------------------------
-// arrays
-// ----------------------------------------------------------------------------
-
-struct array_t {
- typedef void (*fetcher_t)(ogles_context_t*, GLfixed*, const GLvoid*);
- fetcher_t fetch;
- GLvoid const* physical_pointer;
- GLint size;
- GLsizei stride;
- GLvoid const* pointer;
- buffer_t const* bo;
- uint16_t type;
- GLboolean enable;
- GLboolean pad;
- GLsizei bounds;
- void init(GLint, GLenum, GLsizei, const GLvoid *, const buffer_t*, GLsizei);
- inline void resolve();
- inline const GLubyte* element(GLint i) const {
- return (const GLubyte*)physical_pointer + i * stride;
- }
-};
-
-struct array_machine_t {
- array_t vertex;
- array_t normal;
- array_t color;
- array_t texture[GGL_TEXTURE_UNIT_COUNT];
- uint8_t activeTexture;
- uint8_t tmu;
- uint16_t cull;
- uint32_t flags;
- GLenum indicesType;
- buffer_t const* array_buffer;
- buffer_t const* element_array_buffer;
-
- void (*compileElements)(ogles_context_t*, vertex_t*, GLint, GLsizei);
- void (*compileElement)(ogles_context_t*, vertex_t*, GLint);
-
- void (*mvp_transform)(transform_t const*, vec4_t*, vec4_t const*);
- void (*mv_transform)(transform_t const*, vec4_t*, vec4_t const*);
- void (*tex_transform[2])(transform_t const*, vec4_t*, vec4_t const*);
- void (*perspective)(ogles_context_t*c, vertex_t* v);
- void (*clipVertex)(ogles_context_t* c, vertex_t* nv,
- GGLfixed t, const vertex_t* s, const vertex_t* p);
- void (*clipEye)(ogles_context_t* c, vertex_t* nv,
- GGLfixed t, const vertex_t* s, const vertex_t* p);
-};
-
-struct vertex_cache_t {
- enum {
- // must be at least 4
- // 3 vertice for triangles
- // or 2 + 2 for indexed triangles w/ cache contention
- VERTEX_BUFFER_SIZE = 8,
- // must be a power of two and at least 3
- VERTEX_CACHE_SIZE = 64, // 8 KB
-
- INDEX_BITS = 16,
- INDEX_MASK = ((1LU<<INDEX_BITS)-1),
- INDEX_SEQ = 1LU<<INDEX_BITS,
- };
- vertex_t* vBuffer;
- vertex_t* vCache;
- uint32_t sequence;
- void* base;
- uint32_t total;
- uint32_t misses;
- int64_t startTime;
- void init();
- void uninit();
- void clear();
- void dump_stats(GLenum mode);
-};
-
-// ----------------------------------------------------------------------------
-// fog
-// ----------------------------------------------------------------------------
-
-struct fog_t {
- GLfixed density;
- GLfixed start;
- GLfixed end;
- GLfixed invEndMinusStart;
- GLenum mode;
- GLfixed (*fog)(ogles_context_t* c, GLfixed z);
-};
-
-// ----------------------------------------------------------------------------
-// user clip planes
-// ----------------------------------------------------------------------------
-
-const unsigned int OGLES_MAX_CLIP_PLANES = 6;
-
-struct clip_plane_t {
- vec4_t equation;
-};
-
-struct user_clip_planes_t {
- clip_plane_t plane[OGLES_MAX_CLIP_PLANES];
- uint32_t enable;
-};
-
-// ----------------------------------------------------------------------------
-// lighting
-// ----------------------------------------------------------------------------
-
-const unsigned int OGLES_MAX_LIGHTS = 8;
-
-struct light_t {
- vec4_t ambient;
- vec4_t diffuse;
- vec4_t specular;
- vec4_t implicitAmbient;
- vec4_t implicitDiffuse;
- vec4_t implicitSpecular;
- vec4_t position; // position in eye space
- vec4_t objPosition;
- vec4_t normalizedObjPosition;
- vec4_t spotDir;
- vec4_t normalizedSpotDir;
- GLfixed spotExp;
- GLfixed spotCutoff;
- GLfixed spotCutoffCosine;
- GLfixed attenuation[3];
- GLfixed rConstAttenuation;
- GLboolean enable;
-};
-
-struct material_t {
- vec4_t ambient;
- vec4_t diffuse;
- vec4_t specular;
- vec4_t emission;
- GLfixed shininess;
-};
-
-struct light_model_t {
- vec4_t ambient;
- GLboolean twoSide;
-};
-
-struct color_material_t {
- GLenum face;
- GLenum mode;
- GLboolean enable;
-};
-
-struct lighting_t {
- light_t lights[OGLES_MAX_LIGHTS];
- material_t front;
- light_model_t lightModel;
- color_material_t colorMaterial;
- vec4_t implicitSceneEmissionAndAmbient;
- vec4_t objViewer;
- uint32_t enabledLights;
- GLboolean enable;
- GLenum shadeModel;
- typedef void (*light_fct_t)(ogles_context_t*, vertex_t*);
- void (*lightVertex)(ogles_context_t* c, vertex_t* v);
- void (*lightTriangle)(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2);
-};
-
-struct culling_t {
- GLenum cullFace;
- GLenum frontFace;
- GLboolean enable;
-};
-
-// ----------------------------------------------------------------------------
-// textures
-// ----------------------------------------------------------------------------
-
-struct texture_unit_t {
- GLuint name;
- EGLTextureObject* texture;
- uint8_t dirty;
-};
-
-struct texture_state_t
-{
- texture_unit_t tmu[GGL_TEXTURE_UNIT_COUNT];
- int active; // active tmu
- EGLTextureObject* defaultTexture;
- GGLContext* ggl;
- uint8_t packAlignment;
- uint8_t unpackAlignment;
-};
-
-// ----------------------------------------------------------------------------
-// transformation and matrices
-// ----------------------------------------------------------------------------
-
-struct matrixf_t;
-
-struct matrixx_t {
- GLfixed m[16];
- void load(const matrixf_t& rhs);
-};
-
-struct matrix_stack_t;
-
-
-struct matrixf_t {
- void loadIdentity();
- void load(const matrixf_t& rhs);
-
- inline GLfloat* editElements() { return m; }
- inline GLfloat const* elements() const { return m; }
-
- void set(const GLfixed* rhs);
- void set(const GLfloat* rhs);
-
- static void multiply(matrixf_t& r,
- const matrixf_t& lhs, const matrixf_t& rhs);
-
- void dump(const char* what);
-
-private:
- friend struct matrix_stack_t;
- GLfloat m[16];
- void load(const GLfixed* rhs);
- void load(const GLfloat* rhs);
- void multiply(const matrixf_t& rhs);
- void translate(GLfloat x, GLfloat y, GLfloat z);
- void scale(GLfloat x, GLfloat y, GLfloat z);
- void rotate(GLfloat a, GLfloat x, GLfloat y, GLfloat z);
-};
-
-enum {
- OP_IDENTITY = 0x00,
- OP_TRANSLATE = 0x01,
- OP_UNIFORM_SCALE = 0x02,
- OP_SCALE = 0x05,
- OP_ROTATE = 0x08,
- OP_SKEW = 0x10,
- OP_ALL = 0x1F
-};
-
-struct transform_t {
- enum {
- FLAGS_2D_PROJECTION = 0x1
- };
- matrixx_t matrix;
- uint32_t flags;
- uint32_t ops;
-
- union {
- struct {
- void (*point2)(transform_t const* t, vec4_t*, vec4_t const*);
- void (*point3)(transform_t const* t, vec4_t*, vec4_t const*);
- void (*point4)(transform_t const* t, vec4_t*, vec4_t const*);
- };
- void (*pointv[3])(transform_t const* t, vec4_t*, vec4_t const*);
- };
-
- void loadIdentity();
- void picker();
- void dump(const char* what);
-};
-
-struct mvui_transform_t : public transform_t
-{
- void picker();
-};
-
-struct matrix_stack_t {
- enum {
- DO_PICKER = 0x1,
- DO_FLOAT_TO_FIXED = 0x2
- };
- transform_t transform;
- uint8_t maxDepth;
- uint8_t depth;
- uint8_t dirty;
- uint8_t reserved;
- matrixf_t *stack;
- uint8_t *ops;
- void init(int depth);
- void uninit();
- void loadIdentity();
- void load(const GLfixed* rhs);
- void load(const GLfloat* rhs);
- void multiply(const matrixf_t& rhs);
- void translate(GLfloat x, GLfloat y, GLfloat z);
- void scale(GLfloat x, GLfloat y, GLfloat z);
- void rotate(GLfloat a, GLfloat x, GLfloat y, GLfloat z);
- GLint push();
- GLint pop();
- void validate();
- matrixf_t& top() { return stack[depth]; }
- const matrixf_t& top() const { return stack[depth]; }
- uint32_t top_ops() const { return ops[depth]; }
- inline bool isRigidBody() const {
- return !(ops[depth] & ~(OP_TRANSLATE|OP_UNIFORM_SCALE|OP_ROTATE));
- }
-};
-
-struct vp_transform_t {
- transform_t transform;
- matrixf_t matrix;
- GLfloat zNear;
- GLfloat zFar;
- void loadIdentity();
-};
-
-struct transform_state_t {
- enum {
- MODELVIEW = 0x01,
- PROJECTION = 0x02,
- VIEWPORT = 0x04,
- TEXTURE = 0x08,
- MVUI = 0x10,
- MVIT = 0x20,
- MVP = 0x40,
- };
- matrix_stack_t *current;
- matrix_stack_t modelview;
- matrix_stack_t projection;
- matrix_stack_t texture[GGL_TEXTURE_UNIT_COUNT];
-
- // modelview * projection
- transform_t mvp __attribute__((aligned(32)));
- // viewport transformation
- vp_transform_t vpt __attribute__((aligned(32)));
- // same for 4-D vertices
- transform_t mvp4;
- // full modelview inverse transpose
- transform_t mvit4;
- // upper 3x3 of mv-inverse-transpose (for normals)
- mvui_transform_t mvui;
-
- GLenum matrixMode;
- GLenum rescaleNormals;
- uint32_t dirty;
- void invalidate();
- void update_mvp();
- void update_mvit();
- void update_mvui();
-};
-
-struct viewport_t {
- GLint x;
- GLint y;
- GLsizei w;
- GLsizei h;
- struct {
- GLint x;
- GLint y;
- } surfaceport;
- struct {
- GLint x;
- GLint y;
- GLsizei w;
- GLsizei h;
- } scissor;
-};
-
-// ----------------------------------------------------------------------------
-// Lerping
-// ----------------------------------------------------------------------------
-
-struct compute_iterators_t
-{
- void initTriangle(
- vertex_t const* v0,
- vertex_t const* v1,
- vertex_t const* v2);
-
- void initLine(
- vertex_t const* v0,
- vertex_t const* v1);
-
- inline void initLerp(vertex_t const* v0, uint32_t enables);
-
- int iteratorsScale(int32_t it[3],
- int32_t c0, int32_t c1, int32_t c2) const;
-
- void iterators1616(GGLfixed it[3],
- GGLfixed c0, GGLfixed c1, GGLfixed c2) const;
-
- void iterators0032(int32_t it[3],
- int32_t c0, int32_t c1, int32_t c2) const;
-
- void iterators0032(int64_t it[3],
- int32_t c0, int32_t c1, int32_t c2) const;
-
- GGLcoord area() const { return m_area; }
-
-private:
- // don't change order of members here -- used by iterators.S
- GGLcoord m_dx01, m_dy10, m_dx20, m_dy02;
- GGLcoord m_x0, m_y0;
- GGLcoord m_area;
- uint8_t m_scale;
- uint8_t m_area_scale;
- uint8_t m_reserved[2];
-
-};
-
-// ----------------------------------------------------------------------------
-// state
-// ----------------------------------------------------------------------------
-
-#ifdef HAVE_ANDROID_OS
- // We have a dedicated TLS slot in bionic
- inline void setGlThreadSpecific(ogles_context_t *value) {
- ((uint32_t *)__get_tls())[TLS_SLOT_OPENGL] = (uint32_t)value;
- }
- inline ogles_context_t* getGlThreadSpecific() {
- return (ogles_context_t *)(((unsigned *)__get_tls())[TLS_SLOT_OPENGL]);
- }
-#else
- extern pthread_key_t gGLKey;
- inline void setGlThreadSpecific(ogles_context_t *value) {
- pthread_setspecific(gGLKey, value);
- }
- inline ogles_context_t* getGlThreadSpecific() {
- return static_cast<ogles_context_t*>(pthread_getspecific(gGLKey));
- }
-#endif
-
-
-struct prims_t {
- typedef ogles_context_t* GL;
- void (*renderPoint)(GL, vertex_t*);
- void (*renderLine)(GL, vertex_t*, vertex_t*);
- void (*renderTriangle)(GL, vertex_t*, vertex_t*, vertex_t*);
-};
-
-struct ogles_context_t {
- context_t rasterizer;
- array_machine_t arrays __attribute__((aligned(32)));
- texture_state_t textures;
- transform_state_t transforms;
- vertex_cache_t vc;
- prims_t prims;
- culling_t cull;
- lighting_t lighting;
- user_clip_planes_t clipPlanes;
- compute_iterators_t lerp; __attribute__((aligned(32)));
- vertex_t current;
- vec4_t currentColorClamped;
- vec3_t currentNormal;
- viewport_t viewport;
- point_size_t point;
- line_width_t line;
- polygon_offset_t polygonOffset;
- fog_t fog;
- uint32_t perspective : 1;
- uint32_t transformTextures : 1;
- EGLSurfaceManager* surfaceManager;
- EGLBufferObjectManager* bufferObjectManager;
-
- GLenum error;
-
- static inline ogles_context_t* get() {
- return getGlThreadSpecific();
- }
-
-};
-
-}; // namespace gl
-}; // namespace android
-
-using namespace android::gl;
-
-#endif // ANDROID_OPENGLES_CONTEXT_H
-
diff --git a/opengl/libagl/dxt.cpp b/opengl/libagl/dxt.cpp
deleted file mode 100644
index 238c81f..0000000
--- a/opengl/libagl/dxt.cpp
+++ /dev/null
@@ -1,636 +0,0 @@
-/* libs/opengles/dxt.cpp
-**
-** Copyright 2007, 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.
-*/
-
-#define TIMING 0
-
-#if TIMING
-#include <sys/time.h> // for optimization timing
-#include <stdio.h>
-#include <stdlib.h>
-#endif
-
-#include <GLES/gl.h>
-#include <utils/Endian.h>
-
-#include "context.h"
-
-#define TIMING 0
-
-namespace android {
-
-static uint8_t avg23tab[64*64];
-static volatile int tables_initialized = 0;
-
-// Definitions below are equivalent to these over the valid range of arguments
-// #define div5(x) ((x)/5)
-// #define div7(x) ((x)/7)
-
-// Use fixed-point to divide by 5 and 7
-// 3277 = 2^14/5 + 1
-// 2341 = 2^14/7 + 1
-#define div5(x) (((x)*3277) >> 14)
-#define div7(x) (((x)*2341) >> 14)
-
-// Table with entry [a << 6 | b] = (2*a + b)/3 for 0 <= a,b < 64
-#define avg23(x0,x1) avg23tab[((x0) << 6) | (x1)]
-
-// Extract 5/6/5 RGB
-#define red(x) (((x) >> 11) & 0x1f)
-#define green(x) (((x) >> 5) & 0x3f)
-#define blue(x) ( (x) & 0x1f)
-
-/*
- * Convert 5/6/5 RGB (as 3 ints) to 8/8/8
- *
- * Operation count: 8 <<, 0 &, 5 |
- */
-inline static int rgb565SepTo888(int r, int g, int b)
-
-{
- return ((((r << 3) | (r >> 2)) << 16) |
- (((g << 2) | (g >> 4)) << 8) |
- ((b << 3) | (b >> 2)));
-}
-
-/*
- * Convert 5/6/5 RGB (as a single 16-bit word) to 8/8/8
- *
- * r4r3r2r1 r0g5g4g3 g2g1g0b4 b3b2b1b0 rgb
- * r4r3r2 r1r0g5g4 g3g2g1g0 b4b3b2b1 b0 0 0 0 rgb << 3
- * r4r3r2r1 r0r4r3r2 g5g4g3g2 g1g0g5g4 b4b3b2b1 b0b4b3b2 desired result
- *
- * Construct the 24-bit RGB word as:
- *
- * r4r3r2r1 r0------ -------- -------- -------- -------- (rgb << 8) & 0xf80000
- * r4r3r2 -------- -------- -------- -------- (rgb << 3) & 0x070000
- * g5g4g3g2 g1g0---- -------- -------- (rgb << 5) & 0x00fc00
- * g5g4 -------- -------- (rgb >> 1) & 0x000300
- * b4b3b2b1 b0------ (rgb << 3) & 0x0000f8
- * b4b3b2 (rgb >> 2) & 0x000007
- *
- * Operation count: 5 <<, 6 &, 5 | (n.b. rgb >> 3 is used twice)
- */
-inline static int rgb565To888(int rgb)
-
-{
- int rgb3 = rgb >> 3;
- return (((rgb << 8) & 0xf80000) |
- ( rgb3 & 0x070000) |
- ((rgb << 5) & 0x00fc00) |
- ((rgb >> 1) & 0x000300) |
- ( rgb3 & 0x0000f8) |
- ((rgb >> 2) & 0x000007));
-}
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-static uint32_t swap(uint32_t x) {
- int b0 = (x >> 24) & 0xff;
- int b1 = (x >> 16) & 0xff;
- int b2 = (x >> 8) & 0xff;
- int b3 = (x ) & 0xff;
-
- return (uint32_t)((b3 << 24) | (b2 << 16) | (b1 << 8) | b0);
-}
-#endif
-
-static void
-init_tables()
-{
- if (tables_initialized) {
- return;
- }
-
- for (int i = 0; i < 64; i++) {
- for (int j = 0; j < 64; j++) {
- int avg = (2*i + j)/3;
- avg23tab[(i << 6) | j] = avg;
- }
- }
-
- asm volatile ("" : : : "memory");
- tables_initialized = 1;
-}
-
-/*
- * Utility to scan a DXT1 compressed texture to determine whether it
- * contains a transparent pixel (color0 < color1, code == 3). This
- * may be useful if the application lacks information as to whether
- * the true format is GL_COMPRESSED_RGB_S3TC_DXT1_EXT or
- * GL_COMPRESSED_RGBA_S3TC_DXT1_EXT.
- */
-bool
-DXT1HasAlpha(const GLvoid *data, int width, int height) {
-#if TIMING
- struct timeval start_t, end_t;
- struct timezone tz;
-
- gettimeofday(&start_t, &tz);
-#endif
-
- bool hasAlpha = false;
-
- int xblocks = (width + 3)/4;
- int yblocks = (height + 3)/4;
- int numblocks = xblocks*yblocks;
-
- uint32_t const *d32 = (uint32_t *)data;
- for (int b = 0; b < numblocks; b++) {
- uint32_t colors = *d32++;
-
-#if __BYTE_ORDER == __BIG_ENDIAN
- colors = swap(colors);
-#endif
-
- uint16_t color0 = colors & 0xffff;
- uint16_t color1 = colors >> 16;
-
- if (color0 < color1) {
- // There's no need to endian-swap within 'bits'
- // since we don't care which pixel is the transparent one
- uint32_t bits = *d32++;
-
- // Detect if any (odd, even) pair of bits are '11'
- // bits: b31 b30 b29 ... b3 b2 b1 b0
- // bits >> 1: b31 b31 b30 ... b4 b3 b2 b1
- // &: b31 (b31 & b30) (b29 & b28) ... (b2 & b1) (b1 & b0)
- // & 0x55..: 0 (b31 & b30) 0 ... 0 (b1 & b0)
- if (((bits & (bits >> 1)) & 0x55555555) != 0) {
- hasAlpha = true;
- goto done;
- }
- } else {
- // Skip 4 bytes
- ++d32;
- }
- }
-
- done:
-#if TIMING
- gettimeofday(&end_t, &tz);
- long usec = (end_t.tv_sec - start_t.tv_sec)*1000000 +
- (end_t.tv_usec - start_t.tv_usec);
-
- printf("Scanned w=%d h=%d in %ld usec\n", width, height, usec);
-#endif
-
- return hasAlpha;
-}
-
-static void
-decodeDXT1(const GLvoid *data, int width, int height,
- void *surface, int stride,
- bool hasAlpha)
-
-{
- init_tables();
-
- uint32_t const *d32 = (uint32_t *)data;
-
- // Color table for the current block
- uint16_t c[4];
- c[0] = c[1] = c[2] = c[3] = 0;
-
- // Specified colors from the previous block
- uint16_t prev_color0 = 0x0000;
- uint16_t prev_color1 = 0x0000;
-
- uint16_t* rowPtr = (uint16_t*)surface;
- for (int base_y = 0; base_y < height; base_y += 4, rowPtr += 4*stride) {
- uint16_t *blockPtr = rowPtr;
- for (int base_x = 0; base_x < width; base_x += 4, blockPtr += 4) {
- uint32_t colors = *d32++;
- uint32_t bits = *d32++;
-
-#if __BYTE_ORDER == __BIG_ENDIAN
- colors = swap(colors);
- bits = swap(bits);
-#endif
-
- // Raw colors
- uint16_t color0 = colors & 0xffff;
- uint16_t color1 = colors >> 16;
-
- // If the new block has the same base colors as the
- // previous one, we don't need to recompute the color
- // table c[]
- if (color0 != prev_color0 || color1 != prev_color1) {
- // Store raw colors for comparison with next block
- prev_color0 = color0;
- prev_color1 = color1;
-
- int r0 = red(color0);
- int g0 = green(color0);
- int b0 = blue(color0);
-
- int r1 = red(color1);
- int g1 = green(color1);
- int b1 = blue(color1);
-
- if (hasAlpha) {
- c[0] = (r0 << 11) | ((g0 >> 1) << 6) | (b0 << 1) | 0x1;
- c[1] = (r1 << 11) | ((g1 >> 1) << 6) | (b1 << 1) | 0x1;
- } else {
- c[0] = color0;
- c[1] = color1;
- }
-
- int r2, g2, b2, r3, g3, b3, a3;
-
- int bbits = bits >> 1;
- bool has2 = ((bbits & ~bits) & 0x55555555) != 0;
- bool has3 = ((bbits & bits) & 0x55555555) != 0;
-
- if (has2 || has3) {
- if (color0 > color1) {
- r2 = avg23(r0, r1);
- g2 = avg23(g0, g1);
- b2 = avg23(b0, b1);
-
- r3 = avg23(r1, r0);
- g3 = avg23(g1, g0);
- b3 = avg23(b1, b0);
- a3 = 1;
- } else {
- r2 = (r0 + r1) >> 1;
- g2 = (g0 + g1) >> 1;
- b2 = (b0 + b1) >> 1;
-
- r3 = g3 = b3 = a3 = 0;
- }
- if (hasAlpha) {
- c[2] = (r2 << 11) | ((g2 >> 1) << 6) |
- (b2 << 1) | 0x1;
- c[3] = (r3 << 11) | ((g3 >> 1) << 6) |
- (b3 << 1) | a3;
- } else {
- c[2] = (r2 << 11) | (g2 << 5) | b2;
- c[3] = (r3 << 11) | (g3 << 5) | b3;
- }
- }
- }
-
- uint16_t* blockRowPtr = blockPtr;
- for (int y = 0; y < 4; y++, blockRowPtr += stride) {
- // Don't process rows past the botom
- if (base_y + y >= height) {
- break;
- }
-
- int w = min(width - base_x, 4);
- for (int x = 0; x < w; x++) {
- int code = bits & 0x3;
- bits >>= 2;
-
- blockRowPtr[x] = c[code];
- }
- }
- }
- }
-}
-
-// Output data as internalformat=GL_RGBA, type=GL_UNSIGNED_BYTE
-static void
-decodeDXT3(const GLvoid *data, int width, int height,
- void *surface, int stride)
-
-{
- init_tables();
-
- uint32_t const *d32 = (uint32_t *)data;
-
- // Specified colors from the previous block
- uint16_t prev_color0 = 0x0000;
- uint16_t prev_color1 = 0x0000;
-
- // Color table for the current block
- uint32_t c[4];
- c[0] = c[1] = c[2] = c[3] = 0;
-
- uint32_t* rowPtr = (uint32_t*)surface;
- for (int base_y = 0; base_y < height; base_y += 4, rowPtr += 4*stride) {
- uint32_t *blockPtr = rowPtr;
- for (int base_x = 0; base_x < width; base_x += 4, blockPtr += 4) {
-
-#if __BYTE_ORDER == __BIG_ENDIAN
- uint32_t alphahi = *d32++;
- uint32_t alphalo = *d32++;
- alphahi = swap(alphahi);
- alphalo = swap(alphalo);
-#else
- uint32_t alphalo = *d32++;
- uint32_t alphahi = *d32++;
-#endif
-
- uint32_t colors = *d32++;
- uint32_t bits = *d32++;
-
-#if __BYTE_ORDER == __BIG_ENDIAN
- colors = swap(colors);
- bits = swap(bits);
-#endif
-
- uint64_t alpha = ((uint64_t)alphahi << 32) | alphalo;
-
- // Raw colors
- uint16_t color0 = colors & 0xffff;
- uint16_t color1 = colors >> 16;
-
- // If the new block has the same base colors as the
- // previous one, we don't need to recompute the color
- // table c[]
- if (color0 != prev_color0 || color1 != prev_color1) {
- // Store raw colors for comparison with next block
- prev_color0 = color0;
- prev_color1 = color1;
-
- int bbits = bits >> 1;
- bool has2 = ((bbits & ~bits) & 0x55555555) != 0;
- bool has3 = ((bbits & bits) & 0x55555555) != 0;
-
- if (has2 || has3) {
- int r0 = red(color0);
- int g0 = green(color0);
- int b0 = blue(color0);
-
- int r1 = red(color1);
- int g1 = green(color1);
- int b1 = blue(color1);
-
- int r2 = avg23(r0, r1);
- int g2 = avg23(g0, g1);
- int b2 = avg23(b0, b1);
-
- int r3 = avg23(r1, r0);
- int g3 = avg23(g1, g0);
- int b3 = avg23(b1, b0);
-
- c[0] = rgb565SepTo888(r0, g0, b0);
- c[1] = rgb565SepTo888(r1, g1, b1);
- c[2] = rgb565SepTo888(r2, g2, b2);
- c[3] = rgb565SepTo888(r3, g3, b3);
- } else {
- // Convert to 8 bits
- c[0] = rgb565To888(color0);
- c[1] = rgb565To888(color1);
- }
- }
-
- uint32_t* blockRowPtr = blockPtr;
- for (int y = 0; y < 4; y++, blockRowPtr += stride) {
- // Don't process rows past the botom
- if (base_y + y >= height) {
- break;
- }
-
- int w = min(width - base_x, 4);
- for (int x = 0; x < w; x++) {
- int a = alpha & 0xf;
- alpha >>= 4;
-
- int code = bits & 0x3;
- bits >>= 2;
-
- blockRowPtr[x] = c[code] | (a << 28) | (a << 24);
- }
- }
- }
- }
-}
-
-// Output data as internalformat=GL_RGBA, type=GL_UNSIGNED_BYTE
-static void
-decodeDXT5(const GLvoid *data, int width, int height,
- void *surface, int stride)
-
-{
- init_tables();
-
- uint32_t const *d32 = (uint32_t *)data;
-
- // Specified alphas from the previous block
- uint8_t prev_alpha0 = 0x00;
- uint8_t prev_alpha1 = 0x00;
-
- // Specified colors from the previous block
- uint16_t prev_color0 = 0x0000;
- uint16_t prev_color1 = 0x0000;
-
- // Alpha table for the current block
- uint8_t a[8];
- a[0] = a[1] = a[2] = a[3] = a[4] = a[5] = a[6] = a[7] = 0;
-
- // Color table for the current block
- uint32_t c[4];
- c[0] = c[1] = c[2] = c[3] = 0;
-
- int good_a5 = 0;
- int bad_a5 = 0;
- int good_a6 = 0;
- int bad_a6 = 0;
- int good_a7 = 0;
- int bad_a7 = 0;
-
- uint32_t* rowPtr = (uint32_t*)surface;
- for (int base_y = 0; base_y < height; base_y += 4, rowPtr += 4*stride) {
- uint32_t *blockPtr = rowPtr;
- for (int base_x = 0; base_x < width; base_x += 4, blockPtr += 4) {
-
-#if __BYTE_ORDER == __BIG_ENDIAN
- uint32_t alphahi = *d32++;
- uint32_t alphalo = *d32++;
- alphahi = swap(alphahi);
- alphalo = swap(alphalo);
-#else
- uint32_t alphalo = *d32++;
- uint32_t alphahi = *d32++;
-#endif
-
- uint32_t colors = *d32++;
- uint32_t bits = *d32++;
-
-#if __BYTE_ORDER == __BIG_ENDIANx
- colors = swap(colors);
- bits = swap(bits);
-#endif
-
- uint64_t alpha = ((uint64_t)alphahi << 32) | alphalo;
- uint64_t alpha0 = alpha & 0xff;
- alpha >>= 8;
- uint64_t alpha1 = alpha & 0xff;
- alpha >>= 8;
-
- if (alpha0 != prev_alpha0 || alpha1 != prev_alpha1) {
- prev_alpha0 = alpha0;
- prev_alpha1 = alpha1;
-
- a[0] = alpha0;
- a[1] = alpha1;
- int a01 = alpha0 + alpha1 - 1;
- if (alpha0 > alpha1) {
- a[2] = div7(6*alpha0 + alpha1);
- a[4] = div7(4*alpha0 + 3*alpha1);
- a[6] = div7(2*alpha0 + 5*alpha1);
-
- // Use symmetry to derive half of the values
- // A few values will be off by 1 (~.5%)
- // Alternate which values are computed directly
- // and which are derived to try to reduce bias
- a[3] = a01 - a[6];
- a[5] = a01 - a[4];
- a[7] = a01 - a[2];
- } else {
- a[2] = div5(4*alpha0 + alpha1);
- a[4] = div5(2*alpha0 + 3*alpha1);
- a[3] = a01 - a[4];
- a[5] = a01 - a[2];
- a[6] = 0x00;
- a[7] = 0xff;
- }
- }
-
- // Raw colors
- uint16_t color0 = colors & 0xffff;
- uint16_t color1 = colors >> 16;
-
- // If the new block has the same base colors as the
- // previous one, we don't need to recompute the color
- // table c[]
- if (color0 != prev_color0 || color1 != prev_color1) {
- // Store raw colors for comparison with next block
- prev_color0 = color0;
- prev_color1 = color1;
-
- int bbits = bits >> 1;
- bool has2 = ((bbits & ~bits) & 0x55555555) != 0;
- bool has3 = ((bbits & bits) & 0x55555555) != 0;
-
- if (has2 || has3) {
- int r0 = red(color0);
- int g0 = green(color0);
- int b0 = blue(color0);
-
- int r1 = red(color1);
- int g1 = green(color1);
- int b1 = blue(color1);
-
- int r2 = avg23(r0, r1);
- int g2 = avg23(g0, g1);
- int b2 = avg23(b0, b1);
-
- int r3 = avg23(r1, r0);
- int g3 = avg23(g1, g0);
- int b3 = avg23(b1, b0);
-
- c[0] = rgb565SepTo888(r0, g0, b0);
- c[1] = rgb565SepTo888(r1, g1, b1);
- c[2] = rgb565SepTo888(r2, g2, b2);
- c[3] = rgb565SepTo888(r3, g3, b3);
- } else {
- // Convert to 8 bits
- c[0] = rgb565To888(color0);
- c[1] = rgb565To888(color1);
- }
- }
-
- uint32_t* blockRowPtr = blockPtr;
- for (int y = 0; y < 4; y++, blockRowPtr += stride) {
- // Don't process rows past the botom
- if (base_y + y >= height) {
- break;
- }
-
- int w = min(width - base_x, 4);
- for (int x = 0; x < w; x++) {
- int acode = alpha & 0x7;
- alpha >>= 3;
-
- int code = bits & 0x3;
- bits >>= 2;
-
- blockRowPtr[x] = c[code] | (a[acode] << 24);
- }
- }
- }
- }
-}
-
-/*
- * Decode a DXT-compressed texture into memory. DXT textures consist of
- * a series of 4x4 pixel blocks in left-to-right, top-down order.
- * The number of blocks is given by ceil(width/4)*ceil(height/4).
- *
- * 'data' points to the texture data. 'width' and 'height' indicate the
- * dimensions of the texture. We assume width and height are >= 0 but
- * do not require them to be powers of 2 or divisible by any factor.
- *
- * The output is written to 'surface' with each scanline separated by
- * 'stride' 2- or 4-byte words.
- *
- * 'format' indicates the type of compression and must be one of the following:
- *
- * GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- * The output is written as 5/6/5 opaque RGB (16 bit words).
- * 8 bytes are read from 'data' for each block.
- *
- * GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
- * The output is written as 5/5/5/1 RGBA (16 bit words)
- * 8 bytes are read from 'data' for each block.
- *
- * GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
- * GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
- * The output is written as 8/8/8/8 ARGB (32 bit words)
- * 16 bytes are read from 'data' for each block.
- */
-void
-decodeDXT(const GLvoid *data, int width, int height,
- void *surface, int stride, int format)
-{
-#if TIMING
- struct timeval start_t, end_t;
- struct timezone tz;
-
- gettimeofday(&start_t, &tz);
-#endif
-
- switch (format) {
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- decodeDXT1(data, width, height, surface, stride, false);
- break;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- decodeDXT1(data, width, height, surface, stride, true);
- break;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- decodeDXT3(data, width, height, surface, stride);
- break;
-
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- decodeDXT5(data, width, height, surface, stride);
- break;
- }
-
-#if TIMING
- gettimeofday(&end_t, &tz);
- long usec = (end_t.tv_sec - start_t.tv_sec)*1000000 +
- (end_t.tv_usec - start_t.tv_usec);
-
- printf("Loaded w=%d h=%d in %ld usec\n", width, height, usec);
-#endif
-}
-
-} // namespace android
diff --git a/opengl/libagl/dxt.h b/opengl/libagl/dxt.h
deleted file mode 100644
index d95a36c..0000000
--- a/opengl/libagl/dxt.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* libs/opengles/dxt.h
-**
-** Copyright 2007, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_TEXTURE_H
-#define ANDROID_OPENGLES_TEXTURE_H
-
-#include <stdlib.h>
-
-#include <GLES/gl.h>
-
-namespace android {
-
- bool DXT1HasAlpha(const GLvoid *data, int width, int height);
- void decodeDXT(const GLvoid *data, int width, int height,
- void *surface, int stride, int format);
-
-} // namespace android
-
-#endif // ANDROID_OPENGLES_TEXTURE_H
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
deleted file mode 100644
index 92d32a2..0000000
--- a/opengl/libagl/egl.cpp
+++ /dev/null
@@ -1,2079 +0,0 @@
-/*
-**
-** Copyright 2007 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.
-*/
-
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-
-#include <cutils/log.h>
-#include <cutils/atomic.h>
-
-#include <utils/threads.h>
-#include <ui/ANativeObjectBase.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <pixelflinger/format.h>
-#include <pixelflinger/pixelflinger.h>
-
-#include "context.h"
-#include "state.h"
-#include "texture.h"
-#include "matrix.h"
-
-#undef NELEM
-#define NELEM(x) (sizeof(x)/sizeof(*(x)))
-
-// ----------------------------------------------------------------------------
-
-EGLBoolean EGLAPI eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw,
- EGLint left, EGLint top, EGLint width, EGLint height);
-
-// ----------------------------------------------------------------------------
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-const unsigned int NUM_DISPLAYS = 1;
-
-static pthread_mutex_t gInitMutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t gErrorKeyMutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_key_t gEGLErrorKey = -1;
-#ifndef HAVE_ANDROID_OS
-namespace gl {
-pthread_key_t gGLKey = -1;
-}; // namespace gl
-#endif
-
-template<typename T>
-static T setError(GLint error, T returnValue) {
- if (ggl_unlikely(gEGLErrorKey == -1)) {
- pthread_mutex_lock(&gErrorKeyMutex);
- if (gEGLErrorKey == -1)
- pthread_key_create(&gEGLErrorKey, NULL);
- pthread_mutex_unlock(&gErrorKeyMutex);
- }
- pthread_setspecific(gEGLErrorKey, (void*)error);
- return returnValue;
-}
-
-static GLint getError() {
- if (ggl_unlikely(gEGLErrorKey == -1))
- return EGL_SUCCESS;
- GLint error = (GLint)pthread_getspecific(gEGLErrorKey);
- if (error == 0) {
- // The TLS key has been created by another thread, but the value for
- // this thread has not been initialized.
- return EGL_SUCCESS;
- }
- pthread_setspecific(gEGLErrorKey, (void*)EGL_SUCCESS);
- return error;
-}
-
-// ----------------------------------------------------------------------------
-
-struct egl_display_t
-{
- egl_display_t() : type(0), initialized(0) { }
-
- static egl_display_t& get_display(EGLDisplay dpy);
-
- static EGLBoolean is_valid(EGLDisplay dpy) {
- return ((uintptr_t(dpy)-1U) >= NUM_DISPLAYS) ? EGL_FALSE : EGL_TRUE;
- }
-
- NativeDisplayType type;
- volatile int32_t initialized;
-};
-
-static egl_display_t gDisplays[NUM_DISPLAYS];
-
-egl_display_t& egl_display_t::get_display(EGLDisplay dpy) {
- return gDisplays[uintptr_t(dpy)-1U];
-}
-
-struct egl_context_t {
- enum {
- IS_CURRENT = 0x00010000,
- NEVER_CURRENT = 0x00020000
- };
- uint32_t flags;
- EGLDisplay dpy;
- EGLConfig config;
- EGLSurface read;
- EGLSurface draw;
-
- static inline egl_context_t* context(EGLContext ctx) {
- ogles_context_t* const gl = static_cast<ogles_context_t*>(ctx);
- return static_cast<egl_context_t*>(gl->rasterizer.base);
- }
-};
-
-// ----------------------------------------------------------------------------
-
-struct egl_surface_t
-{
- enum {
- PAGE_FLIP = 0x00000001,
- MAGIC = 0x31415265
- };
-
- uint32_t magic;
- EGLDisplay dpy;
- EGLConfig config;
- EGLContext ctx;
-
- egl_surface_t(EGLDisplay dpy, EGLConfig config, int32_t depthFormat);
- virtual ~egl_surface_t();
- bool isValid() const;
- virtual bool initCheck() const = 0;
-
- virtual EGLBoolean bindDrawSurface(ogles_context_t* gl) = 0;
- virtual EGLBoolean bindReadSurface(ogles_context_t* gl) = 0;
- virtual EGLBoolean connect() { return EGL_TRUE; }
- virtual void disconnect() {}
- virtual EGLint getWidth() const = 0;
- virtual EGLint getHeight() const = 0;
-
- virtual EGLint getHorizontalResolution() const;
- virtual EGLint getVerticalResolution() const;
- virtual EGLint getRefreshRate() const;
- virtual EGLint getSwapBehavior() const;
- virtual EGLBoolean swapBuffers();
- virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h);
-protected:
- GGLSurface depth;
-};
-
-egl_surface_t::egl_surface_t(EGLDisplay dpy,
- EGLConfig config,
- int32_t depthFormat)
- : magic(MAGIC), dpy(dpy), config(config), ctx(0)
-{
- depth.version = sizeof(GGLSurface);
- depth.data = 0;
- depth.format = depthFormat;
-}
-egl_surface_t::~egl_surface_t()
-{
- magic = 0;
- free(depth.data);
-}
-bool egl_surface_t::isValid() const {
- ALOGE_IF(magic != MAGIC, "invalid EGLSurface (%p)", this);
- return magic == MAGIC;
-}
-
-EGLBoolean egl_surface_t::swapBuffers() {
- return EGL_FALSE;
-}
-EGLint egl_surface_t::getHorizontalResolution() const {
- return (0 * EGL_DISPLAY_SCALING) * (1.0f / 25.4f);
-}
-EGLint egl_surface_t::getVerticalResolution() const {
- return (0 * EGL_DISPLAY_SCALING) * (1.0f / 25.4f);
-}
-EGLint egl_surface_t::getRefreshRate() const {
- return (60 * EGL_DISPLAY_SCALING);
-}
-EGLint egl_surface_t::getSwapBehavior() const {
- return EGL_BUFFER_PRESERVED;
-}
-EGLBoolean egl_surface_t::setSwapRectangle(
- EGLint l, EGLint t, EGLint w, EGLint h)
-{
- return EGL_FALSE;
-}
-
-// ----------------------------------------------------------------------------
-
-struct egl_window_surface_v2_t : public egl_surface_t
-{
- egl_window_surface_v2_t(
- EGLDisplay dpy, EGLConfig config,
- int32_t depthFormat,
- ANativeWindow* window);
-
- ~egl_window_surface_v2_t();
-
- virtual bool initCheck() const { return true; } // TODO: report failure if ctor fails
- virtual EGLBoolean swapBuffers();
- virtual EGLBoolean bindDrawSurface(ogles_context_t* gl);
- virtual EGLBoolean bindReadSurface(ogles_context_t* gl);
- virtual EGLBoolean connect();
- virtual void disconnect();
- virtual EGLint getWidth() const { return width; }
- virtual EGLint getHeight() const { return height; }
- virtual EGLint getHorizontalResolution() const;
- virtual EGLint getVerticalResolution() const;
- virtual EGLint getRefreshRate() const;
- virtual EGLint getSwapBehavior() const;
- virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h);
-
-private:
- status_t lock(ANativeWindowBuffer* buf, int usage, void** vaddr);
- status_t unlock(ANativeWindowBuffer* buf);
- ANativeWindow* nativeWindow;
- ANativeWindowBuffer* buffer;
- ANativeWindowBuffer* previousBuffer;
- gralloc_module_t const* module;
- int width;
- int height;
- void* bits;
- GGLFormat const* pixelFormatTable;
-
- struct Rect {
- inline Rect() { };
- inline Rect(int32_t w, int32_t h)
- : left(0), top(0), right(w), bottom(h) { }
- inline Rect(int32_t l, int32_t t, int32_t r, int32_t b)
- : left(l), top(t), right(r), bottom(b) { }
- Rect& andSelf(const Rect& r) {
- left = max(left, r.left);
- top = max(top, r.top);
- right = min(right, r.right);
- bottom = min(bottom, r.bottom);
- return *this;
- }
- bool isEmpty() const {
- return (left>=right || top>=bottom);
- }
- void dump(char const* what) {
- ALOGD("%s { %5d, %5d, w=%5d, h=%5d }",
- what, left, top, right-left, bottom-top);
- }
-
- int32_t left;
- int32_t top;
- int32_t right;
- int32_t bottom;
- };
-
- struct Region {
- inline Region() : count(0) { }
- typedef Rect const* const_iterator;
- const_iterator begin() const { return storage; }
- const_iterator end() const { return storage+count; }
- static Region subtract(const Rect& lhs, const Rect& rhs) {
- Region reg;
- Rect* storage = reg.storage;
- if (!lhs.isEmpty()) {
- if (lhs.top < rhs.top) { // top rect
- storage->left = lhs.left;
- storage->top = lhs.top;
- storage->right = lhs.right;
- storage->bottom = rhs.top;
- storage++;
- }
- const int32_t top = max(lhs.top, rhs.top);
- const int32_t bot = min(lhs.bottom, rhs.bottom);
- if (top < bot) {
- if (lhs.left < rhs.left) { // left-side rect
- storage->left = lhs.left;
- storage->top = top;
- storage->right = rhs.left;
- storage->bottom = bot;
- storage++;
- }
- if (lhs.right > rhs.right) { // right-side rect
- storage->left = rhs.right;
- storage->top = top;
- storage->right = lhs.right;
- storage->bottom = bot;
- storage++;
- }
- }
- if (lhs.bottom > rhs.bottom) { // bottom rect
- storage->left = lhs.left;
- storage->top = rhs.bottom;
- storage->right = lhs.right;
- storage->bottom = lhs.bottom;
- storage++;
- }
- reg.count = storage - reg.storage;
- }
- return reg;
- }
- bool isEmpty() const {
- return count<=0;
- }
- private:
- Rect storage[4];
- ssize_t count;
- };
-
- void copyBlt(
- ANativeWindowBuffer* dst, void* dst_vaddr,
- ANativeWindowBuffer* src, void const* src_vaddr,
- const Region& clip);
-
- Rect dirtyRegion;
- Rect oldDirtyRegion;
-};
-
-egl_window_surface_v2_t::egl_window_surface_v2_t(EGLDisplay dpy,
- EGLConfig config,
- int32_t depthFormat,
- ANativeWindow* window)
- : egl_surface_t(dpy, config, depthFormat),
- nativeWindow(window), buffer(0), previousBuffer(0), module(0),
- bits(NULL)
-{
- hw_module_t const* pModule;
- hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &pModule);
- module = reinterpret_cast<gralloc_module_t const*>(pModule);
-
- pixelFormatTable = gglGetPixelFormatTable();
-
- // keep a reference on the window
- nativeWindow->common.incRef(&nativeWindow->common);
- nativeWindow->query(nativeWindow, NATIVE_WINDOW_WIDTH, &width);
- nativeWindow->query(nativeWindow, NATIVE_WINDOW_HEIGHT, &height);
-}
-
-egl_window_surface_v2_t::~egl_window_surface_v2_t() {
- if (buffer) {
- buffer->common.decRef(&buffer->common);
- }
- if (previousBuffer) {
- previousBuffer->common.decRef(&previousBuffer->common);
- }
- nativeWindow->common.decRef(&nativeWindow->common);
-}
-
-EGLBoolean egl_window_surface_v2_t::connect()
-{
- // we're intending to do software rendering
- native_window_set_usage(nativeWindow,
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
-
- // dequeue a buffer
- if (nativeWindow->dequeueBuffer(nativeWindow, &buffer) != NO_ERROR) {
- return setError(EGL_BAD_ALLOC, EGL_FALSE);
- }
-
- // allocate a corresponding depth-buffer
- width = buffer->width;
- height = buffer->height;
- if (depth.format) {
- depth.width = width;
- depth.height = height;
- depth.stride = depth.width; // use the width here
- depth.data = (GGLubyte*)malloc(depth.stride*depth.height*2);
- if (depth.data == 0) {
- return setError(EGL_BAD_ALLOC, EGL_FALSE);
- }
- }
-
- // keep a reference on the buffer
- buffer->common.incRef(&buffer->common);
-
- // Lock the buffer
- nativeWindow->lockBuffer(nativeWindow, buffer);
- // pin the buffer down
- if (lock(buffer, GRALLOC_USAGE_SW_READ_OFTEN |
- GRALLOC_USAGE_SW_WRITE_OFTEN, &bits) != NO_ERROR) {
- ALOGE("connect() failed to lock buffer %p (%ux%u)",
- buffer, buffer->width, buffer->height);
- return setError(EGL_BAD_ACCESS, EGL_FALSE);
- // FIXME: we should make sure we're not accessing the buffer anymore
- }
- return EGL_TRUE;
-}
-
-void egl_window_surface_v2_t::disconnect()
-{
- if (buffer && bits) {
- bits = NULL;
- unlock(buffer);
- }
- // enqueue the last frame
- nativeWindow->queueBuffer(nativeWindow, buffer);
- if (buffer) {
- buffer->common.decRef(&buffer->common);
- buffer = 0;
- }
- if (previousBuffer) {
- previousBuffer->common.decRef(&previousBuffer->common);
- previousBuffer = 0;
- }
-}
-
-status_t egl_window_surface_v2_t::lock(
- ANativeWindowBuffer* buf, int usage, void** vaddr)
-{
- int err;
-
- err = module->lock(module, buf->handle,
- usage, 0, 0, buf->width, buf->height, vaddr);
-
- return err;
-}
-
-status_t egl_window_surface_v2_t::unlock(ANativeWindowBuffer* buf)
-{
- if (!buf) return BAD_VALUE;
- int err = NO_ERROR;
-
- err = module->unlock(module, buf->handle);
-
- return err;
-}
-
-void egl_window_surface_v2_t::copyBlt(
- ANativeWindowBuffer* dst, void* dst_vaddr,
- ANativeWindowBuffer* src, void const* src_vaddr,
- const Region& clip)
-{
- // NOTE: dst and src must be the same format
-
- Region::const_iterator cur = clip.begin();
- Region::const_iterator end = clip.end();
-
- const size_t bpp = pixelFormatTable[src->format].size;
- const size_t dbpr = dst->stride * bpp;
- const size_t sbpr = src->stride * bpp;
-
- uint8_t const * const src_bits = (uint8_t const *)src_vaddr;
- uint8_t * const dst_bits = (uint8_t *)dst_vaddr;
-
- while (cur != end) {
- const Rect& r(*cur++);
- ssize_t w = r.right - r.left;
- ssize_t h = r.bottom - r.top;
- if (w <= 0 || h<=0) continue;
- size_t size = w * bpp;
- uint8_t const * s = src_bits + (r.left + src->stride * r.top) * bpp;
- uint8_t * d = dst_bits + (r.left + dst->stride * r.top) * bpp;
- if (dbpr==sbpr && size==sbpr) {
- size *= h;
- h = 1;
- }
- do {
- memcpy(d, s, size);
- d += dbpr;
- s += sbpr;
- } while (--h > 0);
- }
-}
-
-EGLBoolean egl_window_surface_v2_t::swapBuffers()
-{
- if (!buffer) {
- return setError(EGL_BAD_ACCESS, EGL_FALSE);
- }
-
- /*
- * Handle eglSetSwapRectangleANDROID()
- * We copyback from the front buffer
- */
- if (!dirtyRegion.isEmpty()) {
- dirtyRegion.andSelf(Rect(buffer->width, buffer->height));
- if (previousBuffer) {
- // This was const Region copyBack, but that causes an
- // internal compile error on simulator builds
- /*const*/ Region copyBack(Region::subtract(oldDirtyRegion, dirtyRegion));
- if (!copyBack.isEmpty()) {
- void* prevBits;
- if (lock(previousBuffer,
- GRALLOC_USAGE_SW_READ_OFTEN, &prevBits) == NO_ERROR) {
- // copy from previousBuffer to buffer
- copyBlt(buffer, bits, previousBuffer, prevBits, copyBack);
- unlock(previousBuffer);
- }
- }
- }
- oldDirtyRegion = dirtyRegion;
- }
-
- if (previousBuffer) {
- previousBuffer->common.decRef(&previousBuffer->common);
- previousBuffer = 0;
- }
-
- unlock(buffer);
- previousBuffer = buffer;
- nativeWindow->queueBuffer(nativeWindow, buffer);
- buffer = 0;
-
- // dequeue a new buffer
- if (nativeWindow->dequeueBuffer(nativeWindow, &buffer) == NO_ERROR) {
-
- // TODO: lockBuffer should rather be executed when the very first
- // direct rendering occurs.
- nativeWindow->lockBuffer(nativeWindow, buffer);
-
- // reallocate the depth-buffer if needed
- if ((width != buffer->width) || (height != buffer->height)) {
- // TODO: we probably should reset the swap rect here
- // if the window size has changed
- width = buffer->width;
- height = buffer->height;
- if (depth.data) {
- free(depth.data);
- depth.width = width;
- depth.height = height;
- depth.stride = buffer->stride;
- depth.data = (GGLubyte*)malloc(depth.stride*depth.height*2);
- if (depth.data == 0) {
- setError(EGL_BAD_ALLOC, EGL_FALSE);
- return EGL_FALSE;
- }
- }
- }
-
- // keep a reference on the buffer
- buffer->common.incRef(&buffer->common);
-
- // finally pin the buffer down
- if (lock(buffer, GRALLOC_USAGE_SW_READ_OFTEN |
- GRALLOC_USAGE_SW_WRITE_OFTEN, &bits) != NO_ERROR) {
- ALOGE("eglSwapBuffers() failed to lock buffer %p (%ux%u)",
- buffer, buffer->width, buffer->height);
- return setError(EGL_BAD_ACCESS, EGL_FALSE);
- // FIXME: we should make sure we're not accessing the buffer anymore
- }
- } else {
- return setError(EGL_BAD_CURRENT_SURFACE, EGL_FALSE);
- }
-
- return EGL_TRUE;
-}
-
-EGLBoolean egl_window_surface_v2_t::setSwapRectangle(
- EGLint l, EGLint t, EGLint w, EGLint h)
-{
- dirtyRegion = Rect(l, t, l+w, t+h);
- return EGL_TRUE;
-}
-
-EGLBoolean egl_window_surface_v2_t::bindDrawSurface(ogles_context_t* gl)
-{
- GGLSurface buffer;
- buffer.version = sizeof(GGLSurface);
- buffer.width = this->buffer->width;
- buffer.height = this->buffer->height;
- buffer.stride = this->buffer->stride;
- buffer.data = (GGLubyte*)bits;
- buffer.format = this->buffer->format;
- gl->rasterizer.procs.colorBuffer(gl, &buffer);
- if (depth.data != gl->rasterizer.state.buffers.depth.data)
- gl->rasterizer.procs.depthBuffer(gl, &depth);
-
- return EGL_TRUE;
-}
-EGLBoolean egl_window_surface_v2_t::bindReadSurface(ogles_context_t* gl)
-{
- GGLSurface buffer;
- buffer.version = sizeof(GGLSurface);
- buffer.width = this->buffer->width;
- buffer.height = this->buffer->height;
- buffer.stride = this->buffer->stride;
- buffer.data = (GGLubyte*)bits; // FIXME: hopefully is is LOCKED!!!
- buffer.format = this->buffer->format;
- gl->rasterizer.procs.readBuffer(gl, &buffer);
- return EGL_TRUE;
-}
-EGLint egl_window_surface_v2_t::getHorizontalResolution() const {
- return (nativeWindow->xdpi * EGL_DISPLAY_SCALING) * (1.0f / 25.4f);
-}
-EGLint egl_window_surface_v2_t::getVerticalResolution() const {
- return (nativeWindow->ydpi * EGL_DISPLAY_SCALING) * (1.0f / 25.4f);
-}
-EGLint egl_window_surface_v2_t::getRefreshRate() const {
- return (60 * EGL_DISPLAY_SCALING); // FIXME
-}
-EGLint egl_window_surface_v2_t::getSwapBehavior() const
-{
- /*
- * EGL_BUFFER_PRESERVED means that eglSwapBuffers() completely preserves
- * the content of the swapped buffer.
- *
- * EGL_BUFFER_DESTROYED means that the content of the buffer is lost.
- *
- * However when ANDROID_swap_retcangle is supported, EGL_BUFFER_DESTROYED
- * only applies to the area specified by eglSetSwapRectangleANDROID(), that
- * is, everything outside of this area is preserved.
- *
- * This implementation of EGL assumes the later case.
- *
- */
-
- return EGL_BUFFER_DESTROYED;
-}
-
-// ----------------------------------------------------------------------------
-
-struct egl_pixmap_surface_t : public egl_surface_t
-{
- egl_pixmap_surface_t(
- EGLDisplay dpy, EGLConfig config,
- int32_t depthFormat,
- egl_native_pixmap_t const * pixmap);
-
- virtual ~egl_pixmap_surface_t() { }
-
- virtual bool initCheck() const { return !depth.format || depth.data!=0; }
- virtual EGLBoolean bindDrawSurface(ogles_context_t* gl);
- virtual EGLBoolean bindReadSurface(ogles_context_t* gl);
- virtual EGLint getWidth() const { return nativePixmap.width; }
- virtual EGLint getHeight() const { return nativePixmap.height; }
-private:
- egl_native_pixmap_t nativePixmap;
-};
-
-egl_pixmap_surface_t::egl_pixmap_surface_t(EGLDisplay dpy,
- EGLConfig config,
- int32_t depthFormat,
- egl_native_pixmap_t const * pixmap)
- : egl_surface_t(dpy, config, depthFormat), nativePixmap(*pixmap)
-{
- if (depthFormat) {
- depth.width = pixmap->width;
- depth.height = pixmap->height;
- depth.stride = depth.width; // use the width here
- depth.data = (GGLubyte*)malloc(depth.stride*depth.height*2);
- if (depth.data == 0) {
- setError(EGL_BAD_ALLOC, EGL_NO_SURFACE);
- }
- }
-}
-EGLBoolean egl_pixmap_surface_t::bindDrawSurface(ogles_context_t* gl)
-{
- GGLSurface buffer;
- buffer.version = sizeof(GGLSurface);
- buffer.width = nativePixmap.width;
- buffer.height = nativePixmap.height;
- buffer.stride = nativePixmap.stride;
- buffer.data = nativePixmap.data;
- buffer.format = nativePixmap.format;
-
- gl->rasterizer.procs.colorBuffer(gl, &buffer);
- if (depth.data != gl->rasterizer.state.buffers.depth.data)
- gl->rasterizer.procs.depthBuffer(gl, &depth);
- return EGL_TRUE;
-}
-EGLBoolean egl_pixmap_surface_t::bindReadSurface(ogles_context_t* gl)
-{
- GGLSurface buffer;
- buffer.version = sizeof(GGLSurface);
- buffer.width = nativePixmap.width;
- buffer.height = nativePixmap.height;
- buffer.stride = nativePixmap.stride;
- buffer.data = nativePixmap.data;
- buffer.format = nativePixmap.format;
- gl->rasterizer.procs.readBuffer(gl, &buffer);
- return EGL_TRUE;
-}
-
-// ----------------------------------------------------------------------------
-
-struct egl_pbuffer_surface_t : public egl_surface_t
-{
- egl_pbuffer_surface_t(
- EGLDisplay dpy, EGLConfig config, int32_t depthFormat,
- int32_t w, int32_t h, int32_t f);
-
- virtual ~egl_pbuffer_surface_t();
-
- virtual bool initCheck() const { return pbuffer.data != 0; }
- virtual EGLBoolean bindDrawSurface(ogles_context_t* gl);
- virtual EGLBoolean bindReadSurface(ogles_context_t* gl);
- virtual EGLint getWidth() const { return pbuffer.width; }
- virtual EGLint getHeight() const { return pbuffer.height; }
-private:
- GGLSurface pbuffer;
-};
-
-egl_pbuffer_surface_t::egl_pbuffer_surface_t(EGLDisplay dpy,
- EGLConfig config, int32_t depthFormat,
- int32_t w, int32_t h, int32_t f)
- : egl_surface_t(dpy, config, depthFormat)
-{
- size_t size = w*h;
- switch (f) {
- case GGL_PIXEL_FORMAT_A_8: size *= 1; break;
- case GGL_PIXEL_FORMAT_RGB_565: size *= 2; break;
- case GGL_PIXEL_FORMAT_RGBA_8888: size *= 4; break;
- case GGL_PIXEL_FORMAT_RGBX_8888: size *= 4; break;
- default:
- ALOGE("incompatible pixel format for pbuffer (format=%d)", f);
- pbuffer.data = 0;
- break;
- }
- pbuffer.version = sizeof(GGLSurface);
- pbuffer.width = w;
- pbuffer.height = h;
- pbuffer.stride = w;
- pbuffer.data = (GGLubyte*)malloc(size);
- pbuffer.format = f;
-
- if (depthFormat) {
- depth.width = pbuffer.width;
- depth.height = pbuffer.height;
- depth.stride = depth.width; // use the width here
- depth.data = (GGLubyte*)malloc(depth.stride*depth.height*2);
- if (depth.data == 0) {
- setError(EGL_BAD_ALLOC, EGL_NO_SURFACE);
- return;
- }
- }
-}
-egl_pbuffer_surface_t::~egl_pbuffer_surface_t() {
- free(pbuffer.data);
-}
-EGLBoolean egl_pbuffer_surface_t::bindDrawSurface(ogles_context_t* gl)
-{
- gl->rasterizer.procs.colorBuffer(gl, &pbuffer);
- if (depth.data != gl->rasterizer.state.buffers.depth.data)
- gl->rasterizer.procs.depthBuffer(gl, &depth);
- return EGL_TRUE;
-}
-EGLBoolean egl_pbuffer_surface_t::bindReadSurface(ogles_context_t* gl)
-{
- gl->rasterizer.procs.readBuffer(gl, &pbuffer);
- return EGL_TRUE;
-}
-
-// ----------------------------------------------------------------------------
-
-struct config_pair_t {
- GLint key;
- GLint value;
-};
-
-struct configs_t {
- const config_pair_t* array;
- int size;
-};
-
-struct config_management_t {
- GLint key;
- bool (*match)(GLint reqValue, GLint confValue);
- static bool atLeast(GLint reqValue, GLint confValue) {
- return (reqValue == EGL_DONT_CARE) || (confValue >= reqValue);
- }
- static bool exact(GLint reqValue, GLint confValue) {
- return (reqValue == EGL_DONT_CARE) || (confValue == reqValue);
- }
- static bool mask(GLint reqValue, GLint confValue) {
- return (confValue & reqValue) == reqValue;
- }
- static bool ignore(GLint reqValue, GLint confValue) {
- return true;
- }
-};
-
-// ----------------------------------------------------------------------------
-
-#define VERSION_MAJOR 1
-#define VERSION_MINOR 2
-static char const * const gVendorString = "Google Inc.";
-static char const * const gVersionString = "1.2 Android Driver 1.2.0";
-static char const * const gClientApiString = "OpenGL ES";
-static char const * const gExtensionsString =
- "EGL_KHR_image_base "
- // "KHR_image_pixmap "
- "EGL_ANDROID_image_native_buffer "
- "EGL_ANDROID_swap_rectangle "
- ;
-
-// ----------------------------------------------------------------------------
-
-struct extention_map_t {
- const char * const name;
- __eglMustCastToProperFunctionPointerType address;
-};
-
-static const extention_map_t gExtentionMap[] = {
- { "glDrawTexsOES",
- (__eglMustCastToProperFunctionPointerType)&glDrawTexsOES },
- { "glDrawTexiOES",
- (__eglMustCastToProperFunctionPointerType)&glDrawTexiOES },
- { "glDrawTexfOES",
- (__eglMustCastToProperFunctionPointerType)&glDrawTexfOES },
- { "glDrawTexxOES",
- (__eglMustCastToProperFunctionPointerType)&glDrawTexxOES },
- { "glDrawTexsvOES",
- (__eglMustCastToProperFunctionPointerType)&glDrawTexsvOES },
- { "glDrawTexivOES",
- (__eglMustCastToProperFunctionPointerType)&glDrawTexivOES },
- { "glDrawTexfvOES",
- (__eglMustCastToProperFunctionPointerType)&glDrawTexfvOES },
- { "glDrawTexxvOES",
- (__eglMustCastToProperFunctionPointerType)&glDrawTexxvOES },
- { "glQueryMatrixxOES",
- (__eglMustCastToProperFunctionPointerType)&glQueryMatrixxOES },
- { "glEGLImageTargetTexture2DOES",
- (__eglMustCastToProperFunctionPointerType)&glEGLImageTargetTexture2DOES },
- { "glEGLImageTargetRenderbufferStorageOES",
- (__eglMustCastToProperFunctionPointerType)&glEGLImageTargetRenderbufferStorageOES },
- { "glClipPlanef",
- (__eglMustCastToProperFunctionPointerType)&glClipPlanef },
- { "glClipPlanex",
- (__eglMustCastToProperFunctionPointerType)&glClipPlanex },
- { "glBindBuffer",
- (__eglMustCastToProperFunctionPointerType)&glBindBuffer },
- { "glBufferData",
- (__eglMustCastToProperFunctionPointerType)&glBufferData },
- { "glBufferSubData",
- (__eglMustCastToProperFunctionPointerType)&glBufferSubData },
- { "glDeleteBuffers",
- (__eglMustCastToProperFunctionPointerType)&glDeleteBuffers },
- { "glGenBuffers",
- (__eglMustCastToProperFunctionPointerType)&glGenBuffers },
- { "eglCreateImageKHR",
- (__eglMustCastToProperFunctionPointerType)&eglCreateImageKHR },
- { "eglDestroyImageKHR",
- (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR },
- { "eglSetSwapRectangleANDROID",
- (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID },
-};
-
-/*
- * In the lists below, attributes names MUST be sorted.
- * Additionally, all configs must be sorted according to
- * the EGL specification.
- */
-
-static config_pair_t const config_base_attribute_list[] = {
- { EGL_STENCIL_SIZE, 0 },
- { EGL_CONFIG_CAVEAT, EGL_SLOW_CONFIG },
- { EGL_LEVEL, 0 },
- { EGL_MAX_PBUFFER_HEIGHT, GGL_MAX_VIEWPORT_DIMS },
- { EGL_MAX_PBUFFER_PIXELS,
- GGL_MAX_VIEWPORT_DIMS*GGL_MAX_VIEWPORT_DIMS },
- { EGL_MAX_PBUFFER_WIDTH, GGL_MAX_VIEWPORT_DIMS },
- { EGL_NATIVE_RENDERABLE, EGL_TRUE },
- { EGL_NATIVE_VISUAL_ID, 0 },
- { EGL_NATIVE_VISUAL_TYPE, GGL_PIXEL_FORMAT_RGB_565 },
- { EGL_SAMPLES, 0 },
- { EGL_SAMPLE_BUFFERS, 0 },
- { EGL_TRANSPARENT_TYPE, EGL_NONE },
- { EGL_TRANSPARENT_BLUE_VALUE, 0 },
- { EGL_TRANSPARENT_GREEN_VALUE, 0 },
- { EGL_TRANSPARENT_RED_VALUE, 0 },
- { EGL_BIND_TO_TEXTURE_RGBA, EGL_FALSE },
- { EGL_BIND_TO_TEXTURE_RGB, EGL_FALSE },
- { EGL_MIN_SWAP_INTERVAL, 1 },
- { EGL_MAX_SWAP_INTERVAL, 1 },
- { EGL_LUMINANCE_SIZE, 0 },
- { EGL_ALPHA_MASK_SIZE, 0 },
- { EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER },
- { EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT },
- { EGL_CONFORMANT, 0 }
-};
-
-// These configs can override the base attribute list
-// NOTE: when adding a config here, don't forget to update eglCreate*Surface()
-
-// 565 configs
-static config_pair_t const config_0_attribute_list[] = {
- { EGL_BUFFER_SIZE, 16 },
- { EGL_ALPHA_SIZE, 0 },
- { EGL_BLUE_SIZE, 5 },
- { EGL_GREEN_SIZE, 6 },
- { EGL_RED_SIZE, 5 },
- { EGL_DEPTH_SIZE, 0 },
- { EGL_CONFIG_ID, 0 },
- { EGL_NATIVE_VISUAL_ID, GGL_PIXEL_FORMAT_RGB_565 },
- { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
-};
-
-static config_pair_t const config_1_attribute_list[] = {
- { EGL_BUFFER_SIZE, 16 },
- { EGL_ALPHA_SIZE, 0 },
- { EGL_BLUE_SIZE, 5 },
- { EGL_GREEN_SIZE, 6 },
- { EGL_RED_SIZE, 5 },
- { EGL_DEPTH_SIZE, 16 },
- { EGL_CONFIG_ID, 1 },
- { EGL_NATIVE_VISUAL_ID, GGL_PIXEL_FORMAT_RGB_565 },
- { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
-};
-
-// RGB 888 configs
-static config_pair_t const config_2_attribute_list[] = {
- { EGL_BUFFER_SIZE, 32 },
- { EGL_ALPHA_SIZE, 0 },
- { EGL_BLUE_SIZE, 8 },
- { EGL_GREEN_SIZE, 8 },
- { EGL_RED_SIZE, 8 },
- { EGL_DEPTH_SIZE, 0 },
- { EGL_CONFIG_ID, 6 },
- { EGL_NATIVE_VISUAL_ID, GGL_PIXEL_FORMAT_RGBX_8888 },
- { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
-};
-
-static config_pair_t const config_3_attribute_list[] = {
- { EGL_BUFFER_SIZE, 32 },
- { EGL_ALPHA_SIZE, 0 },
- { EGL_BLUE_SIZE, 8 },
- { EGL_GREEN_SIZE, 8 },
- { EGL_RED_SIZE, 8 },
- { EGL_DEPTH_SIZE, 16 },
- { EGL_CONFIG_ID, 7 },
- { EGL_NATIVE_VISUAL_ID, GGL_PIXEL_FORMAT_RGBX_8888 },
- { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
-};
-
-// 8888 configs
-static config_pair_t const config_4_attribute_list[] = {
- { EGL_BUFFER_SIZE, 32 },
- { EGL_ALPHA_SIZE, 8 },
- { EGL_BLUE_SIZE, 8 },
- { EGL_GREEN_SIZE, 8 },
- { EGL_RED_SIZE, 8 },
- { EGL_DEPTH_SIZE, 0 },
- { EGL_CONFIG_ID, 2 },
- { EGL_NATIVE_VISUAL_ID, GGL_PIXEL_FORMAT_RGBA_8888 },
- { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
-};
-
-static config_pair_t const config_5_attribute_list[] = {
- { EGL_BUFFER_SIZE, 32 },
- { EGL_ALPHA_SIZE, 8 },
- { EGL_BLUE_SIZE, 8 },
- { EGL_GREEN_SIZE, 8 },
- { EGL_RED_SIZE, 8 },
- { EGL_DEPTH_SIZE, 16 },
- { EGL_CONFIG_ID, 3 },
- { EGL_NATIVE_VISUAL_ID, GGL_PIXEL_FORMAT_RGBA_8888 },
- { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
-};
-
-// A8 configs
-static config_pair_t const config_6_attribute_list[] = {
- { EGL_BUFFER_SIZE, 8 },
- { EGL_ALPHA_SIZE, 8 },
- { EGL_BLUE_SIZE, 0 },
- { EGL_GREEN_SIZE, 0 },
- { EGL_RED_SIZE, 0 },
- { EGL_DEPTH_SIZE, 0 },
- { EGL_CONFIG_ID, 4 },
- { EGL_NATIVE_VISUAL_ID, GGL_PIXEL_FORMAT_A_8 },
- { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
-};
-
-static config_pair_t const config_7_attribute_list[] = {
- { EGL_BUFFER_SIZE, 8 },
- { EGL_ALPHA_SIZE, 8 },
- { EGL_BLUE_SIZE, 0 },
- { EGL_GREEN_SIZE, 0 },
- { EGL_RED_SIZE, 0 },
- { EGL_DEPTH_SIZE, 16 },
- { EGL_CONFIG_ID, 5 },
- { EGL_NATIVE_VISUAL_ID, GGL_PIXEL_FORMAT_A_8 },
- { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
-};
-
-static configs_t const gConfigs[] = {
- { config_0_attribute_list, NELEM(config_0_attribute_list) },
- { config_1_attribute_list, NELEM(config_1_attribute_list) },
- { config_2_attribute_list, NELEM(config_2_attribute_list) },
- { config_3_attribute_list, NELEM(config_3_attribute_list) },
- { config_4_attribute_list, NELEM(config_4_attribute_list) },
- { config_5_attribute_list, NELEM(config_5_attribute_list) },
- { config_6_attribute_list, NELEM(config_6_attribute_list) },
- { config_7_attribute_list, NELEM(config_7_attribute_list) },
-};
-
-static config_management_t const gConfigManagement[] = {
- { EGL_BUFFER_SIZE, config_management_t::atLeast },
- { EGL_ALPHA_SIZE, config_management_t::atLeast },
- { EGL_BLUE_SIZE, config_management_t::atLeast },
- { EGL_GREEN_SIZE, config_management_t::atLeast },
- { EGL_RED_SIZE, config_management_t::atLeast },
- { EGL_DEPTH_SIZE, config_management_t::atLeast },
- { EGL_STENCIL_SIZE, config_management_t::atLeast },
- { EGL_CONFIG_CAVEAT, config_management_t::exact },
- { EGL_CONFIG_ID, config_management_t::exact },
- { EGL_LEVEL, config_management_t::exact },
- { EGL_MAX_PBUFFER_HEIGHT, config_management_t::ignore },
- { EGL_MAX_PBUFFER_PIXELS, config_management_t::ignore },
- { EGL_MAX_PBUFFER_WIDTH, config_management_t::ignore },
- { EGL_NATIVE_RENDERABLE, config_management_t::exact },
- { EGL_NATIVE_VISUAL_ID, config_management_t::ignore },
- { EGL_NATIVE_VISUAL_TYPE, config_management_t::exact },
- { EGL_SAMPLES, config_management_t::exact },
- { EGL_SAMPLE_BUFFERS, config_management_t::exact },
- { EGL_SURFACE_TYPE, config_management_t::mask },
- { EGL_TRANSPARENT_TYPE, config_management_t::exact },
- { EGL_TRANSPARENT_BLUE_VALUE, config_management_t::exact },
- { EGL_TRANSPARENT_GREEN_VALUE, config_management_t::exact },
- { EGL_TRANSPARENT_RED_VALUE, config_management_t::exact },
- { EGL_BIND_TO_TEXTURE_RGBA, config_management_t::exact },
- { EGL_BIND_TO_TEXTURE_RGB, config_management_t::exact },
- { EGL_MIN_SWAP_INTERVAL, config_management_t::exact },
- { EGL_MAX_SWAP_INTERVAL, config_management_t::exact },
- { EGL_LUMINANCE_SIZE, config_management_t::atLeast },
- { EGL_ALPHA_MASK_SIZE, config_management_t::atLeast },
- { EGL_COLOR_BUFFER_TYPE, config_management_t::exact },
- { EGL_RENDERABLE_TYPE, config_management_t::mask },
- { EGL_CONFORMANT, config_management_t::mask }
-};
-
-
-static config_pair_t const config_defaults[] = {
- // attributes that are not specified are simply ignored, if a particular
- // one needs not be ignored, it must be specified here, eg:
- // { EGL_SURFACE_TYPE, EGL_WINDOW_BIT },
-};
-
-// ----------------------------------------------------------------------------
-
-static status_t getConfigFormatInfo(EGLint configID,
- int32_t& pixelFormat, int32_t& depthFormat)
-{
- switch(configID) {
- case 0:
- pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
- depthFormat = 0;
- break;
- case 1:
- pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- case 2:
- pixelFormat = GGL_PIXEL_FORMAT_RGBX_8888;
- depthFormat = 0;
- break;
- case 3:
- pixelFormat = GGL_PIXEL_FORMAT_RGBX_8888;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- case 4:
- pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
- depthFormat = 0;
- break;
- case 5:
- pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- case 6:
- pixelFormat = GGL_PIXEL_FORMAT_A_8;
- depthFormat = 0;
- break;
- case 7:
- pixelFormat = GGL_PIXEL_FORMAT_A_8;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- default:
- return NAME_NOT_FOUND;
- }
- return NO_ERROR;
-}
-
-// ----------------------------------------------------------------------------
-
-template<typename T>
-static int binarySearch(T const sortedArray[], int first, int last, EGLint key)
-{
- while (first <= last) {
- int mid = (first + last) / 2;
- if (key > sortedArray[mid].key) {
- first = mid + 1;
- } else if (key < sortedArray[mid].key) {
- last = mid - 1;
- } else {
- return mid;
- }
- }
- return -1;
-}
-
-static int isAttributeMatching(int i, EGLint attr, EGLint val)
-{
- // look for the attribute in all of our configs
- config_pair_t const* configFound = gConfigs[i].array;
- int index = binarySearch<config_pair_t>(
- gConfigs[i].array,
- 0, gConfigs[i].size-1,
- attr);
- if (index < 0) {
- configFound = config_base_attribute_list;
- index = binarySearch<config_pair_t>(
- config_base_attribute_list,
- 0, NELEM(config_base_attribute_list)-1,
- attr);
- }
- if (index >= 0) {
- // attribute found, check if this config could match
- int cfgMgtIndex = binarySearch<config_management_t>(
- gConfigManagement,
- 0, NELEM(gConfigManagement)-1,
- attr);
- if (cfgMgtIndex >= 0) {
- bool match = gConfigManagement[cfgMgtIndex].match(
- val, configFound[index].value);
- if (match) {
- // this config matches
- return 1;
- }
- } else {
- // attribute not found. this should NEVER happen.
- }
- } else {
- // error, this attribute doesn't exist
- }
- return 0;
-}
-
-static int makeCurrent(ogles_context_t* gl)
-{
- ogles_context_t* current = (ogles_context_t*)getGlThreadSpecific();
- if (gl) {
- egl_context_t* c = egl_context_t::context(gl);
- if (c->flags & egl_context_t::IS_CURRENT) {
- if (current != gl) {
- // it is an error to set a context current, if it's already
- // current to another thread
- return -1;
- }
- } else {
- if (current) {
- // mark the current context as not current, and flush
- glFlush();
- egl_context_t::context(current)->flags &= ~egl_context_t::IS_CURRENT;
- }
- }
- if (!(c->flags & egl_context_t::IS_CURRENT)) {
- // The context is not current, make it current!
- setGlThreadSpecific(gl);
- c->flags |= egl_context_t::IS_CURRENT;
- }
- } else {
- if (current) {
- // mark the current context as not current, and flush
- glFlush();
- egl_context_t::context(current)->flags &= ~egl_context_t::IS_CURRENT;
- }
- // this thread has no context attached to it
- setGlThreadSpecific(0);
- }
- return 0;
-}
-
-static EGLBoolean getConfigAttrib(EGLDisplay dpy, EGLConfig config,
- EGLint attribute, EGLint *value)
-{
- size_t numConfigs = NELEM(gConfigs);
- int index = (int)config;
- if (uint32_t(index) >= numConfigs)
- return setError(EGL_BAD_CONFIG, EGL_FALSE);
-
- int attrIndex;
- attrIndex = binarySearch<config_pair_t>(
- gConfigs[index].array,
- 0, gConfigs[index].size-1,
- attribute);
- if (attrIndex>=0) {
- *value = gConfigs[index].array[attrIndex].value;
- return EGL_TRUE;
- }
-
- attrIndex = binarySearch<config_pair_t>(
- config_base_attribute_list,
- 0, NELEM(config_base_attribute_list)-1,
- attribute);
- if (attrIndex>=0) {
- *value = config_base_attribute_list[attrIndex].value;
- return EGL_TRUE;
- }
- return setError(EGL_BAD_ATTRIBUTE, EGL_FALSE);
-}
-
-static EGLSurface createWindowSurface(EGLDisplay dpy, EGLConfig config,
- NativeWindowType window, const EGLint *attrib_list)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_NO_SURFACE);
- if (window == 0)
- return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
-
- EGLint surfaceType;
- if (getConfigAttrib(dpy, config, EGL_SURFACE_TYPE, &surfaceType) == EGL_FALSE)
- return EGL_FALSE;
-
- if (!(surfaceType & EGL_WINDOW_BIT))
- return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
-
- if (static_cast<ANativeWindow*>(window)->common.magic !=
- ANDROID_NATIVE_WINDOW_MAGIC) {
- return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
- }
-
- EGLint configID;
- if (getConfigAttrib(dpy, config, EGL_CONFIG_ID, &configID) == EGL_FALSE)
- return EGL_FALSE;
-
- int32_t depthFormat;
- int32_t pixelFormat;
- if (getConfigFormatInfo(configID, pixelFormat, depthFormat) != NO_ERROR) {
- return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
- }
-
- // FIXME: we don't have access to the pixelFormat here just yet.
- // (it's possible that the surface is not fully initialized)
- // maybe this should be done after the page-flip
- //if (EGLint(info.format) != pixelFormat)
- // return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
-
- egl_surface_t* surface;
- surface = new egl_window_surface_v2_t(dpy, config, depthFormat,
- static_cast<ANativeWindow*>(window));
-
- if (!surface->initCheck()) {
- // there was a problem in the ctor, the error
- // flag has been set.
- delete surface;
- surface = 0;
- }
- return surface;
-}
-
-static EGLSurface createPixmapSurface(EGLDisplay dpy, EGLConfig config,
- NativePixmapType pixmap, const EGLint *attrib_list)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_NO_SURFACE);
- if (pixmap == 0)
- return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
-
- EGLint surfaceType;
- if (getConfigAttrib(dpy, config, EGL_SURFACE_TYPE, &surfaceType) == EGL_FALSE)
- return EGL_FALSE;
-
- if (!(surfaceType & EGL_PIXMAP_BIT))
- return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
-
- if (static_cast<egl_native_pixmap_t*>(pixmap)->version !=
- sizeof(egl_native_pixmap_t)) {
- return setError(EGL_BAD_NATIVE_PIXMAP, EGL_NO_SURFACE);
- }
-
- EGLint configID;
- if (getConfigAttrib(dpy, config, EGL_CONFIG_ID, &configID) == EGL_FALSE)
- return EGL_FALSE;
-
- int32_t depthFormat;
- int32_t pixelFormat;
- if (getConfigFormatInfo(configID, pixelFormat, depthFormat) != NO_ERROR) {
- return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
- }
-
- if (pixmap->format != pixelFormat)
- return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
-
- egl_surface_t* surface =
- new egl_pixmap_surface_t(dpy, config, depthFormat,
- static_cast<egl_native_pixmap_t*>(pixmap));
-
- if (!surface->initCheck()) {
- // there was a problem in the ctor, the error
- // flag has been set.
- delete surface;
- surface = 0;
- }
- return surface;
-}
-
-static EGLSurface createPbufferSurface(EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_NO_SURFACE);
-
- EGLint surfaceType;
- if (getConfigAttrib(dpy, config, EGL_SURFACE_TYPE, &surfaceType) == EGL_FALSE)
- return EGL_FALSE;
-
- if (!(surfaceType & EGL_PBUFFER_BIT))
- return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
-
- EGLint configID;
- if (getConfigAttrib(dpy, config, EGL_CONFIG_ID, &configID) == EGL_FALSE)
- return EGL_FALSE;
-
- int32_t depthFormat;
- int32_t pixelFormat;
- if (getConfigFormatInfo(configID, pixelFormat, depthFormat) != NO_ERROR) {
- return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
- }
-
- int32_t w = 0;
- int32_t h = 0;
- while (attrib_list[0]) {
- if (attrib_list[0] == EGL_WIDTH) w = attrib_list[1];
- if (attrib_list[0] == EGL_HEIGHT) h = attrib_list[1];
- attrib_list+=2;
- }
-
- egl_surface_t* surface =
- new egl_pbuffer_surface_t(dpy, config, depthFormat, w, h, pixelFormat);
-
- if (!surface->initCheck()) {
- // there was a problem in the ctor, the error
- // flag has been set.
- delete surface;
- surface = 0;
- }
- return surface;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-using namespace android;
-
-// ----------------------------------------------------------------------------
-// Initialization
-// ----------------------------------------------------------------------------
-
-EGLDisplay eglGetDisplay(NativeDisplayType display)
-{
-#ifndef HAVE_ANDROID_OS
- // this just needs to be done once
- if (gGLKey == -1) {
- pthread_mutex_lock(&gInitMutex);
- if (gGLKey == -1)
- pthread_key_create(&gGLKey, NULL);
- pthread_mutex_unlock(&gInitMutex);
- }
-#endif
- if (display == EGL_DEFAULT_DISPLAY) {
- EGLDisplay dpy = (EGLDisplay)1;
- egl_display_t& d = egl_display_t::get_display(dpy);
- d.type = display;
- return dpy;
- }
- return EGL_NO_DISPLAY;
-}
-
-EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- EGLBoolean res = EGL_TRUE;
- egl_display_t& d = egl_display_t::get_display(dpy);
-
- if (android_atomic_inc(&d.initialized) == 0) {
- // initialize stuff here if needed
- //pthread_mutex_lock(&gInitMutex);
- //pthread_mutex_unlock(&gInitMutex);
- }
-
- if (res == EGL_TRUE) {
- if (major != NULL) *major = VERSION_MAJOR;
- if (minor != NULL) *minor = VERSION_MINOR;
- }
- return res;
-}
-
-EGLBoolean eglTerminate(EGLDisplay dpy)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- EGLBoolean res = EGL_TRUE;
- egl_display_t& d = egl_display_t::get_display(dpy);
- if (android_atomic_dec(&d.initialized) == 1) {
- // TODO: destroy all resources (surfaces, contexts, etc...)
- //pthread_mutex_lock(&gInitMutex);
- //pthread_mutex_unlock(&gInitMutex);
- }
- return res;
-}
-
-// ----------------------------------------------------------------------------
-// configuration
-// ----------------------------------------------------------------------------
-
-EGLBoolean eglGetConfigs( EGLDisplay dpy,
- EGLConfig *configs,
- EGLint config_size, EGLint *num_config)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- GLint numConfigs = NELEM(gConfigs);
- if (!configs) {
- *num_config = numConfigs;
- return EGL_TRUE;
- }
- GLint i;
- for (i=0 ; i<numConfigs && i<config_size ; i++) {
- *configs++ = (EGLConfig)i;
- }
- *num_config = i;
- return EGL_TRUE;
-}
-
-EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list,
- EGLConfig *configs, EGLint config_size,
- EGLint *num_config)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- if (ggl_unlikely(num_config==0)) {
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- if (ggl_unlikely(attrib_list==0)) {
- /*
- * A NULL attrib_list should be treated as though it was an empty
- * one (terminated with EGL_NONE) as defined in
- * section 3.4.1 "Querying Configurations" in the EGL specification.
- */
- static const EGLint dummy = EGL_NONE;
- attrib_list = &dummy;
- }
-
- int numAttributes = 0;
- int numConfigs = NELEM(gConfigs);
- uint32_t possibleMatch = (1<<numConfigs)-1;
- while(possibleMatch && *attrib_list != EGL_NONE) {
- numAttributes++;
- EGLint attr = *attrib_list++;
- EGLint val = *attrib_list++;
- for (int i=0 ; possibleMatch && i<numConfigs ; i++) {
- if (!(possibleMatch & (1<<i)))
- continue;
- if (isAttributeMatching(i, attr, val) == 0) {
- possibleMatch &= ~(1<<i);
- }
- }
- }
-
- // now, handle the attributes which have a useful default value
- for (size_t j=0 ; possibleMatch && j<NELEM(config_defaults) ; j++) {
- // see if this attribute was specified, if not, apply its
- // default value
- if (binarySearch<config_pair_t>(
- (config_pair_t const*)attrib_list,
- 0, numAttributes-1,
- config_defaults[j].key) < 0)
- {
- for (int i=0 ; possibleMatch && i<numConfigs ; i++) {
- if (!(possibleMatch & (1<<i)))
- continue;
- if (isAttributeMatching(i,
- config_defaults[j].key,
- config_defaults[j].value) == 0)
- {
- possibleMatch &= ~(1<<i);
- }
- }
- }
- }
-
- // return the configurations found
- int n=0;
- if (possibleMatch) {
- if (configs) {
- for (int i=0 ; config_size && i<numConfigs ; i++) {
- if (possibleMatch & (1<<i)) {
- *configs++ = (EGLConfig)i;
- config_size--;
- n++;
- }
- }
- } else {
- for (int i=0 ; i<numConfigs ; i++) {
- if (possibleMatch & (1<<i)) {
- n++;
- }
- }
- }
- }
- *num_config = n;
- return EGL_TRUE;
-}
-
-EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
- EGLint attribute, EGLint *value)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- return getConfigAttrib(dpy, config, attribute, value);
-}
-
-// ----------------------------------------------------------------------------
-// surfaces
-// ----------------------------------------------------------------------------
-
-EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
- NativeWindowType window,
- const EGLint *attrib_list)
-{
- return createWindowSurface(dpy, config, window, attrib_list);
-}
-
-EGLSurface eglCreatePixmapSurface( EGLDisplay dpy, EGLConfig config,
- NativePixmapType pixmap,
- const EGLint *attrib_list)
-{
- return createPixmapSurface(dpy, config, pixmap, attrib_list);
-}
-
-EGLSurface eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list)
-{
- return createPbufferSurface(dpy, config, attrib_list);
-}
-
-EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface eglSurface)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- if (eglSurface != EGL_NO_SURFACE) {
- egl_surface_t* surface( static_cast<egl_surface_t*>(eglSurface) );
- if (!surface->isValid())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
- if (surface->dpy != dpy)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- if (surface->ctx) {
- // FIXME: this surface is current check what the spec says
- surface->disconnect();
- surface->ctx = 0;
- }
- delete surface;
- }
- return EGL_TRUE;
-}
-
-EGLBoolean eglQuerySurface( EGLDisplay dpy, EGLSurface eglSurface,
- EGLint attribute, EGLint *value)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- egl_surface_t* surface = static_cast<egl_surface_t*>(eglSurface);
- if (!surface->isValid())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
- if (surface->dpy != dpy)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- EGLBoolean ret = EGL_TRUE;
- switch (attribute) {
- case EGL_CONFIG_ID:
- ret = getConfigAttrib(dpy, surface->config, EGL_CONFIG_ID, value);
- break;
- case EGL_WIDTH:
- *value = surface->getWidth();
- break;
- case EGL_HEIGHT:
- *value = surface->getHeight();
- break;
- case EGL_LARGEST_PBUFFER:
- // not modified for a window or pixmap surface
- break;
- case EGL_TEXTURE_FORMAT:
- *value = EGL_NO_TEXTURE;
- break;
- case EGL_TEXTURE_TARGET:
- *value = EGL_NO_TEXTURE;
- break;
- case EGL_MIPMAP_TEXTURE:
- *value = EGL_FALSE;
- break;
- case EGL_MIPMAP_LEVEL:
- *value = 0;
- break;
- case EGL_RENDER_BUFFER:
- // TODO: return the real RENDER_BUFFER here
- *value = EGL_BACK_BUFFER;
- break;
- case EGL_HORIZONTAL_RESOLUTION:
- // pixel/mm * EGL_DISPLAY_SCALING
- *value = surface->getHorizontalResolution();
- break;
- case EGL_VERTICAL_RESOLUTION:
- // pixel/mm * EGL_DISPLAY_SCALING
- *value = surface->getVerticalResolution();
- break;
- case EGL_PIXEL_ASPECT_RATIO: {
- // w/h * EGL_DISPLAY_SCALING
- int wr = surface->getHorizontalResolution();
- int hr = surface->getVerticalResolution();
- *value = (wr * EGL_DISPLAY_SCALING) / hr;
- } break;
- case EGL_SWAP_BEHAVIOR:
- *value = surface->getSwapBehavior();
- break;
- default:
- ret = setError(EGL_BAD_ATTRIBUTE, EGL_FALSE);
- }
- return ret;
-}
-
-EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config,
- EGLContext share_list, const EGLint *attrib_list)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_NO_SURFACE);
-
- ogles_context_t* gl = ogles_init(sizeof(egl_context_t));
- if (!gl) return setError(EGL_BAD_ALLOC, EGL_NO_CONTEXT);
-
- egl_context_t* c = static_cast<egl_context_t*>(gl->rasterizer.base);
- c->flags = egl_context_t::NEVER_CURRENT;
- c->dpy = dpy;
- c->config = config;
- c->read = 0;
- c->draw = 0;
- return (EGLContext)gl;
-}
-
-EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- egl_context_t* c = egl_context_t::context(ctx);
- if (c->flags & egl_context_t::IS_CURRENT)
- setGlThreadSpecific(0);
- ogles_uninit((ogles_context_t*)ctx);
- return EGL_TRUE;
-}
-
-EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
- EGLSurface read, EGLContext ctx)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- if (draw) {
- egl_surface_t* s = (egl_surface_t*)draw;
- if (!s->isValid())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
- if (s->dpy != dpy)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- // TODO: check that draw is compatible with the context
- }
- if (read && read!=draw) {
- egl_surface_t* s = (egl_surface_t*)read;
- if (!s->isValid())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
- if (s->dpy != dpy)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- // TODO: check that read is compatible with the context
- }
-
- EGLContext current_ctx = EGL_NO_CONTEXT;
-
- if ((read == EGL_NO_SURFACE && draw == EGL_NO_SURFACE) && (ctx != EGL_NO_CONTEXT))
- return setError(EGL_BAD_MATCH, EGL_FALSE);
-
- if ((read != EGL_NO_SURFACE || draw != EGL_NO_SURFACE) && (ctx == EGL_NO_CONTEXT))
- return setError(EGL_BAD_MATCH, EGL_FALSE);
-
- if (ctx == EGL_NO_CONTEXT) {
- // if we're detaching, we need the current context
- current_ctx = (EGLContext)getGlThreadSpecific();
- } else {
- egl_context_t* c = egl_context_t::context(ctx);
- egl_surface_t* d = (egl_surface_t*)draw;
- egl_surface_t* r = (egl_surface_t*)read;
- if ((d && d->ctx && d->ctx != ctx) ||
- (r && r->ctx && r->ctx != ctx)) {
- // one of the surface is bound to a context in another thread
- return setError(EGL_BAD_ACCESS, EGL_FALSE);
- }
- }
-
- ogles_context_t* gl = (ogles_context_t*)ctx;
- if (makeCurrent(gl) == 0) {
- if (ctx) {
- egl_context_t* c = egl_context_t::context(ctx);
- egl_surface_t* d = (egl_surface_t*)draw;
- egl_surface_t* r = (egl_surface_t*)read;
-
- if (c->draw) {
- egl_surface_t* s = reinterpret_cast<egl_surface_t*>(c->draw);
- s->disconnect();
- }
- if (c->read) {
- // FIXME: unlock/disconnect the read surface too
- }
-
- c->draw = draw;
- c->read = read;
-
- if (c->flags & egl_context_t::NEVER_CURRENT) {
- c->flags &= ~egl_context_t::NEVER_CURRENT;
- GLint w = 0;
- GLint h = 0;
- if (draw) {
- w = d->getWidth();
- h = d->getHeight();
- }
- ogles_surfaceport(gl, 0, 0);
- ogles_viewport(gl, 0, 0, w, h);
- ogles_scissor(gl, 0, 0, w, h);
- }
- if (d) {
- if (d->connect() == EGL_FALSE) {
- return EGL_FALSE;
- }
- d->ctx = ctx;
- d->bindDrawSurface(gl);
- }
- if (r) {
- // FIXME: lock/connect the read surface too
- r->ctx = ctx;
- r->bindReadSurface(gl);
- }
- } else {
- // if surfaces were bound to the context bound to this thread
- // mark then as unbound.
- if (current_ctx) {
- egl_context_t* c = egl_context_t::context(current_ctx);
- egl_surface_t* d = (egl_surface_t*)c->draw;
- egl_surface_t* r = (egl_surface_t*)c->read;
- if (d) {
- c->draw = 0;
- d->ctx = EGL_NO_CONTEXT;
- d->disconnect();
- }
- if (r) {
- c->read = 0;
- r->ctx = EGL_NO_CONTEXT;
- // FIXME: unlock/disconnect the read surface too
- }
- }
- }
- return EGL_TRUE;
- }
- return setError(EGL_BAD_ACCESS, EGL_FALSE);
-}
-
-EGLContext eglGetCurrentContext(void)
-{
- // eglGetCurrentContext returns the current EGL rendering context,
- // as specified by eglMakeCurrent. If no context is current,
- // EGL_NO_CONTEXT is returned.
- return (EGLContext)getGlThreadSpecific();
-}
-
-EGLSurface eglGetCurrentSurface(EGLint readdraw)
-{
- // eglGetCurrentSurface returns the read or draw surface attached
- // to the current EGL rendering context, as specified by eglMakeCurrent.
- // If no context is current, EGL_NO_SURFACE is returned.
- EGLContext ctx = (EGLContext)getGlThreadSpecific();
- if (ctx == EGL_NO_CONTEXT) return EGL_NO_SURFACE;
- egl_context_t* c = egl_context_t::context(ctx);
- if (readdraw == EGL_READ) {
- return c->read;
- } else if (readdraw == EGL_DRAW) {
- return c->draw;
- }
- return setError(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
-}
-
-EGLDisplay eglGetCurrentDisplay(void)
-{
- // eglGetCurrentDisplay returns the current EGL display connection
- // for the current EGL rendering context, as specified by eglMakeCurrent.
- // If no context is current, EGL_NO_DISPLAY is returned.
- EGLContext ctx = (EGLContext)getGlThreadSpecific();
- if (ctx == EGL_NO_CONTEXT) return EGL_NO_DISPLAY;
- egl_context_t* c = egl_context_t::context(ctx);
- return c->dpy;
-}
-
-EGLBoolean eglQueryContext( EGLDisplay dpy, EGLContext ctx,
- EGLint attribute, EGLint *value)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- egl_context_t* c = egl_context_t::context(ctx);
- switch (attribute) {
- case EGL_CONFIG_ID:
- // Returns the ID of the EGL frame buffer configuration with
- // respect to which the context was created
- return getConfigAttrib(dpy, c->config, EGL_CONFIG_ID, value);
- }
- return setError(EGL_BAD_ATTRIBUTE, EGL_FALSE);
-}
-
-EGLBoolean eglWaitGL(void)
-{
- return EGL_TRUE;
-}
-
-EGLBoolean eglWaitNative(EGLint engine)
-{
- return EGL_TRUE;
-}
-
-EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- egl_surface_t* d = static_cast<egl_surface_t*>(draw);
- if (!d->isValid())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
- if (d->dpy != dpy)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- // post the surface
- d->swapBuffers();
-
- // if it's bound to a context, update the buffer
- if (d->ctx != EGL_NO_CONTEXT) {
- d->bindDrawSurface((ogles_context_t*)d->ctx);
- // if this surface is also the read surface of the context
- // it is bound to, make sure to update the read buffer as well.
- // The EGL spec is a little unclear about this.
- egl_context_t* c = egl_context_t::context(d->ctx);
- if (c->read == draw) {
- d->bindReadSurface((ogles_context_t*)d->ctx);
- }
- }
-
- return EGL_TRUE;
-}
-
-EGLBoolean eglCopyBuffers( EGLDisplay dpy, EGLSurface surface,
- NativePixmapType target)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- // TODO: eglCopyBuffers()
- return EGL_FALSE;
-}
-
-EGLint eglGetError(void)
-{
- return getError();
-}
-
-const char* eglQueryString(EGLDisplay dpy, EGLint name)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, (const char*)0);
-
- switch (name) {
- case EGL_VENDOR:
- return gVendorString;
- case EGL_VERSION:
- return gVersionString;
- case EGL_EXTENSIONS:
- return gExtensionsString;
- case EGL_CLIENT_APIS:
- return gClientApiString;
- }
- return setError(EGL_BAD_PARAMETER, (const char *)0);
-}
-
-// ----------------------------------------------------------------------------
-// EGL 1.1
-// ----------------------------------------------------------------------------
-
-EGLBoolean eglSurfaceAttrib(
- EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- // TODO: eglSurfaceAttrib()
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
-}
-
-EGLBoolean eglBindTexImage(
- EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- // TODO: eglBindTexImage()
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
-}
-
-EGLBoolean eglReleaseTexImage(
- EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- // TODO: eglReleaseTexImage()
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
-}
-
-EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- // TODO: eglSwapInterval()
- return EGL_TRUE;
-}
-
-// ----------------------------------------------------------------------------
-// EGL 1.2
-// ----------------------------------------------------------------------------
-
-EGLBoolean eglBindAPI(EGLenum api)
-{
- if (api != EGL_OPENGL_ES_API)
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- return EGL_TRUE;
-}
-
-EGLenum eglQueryAPI(void)
-{
- return EGL_OPENGL_ES_API;
-}
-
-EGLBoolean eglWaitClient(void)
-{
- glFinish();
- return EGL_TRUE;
-}
-
-EGLBoolean eglReleaseThread(void)
-{
- // TODO: eglReleaseThread()
- return EGL_TRUE;
-}
-
-EGLSurface eglCreatePbufferFromClientBuffer(
- EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
- EGLConfig config, const EGLint *attrib_list)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_NO_SURFACE);
- // TODO: eglCreatePbufferFromClientBuffer()
- return setError(EGL_BAD_PARAMETER, EGL_NO_SURFACE);
-}
-
-// ----------------------------------------------------------------------------
-// EGL_EGLEXT_VERSION 3
-// ----------------------------------------------------------------------------
-
-void (*eglGetProcAddress (const char *procname))()
-{
- extention_map_t const * const map = gExtentionMap;
- for (uint32_t i=0 ; i<NELEM(gExtentionMap) ; i++) {
- if (!strcmp(procname, map[i].name)) {
- return map[i].address;
- }
- }
- return NULL;
-}
-
-EGLBoolean eglLockSurfaceKHR(EGLDisplay dpy, EGLSurface surface,
- const EGLint *attrib_list)
-{
- EGLBoolean result = EGL_FALSE;
- return result;
-}
-
-EGLBoolean eglUnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface)
-{
- EGLBoolean result = EGL_FALSE;
- return result;
-}
-
-EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
- EGLClientBuffer buffer, const EGLint *attrib_list)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE) {
- return setError(EGL_BAD_DISPLAY, EGL_NO_IMAGE_KHR);
- }
- if (ctx != EGL_NO_CONTEXT) {
- return setError(EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR);
- }
- if (target != EGL_NATIVE_BUFFER_ANDROID) {
- return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
- }
-
- ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)buffer;
-
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
- return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
-
- if (native_buffer->common.version != sizeof(ANativeWindowBuffer))
- return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
-
- switch (native_buffer->format) {
- case HAL_PIXEL_FORMAT_RGBA_8888:
- case HAL_PIXEL_FORMAT_RGBX_8888:
- case HAL_PIXEL_FORMAT_RGB_888:
- case HAL_PIXEL_FORMAT_RGB_565:
- case HAL_PIXEL_FORMAT_BGRA_8888:
- case HAL_PIXEL_FORMAT_RGBA_5551:
- case HAL_PIXEL_FORMAT_RGBA_4444:
- break;
- default:
- return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
- }
-
- native_buffer->common.incRef(&native_buffer->common);
- return (EGLImageKHR)native_buffer;
-}
-
-EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE) {
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- }
-
- ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)img;
-
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
-
- if (native_buffer->common.version != sizeof(ANativeWindowBuffer))
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
-
- native_buffer->common.decRef(&native_buffer->common);
-
- return EGL_TRUE;
-}
-
-// ----------------------------------------------------------------------------
-// ANDROID extensions
-// ----------------------------------------------------------------------------
-
-EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw,
- EGLint left, EGLint top, EGLint width, EGLint height)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- egl_surface_t* d = static_cast<egl_surface_t*>(draw);
- if (!d->isValid())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
- if (d->dpy != dpy)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- // post the surface
- d->setSwapRectangle(left, top, width, height);
-
- return EGL_TRUE;
-}
diff --git a/opengl/libagl/fixed_asm.S b/opengl/libagl/fixed_asm.S
deleted file mode 100644
index 05044f2..0000000
--- a/opengl/libagl/fixed_asm.S
+++ /dev/null
@@ -1,67 +0,0 @@
-/* libs/opengles/fixed_asm.S
-**
-** Copyright 2006, 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.
-*/
-
-
- .text
- .align
-
- .global gglFloatToFixed
- .type gglFloatToFixed, %function
- .global gglFloatToFixedFast
- .type gglFloatToFixedFast, %function
-
-
-/*
- * Converts a float to a s15.16 fixed-point number.
- * this doesn't handle floats out of the [-32768, +32768[ range
- * and doesn't performs round-to-nearest.
- * however, it's very fast :-)
- */
-
-gglFloatToFixedFast:
- movs r1, r0, lsl #1 /* remove bit sign */
- mov r2, #0x8E /* 127 + 15 */
- sub r1, r2, r1, lsr #24 /* compute shift */
- mov r2, r0, lsl #8 /* mantissa<<8 */
- orr r2, r2, #0x80000000 /* add the missing 1 */
- mov r0, r2, lsr r1 /* scale to 16.16 */
- rsbcs r0, r0, #0 /* negate if needed */
- bx lr
-
-/*
- * this version rounds-to-nearest and saturates numbers
- * outside the range (but not NaNs).
- */
-
-gglFloatToFixed:
- mov r1, r0, lsl #1 /* remove bit sign */
- mov r2, #0x8E /* 127 + 15 */
- subs r1, r2, r1, lsr #24 /* compute shift */
- bls 0f /* too big */
- mov r2, r0, lsl #8 /* mantissa<<8 */
- orr r2, r2, #0x80000000 /* add the missing 1 */
- mov r3, r0
- movs r0, r2, lsr r1 /* scale to 16.16 */
- addcs r0, r0, #1 /* round-to-nearest */
- tst r3, #0x80000000 /* negative? */
- rsbne r0, r0, #0 /* negate if needed */
- bx lr
-
-0: ands r0, r0, #0x80000000 /* keep only the sign bit */
- moveq r0, #0x7fffffff /* positive, maximum value */
- bx lr
-
diff --git a/opengl/libagl/fp.cpp b/opengl/libagl/fp.cpp
deleted file mode 100644
index ae5f1fe..0000000
--- a/opengl/libagl/fp.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/* libs/opengles/fp.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include "fp.h"
-
-// ----------------------------------------------------------------------------
-
-#if !defined(__arm__)
-GGLfixed gglFloatToFixed(float v) {
- return GGLfixed(floorf(v * 65536.0f + 0.5f));
-}
-#endif
-
-// ----------------------------------------------------------------------------
-
-namespace android {
-
-namespace gl {
-
-GLfloat fixedToFloat(GLfixed x)
-{
-#if DEBUG_USE_FLOATS
- return x / 65536.0f;
-#else
- if (!x) return 0;
- const uint32_t s = x & 0x80000000;
- union {
- uint32_t i;
- float f;
- };
- i = s ? -x : x;
- const int c = gglClz(i) - 8;
- i = (c>=0) ? (i<<c) : (i>>-c);
- const uint32_t e = 134 - c;
- i &= ~0x800000;
- i |= e<<23;
- i |= s;
- return f;
-#endif
-}
-
-float sinef(float x)
-{
- const float A = 1.0f / (2.0f*M_PI);
- const float B = -16.0f;
- const float C = 8.0f;
-
- // scale angle for easy argument reduction
- x *= A;
-
- if (fabsf(x) >= 0.5f) {
- // Argument reduction
- x = x - ceilf(x + 0.5f) + 1.0f;
- }
-
- const float y = B*x*fabsf(x) + C*x;
- return 0.2215f * (y*fabsf(y) - y) + y;
-}
-
-float cosinef(float x)
-{
- return sinef(x + float(M_PI/2));
-}
-
-void sincosf(GLfloat angle, GLfloat* s, GLfloat* c) {
- *s = sinef(angle);
- *c = cosinef(angle);
-}
-
-}; // namespace fp_utils
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/opengl/libagl/fp.h b/opengl/libagl/fp.h
deleted file mode 100644
index 6d0c183..0000000
--- a/opengl/libagl/fp.h
+++ /dev/null
@@ -1,243 +0,0 @@
-/* libs/opengles/fp.h
-**
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_FP_H
-#define ANDROID_OPENGLES_FP_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-#include <math.h>
-
-#include <private/pixelflinger/ggl_context.h>
-
-#include <GLES/gl.h>
-
-#define DEBUG_USE_FLOATS 0
-
-// ----------------------------------------------------------------------------
-
-extern "C" GLfixed gglFloatToFixed(float f) __attribute__((const));
-
-// ----------------------------------------------------------------------------
-namespace android {
-
-namespace gl {
-
- GLfloat fixedToFloat(GLfixed) CONST;
-
- void sincosf(GLfloat angle, GLfloat* s, GLfloat* c);
- float sinef(GLfloat x) CONST;
- float cosinef(GLfloat x) CONST;
-
-inline bool cmpf(GLfloat a, GLfloat b) CONST;
-inline bool isZerof(GLfloat) CONST;
-inline bool isOnef(GLfloat) CONST;
-
-inline int isZeroOrNegativef(GLfloat) CONST;
-
-inline int exponent(GLfloat) CONST;
-inline int32_t mantissa(GLfloat) CONST;
-inline GLfloat clampToZerof(GLfloat) CONST;
-inline GLfloat reciprocalf(GLfloat) CONST;
-inline GLfloat rsqrtf(GLfloat) CONST;
-inline GLfloat sqrf(GLfloat) CONST;
-inline GLfloat addExpf(GLfloat v, int e) CONST;
-inline GLfloat mul2f(GLfloat v) CONST;
-inline GLfloat div2f(GLfloat v) CONST;
-inline GLfloat absf(GLfloat v) CONST;
-
-
-/*
- * float fastexpf(float) : a fast approximation of expf(x)
- * give somewhat accurate results for -88 <= x <= 88
- *
- * exp(x) = 2^(x/ln(2))
- * we use the properties of float encoding
- * to get a fast 2^ and linear interpolation
- *
- */
-
-inline float fastexpf(float y) __attribute__((const));
-
-inline float fastexpf(float y)
-{
- union {
- float r;
- int32_t i;
- } u;
-
- // 127*ln(2) = 88
- if (y < -88.0f) {
- u.r = 0.0f;
- } else if (y > 88.0f) {
- u.r = INFINITY;
- } else {
- const float kOneOverLogTwo = (1L<<23) / M_LN2;
- const int32_t kExponentBias = 127L<<23;
- const int32_t e = int32_t(y*kOneOverLogTwo);
- u.i = e + kExponentBias;
- }
-
- return u.r;
-}
-
-
-bool cmpf(GLfloat a, GLfloat b) {
-#if DEBUG_USE_FLOATS
- return a == b;
-#else
- union {
- float f;
- uint32_t i;
- } ua, ub;
- ua.f = a;
- ub.f = b;
- return ua.i == ub.i;
-#endif
-}
-
-bool isZerof(GLfloat v) {
-#if DEBUG_USE_FLOATS
- return v == 0;
-#else
- union {
- float f;
- int32_t i;
- };
- f = v;
- return (i<<1) == 0;
-#endif
-}
-
-bool isOnef(GLfloat v) {
- return cmpf(v, 1.0f);
-}
-
-int isZeroOrNegativef(GLfloat v) {
-#if DEBUG_USE_FLOATS
- return v <= 0;
-#else
- union {
- float f;
- int32_t i;
- };
- f = v;
- return isZerof(v) | (i>>31);
-#endif
-}
-
-int exponent(GLfloat v) {
- union {
- float f;
- uint32_t i;
- };
- f = v;
- return ((i << 1) >> 24) - 127;
-}
-
-int32_t mantissa(GLfloat v) {
- union {
- float f;
- uint32_t i;
- };
- f = v;
- if (!(i&0x7F800000)) return 0;
- const int s = i >> 31;
- i |= (1L<<23);
- i &= ~0xFF000000;
- return s ? -i : i;
-}
-
-GLfloat clampToZerof(GLfloat v) {
-#if DEBUG_USE_FLOATS
- return v<0 ? 0 : (v>1 ? 1 : v);
-#else
- union {
- float f;
- int32_t i;
- };
- f = v;
- i &= ~(i>>31);
- return f;
-#endif
-}
-
-GLfloat reciprocalf(GLfloat v) {
- // XXX: do better
- return 1.0f / v;
-}
-
-GLfloat rsqrtf(GLfloat v) {
- // XXX: do better
- return 1.0f / sqrtf(v);
-}
-
-GLfloat sqrf(GLfloat v) {
- // XXX: do better
- return v*v;
-}
-
-GLfloat addExpf(GLfloat v, int e) {
- union {
- float f;
- int32_t i;
- };
- f = v;
- if (i<<1) { // XXX: deal with over/underflow
- i += int32_t(e)<<23;
- }
- return f;
-}
-
-GLfloat mul2f(GLfloat v) {
-#if DEBUG_USE_FLOATS
- return v*2;
-#else
- return addExpf(v, 1);
-#endif
-}
-
-GLfloat div2f(GLfloat v) {
-#if DEBUG_USE_FLOATS
- return v*0.5f;
-#else
- return addExpf(v, -1);
-#endif
-}
-
-GLfloat absf(GLfloat v) {
-#if DEBUG_USE_FLOATS
- return v<0 ? -v : v;
-#else
- union {
- float f;
- int32_t i;
- };
- f = v;
- i &= ~0x80000000;
- return f;
-#endif
-}
-
-}; // namespace gl
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_FP_H
-
diff --git a/opengl/libagl/iterators.S b/opengl/libagl/iterators.S
deleted file mode 100644
index 8c86482..0000000
--- a/opengl/libagl/iterators.S
+++ /dev/null
@@ -1,89 +0,0 @@
-/* libs/opengles/iterators.S
-**
-** Copyright 2006, 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.
-*/
-
-
- .text
- .align
- .arm
-
- .global iterators0032
- .type iterators0032, %function
-
-/*
- * iterators0032
- *
- * MUST BE CALLED FROM ARM CODE
- *
- * r0: const compute_iterators_t* (this)
- * r0 + 0: m_dx01
- * r0 + 4: m_dy10
- * r0 + 8: m_dx20
- * r0 +12: m_dy02
- * r0 +16: m_x0
- * r0 +20: m_y0
- * r0 +24: m_area
- * r0 +28: m_scale
- * r0 +29: m_area_scale;
- * r1: int32_t* (out)
- * r1 + 0: c
- * r1 + 4: dcdx
- * r1 + 8: dcdy
- * r2: c0
- * r3: c1
- * [sp]: c2
- */
-
-iterators0032:
- stmfd sp!, {r4, r5, r6, r7, r8, lr}
- ldr r4, [sp, #4*6]
-
- ldrb r12, [r0, #29]
- sub r3, r3, r2
- sub r4, r4, r2
- sub r12, r12, #16
- mov r3, r3, asr r12
- mov r4, r4, asr r12
-
- ldr r5, [r0, #0]
- ldr r12, [r0, #4]
- smull r8, lr, r4, r5
- ldr r5, [r0, #8]
- smull r6, r7, r4, r12
- ldr r12, [r0, #12]
- smlal r8, lr, r3, r5
- smlal r6, r7, r3, r12
-
- ldr r3, [r0, #16] // m_x0
- ldr r4, [r0, #20] // m_x1
-
- str r6, [r1, #4]
- str r8, [r1, #8]
-
- umull r6, r5, r3, r6
- umull r8, r0, r4, r8
- mla r7, r3, r7, r5
- mla lr, r4, lr, r0
- adds r6, r6, r8
- adc r7, r7, lr
-
- movs r6, r6, lsr #4
- adc r6, r6, r7, lsl #28
- rsb r6, r6, r2, lsl #16
- str r6, [r1, #0]
-
- ldmfd sp!, {r4, r5, r6, r7, r8, pc}
-
diff --git a/opengl/libagl/light.cpp b/opengl/libagl/light.cpp
deleted file mode 100644
index ca715db..0000000
--- a/opengl/libagl/light.cpp
+++ /dev/null
@@ -1,876 +0,0 @@
-/* libs/opengles/light.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdio.h>
-#include "context.h"
-#include "fp.h"
-#include "light.h"
-#include "state.h"
-#include "matrix.h"
-
-
-#if defined(__arm__) && defined(__thumb__)
-#warning "light.cpp should not be compiled in thumb on ARM."
-#endif
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-static void invalidate_lighting(ogles_context_t* c);
-static void lightVertexValidate(ogles_context_t* c, vertex_t* v);
-static void lightVertexNop(ogles_context_t* c, vertex_t* v);
-static void lightVertex(ogles_context_t* c, vertex_t* v);
-static void lightVertexMaterial(ogles_context_t* c, vertex_t* v);
-
-static inline void vscale3(GLfixed* d, const GLfixed* m, GLfixed s);
-
-static __attribute__((noinline))
-void vnorm3(GLfixed* d, const GLfixed* a);
-
-static inline void vsa3(GLfixed* d,
- const GLfixed* m, GLfixed s, const GLfixed* a);
-static inline void vss3(GLfixed* d,
- const GLfixed* m, GLfixed s, const GLfixed* a);
-static inline void vmla3(GLfixed* d,
- const GLfixed* m0, const GLfixed* m1, const GLfixed* a);
-static inline void vmul3(GLfixed* d,
- const GLfixed* m0, const GLfixed* m1);
-
-static GLfixed fog_linear(ogles_context_t* c, GLfixed z);
-static GLfixed fog_exp(ogles_context_t* c, GLfixed z);
-static GLfixed fog_exp2(ogles_context_t* c, GLfixed z);
-
-
-// ----------------------------------------------------------------------------
-
-static void init_white(vec4_t& c) {
- c.r = c.g = c.b = c.a = 0x10000;
-}
-
-void ogles_init_light(ogles_context_t* c)
-{
- for (unsigned int i=0 ; i<OGLES_MAX_LIGHTS ; i++) {
- c->lighting.lights[i].ambient.a = 0x10000;
- c->lighting.lights[i].position.z = 0x10000;
- c->lighting.lights[i].spotDir.z = -0x10000;
- c->lighting.lights[i].spotCutoff = gglIntToFixed(180);
- c->lighting.lights[i].attenuation[0] = 0x10000;
- }
- init_white(c->lighting.lights[0].diffuse);
- init_white(c->lighting.lights[0].specular);
-
- c->lighting.front.ambient.r =
- c->lighting.front.ambient.g =
- c->lighting.front.ambient.b = gglFloatToFixed(0.2f);
- c->lighting.front.ambient.a = 0x10000;
- c->lighting.front.diffuse.r =
- c->lighting.front.diffuse.g =
- c->lighting.front.diffuse.b = gglFloatToFixed(0.8f);
- c->lighting.front.diffuse.a = 0x10000;
- c->lighting.front.specular.a = 0x10000;
- c->lighting.front.emission.a = 0x10000;
-
- c->lighting.lightModel.ambient.r =
- c->lighting.lightModel.ambient.g =
- c->lighting.lightModel.ambient.b = gglFloatToFixed(0.2f);
- c->lighting.lightModel.ambient.a = 0x10000;
-
- c->lighting.colorMaterial.face = GL_FRONT_AND_BACK;
- c->lighting.colorMaterial.mode = GL_AMBIENT_AND_DIFFUSE;
-
- c->fog.mode = GL_EXP;
- c->fog.fog = fog_exp;
- c->fog.density = 0x10000;
- c->fog.end = 0x10000;
- c->fog.invEndMinusStart = 0x10000;
-
- invalidate_lighting(c);
-
- c->rasterizer.procs.shadeModel(c, GL_SMOOTH);
- c->lighting.shadeModel = GL_SMOOTH;
-}
-
-void ogles_uninit_light(ogles_context_t* c)
-{
-}
-
-static inline int32_t clampF(GLfixed f) CONST;
-int32_t clampF(GLfixed f) {
- f = (f & ~(f>>31));
- if (f >= 0x10000)
- f = 0x10000;
- return f;
-}
-
-static GLfixed fog_linear(ogles_context_t* c, GLfixed z) {
- return clampF(gglMulx((c->fog.end - ((z<0)?-z:z)), c->fog.invEndMinusStart));
-}
-
-static GLfixed fog_exp(ogles_context_t* c, GLfixed z) {
- const float e = fixedToFloat(gglMulx(c->fog.density, ((z<0)?-z:z)));
- return clampF(gglFloatToFixed(fastexpf(-e)));
-}
-
-static GLfixed fog_exp2(ogles_context_t* c, GLfixed z) {
- const float e = fixedToFloat(gglMulx(c->fog.density, z));
- return clampF(gglFloatToFixed(fastexpf(-e*e)));
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark math helpers
-#endif
-
-static inline
-void vscale3(GLfixed* d, const GLfixed* m, GLfixed s) {
- d[0] = gglMulx(m[0], s);
- d[1] = gglMulx(m[1], s);
- d[2] = gglMulx(m[2], s);
-}
-
-static inline
-void vsa3(GLfixed* d, const GLfixed* m, GLfixed s, const GLfixed* a) {
- d[0] = gglMulAddx(m[0], s, a[0]);
- d[1] = gglMulAddx(m[1], s, a[1]);
- d[2] = gglMulAddx(m[2], s, a[2]);
-}
-
-static inline
-void vss3(GLfixed* d, const GLfixed* m, GLfixed s, const GLfixed* a) {
- d[0] = gglMulSubx(m[0], s, a[0]);
- d[1] = gglMulSubx(m[1], s, a[1]);
- d[2] = gglMulSubx(m[2], s, a[2]);
-}
-
-static inline
-void vmla3(GLfixed* d,
- const GLfixed* m0, const GLfixed* m1, const GLfixed* a)
-{
- d[0] = gglMulAddx(m0[0], m1[0], a[0]);
- d[1] = gglMulAddx(m0[1], m1[1], a[1]);
- d[2] = gglMulAddx(m0[2], m1[2], a[2]);
-}
-
-static inline
-void vmul3(GLfixed* d, const GLfixed* m0, const GLfixed* m1) {
- d[0] = gglMulx(m0[0], m1[0]);
- d[1] = gglMulx(m0[1], m1[1]);
- d[2] = gglMulx(m0[2], m1[2]);
-}
-
-void vnorm3(GLfixed* d, const GLfixed* a)
-{
- // we must take care of overflows when normalizing a vector
- GLfixed n;
- int32_t x = a[0]; x = x>=0 ? x : -x;
- int32_t y = a[1]; y = y>=0 ? y : -y;
- int32_t z = a[2]; z = z>=0 ? z : -z;
- if (ggl_likely(x<=0x6800 && y<=0x6800 && z<= 0x6800)) {
- // in this case this will all fit on 32 bits
- n = x*x + y*y + z*z;
- n = gglSqrtRecipx(n);
- n <<= 8;
- } else {
- // here norm^2 is at least 0x7EC00000 (>>32 == 0.495117)
- n = vsquare3(x, y, z);
- n = gglSqrtRecipx(n);
- }
- vscale3(d, a, n);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark lighting equations
-#endif
-
-static inline void light_picker(ogles_context_t* c)
-{
- if (ggl_likely(!c->lighting.enable)) {
- c->lighting.lightVertex = lightVertexNop;
- return;
- }
- if (c->lighting.colorMaterial.enable) {
- c->lighting.lightVertex = lightVertexMaterial;
- } else {
- c->lighting.lightVertex = lightVertex;
- }
-}
-
-static inline void validate_light_mvi(ogles_context_t* c)
-{
- uint32_t en = c->lighting.enabledLights;
- // Vector from object to viewer, in eye coordinates
- while (en) {
- const int i = 31 - gglClz(en);
- en &= ~(1<<i);
- light_t& l = c->lighting.lights[i];
-#if OBJECT_SPACE_LIGHTING
- c->transforms.mvui.point4(&c->transforms.mvui,
- &l.objPosition, &l.position);
-#else
- l.objPosition = l.position;
-#endif
- vnorm3(l.normalizedObjPosition.v, l.objPosition.v);
- }
- const vec4_t eyeViewer = { 0, 0, 0x10000, 0 };
-#if OBJECT_SPACE_LIGHTING
- c->transforms.mvui.point3(&c->transforms.mvui,
- &c->lighting.objViewer, &eyeViewer);
- vnorm3(c->lighting.objViewer.v, c->lighting.objViewer.v);
-#else
- c->lighting.objViewer = eyeViewer;
-#endif
-}
-
-static inline void validate_light(ogles_context_t* c)
-{
- // if colorMaterial is enabled, we get the color from the vertex
- if (!c->lighting.colorMaterial.enable) {
- material_t& material = c->lighting.front;
- uint32_t en = c->lighting.enabledLights;
- while (en) {
- const int i = 31 - gglClz(en);
- en &= ~(1<<i);
- light_t& l = c->lighting.lights[i];
- vmul3(l.implicitAmbient.v, material.ambient.v, l.ambient.v);
- vmul3(l.implicitDiffuse.v, material.diffuse.v, l.diffuse.v);
- vmul3(l.implicitSpecular.v, material.specular.v, l.specular.v);
-
- // this is just a flag to tell if we have a specular component
- l.implicitSpecular.v[3] =
- l.implicitSpecular.r |
- l.implicitSpecular.g |
- l.implicitSpecular.b;
-
- l.rConstAttenuation = (l.attenuation[1] | l.attenuation[2])==0;
- if (l.rConstAttenuation)
- l.rConstAttenuation = gglRecipFast(l.attenuation[0]);
- }
- // emission and ambient for the whole scene
- vmla3( c->lighting.implicitSceneEmissionAndAmbient.v,
- c->lighting.lightModel.ambient.v,
- material.ambient.v,
- material.emission.v);
- c->lighting.implicitSceneEmissionAndAmbient.a = material.diffuse.a;
- }
- validate_light_mvi(c);
-}
-
-void invalidate_lighting(ogles_context_t* c)
-{
- // TODO: pick lightVertexValidate or lightVertexValidateMVI
- // instead of systematically the heavier lightVertexValidate()
- c->lighting.lightVertex = lightVertexValidate;
-}
-
-void ogles_invalidate_lighting_mvui(ogles_context_t* c)
-{
- invalidate_lighting(c);
-}
-
-void lightVertexNop(ogles_context_t*, vertex_t* v)
-{
- // we should never end-up here
-}
-
-void lightVertexValidateMVI(ogles_context_t* c, vertex_t* v)
-{
- validate_light_mvi(c);
- light_picker(c);
- c->lighting.lightVertex(c, v);
-}
-
-void lightVertexValidate(ogles_context_t* c, vertex_t* v)
-{
- validate_light(c);
- light_picker(c);
- c->lighting.lightVertex(c, v);
-}
-
-void lightVertexMaterial(ogles_context_t* c, vertex_t* v)
-{
- // fetch the material color
- const GLvoid* cp = c->arrays.color.element(
- v->index & vertex_cache_t::INDEX_MASK);
- c->arrays.color.fetch(c, v->color.v, cp);
-
- // acquire the color-material from the vertex
- material_t& material = c->lighting.front;
- material.ambient =
- material.diffuse = v->color;
- // implicit arguments need to be computed per/vertex
- uint32_t en = c->lighting.enabledLights;
- while (en) {
- const int i = 31 - gglClz(en);
- en &= ~(1<<i);
- light_t& l = c->lighting.lights[i];
- vmul3(l.implicitAmbient.v, material.ambient.v, l.ambient.v);
- vmul3(l.implicitDiffuse.v, material.diffuse.v, l.diffuse.v);
- vmul3(l.implicitSpecular.v, material.specular.v, l.specular.v);
- // this is just a flag to tell if we have a specular component
- l.implicitSpecular.v[3] =
- l.implicitSpecular.r |
- l.implicitSpecular.g |
- l.implicitSpecular.b;
- }
- // emission and ambient for the whole scene
- vmla3( c->lighting.implicitSceneEmissionAndAmbient.v,
- c->lighting.lightModel.ambient.v,
- material.ambient.v,
- material.emission.v);
- c->lighting.implicitSceneEmissionAndAmbient.a = material.diffuse.a;
-
- // now we can light our vertex as usual
- lightVertex(c, v);
-}
-
-void lightVertex(ogles_context_t* c, vertex_t* v)
-{
- // emission and ambient for the whole scene
- vec4_t r = c->lighting.implicitSceneEmissionAndAmbient;
- const vec4_t objViewer = c->lighting.objViewer;
-
- uint32_t en = c->lighting.enabledLights;
- if (ggl_likely(en)) {
- // since we do the lighting in object-space, we don't need to
- // transform each normal. However, we might still have to normalize
- // it if GL_NORMALIZE is enabled.
- vec4_t n;
- c->arrays.normal.fetch(c, n.v,
- c->arrays.normal.element(v->index & vertex_cache_t::INDEX_MASK));
-
-#if !OBJECT_SPACE_LIGHTING
- c->transforms.mvui.point3(&c->transforms.mvui, &n, &n);
-#endif
-
- // TODO: right now we handle GL_RESCALE_NORMALS as if it were
- // GL_NORMALIZE. We could optimize this by scaling mvui
- // appropriately instead.
- if (c->transforms.rescaleNormals)
- vnorm3(n.v, n.v);
-
- const material_t& material = c->lighting.front;
- const int twoSide = c->lighting.lightModel.twoSide;
-
- while (en) {
- const int i = 31 - gglClz(en);
- en &= ~(1<<i);
- const light_t& l = c->lighting.lights[i];
-
- vec4_t d, t;
- GLfixed s;
- GLfixed sqDist = 0x10000;
-
- // compute vertex-to-light vector
- if (ggl_unlikely(l.position.w)) {
- // lightPos/1.0 - vertex/vertex.w == lightPos*vertex.w - vertex
- vss3(d.v, l.objPosition.v, v->obj.w, v->obj.v);
- sqDist = dot3(d.v, d.v);
- vscale3(d.v, d.v, gglSqrtRecipx(sqDist));
- } else {
- // TODO: avoid copy here
- d = l.normalizedObjPosition;
- }
-
- // ambient & diffuse
- s = dot3(n.v, d.v);
- s = (s<0) ? (twoSide?(-s):0) : s;
- vsa3(t.v, l.implicitDiffuse.v, s, l.implicitAmbient.v);
-
- // specular
- if (ggl_unlikely(s && l.implicitSpecular.v[3])) {
- vec4_t h;
- h.x = d.x + objViewer.x;
- h.y = d.y + objViewer.y;
- h.z = d.z + objViewer.z;
- vnorm3(h.v, h.v);
- s = dot3(n.v, h.v);
- s = (s<0) ? (twoSide?(-s):0) : s;
- if (s > 0) {
- s = gglPowx(s, material.shininess);
- vsa3(t.v, l.implicitSpecular.v, s, t.v);
- }
- }
-
- // spot
- if (ggl_unlikely(l.spotCutoff != gglIntToFixed(180))) {
- GLfixed spotAtt = -dot3(l.normalizedSpotDir.v, d.v);
- if (spotAtt >= l.spotCutoffCosine) {
- vscale3(t.v, t.v, gglPowx(spotAtt, l.spotExp));
- }
- }
-
- // attenuation
- if (ggl_unlikely(l.position.w)) {
- if (l.rConstAttenuation) {
- s = l.rConstAttenuation;
- } else {
- s = gglMulAddx(sqDist, l.attenuation[2], l.attenuation[0]);
- if (l.attenuation[1])
- s = gglMulAddx(gglSqrtx(sqDist), l.attenuation[1], s);
- s = gglRecipFast(s);
- }
- vscale3(t.v, t.v, s);
- }
-
- r.r += t.r;
- r.g += t.g;
- r.b += t.b;
- }
- }
- v->color.r = gglClampx(r.r);
- v->color.g = gglClampx(r.g);
- v->color.b = gglClampx(r.b);
- v->color.a = gglClampx(r.a);
- v->flags |= vertex_t::LIT;
-}
-
-static void lightModelx(GLenum pname, GLfixed param, ogles_context_t* c)
-{
- if (ggl_unlikely(pname != GL_LIGHT_MODEL_TWO_SIDE)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->lighting.lightModel.twoSide = param ? GL_TRUE : GL_FALSE;
- invalidate_lighting(c);
-}
-
-static void lightx(GLenum i, GLenum pname, GLfixed param, ogles_context_t* c)
-{
- if (ggl_unlikely(uint32_t(i-GL_LIGHT0) >= OGLES_MAX_LIGHTS)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- light_t& light = c->lighting.lights[i-GL_LIGHT0];
- const GLfixed kDegToRad = GLfixed((M_PI * gglIntToFixed(1)) / 180.0f);
- switch (pname) {
- case GL_SPOT_EXPONENT:
- if (GGLfixed(param) >= gglIntToFixed(128)) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- light.spotExp = param;
- break;
- case GL_SPOT_CUTOFF:
- if (param!=gglIntToFixed(180) && GGLfixed(param)>=gglIntToFixed(90)) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- light.spotCutoff = param;
- light.spotCutoffCosine =
- gglFloatToFixed(cosinef((M_PI/(180.0f*65536.0f))*param));
- break;
- case GL_CONSTANT_ATTENUATION:
- if (param < 0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- light.attenuation[0] = param;
- break;
- case GL_LINEAR_ATTENUATION:
- if (param < 0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- light.attenuation[1] = param;
- break;
- case GL_QUADRATIC_ATTENUATION:
- if (param < 0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- light.attenuation[2] = param;
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- invalidate_lighting(c);
-}
-
-static void lightxv(GLenum i, GLenum pname, const GLfixed *params, ogles_context_t* c)
-{
- if (ggl_unlikely(uint32_t(i-GL_LIGHT0) >= OGLES_MAX_LIGHTS)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- GLfixed* what;
- light_t& light = c->lighting.lights[i-GL_LIGHT0];
- switch (pname) {
- case GL_AMBIENT:
- what = light.ambient.v;
- break;
- case GL_DIFFUSE:
- what = light.diffuse.v;
- break;
- case GL_SPECULAR:
- what = light.specular.v;
- break;
- case GL_POSITION: {
- ogles_validate_transform(c, transform_state_t::MODELVIEW);
- transform_t& mv = c->transforms.modelview.transform;
- mv.point4(&mv, &light.position, reinterpret_cast<vec4_t const*>(params));
- invalidate_lighting(c);
- return;
- }
- case GL_SPOT_DIRECTION: {
-#if OBJECT_SPACE_LIGHTING
- ogles_validate_transform(c, transform_state_t::MVUI);
- transform_t& mvui = c->transforms.mvui;
- mvui.point3(&mvui, &light.spotDir, reinterpret_cast<vec4_t const*>(params));
-#else
- light.spotDir = *reinterpret_cast<vec4_t const*>(params);
-#endif
- vnorm3(light.normalizedSpotDir.v, light.spotDir.v);
- invalidate_lighting(c);
- return;
- }
- default:
- lightx(i, pname, params[0], c);
- return;
- }
- what[0] = params[0];
- what[1] = params[1];
- what[2] = params[2];
- what[3] = params[3];
- invalidate_lighting(c);
-}
-
-static void materialx(GLenum face, GLenum pname, GLfixed param, ogles_context_t* c)
-{
- if (ggl_unlikely(face != GL_FRONT_AND_BACK)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (ggl_unlikely(pname != GL_SHININESS)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->lighting.front.shininess = param;
- invalidate_lighting(c);
-}
-
-static void fogx(GLenum pname, GLfixed param, ogles_context_t* c)
-{
- switch (pname) {
- case GL_FOG_DENSITY:
- if (param >= 0) {
- c->fog.density = param;
- break;
- }
- ogles_error(c, GL_INVALID_VALUE);
- break;
- case GL_FOG_START:
- c->fog.start = param;
- c->fog.invEndMinusStart = gglRecip(c->fog.end - c->fog.start);
- break;
- case GL_FOG_END:
- c->fog.end = param;
- c->fog.invEndMinusStart = gglRecip(c->fog.end - c->fog.start);
- break;
- case GL_FOG_MODE:
- switch (param) {
- case GL_LINEAR:
- c->fog.mode = param;
- c->fog.fog = fog_linear;
- break;
- case GL_EXP:
- c->fog.mode = param;
- c->fog.fog = fog_exp;
- break;
- case GL_EXP2:
- c->fog.mode = param;
- c->fog.fog = fog_exp2;
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- break;
- }
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- break;
- }
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-using namespace android;
-
-#if 0
-#pragma mark -
-#pragma mark lighting APIs
-#endif
-
-void glShadeModel(GLenum mode)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (ggl_unlikely(mode != GL_SMOOTH && mode != GL_FLAT)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->lighting.shadeModel = mode;
-}
-
-void glLightModelf(GLenum pname, GLfloat param)
-{
- ogles_context_t* c = ogles_context_t::get();
- lightModelx(pname, gglFloatToFixed(param), c);
-}
-
-void glLightModelx(GLenum pname, GLfixed param)
-{
- ogles_context_t* c = ogles_context_t::get();
- lightModelx(pname, param, c);
-}
-
-void glLightModelfv(GLenum pname, const GLfloat *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (pname == GL_LIGHT_MODEL_TWO_SIDE) {
- lightModelx(pname, gglFloatToFixed(params[0]), c);
- return;
- }
-
- if (ggl_unlikely(pname != GL_LIGHT_MODEL_AMBIENT)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- c->lighting.lightModel.ambient.r = gglFloatToFixed(params[0]);
- c->lighting.lightModel.ambient.g = gglFloatToFixed(params[1]);
- c->lighting.lightModel.ambient.b = gglFloatToFixed(params[2]);
- c->lighting.lightModel.ambient.a = gglFloatToFixed(params[3]);
- invalidate_lighting(c);
-}
-
-void glLightModelxv(GLenum pname, const GLfixed *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (pname == GL_LIGHT_MODEL_TWO_SIDE) {
- lightModelx(pname, params[0], c);
- return;
- }
-
- if (ggl_unlikely(pname != GL_LIGHT_MODEL_AMBIENT)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- c->lighting.lightModel.ambient.r = params[0];
- c->lighting.lightModel.ambient.g = params[1];
- c->lighting.lightModel.ambient.b = params[2];
- c->lighting.lightModel.ambient.a = params[3];
- invalidate_lighting(c);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-void glLightf(GLenum i, GLenum pname, GLfloat param)
-{
- ogles_context_t* c = ogles_context_t::get();
- lightx(i, pname, gglFloatToFixed(param), c);
-}
-
-void glLightx(GLenum i, GLenum pname, GLfixed param)
-{
- ogles_context_t* c = ogles_context_t::get();
- lightx(i, pname, param, c);
-}
-
-void glLightfv(GLenum i, GLenum pname, const GLfloat *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- switch (pname) {
- case GL_SPOT_EXPONENT:
- case GL_SPOT_CUTOFF:
- case GL_CONSTANT_ATTENUATION:
- case GL_LINEAR_ATTENUATION:
- case GL_QUADRATIC_ATTENUATION:
- lightx(i, pname, gglFloatToFixed(params[0]), c);
- return;
- }
-
- GLfixed paramsx[4];
- paramsx[0] = gglFloatToFixed(params[0]);
- paramsx[1] = gglFloatToFixed(params[1]);
- paramsx[2] = gglFloatToFixed(params[2]);
- if (pname != GL_SPOT_DIRECTION)
- paramsx[3] = gglFloatToFixed(params[3]);
-
- lightxv(i, pname, paramsx, c);
-}
-
-void glLightxv(GLenum i, GLenum pname, const GLfixed *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- lightxv(i, pname, params, c);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-void glMaterialf(GLenum face, GLenum pname, GLfloat param)
-{
- ogles_context_t* c = ogles_context_t::get();
- materialx(face, pname, gglFloatToFixed(param), c);
-}
-
-void glMaterialx(GLenum face, GLenum pname, GLfixed param)
-{
- ogles_context_t* c = ogles_context_t::get();
- materialx(face, pname, param, c);
-}
-
-void glMaterialfv(
- GLenum face, GLenum pname, const GLfloat *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (ggl_unlikely(face != GL_FRONT_AND_BACK)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- GLfixed* what=0;
- GLfixed* other=0;
- switch (pname) {
- case GL_AMBIENT: what = c->lighting.front.ambient.v; break;
- case GL_DIFFUSE: what = c->lighting.front.diffuse.v; break;
- case GL_SPECULAR: what = c->lighting.front.specular.v; break;
- case GL_EMISSION: what = c->lighting.front.emission.v; break;
- case GL_AMBIENT_AND_DIFFUSE:
- what = c->lighting.front.ambient.v;
- other = c->lighting.front.diffuse.v;
- break;
- case GL_SHININESS:
- c->lighting.front.shininess = gglFloatToFixed(params[0]);
- invalidate_lighting(c);
- return;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- what[0] = gglFloatToFixed(params[0]);
- what[1] = gglFloatToFixed(params[1]);
- what[2] = gglFloatToFixed(params[2]);
- what[3] = gglFloatToFixed(params[3]);
- if (other) {
- other[0] = what[0];
- other[1] = what[1];
- other[2] = what[2];
- other[3] = what[3];
- }
- invalidate_lighting(c);
-}
-
-void glMaterialxv(
- GLenum face, GLenum pname, const GLfixed *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (ggl_unlikely(face != GL_FRONT_AND_BACK)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- GLfixed* what=0;
- GLfixed* other=0;
- switch (pname) {
- case GL_AMBIENT: what = c->lighting.front.ambient.v; break;
- case GL_DIFFUSE: what = c->lighting.front.diffuse.v; break;
- case GL_SPECULAR: what = c->lighting.front.specular.v; break;
- case GL_EMISSION: what = c->lighting.front.emission.v; break;
- case GL_AMBIENT_AND_DIFFUSE:
- what = c->lighting.front.ambient.v;
- other = c->lighting.front.diffuse.v;
- break;
- case GL_SHININESS:
- c->lighting.front.shininess = gglFloatToFixed(params[0]);
- invalidate_lighting(c);
- return;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- what[0] = params[0];
- what[1] = params[1];
- what[2] = params[2];
- what[3] = params[3];
- if (other) {
- other[0] = what[0];
- other[1] = what[1];
- other[2] = what[2];
- other[3] = what[3];
- }
- invalidate_lighting(c);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark fog
-#endif
-
-void glFogf(GLenum pname, GLfloat param) {
- ogles_context_t* c = ogles_context_t::get();
- GLfixed paramx = (GLfixed)param;
- if (pname != GL_FOG_MODE)
- paramx = gglFloatToFixed(param);
- fogx(pname, paramx, c);
-}
-
-void glFogx(GLenum pname, GLfixed param) {
- ogles_context_t* c = ogles_context_t::get();
- fogx(pname, param, c);
-}
-
-void glFogfv(GLenum pname, const GLfloat *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (pname != GL_FOG_COLOR) {
- GLfixed paramx = (GLfixed)params[0];
- if (pname != GL_FOG_MODE)
- paramx = gglFloatToFixed(params[0]);
- fogx(pname, paramx, c);
- return;
- }
- GLfixed paramsx[4];
- paramsx[0] = gglFloatToFixed(params[0]);
- paramsx[1] = gglFloatToFixed(params[1]);
- paramsx[2] = gglFloatToFixed(params[2]);
- paramsx[3] = gglFloatToFixed(params[3]);
- c->rasterizer.procs.fogColor3xv(c, paramsx);
-}
-
-void glFogxv(GLenum pname, const GLfixed *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (pname != GL_FOG_COLOR) {
- fogx(pname, params[0], c);
- return;
- }
- c->rasterizer.procs.fogColor3xv(c, params);
-}
diff --git a/opengl/libagl/light.h b/opengl/libagl/light.h
deleted file mode 100644
index 39e3309..0000000
--- a/opengl/libagl/light.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* libs/opengles/light.h
-**
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_LIGHT_H
-#define ANDROID_OPENGLES_LIGHT_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-
-// Set to 1 for object-space lighting evaluation.
-// There are still some bugs with object-space lighting,
-// especially visible in the San Angeles demo.
-#define OBJECT_SPACE_LIGHTING 0
-
-
-namespace android {
-
-namespace gl {
-struct ogles_context_t;
-};
-
-void ogles_init_light(ogles_context_t* c);
-void ogles_uninit_light(ogles_context_t* c);
-void ogles_invalidate_lighting_mvui(ogles_context_t* c);
-
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_LIGHT_H
-
diff --git a/opengl/libagl/matrix.cpp b/opengl/libagl/matrix.cpp
deleted file mode 100644
index cdeccb3..0000000
--- a/opengl/libagl/matrix.cpp
+++ /dev/null
@@ -1,1134 +0,0 @@
-/* libs/opengles/matrix.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "context.h"
-#include "fp.h"
-#include "state.h"
-#include "matrix.h"
-#include "vertex.h"
-#include "light.h"
-
-#if defined(__arm__) && defined(__thumb__)
-#warning "matrix.cpp should not be compiled in thumb on ARM."
-#endif
-
-#define I(_i, _j) ((_j)+ 4*(_i))
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-static const GLfloat gIdentityf[16] = { 1,0,0,0,
- 0,1,0,0,
- 0,0,1,0,
- 0,0,0,1 };
-
-static const matrixx_t gIdentityx = {
- { 0x10000,0,0,0,
- 0,0x10000,0,0,
- 0,0,0x10000,0,
- 0,0,0,0x10000
- }
- };
-
-static void point2__nop(transform_t const*, vec4_t* c, vec4_t const* o);
-static void point3__nop(transform_t const*, vec4_t* c, vec4_t const* o);
-static void point4__nop(transform_t const*, vec4_t* c, vec4_t const* o);
-static void normal__nop(transform_t const*, vec4_t* c, vec4_t const* o);
-static void point2__generic(transform_t const*, vec4_t* c, vec4_t const* o);
-static void point3__generic(transform_t const*, vec4_t* c, vec4_t const* o);
-static void point4__generic(transform_t const*, vec4_t* c, vec4_t const* o);
-static void point3__mvui(transform_t const*, vec4_t* c, vec4_t const* o);
-static void point4__mvui(transform_t const*, vec4_t* c, vec4_t const* o);
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-void ogles_init_matrix(ogles_context_t* c)
-{
- c->transforms.modelview.init(OGLES_MODELVIEW_STACK_DEPTH);
- c->transforms.projection.init(OGLES_PROJECTION_STACK_DEPTH);
- for (int i=0; i<GGL_TEXTURE_UNIT_COUNT ; i++)
- c->transforms.texture[i].init(OGLES_TEXTURE_STACK_DEPTH);
-
- c->transforms.current = &c->transforms.modelview;
- c->transforms.matrixMode = GL_MODELVIEW;
- c->transforms.dirty = transform_state_t::VIEWPORT |
- transform_state_t::MVUI |
- transform_state_t::MVIT |
- transform_state_t::MVP;
- c->transforms.mvp.loadIdentity();
- c->transforms.mvp4.loadIdentity();
- c->transforms.mvit4.loadIdentity();
- c->transforms.mvui.loadIdentity();
- c->transforms.vpt.loadIdentity();
- c->transforms.vpt.zNear = 0.0f;
- c->transforms.vpt.zFar = 1.0f;
-}
-
-void ogles_uninit_matrix(ogles_context_t* c)
-{
- c->transforms.modelview.uninit();
- c->transforms.projection.uninit();
- for (int i=0; i<GGL_TEXTURE_UNIT_COUNT ; i++)
- c->transforms.texture[i].uninit();
-}
-
-static void validate_perspective(ogles_context_t* c, vertex_t* v)
-{
- const uint32_t enables = c->rasterizer.state.enables;
- c->arrays.perspective = (c->clipPlanes.enable) ?
- ogles_vertex_clipAllPerspective3D : ogles_vertex_perspective3D;
- if (enables & (GGL_ENABLE_DEPTH_TEST|GGL_ENABLE_FOG)) {
- c->arrays.perspective = ogles_vertex_perspective3DZ;
- if (c->clipPlanes.enable || (enables&GGL_ENABLE_FOG))
- c->arrays.perspective = ogles_vertex_clipAllPerspective3DZ;
- }
- if ((c->arrays.vertex.size != 4) &&
- (c->transforms.mvp4.flags & transform_t::FLAGS_2D_PROJECTION)) {
- c->arrays.perspective = ogles_vertex_perspective2D;
- }
- c->arrays.perspective(c, v);
-}
-
-void ogles_invalidate_perspective(ogles_context_t* c)
-{
- c->arrays.perspective = validate_perspective;
-}
-
-void ogles_validate_transform_impl(ogles_context_t* c, uint32_t want)
-{
- int dirty = c->transforms.dirty & want;
-
- // Validate the modelview
- if (dirty & transform_state_t::MODELVIEW) {
- c->transforms.modelview.validate();
- }
-
- // Validate the projection stack (in fact, it's never needed)
- if (dirty & transform_state_t::PROJECTION) {
- c->transforms.projection.validate();
- }
-
- // Validate the viewport transformation
- if (dirty & transform_state_t::VIEWPORT) {
- vp_transform_t& vpt = c->transforms.vpt;
- vpt.transform.matrix.load(vpt.matrix);
- vpt.transform.picker();
- }
-
- // We need to update the mvp (used to transform each vertex)
- if (dirty & transform_state_t::MVP) {
- c->transforms.update_mvp();
- // invalidate perspective (divide by W) and view volume clipping
- ogles_invalidate_perspective(c);
- }
-
- // Validate the mvui (for normal transformation)
- if (dirty & transform_state_t::MVUI) {
- c->transforms.update_mvui();
- ogles_invalidate_lighting_mvui(c);
- }
-
- // Validate the texture stack
- if (dirty & transform_state_t::TEXTURE) {
- for (int i=0; i<GGL_TEXTURE_UNIT_COUNT ; i++)
- c->transforms.texture[i].validate();
- }
-
- // Validate the mvit4 (user-clip planes)
- if (dirty & transform_state_t::MVIT) {
- c->transforms.update_mvit();
- }
-
- c->transforms.dirty &= ~want;
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark transform_t
-#endif
-
-void transform_t::loadIdentity() {
- matrix = gIdentityx;
- flags = 0;
- ops = OP_IDENTITY;
- point2 = point2__nop;
- point3 = point3__nop;
- point4 = point4__nop;
-}
-
-
-static inline
-int notZero(GLfixed v) {
- return abs(v) & ~0x3;
-}
-
-static inline
-int notOne(GLfixed v) {
- return notZero(v - 0x10000);
-}
-
-void transform_t::picker()
-{
- const GLfixed* const m = matrix.m;
-
- // XXX: picker needs to be smarter
- flags = 0;
- ops = OP_ALL;
- point2 = point2__generic;
- point3 = point3__generic;
- point4 = point4__generic;
-
- // find out if this is a 2D projection
- if (!(notZero(m[3]) | notZero(m[7]) | notZero(m[11]) | notOne(m[15]))) {
- flags |= FLAGS_2D_PROJECTION;
- }
-}
-
-void mvui_transform_t::picker()
-{
- flags = 0;
- ops = OP_ALL;
- point3 = point3__mvui;
- point4 = point4__mvui;
-}
-
-void transform_t::dump(const char* what)
-{
- GLfixed const * const m = matrix.m;
- ALOGD("%s:", what);
- for (int i=0 ; i<4 ; i++)
- ALOGD("[%08x %08x %08x %08x] [%f %f %f %f]\n",
- m[I(0,i)], m[I(1,i)], m[I(2,i)], m[I(3,i)],
- fixedToFloat(m[I(0,i)]),
- fixedToFloat(m[I(1,i)]),
- fixedToFloat(m[I(2,i)]),
- fixedToFloat(m[I(3,i)]));
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark matrixx_t
-#endif
-
-void matrixx_t::load(const matrixf_t& rhs) {
- GLfixed* xp = m;
- GLfloat const* fp = rhs.elements();
- unsigned int i = 16;
- do {
- const GLfloat f = *fp++;
- *xp++ = isZerof(f) ? 0 : gglFloatToFixed(f);
- } while (--i);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark matrixf_t
-#endif
-
-void matrixf_t::multiply(matrixf_t& r, const matrixf_t& lhs, const matrixf_t& rhs)
-{
- GLfloat const* const m = lhs.m;
- for (int i=0 ; i<4 ; i++) {
- register const float rhs_i0 = rhs.m[ I(i,0) ];
- register float ri0 = m[ I(0,0) ] * rhs_i0;
- register float ri1 = m[ I(0,1) ] * rhs_i0;
- register float ri2 = m[ I(0,2) ] * rhs_i0;
- register float ri3 = m[ I(0,3) ] * rhs_i0;
- for (int j=1 ; j<4 ; j++) {
- register const float rhs_ij = rhs.m[ I(i,j) ];
- ri0 += m[ I(j,0) ] * rhs_ij;
- ri1 += m[ I(j,1) ] * rhs_ij;
- ri2 += m[ I(j,2) ] * rhs_ij;
- ri3 += m[ I(j,3) ] * rhs_ij;
- }
- r.m[ I(i,0) ] = ri0;
- r.m[ I(i,1) ] = ri1;
- r.m[ I(i,2) ] = ri2;
- r.m[ I(i,3) ] = ri3;
- }
-}
-
-void matrixf_t::dump(const char* what) {
- ALOGD("%s", what);
- ALOGD("[ %9f %9f %9f %9f ]", m[I(0,0)], m[I(1,0)], m[I(2,0)], m[I(3,0)]);
- ALOGD("[ %9f %9f %9f %9f ]", m[I(0,1)], m[I(1,1)], m[I(2,1)], m[I(3,1)]);
- ALOGD("[ %9f %9f %9f %9f ]", m[I(0,2)], m[I(1,2)], m[I(2,2)], m[I(3,2)]);
- ALOGD("[ %9f %9f %9f %9f ]", m[I(0,3)], m[I(1,3)], m[I(2,3)], m[I(3,3)]);
-}
-
-void matrixf_t::loadIdentity() {
- memcpy(m, gIdentityf, sizeof(m));
-}
-
-void matrixf_t::set(const GLfixed* rhs) {
- load(rhs);
-}
-
-void matrixf_t::set(const GLfloat* rhs) {
- load(rhs);
-}
-
-void matrixf_t::load(const GLfixed* rhs) {
- GLfloat* fp = m;
- unsigned int i = 16;
- do {
- *fp++ = fixedToFloat(*rhs++);
- } while (--i);
-}
-
-void matrixf_t::load(const GLfloat* rhs) {
- memcpy(m, rhs, sizeof(m));
-}
-
-void matrixf_t::load(const matrixf_t& rhs) {
- operator = (rhs);
-}
-
-void matrixf_t::multiply(const matrixf_t& rhs) {
- matrixf_t r;
- multiply(r, *this, rhs);
- operator = (r);
-}
-
-void matrixf_t::translate(GLfloat x, GLfloat y, GLfloat z) {
- for (int i=0 ; i<4 ; i++) {
- m[12+i] += m[i]*x + m[4+i]*y + m[8+i]*z;
- }
-}
-
-void matrixf_t::scale(GLfloat x, GLfloat y, GLfloat z) {
- for (int i=0 ; i<4 ; i++) {
- m[ i] *= x;
- m[4+i] *= y;
- m[8+i] *= z;
- }
-}
-
-void matrixf_t::rotate(GLfloat a, GLfloat x, GLfloat y, GLfloat z)
-{
- matrixf_t rotation;
- GLfloat* r = rotation.m;
- GLfloat c, s;
- r[3] = 0; r[7] = 0; r[11]= 0;
- r[12]= 0; r[13]= 0; r[14]= 0; r[15]= 1;
- a *= GLfloat(M_PI / 180.0f);
- sincosf(a, &s, &c);
- if (isOnef(x) && isZerof(y) && isZerof(z)) {
- r[5] = c; r[10]= c;
- r[6] = s; r[9] = -s;
- r[1] = 0; r[2] = 0;
- r[4] = 0; r[8] = 0;
- r[0] = 1;
- } else if (isZerof(x) && isOnef(y) && isZerof(z)) {
- r[0] = c; r[10]= c;
- r[8] = s; r[2] = -s;
- r[1] = 0; r[4] = 0;
- r[6] = 0; r[9] = 0;
- r[5] = 1;
- } else if (isZerof(x) && isZerof(y) && isOnef(z)) {
- r[0] = c; r[5] = c;
- r[1] = s; r[4] = -s;
- r[2] = 0; r[6] = 0;
- r[8] = 0; r[9] = 0;
- r[10]= 1;
- } else {
- const GLfloat len = sqrtf(x*x + y*y + z*z);
- if (!isOnef(len)) {
- const GLfloat recipLen = reciprocalf(len);
- x *= recipLen;
- y *= recipLen;
- z *= recipLen;
- }
- const GLfloat nc = 1.0f - c;
- const GLfloat xy = x * y;
- const GLfloat yz = y * z;
- const GLfloat zx = z * x;
- const GLfloat xs = x * s;
- const GLfloat ys = y * s;
- const GLfloat zs = z * s;
- r[ 0] = x*x*nc + c; r[ 4] = xy*nc - zs; r[ 8] = zx*nc + ys;
- r[ 1] = xy*nc + zs; r[ 5] = y*y*nc + c; r[ 9] = yz*nc - xs;
- r[ 2] = zx*nc - ys; r[ 6] = yz*nc + xs; r[10] = z*z*nc + c;
- }
- multiply(rotation);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark matrix_stack_t
-#endif
-
-void matrix_stack_t::init(int depth) {
- stack = new matrixf_t[depth];
- ops = new uint8_t[depth];
- maxDepth = depth;
- depth = 0;
- dirty = 0;
- loadIdentity();
-}
-
-void matrix_stack_t::uninit() {
- delete [] stack;
- delete [] ops;
-}
-
-void matrix_stack_t::loadIdentity() {
- transform.loadIdentity();
- stack[depth].loadIdentity();
- ops[depth] = OP_IDENTITY;
-}
-
-void matrix_stack_t::load(const GLfixed* rhs)
-{
- memcpy(transform.matrix.m, rhs, sizeof(transform.matrix.m));
- stack[depth].load(rhs);
- ops[depth] = OP_ALL; // TODO: we should look at the matrix
-}
-
-void matrix_stack_t::load(const GLfloat* rhs)
-{
- stack[depth].load(rhs);
- ops[depth] = OP_ALL; // TODO: we should look at the matrix
-}
-
-void matrix_stack_t::multiply(const matrixf_t& rhs)
-{
- stack[depth].multiply(rhs);
- ops[depth] = OP_ALL; // TODO: we should look at the matrix
-}
-
-void matrix_stack_t::translate(GLfloat x, GLfloat y, GLfloat z)
-{
- stack[depth].translate(x,y,z);
- ops[depth] |= OP_TRANSLATE;
-}
-
-void matrix_stack_t::scale(GLfloat x, GLfloat y, GLfloat z)
-{
- stack[depth].scale(x,y,z);
- if (x==y && y==z) {
- ops[depth] |= OP_UNIFORM_SCALE;
- } else {
- ops[depth] |= OP_SCALE;
- }
-}
-
-void matrix_stack_t::rotate(GLfloat a, GLfloat x, GLfloat y, GLfloat z)
-{
- stack[depth].rotate(a,x,y,z);
- ops[depth] |= OP_ROTATE;
-}
-
-void matrix_stack_t::validate()
-{
- if (dirty & DO_FLOAT_TO_FIXED) {
- transform.matrix.load(top());
- }
- if (dirty & DO_PICKER) {
- transform.picker();
- }
- dirty = 0;
-}
-
-GLint matrix_stack_t::push()
-{
- if (depth >= (maxDepth-1)) {
- return GL_STACK_OVERFLOW;
- }
- stack[depth+1] = stack[depth];
- ops[depth+1] = ops[depth];
- depth++;
- return 0;
-}
-
-GLint matrix_stack_t::pop()
-{
- if (depth == 0) {
- return GL_STACK_UNDERFLOW;
- }
- depth--;
- return 0;
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark vp_transform_t
-#endif
-
-void vp_transform_t::loadIdentity() {
- transform.loadIdentity();
- matrix.loadIdentity();
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark transform_state_t
-#endif
-
-void transform_state_t::invalidate()
-{
- switch (matrixMode) {
- case GL_MODELVIEW: dirty |= MODELVIEW | MVP | MVUI | MVIT; break;
- case GL_PROJECTION: dirty |= PROJECTION | MVP; break;
- case GL_TEXTURE: dirty |= TEXTURE | MVP; break;
- }
- current->dirty = matrix_stack_t::DO_PICKER |
- matrix_stack_t::DO_FLOAT_TO_FIXED;
-}
-
-void transform_state_t::update_mvp()
-{
- matrixf_t temp_mvp;
- matrixf_t::multiply(temp_mvp, projection.top(), modelview.top());
- mvp4.matrix.load(temp_mvp);
- mvp4.picker();
-
- if (mvp4.flags & transform_t::FLAGS_2D_PROJECTION) {
- // the mvp matrix doesn't transform W, in this case we can
- // premultiply it with the viewport transformation. In addition to
- // being more efficient, this is also much more accurate and in fact
- // is needed for 2D drawing with a resulting 1:1 mapping.
- matrixf_t mvpv;
- matrixf_t::multiply(mvpv, vpt.matrix, temp_mvp);
- mvp.matrix.load(mvpv);
- mvp.picker();
- } else {
- mvp = mvp4;
- }
-}
-
-static inline
-GLfloat det22(GLfloat a, GLfloat b, GLfloat c, GLfloat d) {
- return a*d - b*c;
-}
-
-static inline
-GLfloat ndet22(GLfloat a, GLfloat b, GLfloat c, GLfloat d) {
- return b*c - a*d;
-}
-
-static __attribute__((noinline))
-void invert(GLfloat* inverse, const GLfloat* src)
-{
- double t;
- int i, j, k, swap;
- GLfloat tmp[4][4];
-
- memcpy(inverse, gIdentityf, sizeof(gIdentityf));
- memcpy(tmp, src, sizeof(GLfloat)*16);
-
- for (i = 0; i < 4; i++) {
- // look for largest element in column
- swap = i;
- for (j = i + 1; j < 4; j++) {
- if (fabs(tmp[j][i]) > fabs(tmp[i][i])) {
- swap = j;
- }
- }
-
- if (swap != i) {
- /* swap rows. */
- for (k = 0; k < 4; k++) {
- t = tmp[i][k];
- tmp[i][k] = tmp[swap][k];
- tmp[swap][k] = t;
-
- t = inverse[i*4+k];
- inverse[i*4+k] = inverse[swap*4+k];
- inverse[swap*4+k] = t;
- }
- }
-
- t = 1.0f / tmp[i][i];
- for (k = 0; k < 4; k++) {
- tmp[i][k] *= t;
- inverse[i*4+k] *= t;
- }
- for (j = 0; j < 4; j++) {
- if (j != i) {
- t = tmp[j][i];
- for (k = 0; k < 4; k++) {
- tmp[j][k] -= tmp[i][k]*t;
- inverse[j*4+k] -= inverse[i*4+k]*t;
- }
- }
- }
- }
-}
-
-void transform_state_t::update_mvit()
-{
- GLfloat r[16];
- const GLfloat* const mv = modelview.top().elements();
- invert(r, mv);
- // convert to fixed-point and transpose
- GLfixed* const x = mvit4.matrix.m;
- for (int i=0 ; i<4 ; i++)
- for (int j=0 ; j<4 ; j++)
- x[I(i,j)] = gglFloatToFixed(r[I(j,i)]);
- mvit4.picker();
-}
-
-void transform_state_t::update_mvui()
-{
- GLfloat r[16];
- const GLfloat* const mv = modelview.top().elements();
-
- /*
- When evaluating the lighting equation in eye-space, normals
- are transformed by the upper 3x3 modelview inverse-transpose.
- http://www.opengl.org/documentation/specs/version1.1/glspec1.1/node26.html
-
- (note that inverse-transpose is distributive).
- Also note that:
- l(obj) = inv(modelview).l(eye) for local light
- l(obj) = tr(modelview).l(eye) for infinite light
- */
-
- invert(r, mv);
-
- GLfixed* const x = mvui.matrix.m;
-
-#if OBJECT_SPACE_LIGHTING
- for (int i=0 ; i<4 ; i++)
- for (int j=0 ; j<4 ; j++)
- x[I(i,j)] = gglFloatToFixed(r[I(i,j)]);
-#else
- for (int i=0 ; i<4 ; i++)
- for (int j=0 ; j<4 ; j++)
- x[I(i,j)] = gglFloatToFixed(r[I(j,i)]);
-#endif
-
- mvui.picker();
-}
-
-
-// ----------------------------------------------------------------------------
-// transformation and matrices API
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark transformation and matrices API
-#endif
-
-int ogles_surfaceport(ogles_context_t* c, GLint x, GLint y)
-{
- c->viewport.surfaceport.x = x;
- c->viewport.surfaceport.y = y;
-
- ogles_viewport(c,
- c->viewport.x,
- c->viewport.y,
- c->viewport.w,
- c->viewport.h);
-
- ogles_scissor(c,
- c->viewport.scissor.x,
- c->viewport.scissor.y,
- c->viewport.scissor.w,
- c->viewport.scissor.h);
-
- return 0;
-}
-
-void ogles_scissor(ogles_context_t* c,
- GLint x, GLint y, GLsizei w, GLsizei h)
-{
- if ((w|h) < 0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- c->viewport.scissor.x = x;
- c->viewport.scissor.y = y;
- c->viewport.scissor.w = w;
- c->viewport.scissor.h = h;
-
- x += c->viewport.surfaceport.x;
- y += c->viewport.surfaceport.y;
-
- y = c->rasterizer.state.buffers.color.height - (y + h);
- c->rasterizer.procs.scissor(c, x, y, w, h);
-}
-
-void ogles_viewport(ogles_context_t* c,
- GLint x, GLint y, GLsizei w, GLsizei h)
-{
- if ((w|h)<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- c->viewport.x = x;
- c->viewport.y = y;
- c->viewport.w = w;
- c->viewport.h = h;
-
- x += c->viewport.surfaceport.x;
- y += c->viewport.surfaceport.y;
-
- GLint H = c->rasterizer.state.buffers.color.height;
- GLfloat sx = div2f(w);
- GLfloat ox = sx + x;
- GLfloat sy = div2f(h);
- GLfloat oy = sy - y + (H - h);
-
- GLfloat near = c->transforms.vpt.zNear;
- GLfloat far = c->transforms.vpt.zFar;
- GLfloat A = div2f(far - near);
- GLfloat B = div2f(far + near);
-
- // compute viewport matrix
- GLfloat* const f = c->transforms.vpt.matrix.editElements();
- f[0] = sx; f[4] = 0; f[ 8] = 0; f[12] = ox;
- f[1] = 0; f[5] =-sy; f[ 9] = 0; f[13] = oy;
- f[2] = 0; f[6] = 0; f[10] = A; f[14] = B;
- f[3] = 0; f[7] = 0; f[11] = 0; f[15] = 1;
- c->transforms.dirty |= transform_state_t::VIEWPORT;
- if (c->transforms.mvp4.flags & transform_t::FLAGS_2D_PROJECTION)
- c->transforms.dirty |= transform_state_t::MVP;
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark matrix * vertex
-#endif
-
-void point2__generic(transform_t const* mx, vec4_t* lhs, vec4_t const* rhs) {
- const GLfixed* const m = mx->matrix.m;
- const GLfixed rx = rhs->x;
- const GLfixed ry = rhs->y;
- lhs->x = mla2a(rx, m[ 0], ry, m[ 4], m[12]);
- lhs->y = mla2a(rx, m[ 1], ry, m[ 5], m[13]);
- lhs->z = mla2a(rx, m[ 2], ry, m[ 6], m[14]);
- lhs->w = mla2a(rx, m[ 3], ry, m[ 7], m[15]);
-}
-
-void point3__generic(transform_t const* mx, vec4_t* lhs, vec4_t const* rhs) {
- const GLfixed* const m = mx->matrix.m;
- const GLfixed rx = rhs->x;
- const GLfixed ry = rhs->y;
- const GLfixed rz = rhs->z;
- lhs->x = mla3a(rx, m[ 0], ry, m[ 4], rz, m[ 8], m[12]);
- lhs->y = mla3a(rx, m[ 1], ry, m[ 5], rz, m[ 9], m[13]);
- lhs->z = mla3a(rx, m[ 2], ry, m[ 6], rz, m[10], m[14]);
- lhs->w = mla3a(rx, m[ 3], ry, m[ 7], rz, m[11], m[15]);
-}
-
-void point4__generic(transform_t const* mx, vec4_t* lhs, vec4_t const* rhs) {
- const GLfixed* const m = mx->matrix.m;
- const GLfixed rx = rhs->x;
- const GLfixed ry = rhs->y;
- const GLfixed rz = rhs->z;
- const GLfixed rw = rhs->w;
- lhs->x = mla4(rx, m[ 0], ry, m[ 4], rz, m[ 8], rw, m[12]);
- lhs->y = mla4(rx, m[ 1], ry, m[ 5], rz, m[ 9], rw, m[13]);
- lhs->z = mla4(rx, m[ 2], ry, m[ 6], rz, m[10], rw, m[14]);
- lhs->w = mla4(rx, m[ 3], ry, m[ 7], rz, m[11], rw, m[15]);
-}
-
-void point3__mvui(transform_t const* mx, vec4_t* lhs, vec4_t const* rhs) {
- // this is used for transforming light positions back to object space.
- // w is used as a switch for directional lights, so we need
- // to preserve it.
- const GLfixed* const m = mx->matrix.m;
- const GLfixed rx = rhs->x;
- const GLfixed ry = rhs->y;
- const GLfixed rz = rhs->z;
- lhs->x = mla3(rx, m[ 0], ry, m[ 4], rz, m[ 8]);
- lhs->y = mla3(rx, m[ 1], ry, m[ 5], rz, m[ 9]);
- lhs->z = mla3(rx, m[ 2], ry, m[ 6], rz, m[10]);
- lhs->w = 0;
-}
-
-void point4__mvui(transform_t const* mx, vec4_t* lhs, vec4_t const* rhs) {
- // this is used for transforming light positions back to object space.
- // w is used as a switch for directional lights, so we need
- // to preserve it.
- const GLfixed* const m = mx->matrix.m;
- const GLfixed rx = rhs->x;
- const GLfixed ry = rhs->y;
- const GLfixed rz = rhs->z;
- const GLfixed rw = rhs->w;
- lhs->x = mla4(rx, m[ 0], ry, m[ 4], rz, m[ 8], rw, m[12]);
- lhs->y = mla4(rx, m[ 1], ry, m[ 5], rz, m[ 9], rw, m[13]);
- lhs->z = mla4(rx, m[ 2], ry, m[ 6], rz, m[10], rw, m[14]);
- lhs->w = rw;
-}
-
-void point2__nop(transform_t const*, vec4_t* lhs, vec4_t const* rhs) {
- lhs->z = 0;
- lhs->w = 0x10000;
- if (lhs != rhs) {
- lhs->x = rhs->x;
- lhs->y = rhs->y;
- }
-}
-
-void point3__nop(transform_t const*, vec4_t* lhs, vec4_t const* rhs) {
- lhs->w = 0x10000;
- if (lhs != rhs) {
- lhs->x = rhs->x;
- lhs->y = rhs->y;
- lhs->z = rhs->z;
- }
-}
-
-void point4__nop(transform_t const*, vec4_t* lhs, vec4_t const* rhs) {
- if (lhs != rhs)
- *lhs = *rhs;
-}
-
-
-static void frustumf(
- GLfloat left, GLfloat right,
- GLfloat bottom, GLfloat top,
- GLfloat zNear, GLfloat zFar,
- ogles_context_t* c)
- {
- if (cmpf(left,right) ||
- cmpf(top, bottom) ||
- cmpf(zNear, zFar) ||
- isZeroOrNegativef(zNear) ||
- isZeroOrNegativef(zFar))
- {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- const GLfloat r_width = reciprocalf(right - left);
- const GLfloat r_height = reciprocalf(top - bottom);
- const GLfloat r_depth = reciprocalf(zNear - zFar);
- const GLfloat x = mul2f(zNear * r_width);
- const GLfloat y = mul2f(zNear * r_height);
- const GLfloat A = mul2f((right + left) * r_width);
- const GLfloat B = (top + bottom) * r_height;
- const GLfloat C = (zFar + zNear) * r_depth;
- const GLfloat D = mul2f(zFar * zNear * r_depth);
- GLfloat f[16];
- f[ 0] = x;
- f[ 5] = y;
- f[ 8] = A;
- f[ 9] = B;
- f[10] = C;
- f[14] = D;
- f[11] = -1.0f;
- f[ 1] = f[ 2] = f[ 3] =
- f[ 4] = f[ 6] = f[ 7] =
- f[12] = f[13] = f[15] = 0.0f;
-
- matrixf_t rhs;
- rhs.set(f);
- c->transforms.current->multiply(rhs);
- c->transforms.invalidate();
-}
-
-static void orthof(
- GLfloat left, GLfloat right,
- GLfloat bottom, GLfloat top,
- GLfloat zNear, GLfloat zFar,
- ogles_context_t* c)
-{
- if (cmpf(left,right) ||
- cmpf(top, bottom) ||
- cmpf(zNear, zFar))
- {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- const GLfloat r_width = reciprocalf(right - left);
- const GLfloat r_height = reciprocalf(top - bottom);
- const GLfloat r_depth = reciprocalf(zFar - zNear);
- const GLfloat x = mul2f(r_width);
- const GLfloat y = mul2f(r_height);
- const GLfloat z = -mul2f(r_depth);
- const GLfloat tx = -(right + left) * r_width;
- const GLfloat ty = -(top + bottom) * r_height;
- const GLfloat tz = -(zFar + zNear) * r_depth;
- GLfloat f[16];
- f[ 0] = x;
- f[ 5] = y;
- f[10] = z;
- f[12] = tx;
- f[13] = ty;
- f[14] = tz;
- f[15] = 1.0f;
- f[ 1] = f[ 2] = f[ 3] =
- f[ 4] = f[ 6] = f[ 7] =
- f[ 8] = f[ 9] = f[11] = 0.0f;
- matrixf_t rhs;
- rhs.set(f);
- c->transforms.current->multiply(rhs);
- c->transforms.invalidate();
-}
-
-static void depthRangef(GLclampf zNear, GLclampf zFar, ogles_context_t* c)
-{
- zNear = clampToZerof(zNear > 1 ? 1 : zNear);
- zFar = clampToZerof(zFar > 1 ? 1 : zFar);
- GLfloat* const f = c->transforms.vpt.matrix.editElements();
- f[10] = div2f(zFar - zNear);
- f[14] = div2f(zFar + zNear);
- c->transforms.dirty |= transform_state_t::VIEWPORT;
- c->transforms.vpt.zNear = zNear;
- c->transforms.vpt.zFar = zFar;
-}
-
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-using namespace android;
-
-void glMatrixMode(GLenum mode)
-{
- ogles_context_t* c = ogles_context_t::get();
- matrix_stack_t* stack = 0;
- switch (mode) {
- case GL_MODELVIEW:
- stack = &c->transforms.modelview;
- break;
- case GL_PROJECTION:
- stack = &c->transforms.projection;
- break;
- case GL_TEXTURE:
- stack = &c->transforms.texture[c->textures.active];
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->transforms.matrixMode = mode;
- c->transforms.current = stack;
-}
-
-void glLoadIdentity()
-{
- ogles_context_t* c = ogles_context_t::get();
- c->transforms.current->loadIdentity(); // also loads the GLfixed transform
- c->transforms.invalidate();
- c->transforms.current->dirty = 0;
-}
-
-void glLoadMatrixf(const GLfloat* m)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->transforms.current->load(m);
- c->transforms.invalidate();
-}
-
-void glLoadMatrixx(const GLfixed* m)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->transforms.current->load(m); // also loads the GLfixed transform
- c->transforms.invalidate();
- c->transforms.current->dirty &= ~matrix_stack_t::DO_FLOAT_TO_FIXED;
-}
-
-void glMultMatrixf(const GLfloat* m)
-{
- ogles_context_t* c = ogles_context_t::get();
- matrixf_t rhs;
- rhs.set(m);
- c->transforms.current->multiply(rhs);
- c->transforms.invalidate();
-}
-
-void glMultMatrixx(const GLfixed* m)
-{
- ogles_context_t* c = ogles_context_t::get();
- matrixf_t rhs;
- rhs.set(m);
- c->transforms.current->multiply(rhs);
- c->transforms.invalidate();
-}
-
-void glPopMatrix()
-{
- ogles_context_t* c = ogles_context_t::get();
- GLint err = c->transforms.current->pop();
- if (ggl_unlikely(err)) {
- ogles_error(c, err);
- return;
- }
- c->transforms.invalidate();
-}
-
-void glPushMatrix()
-{
- ogles_context_t* c = ogles_context_t::get();
- GLint err = c->transforms.current->push();
- if (ggl_unlikely(err)) {
- ogles_error(c, err);
- return;
- }
- c->transforms.invalidate();
-}
-
-void glFrustumf(
- GLfloat left, GLfloat right,
- GLfloat bottom, GLfloat top,
- GLfloat zNear, GLfloat zFar)
-{
- ogles_context_t* c = ogles_context_t::get();
- frustumf(left, right, bottom, top, zNear, zFar, c);
-}
-
-void glFrustumx(
- GLfixed left, GLfixed right,
- GLfixed bottom, GLfixed top,
- GLfixed zNear, GLfixed zFar)
-{
- ogles_context_t* c = ogles_context_t::get();
- frustumf( fixedToFloat(left), fixedToFloat(right),
- fixedToFloat(bottom), fixedToFloat(top),
- fixedToFloat(zNear), fixedToFloat(zFar),
- c);
-}
-
-void glOrthof(
- GLfloat left, GLfloat right,
- GLfloat bottom, GLfloat top,
- GLfloat zNear, GLfloat zFar)
-{
- ogles_context_t* c = ogles_context_t::get();
- orthof(left, right, bottom, top, zNear, zFar, c);
-}
-
-void glOrthox(
- GLfixed left, GLfixed right,
- GLfixed bottom, GLfixed top,
- GLfixed zNear, GLfixed zFar)
-{
- ogles_context_t* c = ogles_context_t::get();
- orthof( fixedToFloat(left), fixedToFloat(right),
- fixedToFloat(bottom), fixedToFloat(top),
- fixedToFloat(zNear), fixedToFloat(zFar),
- c);
-}
-
-void glRotatef(GLfloat a, GLfloat x, GLfloat y, GLfloat z)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->transforms.current->rotate(a, x, y, z);
- c->transforms.invalidate();
-}
-
-void glRotatex(GLfixed a, GLfixed x, GLfixed y, GLfixed z)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->transforms.current->rotate(
- fixedToFloat(a), fixedToFloat(x),
- fixedToFloat(y), fixedToFloat(z));
- c->transforms.invalidate();
-}
-
-void glScalef(GLfloat x, GLfloat y, GLfloat z)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->transforms.current->scale(x, y, z);
- c->transforms.invalidate();
-}
-
-void glScalex(GLfixed x, GLfixed y, GLfixed z)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->transforms.current->scale(
- fixedToFloat(x), fixedToFloat(y), fixedToFloat(z));
- c->transforms.invalidate();
-}
-
-void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->transforms.current->translate(x, y, z);
- c->transforms.invalidate();
-}
-
-void glTranslatex(GLfixed x, GLfixed y, GLfixed z)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->transforms.current->translate(
- fixedToFloat(x), fixedToFloat(y), fixedToFloat(z));
- c->transforms.invalidate();
-}
-
-void glScissor(GLint x, GLint y, GLsizei w, GLsizei h)
-{
- ogles_context_t* c = ogles_context_t::get();
- ogles_scissor(c, x, y, w, h);
-}
-
-void glViewport(GLint x, GLint y, GLsizei w, GLsizei h)
-{
- ogles_context_t* c = ogles_context_t::get();
- ogles_viewport(c, x, y, w, h);
-}
-
-void glDepthRangef(GLclampf zNear, GLclampf zFar)
-{
- ogles_context_t* c = ogles_context_t::get();
- depthRangef(zNear, zFar, c);
-}
-
-void glDepthRangex(GLclampx zNear, GLclampx zFar)
-{
- ogles_context_t* c = ogles_context_t::get();
- depthRangef(fixedToFloat(zNear), fixedToFloat(zFar), c);
-}
-
-void glPolygonOffsetx(GLfixed factor, GLfixed units)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->polygonOffset.factor = factor;
- c->polygonOffset.units = units;
-}
-
-void glPolygonOffset(GLfloat factor, GLfloat units)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->polygonOffset.factor = gglFloatToFixed(factor);
- c->polygonOffset.units = gglFloatToFixed(units);
-}
-
-GLbitfield glQueryMatrixxOES(GLfixed* m, GLint* e)
-{
- ogles_context_t* c = ogles_context_t::get();
- GLbitfield status = 0;
- GLfloat const* f = c->transforms.current->top().elements();
- for (int i=0 ; i<16 ; i++) {
- if (isnan(f[i]) || isinf(f[i])) {
- status |= 1<<i;
- continue;
- }
- e[i] = exponent(f[i]) - 7;
- m[i] = mantissa(f[i]);
- }
- return status;
-}
diff --git a/opengl/libagl/matrix.h b/opengl/libagl/matrix.h
deleted file mode 100644
index c9a38a9..0000000
--- a/opengl/libagl/matrix.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/* libs/opengles/matrix.h
-**
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_MATRIX_H
-#define ANDROID_OPENGLES_MATRIX_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-#include <utils/Log.h>
-
-#include <private/pixelflinger/ggl_context.h>
-
-#include <GLES/gl.h>
-
-namespace android {
-
-const int OGLES_MODELVIEW_STACK_DEPTH = 16;
-const int OGLES_PROJECTION_STACK_DEPTH = 2;
-const int OGLES_TEXTURE_STACK_DEPTH = 2;
-
-void ogles_init_matrix(ogles_context_t*);
-void ogles_uninit_matrix(ogles_context_t*);
-void ogles_invalidate_perspective(ogles_context_t* c);
-void ogles_validate_transform_impl(ogles_context_t* c, uint32_t want);
-
-int ogles_surfaceport(ogles_context_t* c, GLint x, GLint y);
-
-void ogles_scissor(ogles_context_t* c,
- GLint x, GLint y, GLsizei w, GLsizei h);
-
-void ogles_viewport(ogles_context_t* c,
- GLint x, GLint y, GLsizei w, GLsizei h);
-
-inline void ogles_validate_transform(
- ogles_context_t* c, uint32_t want)
-{
- if (c->transforms.dirty & want)
- ogles_validate_transform_impl(c, want);
-}
-
-// ----------------------------------------------------------------------------
-
-inline
-GLfixed vsquare3(GLfixed a, GLfixed b, GLfixed c)
-{
-#if defined(__arm__) && !defined(__thumb__)
-
- GLfixed r;
- int32_t t;
- asm(
- "smull %0, %1, %2, %2 \n"
- "smlal %0, %1, %3, %3 \n"
- "smlal %0, %1, %4, %4 \n"
- "movs %0, %0, lsr #16 \n"
- "adc %0, %0, %1, lsl #16 \n"
- : "=&r"(r), "=&r"(t)
- : "%r"(a), "r"(b), "r"(c)
- : "cc"
- );
- return r;
-
-#else
-
- return (( int64_t(a)*a +
- int64_t(b)*b +
- int64_t(c)*c + 0x8000)>>16);
-
-#endif
-}
-
-static inline GLfixed mla2a( GLfixed a0, GLfixed b0,
- GLfixed a1, GLfixed b1,
- GLfixed c)
-{
-#if defined(__arm__) && !defined(__thumb__)
-
- GLfixed r;
- int32_t t;
- asm(
- "smull %0, %1, %2, %3 \n"
- "smlal %0, %1, %4, %5 \n"
- "add %0, %6, %0, lsr #16 \n"
- "add %0, %0, %1, lsl #16 \n"
- : "=&r"(r), "=&r"(t)
- : "%r"(a0), "r"(b0),
- "%r"(a1), "r"(b1),
- "r"(c)
- :
- );
- return r;
-
-#else
-
- return (( int64_t(a0)*b0 +
- int64_t(a1)*b1)>>16) + c;
-
-#endif
-}
-
-static inline GLfixed mla3a( GLfixed a0, GLfixed b0,
- GLfixed a1, GLfixed b1,
- GLfixed a2, GLfixed b2,
- GLfixed c)
-{
-#if defined(__arm__) && !defined(__thumb__)
-
- GLfixed r;
- int32_t t;
- asm(
- "smull %0, %1, %2, %3 \n"
- "smlal %0, %1, %4, %5 \n"
- "smlal %0, %1, %6, %7 \n"
- "add %0, %8, %0, lsr #16 \n"
- "add %0, %0, %1, lsl #16 \n"
- : "=&r"(r), "=&r"(t)
- : "%r"(a0), "r"(b0),
- "%r"(a1), "r"(b1),
- "%r"(a2), "r"(b2),
- "r"(c)
- :
- );
- return r;
-
-#else
-
- return (( int64_t(a0)*b0 +
- int64_t(a1)*b1 +
- int64_t(a2)*b2)>>16) + c;
-
-#endif
-}
-
-// b0, b1, b2 are signed 16-bit quanities
-// that have been shifted right by 'shift' bits relative to normal
-// S16.16 fixed point
-static inline GLfixed mla3a16( GLfixed a0, int32_t b1b0,
- GLfixed a1,
- GLfixed a2, int32_t b2,
- GLint shift,
- GLfixed c)
-{
-#if defined(__arm__) && !defined(__thumb__)
-
- GLfixed r;
- asm(
- "smulwb %0, %1, %2 \n"
- "smlawt %0, %3, %2, %0 \n"
- "smlawb %0, %4, %5, %0 \n"
- "add %0, %7, %0, lsl %6 \n"
- : "=&r"(r)
- : "r"(a0), "r"(b1b0),
- "r"(a1),
- "r"(a2), "r"(b2),
- "r"(shift),
- "r"(c)
- :
- );
- return r;
-
-#else
-
- int32_t accum;
- int16_t b0 = b1b0 & 0xffff;
- int16_t b1 = (b1b0 >> 16) & 0xffff;
- accum = int64_t(a0)*int16_t(b0) >> 16;
- accum += int64_t(a1)*int16_t(b1) >> 16;
- accum += int64_t(a2)*int16_t(b2) >> 16;
- accum = (accum << shift) + c;
- return accum;
-
-#endif
-}
-
-
-static inline GLfixed mla3a16_btb( GLfixed a0,
- GLfixed a1,
- GLfixed a2,
- int32_t b1b0, int32_t xxb2,
- GLint shift,
- GLfixed c)
-{
-#if defined(__arm__) && !defined(__thumb__)
-
- GLfixed r;
- asm(
- "smulwb %0, %1, %4 \n"
- "smlawt %0, %2, %4, %0 \n"
- "smlawb %0, %3, %5, %0 \n"
- "add %0, %7, %0, lsl %6 \n"
- : "=&r"(r)
- : "r"(a0),
- "r"(a1),
- "r"(a2),
- "r"(b1b0), "r"(xxb2),
- "r"(shift),
- "r"(c)
- :
- );
- return r;
-
-#else
-
- int32_t accum;
- int16_t b0 = b1b0 & 0xffff;
- int16_t b1 = (b1b0 >> 16) & 0xffff;
- int16_t b2 = xxb2 & 0xffff;
- accum = int64_t(a0)*int16_t(b0) >> 16;
- accum += int64_t(a1)*int16_t(b1) >> 16;
- accum += int64_t(a2)*int16_t(b2) >> 16;
- accum = (accum << shift) + c;
- return accum;
-
-#endif
-}
-
-static inline GLfixed mla3a16_btt( GLfixed a0,
- GLfixed a1,
- GLfixed a2,
- int32_t b1b0, int32_t b2xx,
- GLint shift,
- GLfixed c)
-{
-#if defined(__arm__) && !defined(__thumb__)
-
- GLfixed r;
- asm(
- "smulwb %0, %1, %4 \n"
- "smlawt %0, %2, %4, %0 \n"
- "smlawt %0, %3, %5, %0 \n"
- "add %0, %7, %0, lsl %6 \n"
- : "=&r"(r)
- : "r"(a0),
- "r"(a1),
- "r"(a2),
- "r"(b1b0), "r"(b2xx),
- "r"(shift),
- "r"(c)
- :
- );
- return r;
-
-#else
-
- int32_t accum;
- int16_t b0 = b1b0 & 0xffff;
- int16_t b1 = (b1b0 >> 16) & 0xffff;
- int16_t b2 = (b2xx >> 16) & 0xffff;
- accum = int64_t(a0)*int16_t(b0) >> 16;
- accum += int64_t(a1)*int16_t(b1) >> 16;
- accum += int64_t(a2)*int16_t(b2) >> 16;
- accum = (accum << shift) + c;
- return accum;
-
-#endif
-}
-
-static inline GLfixed mla3( GLfixed a0, GLfixed b0,
- GLfixed a1, GLfixed b1,
- GLfixed a2, GLfixed b2)
-{
-#if defined(__arm__) && !defined(__thumb__)
-
- GLfixed r;
- int32_t t;
- asm(
- "smull %0, %1, %2, %3 \n"
- "smlal %0, %1, %4, %5 \n"
- "smlal %0, %1, %6, %7 \n"
- "movs %0, %0, lsr #16 \n"
- "adc %0, %0, %1, lsl #16 \n"
- : "=&r"(r), "=&r"(t)
- : "%r"(a0), "r"(b0),
- "%r"(a1), "r"(b1),
- "%r"(a2), "r"(b2)
- : "cc"
- );
- return r;
-
-#else
-
- return (( int64_t(a0)*b0 +
- int64_t(a1)*b1 +
- int64_t(a2)*b2 + 0x8000)>>16);
-
-#endif
-}
-
-static inline GLfixed mla4( GLfixed a0, GLfixed b0,
- GLfixed a1, GLfixed b1,
- GLfixed a2, GLfixed b2,
- GLfixed a3, GLfixed b3)
-{
-#if defined(__arm__) && !defined(__thumb__)
-
- GLfixed r;
- int32_t t;
- asm(
- "smull %0, %1, %2, %3 \n"
- "smlal %0, %1, %4, %5 \n"
- "smlal %0, %1, %6, %7 \n"
- "smlal %0, %1, %8, %9 \n"
- "movs %0, %0, lsr #16 \n"
- "adc %0, %0, %1, lsl #16 \n"
- : "=&r"(r), "=&r"(t)
- : "%r"(a0), "r"(b0),
- "%r"(a1), "r"(b1),
- "%r"(a2), "r"(b2),
- "%r"(a3), "r"(b3)
- : "cc"
- );
- return r;
-
-#else
-
- return (( int64_t(a0)*b0 +
- int64_t(a1)*b1 +
- int64_t(a2)*b2 +
- int64_t(a3)*b3 + 0x8000)>>16);
-
-#endif
-}
-
-inline
-GLfixed dot4(const GLfixed* a, const GLfixed* b)
-{
- return mla4(a[0], b[0], a[1], b[1], a[2], b[2], a[3], b[3]);
-}
-
-
-inline
-GLfixed dot3(const GLfixed* a, const GLfixed* b)
-{
- return mla3(a[0], b[0], a[1], b[1], a[2], b[2]);
-}
-
-
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_MATRIX_H
-
diff --git a/opengl/libagl/mipmap.cpp b/opengl/libagl/mipmap.cpp
deleted file mode 100644
index e142a58..0000000
--- a/opengl/libagl/mipmap.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-/* libs/opengles/mipmap.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "context.h"
-#include "state.h"
-#include "texture.h"
-#include "TextureObjectManager.h"
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-status_t buildAPyramid(ogles_context_t* c, EGLTextureObject* tex)
-{
- int level = 0;
- const GGLSurface* base = &tex->surface;
- const GGLFormat& pixelFormat(c->rasterizer.formats[base->format]);
-
- int w = base->width;
- int h = base->height;
- if ((w&h) == 1)
- return NO_ERROR;
-
- w = (w>>1) ? : 1;
- h = (h>>1) ? : 1;
-
- while(true) {
- ++level;
- const int bpr = w * pixelFormat.size;
- if (tex->reallocate(level, w, h, w,
- base->format, base->compressedFormat, bpr) != NO_ERROR) {
- return NO_MEMORY;
- }
-
- int stride = w;
- int bs = base->stride;
- GGLSurface& cur = tex->editMip(level);
-
- if (base->format == GGL_PIXEL_FORMAT_RGB_565)
- {
- uint16_t const * src = (uint16_t const *)base->data;
- uint16_t* dst = (uint16_t*)cur.data;
- const uint32_t mask = 0x07E0F81F;
- for (int y=0 ; y<h ; y++) {
- size_t offset = (y*2) * bs;
- for (int x=0 ; x<w ; x++) {
- uint32_t p00 = src[offset];
- uint32_t p10 = src[offset+1];
- uint32_t p01 = src[offset+bs];
- uint32_t p11 = src[offset+bs+1];
- p00 = (p00 | (p00 << 16)) & mask;
- p01 = (p01 | (p01 << 16)) & mask;
- p10 = (p10 | (p10 << 16)) & mask;
- p11 = (p11 | (p11 << 16)) & mask;
- uint32_t grb = ((p00 + p10 + p01 + p11) >> 2) & mask;
- uint32_t rgb = (grb & 0xFFFF) | (grb >> 16);
- dst[x + y*stride] = rgb;
- offset += 2;
- }
- }
- }
- else if (base->format == GGL_PIXEL_FORMAT_RGBA_5551)
- {
- uint16_t const * src = (uint16_t const *)base->data;
- uint16_t* dst = (uint16_t*)cur.data;
- for (int y=0 ; y<h ; y++) {
- size_t offset = (y*2) * bs;
- for (int x=0 ; x<w ; x++) {
- uint32_t p00 = src[offset];
- uint32_t p10 = src[offset+1];
- uint32_t p01 = src[offset+bs];
- uint32_t p11 = src[offset+bs+1];
- uint32_t r = ((p00>>11)+(p10>>11)+(p01>>11)+(p11>>11)+2)>>2;
- uint32_t g = (((p00>>6)+(p10>>6)+(p01>>6)+(p11>>6)+2)>>2)&0x3F;
- uint32_t b = ((p00&0x3E)+(p10&0x3E)+(p01&0x3E)+(p11&0x3E)+4)>>3;
- uint32_t a = ((p00&1)+(p10&1)+(p01&1)+(p11&1)+2)>>2;
- dst[x + y*stride] = (r<<11)|(g<<6)|(b<<1)|a;
- offset += 2;
- }
- }
- }
- else if (base->format == GGL_PIXEL_FORMAT_RGBA_8888)
- {
- uint32_t const * src = (uint32_t const *)base->data;
- uint32_t* dst = (uint32_t*)cur.data;
- for (int y=0 ; y<h ; y++) {
- size_t offset = (y*2) * bs;
- for (int x=0 ; x<w ; x++) {
- uint32_t p00 = src[offset];
- uint32_t p10 = src[offset+1];
- uint32_t p01 = src[offset+bs];
- uint32_t p11 = src[offset+bs+1];
- uint32_t rb00 = p00 & 0x00FF00FF;
- uint32_t rb01 = p01 & 0x00FF00FF;
- uint32_t rb10 = p10 & 0x00FF00FF;
- uint32_t rb11 = p11 & 0x00FF00FF;
- uint32_t ga00 = (p00 >> 8) & 0x00FF00FF;
- uint32_t ga01 = (p01 >> 8) & 0x00FF00FF;
- uint32_t ga10 = (p10 >> 8) & 0x00FF00FF;
- uint32_t ga11 = (p11 >> 8) & 0x00FF00FF;
- uint32_t rb = (rb00 + rb01 + rb10 + rb11)>>2;
- uint32_t ga = (ga00 + ga01 + ga10 + ga11)>>2;
- uint32_t rgba = (rb & 0x00FF00FF) | ((ga & 0x00FF00FF)<<8);
- dst[x + y*stride] = rgba;
- offset += 2;
- }
- }
- }
- else if ((base->format == GGL_PIXEL_FORMAT_RGB_888) ||
- (base->format == GGL_PIXEL_FORMAT_LA_88) ||
- (base->format == GGL_PIXEL_FORMAT_A_8) ||
- (base->format == GGL_PIXEL_FORMAT_L_8))
- {
- int skip;
- switch (base->format) {
- case GGL_PIXEL_FORMAT_RGB_888: skip = 3; break;
- case GGL_PIXEL_FORMAT_LA_88: skip = 2; break;
- default: skip = 1; break;
- }
- uint8_t const * src = (uint8_t const *)base->data;
- uint8_t* dst = (uint8_t*)cur.data;
- bs *= skip;
- stride *= skip;
- for (int y=0 ; y<h ; y++) {
- size_t offset = (y*2) * bs;
- for (int x=0 ; x<w ; x++) {
- for (int c=0 ; c<skip ; c++) {
- uint32_t p00 = src[c+offset];
- uint32_t p10 = src[c+offset+skip];
- uint32_t p01 = src[c+offset+bs];
- uint32_t p11 = src[c+offset+bs+skip];
- dst[x + y*stride + c] = (p00 + p10 + p01 + p11) >> 2;
- }
- offset += 2*skip;
- }
- }
- }
- else if (base->format == GGL_PIXEL_FORMAT_RGBA_4444)
- {
- uint16_t const * src = (uint16_t const *)base->data;
- uint16_t* dst = (uint16_t*)cur.data;
- for (int y=0 ; y<h ; y++) {
- size_t offset = (y*2) * bs;
- for (int x=0 ; x<w ; x++) {
- uint32_t p00 = src[offset];
- uint32_t p10 = src[offset+1];
- uint32_t p01 = src[offset+bs];
- uint32_t p11 = src[offset+bs+1];
- p00 = ((p00 << 12) & 0x0F0F0000) | (p00 & 0x0F0F);
- p10 = ((p10 << 12) & 0x0F0F0000) | (p10 & 0x0F0F);
- p01 = ((p01 << 12) & 0x0F0F0000) | (p01 & 0x0F0F);
- p11 = ((p11 << 12) & 0x0F0F0000) | (p11 & 0x0F0F);
- uint32_t rbga = (p00 + p10 + p01 + p11) >> 2;
- uint32_t rgba = (rbga & 0x0F0F) | ((rbga>>12) & 0xF0F0);
- dst[x + y*stride] = rgba;
- offset += 2;
- }
- }
- } else {
- ALOGE("Unsupported format (%d)", base->format);
- return BAD_TYPE;
- }
-
- // exit condition: we just processed the 1x1 LODs
- if ((w&h) == 1)
- break;
-
- base = &cur;
- w = (w>>1) ? : 1;
- h = (h>>1) ? : 1;
- }
- return NO_ERROR;
-}
-
-}; // namespace android
diff --git a/opengl/libagl/primitives.cpp b/opengl/libagl/primitives.cpp
deleted file mode 100644
index 769ec40..0000000
--- a/opengl/libagl/primitives.cpp
+++ /dev/null
@@ -1,1111 +0,0 @@
-/* libs/opengles/primitives.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include "context.h"
-#include "primitives.h"
-#include "light.h"
-#include "matrix.h"
-#include "vertex.h"
-#include "fp.h"
-#include "TextureObjectManager.h"
-
-extern "C" void iterators0032(const void* that,
- int32_t* it, int32_t c0, int32_t c1, int32_t c2);
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-static void primitive_point(ogles_context_t* c, vertex_t* v);
-static void primitive_line(ogles_context_t* c, vertex_t* v0, vertex_t* v1);
-static void primitive_clip_triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2);
-
-static void primitive_nop_point(ogles_context_t* c, vertex_t* v);
-static void primitive_nop_line(ogles_context_t* c, vertex_t* v0, vertex_t* v1);
-static void primitive_nop_triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2);
-
-static inline bool cull_triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2);
-
-static void lerp_triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2);
-
-static void lerp_texcoords(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2);
-
-static void lerp_texcoords_w(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2);
-
-static void triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2);
-
-static void clip_triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2);
-
-static unsigned int clip_line(ogles_context_t* c,
- vertex_t* s, vertex_t* p);
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-static void lightTriangleDarkSmooth(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- if (!(v0->flags & vertex_t::LIT)) {
- v0->flags |= vertex_t::LIT;
- const GLvoid* cp = c->arrays.color.element(
- v0->index & vertex_cache_t::INDEX_MASK);
- c->arrays.color.fetch(c, v0->color.v, cp);
- }
- if (!(v1->flags & vertex_t::LIT)) {
- v1->flags |= vertex_t::LIT;
- const GLvoid* cp = c->arrays.color.element(
- v1->index & vertex_cache_t::INDEX_MASK);
- c->arrays.color.fetch(c, v1->color.v, cp);
- }
- if(!(v2->flags & vertex_t::LIT)) {
- v2->flags |= vertex_t::LIT;
- const GLvoid* cp = c->arrays.color.element(
- v2->index & vertex_cache_t::INDEX_MASK);
- c->arrays.color.fetch(c, v2->color.v, cp);
- }
-}
-
-static void lightTriangleDarkFlat(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- if (!(v2->flags & vertex_t::LIT)) {
- v2->flags |= vertex_t::LIT;
- const GLvoid* cp = c->arrays.color.element(
- v2->index & vertex_cache_t::INDEX_MASK);
- c->arrays.color.fetch(c, v2->color.v, cp);
- }
- // configure the rasterizer here, before we clip
- c->rasterizer.procs.color4xv(c, v2->color.v);
-}
-
-static void lightTriangleSmooth(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- if (!(v0->flags & vertex_t::LIT))
- c->lighting.lightVertex(c, v0);
- if (!(v1->flags & vertex_t::LIT))
- c->lighting.lightVertex(c, v1);
- if(!(v2->flags & vertex_t::LIT))
- c->lighting.lightVertex(c, v2);
-}
-
-static void lightTriangleFlat(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- if (!(v2->flags & vertex_t::LIT))
- c->lighting.lightVertex(c, v2);
- // configure the rasterizer here, before we clip
- c->rasterizer.procs.color4xv(c, v2->color.v);
-}
-
-// The fog versions...
-
-static inline
-void lightVertexDarkSmoothFog(ogles_context_t* c, vertex_t* v)
-{
- if (!(v->flags & vertex_t::LIT)) {
- v->flags |= vertex_t::LIT;
- v->fog = c->fog.fog(c, v->eye.z);
- const GLvoid* cp = c->arrays.color.element(
- v->index & vertex_cache_t::INDEX_MASK);
- c->arrays.color.fetch(c, v->color.v, cp);
- }
-}
-static inline
-void lightVertexDarkFlatFog(ogles_context_t* c, vertex_t* v)
-{
- if (!(v->flags & vertex_t::LIT)) {
- v->flags |= vertex_t::LIT;
- v->fog = c->fog.fog(c, v->eye.z);
- }
-}
-static inline
-void lightVertexSmoothFog(ogles_context_t* c, vertex_t* v)
-{
- if (!(v->flags & vertex_t::LIT)) {
- v->fog = c->fog.fog(c, v->eye.z);
- c->lighting.lightVertex(c, v);
- }
-}
-
-static void lightTriangleDarkSmoothFog(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- lightVertexDarkSmoothFog(c, v0);
- lightVertexDarkSmoothFog(c, v1);
- lightVertexDarkSmoothFog(c, v2);
-}
-
-static void lightTriangleDarkFlatFog(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- lightVertexDarkFlatFog(c, v0);
- lightVertexDarkFlatFog(c, v1);
- lightVertexDarkSmoothFog(c, v2);
- // configure the rasterizer here, before we clip
- c->rasterizer.procs.color4xv(c, v2->color.v);
-}
-
-static void lightTriangleSmoothFog(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- lightVertexSmoothFog(c, v0);
- lightVertexSmoothFog(c, v1);
- lightVertexSmoothFog(c, v2);
-}
-
-static void lightTriangleFlatFog(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- lightVertexDarkFlatFog(c, v0);
- lightVertexDarkFlatFog(c, v1);
- lightVertexSmoothFog(c, v2);
- // configure the rasterizer here, before we clip
- c->rasterizer.procs.color4xv(c, v2->color.v);
-}
-
-
-
-typedef void (*light_primitive_t)(ogles_context_t*,
- vertex_t*, vertex_t*, vertex_t*);
-
-// fog 0x4, light 0x2, smooth 0x1
-static const light_primitive_t lightPrimitive[8] = {
- lightTriangleDarkFlat, // no fog | dark | flat
- lightTriangleDarkSmooth, // no fog | dark | smooth
- lightTriangleFlat, // no fog | light | flat
- lightTriangleSmooth, // no fog | light | smooth
- lightTriangleDarkFlatFog, // fog | dark | flat
- lightTriangleDarkSmoothFog, // fog | dark | smooth
- lightTriangleFlatFog, // fog | light | flat
- lightTriangleSmoothFog // fog | light | smooth
-};
-
-void ogles_validate_primitives(ogles_context_t* c)
-{
- const uint32_t enables = c->rasterizer.state.enables;
-
- // set up the lighting/shading/smoothing/fogging function
- int index = enables & GGL_ENABLE_SMOOTH ? 0x1 : 0;
- index |= c->lighting.enable ? 0x2 : 0;
- index |= enables & GGL_ENABLE_FOG ? 0x4 : 0;
- c->lighting.lightTriangle = lightPrimitive[index];
-
- // set up the primitive renderers
- if (ggl_likely(c->arrays.vertex.enable)) {
- c->prims.renderPoint = primitive_point;
- c->prims.renderLine = primitive_line;
- c->prims.renderTriangle = primitive_clip_triangle;
- } else {
- c->prims.renderPoint = primitive_nop_point;
- c->prims.renderLine = primitive_nop_line;
- c->prims.renderTriangle = primitive_nop_triangle;
- }
-}
-
-// ----------------------------------------------------------------------------
-
-void compute_iterators_t::initTriangle(
- vertex_t const* v0, vertex_t const* v1, vertex_t const* v2)
-{
- m_dx01 = v1->window.x - v0->window.x;
- m_dy10 = v0->window.y - v1->window.y;
- m_dx20 = v0->window.x - v2->window.x;
- m_dy02 = v2->window.y - v0->window.y;
- m_area = m_dx01*m_dy02 + (-m_dy10)*m_dx20;
-}
-
-void compute_iterators_t::initLine(
- vertex_t const* v0, vertex_t const* v1)
-{
- m_dx01 = m_dy02 = v1->window.x - v0->window.x;
- m_dy10 = m_dx20 = v0->window.y - v1->window.y;
- m_area = m_dx01*m_dy02 + (-m_dy10)*m_dx20;
-}
-
-void compute_iterators_t::initLerp(vertex_t const* v0, uint32_t enables)
-{
- m_x0 = v0->window.x;
- m_y0 = v0->window.y;
- const GGLcoord area = (m_area + TRI_HALF) >> TRI_FRACTION_BITS;
- const GGLcoord minArea = 2; // cannot be inverted
- // triangles with an area smaller than 1.0 are not smooth-shaded
-
- int q=0, s=0, d=0;
- if (abs(area) >= minArea) {
- // Here we do some voodoo magic, to compute a suitable scale
- // factor for deltas/area:
-
- // First compute the 1/area with full 32-bits precision,
- // gglRecipQNormalized returns a number [-0.5, 0.5[ and an exponent.
- d = gglRecipQNormalized(area, &q);
-
- // Then compute the minimum left-shift to not overflow the muls
- // below.
- s = 32 - gglClz(abs(m_dy02)|abs(m_dy10)|abs(m_dx01)|abs(m_dx20));
-
- // We'll keep 16-bits of precision for deltas/area. So we need
- // to shift everything left an extra 15 bits.
- s += 15;
-
- // make sure all final shifts are not > 32, because gglMulx
- // can't handle it.
- if (s < q) s = q;
- if (s > 32) {
- d >>= 32-s;
- s = 32;
- }
- }
-
- m_dx01 = gglMulx(m_dx01, d, s);
- m_dy10 = gglMulx(m_dy10, d, s);
- m_dx20 = gglMulx(m_dx20, d, s);
- m_dy02 = gglMulx(m_dy02, d, s);
- m_area_scale = 32 + q - s;
- m_scale = 0;
-
- if (enables & GGL_ENABLE_TMUS) {
- const int A = gglClz(abs(m_dy02)|abs(m_dy10)|abs(m_dx01)|abs(m_dx20));
- const int B = gglClz(abs(m_x0)|abs(m_y0));
- m_scale = max(0, 32 - (A + 16)) +
- max(0, 32 - (B + TRI_FRACTION_BITS)) + 1;
- }
-}
-
-int compute_iterators_t::iteratorsScale(GGLfixed* it,
- int32_t c0, int32_t c1, int32_t c2) const
-{
- int32_t dc01 = c1 - c0;
- int32_t dc02 = c2 - c0;
- const int A = gglClz(abs(c0));
- const int B = gglClz(abs(dc01)|abs(dc02));
- const int scale = min(A, B - m_scale) - 2;
- if (scale >= 0) {
- c0 <<= scale;
- dc01 <<= scale;
- dc02 <<= scale;
- } else {
- c0 >>= -scale;
- dc01 >>= -scale;
- dc02 >>= -scale;
- }
- const int s = m_area_scale;
- int32_t dcdx = gglMulAddx(dc01, m_dy02, gglMulx(dc02, m_dy10, s), s);
- int32_t dcdy = gglMulAddx(dc02, m_dx01, gglMulx(dc01, m_dx20, s), s);
- int32_t c = c0 - (gglMulAddx(dcdx, m_x0,
- gglMulx(dcdy, m_y0, TRI_FRACTION_BITS), TRI_FRACTION_BITS));
- it[0] = c;
- it[1] = dcdx;
- it[2] = dcdy;
- return scale;
-}
-
-void compute_iterators_t::iterators1616(GGLfixed* it,
- GGLfixed c0, GGLfixed c1, GGLfixed c2) const
-{
- const GGLfixed dc01 = c1 - c0;
- const GGLfixed dc02 = c2 - c0;
- // 16.16 x 16.16 == 32.32 --> 16.16
- const int s = m_area_scale;
- int32_t dcdx = gglMulAddx(dc01, m_dy02, gglMulx(dc02, m_dy10, s), s);
- int32_t dcdy = gglMulAddx(dc02, m_dx01, gglMulx(dc01, m_dx20, s), s);
- int32_t c = c0 - (gglMulAddx(dcdx, m_x0,
- gglMulx(dcdy, m_y0, TRI_FRACTION_BITS), TRI_FRACTION_BITS));
- it[0] = c;
- it[1] = dcdx;
- it[2] = dcdy;
-}
-
-void compute_iterators_t::iterators0032(int64_t* it,
- int32_t c0, int32_t c1, int32_t c2) const
-{
- const int s = m_area_scale - 16;
- int32_t dc01 = (c1 - c0)>>s;
- int32_t dc02 = (c2 - c0)>>s;
- // 16.16 x 16.16 == 32.32
- int64_t dcdx = gglMulii(dc01, m_dy02) + gglMulii(dc02, m_dy10);
- int64_t dcdy = gglMulii(dc02, m_dx01) + gglMulii(dc01, m_dx20);
- it[ 0] = (c0<<16) - ((dcdx*m_x0 + dcdy*m_y0)>>4);
- it[ 1] = dcdx;
- it[ 2] = dcdy;
-}
-
-#if defined(__arm__) && !defined(__thumb__)
-inline void compute_iterators_t::iterators0032(int32_t* it,
- int32_t c0, int32_t c1, int32_t c2) const
-{
- ::iterators0032(this, it, c0, c1, c2);
-}
-#else
-void compute_iterators_t::iterators0032(int32_t* it,
- int32_t c0, int32_t c1, int32_t c2) const
-{
- int64_t it64[3];
- iterators0032(it64, c0, c1, c2);
- it[0] = it64[0];
- it[1] = it64[1];
- it[2] = it64[2];
-}
-#endif
-
-// ----------------------------------------------------------------------------
-
-static inline int32_t clampZ(GLfixed z) CONST;
-int32_t clampZ(GLfixed z) {
- z = (z & ~(z>>31));
- if (z >= 0x10000)
- z = 0xFFFF;
- return z;
-}
-
-static __attribute__((noinline))
-void fetch_texcoord_impl(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- vertex_t* const vtx[3] = { v0, v1, v2 };
- array_t const * const texcoordArray = c->arrays.texture;
-
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- if (!(c->rasterizer.state.texture[i].enable))
- continue;
-
- for (int j=0 ; j<3 ; j++) {
- vertex_t* const v = vtx[j];
- if (v->flags & vertex_t::TT)
- continue;
-
- // NOTE: here we could compute automatic texgen
- // such as sphere/cube maps, instead of fetching them
- // from the textcoord array.
-
- vec4_t& coords = v->texture[i];
- const GLubyte* tp = texcoordArray[i].element(
- v->index & vertex_cache_t::INDEX_MASK);
- texcoordArray[i].fetch(c, coords.v, tp);
-
- // transform texture coordinates...
- coords.Q = 0x10000;
- const transform_t& tr = c->transforms.texture[i].transform;
- if (ggl_unlikely(tr.ops)) {
- c->arrays.tex_transform[i](&tr, &coords, &coords);
- }
-
- // divide by Q
- const GGLfixed q = coords.Q;
- if (ggl_unlikely(q != 0x10000)) {
- const int32_t qinv = gglRecip28(q);
- coords.S = gglMulx(coords.S, qinv, 28);
- coords.T = gglMulx(coords.T, qinv, 28);
- }
- }
- }
- v0->flags |= vertex_t::TT;
- v1->flags |= vertex_t::TT;
- v2->flags |= vertex_t::TT;
-}
-
-inline void fetch_texcoord(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- const uint32_t enables = c->rasterizer.state.enables;
- if (!(enables & GGL_ENABLE_TMUS))
- return;
-
- // Fetch & transform texture coordinates...
- if (ggl_likely(v0->flags & v1->flags & v2->flags & vertex_t::TT)) {
- // already done for all three vertices, bail...
- return;
- }
- fetch_texcoord_impl(c, v0, v1, v2);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Point
-#endif
-
-void primitive_nop_point(ogles_context_t*, vertex_t*) {
-}
-
-void primitive_point(ogles_context_t* c, vertex_t* v)
-{
- // lighting & clamping...
- const uint32_t enables = c->rasterizer.state.enables;
-
- if (ggl_unlikely(!(v->flags & vertex_t::LIT))) {
- if (c->lighting.enable) {
- c->lighting.lightVertex(c, v);
- } else {
- v->flags |= vertex_t::LIT;
- const GLvoid* cp = c->arrays.color.element(
- v->index & vertex_cache_t::INDEX_MASK);
- c->arrays.color.fetch(c, v->color.v, cp);
- }
- if (enables & GGL_ENABLE_FOG) {
- v->fog = c->fog.fog(c, v->eye.z);
- }
- }
-
- // XXX: we don't need to do that each-time
- // if color array and lighting not enabled
- c->rasterizer.procs.color4xv(c, v->color.v);
-
- // XXX: look into ES point-sprite extension
- if (enables & GGL_ENABLE_TMUS) {
- fetch_texcoord(c, v,v,v);
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- if (!c->rasterizer.state.texture[i].enable)
- continue;
- int32_t itt[8];
- itt[1] = itt[2] = itt[4] = itt[5] = 0;
- itt[6] = itt[7] = 16; // XXX: check that
- if (c->rasterizer.state.texture[i].s_wrap == GGL_CLAMP) {
- int width = c->textures.tmu[i].texture->surface.width;
- itt[0] = v->texture[i].S * width;
- itt[6] = 0;
- }
- if (c->rasterizer.state.texture[i].t_wrap == GGL_CLAMP) {
- int height = c->textures.tmu[i].texture->surface.height;
- itt[3] = v->texture[i].T * height;
- itt[7] = 0;
- }
- c->rasterizer.procs.texCoordGradScale8xv(c, i, itt);
- }
- }
-
- if (enables & GGL_ENABLE_DEPTH_TEST) {
- int32_t itz[3];
- itz[0] = clampZ(v->window.z) * 0x00010001;
- itz[1] = itz[2] = 0;
- c->rasterizer.procs.zGrad3xv(c, itz);
- }
-
- if (enables & GGL_ENABLE_FOG) {
- GLfixed itf[3];
- itf[0] = v->fog;
- itf[1] = itf[2] = 0;
- c->rasterizer.procs.fogGrad3xv(c, itf);
- }
-
- // Render our point...
- c->rasterizer.procs.pointx(c, v->window.v, c->point.size);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Line
-#endif
-
-void primitive_nop_line(ogles_context_t*, vertex_t*, vertex_t*) {
-}
-
-void primitive_line(ogles_context_t* c, vertex_t* v0, vertex_t* v1)
-{
- // get texture coordinates
- fetch_texcoord(c, v0, v1, v1);
-
- // light/shade the vertices first (they're copied below)
- c->lighting.lightTriangle(c, v0, v1, v1);
-
- // clip the line if needed
- if (ggl_unlikely((v0->flags | v1->flags) & vertex_t::CLIP_ALL)) {
- unsigned int count = clip_line(c, v0, v1);
- if (ggl_unlikely(count == 0))
- return;
- }
-
- // compute iterators...
- const uint32_t enables = c->rasterizer.state.enables;
- const uint32_t mask = GGL_ENABLE_TMUS |
- GGL_ENABLE_SMOOTH |
- GGL_ENABLE_W |
- GGL_ENABLE_FOG |
- GGL_ENABLE_DEPTH_TEST;
-
- if (ggl_unlikely(enables & mask)) {
- c->lerp.initLine(v0, v1);
- lerp_triangle(c, v0, v1, v0);
- }
-
- // render our line
- c->rasterizer.procs.linex(c, v0->window.v, v1->window.v, c->line.width);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Triangle
-#endif
-
-void primitive_nop_triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2) {
-}
-
-void primitive_clip_triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- uint32_t cc = (v0->flags | v1->flags | v2->flags) & vertex_t::CLIP_ALL;
- if (ggl_likely(!cc)) {
- // code below must be as optimized as possible, this is the
- // common code path.
-
- // This triangle is not clipped, test if it's culled
- // unclipped triangle...
- c->lerp.initTriangle(v0, v1, v2);
- if (cull_triangle(c, v0, v1, v2))
- return; // culled!
-
- // Fetch all texture coordinates if needed
- fetch_texcoord(c, v0, v1, v2);
-
- // light (or shade) our triangle!
- c->lighting.lightTriangle(c, v0, v1, v2);
-
- triangle(c, v0, v1, v2);
- return;
- }
-
- // The assumption here is that we're not going to clip very often,
- // and even more rarely will we clip a triangle that ends up
- // being culled out. So it's okay to light the vertices here, even though
- // in a few cases we won't render the triangle (if culled).
-
- // Fetch texture coordinates...
- fetch_texcoord(c, v0, v1, v2);
-
- // light (or shade) our triangle!
- c->lighting.lightTriangle(c, v0, v1, v2);
-
- clip_triangle(c, v0, v1, v2);
-}
-
-// -----------------------------------------------------------------------
-
-void triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- // compute iterators...
- const uint32_t enables = c->rasterizer.state.enables;
- const uint32_t mask = GGL_ENABLE_TMUS |
- GGL_ENABLE_SMOOTH |
- GGL_ENABLE_W |
- GGL_ENABLE_FOG |
- GGL_ENABLE_DEPTH_TEST;
-
- if (ggl_likely(enables & mask))
- lerp_triangle(c, v0, v1, v2);
-
- c->rasterizer.procs.trianglex(c, v0->window.v, v1->window.v, v2->window.v);
-}
-
-void lerp_triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- const uint32_t enables = c->rasterizer.state.enables;
- c->lerp.initLerp(v0, enables);
-
- // set up texture iterators
- if (enables & GGL_ENABLE_TMUS) {
- if (enables & GGL_ENABLE_W) {
- lerp_texcoords_w(c, v0, v1, v2);
- } else {
- lerp_texcoords(c, v0, v1, v2);
- }
- }
-
- // set up the color iterators
- const compute_iterators_t& lerp = c->lerp;
- if (enables & GGL_ENABLE_SMOOTH) {
- GLfixed itc[12];
- for (int i=0 ; i<4 ; i++) {
- const GGLcolor c0 = v0->color.v[i] * 255;
- const GGLcolor c1 = v1->color.v[i] * 255;
- const GGLcolor c2 = v2->color.v[i] * 255;
- lerp.iterators1616(&itc[i*3], c0, c1, c2);
- }
- c->rasterizer.procs.colorGrad12xv(c, itc);
- }
-
- if (enables & GGL_ENABLE_DEPTH_TEST) {
- int32_t itz[3];
- const int32_t v0z = clampZ(v0->window.z);
- const int32_t v1z = clampZ(v1->window.z);
- const int32_t v2z = clampZ(v2->window.z);
- if (ggl_unlikely(c->polygonOffset.enable)) {
- const int32_t units = (c->polygonOffset.units << 16);
- const GLfixed factor = c->polygonOffset.factor;
- if (factor) {
- int64_t itz64[3];
- lerp.iterators0032(itz64, v0z, v1z, v2z);
- int64_t maxDepthSlope = max(itz64[1], itz64[2]);
- itz[0] = uint32_t(itz64[0])
- + uint32_t((maxDepthSlope*factor)>>16) + units;
- itz[1] = uint32_t(itz64[1]);
- itz[2] = uint32_t(itz64[2]);
- } else {
- lerp.iterators0032(itz, v0z, v1z, v2z);
- itz[0] += units;
- }
- } else {
- lerp.iterators0032(itz, v0z, v1z, v2z);
- }
- c->rasterizer.procs.zGrad3xv(c, itz);
- }
-
- if (ggl_unlikely(enables & GGL_ENABLE_FOG)) {
- GLfixed itf[3];
- lerp.iterators1616(itf, v0->fog, v1->fog, v2->fog);
- c->rasterizer.procs.fogGrad3xv(c, itf);
- }
-}
-
-
-static inline
-int compute_lod(ogles_context_t* c, int i,
- int32_t s0, int32_t t0, int32_t s1, int32_t t1, int32_t s2, int32_t t2)
-{
- // Compute mipmap level / primitive
- // rho = sqrt( texelArea / area )
- // lod = log2( rho )
- // lod = log2( texelArea / area ) / 2
- // lod = (log2( texelArea ) - log2( area )) / 2
- const compute_iterators_t& lerp = c->lerp;
- const GGLcoord area = abs(lerp.area());
- const int w = c->textures.tmu[i].texture->surface.width;
- const int h = c->textures.tmu[i].texture->surface.height;
- const int shift = 16 + (16 - TRI_FRACTION_BITS);
- int32_t texelArea = abs( gglMulx(s1-s0, t2-t0, shift) -
- gglMulx(s2-s0, t1-t0, shift) )*w*h;
- int log2TArea = (32-TRI_FRACTION_BITS -1) - gglClz(texelArea);
- int log2Area = (32-TRI_FRACTION_BITS*2-1) - gglClz(area);
- int lod = (log2TArea - log2Area + 1) >> 1;
- return lod;
-}
-
-void lerp_texcoords(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- const compute_iterators_t& lerp = c->lerp;
- int32_t itt[8] __attribute__((aligned(16)));
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- const texture_t& tmu = c->rasterizer.state.texture[i];
- if (!tmu.enable)
- continue;
-
- // compute the jacobians using block floating-point
- int32_t s0 = v0->texture[i].S;
- int32_t t0 = v0->texture[i].T;
- int32_t s1 = v1->texture[i].S;
- int32_t t1 = v1->texture[i].T;
- int32_t s2 = v2->texture[i].S;
- int32_t t2 = v2->texture[i].T;
-
- const GLenum min_filter = c->textures.tmu[i].texture->min_filter;
- if (ggl_unlikely(min_filter >= GL_NEAREST_MIPMAP_NEAREST)) {
- int lod = compute_lod(c, i, s0, t0, s1, t1, s2, t2);
- c->rasterizer.procs.bindTextureLod(c, i,
- &c->textures.tmu[i].texture->mip(lod));
- }
-
- // premultiply (s,t) when clampling
- if (tmu.s_wrap == GGL_CLAMP) {
- const int width = tmu.surface.width;
- s0 *= width;
- s1 *= width;
- s2 *= width;
- }
- if (tmu.t_wrap == GGL_CLAMP) {
- const int height = tmu.surface.height;
- t0 *= height;
- t1 *= height;
- t2 *= height;
- }
- itt[6] = -lerp.iteratorsScale(itt+0, s0, s1, s2);
- itt[7] = -lerp.iteratorsScale(itt+3, t0, t1, t2);
- c->rasterizer.procs.texCoordGradScale8xv(c, i, itt);
- }
-}
-
-void lerp_texcoords_w(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- const compute_iterators_t& lerp = c->lerp;
- int32_t itt[8] __attribute__((aligned(16)));
- int32_t itw[3];
-
- // compute W's scale to 2.30
- int32_t w0 = v0->window.w;
- int32_t w1 = v1->window.w;
- int32_t w2 = v2->window.w;
- int wscale = 32 - gglClz(w0|w1|w2);
-
- // compute the jacobian using block floating-point
- int sc = lerp.iteratorsScale(itw, w0, w1, w2);
- sc += wscale - 16;
- c->rasterizer.procs.wGrad3xv(c, itw);
-
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- const texture_t& tmu = c->rasterizer.state.texture[i];
- if (!tmu.enable)
- continue;
-
- // compute the jacobians using block floating-point
- int32_t s0 = v0->texture[i].S;
- int32_t t0 = v0->texture[i].T;
- int32_t s1 = v1->texture[i].S;
- int32_t t1 = v1->texture[i].T;
- int32_t s2 = v2->texture[i].S;
- int32_t t2 = v2->texture[i].T;
-
- const GLenum min_filter = c->textures.tmu[i].texture->min_filter;
- if (ggl_unlikely(min_filter >= GL_NEAREST_MIPMAP_NEAREST)) {
- int lod = compute_lod(c, i, s0, t0, s1, t1, s2, t2);
- c->rasterizer.procs.bindTextureLod(c, i,
- &c->textures.tmu[i].texture->mip(lod));
- }
-
- // premultiply (s,t) when clampling
- if (tmu.s_wrap == GGL_CLAMP) {
- const int width = tmu.surface.width;
- s0 *= width;
- s1 *= width;
- s2 *= width;
- }
- if (tmu.t_wrap == GGL_CLAMP) {
- const int height = tmu.surface.height;
- t0 *= height;
- t1 *= height;
- t2 *= height;
- }
-
- s0 = gglMulx(s0, w0, wscale);
- t0 = gglMulx(t0, w0, wscale);
- s1 = gglMulx(s1, w1, wscale);
- t1 = gglMulx(t1, w1, wscale);
- s2 = gglMulx(s2, w2, wscale);
- t2 = gglMulx(t2, w2, wscale);
-
- itt[6] = sc - lerp.iteratorsScale(itt+0, s0, s1, s2);
- itt[7] = sc - lerp.iteratorsScale(itt+3, t0, t1, t2);
- c->rasterizer.procs.texCoordGradScale8xv(c, i, itt);
- }
-}
-
-
-static inline
-bool cull_triangle(ogles_context_t* c, vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- if (ggl_likely(c->cull.enable)) {
- const GLenum winding = (c->lerp.area() > 0) ? GL_CW : GL_CCW;
- const GLenum face = (winding == c->cull.frontFace) ? GL_FRONT : GL_BACK;
- if (face == c->cull.cullFace)
- return true; // culled!
- }
- return false;
-}
-
-static inline
-GLfixed frustumPlaneDist(int plane, const vec4_t& s)
-{
- const GLfixed d = s.v[ plane >> 1 ];
- return ((plane & 1) ? (s.w - d) : (s.w + d));
-}
-
-static inline
-int32_t clipDivide(GLfixed a, GLfixed b) {
- // returns a 4.28 fixed-point
- return gglMulDivi(1LU<<28, a, b);
-}
-
-void clip_triangle(ogles_context_t* c,
- vertex_t* v0, vertex_t* v1, vertex_t* v2)
-{
- uint32_t all_cc = (v0->flags | v1->flags | v2->flags) & vertex_t::CLIP_ALL;
-
- vertex_t *p0, *p1, *p2;
- const int MAX_CLIPPING_PLANES = 6 + OGLES_MAX_CLIP_PLANES;
- const int MAX_VERTICES = 3;
-
- // Temporary buffer to hold the new vertices. Each plane can add up to
- // two new vertices (because the polygon is convex).
- // We need one extra element, to handle an overflow case when
- // the polygon degenerates into something non convex.
- vertex_t buffer[MAX_CLIPPING_PLANES * 2 + 1]; // ~3KB
- vertex_t* buf = buffer;
-
- // original list of vertices (polygon to clip, in fact this
- // function works with an arbitrary polygon).
- vertex_t* in[3] = { v0, v1, v2 };
-
- // output lists (we need 2, which we use back and forth)
- // (maximum outpout list's size is MAX_CLIPPING_PLANES + MAX_VERTICES)
- // 2 more elements for overflow when non convex polygons.
- vertex_t* out[2][MAX_CLIPPING_PLANES + MAX_VERTICES + 2];
- unsigned int outi = 0;
-
- // current input list
- vertex_t** ivl = in;
-
- // 3 input vertices, 0 in the output list, first plane
- unsigned int ic = 3;
-
- // User clip-planes first, the clipping is always done in eye-coordinate
- // this is basically the same algorithm than for the view-volume
- // clipping, except for the computation of the distance (vertex, plane)
- // and the fact that we need to compute the eye-coordinates of each
- // new vertex we create.
-
- if (ggl_unlikely(all_cc & vertex_t::USER_CLIP_ALL))
- {
- unsigned int plane = 0;
- uint32_t cc = (all_cc & vertex_t::USER_CLIP_ALL) >> 8;
- do {
- if (cc & 1) {
- // pointers to our output list (head and current)
- vertex_t** const ovl = &out[outi][0];
- vertex_t** output = ovl;
- unsigned int oc = 0;
- unsigned int sentinel = 0;
- // previous vertex, compute distance to the plane
- vertex_t* s = ivl[ic-1];
- const vec4_t& equation = c->clipPlanes.plane[plane].equation;
- GLfixed sd = dot4(equation.v, s->eye.v);
- // clip each vertex against this plane...
- for (unsigned int i=0 ; i<ic ; i++) {
- vertex_t* p = ivl[i];
- const GLfixed pd = dot4(equation.v, p->eye.v);
- if (sd >= 0) {
- if (pd >= 0) {
- // both inside
- *output++ = p;
- oc++;
- } else {
- // s inside, p outside (exiting)
- const GLfixed t = clipDivide(sd, sd-pd);
- c->arrays.clipEye(c, buf, t, p, s);
- *output++ = buf++;
- oc++;
- if (++sentinel >= 3)
- return; // non-convex polygon!
- }
- } else {
- if (pd >= 0) {
- // s outside (entering)
- if (pd) {
- const GLfixed t = clipDivide(pd, pd-sd);
- c->arrays.clipEye(c, buf, t, s, p);
- *output++ = buf++;
- oc++;
- if (++sentinel >= 3)
- return; // non-convex polygon!
- }
- *output++ = p;
- oc++;
- } else {
- // both outside
- }
- }
- s = p;
- sd = pd;
- }
- // output list become the new input list
- if (oc<3)
- return; // less than 3 vertices left? we're done!
- ivl = ovl;
- ic = oc;
- outi = 1-outi;
- }
- cc >>= 1;
- plane++;
- } while (cc);
- }
-
- // frustum clip-planes
- if (all_cc & vertex_t::FRUSTUM_CLIP_ALL)
- {
- unsigned int plane = 0;
- uint32_t cc = all_cc & vertex_t::FRUSTUM_CLIP_ALL;
- do {
- if (cc & 1) {
- // pointers to our output list (head and current)
- vertex_t** const ovl = &out[outi][0];
- vertex_t** output = ovl;
- unsigned int oc = 0;
- unsigned int sentinel = 0;
- // previous vertex, compute distance to the plane
- vertex_t* s = ivl[ic-1];
- GLfixed sd = frustumPlaneDist(plane, s->clip);
- // clip each vertex against this plane...
- for (unsigned int i=0 ; i<ic ; i++) {
- vertex_t* p = ivl[i];
- const GLfixed pd = frustumPlaneDist(plane, p->clip);
- if (sd >= 0) {
- if (pd >= 0) {
- // both inside
- *output++ = p;
- oc++;
- } else {
- // s inside, p outside (exiting)
- const GLfixed t = clipDivide(sd, sd-pd);
- c->arrays.clipVertex(c, buf, t, p, s);
- *output++ = buf++;
- oc++;
- if (++sentinel >= 3)
- return; // non-convex polygon!
- }
- } else {
- if (pd >= 0) {
- // s outside (entering)
- if (pd) {
- const GLfixed t = clipDivide(pd, pd-sd);
- c->arrays.clipVertex(c, buf, t, s, p);
- *output++ = buf++;
- oc++;
- if (++sentinel >= 3)
- return; // non-convex polygon!
- }
- *output++ = p;
- oc++;
- } else {
- // both outside
- }
- }
- s = p;
- sd = pd;
- }
- // output list become the new input list
- if (oc<3)
- return; // less than 3 vertices left? we're done!
- ivl = ovl;
- ic = oc;
- outi = 1-outi;
- }
- cc >>= 1;
- plane++;
- } while (cc);
- }
-
- // finally we can render our triangles...
- p0 = ivl[0];
- p1 = ivl[1];
- for (unsigned int i=2 ; i<ic ; i++) {
- p2 = ivl[i];
- c->lerp.initTriangle(p0, p1, p2);
- if (cull_triangle(c, p0, p1, p2)) {
- p1 = p2;
- continue; // culled!
- }
- triangle(c, p0, p1, p2);
- p1 = p2;
- }
-}
-
-unsigned int clip_line(ogles_context_t* c, vertex_t* s, vertex_t* p)
-{
- const uint32_t all_cc = (s->flags | p->flags) & vertex_t::CLIP_ALL;
-
- if (ggl_unlikely(all_cc & vertex_t::USER_CLIP_ALL))
- {
- unsigned int plane = 0;
- uint32_t cc = (all_cc & vertex_t::USER_CLIP_ALL) >> 8;
- do {
- if (cc & 1) {
- const vec4_t& equation = c->clipPlanes.plane[plane].equation;
- const GLfixed sd = dot4(equation.v, s->eye.v);
- const GLfixed pd = dot4(equation.v, p->eye.v);
- if (sd >= 0) {
- if (pd >= 0) {
- // both inside
- } else {
- // s inside, p outside (exiting)
- const GLfixed t = clipDivide(sd, sd-pd);
- c->arrays.clipEye(c, p, t, p, s);
- }
- } else {
- if (pd >= 0) {
- // s outside (entering)
- if (pd) {
- const GLfixed t = clipDivide(pd, pd-sd);
- c->arrays.clipEye(c, s, t, s, p);
- }
- } else {
- // both outside
- return 0;
- }
- }
- }
- cc >>= 1;
- plane++;
- } while (cc);
- }
-
- // frustum clip-planes
- if (all_cc & vertex_t::FRUSTUM_CLIP_ALL)
- {
- unsigned int plane = 0;
- uint32_t cc = all_cc & vertex_t::FRUSTUM_CLIP_ALL;
- do {
- if (cc & 1) {
- const GLfixed sd = frustumPlaneDist(plane, s->clip);
- const GLfixed pd = frustumPlaneDist(plane, p->clip);
- if (sd >= 0) {
- if (pd >= 0) {
- // both inside
- } else {
- // s inside, p outside (exiting)
- const GLfixed t = clipDivide(sd, sd-pd);
- c->arrays.clipVertex(c, p, t, p, s);
- }
- } else {
- if (pd >= 0) {
- // s outside (entering)
- if (pd) {
- const GLfixed t = clipDivide(pd, pd-sd);
- c->arrays.clipVertex(c, s, t, s, p);
- }
- } else {
- // both outside
- return 0;
- }
- }
- }
- cc >>= 1;
- plane++;
- } while (cc);
- }
-
- return 2;
-}
-
-
-}; // namespace android
diff --git a/opengl/libagl/primitives.h b/opengl/libagl/primitives.h
deleted file mode 100644
index 1bef604..0000000
--- a/opengl/libagl/primitives.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* libs/opengles/primitives.h
-**
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_PRIMITIVES_H
-#define ANDROID_OPENGLES_PRIMITIVES_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-
-namespace android {
-
-namespace gl {
-struct ogles_context_t;
-};
-
-void ogles_validate_primitives(ogles_context_t* c);
-
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_PRIMITIVES_H
-
diff --git a/opengl/libagl/state.cpp b/opengl/libagl/state.cpp
deleted file mode 100644
index 90e9612..0000000
--- a/opengl/libagl/state.cpp
+++ /dev/null
@@ -1,597 +0,0 @@
-/* libs/opengles/state.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdlib.h>
-
-#include "context.h"
-#include "fp.h"
-#include "state.h"
-#include "array.h"
-#include "matrix.h"
-#include "vertex.h"
-#include "light.h"
-#include "texture.h"
-#include "BufferObjectManager.h"
-#include "TextureObjectManager.h"
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-static char const * const gVendorString = "Android";
-static char const * const gRendererString = "Android PixelFlinger 1.4";
-static char const * const gVersionString = "OpenGL ES-CM 1.0";
-static char const * const gExtensionsString =
- "GL_OES_byte_coordinates " // OK
- "GL_OES_fixed_point " // OK
- "GL_OES_single_precision " // OK
- "GL_OES_read_format " // OK
- "GL_OES_compressed_paletted_texture " // OK
- "GL_OES_draw_texture " // OK
- "GL_OES_matrix_get " // OK
- "GL_OES_query_matrix " // OK
- // "GL_OES_point_size_array " // TODO
- // "GL_OES_point_sprite " // TODO
- "GL_OES_EGL_image " // OK
-#ifdef GL_OES_compressed_ETC1_RGB8_texture
- "GL_OES_compressed_ETC1_RGB8_texture " // OK
-#endif
- "GL_ARB_texture_compression " // OK
- "GL_ARB_texture_non_power_of_two " // OK
- "GL_ANDROID_user_clip_plane " // OK
- "GL_ANDROID_vertex_buffer_object " // OK
- "GL_ANDROID_generate_mipmap " // OK
- ;
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-ogles_context_t *ogles_init(size_t extra)
-{
- void* const base = malloc(extra + sizeof(ogles_context_t) + 32);
- if (!base) return 0;
-
- ogles_context_t *c =
- (ogles_context_t *)((ptrdiff_t(base) + extra + 31) & ~0x1FL);
- memset(c, 0, sizeof(ogles_context_t));
- ggl_init_context(&(c->rasterizer));
-
- // XXX: this should be passed as an argument
- sp<EGLSurfaceManager> smgr(new EGLSurfaceManager());
- c->surfaceManager = smgr.get();
- c->surfaceManager->incStrong(c);
-
- sp<EGLBufferObjectManager> bomgr(new EGLBufferObjectManager());
- c->bufferObjectManager = bomgr.get();
- c->bufferObjectManager->incStrong(c);
-
- ogles_init_array(c);
- ogles_init_matrix(c);
- ogles_init_vertex(c);
- ogles_init_light(c);
- ogles_init_texture(c);
-
- c->rasterizer.base = base;
- c->point.size = TRI_ONE;
- c->line.width = TRI_ONE;
-
- // in OpenGL, writing to the depth buffer is enabled by default.
- c->rasterizer.procs.depthMask(c, 1);
-
- // OpenGL enables dithering by default
- c->rasterizer.procs.enable(c, GL_DITHER);
-
- return c;
-}
-
-void ogles_uninit(ogles_context_t* c)
-{
- ogles_uninit_array(c);
- ogles_uninit_matrix(c);
- ogles_uninit_vertex(c);
- ogles_uninit_light(c);
- ogles_uninit_texture(c);
- c->surfaceManager->decStrong(c);
- c->bufferObjectManager->decStrong(c);
- ggl_uninit_context(&(c->rasterizer));
- free(c->rasterizer.base);
-}
-
-void _ogles_error(ogles_context_t* c, GLenum error)
-{
- if (c->error == GL_NO_ERROR)
- c->error = error;
-}
-
-static bool stencilop_valid(GLenum op) {
- switch (op) {
- case GL_KEEP:
- case GL_ZERO:
- case GL_REPLACE:
- case GL_INCR:
- case GL_DECR:
- case GL_INVERT:
- return true;
- }
- return false;
-}
-
-static void enable_disable(ogles_context_t* c, GLenum cap, int enabled)
-{
- if ((cap >= GL_LIGHT0) && (cap<GL_LIGHT0+OGLES_MAX_LIGHTS)) {
- c->lighting.lights[cap-GL_LIGHT0].enable = enabled;
- c->lighting.enabledLights &= ~(1<<(cap-GL_LIGHT0));
- c->lighting.enabledLights |= (enabled<<(cap-GL_LIGHT0));
- return;
- }
-
- switch (cap) {
- case GL_POINT_SMOOTH:
- c->point.smooth = enabled;
- break;
- case GL_LINE_SMOOTH:
- c->line.smooth = enabled;
- break;
- case GL_POLYGON_OFFSET_FILL:
- c->polygonOffset.enable = enabled;
- break;
- case GL_CULL_FACE:
- c->cull.enable = enabled;
- break;
- case GL_LIGHTING:
- c->lighting.enable = enabled;
- break;
- case GL_COLOR_MATERIAL:
- c->lighting.colorMaterial.enable = enabled;
- break;
- case GL_NORMALIZE:
- case GL_RESCALE_NORMAL:
- c->transforms.rescaleNormals = enabled ? cap : 0;
- // XXX: invalidate mvit
- break;
-
- case GL_CLIP_PLANE0:
- case GL_CLIP_PLANE1:
- case GL_CLIP_PLANE2:
- case GL_CLIP_PLANE3:
- case GL_CLIP_PLANE4:
- case GL_CLIP_PLANE5:
- c->clipPlanes.enable &= ~(1<<(cap-GL_CLIP_PLANE0));
- c->clipPlanes.enable |= (enabled<<(cap-GL_CLIP_PLANE0));
- ogles_invalidate_perspective(c);
- break;
-
- case GL_FOG:
- case GL_DEPTH_TEST:
- ogles_invalidate_perspective(c);
- // fall-through...
- case GL_BLEND:
- case GL_SCISSOR_TEST:
- case GL_ALPHA_TEST:
- case GL_COLOR_LOGIC_OP:
- case GL_DITHER:
- case GL_STENCIL_TEST:
- case GL_TEXTURE_2D:
- // these need to fall through into the rasterizer
- c->rasterizer.procs.enableDisable(c, cap, enabled);
- break;
- case GL_TEXTURE_EXTERNAL_OES:
- c->rasterizer.procs.enableDisable(c, GL_TEXTURE_2D, enabled);
- break;
-
- case GL_MULTISAMPLE:
- case GL_SAMPLE_ALPHA_TO_COVERAGE:
- case GL_SAMPLE_ALPHA_TO_ONE:
- case GL_SAMPLE_COVERAGE:
- // not supported in this implementation
- break;
-
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-using namespace android;
-
-#if 0
-#pragma mark -
-#endif
-
-// These ones are super-easy, we're not supporting those features!
-void glSampleCoverage(GLclampf value, GLboolean invert) {
-}
-void glSampleCoveragex(GLclampx value, GLboolean invert) {
-}
-void glStencilFunc(GLenum func, GLint ref, GLuint mask) {
- ogles_context_t* c = ogles_context_t::get();
- if (func < GL_NEVER || func > GL_ALWAYS) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- // from OpenGL|ES 1.0 sepcification:
- // If there is no stencil buffer, no stencil modification can occur
- // and it is as if the stencil test always passes.
-}
-
-void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
- ogles_context_t* c = ogles_context_t::get();
- if ((stencilop_valid(fail) &
- stencilop_valid(zfail) &
- stencilop_valid(zpass)) == 0) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-}
-
-// ----------------------------------------------------------------------------
-
-void glAlphaFunc(GLenum func, GLclampf ref)
-{
- glAlphaFuncx(func, gglFloatToFixed(ref));
-}
-
-void glCullFace(GLenum mode)
-{
- ogles_context_t* c = ogles_context_t::get();
- switch (mode) {
- case GL_FRONT:
- case GL_BACK:
- case GL_FRONT_AND_BACK:
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- }
- c->cull.cullFace = mode;
-}
-
-void glFrontFace(GLenum mode)
-{
- ogles_context_t* c = ogles_context_t::get();
- switch (mode) {
- case GL_CW:
- case GL_CCW:
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->cull.frontFace = mode;
-}
-
-void glHint(GLenum target, GLenum mode)
-{
- ogles_context_t* c = ogles_context_t::get();
- switch (target) {
- case GL_FOG_HINT:
- case GL_GENERATE_MIPMAP_HINT:
- case GL_LINE_SMOOTH_HINT:
- break;
- case GL_POINT_SMOOTH_HINT:
- c->rasterizer.procs.enableDisable(c,
- GGL_POINT_SMOOTH_NICE, mode==GL_NICEST);
- break;
- case GL_PERSPECTIVE_CORRECTION_HINT:
- c->perspective = (mode == GL_NICEST) ? 1 : 0;
- break;
- default:
- ogles_error(c, GL_INVALID_ENUM);
- }
-}
-
-void glEnable(GLenum cap) {
- ogles_context_t* c = ogles_context_t::get();
- enable_disable(c, cap, 1);
-}
-void glDisable(GLenum cap) {
- ogles_context_t* c = ogles_context_t::get();
- enable_disable(c, cap, 0);
-}
-
-void glFinish()
-{ // nothing to do for our software implementation
-}
-
-void glFlush()
-{ // nothing to do for our software implementation
-}
-
-GLenum glGetError()
-{
- // From OpenGL|ES 1.0 specification:
- // If more than one flag has recorded an error, glGetError returns
- // and clears an arbitrary error flag value. Thus, glGetError should
- // always be called in a loop, until it returns GL_NO_ERROR,
- // if all error flags are to be reset.
-
- ogles_context_t* c = ogles_context_t::get();
- if (c->error) {
- const GLenum ret(c->error);
- c->error = 0;
- return ret;
- }
-
- if (c->rasterizer.error) {
- const GLenum ret(c->rasterizer.error);
- c->rasterizer.error = 0;
- return ret;
- }
-
- return GL_NO_ERROR;
-}
-
-const GLubyte* glGetString(GLenum string)
-{
- switch (string) {
- case GL_VENDOR: return (const GLubyte*)gVendorString;
- case GL_RENDERER: return (const GLubyte*)gRendererString;
- case GL_VERSION: return (const GLubyte*)gVersionString;
- case GL_EXTENSIONS: return (const GLubyte*)gExtensionsString;
- }
- ogles_context_t* c = ogles_context_t::get();
- ogles_error(c, GL_INVALID_ENUM);
- return 0;
-}
-
-void glGetIntegerv(GLenum pname, GLint *params)
-{
- int i;
- ogles_context_t* c = ogles_context_t::get();
- switch (pname) {
- case GL_ALIASED_POINT_SIZE_RANGE:
- params[0] = 0;
- params[1] = GGL_MAX_ALIASED_POINT_SIZE;
- break;
- case GL_ALIASED_LINE_WIDTH_RANGE:
- params[0] = 0;
- params[1] = GGL_MAX_ALIASED_POINT_SIZE;
- break;
- case GL_ALPHA_BITS: {
- int index = c->rasterizer.state.buffers.color.format;
- GGLFormat const * formats = gglGetPixelFormatTable();
- params[0] = formats[index].ah - formats[index].al;
- break;
- }
- case GL_RED_BITS: {
- int index = c->rasterizer.state.buffers.color.format;
- GGLFormat const * formats = gglGetPixelFormatTable();
- params[0] = formats[index].rh - formats[index].rl;
- break;
- }
- case GL_GREEN_BITS: {
- int index = c->rasterizer.state.buffers.color.format;
- GGLFormat const * formats = gglGetPixelFormatTable();
- params[0] = formats[index].gh - formats[index].gl;
- break;
- }
- case GL_BLUE_BITS: {
- int index = c->rasterizer.state.buffers.color.format;
- GGLFormat const * formats = gglGetPixelFormatTable();
- params[0] = formats[index].bh - formats[index].bl;
- break;
- }
- case GL_COMPRESSED_TEXTURE_FORMATS:
- params[ 0] = GL_PALETTE4_RGB8_OES;
- params[ 1] = GL_PALETTE4_RGBA8_OES;
- params[ 2] = GL_PALETTE4_R5_G6_B5_OES;
- params[ 3] = GL_PALETTE4_RGBA4_OES;
- params[ 4] = GL_PALETTE4_RGB5_A1_OES;
- params[ 5] = GL_PALETTE8_RGB8_OES;
- params[ 6] = GL_PALETTE8_RGBA8_OES;
- params[ 7] = GL_PALETTE8_R5_G6_B5_OES;
- params[ 8] = GL_PALETTE8_RGBA4_OES;
- params[ 9] = GL_PALETTE8_RGB5_A1_OES;
- i = 10;
-#ifdef GL_OES_compressed_ETC1_RGB8_texture
- params[i++] = GL_ETC1_RGB8_OES;
-#endif
- break;
- case GL_DEPTH_BITS:
- params[0] = c->rasterizer.state.buffers.depth.format ? 0 : 16;
- break;
- case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
- params[0] = GL_RGB;
- break;
- case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
- params[0] = GL_UNSIGNED_SHORT_5_6_5;
- break;
- case GL_MAX_LIGHTS:
- params[0] = OGLES_MAX_LIGHTS;
- break;
- case GL_MAX_CLIP_PLANES:
- params[0] = OGLES_MAX_CLIP_PLANES;
- break;
- case GL_MAX_MODELVIEW_STACK_DEPTH:
- params[0] = OGLES_MODELVIEW_STACK_DEPTH;
- break;
- case GL_MAX_PROJECTION_STACK_DEPTH:
- params[0] = OGLES_PROJECTION_STACK_DEPTH;
- break;
- case GL_MAX_TEXTURE_STACK_DEPTH:
- params[0] = OGLES_TEXTURE_STACK_DEPTH;
- break;
- case GL_MAX_TEXTURE_SIZE:
- params[0] = GGL_MAX_TEXTURE_SIZE;
- break;
- case GL_MAX_TEXTURE_UNITS:
- params[0] = GGL_TEXTURE_UNIT_COUNT;
- break;
- case GL_MAX_VIEWPORT_DIMS:
- params[0] = GGL_MAX_VIEWPORT_DIMS;
- params[1] = GGL_MAX_VIEWPORT_DIMS;
- break;
- case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
- params[0] = OGLES_NUM_COMPRESSED_TEXTURE_FORMATS;
- break;
- case GL_SMOOTH_LINE_WIDTH_RANGE:
- params[0] = 0;
- params[1] = GGL_MAX_SMOOTH_LINE_WIDTH;
- break;
- case GL_SMOOTH_POINT_SIZE_RANGE:
- params[0] = 0;
- params[1] = GGL_MAX_SMOOTH_POINT_SIZE;
- break;
- case GL_STENCIL_BITS:
- params[0] = 0;
- break;
- case GL_SUBPIXEL_BITS:
- params[0] = GGL_SUBPIXEL_BITS;
- break;
-
- case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
- memcpy( params,
- c->transforms.modelview.top().elements(),
- 16*sizeof(GLint));
- break;
- case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
- memcpy( params,
- c->transforms.projection.top().elements(),
- 16*sizeof(GLint));
- break;
- case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
- memcpy( params,
- c->transforms.texture[c->textures.active].top().elements(),
- 16*sizeof(GLint));
- break;
-
- default:
- ogles_error(c, GL_INVALID_ENUM);
- break;
- }
-}
-
-// ----------------------------------------------------------------------------
-
-void glPointSize(GLfloat size)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (size <= 0) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->point.size = TRI_FROM_FIXED(gglFloatToFixed(size));
-}
-
-void glPointSizex(GLfixed size)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (size <= 0) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->point.size = TRI_FROM_FIXED(size);
-}
-
-// ----------------------------------------------------------------------------
-
-void glLineWidth(GLfloat width)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (width <= 0) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->line.width = TRI_FROM_FIXED(gglFloatToFixed(width));
-}
-
-void glLineWidthx(GLfixed width)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (width <= 0) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->line.width = TRI_FROM_FIXED(width);
-}
-
-// ----------------------------------------------------------------------------
-
-void glColorMask(GLboolean r, GLboolean g, GLboolean b, GLboolean a) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.colorMask(c, r, g, b, a);
-}
-
-void glDepthMask(GLboolean flag) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.depthMask(c, flag);
-}
-
-void glStencilMask(GLuint mask) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.stencilMask(c, mask);
-}
-
-void glDepthFunc(GLenum func) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.depthFunc(c, func);
-}
-
-void glLogicOp(GLenum opcode) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.logicOp(c, opcode);
-}
-
-void glAlphaFuncx(GLenum func, GLclampx ref) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.alphaFuncx(c, func, ref);
-}
-
-void glBlendFunc(GLenum sfactor, GLenum dfactor) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.blendFunc(c, sfactor, dfactor);
-}
-
-void glClear(GLbitfield mask) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.clear(c, mask);
-}
-
-void glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.clearColorx(c, red, green, blue, alpha);
-}
-
-void glClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.clearColorx(c,
- gglFloatToFixed(r),
- gglFloatToFixed(g),
- gglFloatToFixed(b),
- gglFloatToFixed(a));
-}
-
-void glClearDepthx(GLclampx depth) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.clearDepthx(c, depth);
-}
-
-void glClearDepthf(GLclampf depth)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.clearDepthx(c, gglFloatToFixed(depth));
-}
-
-void glClearStencil(GLint s) {
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.clearStencil(c, s);
-}
diff --git a/opengl/libagl/state.h b/opengl/libagl/state.h
deleted file mode 100644
index 55a5ccb..0000000
--- a/opengl/libagl/state.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* libs/opengles/state.h
-**
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_STATE_H
-#define ANDROID_OPENGLES_STATE_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-#include <private/pixelflinger/ggl_context.h>
-
-#include <GLES/gl.h>
-
-#include <stdio.h>
-
-namespace android {
-
-ogles_context_t *ogles_init(size_t extra);
-void ogles_uninit(ogles_context_t* c);
-void _ogles_error(ogles_context_t* c, GLenum error);
-
-#ifndef TRACE_GL_ERRORS
-#define TRACE_GL_ERRORS 0
-#endif
-
-#if TRACE_GL_ERRORS
-#define ogles_error(c, error) \
-do { \
- printf("ogles_error at file %s line %d\n", __FILE__, __LINE__); \
- _ogles_error(c, error); \
-} while (0)
-#else /* !TRACE_GL_ERRORS */
-#define ogles_error(c, error) _ogles_error((c), (error))
-#endif
-
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_STATE_H
-
diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp
deleted file mode 100644
index 08536df..0000000
--- a/opengl/libagl/texture.cpp
+++ /dev/null
@@ -1,1656 +0,0 @@
-/* libs/opengles/texture.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "context.h"
-#include "fp.h"
-#include "state.h"
-#include "texture.h"
-#include "TextureObjectManager.h"
-
-#include <ETC1/etc1.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-static void bindTextureTmu(
- ogles_context_t* c, int tmu, GLuint texture, const sp<EGLTextureObject>& tex);
-
-static __attribute__((noinline))
-void generateMipmap(ogles_context_t* c, GLint level);
-
-// ----------------------------------------------------------------------------
-
-#if 0
-#pragma mark -
-#pragma mark Init
-#endif
-
-void ogles_init_texture(ogles_context_t* c)
-{
- c->textures.packAlignment = 4;
- c->textures.unpackAlignment = 4;
-
- // each context has a default named (0) texture (not shared)
- c->textures.defaultTexture = new EGLTextureObject();
- c->textures.defaultTexture->incStrong(c);
-
- // bind the default texture to each texture unit
- for (int i=0; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- bindTextureTmu(c, i, 0, c->textures.defaultTexture);
- memset(c->current.texture[i].v, 0, sizeof(vec4_t));
- c->current.texture[i].Q = 0x10000;
- }
-}
-
-void ogles_uninit_texture(ogles_context_t* c)
-{
- if (c->textures.ggl)
- gglUninit(c->textures.ggl);
- c->textures.defaultTexture->decStrong(c);
- for (int i=0; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- if (c->textures.tmu[i].texture)
- c->textures.tmu[i].texture->decStrong(c);
- }
-}
-
-static __attribute__((noinline))
-void validate_tmu(ogles_context_t* c, int i)
-{
- texture_unit_t& u(c->textures.tmu[i]);
- if (u.dirty) {
- u.dirty = 0;
- c->rasterizer.procs.activeTexture(c, i);
- c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
- c->rasterizer.procs.texGeni(c, GGL_S,
- GGL_TEXTURE_GEN_MODE, GGL_AUTOMATIC);
- c->rasterizer.procs.texGeni(c, GGL_T,
- GGL_TEXTURE_GEN_MODE, GGL_AUTOMATIC);
- c->rasterizer.procs.texParameteri(c, GGL_TEXTURE_2D,
- GGL_TEXTURE_WRAP_S, u.texture->wraps);
- c->rasterizer.procs.texParameteri(c, GGL_TEXTURE_2D,
- GGL_TEXTURE_WRAP_T, u.texture->wrapt);
- c->rasterizer.procs.texParameteri(c, GGL_TEXTURE_2D,
- GGL_TEXTURE_MIN_FILTER, u.texture->min_filter);
- c->rasterizer.procs.texParameteri(c, GGL_TEXTURE_2D,
- GGL_TEXTURE_MAG_FILTER, u.texture->mag_filter);
-
- // disable this texture unit if it's not complete
- if (!u.texture->isComplete()) {
- c->rasterizer.procs.disable(c, GGL_TEXTURE_2D);
- }
- }
-}
-
-void ogles_validate_texture(ogles_context_t* c)
-{
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- if (c->rasterizer.state.texture[i].enable)
- validate_tmu(c, i);
- }
- c->rasterizer.procs.activeTexture(c, c->textures.active);
-}
-
-static
-void invalidate_texture(ogles_context_t* c, int tmu, uint8_t flags = 0xFF) {
- c->textures.tmu[tmu].dirty = flags;
-}
-
-/*
- * If the active textures are EGLImage, they need to be locked before
- * they can be used.
- *
- * FIXME: code below is far from being optimal
- *
- */
-
-void ogles_lock_textures(ogles_context_t* c)
-{
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- if (c->rasterizer.state.texture[i].enable) {
- texture_unit_t& u(c->textures.tmu[i]);
- ANativeWindowBuffer* native_buffer = u.texture->buffer;
- if (native_buffer) {
- c->rasterizer.procs.activeTexture(c, i);
- hw_module_t const* pModule;
- if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &pModule))
- continue;
-
- gralloc_module_t const* module =
- reinterpret_cast<gralloc_module_t const*>(pModule);
-
- void* vaddr;
- int err = module->lock(module, native_buffer->handle,
- GRALLOC_USAGE_SW_READ_OFTEN,
- 0, 0, native_buffer->width, native_buffer->height,
- &vaddr);
-
- u.texture->setImageBits(vaddr);
- c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
- }
- }
- }
-}
-
-void ogles_unlock_textures(ogles_context_t* c)
-{
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- if (c->rasterizer.state.texture[i].enable) {
- texture_unit_t& u(c->textures.tmu[i]);
- ANativeWindowBuffer* native_buffer = u.texture->buffer;
- if (native_buffer) {
- c->rasterizer.procs.activeTexture(c, i);
- hw_module_t const* pModule;
- if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &pModule))
- continue;
-
- gralloc_module_t const* module =
- reinterpret_cast<gralloc_module_t const*>(pModule);
-
- module->unlock(module, native_buffer->handle);
- u.texture->setImageBits(NULL);
- c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
- }
- }
- }
- c->rasterizer.procs.activeTexture(c, c->textures.active);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Format conversion
-#endif
-
-static uint32_t gl2format_table[6][4] = {
- // BYTE, 565, 4444, 5551
- { GGL_PIXEL_FORMAT_A_8,
- 0, 0, 0 }, // GL_ALPHA
- { GGL_PIXEL_FORMAT_RGB_888,
- GGL_PIXEL_FORMAT_RGB_565,
- 0, 0 }, // GL_RGB
- { GGL_PIXEL_FORMAT_RGBA_8888,
- 0,
- GGL_PIXEL_FORMAT_RGBA_4444,
- GGL_PIXEL_FORMAT_RGBA_5551 }, // GL_RGBA
- { GGL_PIXEL_FORMAT_L_8,
- 0, 0, 0 }, // GL_LUMINANCE
- { GGL_PIXEL_FORMAT_LA_88,
- 0, 0, 0 }, // GL_LUMINANCE_ALPHA
-};
-
-static int32_t convertGLPixelFormat(GLint format, GLenum type)
-{
- int32_t fi = -1;
- int32_t ti = -1;
- switch (format) {
- case GL_ALPHA: fi = 0; break;
- case GL_RGB: fi = 1; break;
- case GL_RGBA: fi = 2; break;
- case GL_LUMINANCE: fi = 3; break;
- case GL_LUMINANCE_ALPHA: fi = 4; break;
- }
- switch (type) {
- case GL_UNSIGNED_BYTE: ti = 0; break;
- case GL_UNSIGNED_SHORT_5_6_5: ti = 1; break;
- case GL_UNSIGNED_SHORT_4_4_4_4: ti = 2; break;
- case GL_UNSIGNED_SHORT_5_5_5_1: ti = 3; break;
- }
- if (fi==-1 || ti==-1)
- return 0;
- return gl2format_table[fi][ti];
-}
-
-// ----------------------------------------------------------------------------
-
-static GLenum validFormatType(ogles_context_t* c, GLenum format, GLenum type)
-{
- GLenum error = 0;
- if (format<GL_ALPHA || format>GL_LUMINANCE_ALPHA) {
- error = GL_INVALID_ENUM;
- }
- if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT_4_4_4_4 &&
- type != GL_UNSIGNED_SHORT_5_5_5_1 && type != GL_UNSIGNED_SHORT_5_6_5) {
- error = GL_INVALID_ENUM;
- }
- if (type == GL_UNSIGNED_SHORT_5_6_5 && format != GL_RGB) {
- error = GL_INVALID_OPERATION;
- }
- if ((type == GL_UNSIGNED_SHORT_4_4_4_4 ||
- type == GL_UNSIGNED_SHORT_5_5_5_1) && format != GL_RGBA) {
- error = GL_INVALID_OPERATION;
- }
- if (error) {
- ogles_error(c, error);
- }
- return error;
-}
-
-// ----------------------------------------------------------------------------
-
-GGLContext* getRasterizer(ogles_context_t* c)
-{
- GGLContext* ggl = c->textures.ggl;
- if (ggl_unlikely(!ggl)) {
- // this is quite heavy the first time...
- gglInit(&ggl);
- if (!ggl) {
- return 0;
- }
- GGLfixed colors[4] = { 0, 0, 0, 0x10000 };
- c->textures.ggl = ggl;
- ggl->activeTexture(ggl, 0);
- ggl->enable(ggl, GGL_TEXTURE_2D);
- ggl->texEnvi(ggl, GGL_TEXTURE_ENV, GGL_TEXTURE_ENV_MODE, GGL_REPLACE);
- ggl->disable(ggl, GGL_DITHER);
- ggl->shadeModel(ggl, GGL_FLAT);
- ggl->color4xv(ggl, colors);
- }
- return ggl;
-}
-
-static __attribute__((noinline))
-int copyPixels(
- ogles_context_t* c,
- const GGLSurface& dst,
- GLint xoffset, GLint yoffset,
- const GGLSurface& src,
- GLint x, GLint y, GLsizei w, GLsizei h)
-{
- if ((dst.format == src.format) &&
- (dst.stride == src.stride) &&
- (dst.width == src.width) &&
- (dst.height == src.height) &&
- (dst.stride > 0) &&
- ((x|y) == 0) &&
- ((xoffset|yoffset) == 0))
- {
- // this is a common case...
- const GGLFormat& pixelFormat(c->rasterizer.formats[src.format]);
- const size_t size = src.height * src.stride * pixelFormat.size;
- memcpy(dst.data, src.data, size);
- return 0;
- }
-
- // use pixel-flinger to handle all the conversions
- GGLContext* ggl = getRasterizer(c);
- if (!ggl) {
- // the only reason this would fail is because we ran out of memory
- return GL_OUT_OF_MEMORY;
- }
-
- ggl->colorBuffer(ggl, &dst);
- ggl->bindTexture(ggl, &src);
- ggl->texCoord2i(ggl, x-xoffset, y-yoffset);
- ggl->recti(ggl, xoffset, yoffset, xoffset+w, yoffset+h);
- return 0;
-}
-
-// ----------------------------------------------------------------------------
-
-static __attribute__((noinline))
-sp<EGLTextureObject> getAndBindActiveTextureObject(ogles_context_t* c)
-{
- sp<EGLTextureObject> tex;
- const int active = c->textures.active;
- const GLuint name = c->textures.tmu[active].name;
-
- // free the reference to the previously bound object
- texture_unit_t& u(c->textures.tmu[active]);
- if (u.texture)
- u.texture->decStrong(c);
-
- if (name == 0) {
- // 0 is our local texture object, not shared with anyone.
- // But it affects all bound TMUs immediately.
- // (we need to invalidate all units bound to this texture object)
- tex = c->textures.defaultTexture;
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- if (c->textures.tmu[i].texture == tex.get())
- invalidate_texture(c, i);
- }
- } else {
- // get a new texture object for that name
- tex = c->surfaceManager->replaceTexture(name);
- }
-
- // bind this texture to the current active texture unit
- // and add a reference to this texture object
- u.texture = tex.get();
- u.texture->incStrong(c);
- u.name = name;
- invalidate_texture(c, active);
- return tex;
-}
-
-void bindTextureTmu(
- ogles_context_t* c, int tmu, GLuint texture, const sp<EGLTextureObject>& tex)
-{
- if (tex.get() == c->textures.tmu[tmu].texture)
- return;
-
- // free the reference to the previously bound object
- texture_unit_t& u(c->textures.tmu[tmu]);
- if (u.texture)
- u.texture->decStrong(c);
-
- // bind this texture to the current active texture unit
- // and add a reference to this texture object
- u.texture = tex.get();
- u.texture->incStrong(c);
- u.name = texture;
- invalidate_texture(c, tmu);
-}
-
-int createTextureSurface(ogles_context_t* c,
- GGLSurface** outSurface, int32_t* outSize, GLint level,
- GLenum format, GLenum type, GLsizei width, GLsizei height,
- GLenum compressedFormat = 0)
-{
- // find out which texture is bound to the current unit
- const int active = c->textures.active;
- const GLuint name = c->textures.tmu[active].name;
-
- // convert the pixelformat to one we can handle
- const int32_t formatIdx = convertGLPixelFormat(format, type);
- if (formatIdx == 0) { // we don't know what to do with this
- return GL_INVALID_OPERATION;
- }
-
- // figure out the size we need as well as the stride
- const GGLFormat& pixelFormat(c->rasterizer.formats[formatIdx]);
- const int32_t align = c->textures.unpackAlignment-1;
- const int32_t bpr = ((width * pixelFormat.size) + align) & ~align;
- const size_t size = bpr * height;
- const int32_t stride = bpr / pixelFormat.size;
-
- if (level > 0) {
- const int active = c->textures.active;
- EGLTextureObject* tex = c->textures.tmu[active].texture;
- status_t err = tex->reallocate(level,
- width, height, stride, formatIdx, compressedFormat, bpr);
- if (err != NO_ERROR)
- return GL_OUT_OF_MEMORY;
- GGLSurface& surface = tex->editMip(level);
- *outSurface = &surface;
- *outSize = size;
- return 0;
- }
-
- sp<EGLTextureObject> tex = getAndBindActiveTextureObject(c);
- status_t err = tex->reallocate(level,
- width, height, stride, formatIdx, compressedFormat, bpr);
- if (err != NO_ERROR)
- return GL_OUT_OF_MEMORY;
-
- tex->internalformat = format;
- *outSurface = &tex->surface;
- *outSize = size;
- return 0;
-}
-
-static size_t dataSizePalette4(int numLevels, int width, int height, int format)
-{
- int indexBits = 8;
- int entrySize = 0;
- switch (format) {
- case GL_PALETTE4_RGB8_OES:
- indexBits = 4;
- /* FALLTHROUGH */
- case GL_PALETTE8_RGB8_OES:
- entrySize = 3;
- break;
-
- case GL_PALETTE4_RGBA8_OES:
- indexBits = 4;
- /* FALLTHROUGH */
- case GL_PALETTE8_RGBA8_OES:
- entrySize = 4;
- break;
-
- case GL_PALETTE4_R5_G6_B5_OES:
- case GL_PALETTE4_RGBA4_OES:
- case GL_PALETTE4_RGB5_A1_OES:
- indexBits = 4;
- /* FALLTHROUGH */
- case GL_PALETTE8_R5_G6_B5_OES:
- case GL_PALETTE8_RGBA4_OES:
- case GL_PALETTE8_RGB5_A1_OES:
- entrySize = 2;
- break;
- }
-
- size_t size = (1 << indexBits) * entrySize; // palette size
-
- for (int i=0 ; i< numLevels ; i++) {
- int w = (width >> i) ? : 1;
- int h = (height >> i) ? : 1;
- int levelSize = h * ((w * indexBits) / 8) ? : 1;
- size += levelSize;
- }
-
- return size;
-}
-
-static void decodePalette4(const GLvoid *data, int level, int width, int height,
- void *surface, int stride, int format)
-
-{
- int indexBits = 8;
- int entrySize = 0;
- switch (format) {
- case GL_PALETTE4_RGB8_OES:
- indexBits = 4;
- /* FALLTHROUGH */
- case GL_PALETTE8_RGB8_OES:
- entrySize = 3;
- break;
-
- case GL_PALETTE4_RGBA8_OES:
- indexBits = 4;
- /* FALLTHROUGH */
- case GL_PALETTE8_RGBA8_OES:
- entrySize = 4;
- break;
-
- case GL_PALETTE4_R5_G6_B5_OES:
- case GL_PALETTE4_RGBA4_OES:
- case GL_PALETTE4_RGB5_A1_OES:
- indexBits = 4;
- /* FALLTHROUGH */
- case GL_PALETTE8_R5_G6_B5_OES:
- case GL_PALETTE8_RGBA4_OES:
- case GL_PALETTE8_RGB5_A1_OES:
- entrySize = 2;
- break;
- }
-
- const int paletteSize = (1 << indexBits) * entrySize;
-
- uint8_t const* pixels = (uint8_t *)data + paletteSize;
- for (int i=0 ; i<level ; i++) {
- int w = (width >> i) ? : 1;
- int h = (height >> i) ? : 1;
- pixels += h * ((w * indexBits) / 8);
- }
- width = (width >> level) ? : 1;
- height = (height >> level) ? : 1;
-
- if (entrySize == 2) {
- uint8_t const* const palette = (uint8_t*)data;
- for (int y=0 ; y<height ; y++) {
- uint8_t* p = (uint8_t*)surface + y*stride*2;
- if (indexBits == 8) {
- for (int x=0 ; x<width ; x++) {
- int index = 2 * (*pixels++);
- *p++ = palette[index + 0];
- *p++ = palette[index + 1];
- }
- } else {
- for (int x=0 ; x<width ; x+=2) {
- int v = *pixels++;
- int index = 2 * (v >> 4);
- *p++ = palette[index + 0];
- *p++ = palette[index + 1];
- if (x+1 < width) {
- index = 2 * (v & 0xF);
- *p++ = palette[index + 0];
- *p++ = palette[index + 1];
- }
- }
- }
- }
- } else if (entrySize == 3) {
- uint8_t const* const palette = (uint8_t*)data;
- for (int y=0 ; y<height ; y++) {
- uint8_t* p = (uint8_t*)surface + y*stride*3;
- if (indexBits == 8) {
- for (int x=0 ; x<width ; x++) {
- int index = 3 * (*pixels++);
- *p++ = palette[index + 0];
- *p++ = palette[index + 1];
- *p++ = palette[index + 2];
- }
- } else {
- for (int x=0 ; x<width ; x+=2) {
- int v = *pixels++;
- int index = 3 * (v >> 4);
- *p++ = palette[index + 0];
- *p++ = palette[index + 1];
- *p++ = palette[index + 2];
- if (x+1 < width) {
- index = 3 * (v & 0xF);
- *p++ = palette[index + 0];
- *p++ = palette[index + 1];
- *p++ = palette[index + 2];
- }
- }
- }
- }
- } else if (entrySize == 4) {
- uint8_t const* const palette = (uint8_t*)data;
- for (int y=0 ; y<height ; y++) {
- uint8_t* p = (uint8_t*)surface + y*stride*4;
- if (indexBits == 8) {
- for (int x=0 ; x<width ; x++) {
- int index = 4 * (*pixels++);
- *p++ = palette[index + 0];
- *p++ = palette[index + 1];
- *p++ = palette[index + 2];
- *p++ = palette[index + 3];
- }
- } else {
- for (int x=0 ; x<width ; x+=2) {
- int v = *pixels++;
- int index = 4 * (v >> 4);
- *p++ = palette[index + 0];
- *p++ = palette[index + 1];
- *p++ = palette[index + 2];
- *p++ = palette[index + 3];
- if (x+1 < width) {
- index = 4 * (v & 0xF);
- *p++ = palette[index + 0];
- *p++ = palette[index + 1];
- *p++ = palette[index + 2];
- *p++ = palette[index + 3];
- }
- }
- }
- }
- }
-}
-
-
-
-static __attribute__((noinline))
-void set_depth_and_fog(ogles_context_t* c, GGLfixed z)
-{
- const uint32_t enables = c->rasterizer.state.enables;
- // we need to compute Zw
- int32_t iterators[3];
- iterators[1] = iterators[2] = 0;
- GGLfixed Zw;
- GGLfixed n = gglFloatToFixed(c->transforms.vpt.zNear);
- GGLfixed f = gglFloatToFixed(c->transforms.vpt.zFar);
- if (z<=0) Zw = n;
- else if (z>=0x10000) Zw = f;
- else Zw = gglMulAddx(z, (f-n), n);
- if (enables & GGL_ENABLE_FOG) {
- // set up fog if needed...
- iterators[0] = c->fog.fog(c, Zw);
- c->rasterizer.procs.fogGrad3xv(c, iterators);
- }
- if (enables & GGL_ENABLE_DEPTH_TEST) {
- // set up z-test if needed...
- int32_t z = (Zw & ~(Zw>>31));
- if (z >= 0x10000)
- z = 0xFFFF;
- iterators[0] = (z << 16) | z;
- c->rasterizer.procs.zGrad3xv(c, iterators);
- }
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark Generate mimaps
-#endif
-
-extern status_t buildAPyramid(ogles_context_t* c, EGLTextureObject* tex);
-
-void generateMipmap(ogles_context_t* c, GLint level)
-{
- if (level == 0) {
- const int active = c->textures.active;
- EGLTextureObject* tex = c->textures.tmu[active].texture;
- if (tex->generate_mipmap) {
- if (buildAPyramid(c, tex) != NO_ERROR) {
- ogles_error(c, GL_OUT_OF_MEMORY);
- return;
- }
- }
- }
-}
-
-
-static void texParameterx(
- GLenum target, GLenum pname, GLfixed param, ogles_context_t* c)
-{
- if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- EGLTextureObject* textureObject = c->textures.tmu[c->textures.active].texture;
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- if ((param == GL_REPEAT) ||
- (param == GL_CLAMP_TO_EDGE)) {
- textureObject->wraps = param;
- } else {
- goto invalid_enum;
- }
- break;
- case GL_TEXTURE_WRAP_T:
- if ((param == GL_REPEAT) ||
- (param == GL_CLAMP_TO_EDGE)) {
- textureObject->wrapt = param;
- } else {
- goto invalid_enum;
- }
- break;
- case GL_TEXTURE_MIN_FILTER:
- if ((param == GL_NEAREST) ||
- (param == GL_LINEAR) ||
- (param == GL_NEAREST_MIPMAP_NEAREST) ||
- (param == GL_LINEAR_MIPMAP_NEAREST) ||
- (param == GL_NEAREST_MIPMAP_LINEAR) ||
- (param == GL_LINEAR_MIPMAP_LINEAR)) {
- textureObject->min_filter = param;
- } else {
- goto invalid_enum;
- }
- break;
- case GL_TEXTURE_MAG_FILTER:
- if ((param == GL_NEAREST) ||
- (param == GL_LINEAR)) {
- textureObject->mag_filter = param;
- } else {
- goto invalid_enum;
- }
- break;
- case GL_GENERATE_MIPMAP:
- textureObject->generate_mipmap = param;
- break;
- default:
-invalid_enum:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- invalidate_texture(c, c->textures.active);
-}
-
-
-
-static void drawTexxOESImp(GLfixed x, GLfixed y, GLfixed z, GLfixed w, GLfixed h,
- ogles_context_t* c)
-{
- ogles_lock_textures(c);
-
- const GGLSurface& cbSurface = c->rasterizer.state.buffers.color.s;
- y = gglIntToFixed(cbSurface.height) - (y + h);
- w >>= FIXED_BITS;
- h >>= FIXED_BITS;
-
- // set up all texture units
- for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT ; i++) {
- if (!c->rasterizer.state.texture[i].enable)
- continue;
-
- int32_t texcoords[8];
- texture_unit_t& u(c->textures.tmu[i]);
-
- // validate this tmu (bind, wrap, filter)
- validate_tmu(c, i);
- // we CLAMP here, which works with premultiplied (s,t)
- c->rasterizer.procs.texParameteri(c,
- GGL_TEXTURE_2D, GGL_TEXTURE_WRAP_S, GGL_CLAMP);
- c->rasterizer.procs.texParameteri(c,
- GGL_TEXTURE_2D, GGL_TEXTURE_WRAP_T, GGL_CLAMP);
- u.dirty = 0xFF; // XXX: should be more subtle
-
- EGLTextureObject* textureObject = u.texture;
- const GLint Ucr = textureObject->crop_rect[0] << 16;
- const GLint Vcr = textureObject->crop_rect[1] << 16;
- const GLint Wcr = textureObject->crop_rect[2] << 16;
- const GLint Hcr = textureObject->crop_rect[3] << 16;
-
- // computes texture coordinates (pre-multiplied)
- int32_t dsdx = Wcr / w; // dsdx = ((Wcr/w)/Wt)*Wt
- int32_t dtdy =-Hcr / h; // dtdy = -((Hcr/h)/Ht)*Ht
- int32_t s0 = Ucr - gglMulx(dsdx, x); // s0 = Ucr - x * dsdx
- int32_t t0 = (Vcr+Hcr) - gglMulx(dtdy, y); // t0 = (Vcr+Hcr) - y*dtdy
- texcoords[0] = s0;
- texcoords[1] = dsdx;
- texcoords[2] = 0;
- texcoords[3] = t0;
- texcoords[4] = 0;
- texcoords[5] = dtdy;
- texcoords[6] = 0;
- texcoords[7] = 0;
- c->rasterizer.procs.texCoordGradScale8xv(c, i, texcoords);
- }
-
- const uint32_t enables = c->rasterizer.state.enables;
- if (ggl_unlikely(enables & (GGL_ENABLE_DEPTH_TEST|GGL_ENABLE_FOG)))
- set_depth_and_fog(c, z);
-
- c->rasterizer.procs.activeTexture(c, c->textures.active);
- c->rasterizer.procs.color4xv(c, c->currentColorClamped.v);
- c->rasterizer.procs.disable(c, GGL_W_LERP);
- c->rasterizer.procs.disable(c, GGL_AA);
- c->rasterizer.procs.shadeModel(c, GL_FLAT);
- c->rasterizer.procs.recti(c,
- gglFixedToIntRound(x),
- gglFixedToIntRound(y),
- gglFixedToIntRound(x)+w,
- gglFixedToIntRound(y)+h);
-
- ogles_unlock_textures(c);
-}
-
-static void drawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed w, GLfixed h,
- ogles_context_t* c)
-{
- // quickly reject empty rects
- if ((w|h) <= 0)
- return;
-
- drawTexxOESImp(x, y, z, w, h, c);
-}
-
-static void drawTexiOES(GLint x, GLint y, GLint z, GLint w, GLint h, ogles_context_t* c)
-{
- // All coordinates are integer, so if we have only one
- // texture unit active and no scaling is required
- // THEN, we can use our special 1:1 mapping
- // which is a lot faster.
-
- if (ggl_likely(c->rasterizer.state.enabled_tmu == 1)) {
- const int tmu = 0;
- texture_unit_t& u(c->textures.tmu[tmu]);
- EGLTextureObject* textureObject = u.texture;
- const GLint Wcr = textureObject->crop_rect[2];
- const GLint Hcr = textureObject->crop_rect[3];
-
- if ((w == Wcr) && (h == -Hcr)) {
- if ((w|h) <= 0) return; // quickly reject empty rects
-
- if (u.dirty) {
- c->rasterizer.procs.activeTexture(c, tmu);
- c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
- c->rasterizer.procs.texParameteri(c, GGL_TEXTURE_2D,
- GGL_TEXTURE_MIN_FILTER, u.texture->min_filter);
- c->rasterizer.procs.texParameteri(c, GGL_TEXTURE_2D,
- GGL_TEXTURE_MAG_FILTER, u.texture->mag_filter);
- }
- c->rasterizer.procs.texGeni(c, GGL_S,
- GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
- c->rasterizer.procs.texGeni(c, GGL_T,
- GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
- u.dirty = 0xFF; // XXX: should be more subtle
- c->rasterizer.procs.activeTexture(c, c->textures.active);
-
- const GGLSurface& cbSurface = c->rasterizer.state.buffers.color.s;
- y = cbSurface.height - (y + h);
- const GLint Ucr = textureObject->crop_rect[0];
- const GLint Vcr = textureObject->crop_rect[1];
- const GLint s0 = Ucr - x;
- const GLint t0 = (Vcr + Hcr) - y;
-
- const GLuint tw = textureObject->surface.width;
- const GLuint th = textureObject->surface.height;
- if ((uint32_t(s0+x+w) > tw) || (uint32_t(t0+y+h) > th)) {
- // The GL spec is unclear about what should happen
- // in this case, so we just use the slow case, which
- // at least won't crash
- goto slow_case;
- }
-
- ogles_lock_textures(c);
-
- c->rasterizer.procs.texCoord2i(c, s0, t0);
- const uint32_t enables = c->rasterizer.state.enables;
- if (ggl_unlikely(enables & (GGL_ENABLE_DEPTH_TEST|GGL_ENABLE_FOG)))
- set_depth_and_fog(c, gglIntToFixed(z));
-
- c->rasterizer.procs.color4xv(c, c->currentColorClamped.v);
- c->rasterizer.procs.disable(c, GGL_W_LERP);
- c->rasterizer.procs.disable(c, GGL_AA);
- c->rasterizer.procs.shadeModel(c, GL_FLAT);
- c->rasterizer.procs.recti(c, x, y, x+w, y+h);
-
- ogles_unlock_textures(c);
-
- return;
- }
- }
-
-slow_case:
- drawTexxOESImp(
- gglIntToFixed(x), gglIntToFixed(y), gglIntToFixed(z),
- gglIntToFixed(w), gglIntToFixed(h),
- c);
-}
-
-
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-using namespace android;
-
-
-#if 0
-#pragma mark -
-#pragma mark Texture API
-#endif
-
-void glActiveTexture(GLenum texture)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (uint32_t(texture-GL_TEXTURE0) > uint32_t(GGL_TEXTURE_UNIT_COUNT)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- c->textures.active = texture - GL_TEXTURE0;
- c->rasterizer.procs.activeTexture(c, c->textures.active);
-}
-
-void glBindTexture(GLenum target, GLuint texture)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- // Bind or create a texture
- sp<EGLTextureObject> tex;
- if (texture == 0) {
- // 0 is our local texture object
- tex = c->textures.defaultTexture;
- } else {
- tex = c->surfaceManager->texture(texture);
- if (ggl_unlikely(tex == 0)) {
- tex = c->surfaceManager->createTexture(texture);
- if (tex == 0) {
- ogles_error(c, GL_OUT_OF_MEMORY);
- return;
- }
- }
- }
- bindTextureTmu(c, c->textures.active, texture, tex);
-}
-
-void glGenTextures(GLsizei n, GLuint *textures)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (n<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- // generate unique (shared) texture names
- c->surfaceManager->getToken(n, textures);
-}
-
-void glDeleteTextures(GLsizei n, const GLuint *textures)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (n<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- // If deleting a bound texture, bind this unit to 0
- for (int t=0 ; t<GGL_TEXTURE_UNIT_COUNT ; t++) {
- if (c->textures.tmu[t].name == 0)
- continue;
- for (int i=0 ; i<n ; i++) {
- if (textures[i] && (textures[i] == c->textures.tmu[t].name)) {
- // bind this tmu to texture 0
- sp<EGLTextureObject> tex(c->textures.defaultTexture);
- bindTextureTmu(c, t, 0, tex);
- }
- }
- }
- c->surfaceManager->deleteTextures(n, textures);
- c->surfaceManager->recycleTokens(n, textures);
-}
-
-void glMultiTexCoord4f(
- GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (uint32_t(target-GL_TEXTURE0) > uint32_t(GGL_TEXTURE_UNIT_COUNT)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- const int tmu = target-GL_TEXTURE0;
- c->current.texture[tmu].S = gglFloatToFixed(s);
- c->current.texture[tmu].T = gglFloatToFixed(t);
- c->current.texture[tmu].R = gglFloatToFixed(r);
- c->current.texture[tmu].Q = gglFloatToFixed(q);
-}
-
-void glMultiTexCoord4x(
- GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (uint32_t(target-GL_TEXTURE0) > uint32_t(GGL_TEXTURE_UNIT_COUNT)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- const int tmu = target-GL_TEXTURE0;
- c->current.texture[tmu].S = s;
- c->current.texture[tmu].T = t;
- c->current.texture[tmu].R = r;
- c->current.texture[tmu].Q = q;
-}
-
-void glPixelStorei(GLenum pname, GLint param)
-{
- ogles_context_t* c = ogles_context_t::get();
- if ((pname != GL_PACK_ALIGNMENT) && (pname != GL_UNPACK_ALIGNMENT)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if ((param<=0 || param>8) || (param & (param-1))) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- if (pname == GL_PACK_ALIGNMENT)
- c->textures.packAlignment = param;
- if (pname == GL_UNPACK_ALIGNMENT)
- c->textures.unpackAlignment = param;
-}
-
-void glTexEnvf(GLenum target, GLenum pname, GLfloat param)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.texEnvi(c, target, pname, GLint(param));
-}
-
-void glTexEnvfv(
- GLenum target, GLenum pname, const GLfloat *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (pname == GL_TEXTURE_ENV_MODE) {
- c->rasterizer.procs.texEnvi(c, target, pname, GLint(*params));
- return;
- }
- if (pname == GL_TEXTURE_ENV_COLOR) {
- GGLfixed fixed[4];
- for (int i=0 ; i<4 ; i++)
- fixed[i] = gglFloatToFixed(params[i]);
- c->rasterizer.procs.texEnvxv(c, target, pname, fixed);
- return;
- }
- ogles_error(c, GL_INVALID_ENUM);
-}
-
-void glTexEnvx(GLenum target, GLenum pname, GLfixed param)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.texEnvi(c, target, pname, param);
-}
-
-void glTexEnvxv(
- GLenum target, GLenum pname, const GLfixed *params)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->rasterizer.procs.texEnvxv(c, target, pname, params);
-}
-
-void glTexParameteriv(
- GLenum target, GLenum pname, const GLint* params)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- EGLTextureObject* textureObject = c->textures.tmu[c->textures.active].texture;
- switch (pname) {
- case GL_TEXTURE_CROP_RECT_OES:
- memcpy(textureObject->crop_rect, params, 4*sizeof(GLint));
- break;
- default:
- texParameterx(target, pname, GLfixed(params[0]), c);
- return;
- }
-}
-
-void glTexParameterf(
- GLenum target, GLenum pname, GLfloat param)
-{
- ogles_context_t* c = ogles_context_t::get();
- texParameterx(target, pname, GLfixed(param), c);
-}
-
-void glTexParameterx(
- GLenum target, GLenum pname, GLfixed param)
-{
- ogles_context_t* c = ogles_context_t::get();
- texParameterx(target, pname, param, c);
-}
-
-void glTexParameteri(
- GLenum target, GLenum pname, GLint param)
-{
- ogles_context_t* c = ogles_context_t::get();
- texParameterx(target, pname, GLfixed(param), c);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#endif
-
-void glCompressedTexImage2D(
- GLenum target, GLint level, GLenum internalformat,
- GLsizei width, GLsizei height, GLint border,
- GLsizei imageSize, const GLvoid *data)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (target != GL_TEXTURE_2D) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (width<0 || height<0 || border!=0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- // "uncompress" the texture since pixelflinger doesn't support
- // any compressed texture format natively.
- GLenum format;
- GLenum type;
- switch (internalformat) {
- case GL_PALETTE8_RGB8_OES:
- case GL_PALETTE4_RGB8_OES:
- format = GL_RGB;
- type = GL_UNSIGNED_BYTE;
- break;
- case GL_PALETTE8_RGBA8_OES:
- case GL_PALETTE4_RGBA8_OES:
- format = GL_RGBA;
- type = GL_UNSIGNED_BYTE;
- break;
- case GL_PALETTE8_R5_G6_B5_OES:
- case GL_PALETTE4_R5_G6_B5_OES:
- format = GL_RGB;
- type = GL_UNSIGNED_SHORT_5_6_5;
- break;
- case GL_PALETTE8_RGBA4_OES:
- case GL_PALETTE4_RGBA4_OES:
- format = GL_RGBA;
- type = GL_UNSIGNED_SHORT_4_4_4_4;
- break;
- case GL_PALETTE8_RGB5_A1_OES:
- case GL_PALETTE4_RGB5_A1_OES:
- format = GL_RGBA;
- type = GL_UNSIGNED_SHORT_5_5_5_1;
- break;
-#ifdef GL_OES_compressed_ETC1_RGB8_texture
- case GL_ETC1_RGB8_OES:
- format = GL_RGB;
- type = GL_UNSIGNED_BYTE;
- break;
-#endif
- default:
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- if (!data || !width || !height) {
- // unclear if this is an error or not...
- return;
- }
-
- int32_t size;
- GGLSurface* surface;
-
-#ifdef GL_OES_compressed_ETC1_RGB8_texture
- if (internalformat == GL_ETC1_RGB8_OES) {
- GLsizei compressedSize = etc1_get_encoded_data_size(width, height);
- if (compressedSize > imageSize) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- int error = createTextureSurface(c, &surface, &size,
- level, format, type, width, height);
- if (error) {
- ogles_error(c, error);
- return;
- }
- if (etc1_decode_image(
- (const etc1_byte*)data,
- (etc1_byte*)surface->data,
- width, height, 3, surface->stride*3) != 0) {
- ogles_error(c, GL_INVALID_OPERATION);
- }
- return;
- }
-#endif
-
- // all mipmap levels are specified at once.
- const int numLevels = level<0 ? -level : 1;
-
- if (dataSizePalette4(numLevels, width, height, format) > imageSize) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- for (int i=0 ; i<numLevels ; i++) {
- int lod_w = (width >> i) ? : 1;
- int lod_h = (height >> i) ? : 1;
- int error = createTextureSurface(c, &surface, &size,
- i, format, type, lod_w, lod_h);
- if (error) {
- ogles_error(c, error);
- return;
- }
- decodePalette4(data, i, width, height,
- surface->data, surface->stride, internalformat);
- }
-}
-
-
-void glTexImage2D(
- GLenum target, GLint level, GLint internalformat,
- GLsizei width, GLsizei height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (target != GL_TEXTURE_2D) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (width<0 || height<0 || border!=0 || level < 0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- if (format != (GLenum)internalformat) {
- ogles_error(c, GL_INVALID_OPERATION);
- return;
- }
- if (validFormatType(c, format, type)) {
- return;
- }
-
- int32_t size = 0;
- GGLSurface* surface = 0;
- int error = createTextureSurface(c, &surface, &size,
- level, format, type, width, height);
- if (error) {
- ogles_error(c, error);
- return;
- }
-
- if (pixels) {
- const int32_t formatIdx = convertGLPixelFormat(format, type);
- const GGLFormat& pixelFormat(c->rasterizer.formats[formatIdx]);
- const int32_t align = c->textures.unpackAlignment-1;
- const int32_t bpr = ((width * pixelFormat.size) + align) & ~align;
- const size_t size = bpr * height;
- const int32_t stride = bpr / pixelFormat.size;
-
- GGLSurface userSurface;
- userSurface.version = sizeof(userSurface);
- userSurface.width = width;
- userSurface.height = height;
- userSurface.stride = stride;
- userSurface.format = formatIdx;
- userSurface.compressedFormat = 0;
- userSurface.data = (GLubyte*)pixels;
-
- int err = copyPixels(c, *surface, 0, 0, userSurface, 0, 0, width, height);
- if (err) {
- ogles_error(c, err);
- return;
- }
- generateMipmap(c, level);
- }
-}
-
-// ----------------------------------------------------------------------------
-
-void glCompressedTexSubImage2D(
- GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height,
- GLenum format, GLsizei imageSize,
- const GLvoid *data)
-{
- ogles_context_t* c = ogles_context_t::get();
- ogles_error(c, GL_INVALID_ENUM);
-}
-
-void glTexSubImage2D(
- GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid *pixels)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (target != GL_TEXTURE_2D) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (xoffset<0 || yoffset<0 || width<0 || height<0 || level<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- if (validFormatType(c, format, type)) {
- return;
- }
-
- // find out which texture is bound to the current unit
- const int active = c->textures.active;
- EGLTextureObject* tex = c->textures.tmu[active].texture;
- const GGLSurface& surface(tex->mip(level));
-
- if (!tex->internalformat || tex->direct) {
- ogles_error(c, GL_INVALID_OPERATION);
- return;
- }
-
- if (format != tex->internalformat) {
- ogles_error(c, GL_INVALID_OPERATION);
- return;
- }
- if ((xoffset + width > GLsizei(surface.width)) ||
- (yoffset + height > GLsizei(surface.height))) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- if (!width || !height) {
- return; // okay, but no-op.
- }
-
- // figure out the size we need as well as the stride
- const int32_t formatIdx = convertGLPixelFormat(format, type);
- if (formatIdx == 0) { // we don't know what to do with this
- ogles_error(c, GL_INVALID_OPERATION);
- return;
- }
-
- const GGLFormat& pixelFormat(c->rasterizer.formats[formatIdx]);
- const int32_t align = c->textures.unpackAlignment-1;
- const int32_t bpr = ((width * pixelFormat.size) + align) & ~align;
- const size_t size = bpr * height;
- const int32_t stride = bpr / pixelFormat.size;
- GGLSurface userSurface;
- userSurface.version = sizeof(userSurface);
- userSurface.width = width;
- userSurface.height = height;
- userSurface.stride = stride;
- userSurface.format = formatIdx;
- userSurface.compressedFormat = 0;
- userSurface.data = (GLubyte*)pixels;
-
- int err = copyPixels(c,
- surface, xoffset, yoffset,
- userSurface, 0, 0, width, height);
- if (err) {
- ogles_error(c, err);
- return;
- }
-
- generateMipmap(c, level);
-
- // since we only changed the content of the texture, we don't need
- // to call bindTexture on the main rasterizer.
-}
-
-// ----------------------------------------------------------------------------
-
-void glCopyTexImage2D(
- GLenum target, GLint level, GLenum internalformat,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint border)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (target != GL_TEXTURE_2D) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (internalformat<GL_ALPHA || internalformat>GL_LUMINANCE_ALPHA) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (width<0 || height<0 || border!=0 || level<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- GLenum format = 0;
- GLenum type = GL_UNSIGNED_BYTE;
- const GGLSurface& cbSurface = c->rasterizer.state.buffers.color.s;
- const int cbFormatIdx = cbSurface.format;
- switch (cbFormatIdx) {
- case GGL_PIXEL_FORMAT_RGB_565:
- type = GL_UNSIGNED_SHORT_5_6_5;
- break;
- case GGL_PIXEL_FORMAT_RGBA_5551:
- type = GL_UNSIGNED_SHORT_5_5_5_1;
- break;
- case GGL_PIXEL_FORMAT_RGBA_4444:
- type = GL_UNSIGNED_SHORT_4_4_4_4;
- break;
- }
- switch (internalformat) {
- case GL_ALPHA:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE:
- type = GL_UNSIGNED_BYTE;
- break;
- }
-
- // figure out the format to use for the new texture
- switch (cbFormatIdx) {
- case GGL_PIXEL_FORMAT_RGBA_8888:
- case GGL_PIXEL_FORMAT_A_8:
- case GGL_PIXEL_FORMAT_RGBA_5551:
- case GGL_PIXEL_FORMAT_RGBA_4444:
- format = internalformat;
- break;
- case GGL_PIXEL_FORMAT_RGBX_8888:
- case GGL_PIXEL_FORMAT_RGB_888:
- case GGL_PIXEL_FORMAT_RGB_565:
- case GGL_PIXEL_FORMAT_L_8:
- switch (internalformat) {
- case GL_LUMINANCE:
- case GL_RGB:
- format = internalformat;
- break;
- }
- break;
- }
-
- if (format == 0) {
- // invalid combination
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- // create the new texture...
- int32_t size;
- GGLSurface* surface;
- int error = createTextureSurface(c, &surface, &size,
- level, format, type, width, height);
- if (error) {
- ogles_error(c, error);
- return;
- }
-
- // The bottom row is stored first in textures
- GGLSurface txSurface(*surface);
- txSurface.stride = -txSurface.stride;
-
- // (x,y) is the lower-left corner of colorBuffer
- y = cbSurface.height - (y + height);
-
- /* The GLES spec says:
- * If any of the pixels within the specified rectangle are outside
- * the framebuffer associated with the current rendering context,
- * then the values obtained for those pixels are undefined.
- */
- if (x+width > GLint(cbSurface.width))
- width = cbSurface.width - x;
-
- if (y+height > GLint(cbSurface.height))
- height = cbSurface.height - y;
-
- int err = copyPixels(c,
- txSurface, 0, 0,
- cbSurface, x, y, width, height);
- if (err) {
- ogles_error(c, err);
- }
-
- generateMipmap(c, level);
-}
-
-void glCopyTexSubImage2D(
- GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (target != GL_TEXTURE_2D) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (xoffset<0 || yoffset<0 || width<0 || height<0 || level<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- if (!width || !height) {
- return; // okay, but no-op.
- }
-
- // find out which texture is bound to the current unit
- const int active = c->textures.active;
- EGLTextureObject* tex = c->textures.tmu[active].texture;
- const GGLSurface& surface(tex->mip(level));
-
- if (!tex->internalformat) {
- ogles_error(c, GL_INVALID_OPERATION);
- return;
- }
- if ((xoffset + width > GLsizei(surface.width)) ||
- (yoffset + height > GLsizei(surface.height))) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- // The bottom row is stored first in textures
- GGLSurface txSurface(surface);
- txSurface.stride = -txSurface.stride;
-
- // (x,y) is the lower-left corner of colorBuffer
- const GGLSurface& cbSurface = c->rasterizer.state.buffers.color.s;
- y = cbSurface.height - (y + height);
-
- /* The GLES spec says:
- * If any of the pixels within the specified rectangle are outside
- * the framebuffer associated with the current rendering context,
- * then the values obtained for those pixels are undefined.
- */
- if (x+width > GLint(cbSurface.width))
- width = cbSurface.width - x;
-
- if (y+height > GLint(cbSurface.height))
- height = cbSurface.height - y;
-
- int err = copyPixels(c,
- txSurface, xoffset, yoffset,
- cbSurface, x, y, width, height);
- if (err) {
- ogles_error(c, err);
- return;
- }
-
- generateMipmap(c, level);
-}
-
-void glReadPixels(
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid *pixels)
-{
- ogles_context_t* c = ogles_context_t::get();
- if ((format != GL_RGBA) && (format != GL_RGB)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if ((type != GL_UNSIGNED_BYTE) && (type != GL_UNSIGNED_SHORT_5_6_5)) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
- if (width<0 || height<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- if (x<0 || y<0) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- int32_t formatIdx = GGL_PIXEL_FORMAT_NONE;
- if ((format == GL_RGBA) && (type == GL_UNSIGNED_BYTE)) {
- formatIdx = GGL_PIXEL_FORMAT_RGBA_8888;
- } else if ((format == GL_RGB) && (type == GL_UNSIGNED_SHORT_5_6_5)) {
- formatIdx = GGL_PIXEL_FORMAT_RGB_565;
- } else {
- ogles_error(c, GL_INVALID_OPERATION);
- return;
- }
-
- const GGLSurface& readSurface = c->rasterizer.state.buffers.read.s;
- if ((x+width > GLint(readSurface.width)) ||
- (y+height > GLint(readSurface.height))) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- const GGLFormat& pixelFormat(c->rasterizer.formats[formatIdx]);
- const int32_t align = c->textures.packAlignment-1;
- const int32_t bpr = ((width * pixelFormat.size) + align) & ~align;
- const int32_t stride = bpr / pixelFormat.size;
-
- GGLSurface userSurface;
- userSurface.version = sizeof(userSurface);
- userSurface.width = width;
- userSurface.height = height;
- userSurface.stride = -stride; // bottom row is transfered first
- userSurface.format = formatIdx;
- userSurface.compressedFormat = 0;
- userSurface.data = (GLubyte*)pixels;
-
- // use pixel-flinger to handle all the conversions
- GGLContext* ggl = getRasterizer(c);
- if (!ggl) {
- // the only reason this would fail is because we ran out of memory
- ogles_error(c, GL_OUT_OF_MEMORY);
- return;
- }
-
- ggl->colorBuffer(ggl, &userSurface); // destination is user buffer
- ggl->bindTexture(ggl, &readSurface); // source is read-buffer
- ggl->texCoord2i(ggl, x, readSurface.height - (y + height));
- ggl->recti(ggl, 0, 0, width, height);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark DrawTexture Extension
-#endif
-
-void glDrawTexsvOES(const GLshort* coords) {
- ogles_context_t* c = ogles_context_t::get();
- drawTexiOES(coords[0], coords[1], coords[2], coords[3], coords[4], c);
-}
-void glDrawTexivOES(const GLint* coords) {
- ogles_context_t* c = ogles_context_t::get();
- drawTexiOES(coords[0], coords[1], coords[2], coords[3], coords[4], c);
-}
-void glDrawTexsOES(GLshort x , GLshort y, GLshort z, GLshort w, GLshort h) {
- ogles_context_t* c = ogles_context_t::get();
- drawTexiOES(x, y, z, w, h, c);
-}
-void glDrawTexiOES(GLint x, GLint y, GLint z, GLint w, GLint h) {
- ogles_context_t* c = ogles_context_t::get();
- drawTexiOES(x, y, z, w, h, c);
-}
-
-void glDrawTexfvOES(const GLfloat* coords) {
- ogles_context_t* c = ogles_context_t::get();
- drawTexxOES(
- gglFloatToFixed(coords[0]),
- gglFloatToFixed(coords[1]),
- gglFloatToFixed(coords[2]),
- gglFloatToFixed(coords[3]),
- gglFloatToFixed(coords[4]),
- c);
-}
-void glDrawTexxvOES(const GLfixed* coords) {
- ogles_context_t* c = ogles_context_t::get();
- drawTexxOES(coords[0], coords[1], coords[2], coords[3], coords[4], c);
-}
-void glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat w, GLfloat h){
- ogles_context_t* c = ogles_context_t::get();
- drawTexxOES(
- gglFloatToFixed(x), gglFloatToFixed(y), gglFloatToFixed(z),
- gglFloatToFixed(w), gglFloatToFixed(h),
- c);
-}
-void glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed w, GLfixed h) {
- ogles_context_t* c = ogles_context_t::get();
- drawTexxOES(x, y, z, w, h, c);
-}
-
-// ----------------------------------------------------------------------------
-#if 0
-#pragma mark -
-#pragma mark EGL Image Extension
-#endif
-
-void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- if (image == EGL_NO_IMAGE_KHR) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)image;
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- // bind it to the texture unit
- sp<EGLTextureObject> tex = getAndBindActiveTextureObject(c);
- tex->setImage(native_buffer);
-}
-
-void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
-{
- ogles_context_t* c = ogles_context_t::get();
- if (target != GL_RENDERBUFFER_OES) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- if (image == EGL_NO_IMAGE_KHR) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)image;
- if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
- if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) {
- ogles_error(c, GL_INVALID_VALUE);
- return;
- }
-
- // well, we're not supporting this extension anyways
-}
diff --git a/opengl/libagl/texture.h b/opengl/libagl/texture.h
deleted file mode 100644
index 98f7550..0000000
--- a/opengl/libagl/texture.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* libs/opengles/texture.h
-**
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_TEXTURE_H
-#define ANDROID_OPENGLES_TEXTURE_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-#include <private/pixelflinger/ggl_context.h>
-
-#include <GLES/gl.h>
-
-#include "context.h"
-
-namespace android {
-
-void ogles_init_texture(ogles_context_t* c);
-void ogles_uninit_texture(ogles_context_t* c);
-void ogles_validate_texture(ogles_context_t* c);
-void ogles_lock_textures(ogles_context_t* c);
-void ogles_unlock_textures(ogles_context_t* c);
-
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_TEXTURE_H
diff --git a/opengl/libagl/vertex.cpp b/opengl/libagl/vertex.cpp
deleted file mode 100644
index dad04d6..0000000
--- a/opengl/libagl/vertex.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/* libs/opengles/vertex.cpp
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "context.h"
-#include "fp.h"
-#include "vertex.h"
-#include "state.h"
-#include "matrix.h"
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-void ogles_init_vertex(ogles_context_t* c)
-{
- c->cull.enable = GL_FALSE;
- c->cull.cullFace = GL_BACK;
- c->cull.frontFace = GL_CCW;
-
- c->current.color.r = 0x10000;
- c->current.color.g = 0x10000;
- c->current.color.b = 0x10000;
- c->current.color.a = 0x10000;
-
- c->currentNormal.z = 0x10000;
-}
-
-void ogles_uninit_vertex(ogles_context_t* c)
-{
-}
-
-// ----------------------------------------------------------------------------
-// vertex processing
-// ----------------------------------------------------------------------------
-
-// Divides a vertex clip coordinates by W
-static inline
-void perspective(ogles_context_t* c, vertex_t* v, uint32_t enables)
-{
- // [x,y,z]window = vpt * ([x,y,z]clip / clip.w)
- // [w]window = 1/w
-
- // With a regular projection generated by glFrustum(),
- // we have w=-z, therefore, w is in [zNear, zFar].
- // Also, zNear and zFar are stricly positive,
- // and 1/w (window.w) is in [1/zFar, 1/zNear], usually this
- // means ]0, +inf[ -- however, it is always recommended
- // to use as large values as possible for zNear.
- // All in all, w is usually smaller than 1.0 (assuming
- // zNear is at least 1.0); and even if zNear is smaller than 1.0
- // values of w won't be too big.
-
- const int32_t rw = gglRecip28(v->clip.w);
- const GLfixed* const m = c->transforms.vpt.transform.matrix.m;
- v->window.w = rw;
- v->window.x = gglMulAddx(gglMulx(v->clip.x, rw, 16), m[ 0], m[12], 28);
- v->window.y = gglMulAddx(gglMulx(v->clip.y, rw, 16), m[ 5], m[13], 28);
- v->window.x = TRI_FROM_FIXED(v->window.x);
- v->window.y = TRI_FROM_FIXED(v->window.y);
- if (enables & GGL_ENABLE_DEPTH_TEST) {
- v->window.z = gglMulAddx(gglMulx(v->clip.z, rw, 16), m[10], m[14], 28);
- }
-}
-
-// frustum clipping and W-divide
-static inline
-void clipFrustumPerspective(ogles_context_t* c, vertex_t* v, uint32_t enables)
-{
- // ndc = clip / W
- // window = ncd * viewport
-
- // clip to the view-volume
- uint32_t clip = v->flags & vertex_t::CLIP_ALL;
- const GLfixed w = v->clip.w;
- if (v->clip.x < -w) clip |= vertex_t::CLIP_L;
- if (v->clip.x > w) clip |= vertex_t::CLIP_R;
- if (v->clip.y < -w) clip |= vertex_t::CLIP_B;
- if (v->clip.y > w) clip |= vertex_t::CLIP_T;
- if (v->clip.z < -w) clip |= vertex_t::CLIP_N;
- if (v->clip.z > w) clip |= vertex_t::CLIP_F;
-
- v->flags |= clip;
- c->arrays.cull &= clip;
-
- if (ggl_likely(!clip)) {
- // if the vertex is clipped, we don't do the perspective
- // divide, since we don't need its window coordinates.
- perspective(c, v, enables);
- }
-}
-
-// frustum clipping, user clipping and W-divide
-static inline
-void clipAllPerspective(ogles_context_t* c, vertex_t* v, uint32_t enables)
-{
- // compute eye coordinates
- c->arrays.mv_transform(
- &c->transforms.modelview.transform, &v->eye, &v->obj);
- v->flags |= vertex_t::EYE;
-
- // clip this vertex against each user clip plane
- uint32_t clip = 0;
- int planes = c->clipPlanes.enable;
- while (planes) {
- const int i = 31 - gglClz(planes);
- planes &= ~(1<<i);
- // XXX: we should have a special dot() for 2,3,4 coords vertices
- GLfixed d = dot4(c->clipPlanes.plane[i].equation.v, v->eye.v);
- if (d < 0) {
- clip |= 0x100<<i;
- }
- }
- v->flags |= clip;
-
- clipFrustumPerspective(c, v, enables);
-}
-
-// ----------------------------------------------------------------------------
-
-void ogles_vertex_project(ogles_context_t* c, vertex_t* v) {
- perspective(c, v, c->rasterizer.state.enables);
-}
-
-void ogles_vertex_perspective2D(ogles_context_t* c, vertex_t* v)
-{
- // here we assume w=1.0 and the viewport transformation
- // has been applied already.
- c->arrays.cull = 0;
- v->window.x = TRI_FROM_FIXED(v->clip.x);
- v->window.y = TRI_FROM_FIXED(v->clip.y);
- v->window.z = v->clip.z;
- v->window.w = v->clip.w << 12;
-}
-
-void ogles_vertex_perspective3DZ(ogles_context_t* c, vertex_t* v) {
- clipFrustumPerspective(c, v, GGL_ENABLE_DEPTH_TEST);
-}
-void ogles_vertex_perspective3D(ogles_context_t* c, vertex_t* v) {
- clipFrustumPerspective(c, v, 0);
-}
-void ogles_vertex_clipAllPerspective3DZ(ogles_context_t* c, vertex_t* v) {
- clipAllPerspective(c, v, GGL_ENABLE_DEPTH_TEST);
-}
-void ogles_vertex_clipAllPerspective3D(ogles_context_t* c, vertex_t* v) {
- clipAllPerspective(c, v, 0);
-}
-
-static void clipPlanex(GLenum plane, const GLfixed* equ, ogles_context_t* c)
-{
- const int p = plane - GL_CLIP_PLANE0;
- if (ggl_unlikely(uint32_t(p) > (GL_CLIP_PLANE5 - GL_CLIP_PLANE0))) {
- ogles_error(c, GL_INVALID_ENUM);
- return;
- }
-
- vec4_t& equation = c->clipPlanes.plane[p].equation;
- memcpy(equation.v, equ, sizeof(vec4_t));
-
- ogles_validate_transform(c, transform_state_t::MVIT);
- transform_t& mvit = c->transforms.mvit4;
- mvit.point4(&mvit, &equation, &equation);
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-using namespace android;
-
-
-void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->current.color.r = gglFloatToFixed(r);
- c->currentColorClamped.r = gglClampx(c->current.color.r);
- c->current.color.g = gglFloatToFixed(g);
- c->currentColorClamped.g = gglClampx(c->current.color.g);
- c->current.color.b = gglFloatToFixed(b);
- c->currentColorClamped.b = gglClampx(c->current.color.b);
- c->current.color.a = gglFloatToFixed(a);
- c->currentColorClamped.a = gglClampx(c->current.color.a);
-}
-
-void glColor4x(GLfixed r, GLfixed g, GLfixed b, GLfixed a)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->current.color.r = r;
- c->current.color.g = g;
- c->current.color.b = b;
- c->current.color.a = a;
- c->currentColorClamped.r = gglClampx(r);
- c->currentColorClamped.g = gglClampx(g);
- c->currentColorClamped.b = gglClampx(b);
- c->currentColorClamped.a = gglClampx(a);
-}
-
-void glNormal3f(GLfloat x, GLfloat y, GLfloat z)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->currentNormal.x = gglFloatToFixed(x);
- c->currentNormal.y = gglFloatToFixed(y);
- c->currentNormal.z = gglFloatToFixed(z);
-}
-
-void glNormal3x(GLfixed x, GLfixed y, GLfixed z)
-{
- ogles_context_t* c = ogles_context_t::get();
- c->currentNormal.x = x;
- c->currentNormal.y = y;
- c->currentNormal.z = z;
-}
-
-// ----------------------------------------------------------------------------
-
-void glClipPlanef(GLenum plane, const GLfloat* equ)
-{
- const GLfixed equx[4] = {
- gglFloatToFixed(equ[0]),
- gglFloatToFixed(equ[1]),
- gglFloatToFixed(equ[2]),
- gglFloatToFixed(equ[3])
- };
- ogles_context_t* c = ogles_context_t::get();
- clipPlanex(plane, equx, c);
-}
-
-void glClipPlanex(GLenum plane, const GLfixed* equ)
-{
- ogles_context_t* c = ogles_context_t::get();
- clipPlanex(plane, equ, c);
-}
diff --git a/opengl/libagl/vertex.h b/opengl/libagl/vertex.h
deleted file mode 100644
index 55e6213..0000000
--- a/opengl/libagl/vertex.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* libs/opengles/vertex.h
-**
-** Copyright 2006, 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.
-*/
-
-#ifndef ANDROID_OPENGLES_VERTEX_H
-#define ANDROID_OPENGLES_VERTEX_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-
-namespace android {
-
-namespace gl {
-struct vertex_t;
-struct ogles_context_t;
-};
-
-void ogles_init_vertex(ogles_context_t* c);
-void ogles_uninit_vertex(ogles_context_t* c);
-
-void ogles_vertex_perspective2D(ogles_context_t*, vertex_t*);
-
-void ogles_vertex_perspective3D(ogles_context_t*, vertex_t*);
-void ogles_vertex_perspective3DZ(ogles_context_t*, vertex_t*);
-void ogles_vertex_clipAllPerspective3D(ogles_context_t*, vertex_t*);
-void ogles_vertex_clipAllPerspective3DZ(ogles_context_t*, vertex_t*);
-
-
-void ogles_vertex_project(ogles_context_t* c, vertex_t*);
-
-}; // namespace android
-
-#endif // ANDROID_OPENGLES_VERTEX_H
-
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk
deleted file mode 100644
index 66bc64d..0000000
--- a/opengl/libs/Android.mk
+++ /dev/null
@@ -1,167 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-###############################################################################
-# Build META EGL library
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- EGL/egl_tls.cpp \
- EGL/egl_cache.cpp \
- EGL/egl_display.cpp \
- EGL/egl_object.cpp \
- EGL/egl.cpp \
- EGL/eglApi.cpp \
- EGL/trace.cpp \
- EGL/getProcAddress.cpp.arm \
- EGL/Loader.cpp \
-#
-
-LOCAL_SHARED_LIBRARIES += libcutils libutils libGLES_trace
-LOCAL_LDLIBS := -lpthread -ldl
-LOCAL_MODULE:= libEGL
-LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
-LOCAL_SHARED_LIBRARIES += libdl
-# Bionic's private TLS header relies on the ARCH_ARM_HAVE_TLS_REGISTER to
-# select the appropriate TLS codepath
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-# we need to access the private Bionic header <bionic_tls.h>
-LOCAL_C_INCLUDES += bionic/libc/private
-
-LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_CFLAGS += -fvisibility=hidden
-LOCAL_CFLAGS += -DEGL_TRACE=1
-
-ifeq ($(TARGET_BOARD_PLATFORM),msm7k)
-LOCAL_CFLAGS += -DADRENO130=1
-endif
-
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-
-ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),)
- LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE)
-endif
-
-ifneq ($(MAX_EGL_CACHE_SIZE),)
- LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE)
-endif
-
-include $(BUILD_SHARED_LIBRARY)
-installed_libEGL := $(LOCAL_INSTALLED_MODULE)
-
-# OpenGL drivers config file
-ifneq ($(BOARD_EGL_CFG),)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := egl.cfg
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/egl
-LOCAL_SRC_FILES := ../../../../$(BOARD_EGL_CFG)
-include $(BUILD_PREBUILT)
-
-# make sure we depend on egl.cfg, so it gets installed
-$(installed_libEGL): | egl.cfg
-
-endif
-
-###############################################################################
-# Build the wrapper OpenGL ES 1.x library
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- GLES_CM/gl.cpp.arm \
-#
-
-LOCAL_SHARED_LIBRARIES += libcutils libEGL
-LOCAL_LDLIBS := -lpthread -ldl
-LOCAL_MODULE:= libGLESv1_CM
-
-LOCAL_SHARED_LIBRARIES += libdl
-# we need to access the private Bionic header <bionic_tls.h>
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-LOCAL_C_INCLUDES += bionic/libc/private
-
-LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv1\"
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_CFLAGS += -fvisibility=hidden
-
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-
-include $(BUILD_SHARED_LIBRARY)
-
-
-###############################################################################
-# Build the wrapper OpenGL ES 2.x library
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- GLES2/gl2.cpp.arm \
-#
-
-LOCAL_SHARED_LIBRARIES += libcutils libEGL
-LOCAL_LDLIBS := -lpthread -ldl
-LOCAL_MODULE:= libGLESv2
-
-LOCAL_SHARED_LIBRARIES += libdl
-# we need to access the private Bionic header <bionic_tls.h>
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-LOCAL_C_INCLUDES += bionic/libc/private
-
-LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv2\"
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_CFLAGS += -fvisibility=hidden
-
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-
-include $(BUILD_SHARED_LIBRARY)
-
-###############################################################################
-# Build the ETC1 host static library
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- ETC1/etc1.cpp \
-#
-
-LOCAL_LDLIBS := -lpthread -ldl
-LOCAL_MODULE:= libETC1
-
-include $(BUILD_HOST_STATIC_LIBRARY)
-
-###############################################################################
-# Build the ETC1 device library
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- ETC1/etc1.cpp \
-#
-
-LOCAL_LDLIBS := -lpthread -ldl
-LOCAL_MODULE:= libETC1
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
deleted file mode 100644
index 0b1016c..0000000
--- a/opengl/libs/EGL/Loader.cpp
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <dlfcn.h>
-#include <limits.h>
-
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-#include <EGL/egl.h>
-
-#include "egldefs.h"
-#include "glestrace.h"
-#include "hooks.h"
-#include "Loader.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-
-/*
- * EGL drivers are called
- *
- * /system/lib/egl/lib{[EGL|GLESv1_CM|GLESv2] | GLES}_$TAG.so
- *
- */
-
-ANDROID_SINGLETON_STATIC_INSTANCE( Loader )
-
-/* This function is called to check whether we run inside the emulator,
- * and if this is the case whether GLES GPU emulation is supported.
- *
- * Returned values are:
- * -1 -> not running inside the emulator
- * 0 -> running inside the emulator, but GPU emulation not supported
- * 1 -> running inside the emulator, GPU emulation is supported
- * through the "emulation" config.
- */
-static int
-checkGlesEmulationStatus(void)
-{
- /* We're going to check for the following kernel parameters:
- *
- * qemu=1 -> tells us that we run inside the emulator
- * android.qemu.gles=<number> -> tells us the GLES GPU emulation status
- *
- * Note that we will return <number> if we find it. This let us support
- * more additionnal emulation modes in the future.
- */
- char prop[PROPERTY_VALUE_MAX];
- int result = -1;
-
- /* First, check for qemu=1 */
- property_get("ro.kernel.qemu",prop,"0");
- if (atoi(prop) != 1)
- return -1;
-
- /* We are in the emulator, get GPU status value */
- property_get("ro.kernel.qemu.gles",prop,"0");
- return atoi(prop);
-}
-
-// ----------------------------------------------------------------------------
-
-Loader::driver_t::driver_t(void* gles)
-{
- dso[0] = gles;
- for (size_t i=1 ; i<NELEM(dso) ; i++)
- dso[i] = 0;
-}
-
-Loader::driver_t::~driver_t()
-{
- for (size_t i=0 ; i<NELEM(dso) ; i++) {
- if (dso[i]) {
- dlclose(dso[i]);
- dso[i] = 0;
- }
- }
-}
-
-status_t Loader::driver_t::set(void* hnd, int32_t api)
-{
- switch (api) {
- case EGL:
- dso[0] = hnd;
- break;
- case GLESv1_CM:
- dso[1] = hnd;
- break;
- case GLESv2:
- dso[2] = hnd;
- break;
- default:
- return BAD_INDEX;
- }
- return NO_ERROR;
-}
-
-// ----------------------------------------------------------------------------
-
-Loader::Loader()
-{
- char line[256];
- char tag[256];
-
- /* Special case for GLES emulation */
- if (checkGlesEmulationStatus() == 0) {
- ALOGD("Emulator without GPU support detected. "
- "Fallback to software renderer.");
- mDriverTag.setTo("android");
- return;
- }
-
- /* Otherwise, use egl.cfg */
- FILE* cfg = fopen("/system/lib/egl/egl.cfg", "r");
- if (cfg == NULL) {
- // default config
- ALOGD("egl.cfg not found, using default config");
- mDriverTag.setTo("android");
- } else {
- while (fgets(line, 256, cfg)) {
- int dpy, impl;
- if (sscanf(line, "%u %u %s", &dpy, &impl, tag) == 3) {
- //ALOGD(">>> %u %u %s", dpy, impl, tag);
- // We only load the h/w accelerated implementation
- if (tag != String8("android")) {
- mDriverTag = tag;
- }
- }
- }
- fclose(cfg);
- }
-}
-
-Loader::~Loader()
-{
- GLTrace_stop();
-}
-
-void* Loader::open(egl_connection_t* cnx)
-{
- void* dso;
- driver_t* hnd = 0;
-
- char const* tag = mDriverTag.string();
- if (tag) {
- dso = load_driver("GLES", tag, cnx, EGL | GLESv1_CM | GLESv2);
- if (dso) {
- hnd = new driver_t(dso);
- } else {
- // Always load EGL first
- dso = load_driver("EGL", tag, cnx, EGL);
- if (dso) {
- hnd = new driver_t(dso);
- // TODO: make this more automated
- hnd->set( load_driver("GLESv1_CM", tag, cnx, GLESv1_CM), GLESv1_CM );
- hnd->set( load_driver("GLESv2", tag, cnx, GLESv2), GLESv2 );
- }
- }
- }
-
- LOG_FATAL_IF(!index && !hnd,
- "couldn't find the default OpenGL ES implementation "
- "for default display");
-
- return (void*)hnd;
-}
-
-status_t Loader::close(void* driver)
-{
- driver_t* hnd = (driver_t*)driver;
- delete hnd;
- return NO_ERROR;
-}
-
-void Loader::init_api(void* dso,
- char const * const * api,
- __eglMustCastToProperFunctionPointerType* curr,
- getProcAddressType getProcAddress)
-{
- const ssize_t SIZE = 256;
- char scrap[SIZE];
- while (*api) {
- char const * name = *api;
- __eglMustCastToProperFunctionPointerType f =
- (__eglMustCastToProperFunctionPointerType)dlsym(dso, name);
- if (f == NULL) {
- // couldn't find the entry-point, use eglGetProcAddress()
- f = getProcAddress(name);
- }
- if (f == NULL) {
- // Try without the OES postfix
- ssize_t index = ssize_t(strlen(name)) - 3;
- if ((index>0 && (index<SIZE-1)) && (!strcmp(name+index, "OES"))) {
- strncpy(scrap, name, index);
- scrap[index] = 0;
- f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap);
- //ALOGD_IF(f, "found <%s> instead", scrap);
- }
- }
- if (f == NULL) {
- // Try with the OES postfix
- ssize_t index = ssize_t(strlen(name)) - 3;
- if (index>0 && strcmp(name+index, "OES")) {
- snprintf(scrap, SIZE, "%sOES", name);
- f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap);
- //ALOGD_IF(f, "found <%s> instead", scrap);
- }
- }
- if (f == NULL) {
- //ALOGD("%s", name);
- f = (__eglMustCastToProperFunctionPointerType)gl_unimplemented;
-
- /*
- * GL_EXT_debug_label is special, we always report it as
- * supported, it's handled by GLES_trace. If GLES_trace is not
- * enabled, then these are no-ops.
- */
- if (!strcmp(name, "glInsertEventMarkerEXT")) {
- f = (__eglMustCastToProperFunctionPointerType)gl_noop;
- } else if (!strcmp(name, "glPushGroupMarkerEXT")) {
- f = (__eglMustCastToProperFunctionPointerType)gl_noop;
- } else if (!strcmp(name, "glPopGroupMarkerEXT")) {
- f = (__eglMustCastToProperFunctionPointerType)gl_noop;
- }
- }
- *curr++ = f;
- api++;
- }
-}
-
-void *Loader::load_driver(const char* kind, const char *tag,
- egl_connection_t* cnx, uint32_t mask)
-{
- char driver_absolute_path[PATH_MAX];
- const char* const search1 = "/vendor/lib/egl/lib%s_%s.so";
- const char* const search2 = "/system/lib/egl/lib%s_%s.so";
-
- snprintf(driver_absolute_path, PATH_MAX, search1, kind, tag);
- if (access(driver_absolute_path, R_OK)) {
- snprintf(driver_absolute_path, PATH_MAX, search2, kind, tag);
- if (access(driver_absolute_path, R_OK)) {
- // this happens often, we don't want to log an error
- return 0;
- }
- }
-
- void* dso = dlopen(driver_absolute_path, RTLD_NOW | RTLD_LOCAL);
- if (dso == 0) {
- const char* err = dlerror();
- ALOGE("load_driver(%s): %s", driver_absolute_path, err?err:"unknown");
- return 0;
- }
-
- ALOGD("loaded %s", driver_absolute_path);
-
- if (mask & EGL) {
- getProcAddress = (getProcAddressType)dlsym(dso, "eglGetProcAddress");
-
- ALOGE_IF(!getProcAddress,
- "can't find eglGetProcAddress() in %s", driver_absolute_path);
-
- egl_t* egl = &cnx->egl;
- __eglMustCastToProperFunctionPointerType* curr =
- (__eglMustCastToProperFunctionPointerType*)egl;
- char const * const * api = egl_names;
- while (*api) {
- char const * name = *api;
- __eglMustCastToProperFunctionPointerType f =
- (__eglMustCastToProperFunctionPointerType)dlsym(dso, name);
- if (f == NULL) {
- // couldn't find the entry-point, use eglGetProcAddress()
- f = getProcAddress(name);
- if (f == NULL) {
- f = (__eglMustCastToProperFunctionPointerType)0;
- }
- }
- *curr++ = f;
- api++;
- }
- }
-
- if (mask & GLESv1_CM) {
- init_api(dso, gl_names,
- (__eglMustCastToProperFunctionPointerType*)
- &cnx->hooks[egl_connection_t::GLESv1_INDEX]->gl,
- getProcAddress);
- }
-
- if (mask & GLESv2) {
- init_api(dso, gl_names,
- (__eglMustCastToProperFunctionPointerType*)
- &cnx->hooks[egl_connection_t::GLESv2_INDEX]->gl,
- getProcAddress);
- }
-
- return dso;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
diff --git a/opengl/libs/EGL/Loader.h b/opengl/libs/EGL/Loader.h
deleted file mode 100644
index 30773cb..0000000
--- a/opengl/libs/EGL/Loader.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- ** Copyright 2009, 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.
- */
-
-#ifndef ANDROID_EGL_LOADER_H
-#define ANDROID_EGL_LOADER_H
-
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-
-#include <utils/Errors.h>
-#include <utils/Singleton.h>
-#include <utils/String8.h>
-
-#include <EGL/egl.h>
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-struct egl_connection_t;
-
-class Loader : public Singleton<Loader>
-{
- friend class Singleton<Loader>;
-
- typedef __eglMustCastToProperFunctionPointerType (*getProcAddressType)(
- const char*);
-
- enum {
- EGL = 0x01,
- GLESv1_CM = 0x02,
- GLESv2 = 0x04
- };
- struct driver_t {
- driver_t(void* gles);
- ~driver_t();
- status_t set(void* hnd, int32_t api);
- void* dso[3];
- };
-
- String8 mDriverTag;
- getProcAddressType getProcAddress;
-
-public:
- ~Loader();
-
- void* open(egl_connection_t* cnx);
- status_t close(void* driver);
-
-private:
- Loader();
- void *load_driver(const char* kind, const char *tag, egl_connection_t* cnx, uint32_t mask);
-
- static __attribute__((noinline))
- void init_api(void* dso,
- char const * const * api,
- __eglMustCastToProperFunctionPointerType* curr,
- getProcAddressType getProcAddress);
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif /* ANDROID_EGL_LOADER_H */
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
deleted file mode 100644
index eec5ce1..0000000
--- a/opengl/libs/EGL/egl.cpp
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <hardware/gralloc.h>
-#include <system/window.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <cutils/log.h>
-#include <cutils/atomic.h>
-#include <cutils/properties.h>
-#include <cutils/memory.h>
-
-#include <utils/CallStack.h>
-#include <utils/String8.h>
-
-#include "egldefs.h"
-#include "egl_impl.h"
-#include "egl_tls.h"
-#include "glestrace.h"
-#include "hooks.h"
-#include "Loader.h"
-
-#include "egl_display.h"
-#include "egl_object.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-egl_connection_t gEGLImpl;
-gl_hooks_t gHooks[2];
-gl_hooks_t gHooksNoContext;
-pthread_key_t gGLWrapperKey = -1;
-
-// ----------------------------------------------------------------------------
-
-#if EGL_TRACE
-
-EGLAPI pthread_key_t gGLTraceKey = -1;
-
-// ----------------------------------------------------------------------------
-
-int gEGLDebugLevel;
-
-static int sEGLTraceLevel;
-static int sEGLApplicationTraceLevel;
-
-extern gl_hooks_t gHooksTrace;
-
-static inline void setGlTraceThreadSpecific(gl_hooks_t const *value) {
- pthread_setspecific(gGLTraceKey, value);
-}
-
-gl_hooks_t const* getGLTraceThreadSpecific() {
- return static_cast<gl_hooks_t*>(pthread_getspecific(gGLTraceKey));
-}
-
-void initEglTraceLevel() {
- char value[PROPERTY_VALUE_MAX];
- property_get("debug.egl.trace", value, "0");
- int propertyLevel = atoi(value);
- int applicationLevel = sEGLApplicationTraceLevel;
- sEGLTraceLevel = propertyLevel > applicationLevel ? propertyLevel : applicationLevel;
-
- property_get("debug.egl.debug_proc", value, "");
- if (strlen(value) == 0)
- return;
-
- long pid = getpid();
- char procPath[128] = {};
- sprintf(procPath, "/proc/%ld/cmdline", pid);
- FILE * file = fopen(procPath, "r");
- if (file) {
- char cmdline[256] = {};
- if (fgets(cmdline, sizeof(cmdline) - 1, file)) {
- if (!strncmp(value, cmdline, strlen(value))) {
- // set EGL debug if the "debug.egl.debug_proc" property
- // matches the prefix of this application's command line
- gEGLDebugLevel = 1;
- }
- }
- fclose(file);
- }
-
- if (gEGLDebugLevel > 0) {
- GLTrace_start();
- }
-}
-
-void setGLHooksThreadSpecific(gl_hooks_t const *value) {
- if (sEGLTraceLevel > 0) {
- setGlTraceThreadSpecific(value);
- setGlThreadSpecific(&gHooksTrace);
- } else if (gEGLDebugLevel > 0 && value != &gHooksNoContext) {
- setGlTraceThreadSpecific(value);
- setGlThreadSpecific(GLTrace_getGLHooks());
- } else {
- setGlThreadSpecific(value);
- }
-}
-
-/*
- * Global entry point to allow applications to modify their own trace level.
- * The effective trace level is the max of this level and the value of debug.egl.trace.
- */
-extern "C"
-void setGLTraceLevel(int level) {
- sEGLApplicationTraceLevel = level;
-}
-
-#else
-
-void setGLHooksThreadSpecific(gl_hooks_t const *value) {
- setGlThreadSpecific(value);
-}
-
-#endif
-
-/*****************************************************************************/
-
-static int gl_no_context() {
- if (egl_tls_t::logNoContextCall()) {
- ALOGE("call to OpenGL ES API with no current context "
- "(logged once per thread)");
- char value[PROPERTY_VALUE_MAX];
- property_get("debug.egl.callstack", value, "0");
- if (atoi(value)) {
- CallStack stack;
- stack.update();
- stack.dump();
- }
- }
- return 0;
-}
-
-static void early_egl_init(void)
-{
-#if !USE_FAST_TLS_KEY
- pthread_key_create(&gGLWrapperKey, NULL);
-#endif
-#if EGL_TRACE
- pthread_key_create(&gGLTraceKey, NULL);
- initEglTraceLevel();
-#endif
- uint32_t addr = (uint32_t)((void*)gl_no_context);
- android_memset32(
- (uint32_t*)(void*)&gHooksNoContext,
- addr,
- sizeof(gHooksNoContext));
-
- setGLHooksThreadSpecific(&gHooksNoContext);
-}
-
-static pthread_once_t once_control = PTHREAD_ONCE_INIT;
-static int sEarlyInitState = pthread_once(&once_control, &early_egl_init);
-
-// ----------------------------------------------------------------------------
-
-egl_display_t* validate_display(EGLDisplay dpy) {
- egl_display_t * const dp = get_display(dpy);
- if (!dp)
- return setError(EGL_BAD_DISPLAY, (egl_display_t*)NULL);
- if (!dp->isReady())
- return setError(EGL_NOT_INITIALIZED, (egl_display_t*)NULL);
-
- return dp;
-}
-
-egl_connection_t* validate_display_config(EGLDisplay dpy, EGLConfig,
- egl_display_t const*& dp) {
- dp = validate_display(dpy);
- if (!dp)
- return (egl_connection_t*) NULL;
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso == 0) {
- return setError(EGL_BAD_CONFIG, (egl_connection_t*)NULL);
- }
- return cnx;
-}
-
-// ----------------------------------------------------------------------------
-
-const GLubyte * egl_get_string_for_current_context(GLenum name) {
- // NOTE: returning NULL here will fall-back to the default
- // implementation.
-
- EGLContext context = egl_tls_t::getContext();
- if (context == EGL_NO_CONTEXT)
- return NULL;
-
- egl_context_t const * const c = get_context(context);
- if (c == NULL) // this should never happen, by construction
- return NULL;
-
- if (name != GL_EXTENSIONS)
- return NULL;
-
- return (const GLubyte *)c->gl_extensions.string();
-}
-
-// ----------------------------------------------------------------------------
-
-// this mutex protects:
-// d->disp[]
-// egl_init_drivers_locked()
-//
-static EGLBoolean egl_init_drivers_locked() {
- if (sEarlyInitState) {
- // initialized by static ctor. should be set here.
- return EGL_FALSE;
- }
-
- // get our driver loader
- Loader& loader(Loader::getInstance());
-
- // dynamically load our EGL implementation
- egl_connection_t* cnx = &gEGLImpl;
- if (cnx->dso == 0) {
- cnx->hooks[egl_connection_t::GLESv1_INDEX] =
- &gHooks[egl_connection_t::GLESv1_INDEX];
- cnx->hooks[egl_connection_t::GLESv2_INDEX] =
- &gHooks[egl_connection_t::GLESv2_INDEX];
- cnx->dso = loader.open(cnx);
- }
-
- return cnx->dso ? EGL_TRUE : EGL_FALSE;
-}
-
-static pthread_mutex_t sInitDriverMutex = PTHREAD_MUTEX_INITIALIZER;
-
-EGLBoolean egl_init_drivers() {
- EGLBoolean res;
- pthread_mutex_lock(&sInitDriverMutex);
- res = egl_init_drivers_locked();
- pthread_mutex_unlock(&sInitDriverMutex);
- return res;
-}
-
-void gl_unimplemented() {
- ALOGE("called unimplemented OpenGL ES API");
-}
-
-void gl_noop() {
-}
-
-// ----------------------------------------------------------------------------
-
-#if USE_FAST_TLS_KEY
-
-// We have a dedicated TLS slot in bionic
-static inline gl_hooks_t const * volatile * get_tls_hooks() {
- volatile void *tls_base = __get_tls();
- gl_hooks_t const * volatile * tls_hooks =
- reinterpret_cast<gl_hooks_t const * volatile *>(tls_base);
- return tls_hooks;
-}
-
-void setGlThreadSpecific(gl_hooks_t const *value) {
- gl_hooks_t const * volatile * tls_hooks = get_tls_hooks();
- tls_hooks[TLS_SLOT_OPENGL_API] = value;
-}
-
-gl_hooks_t const* getGlThreadSpecific() {
- gl_hooks_t const * volatile * tls_hooks = get_tls_hooks();
- gl_hooks_t const* hooks = tls_hooks[TLS_SLOT_OPENGL_API];
- if (hooks) return hooks;
- return &gHooksNoContext;
-}
-
-#else
-
-void setGlThreadSpecific(gl_hooks_t const *value) {
- pthread_setspecific(gGLWrapperKey, value);
-}
-
-gl_hooks_t const* getGlThreadSpecific() {
- gl_hooks_t const* hooks = static_cast<gl_hooks_t*>(pthread_getspecific(gGLWrapperKey));
- if (hooks) return hooks;
- return &gHooksNoContext;
-}
-
-#endif
-
-// ----------------------------------------------------------------------------
-// GL / EGL hooks
-// ----------------------------------------------------------------------------
-
-#undef GL_ENTRY
-#undef EGL_ENTRY
-#define GL_ENTRY(_r, _api, ...) #_api,
-#define EGL_ENTRY(_r, _api, ...) #_api,
-
-char const * const gl_names[] = {
- #include "entries.in"
- NULL
-};
-
-char const * const egl_names[] = {
- #include "egl_entries.in"
- NULL
-};
-
-#undef GL_ENTRY
-#undef EGL_ENTRY
-
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
deleted file mode 100644
index a1bd82d..0000000
--- a/opengl/libs/EGL/eglApi.cpp
+++ /dev/null
@@ -1,1139 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <hardware/gralloc.h>
-#include <system/window.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <cutils/log.h>
-#include <cutils/atomic.h>
-#include <cutils/properties.h>
-#include <cutils/memory.h>
-
-#include <utils/KeyedVector.h>
-#include <utils/SortedVector.h>
-#include <utils/String8.h>
-#include <utils/Trace.h>
-
-#include "egl_impl.h"
-#include "egl_tls.h"
-#include "glestrace.h"
-#include "hooks.h"
-
-#include "egl_display.h"
-#include "egl_impl.h"
-#include "egl_object.h"
-#include "egl_tls.h"
-#include "egldefs.h"
-
-using namespace android;
-
-// ----------------------------------------------------------------------------
-
-#define EGL_VERSION_HW_ANDROID 0x3143
-
-struct extention_map_t {
- const char* name;
- __eglMustCastToProperFunctionPointerType address;
-};
-
-static const extention_map_t sExtentionMap[] = {
- { "eglLockSurfaceKHR",
- (__eglMustCastToProperFunctionPointerType)&eglLockSurfaceKHR },
- { "eglUnlockSurfaceKHR",
- (__eglMustCastToProperFunctionPointerType)&eglUnlockSurfaceKHR },
- { "eglCreateImageKHR",
- (__eglMustCastToProperFunctionPointerType)&eglCreateImageKHR },
- { "eglDestroyImageKHR",
- (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR },
- { "eglGetSystemTimeFrequencyNV",
- (__eglMustCastToProperFunctionPointerType)&eglGetSystemTimeFrequencyNV },
- { "eglGetSystemTimeNV",
- (__eglMustCastToProperFunctionPointerType)&eglGetSystemTimeNV },
-};
-
-// accesses protected by sExtensionMapMutex
-static DefaultKeyedVector<String8, __eglMustCastToProperFunctionPointerType> sGLExtentionMap;
-static int sGLExtentionSlot = 0;
-static pthread_mutex_t sExtensionMapMutex = PTHREAD_MUTEX_INITIALIZER;
-
-static void(*findProcAddress(const char* name,
- const extention_map_t* map, size_t n))() {
- for (uint32_t i=0 ; i<n ; i++) {
- if (!strcmp(name, map[i].name)) {
- return map[i].address;
- }
- }
- return NULL;
-}
-
-// ----------------------------------------------------------------------------
-
-namespace android {
-extern void setGLHooksThreadSpecific(gl_hooks_t const *value);
-extern EGLBoolean egl_init_drivers();
-extern const __eglMustCastToProperFunctionPointerType gExtensionForwarders[MAX_NUMBER_OF_GL_EXTENSIONS];
-extern int gEGLDebugLevel;
-extern gl_hooks_t gHooksTrace;
-} // namespace android;
-
-// ----------------------------------------------------------------------------
-
-static inline void clearError() { egl_tls_t::clearError(); }
-static inline EGLContext getContext() { return egl_tls_t::getContext(); }
-
-// ----------------------------------------------------------------------------
-
-EGLDisplay eglGetDisplay(EGLNativeDisplayType display)
-{
- clearError();
-
- uint32_t index = uint32_t(display);
- if (index >= NUM_DISPLAYS) {
- return setError(EGL_BAD_PARAMETER, EGL_NO_DISPLAY);
- }
-
- if (egl_init_drivers() == EGL_FALSE) {
- return setError(EGL_BAD_PARAMETER, EGL_NO_DISPLAY);
- }
-
- EGLDisplay dpy = egl_display_t::getFromNativeDisplay(display);
- return dpy;
-}
-
-// ----------------------------------------------------------------------------
-// Initialization
-// ----------------------------------------------------------------------------
-
-EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
-{
- clearError();
-
- egl_display_t * const dp = get_display(dpy);
- if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- EGLBoolean res = dp->initialize(major, minor);
-
- return res;
-}
-
-EGLBoolean eglTerminate(EGLDisplay dpy)
-{
- // NOTE: don't unload the drivers b/c some APIs can be called
- // after eglTerminate() has been called. eglTerminate() only
- // terminates an EGLDisplay, not a EGL itself.
-
- clearError();
-
- egl_display_t* const dp = get_display(dpy);
- if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- EGLBoolean res = dp->terminate();
-
- return res;
-}
-
-// ----------------------------------------------------------------------------
-// configuration
-// ----------------------------------------------------------------------------
-
-EGLBoolean eglGetConfigs( EGLDisplay dpy,
- EGLConfig *configs,
- EGLint config_size, EGLint *num_config)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- if (num_config==0) {
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- EGLBoolean res = EGL_FALSE;
- *num_config = 0;
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso) {
- res = cnx->egl.eglGetConfigs(
- dp->disp.dpy, configs, config_size, num_config);
- }
-
- return res;
-}
-
-EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list,
- EGLConfig *configs, EGLint config_size,
- EGLint *num_config)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- if (num_config==0) {
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- EGLBoolean res = EGL_FALSE;
- *num_config = 0;
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso) {
- res = cnx->egl.eglChooseConfig(
- dp->disp.dpy, attrib_list, configs, config_size, num_config);
- }
- return res;
-}
-
-EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
- EGLint attribute, EGLint *value)
-{
- clearError();
-
- egl_display_t const* dp = 0;
- egl_connection_t* cnx = validate_display_config(dpy, config, dp);
- if (!cnx) return EGL_FALSE;
-
- return cnx->egl.eglGetConfigAttrib(
- dp->disp.dpy, config, attribute, value);
-}
-
-// ----------------------------------------------------------------------------
-// surfaces
-// ----------------------------------------------------------------------------
-
-EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
- NativeWindowType window,
- const EGLint *attrib_list)
-{
- clearError();
-
- egl_display_t const* dp = 0;
- egl_connection_t* cnx = validate_display_config(dpy, config, dp);
- if (cnx) {
- EGLDisplay iDpy = dp->disp.dpy;
- EGLint format;
-
- if (native_window_api_connect(window, NATIVE_WINDOW_API_EGL) != OK) {
- ALOGE("EGLNativeWindowType %p already connected to another API",
- window);
- return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
- }
-
- // set the native window's buffers format to match this config
- if (cnx->egl.eglGetConfigAttrib(iDpy,
- config, EGL_NATIVE_VISUAL_ID, &format)) {
- if (format != 0) {
- int err = native_window_set_buffers_format(window, format);
- if (err != 0) {
- ALOGE("error setting native window pixel format: %s (%d)",
- strerror(-err), err);
- native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
- return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
- }
- }
- }
-
- // the EGL spec requires that a new EGLSurface default to swap interval
- // 1, so explicitly set that on the window here.
- ANativeWindow* anw = reinterpret_cast<ANativeWindow*>(window);
- anw->setSwapInterval(anw, 1);
-
- EGLSurface surface = cnx->egl.eglCreateWindowSurface(
- iDpy, config, window, attrib_list);
- if (surface != EGL_NO_SURFACE) {
- egl_surface_t* s = new egl_surface_t(dpy, config, window, surface, cnx);
- return s;
- }
-
- // EGLSurface creation failed
- native_window_set_buffers_format(window, 0);
- native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
- }
- return EGL_NO_SURFACE;
-}
-
-EGLSurface eglCreatePixmapSurface( EGLDisplay dpy, EGLConfig config,
- NativePixmapType pixmap,
- const EGLint *attrib_list)
-{
- clearError();
-
- egl_display_t const* dp = 0;
- egl_connection_t* cnx = validate_display_config(dpy, config, dp);
- if (cnx) {
- EGLSurface surface = cnx->egl.eglCreatePixmapSurface(
- dp->disp.dpy, config, pixmap, attrib_list);
- if (surface != EGL_NO_SURFACE) {
- egl_surface_t* s = new egl_surface_t(dpy, config, NULL, surface, cnx);
- return s;
- }
- }
- return EGL_NO_SURFACE;
-}
-
-EGLSurface eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list)
-{
- clearError();
-
- egl_display_t const* dp = 0;
- egl_connection_t* cnx = validate_display_config(dpy, config, dp);
- if (cnx) {
- EGLSurface surface = cnx->egl.eglCreatePbufferSurface(
- dp->disp.dpy, config, attrib_list);
- if (surface != EGL_NO_SURFACE) {
- egl_surface_t* s = new egl_surface_t(dpy, config, NULL, surface, cnx);
- return s;
- }
- }
- return EGL_NO_SURFACE;
-}
-
-EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- SurfaceRef _s(dp, surface);
- if (!_s.get())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-
- egl_surface_t * const s = get_surface(surface);
- EGLBoolean result = s->cnx->egl.eglDestroySurface(dp->disp.dpy, s->surface);
- if (result == EGL_TRUE) {
- _s.terminate();
- }
- return result;
-}
-
-EGLBoolean eglQuerySurface( EGLDisplay dpy, EGLSurface surface,
- EGLint attribute, EGLint *value)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- SurfaceRef _s(dp, surface);
- if (!_s.get())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-
- egl_surface_t const * const s = get_surface(surface);
- return s->cnx->egl.eglQuerySurface(
- dp->disp.dpy, s->surface, attribute, value);
-}
-
-void EGLAPI eglBeginFrame(EGLDisplay dpy, EGLSurface surface) {
- ATRACE_CALL();
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) {
- return;
- }
-
- SurfaceRef _s(dp, surface);
- if (!_s.get()) {
- setError(EGL_BAD_SURFACE, EGL_FALSE);
- return;
- }
-
- int64_t timestamp = systemTime(SYSTEM_TIME_MONOTONIC);
-
- egl_surface_t const * const s = get_surface(surface);
- native_window_set_buffers_timestamp(s->win.get(), timestamp);
-}
-
-// ----------------------------------------------------------------------------
-// Contexts
-// ----------------------------------------------------------------------------
-
-EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config,
- EGLContext share_list, const EGLint *attrib_list)
-{
- clearError();
-
- egl_display_t const* dp = 0;
- egl_connection_t* cnx = validate_display_config(dpy, config, dp);
- if (cnx) {
- if (share_list != EGL_NO_CONTEXT) {
- egl_context_t* const c = get_context(share_list);
- share_list = c->context;
- }
- EGLContext context = cnx->egl.eglCreateContext(
- dp->disp.dpy, config, share_list, attrib_list);
- if (context != EGL_NO_CONTEXT) {
- // figure out if it's a GLESv1 or GLESv2
- int version = 0;
- if (attrib_list) {
- while (*attrib_list != EGL_NONE) {
- GLint attr = *attrib_list++;
- GLint value = *attrib_list++;
- if (attr == EGL_CONTEXT_CLIENT_VERSION) {
- if (value == 1) {
- version = egl_connection_t::GLESv1_INDEX;
- } else if (value == 2) {
- version = egl_connection_t::GLESv2_INDEX;
- }
- }
- };
- }
- egl_context_t* c = new egl_context_t(dpy, context, config, cnx, version);
-#if EGL_TRACE
- if (gEGLDebugLevel > 0)
- GLTrace_eglCreateContext(version, c);
-#endif
- return c;
- }
- }
- return EGL_NO_CONTEXT;
-}
-
-EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp)
- return EGL_FALSE;
-
- ContextRef _c(dp, ctx);
- if (!_c.get())
- return setError(EGL_BAD_CONTEXT, EGL_FALSE);
-
- egl_context_t * const c = get_context(ctx);
- EGLBoolean result = c->cnx->egl.eglDestroyContext(dp->disp.dpy, c->context);
- if (result == EGL_TRUE) {
- _c.terminate();
- }
- return result;
-}
-
-EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
- EGLSurface read, EGLContext ctx)
-{
- clearError();
-
- egl_display_t const * const dp = get_display(dpy);
- if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-
- // If ctx is not EGL_NO_CONTEXT, read is not EGL_NO_SURFACE, or draw is not
- // EGL_NO_SURFACE, then an EGL_NOT_INITIALIZED error is generated if dpy is
- // a valid but uninitialized display.
- if ( (ctx != EGL_NO_CONTEXT) || (read != EGL_NO_SURFACE) ||
- (draw != EGL_NO_SURFACE) ) {
- if (!dp->isReady()) return setError(EGL_NOT_INITIALIZED, EGL_FALSE);
- }
-
- // get a reference to the object passed in
- ContextRef _c(dp, ctx);
- SurfaceRef _d(dp, draw);
- SurfaceRef _r(dp, read);
-
- // validate the context (if not EGL_NO_CONTEXT)
- if ((ctx != EGL_NO_CONTEXT) && !_c.get()) {
- // EGL_NO_CONTEXT is valid
- return EGL_FALSE;
- }
-
- // these are the underlying implementation's object
- EGLContext impl_ctx = EGL_NO_CONTEXT;
- EGLSurface impl_draw = EGL_NO_SURFACE;
- EGLSurface impl_read = EGL_NO_SURFACE;
-
- // these are our objects structs passed in
- egl_context_t * c = NULL;
- egl_surface_t const * d = NULL;
- egl_surface_t const * r = NULL;
-
- // these are the current objects structs
- egl_context_t * cur_c = get_context(getContext());
-
- if (ctx != EGL_NO_CONTEXT) {
- c = get_context(ctx);
- impl_ctx = c->context;
- } else {
- // no context given, use the implementation of the current context
- if (cur_c == NULL) {
- // no current context
- if (draw != EGL_NO_SURFACE || read != EGL_NO_SURFACE) {
- // calling eglMakeCurrent( ..., !=0, !=0, EGL_NO_CONTEXT);
- return setError(EGL_BAD_MATCH, EGL_FALSE);
- }
- // not an error, there is just no current context.
- return EGL_TRUE;
- }
- }
-
- // retrieve the underlying implementation's draw EGLSurface
- if (draw != EGL_NO_SURFACE) {
- d = get_surface(draw);
- impl_draw = d->surface;
- }
-
- // retrieve the underlying implementation's read EGLSurface
- if (read != EGL_NO_SURFACE) {
- r = get_surface(read);
- impl_read = r->surface;
- }
-
-
- EGLBoolean result = const_cast<egl_display_t*>(dp)->makeCurrent(c, cur_c,
- draw, read, ctx,
- impl_draw, impl_read, impl_ctx);
-
- if (result == EGL_TRUE) {
- if (c) {
- setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
- egl_tls_t::setContext(ctx);
-#if EGL_TRACE
- if (gEGLDebugLevel > 0)
- GLTrace_eglMakeCurrent(c->version, c->cnx->hooks[c->version], ctx);
-#endif
- _c.acquire();
- _r.acquire();
- _d.acquire();
- } else {
- setGLHooksThreadSpecific(&gHooksNoContext);
- egl_tls_t::setContext(EGL_NO_CONTEXT);
- }
- } else {
- // this will ALOGE the error
- result = setError(c->cnx->egl.eglGetError(), EGL_FALSE);
- }
- return result;
-}
-
-
-EGLBoolean eglQueryContext( EGLDisplay dpy, EGLContext ctx,
- EGLint attribute, EGLint *value)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- ContextRef _c(dp, ctx);
- if (!_c.get()) return setError(EGL_BAD_CONTEXT, EGL_FALSE);
-
- egl_context_t * const c = get_context(ctx);
- return c->cnx->egl.eglQueryContext(
- dp->disp.dpy, c->context, attribute, value);
-
-}
-
-EGLContext eglGetCurrentContext(void)
-{
- // could be called before eglInitialize(), but we wouldn't have a context
- // then, and this function would correctly return EGL_NO_CONTEXT.
-
- clearError();
-
- EGLContext ctx = getContext();
- return ctx;
-}
-
-EGLSurface eglGetCurrentSurface(EGLint readdraw)
-{
- // could be called before eglInitialize(), but we wouldn't have a context
- // then, and this function would correctly return EGL_NO_SURFACE.
-
- clearError();
-
- EGLContext ctx = getContext();
- if (ctx) {
- egl_context_t const * const c = get_context(ctx);
- if (!c) return setError(EGL_BAD_CONTEXT, EGL_NO_SURFACE);
- switch (readdraw) {
- case EGL_READ: return c->read;
- case EGL_DRAW: return c->draw;
- default: return setError(EGL_BAD_PARAMETER, EGL_NO_SURFACE);
- }
- }
- return EGL_NO_SURFACE;
-}
-
-EGLDisplay eglGetCurrentDisplay(void)
-{
- // could be called before eglInitialize(), but we wouldn't have a context
- // then, and this function would correctly return EGL_NO_DISPLAY.
-
- clearError();
-
- EGLContext ctx = getContext();
- if (ctx) {
- egl_context_t const * const c = get_context(ctx);
- if (!c) return setError(EGL_BAD_CONTEXT, EGL_NO_SURFACE);
- return c->dpy;
- }
- return EGL_NO_DISPLAY;
-}
-
-EGLBoolean eglWaitGL(void)
-{
- clearError();
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (!cnx->dso)
- return setError(EGL_BAD_CONTEXT, EGL_FALSE);
-
- return cnx->egl.eglWaitGL();
-}
-
-EGLBoolean eglWaitNative(EGLint engine)
-{
- clearError();
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (!cnx->dso)
- return setError(EGL_BAD_CONTEXT, EGL_FALSE);
-
- return cnx->egl.eglWaitNative(engine);
-}
-
-EGLint eglGetError(void)
-{
- EGLint err = EGL_SUCCESS;
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso) {
- err = cnx->egl.eglGetError();
- }
- if (err == EGL_SUCCESS) {
- err = egl_tls_t::getError();
- }
- return err;
-}
-
-__eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
-{
- // eglGetProcAddress() could be the very first function called
- // in which case we must make sure we've initialized ourselves, this
- // happens the first time egl_get_display() is called.
-
- clearError();
-
- if (egl_init_drivers() == EGL_FALSE) {
- setError(EGL_BAD_PARAMETER, NULL);
- return NULL;
- }
-
- // The EGL_ANDROID_blob_cache extension should not be exposed to
- // applications. It is used internally by the Android EGL layer.
- if (!strcmp(procname, "eglSetBlobCacheFuncsANDROID")) {
- return NULL;
- }
-
- __eglMustCastToProperFunctionPointerType addr;
- addr = findProcAddress(procname, sExtentionMap, NELEM(sExtentionMap));
- if (addr) return addr;
-
-
- // this protects accesses to sGLExtentionMap and sGLExtentionSlot
- pthread_mutex_lock(&sExtensionMapMutex);
-
- /*
- * Since eglGetProcAddress() is not associated to anything, it needs
- * to return a function pointer that "works" regardless of what
- * the current context is.
- *
- * For this reason, we return a "forwarder", a small stub that takes
- * care of calling the function associated with the context
- * currently bound.
- *
- * We first look for extensions we've already resolved, if we're seeing
- * this extension for the first time, we go through all our
- * implementations and call eglGetProcAddress() and record the
- * result in the appropriate implementation hooks and return the
- * address of the forwarder corresponding to that hook set.
- *
- */
-
- const String8 name(procname);
- addr = sGLExtentionMap.valueFor(name);
- const int slot = sGLExtentionSlot;
-
- ALOGE_IF(slot >= MAX_NUMBER_OF_GL_EXTENSIONS,
- "no more slots for eglGetProcAddress(\"%s\")",
- procname);
-
-#if EGL_TRACE
- gl_hooks_t *debugHooks = GLTrace_getGLHooks();
-#endif
-
- if (!addr && (slot < MAX_NUMBER_OF_GL_EXTENSIONS)) {
- bool found = false;
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglGetProcAddress) {
- found = true;
- // Extensions are independent of the bound context
- cnx->hooks[egl_connection_t::GLESv1_INDEX]->ext.extensions[slot] =
- cnx->hooks[egl_connection_t::GLESv2_INDEX]->ext.extensions[slot] =
-#if EGL_TRACE
- debugHooks->ext.extensions[slot] =
- gHooksTrace.ext.extensions[slot] =
-#endif
- cnx->egl.eglGetProcAddress(procname);
- }
-
- if (found) {
- addr = gExtensionForwarders[slot];
- sGLExtentionMap.add(name, addr);
- sGLExtentionSlot++;
- }
- }
-
- pthread_mutex_unlock(&sExtensionMapMutex);
- return addr;
-}
-
-EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
-{
- ATRACE_CALL();
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- SurfaceRef _s(dp, draw);
- if (!_s.get())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-
-#if EGL_TRACE
- if (gEGLDebugLevel > 0)
- GLTrace_eglSwapBuffers(dpy, draw);
-#endif
-
- egl_surface_t const * const s = get_surface(draw);
- return s->cnx->egl.eglSwapBuffers(dp->disp.dpy, s->surface);
-}
-
-EGLBoolean eglCopyBuffers( EGLDisplay dpy, EGLSurface surface,
- NativePixmapType target)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- SurfaceRef _s(dp, surface);
- if (!_s.get())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-
- egl_surface_t const * const s = get_surface(surface);
- return s->cnx->egl.eglCopyBuffers(dp->disp.dpy, s->surface, target);
-}
-
-const char* eglQueryString(EGLDisplay dpy, EGLint name)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return (const char *) NULL;
-
- switch (name) {
- case EGL_VENDOR:
- return dp->getVendorString();
- case EGL_VERSION:
- return dp->getVersionString();
- case EGL_EXTENSIONS:
- return dp->getExtensionString();
- case EGL_CLIENT_APIS:
- return dp->getClientApiString();
- case EGL_VERSION_HW_ANDROID:
- return dp->disp.queryString.version;
- }
- return setError(EGL_BAD_PARAMETER, (const char *)0);
-}
-
-
-// ----------------------------------------------------------------------------
-// EGL 1.1
-// ----------------------------------------------------------------------------
-
-EGLBoolean eglSurfaceAttrib(
- EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- SurfaceRef _s(dp, surface);
- if (!_s.get())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-
- egl_surface_t const * const s = get_surface(surface);
- if (s->cnx->egl.eglSurfaceAttrib) {
- return s->cnx->egl.eglSurfaceAttrib(
- dp->disp.dpy, s->surface, attribute, value);
- }
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-}
-
-EGLBoolean eglBindTexImage(
- EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- SurfaceRef _s(dp, surface);
- if (!_s.get())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-
- egl_surface_t const * const s = get_surface(surface);
- if (s->cnx->egl.eglBindTexImage) {
- return s->cnx->egl.eglBindTexImage(
- dp->disp.dpy, s->surface, buffer);
- }
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-}
-
-EGLBoolean eglReleaseTexImage(
- EGLDisplay dpy, EGLSurface surface, EGLint buffer)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- SurfaceRef _s(dp, surface);
- if (!_s.get())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-
- egl_surface_t const * const s = get_surface(surface);
- if (s->cnx->egl.eglReleaseTexImage) {
- return s->cnx->egl.eglReleaseTexImage(
- dp->disp.dpy, s->surface, buffer);
- }
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-}
-
-EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- EGLBoolean res = EGL_TRUE;
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglSwapInterval) {
- res = cnx->egl.eglSwapInterval(dp->disp.dpy, interval);
- }
-
- return res;
-}
-
-
-// ----------------------------------------------------------------------------
-// EGL 1.2
-// ----------------------------------------------------------------------------
-
-EGLBoolean eglWaitClient(void)
-{
- clearError();
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (!cnx->dso)
- return setError(EGL_BAD_CONTEXT, EGL_FALSE);
-
- EGLBoolean res;
- if (cnx->egl.eglWaitClient) {
- res = cnx->egl.eglWaitClient();
- } else {
- res = cnx->egl.eglWaitGL();
- }
- return res;
-}
-
-EGLBoolean eglBindAPI(EGLenum api)
-{
- clearError();
-
- if (egl_init_drivers() == EGL_FALSE) {
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- // bind this API on all EGLs
- EGLBoolean res = EGL_TRUE;
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglBindAPI) {
- res = cnx->egl.eglBindAPI(api);
- }
- return res;
-}
-
-EGLenum eglQueryAPI(void)
-{
- clearError();
-
- if (egl_init_drivers() == EGL_FALSE) {
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglQueryAPI) {
- return cnx->egl.eglQueryAPI();
- }
-
- // or, it can only be OpenGL ES
- return EGL_OPENGL_ES_API;
-}
-
-EGLBoolean eglReleaseThread(void)
-{
- clearError();
-
- // If there is context bound to the thread, release it
- egl_display_t::loseCurrent(get_context(getContext()));
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglReleaseThread) {
- cnx->egl.eglReleaseThread();
- }
-
- egl_tls_t::clearTLS();
-#if EGL_TRACE
- if (gEGLDebugLevel > 0)
- GLTrace_eglReleaseThread();
-#endif
- return EGL_TRUE;
-}
-
-EGLSurface eglCreatePbufferFromClientBuffer(
- EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
- EGLConfig config, const EGLint *attrib_list)
-{
- clearError();
-
- egl_display_t const* dp = 0;
- egl_connection_t* cnx = validate_display_config(dpy, config, dp);
- if (!cnx) return EGL_FALSE;
- if (cnx->egl.eglCreatePbufferFromClientBuffer) {
- return cnx->egl.eglCreatePbufferFromClientBuffer(
- dp->disp.dpy, buftype, buffer, config, attrib_list);
- }
- return setError(EGL_BAD_CONFIG, EGL_NO_SURFACE);
-}
-
-// ----------------------------------------------------------------------------
-// EGL_EGLEXT_VERSION 3
-// ----------------------------------------------------------------------------
-
-EGLBoolean eglLockSurfaceKHR(EGLDisplay dpy, EGLSurface surface,
- const EGLint *attrib_list)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- SurfaceRef _s(dp, surface);
- if (!_s.get())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-
- egl_surface_t const * const s = get_surface(surface);
- if (s->cnx->egl.eglLockSurfaceKHR) {
- return s->cnx->egl.eglLockSurfaceKHR(
- dp->disp.dpy, s->surface, attrib_list);
- }
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-}
-
-EGLBoolean eglUnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- SurfaceRef _s(dp, surface);
- if (!_s.get())
- return setError(EGL_BAD_SURFACE, EGL_FALSE);
-
- egl_surface_t const * const s = get_surface(surface);
- if (s->cnx->egl.eglUnlockSurfaceKHR) {
- return s->cnx->egl.eglUnlockSurfaceKHR(dp->disp.dpy, s->surface);
- }
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
-}
-
-EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
- EGLClientBuffer buffer, const EGLint *attrib_list)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_NO_IMAGE_KHR;
-
- ContextRef _c(dp, ctx);
- egl_context_t * const c = _c.get();
-
- EGLImageKHR result = EGL_NO_IMAGE_KHR;
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglCreateImageKHR) {
- result = cnx->egl.eglCreateImageKHR(
- dp->disp.dpy,
- c ? c->context : EGL_NO_CONTEXT,
- target, buffer, attrib_list);
- }
- return result;
-}
-
-EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglDestroyImageKHR) {
- cnx->egl.eglDestroyImageKHR(dp->disp.dpy, img);
- }
- return EGL_TRUE;
-}
-
-// ----------------------------------------------------------------------------
-// EGL_EGLEXT_VERSION 5
-// ----------------------------------------------------------------------------
-
-
-EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_NO_SYNC_KHR;
-
- EGLSyncKHR result = EGL_NO_SYNC_KHR;
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglCreateSyncKHR) {
- result = cnx->egl.eglCreateSyncKHR(dp->disp.dpy, type, attrib_list);
- }
- return result;
-}
-
-EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- EGLBoolean result = EGL_FALSE;
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglDestroySyncKHR) {
- result = cnx->egl.eglDestroySyncKHR(dp->disp.dpy, sync);
- }
- return result;
-}
-
-EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync,
- EGLint flags, EGLTimeKHR timeout)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- EGLBoolean result = EGL_FALSE;
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglClientWaitSyncKHR) {
- result = cnx->egl.eglClientWaitSyncKHR(
- dp->disp.dpy, sync, flags, timeout);
- }
- return result;
-}
-
-EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync,
- EGLint attribute, EGLint *value)
-{
- clearError();
-
- egl_display_t const * const dp = validate_display(dpy);
- if (!dp) return EGL_FALSE;
-
- EGLBoolean result = EGL_FALSE;
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->egl.eglGetSyncAttribKHR) {
- result = cnx->egl.eglGetSyncAttribKHR(
- dp->disp.dpy, sync, attribute, value);
- }
- return result;
-}
-
-// ----------------------------------------------------------------------------
-// ANDROID extensions
-// ----------------------------------------------------------------------------
-
-/* ANDROID extensions entry-point go here */
-
-// ----------------------------------------------------------------------------
-// NVIDIA extensions
-// ----------------------------------------------------------------------------
-EGLuint64NV eglGetSystemTimeFrequencyNV()
-{
- clearError();
-
- if (egl_init_drivers() == EGL_FALSE) {
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- EGLuint64NV ret = 0;
- egl_connection_t* const cnx = &gEGLImpl;
-
- if (cnx->dso && cnx->egl.eglGetSystemTimeFrequencyNV) {
- return cnx->egl.eglGetSystemTimeFrequencyNV();
- }
-
- return setErrorQuiet(EGL_BAD_DISPLAY, 0);
-}
-
-EGLuint64NV eglGetSystemTimeNV()
-{
- clearError();
-
- if (egl_init_drivers() == EGL_FALSE) {
- return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- }
-
- EGLuint64NV ret = 0;
- egl_connection_t* const cnx = &gEGLImpl;
-
- if (cnx->dso && cnx->egl.eglGetSystemTimeNV) {
- return cnx->egl.eglGetSystemTimeNV();
- }
-
- return setErrorQuiet(EGL_BAD_DISPLAY, 0);
-}
diff --git a/opengl/libs/EGL/egl_cache.cpp b/opengl/libs/EGL/egl_cache.cpp
deleted file mode 100644
index c79fb5f..0000000
--- a/opengl/libs/EGL/egl_cache.cpp
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#include "egl_cache.h"
-#include "egl_display.h"
-#include "egl_impl.h"
-#include "egldefs.h"
-
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#ifndef MAX_EGL_CACHE_ENTRY_SIZE
-#define MAX_EGL_CACHE_ENTRY_SIZE (16 * 1024);
-#endif
-
-#ifndef MAX_EGL_CACHE_SIZE
-#define MAX_EGL_CACHE_SIZE (64 * 1024);
-#endif
-
-// Cache size limits.
-static const size_t maxKeySize = 1024;
-static const size_t maxValueSize = MAX_EGL_CACHE_ENTRY_SIZE;
-static const size_t maxTotalSize = MAX_EGL_CACHE_SIZE;
-
-// Cache file header
-static const char* cacheFileMagic = "EGL$";
-static const size_t cacheFileHeaderSize = 8;
-
-// The time in seconds to wait before saving newly inserted cache entries.
-static const unsigned int deferredSaveDelay = 4;
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-#define BC_EXT_STR "EGL_ANDROID_blob_cache"
-
-//
-// Callback functions passed to EGL.
-//
-static void setBlob(const void* key, EGLsizeiANDROID keySize,
- const void* value, EGLsizeiANDROID valueSize) {
- egl_cache_t::get()->setBlob(key, keySize, value, valueSize);
-}
-
-static EGLsizeiANDROID getBlob(const void* key, EGLsizeiANDROID keySize,
- void* value, EGLsizeiANDROID valueSize) {
- return egl_cache_t::get()->getBlob(key, keySize, value, valueSize);
-}
-
-//
-// egl_cache_t definition
-//
-egl_cache_t::egl_cache_t() :
- mInitialized(false),
- mBlobCache(NULL) {
-}
-
-egl_cache_t::~egl_cache_t() {
-}
-
-egl_cache_t egl_cache_t::sCache;
-
-egl_cache_t* egl_cache_t::get() {
- return &sCache;
-}
-
-void egl_cache_t::initialize(egl_display_t *display) {
- Mutex::Autolock lock(mMutex);
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && cnx->major >= 0 && cnx->minor >= 0) {
- const char* exts = display->disp.queryString.extensions;
- size_t bcExtLen = strlen(BC_EXT_STR);
- size_t extsLen = strlen(exts);
- bool equal = !strcmp(BC_EXT_STR, exts);
- bool atStart = !strncmp(BC_EXT_STR " ", exts, bcExtLen+1);
- bool atEnd = (bcExtLen+1) < extsLen &&
- !strcmp(" " BC_EXT_STR, exts + extsLen - (bcExtLen+1));
- bool inMiddle = strstr(exts, " " BC_EXT_STR " ");
- if (equal || atStart || atEnd || inMiddle) {
- PFNEGLSETBLOBCACHEFUNCSANDROIDPROC eglSetBlobCacheFuncsANDROID;
- eglSetBlobCacheFuncsANDROID =
- reinterpret_cast<PFNEGLSETBLOBCACHEFUNCSANDROIDPROC>(
- cnx->egl.eglGetProcAddress(
- "eglSetBlobCacheFuncsANDROID"));
- if (eglSetBlobCacheFuncsANDROID == NULL) {
- ALOGE("EGL_ANDROID_blob_cache advertised, "
- "but unable to get eglSetBlobCacheFuncsANDROID");
- return;
- }
-
- eglSetBlobCacheFuncsANDROID(display->disp.dpy,
- android::setBlob, android::getBlob);
- EGLint err = cnx->egl.eglGetError();
- if (err != EGL_SUCCESS) {
- ALOGE("eglSetBlobCacheFuncsANDROID resulted in an error: "
- "%#x", err);
- }
- }
- }
-
- mInitialized = true;
-}
-
-void egl_cache_t::terminate() {
- Mutex::Autolock lock(mMutex);
- if (mBlobCache != NULL) {
- saveBlobCacheLocked();
- mBlobCache = NULL;
- }
- mInitialized = false;
-}
-
-void egl_cache_t::setBlob(const void* key, EGLsizeiANDROID keySize,
- const void* value, EGLsizeiANDROID valueSize) {
- Mutex::Autolock lock(mMutex);
-
- if (keySize < 0 || valueSize < 0) {
- ALOGW("EGL_ANDROID_blob_cache set: negative sizes are not allowed");
- return;
- }
-
- if (mInitialized) {
- sp<BlobCache> bc = getBlobCacheLocked();
- bc->set(key, keySize, value, valueSize);
-
- if (!mSavePending) {
- class DeferredSaveThread : public Thread {
- public:
- DeferredSaveThread() : Thread(false) {}
-
- virtual bool threadLoop() {
- sleep(deferredSaveDelay);
- egl_cache_t* c = egl_cache_t::get();
- Mutex::Autolock lock(c->mMutex);
- if (c->mInitialized) {
- c->saveBlobCacheLocked();
- }
- c->mSavePending = false;
- return false;
- }
- };
-
- // The thread will hold a strong ref to itself until it has finished
- // running, so there's no need to keep a ref around.
- sp<Thread> deferredSaveThread(new DeferredSaveThread());
- mSavePending = true;
- deferredSaveThread->run();
- }
- }
-}
-
-EGLsizeiANDROID egl_cache_t::getBlob(const void* key, EGLsizeiANDROID keySize,
- void* value, EGLsizeiANDROID valueSize) {
- Mutex::Autolock lock(mMutex);
-
- if (keySize < 0 || valueSize < 0) {
- ALOGW("EGL_ANDROID_blob_cache set: negative sizes are not allowed");
- return 0;
- }
-
- if (mInitialized) {
- sp<BlobCache> bc = getBlobCacheLocked();
- return bc->get(key, keySize, value, valueSize);
- }
- return 0;
-}
-
-void egl_cache_t::setCacheFilename(const char* filename) {
- Mutex::Autolock lock(mMutex);
- mFilename = filename;
-}
-
-sp<BlobCache> egl_cache_t::getBlobCacheLocked() {
- if (mBlobCache == NULL) {
- mBlobCache = new BlobCache(maxKeySize, maxValueSize, maxTotalSize);
- loadBlobCacheLocked();
- }
- return mBlobCache;
-}
-
-static uint32_t crc32c(const uint8_t* buf, size_t len) {
- const uint32_t polyBits = 0x82F63B78;
- uint32_t r = 0;
- for (size_t i = 0; i < len; i++) {
- r ^= buf[i];
- for (int j = 0; j < 8; j++) {
- if (r & 1) {
- r = (r >> 1) ^ polyBits;
- } else {
- r >>= 1;
- }
- }
- }
- return r;
-}
-
-void egl_cache_t::saveBlobCacheLocked() {
- if (mFilename.length() > 0) {
- size_t cacheSize = mBlobCache->getFlattenedSize();
- size_t headerSize = cacheFileHeaderSize;
- const char* fname = mFilename.string();
-
- // Try to create the file with no permissions so we can write it
- // without anyone trying to read it.
- int fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0);
- if (fd == -1) {
- if (errno == EEXIST) {
- // The file exists, delete it and try again.
- if (unlink(fname) == -1) {
- // No point in retrying if the unlink failed.
- ALOGE("error unlinking cache file %s: %s (%d)", fname,
- strerror(errno), errno);
- return;
- }
- // Retry now that we've unlinked the file.
- fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0);
- }
- if (fd == -1) {
- ALOGE("error creating cache file %s: %s (%d)", fname,
- strerror(errno), errno);
- return;
- }
- }
-
- size_t fileSize = headerSize + cacheSize;
- if (ftruncate(fd, fileSize) == -1) {
- ALOGE("error setting cache file size: %s (%d)", strerror(errno),
- errno);
- close(fd);
- unlink(fname);
- return;
- }
-
- uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(NULL, fileSize,
- PROT_WRITE, MAP_SHARED, fd, 0));
- if (buf == MAP_FAILED) {
- ALOGE("error mmaping cache file: %s (%d)", strerror(errno),
- errno);
- close(fd);
- unlink(fname);
- return;
- }
-
- status_t err = mBlobCache->flatten(buf + headerSize, cacheSize, NULL,
- 0);
- if (err != OK) {
- ALOGE("error writing cache contents: %s (%d)", strerror(-err),
- -err);
- munmap(buf, fileSize);
- close(fd);
- unlink(fname);
- return;
- }
-
- // Write the file magic and CRC
- memcpy(buf, cacheFileMagic, 4);
- uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4);
- *crc = crc32c(buf + headerSize, cacheSize);
-
- munmap(buf, fileSize);
- fchmod(fd, S_IRUSR);
- close(fd);
- }
-}
-
-void egl_cache_t::loadBlobCacheLocked() {
- if (mFilename.length() > 0) {
- size_t headerSize = cacheFileHeaderSize;
-
- int fd = open(mFilename.string(), O_RDONLY, 0);
- if (fd == -1) {
- if (errno != ENOENT) {
- ALOGE("error opening cache file %s: %s (%d)", mFilename.string(),
- strerror(errno), errno);
- }
- return;
- }
-
- struct stat statBuf;
- if (fstat(fd, &statBuf) == -1) {
- ALOGE("error stat'ing cache file: %s (%d)", strerror(errno), errno);
- close(fd);
- return;
- }
-
- // Sanity check the size before trying to mmap it.
- size_t fileSize = statBuf.st_size;
- if (fileSize > maxTotalSize * 2) {
- ALOGE("cache file is too large: %#llx", statBuf.st_size);
- close(fd);
- return;
- }
-
- uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(NULL, fileSize,
- PROT_READ, MAP_PRIVATE, fd, 0));
- if (buf == MAP_FAILED) {
- ALOGE("error mmaping cache file: %s (%d)", strerror(errno),
- errno);
- close(fd);
- return;
- }
-
- // Check the file magic and CRC
- size_t cacheSize = fileSize - headerSize;
- if (memcmp(buf, cacheFileMagic, 4) != 0) {
- ALOGE("cache file has bad mojo");
- close(fd);
- return;
- }
- uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4);
- if (crc32c(buf + headerSize, cacheSize) != *crc) {
- ALOGE("cache file failed CRC check");
- close(fd);
- return;
- }
-
- status_t err = mBlobCache->unflatten(buf + headerSize, cacheSize, NULL,
- 0);
- if (err != OK) {
- ALOGE("error reading cache contents: %s (%d)", strerror(-err),
- -err);
- munmap(buf, fileSize);
- close(fd);
- return;
- }
-
- munmap(buf, fileSize);
- close(fd);
- }
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
diff --git a/opengl/libs/EGL/egl_cache.h b/opengl/libs/EGL/egl_cache.h
deleted file mode 100644
index 8760009..0000000
--- a/opengl/libs/EGL/egl_cache.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#ifndef ANDROID_EGL_CACHE_H
-#define ANDROID_EGL_CACHE_H
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#include <utils/BlobCache.h>
-#include <utils/String8.h>
-#include <utils/StrongPointer.h>
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-class egl_display_t;
-
-class EGLAPI egl_cache_t {
-public:
-
- // get returns a pointer to the singleton egl_cache_t object. This
- // singleton object will never be destroyed.
- static egl_cache_t* get();
-
- // initialize puts the egl_cache_t into an initialized state, such that it
- // is able to insert and retrieve entries from the cache. This should be
- // called when EGL is initialized. When not in the initialized state the
- // getBlob and setBlob methods will return without performing any cache
- // operations.
- void initialize(egl_display_t* display);
-
- // terminate puts the egl_cache_t back into the uninitialized state. When
- // in this state the getBlob and setBlob methods will return without
- // performing any cache operations.
- void terminate();
-
- // setBlob attempts to insert a new key/value blob pair into the cache.
- // This will be called by the hardware vendor's EGL implementation via the
- // EGL_ANDROID_blob_cache extension.
- void setBlob(const void* key, EGLsizeiANDROID keySize, const void* value,
- EGLsizeiANDROID valueSize);
-
- // getBlob attempts to retrieve the value blob associated with a given key
- // blob from cache. This will be called by the hardware vendor's EGL
- // implementation via the EGL_ANDROID_blob_cache extension.
- EGLsizeiANDROID getBlob(const void* key, EGLsizeiANDROID keySize,
- void* value, EGLsizeiANDROID valueSize);
-
- // setCacheFilename sets the name of the file that should be used to store
- // cache contents from one program invocation to another.
- void setCacheFilename(const char* filename);
-
-private:
- // Creation and (the lack of) destruction is handled internally.
- egl_cache_t();
- ~egl_cache_t();
-
- // Copying is disallowed.
- egl_cache_t(const egl_cache_t&); // not implemented
- void operator=(const egl_cache_t&); // not implemented
-
- // getBlobCacheLocked returns the BlobCache object being used to store the
- // key/value blob pairs. If the BlobCache object has not yet been created,
- // this will do so, loading the serialized cache contents from disk if
- // possible.
- sp<BlobCache> getBlobCacheLocked();
-
- // saveBlobCache attempts to save the current contents of mBlobCache to
- // disk.
- void saveBlobCacheLocked();
-
- // loadBlobCache attempts to load the saved cache contents from disk into
- // mBlobCache.
- void loadBlobCacheLocked();
-
- // mInitialized indicates whether the egl_cache_t is in the initialized
- // state. It is initialized to false at construction time, and gets set to
- // true when initialize is called. It is set back to false when terminate
- // is called. When in this state, the cache behaves as normal. When not,
- // the getBlob and setBlob methods will return without performing any cache
- // operations.
- bool mInitialized;
-
- // mBlobCache is the cache in which the key/value blob pairs are stored. It
- // is initially NULL, and will be initialized by getBlobCacheLocked the
- // first time it's needed.
- sp<BlobCache> mBlobCache;
-
- // mFilename is the name of the file for storing cache contents in between
- // program invocations. It is initialized to an empty string at
- // construction time, and can be set with the setCacheFilename method. An
- // empty string indicates that the cache should not be saved to or restored
- // from disk.
- String8 mFilename;
-
- // mSavePending indicates whether or not a deferred save operation is
- // pending. Each time a key/value pair is inserted into the cache via
- // setBlob, a deferred save is initiated if one is not already pending.
- // This will wait some amount of time and then trigger a save of the cache
- // contents to disk.
- bool mSavePending;
-
- // mMutex is the mutex used to prevent concurrent access to the member
- // variables. It must be locked whenever the member variables are accessed.
- mutable Mutex mMutex;
-
- // sCache is the singleton egl_cache_t object.
- static egl_cache_t sCache;
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif // ANDROID_EGL_CACHE_H
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
deleted file mode 100644
index c85b4ce..0000000
--- a/opengl/libs/EGL/egl_display.cpp
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#include <string.h>
-
-#include "egl_cache.h"
-#include "egl_display.h"
-#include "egl_object.h"
-#include "egl_tls.h"
-#include "egl_impl.h"
-#include "Loader.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-static char const * const sVendorString = "Android";
-static char const * const sVersionString = "1.4 Android META-EGL";
-static char const * const sClientApiString = "OpenGL ES";
-
-// this is the list of EGL extensions that are exposed to applications
-// some of them are mandatory because used by the ANDROID system.
-//
-// mandatory extensions are required per the CDD and not explicitly
-// checked during EGL initialization. the system *assumes* these extensions
-// are present. the system may not function properly if some mandatory
-// extensions are missing.
-//
-// NOTE: sExtensionString MUST be have a single space as the last character.
-//
-static char const * const sExtensionString =
- "EGL_KHR_image " // mandatory
- "EGL_KHR_image_base " // mandatory
- "EGL_KHR_image_pixmap "
- "EGL_KHR_gl_texture_2D_image "
- "EGL_KHR_gl_texture_cubemap_image "
- "EGL_KHR_gl_renderbuffer_image "
- "EGL_KHR_fence_sync "
- "EGL_NV_system_time "
- "EGL_ANDROID_image_native_buffer " // mandatory
- ;
-
-// extensions not exposed to applications but used by the ANDROID system
-// "EGL_ANDROID_recordable " // mandatory
-// "EGL_ANDROID_blob_cache " // strongly recommended
-
-extern void initEglTraceLevel();
-extern void setGLHooksThreadSpecific(gl_hooks_t const *value);
-
-// ----------------------------------------------------------------------------
-
-egl_display_t egl_display_t::sDisplay[NUM_DISPLAYS];
-
-egl_display_t::egl_display_t() :
- magic('_dpy'), refs(0) {
-}
-
-egl_display_t::~egl_display_t() {
- magic = 0;
- egl_cache_t::get()->terminate();
-}
-
-egl_display_t* egl_display_t::get(EGLDisplay dpy) {
- uintptr_t index = uintptr_t(dpy)-1U;
- return (index >= NUM_DISPLAYS) ? NULL : &sDisplay[index];
-}
-
-void egl_display_t::addObject(egl_object_t* object) {
- Mutex::Autolock _l(lock);
- objects.add(object);
-}
-
-void egl_display_t::removeObject(egl_object_t* object) {
- Mutex::Autolock _l(lock);
- objects.remove(object);
-}
-
-bool egl_display_t::getObject(egl_object_t* object) const {
- Mutex::Autolock _l(lock);
- if (objects.indexOf(object) >= 0) {
- if (object->getDisplay() == this) {
- object->incRef();
- return true;
- }
- }
- return false;
-}
-
-EGLDisplay egl_display_t::getFromNativeDisplay(EGLNativeDisplayType disp) {
- if (uintptr_t(disp) >= NUM_DISPLAYS)
- return NULL;
-
- return sDisplay[uintptr_t(disp)].getDisplay(disp);
-}
-
-EGLDisplay egl_display_t::getDisplay(EGLNativeDisplayType display) {
-
- Mutex::Autolock _l(lock);
-
- // get our driver loader
- Loader& loader(Loader::getInstance());
-
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && disp.dpy == EGL_NO_DISPLAY) {
- EGLDisplay dpy = cnx->egl.eglGetDisplay(display);
- disp.dpy = dpy;
- if (dpy == EGL_NO_DISPLAY) {
- loader.close(cnx->dso);
- cnx->dso = NULL;
- }
- }
-
- return EGLDisplay(uintptr_t(display) + 1U);
-}
-
-EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) {
-
- Mutex::Autolock _l(lock);
-
- if (refs > 0) {
- if (major != NULL)
- *major = VERSION_MAJOR;
- if (minor != NULL)
- *minor = VERSION_MINOR;
- refs++;
- return EGL_TRUE;
- }
-
-#if EGL_TRACE
-
- // Called both at early_init time and at this time. (Early_init is pre-zygote, so
- // the information from that call may be stale.)
- initEglTraceLevel();
-
-#endif
-
- setGLHooksThreadSpecific(&gHooksNoContext);
-
- // initialize each EGL and
- // build our own extension string first, based on the extension we know
- // and the extension supported by our client implementation
-
- egl_connection_t* const cnx = &gEGLImpl;
- cnx->major = -1;
- cnx->minor = -1;
- if (cnx->dso) {
-
-#if defined(ADRENO130)
-#warning "Adreno-130 eglInitialize() workaround"
- /*
- * The ADRENO 130 driver returns a different EGLDisplay each time
- * eglGetDisplay() is called, but also makes the EGLDisplay invalid
- * after eglTerminate() has been called, so that eglInitialize()
- * cannot be called again. Therefore, we need to make sure to call
- * eglGetDisplay() before calling eglInitialize();
- */
- if (i == IMPL_HARDWARE) {
- disp[i].dpy = cnx->egl.eglGetDisplay(EGL_DEFAULT_DISPLAY);
- }
-#endif
-
- EGLDisplay idpy = disp.dpy;
- if (cnx->egl.eglInitialize(idpy, &cnx->major, &cnx->minor)) {
- //ALOGD("initialized dpy=%p, ver=%d.%d, cnx=%p",
- // idpy, cnx->major, cnx->minor, cnx);
-
- // display is now initialized
- disp.state = egl_display_t::INITIALIZED;
-
- // get the query-strings for this display for each implementation
- disp.queryString.vendor = cnx->egl.eglQueryString(idpy,
- EGL_VENDOR);
- disp.queryString.version = cnx->egl.eglQueryString(idpy,
- EGL_VERSION);
- disp.queryString.extensions = cnx->egl.eglQueryString(idpy,
- EGL_EXTENSIONS);
- disp.queryString.clientApi = cnx->egl.eglQueryString(idpy,
- EGL_CLIENT_APIS);
-
- } else {
- ALOGW("eglInitialize(%p) failed (%s)", idpy,
- egl_tls_t::egl_strerror(cnx->egl.eglGetError()));
- }
- }
-
- // the query strings are per-display
- mVendorString.setTo(sVendorString);
- mVersionString.setTo(sVersionString);
- mClientApiString.setTo(sClientApiString);
-
- // we only add extensions that exist in the implementation
- char const* start = sExtensionString;
- char const* end;
- do {
- // find the space separating this extension for the next one
- end = strchr(start, ' ');
- if (end) {
- // length of the extension string
- const size_t len = end - start;
- if (len) {
- // NOTE: we could avoid the copy if we had strnstr.
- const String8 ext(start, len);
- // now look for this extension
- if (disp.queryString.extensions) {
- // if we find it, add this extension string to our list
- // (and don't forget the space)
- const char* match = strstr(disp.queryString.extensions, ext.string());
- if (match && (match[len] == ' ' || match[len] == 0)) {
- mExtensionString.append(start, len+1);
- }
- }
- }
- // process the next extension string, and skip the space.
- start = end + 1;
- }
- } while (end);
-
- egl_cache_t::get()->initialize(this);
-
- refs++;
- if (major != NULL)
- *major = VERSION_MAJOR;
- if (minor != NULL)
- *minor = VERSION_MINOR;
- return EGL_TRUE;
-}
-
-EGLBoolean egl_display_t::terminate() {
-
- Mutex::Autolock _l(lock);
-
- if (refs == 0) {
- return setError(EGL_NOT_INITIALIZED, EGL_FALSE);
- }
-
- // this is specific to Android, display termination is ref-counted.
- if (refs > 1) {
- refs--;
- return EGL_TRUE;
- }
-
- EGLBoolean res = EGL_FALSE;
- egl_connection_t* const cnx = &gEGLImpl;
- if (cnx->dso && disp.state == egl_display_t::INITIALIZED) {
- if (cnx->egl.eglTerminate(disp.dpy) == EGL_FALSE) {
- ALOGW("eglTerminate(%p) failed (%s)", disp.dpy,
- egl_tls_t::egl_strerror(cnx->egl.eglGetError()));
- }
- // REVISIT: it's unclear what to do if eglTerminate() fails
- disp.state = egl_display_t::TERMINATED;
- res = EGL_TRUE;
- }
-
- // Mark all objects remaining in the list as terminated, unless
- // there are no reference to them, it which case, we're free to
- // delete them.
- size_t count = objects.size();
- ALOGW_IF(count, "eglTerminate() called w/ %d objects remaining", count);
- for (size_t i=0 ; i<count ; i++) {
- egl_object_t* o = objects.itemAt(i);
- o->destroy();
- }
-
- // this marks all object handles are "terminated"
- objects.clear();
-
- refs--;
- return res;
-}
-
-void egl_display_t::loseCurrent(egl_context_t * cur_c)
-{
- if (cur_c) {
- egl_display_t* display = cur_c->getDisplay();
- if (display) {
- display->loseCurrentImpl(cur_c);
- }
- }
-}
-
-void egl_display_t::loseCurrentImpl(egl_context_t * cur_c)
-{
- // by construction, these are either 0 or valid (possibly terminated)
- // it should be impossible for these to be invalid
- ContextRef _cur_c(cur_c);
- SurfaceRef _cur_r(cur_c ? get_surface(cur_c->read) : NULL);
- SurfaceRef _cur_d(cur_c ? get_surface(cur_c->draw) : NULL);
-
- { // scope for the lock
- Mutex::Autolock _l(lock);
- cur_c->onLooseCurrent();
-
- }
-
- // This cannot be called with the lock held because it might end-up
- // calling back into EGL (in particular when a surface is destroyed
- // it calls ANativeWindow::disconnect
- _cur_c.release();
- _cur_r.release();
- _cur_d.release();
-}
-
-EGLBoolean egl_display_t::makeCurrent(egl_context_t* c, egl_context_t* cur_c,
- EGLSurface draw, EGLSurface read, EGLContext ctx,
- EGLSurface impl_draw, EGLSurface impl_read, EGLContext impl_ctx)
-{
- EGLBoolean result;
-
- // by construction, these are either 0 or valid (possibly terminated)
- // it should be impossible for these to be invalid
- ContextRef _cur_c(cur_c);
- SurfaceRef _cur_r(cur_c ? get_surface(cur_c->read) : NULL);
- SurfaceRef _cur_d(cur_c ? get_surface(cur_c->draw) : NULL);
-
- { // scope for the lock
- Mutex::Autolock _l(lock);
- if (c) {
- result = c->cnx->egl.eglMakeCurrent(
- disp.dpy, impl_draw, impl_read, impl_ctx);
- if (result == EGL_TRUE) {
- c->onMakeCurrent(draw, read);
- }
- } else {
- result = cur_c->cnx->egl.eglMakeCurrent(
- disp.dpy, impl_draw, impl_read, impl_ctx);
- if (result == EGL_TRUE) {
- cur_c->onLooseCurrent();
- }
- }
- }
-
- if (result == EGL_TRUE) {
- // This cannot be called with the lock held because it might end-up
- // calling back into EGL (in particular when a surface is destroyed
- // it calls ANativeWindow::disconnect
- _cur_c.release();
- _cur_r.release();
- _cur_d.release();
- }
-
- return result;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
diff --git a/opengl/libs/EGL/egl_display.h b/opengl/libs/EGL/egl_display.h
deleted file mode 100644
index 6348228..0000000
--- a/opengl/libs/EGL/egl_display.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#ifndef ANDROID_EGL_DISPLAY_H
-#define ANDROID_EGL_DISPLAY_H
-
-
-#include <ctype.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <utils/SortedVector.h>
-#include <utils/threads.h>
-#include <utils/String8.h>
-
-#include "egldefs.h"
-#include "hooks.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-class egl_object_t;
-class egl_context_t;
-class egl_connection_t;
-
-// ----------------------------------------------------------------------------
-
-class EGLAPI egl_display_t { // marked as EGLAPI for testing purposes
- static egl_display_t sDisplay[NUM_DISPLAYS];
- EGLDisplay getDisplay(EGLNativeDisplayType display);
- void loseCurrentImpl(egl_context_t * cur_c);
-
-public:
- enum {
- NOT_INITIALIZED = 0,
- INITIALIZED = 1,
- TERMINATED = 2
- };
-
- egl_display_t();
- ~egl_display_t();
-
- EGLBoolean initialize(EGLint *major, EGLint *minor);
- EGLBoolean terminate();
-
- // add object to this display's list
- void addObject(egl_object_t* object);
- // remove object from this display's list
- void removeObject(egl_object_t* object);
- // add reference to this object. returns true if this is a valid object.
- bool getObject(egl_object_t* object) const;
-
- static egl_display_t* get(EGLDisplay dpy);
- static EGLDisplay getFromNativeDisplay(EGLNativeDisplayType disp);
-
- EGLBoolean makeCurrent(egl_context_t* c, egl_context_t* cur_c,
- EGLSurface draw, EGLSurface read, EGLContext ctx,
- EGLSurface impl_draw, EGLSurface impl_read, EGLContext impl_ctx);
- static void loseCurrent(egl_context_t * cur_c);
-
- inline bool isReady() const { return (refs > 0); }
- inline bool isValid() const { return magic == '_dpy'; }
- inline bool isAlive() const { return isValid(); }
-
- char const * getVendorString() const { return mVendorString.string(); }
- char const * getVersionString() const { return mVersionString.string(); }
- char const * getClientApiString() const { return mClientApiString.string(); }
- char const * getExtensionString() const { return mExtensionString.string(); }
-
- inline uint32_t getRefsCount() const { return refs; }
-
- struct strings_t {
- char const * vendor;
- char const * version;
- char const * clientApi;
- char const * extensions;
- };
-
- struct DisplayImpl {
- DisplayImpl() : dpy(EGL_NO_DISPLAY), state(NOT_INITIALIZED) { }
- EGLDisplay dpy;
- EGLint state;
- strings_t queryString;
- };
-
-private:
- uint32_t magic;
-
-public:
- DisplayImpl disp;
-
-private:
- uint32_t refs;
- mutable Mutex lock;
- SortedVector<egl_object_t*> objects;
- String8 mVendorString;
- String8 mVersionString;
- String8 mClientApiString;
- String8 mExtensionString;
-};
-
-// ----------------------------------------------------------------------------
-
-inline egl_display_t* get_display(EGLDisplay dpy) {
- return egl_display_t::get(dpy);
-}
-
-// ----------------------------------------------------------------------------
-
-egl_display_t* validate_display(EGLDisplay dpy);
-egl_connection_t* validate_display_config(EGLDisplay dpy,
- EGLConfig config, egl_display_t const*& dp);
-EGLBoolean validate_display_context(EGLDisplay dpy, EGLContext ctx);
-EGLBoolean validate_display_surface(EGLDisplay dpy, EGLSurface surface);
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif // ANDROID_EGL_DISPLAY_H
diff --git a/opengl/libs/EGL/egl_entries.in b/opengl/libs/EGL/egl_entries.in
deleted file mode 100644
index bdd2a7e..0000000
--- a/opengl/libs/EGL/egl_entries.in
+++ /dev/null
@@ -1,69 +0,0 @@
-EGL_ENTRY(EGLDisplay, eglGetDisplay, NativeDisplayType)
-EGL_ENTRY(EGLBoolean, eglInitialize, EGLDisplay, EGLint*, EGLint*)
-EGL_ENTRY(EGLBoolean, eglTerminate, EGLDisplay)
-EGL_ENTRY(EGLBoolean, eglGetConfigs, EGLDisplay, EGLConfig*, EGLint, EGLint*)
-EGL_ENTRY(EGLBoolean, eglChooseConfig, EGLDisplay, const EGLint *, EGLConfig *, EGLint, EGLint *)
-
-EGL_ENTRY(EGLBoolean, eglGetConfigAttrib, EGLDisplay, EGLConfig, EGLint, EGLint *)
-EGL_ENTRY(EGLSurface, eglCreateWindowSurface, EGLDisplay, EGLConfig, NativeWindowType, const EGLint *)
-EGL_ENTRY(EGLSurface, eglCreatePixmapSurface, EGLDisplay, EGLConfig, NativePixmapType, const EGLint *)
-EGL_ENTRY(EGLSurface, eglCreatePbufferSurface, EGLDisplay, EGLConfig, const EGLint *)
-EGL_ENTRY(EGLBoolean, eglDestroySurface, EGLDisplay, EGLSurface)
-EGL_ENTRY(EGLBoolean, eglQuerySurface, EGLDisplay, EGLSurface, EGLint, EGLint *)
-EGL_ENTRY(EGLContext, eglCreateContext, EGLDisplay, EGLConfig, EGLContext, const EGLint *)
-EGL_ENTRY(EGLBoolean, eglDestroyContext, EGLDisplay, EGLContext)
-EGL_ENTRY(EGLBoolean, eglMakeCurrent, EGLDisplay, EGLSurface, EGLSurface, EGLContext)
-EGL_ENTRY(EGLContext, eglGetCurrentContext, void)
-EGL_ENTRY(EGLSurface, eglGetCurrentSurface, EGLint)
-EGL_ENTRY(EGLDisplay, eglGetCurrentDisplay, void)
-EGL_ENTRY(EGLBoolean, eglQueryContext, EGLDisplay, EGLContext, EGLint, EGLint *)
-EGL_ENTRY(EGLBoolean, eglWaitGL, void)
-EGL_ENTRY(EGLBoolean, eglWaitNative, EGLint)
-EGL_ENTRY(EGLBoolean, eglSwapBuffers, EGLDisplay, EGLSurface)
-EGL_ENTRY(EGLBoolean, eglCopyBuffers, EGLDisplay, EGLSurface, NativePixmapType)
-EGL_ENTRY(EGLint, eglGetError, void)
-EGL_ENTRY(const char*, eglQueryString, EGLDisplay, EGLint)
-EGL_ENTRY(__eglMustCastToProperFunctionPointerType, eglGetProcAddress, const char *)
-
-/* EGL 1.1 */
-
-EGL_ENTRY(EGLBoolean, eglSurfaceAttrib, EGLDisplay, EGLSurface, EGLint, EGLint)
-EGL_ENTRY(EGLBoolean, eglBindTexImage, EGLDisplay, EGLSurface, EGLint)
-EGL_ENTRY(EGLBoolean, eglReleaseTexImage, EGLDisplay, EGLSurface, EGLint)
-EGL_ENTRY(EGLBoolean, eglSwapInterval, EGLDisplay, EGLint)
-
-/* EGL 1.2 */
-
-EGL_ENTRY(EGLBoolean, eglBindAPI, EGLenum)
-EGL_ENTRY(EGLenum, eglQueryAPI, void)
-EGL_ENTRY(EGLBoolean, eglWaitClient, void)
-EGL_ENTRY(EGLBoolean, eglReleaseThread, void)
-EGL_ENTRY(EGLSurface, eglCreatePbufferFromClientBuffer, EGLDisplay, EGLenum, EGLClientBuffer, EGLConfig, const EGLint *)
-
-/* EGL 1.3 */
-
-/* EGL 1.4 */
-
-/* EGL_EGLEXT_VERSION 3 */
-
-EGL_ENTRY(EGLBoolean, eglLockSurfaceKHR, EGLDisplay, EGLSurface, const EGLint *)
-EGL_ENTRY(EGLBoolean, eglUnlockSurfaceKHR, EGLDisplay, EGLSurface)
-EGL_ENTRY(EGLImageKHR, eglCreateImageKHR, EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, const EGLint *)
-EGL_ENTRY(EGLBoolean, eglDestroyImageKHR, EGLDisplay, EGLImageKHR)
-
-/* EGL_EGLEXT_VERSION 5 */
-
-EGL_ENTRY(EGLSyncKHR, eglCreateSyncKHR, EGLDisplay, EGLenum, const EGLint *)
-EGL_ENTRY(EGLBoolean, eglDestroySyncKHR, EGLDisplay, EGLSyncKHR)
-EGL_ENTRY(EGLint, eglClientWaitSyncKHR, EGLDisplay, EGLSyncKHR, EGLint, EGLTimeKHR)
-EGL_ENTRY(EGLBoolean, eglGetSyncAttribKHR, EGLDisplay, EGLSyncKHR, EGLint, EGLint *)
-
-/* ANDROID extensions */
-
-EGL_ENTRY(EGLBoolean, eglSetSwapRectangleANDROID, EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint)
-EGL_ENTRY(EGLClientBuffer, eglGetRenderBufferANDROID, EGLDisplay, EGLSurface)
-
-/* NVIDIA extensions */
-
-EGL_ENTRY(EGLuint64NV, eglGetSystemTimeFrequencyNV, void)
-EGL_ENTRY(EGLuint64NV, eglGetSystemTimeNV, void)
diff --git a/opengl/libs/EGL/egl_object.cpp b/opengl/libs/EGL/egl_object.cpp
deleted file mode 100644
index d0cbb31..0000000
--- a/opengl/libs/EGL/egl_object.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#include <ctype.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <utils/threads.h>
-
-#include "egl_object.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-egl_object_t::egl_object_t(egl_display_t* disp) :
- display(disp), count(1) {
- // NOTE: this does an implicit incRef
- display->addObject(this);
-}
-
-egl_object_t::~egl_object_t() {
-}
-
-void egl_object_t::terminate() {
- // this marks the object as "terminated"
- display->removeObject(this);
- if (decRef() == 1) {
- // shouldn't happen because this is called from LocalRef
- ALOGE("egl_object_t::terminate() removed the last reference!");
- }
-}
-
-void egl_object_t::destroy() {
- if (decRef() == 1) {
- delete this;
- }
-}
-
-bool egl_object_t::get(egl_display_t const* display, egl_object_t* object) {
- // used by LocalRef, this does an incRef() atomically with
- // checking that the object is valid.
- return display->getObject(object);
-}
-
-// ----------------------------------------------------------------------------
-
-egl_context_t::egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config,
- egl_connection_t const* cnx, int version) :
- egl_object_t(get_display(dpy)), dpy(dpy), context(context),
- config(config), read(0), draw(0), cnx(cnx),
- version(version)
-{
-}
-
-void egl_context_t::onLooseCurrent() {
- read = NULL;
- draw = NULL;
-}
-
-void egl_context_t::onMakeCurrent(EGLSurface draw, EGLSurface read) {
- this->read = read;
- this->draw = draw;
-
- /*
- * Here we cache the GL_EXTENSIONS string for this context and we
- * add the extensions always handled by the wrapper
- */
-
- if (gl_extensions.isEmpty()) {
- // call the implementation's glGetString(GL_EXTENSIONS)
- const char* exts = (const char *)gEGLImpl.hooks[version]->gl.glGetString(GL_EXTENSIONS);
- gl_extensions.setTo(exts);
- if (gl_extensions.find("GL_EXT_debug_marker") < 0) {
- String8 temp("GL_EXT_debug_marker ");
- temp.append(gl_extensions);
- gl_extensions.setTo(temp);
- }
- }
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
diff --git a/opengl/libs/EGL/egl_object.h b/opengl/libs/EGL/egl_object.h
deleted file mode 100644
index 4d91f54..0000000
--- a/opengl/libs/EGL/egl_object.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#ifndef ANDROID_EGL_OBJECT_H
-#define ANDROID_EGL_OBJECT_H
-
-
-#include <ctype.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <utils/threads.h>
-#include <utils/String8.h>
-
-#include <system/window.h>
-
-#include "egl_display.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-struct egl_display_t;
-
-class egl_object_t {
- egl_display_t *display;
- mutable volatile int32_t count;
-
-protected:
- virtual ~egl_object_t();
-
-public:
- egl_object_t(egl_display_t* display);
- void destroy();
-
- inline int32_t incRef() { return android_atomic_inc(&count); }
- inline int32_t decRef() { return android_atomic_dec(&count); }
- inline egl_display_t* getDisplay() const { return display; }
-
-private:
- void terminate();
- static bool get(egl_display_t const* display, egl_object_t* object);
-
-public:
- template <typename N, typename T>
- class LocalRef {
- egl_object_t* ref;
- LocalRef();
- LocalRef(const LocalRef* rhs);
- public:
- ~LocalRef();
- explicit LocalRef(egl_object_t* rhs);
- explicit LocalRef(egl_display_t const* display, T o) : ref(0) {
- egl_object_t* native = reinterpret_cast<N*>(o);
- if (o && egl_object_t::get(display, native)) {
- ref = native;
- }
- }
- inline N* get() {
- return static_cast<N*>(ref);
- }
- void acquire() const;
- void release() const;
- void terminate();
- };
- template <typename N, typename T>
- friend class LocalRef;
-};
-
-template<typename N, typename T>
-egl_object_t::LocalRef<N, T>::LocalRef(egl_object_t* rhs) : ref(rhs) {
- if (ref) {
- ref->incRef();
- }
-}
-
-template <typename N, typename T>
-egl_object_t::LocalRef<N,T>::~LocalRef() {
- if (ref) {
- ref->destroy();
- }
-}
-
-template <typename N, typename T>
-void egl_object_t::LocalRef<N,T>::acquire() const {
- if (ref) {
- ref->incRef();
- }
-}
-
-template <typename N, typename T>
-void egl_object_t::LocalRef<N,T>::release() const {
- if (ref) {
- if (ref->decRef() == 1) {
- // shouldn't happen because this is called from LocalRef
- ALOGE("LocalRef::release() removed the last reference!");
- }
- }
-}
-
-template <typename N, typename T>
-void egl_object_t::LocalRef<N,T>::terminate() {
- if (ref) {
- ref->terminate();
- }
-}
-
-// ----------------------------------------------------------------------------
-
-class egl_surface_t : public egl_object_t {
-protected:
- ~egl_surface_t() {
- ANativeWindow* const window = win.get();
- if (window != NULL) {
- native_window_set_buffers_format(window, 0);
- if (native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL)) {
- ALOGW("EGLNativeWindowType %p disconnect failed", window);
- }
- }
- }
-public:
- typedef egl_object_t::LocalRef<egl_surface_t, EGLSurface> Ref;
-
- egl_surface_t(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win,
- EGLSurface surface, egl_connection_t const* cnx) :
- egl_object_t(get_display(dpy)), dpy(dpy), surface(surface),
- config(config), win(win), cnx(cnx) {
- }
- EGLDisplay dpy;
- EGLSurface surface;
- EGLConfig config;
- sp<ANativeWindow> win;
- egl_connection_t const* cnx;
-};
-
-class egl_context_t: public egl_object_t {
-protected:
- ~egl_context_t() {}
-public:
- typedef egl_object_t::LocalRef<egl_context_t, EGLContext> Ref;
-
- egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config,
- egl_connection_t const* cnx, int version);
-
- void onLooseCurrent();
- void onMakeCurrent(EGLSurface draw, EGLSurface read);
-
- EGLDisplay dpy;
- EGLContext context;
- EGLConfig config;
- EGLSurface read;
- EGLSurface draw;
- egl_connection_t const* cnx;
- int version;
- String8 gl_extensions;
-};
-
-// ----------------------------------------------------------------------------
-
-typedef egl_surface_t::Ref SurfaceRef;
-typedef egl_context_t::Ref ContextRef;
-
-// ----------------------------------------------------------------------------
-
-template<typename NATIVE, typename EGL>
-static inline NATIVE* egl_to_native_cast(EGL arg) {
- return reinterpret_cast<NATIVE*>(arg);
-}
-
-static inline
-egl_surface_t* get_surface(EGLSurface surface) {
- return egl_to_native_cast<egl_surface_t>(surface);
-}
-
-static inline
-egl_context_t* get_context(EGLContext context) {
- return egl_to_native_cast<egl_context_t>(context);
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif // ANDROID_EGL_OBJECT_H
diff --git a/opengl/libs/EGL/egl_tls.cpp b/opengl/libs/EGL/egl_tls.cpp
deleted file mode 100644
index 41cfae1..0000000
--- a/opengl/libs/EGL/egl_tls.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#include <stdlib.h>
-#include <pthread.h>
-
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-#include <utils/CallStack.h>
-
-#include <EGL/egl.h>
-
-#include "egl_tls.h"
-
-
-namespace android {
-
-pthread_key_t egl_tls_t::sKey = -1;
-pthread_mutex_t egl_tls_t::sLockKey = PTHREAD_MUTEX_INITIALIZER;
-
-egl_tls_t::egl_tls_t()
- : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE) {
-}
-
-const char *egl_tls_t::egl_strerror(EGLint err) {
- switch (err) {
- case EGL_SUCCESS: return "EGL_SUCCESS";
- case EGL_NOT_INITIALIZED: return "EGL_NOT_INITIALIZED";
- case EGL_BAD_ACCESS: return "EGL_BAD_ACCESS";
- case EGL_BAD_ALLOC: return "EGL_BAD_ALLOC";
- case EGL_BAD_ATTRIBUTE: return "EGL_BAD_ATTRIBUTE";
- case EGL_BAD_CONFIG: return "EGL_BAD_CONFIG";
- case EGL_BAD_CONTEXT: return "EGL_BAD_CONTEXT";
- case EGL_BAD_CURRENT_SURFACE: return "EGL_BAD_CURRENT_SURFACE";
- case EGL_BAD_DISPLAY: return "EGL_BAD_DISPLAY";
- case EGL_BAD_MATCH: return "EGL_BAD_MATCH";
- case EGL_BAD_NATIVE_PIXMAP: return "EGL_BAD_NATIVE_PIXMAP";
- case EGL_BAD_NATIVE_WINDOW: return "EGL_BAD_NATIVE_WINDOW";
- case EGL_BAD_PARAMETER: return "EGL_BAD_PARAMETER";
- case EGL_BAD_SURFACE: return "EGL_BAD_SURFACE";
- case EGL_CONTEXT_LOST: return "EGL_CONTEXT_LOST";
- default: return "UNKNOWN";
- }
-}
-
-void egl_tls_t::validateTLSKey()
-{
- if (sKey == -1) {
- pthread_mutex_lock(&sLockKey);
- if (sKey == -1)
- pthread_key_create(&sKey, NULL);
- pthread_mutex_unlock(&sLockKey);
- }
-}
-
-void egl_tls_t::setErrorEtcImpl(
- const char* caller, int line, EGLint error, bool quiet) {
- validateTLSKey();
- egl_tls_t* tls = getTLS();
- if (tls->error != error) {
- if (!quiet) {
- ALOGE("%s:%d error %x (%s)",
- caller, line, error, egl_strerror(error));
- char value[PROPERTY_VALUE_MAX];
- property_get("debug.egl.callstack", value, "0");
- if (atoi(value)) {
- CallStack stack;
- stack.update();
- stack.dump();
- }
- }
- tls->error = error;
- }
-}
-
-bool egl_tls_t::logNoContextCall() {
- egl_tls_t* tls = getTLS();
- if (tls->logCallWithNoContext == true) {
- tls->logCallWithNoContext = false;
- return true;
- }
- return false;
-}
-
-egl_tls_t* egl_tls_t::getTLS() {
- egl_tls_t* tls = (egl_tls_t*)pthread_getspecific(sKey);
- if (tls == 0) {
- tls = new egl_tls_t;
- pthread_setspecific(sKey, tls);
- }
- return tls;
-}
-
-void egl_tls_t::clearTLS() {
- if (sKey != -1) {
- egl_tls_t* tls = (egl_tls_t*)pthread_getspecific(sKey);
- if (tls) {
- delete tls;
- pthread_setspecific(sKey, 0);
- }
- }
-}
-
-void egl_tls_t::clearError() {
- // This must clear the error from all the underlying EGL implementations as
- // well as the EGL wrapper layer.
- eglGetError();
-}
-
-EGLint egl_tls_t::getError() {
- if (sKey == -1)
- return EGL_SUCCESS;
- egl_tls_t* tls = (egl_tls_t*)pthread_getspecific(sKey);
- if (!tls) return EGL_SUCCESS;
- EGLint error = tls->error;
- tls->error = EGL_SUCCESS;
- return error;
-}
-
-void egl_tls_t::setContext(EGLContext ctx) {
- validateTLSKey();
- getTLS()->ctx = ctx;
-}
-
-EGLContext egl_tls_t::getContext() {
- if (sKey == -1)
- return EGL_NO_CONTEXT;
- egl_tls_t* tls = (egl_tls_t *)pthread_getspecific(sKey);
- if (!tls) return EGL_NO_CONTEXT;
- return tls->ctx;
-}
-
-
-} // namespace android
diff --git a/opengl/libs/EGL/egl_tls.h b/opengl/libs/EGL/egl_tls.h
deleted file mode 100644
index 2442ca0..0000000
--- a/opengl/libs/EGL/egl_tls.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#ifndef ANDROID_EGL_TLS_H
-#define ANDROID_EGL_TLS_H
-
-#include <pthread.h>
-
-#include <EGL/egl.h>
-
-#include "egldefs.h"
-#include "hooks.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-class DbgContext;
-
-class egl_tls_t {
- static pthread_key_t sKey;
- static pthread_mutex_t sLockKey;
-
- EGLint error;
- EGLContext ctx;
- EGLBoolean logCallWithNoContext;
-
- egl_tls_t();
- static void validateTLSKey();
- static void setErrorEtcImpl(
- const char* caller, int line, EGLint error, bool quiet);
-
-public:
- static egl_tls_t* getTLS();
- static void clearTLS();
- static void clearError();
- static EGLint getError();
- static void setContext(EGLContext ctx);
- static EGLContext getContext();
- static bool logNoContextCall();
- static const char *egl_strerror(EGLint err);
-
- template<typename T>
- static T setErrorEtc(const char* caller,
- int line, EGLint error, T returnValue, bool quiet = false) {
- setErrorEtcImpl(caller, line, error, quiet);
- return returnValue;
- }
-};
-
-#define setError(_e, _r) \
- egl_tls_t::setErrorEtc(__FUNCTION__, __LINE__, _e, _r)
-
-#define setErrorQuiet(_e, _r) \
- egl_tls_t::setErrorEtc(__FUNCTION__, __LINE__, _e, _r, true)
-
-// ----------------------------------------------------------------------------
-
-#if EGL_TRACE
-
-extern gl_hooks_t const* getGLTraceThreadSpecific();
-
-#endif
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif // ANDROID_EGL_TLS_H
diff --git a/opengl/libs/EGL/egldefs.h b/opengl/libs/EGL/egldefs.h
deleted file mode 100644
index c900c1c..0000000
--- a/opengl/libs/EGL/egldefs.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#ifndef ANDROID_EGLDEFS_H
-#define ANDROID_EGLDEFS_H
-
-#include "hooks.h"
-
-#define VERSION_MAJOR 1
-#define VERSION_MINOR 4
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-// EGLDisplay are global, not attached to a given thread
-const unsigned int NUM_DISPLAYS = 1;
-
-// ----------------------------------------------------------------------------
-
-struct egl_connection_t {
- enum {
- GLESv1_INDEX = 0,
- GLESv2_INDEX = 1
- };
-
- inline egl_connection_t() : dso(0) { }
- void * dso;
- gl_hooks_t * hooks[2];
- EGLint major;
- EGLint minor;
- egl_t egl;
-};
-
-// ----------------------------------------------------------------------------
-
-extern gl_hooks_t gHooks[2];
-extern gl_hooks_t gHooksNoContext;
-extern pthread_key_t gGLWrapperKey;
-extern "C" void gl_unimplemented();
-extern "C" void gl_noop();
-
-extern char const * const gl_names[];
-extern char const * const egl_names[];
-
-extern egl_connection_t gEGLImpl;
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif /* ANDROID_EGLDEFS_H */
diff --git a/opengl/libs/EGL/getProcAddress.cpp b/opengl/libs/EGL/getProcAddress.cpp
deleted file mode 100644
index 8dcf38d..0000000
--- a/opengl/libs/EGL/getProcAddress.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- ** Copyright 2009, 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.
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <cutils/log.h>
-
-#include "egldefs.h"
-#include "hooks.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-#undef API_ENTRY
-#undef CALL_GL_EXTENSION_API
-#undef GL_EXTENSION
-#undef GL_EXTENSION_NAME
-#undef GL_EXTENSION_ARRAY
-#undef GL_EXTENSION_LIST
-#undef GET_TLS
-
-#if USE_FAST_TLS_KEY
-
- #ifdef HAVE_ARM_TLS_REGISTER
- #define GET_TLS(reg) \
- "mrc p15, 0, " #reg ", c13, c0, 3 \n"
- #else
- #define GET_TLS(reg) \
- "mov " #reg ", #0xFFFF0FFF \n" \
- "ldr " #reg ", [" #reg ", #-15] \n"
- #endif
-
- #define API_ENTRY(_api) __attribute__((naked)) _api
-
- #define CALL_GL_EXTENSION_API(_api) \
- asm volatile( \
- GET_TLS(r12) \
- "ldr r12, [r12, %[tls]] \n" \
- "cmp r12, #0 \n" \
- "ldrne r12, [r12, %[api]] \n" \
- "cmpne r12, #0 \n" \
- "bxne r12 \n" \
- "bx lr \n" \
- : \
- : [tls] "J"(TLS_SLOT_OPENGL_API*4), \
- [api] "J"(__builtin_offsetof(gl_hooks_t, \
- ext.extensions[_api])) \
- : \
- );
-
- #define GL_EXTENSION_NAME(_n) __glExtFwd##_n
-
- #define GL_EXTENSION(_n) \
- void API_ENTRY(GL_EXTENSION_NAME(_n))() { \
- CALL_GL_EXTENSION_API(_n); \
- }
-
-
-#else
-
- #define GL_EXTENSION_NAME(_n) NULL
-
- #define GL_EXTENSION(_n)
-
- #warning "eglGetProcAddress() partially supported"
-
-#endif
-
-
-#define GL_EXTENSION_LIST(name) \
- name(0) name(1) name(2) name(3) name(4) name(5) name(6) name(7) \
- name(8) name(9) name(10) name(11) name(12) name(13) name(14) name(15) \
- name(16) name(17) name(18) name(19) name(20) name(21) name(22) name(23) \
- name(24) name(25) name(26) name(27) name(28) name(29) name(30) name(31) \
- name(32) name(33) name(34) name(35) name(36) name(37) name(38) name(39) \
- name(40) name(41) name(42) name(43) name(44) name(45) name(46) name(47) \
- name(48) name(49) name(50) name(51) name(52) name(53) name(54) name(55) \
- name(56) name(57) name(58) name(59) name(60) name(61) name(62) name(63) \
- name(64) name(65) name(66) name(67) name(68) name(69) name(70) name(71) \
- name(72) name(73) name(74) name(75) name(76) name(77) name(78) name(79) \
- name(80) name(81) name(82) name(83) name(84) name(85) name(86) name(87) \
- name(88) name(89) name(90) name(91) name(92) name(93) name(94) name(95) \
- name(96) name(97) name(98) name(99) \
- name(100) name(101) name(102) name(103) name(104) name(105) name(106) name(107) \
- name(108) name(109) name(110) name(111) name(112) name(113) name(114) name(115) \
- name(116) name(117) name(118) name(119) name(120) name(121) name(122) name(123) \
- name(124) name(125) name(126) name(127) name(128) name(129) name(130) name(131) \
- name(132) name(133) name(134) name(135) name(136) name(137) name(138) name(139) \
- name(140) name(141) name(142) name(143) name(144) name(145) name(146) name(147) \
- name(148) name(149) name(150) name(151) name(152) name(153) name(154) name(155) \
- name(156) name(157) name(158) name(159) name(160) name(161) name(162) name(163) \
- name(164) name(165) name(166) name(167) name(168) name(169) name(170) name(171) \
- name(172) name(173) name(174) name(175) name(176) name(177) name(178) name(179) \
- name(180) name(181) name(182) name(183) name(184) name(185) name(186) name(187) \
- name(188) name(189) name(190) name(191) name(192) name(193) name(194) name(195) \
- name(196) name(197) name(198) name(199) \
- name(200) name(201) name(202) name(203) name(204) name(205) name(206) name(207) \
- name(208) name(209) name(210) name(211) name(212) name(213) name(214) name(215) \
- name(216) name(217) name(218) name(219) name(220) name(221) name(222) name(223) \
- name(224) name(225) name(226) name(227) name(228) name(229) name(230) name(231) \
- name(232) name(233) name(234) name(235) name(236) name(237) name(238) name(239) \
- name(240) name(241) name(242) name(243) name(244) name(245) name(246) name(247) \
- name(248) name(249) name(250) name(251) name(252) name(253) name(254) name(255)
-
-
-GL_EXTENSION_LIST( GL_EXTENSION )
-
-#define GL_EXTENSION_ARRAY(_n) GL_EXTENSION_NAME(_n),
-
-extern const __eglMustCastToProperFunctionPointerType gExtensionForwarders[MAX_NUMBER_OF_GL_EXTENSIONS] = {
- GL_EXTENSION_LIST( GL_EXTENSION_ARRAY )
- };
-
-#undef GET_TLS
-#undef GL_EXTENSION_LIST
-#undef GL_EXTENSION_ARRAY
-#undef GL_EXTENSION_NAME
-#undef GL_EXTENSION
-#undef API_ENTRY
-#undef CALL_GL_EXTENSION_API
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
diff --git a/opengl/libs/EGL/trace.cpp b/opengl/libs/EGL/trace.cpp
deleted file mode 100644
index 52907c1..0000000
--- a/opengl/libs/EGL/trace.cpp
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- ** Copyright 2010, 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.
- */
-
-#if EGL_TRACE
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <cutils/log.h>
-
-#include "egl_tls.h"
-#include "hooks.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-struct GLenumString {
- GLenum e;
- const char* s;
-};
-
-#undef GL_ENUM
-#define GL_ENUM(VAL,NAME) {VAL, #NAME},
-
-static GLenumString g_enumnames[] = {
-#include "enums.in"
-};
-#undef GL_ENUM
-
-static int compareGLEnum(const void* a, const void* b) {
- return ((const GLenumString*) a)->e - ((const GLenumString*) b)->e;
-}
-
-static const char* GLEnumToString(GLenum e) {
- GLenumString key = {e, ""};
- const GLenumString* result = (const GLenumString*) bsearch(
- &key, g_enumnames,
- sizeof(g_enumnames) / sizeof(g_enumnames[0]),
- sizeof(g_enumnames[0]), compareGLEnum);
- if (result) {
- return result->s;
- }
- return NULL;
-}
-
-static const char* GLbooleanToString(GLboolean arg) {
- return arg ? "GL_TRUE" : "GL_FALSE";
-}
-
-static GLenumString g_bitfieldNames[] = {
- {0x00004000, "GL_COLOR_BUFFER_BIT"},
- {0x00000400, "GL_STENCIL_BUFFER_BIT"},
- {0x00000100, "GL_DEPTH_BUFFER_BIT"}
-};
-
-class StringBuilder {
- static const int lineSize = 500;
- char line[lineSize];
- int line_index;
-public:
- StringBuilder() {
- line_index = 0;
- line[0] = '\0';
- }
- void append(const char* fmt, ...) {
- va_list argp;
- va_start(argp, fmt);
- line_index += vsnprintf(line + line_index, lineSize-line_index, fmt, argp);
- va_end(argp);
- }
- const char* getString() {
- line_index = 0;
- line[lineSize-1] = '\0';
- return line;
- }
-};
-
-
-static void TraceGLShaderSource(GLuint shader, GLsizei count,
- const GLchar** string, const GLint* length) {
- ALOGD("const char* shaderSrc[] = {");
- for (GLsizei i = 0; i < count; i++) {
- const char* comma = i < count-1 ? "," : "";
- const GLchar* s = string[i];
- if (length) {
- GLint len = length[i];
- ALOGD(" \"%*s\"%s", len, s, comma);
- } else {
- ALOGD(" \"%s\"%s", s, comma);
- }
- }
- ALOGD("};");
- if (length) {
- ALOGD("const GLint* shaderLength[] = {");
- for (GLsizei i = 0; i < count; i++) {
- const char* comma = i < count-1 ? "," : "";
- GLint len = length[i];
- ALOGD(" \"%d\"%s", len, comma);
- }
- ALOGD("};");
- ALOGD("glShaderSource(%u, %u, shaderSrc, shaderLength);",
- shader, count);
- } else {
- ALOGD("glShaderSource(%u, %u, shaderSrc, (const GLint*) 0);",
- shader, count);
- }
-}
-
-static void TraceValue(int elementCount, char type,
- GLsizei chunkCount, GLsizei chunkSize, const void* value) {
- StringBuilder stringBuilder;
- GLsizei count = chunkCount * chunkSize;
- bool isFloat = type == 'f';
- const char* typeString = isFloat ? "GLfloat" : "GLint";
- ALOGD("const %s value[] = {", typeString);
- for (GLsizei i = 0; i < count; i++) {
- StringBuilder builder;
- builder.append(" ");
- for (int e = 0; e < elementCount; e++) {
- const char* comma = ", ";
- if (e == elementCount-1) {
- if (i == count - 1) {
- comma = "";
- } else {
- comma = ",";
- }
- }
- if (isFloat) {
- builder.append("%g%s", * (GLfloat*) value, comma);
- value = (void*) (((GLfloat*) value) + 1);
- } else {
- builder.append("%d%s", * (GLint*) value, comma);
- value = (void*) (((GLint*) value) + 1);
- }
- }
- ALOGD("%s", builder.getString());
- if (chunkSize > 1 && i < count-1
- && (i % chunkSize) == (chunkSize-1)) {
- ALOGD("%s", ""); // Print a blank line.
- }
- }
- ALOGD("};");
-}
-
-static void TraceUniformv(int elementCount, char type,
- GLuint location, GLsizei count, const void* value) {
- TraceValue(elementCount, type, count, 1, value);
- ALOGD("glUniform%d%c(%u, %u, value);", elementCount, type, location, count);
-}
-
-static void TraceUniformMatrix(int matrixSideLength,
- GLuint location, GLsizei count, GLboolean transpose, const void* value) {
- TraceValue(matrixSideLength, 'f', count, matrixSideLength, value);
- ALOGD("glUniformMatrix%dfv(%u, %u, %s, value);", matrixSideLength, location, count,
- GLbooleanToString(transpose));
-}
-
-static void TraceGL(const char* name, int numArgs, ...) {
- va_list argp;
- va_start(argp, numArgs);
- int nameLen = strlen(name);
-
- // glShaderSource
- if (nameLen == 14 && strcmp(name, "glShaderSource") == 0) {
- va_arg(argp, const char*);
- GLuint shader = va_arg(argp, GLuint);
- va_arg(argp, const char*);
- GLsizei count = va_arg(argp, GLsizei);
- va_arg(argp, const char*);
- const GLchar** string = (const GLchar**) va_arg(argp, void*);
- va_arg(argp, const char*);
- const GLint* length = (const GLint*) va_arg(argp, void*);
- va_end(argp);
- TraceGLShaderSource(shader, count, string, length);
- return;
- }
-
- // glUniformXXv
-
- if (nameLen == 12 && strncmp(name, "glUniform", 9) == 0 && name[11] == 'v') {
- int elementCount = name[9] - '0'; // 1..4
- char type = name[10]; // 'f' or 'i'
- va_arg(argp, const char*);
- GLuint location = va_arg(argp, GLuint);
- va_arg(argp, const char*);
- GLsizei count = va_arg(argp, GLsizei);
- va_arg(argp, const char*);
- const void* value = (const void*) va_arg(argp, void*);
- va_end(argp);
- TraceUniformv(elementCount, type, location, count, value);
- return;
- }
-
- // glUniformMatrixXfv
-
- if (nameLen == 18 && strncmp(name, "glUniformMatrix", 15) == 0
- && name[16] == 'f' && name[17] == 'v') {
- int matrixSideLength = name[15] - '0'; // 2..4
- va_arg(argp, const char*);
- GLuint location = va_arg(argp, GLuint);
- va_arg(argp, const char*);
- GLsizei count = va_arg(argp, GLsizei);
- va_arg(argp, const char*);
- GLboolean transpose = (GLboolean) va_arg(argp, int);
- va_arg(argp, const char*);
- const void* value = (const void*) va_arg(argp, void*);
- va_end(argp);
- TraceUniformMatrix(matrixSideLength, location, count, transpose, value);
- return;
- }
-
- StringBuilder builder;
- builder.append("%s(", name);
- for (int i = 0; i < numArgs; i++) {
- if (i > 0) {
- builder.append(", ");
- }
- const char* type = va_arg(argp, const char*);
- bool isPtr = type[strlen(type)-1] == '*'
- || strcmp(type, "GLeglImageOES") == 0;
- if (isPtr) {
- const void* arg = va_arg(argp, const void*);
- builder.append("(%s) 0x%08x", type, (size_t) arg);
- } else if (strcmp(type, "GLbitfield") == 0) {
- size_t arg = va_arg(argp, size_t);
- bool first = true;
- for (size_t i = 0; i < sizeof(g_bitfieldNames) / sizeof(g_bitfieldNames[0]); i++) {
- const GLenumString* b = &g_bitfieldNames[i];
- if (b->e & arg) {
- if (first) {
- first = false;
- } else {
- builder.append(" | ");
- }
- builder.append("%s", b->s);
- arg &= ~b->e;
- }
- }
- if (first || arg != 0) {
- if (!first) {
- builder.append(" | ");
- }
- builder.append("0x%08x", arg);
- }
- } else if (strcmp(type, "GLboolean") == 0) {
- GLboolean arg = va_arg(argp, int);
- builder.append("%s", GLbooleanToString(arg));
- } else if (strcmp(type, "GLclampf") == 0) {
- double arg = va_arg(argp, double);
- builder.append("%g", arg);
- } else if (strcmp(type, "GLenum") == 0) {
- GLenum arg = va_arg(argp, int);
- const char* s = GLEnumToString(arg);
- if (s) {
- builder.append("%s", s);
- } else {
- builder.append("0x%x", arg);
- }
- } else if (strcmp(type, "GLfixed") == 0) {
- int arg = va_arg(argp, int);
- builder.append("0x%08x", arg);
- } else if (strcmp(type, "GLfloat") == 0) {
- double arg = va_arg(argp, double);
- builder.append("%g", arg);
- } else if (strcmp(type, "GLint") == 0) {
- int arg = va_arg(argp, int);
- const char* s = NULL;
- if (strcmp(name, "glTexParameteri") == 0) {
- s = GLEnumToString(arg);
- }
- if (s) {
- builder.append("%s", s);
- } else {
- builder.append("%d", arg);
- }
- } else if (strcmp(type, "GLintptr") == 0) {
- int arg = va_arg(argp, unsigned int);
- builder.append("%u", arg);
- } else if (strcmp(type, "GLsizei") == 0) {
- int arg = va_arg(argp, size_t);
- builder.append("%u", arg);
- } else if (strcmp(type, "GLsizeiptr") == 0) {
- int arg = va_arg(argp, size_t);
- builder.append("%u", arg);
- } else if (strcmp(type, "GLuint") == 0) {
- int arg = va_arg(argp, unsigned int);
- builder.append("%u", arg);
- } else {
- builder.append("/* ??? %s */", type);
- break;
- }
- }
- builder.append(");");
- ALOGD("%s", builder.getString());
- va_end(argp);
-}
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-#define TRACE_GL_VOID(_api, _args, _argList, ...) \
-static void Tracing_ ## _api _args { \
- TraceGL(#_api, __VA_ARGS__); \
- gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl; \
- _c->_api _argList; \
-}
-
-#define TRACE_GL(_type, _api, _args, _argList, ...) \
-static _type Tracing_ ## _api _args { \
- TraceGL(#_api, __VA_ARGS__); \
- gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl; \
- return _c->_api _argList; \
-}
-
-extern "C" {
-#include "../trace.in"
-}
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-#define GL_ENTRY(_r, _api, ...) Tracing_ ## _api,
-EGLAPI gl_hooks_t gHooksTrace = {
- {
- #include "entries.in"
- },
- {
- {0}
- }
-};
-#undef GL_ENTRY
-
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-// define the ES 1.0 Debug_gl* functions as Tracing_gl functions
-#define TRACE_GL_VOID(_api, _args, _argList, ...) \
-static void Debug_ ## _api _args { \
- TraceGL(#_api, __VA_ARGS__); \
- gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl; \
- _c->_api _argList; \
-}
-
-#define TRACE_GL(_type, _api, _args, _argList, ...) \
-static _type Debug_ ## _api _args { \
- TraceGL(#_api, __VA_ARGS__); \
- gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl; \
- return _c->_api _argList; \
-}
-
-extern "C" {
-#include "../debug.in"
-}
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif // EGL_TRACE
diff --git a/opengl/libs/ETC1/etc1.cpp b/opengl/libs/ETC1/etc1.cpp
deleted file mode 100644
index 97d1085..0000000
--- a/opengl/libs/ETC1/etc1.cpp
+++ /dev/null
@@ -1,670 +0,0 @@
-// Copyright 2009 Google Inc.
-//
-// 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.
-
-#include <ETC1/etc1.h>
-
-#include <string.h>
-
-/* From http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt
-
- The number of bits that represent a 4x4 texel block is 64 bits if
- <internalformat> is given by ETC1_RGB8_OES.
-
- The data for a block is a number of bytes,
-
- {q0, q1, q2, q3, q4, q5, q6, q7}
-
- where byte q0 is located at the lowest memory address and q7 at
- the highest. The 64 bits specifying the block is then represented
- by the following 64 bit integer:
-
- int64bit = 256*(256*(256*(256*(256*(256*(256*q0+q1)+q2)+q3)+q4)+q5)+q6)+q7;
-
- ETC1_RGB8_OES:
-
- a) bit layout in bits 63 through 32 if diffbit = 0
-
- 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48
- -----------------------------------------------
- | base col1 | base col2 | base col1 | base col2 |
- | R1 (4bits)| R2 (4bits)| G1 (4bits)| G2 (4bits)|
- -----------------------------------------------
-
- 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
- ---------------------------------------------------
- | base col1 | base col2 | table | table |diff|flip|
- | B1 (4bits)| B2 (4bits)| cw 1 | cw 2 |bit |bit |
- ---------------------------------------------------
-
-
- b) bit layout in bits 63 through 32 if diffbit = 1
-
- 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48
- -----------------------------------------------
- | base col1 | dcol 2 | base col1 | dcol 2 |
- | R1' (5 bits) | dR2 | G1' (5 bits) | dG2 |
- -----------------------------------------------
-
- 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
- ---------------------------------------------------
- | base col 1 | dcol 2 | table | table |diff|flip|
- | B1' (5 bits) | dB2 | cw 1 | cw 2 |bit |bit |
- ---------------------------------------------------
-
-
- c) bit layout in bits 31 through 0 (in both cases)
-
- 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
- -----------------------------------------------
- | most significant pixel index bits |
- | p| o| n| m| l| k| j| i| h| g| f| e| d| c| b| a|
- -----------------------------------------------
-
- 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
- --------------------------------------------------
- | least significant pixel index bits |
- | p| o| n| m| l| k| j| i| h| g| f| e| d| c | b | a |
- --------------------------------------------------
-
-
- Add table 3.17.2: Intensity modifier sets for ETC1 compressed textures:
-
- table codeword modifier table
- ------------------ ----------------------
- 0 -8 -2 2 8
- 1 -17 -5 5 17
- 2 -29 -9 9 29
- 3 -42 -13 13 42
- 4 -60 -18 18 60
- 5 -80 -24 24 80
- 6 -106 -33 33 106
- 7 -183 -47 47 183
-
-
- Add table 3.17.3 Mapping from pixel index values to modifier values for
- ETC1 compressed textures:
-
- pixel index value
- ---------------
- msb lsb resulting modifier value
- ----- ----- -------------------------
- 1 1 -b (large negative value)
- 1 0 -a (small negative value)
- 0 0 a (small positive value)
- 0 1 b (large positive value)
-
-
- */
-
-static const int kModifierTable[] = {
-/* 0 */2, 8, -2, -8,
-/* 1 */5, 17, -5, -17,
-/* 2 */9, 29, -9, -29,
-/* 3 */13, 42, -13, -42,
-/* 4 */18, 60, -18, -60,
-/* 5 */24, 80, -24, -80,
-/* 6 */33, 106, -33, -106,
-/* 7 */47, 183, -47, -183 };
-
-static const int kLookup[8] = { 0, 1, 2, 3, -4, -3, -2, -1 };
-
-static inline etc1_byte clamp(int x) {
- return (etc1_byte) (x >= 0 ? (x < 255 ? x : 255) : 0);
-}
-
-static
-inline int convert4To8(int b) {
- int c = b & 0xf;
- return (c << 4) | c;
-}
-
-static
-inline int convert5To8(int b) {
- int c = b & 0x1f;
- return (c << 3) | (c >> 2);
-}
-
-static
-inline int convert6To8(int b) {
- int c = b & 0x3f;
- return (c << 2) | (c >> 4);
-}
-
-static
-inline int divideBy255(int d) {
- return (d + 128 + (d >> 8)) >> 8;
-}
-
-static
-inline int convert8To4(int b) {
- int c = b & 0xff;
- return divideBy255(c * 15);
-}
-
-static
-inline int convert8To5(int b) {
- int c = b & 0xff;
- return divideBy255(c * 31);
-}
-
-static
-inline int convertDiff(int base, int diff) {
- return convert5To8((0x1f & base) + kLookup[0x7 & diff]);
-}
-
-static
-void decode_subblock(etc1_byte* pOut, int r, int g, int b, const int* table,
- etc1_uint32 low, bool second, bool flipped) {
- int baseX = 0;
- int baseY = 0;
- if (second) {
- if (flipped) {
- baseY = 2;
- } else {
- baseX = 2;
- }
- }
- for (int i = 0; i < 8; i++) {
- int x, y;
- if (flipped) {
- x = baseX + (i >> 1);
- y = baseY + (i & 1);
- } else {
- x = baseX + (i >> 2);
- y = baseY + (i & 3);
- }
- int k = y + (x * 4);
- int offset = ((low >> k) & 1) | ((low >> (k + 15)) & 2);
- int delta = table[offset];
- etc1_byte* q = pOut + 3 * (x + 4 * y);
- *q++ = clamp(r + delta);
- *q++ = clamp(g + delta);
- *q++ = clamp(b + delta);
- }
-}
-
-// Input is an ETC1 compressed version of the data.
-// Output is a 4 x 4 square of 3-byte pixels in form R, G, B
-
-void etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut) {
- etc1_uint32 high = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
- etc1_uint32 low = (pIn[4] << 24) | (pIn[5] << 16) | (pIn[6] << 8) | pIn[7];
- int r1, r2, g1, g2, b1, b2;
- if (high & 2) {
- // differential
- int rBase = high >> 27;
- int gBase = high >> 19;
- int bBase = high >> 11;
- r1 = convert5To8(rBase);
- r2 = convertDiff(rBase, high >> 24);
- g1 = convert5To8(gBase);
- g2 = convertDiff(gBase, high >> 16);
- b1 = convert5To8(bBase);
- b2 = convertDiff(bBase, high >> 8);
- } else {
- // not differential
- r1 = convert4To8(high >> 28);
- r2 = convert4To8(high >> 24);
- g1 = convert4To8(high >> 20);
- g2 = convert4To8(high >> 16);
- b1 = convert4To8(high >> 12);
- b2 = convert4To8(high >> 8);
- }
- int tableIndexA = 7 & (high >> 5);
- int tableIndexB = 7 & (high >> 2);
- const int* tableA = kModifierTable + tableIndexA * 4;
- const int* tableB = kModifierTable + tableIndexB * 4;
- bool flipped = (high & 1) != 0;
- decode_subblock(pOut, r1, g1, b1, tableA, low, false, flipped);
- decode_subblock(pOut, r2, g2, b2, tableB, low, true, flipped);
-}
-
-typedef struct {
- etc1_uint32 high;
- etc1_uint32 low;
- etc1_uint32 score; // Lower is more accurate
-} etc_compressed;
-
-static
-inline void take_best(etc_compressed* a, const etc_compressed* b) {
- if (a->score > b->score) {
- *a = *b;
- }
-}
-
-static
-void etc_average_colors_subblock(const etc1_byte* pIn, etc1_uint32 inMask,
- etc1_byte* pColors, bool flipped, bool second) {
- int r = 0;
- int g = 0;
- int b = 0;
-
- if (flipped) {
- int by = 0;
- if (second) {
- by = 2;
- }
- for (int y = 0; y < 2; y++) {
- int yy = by + y;
- for (int x = 0; x < 4; x++) {
- int i = x + 4 * yy;
- if (inMask & (1 << i)) {
- const etc1_byte* p = pIn + i * 3;
- r += *(p++);
- g += *(p++);
- b += *(p++);
- }
- }
- }
- } else {
- int bx = 0;
- if (second) {
- bx = 2;
- }
- for (int y = 0; y < 4; y++) {
- for (int x = 0; x < 2; x++) {
- int xx = bx + x;
- int i = xx + 4 * y;
- if (inMask & (1 << i)) {
- const etc1_byte* p = pIn + i * 3;
- r += *(p++);
- g += *(p++);
- b += *(p++);
- }
- }
- }
- }
- pColors[0] = (etc1_byte)((r + 4) >> 3);
- pColors[1] = (etc1_byte)((g + 4) >> 3);
- pColors[2] = (etc1_byte)((b + 4) >> 3);
-}
-
-static
-inline int square(int x) {
- return x * x;
-}
-
-static etc1_uint32 chooseModifier(const etc1_byte* pBaseColors,
- const etc1_byte* pIn, etc1_uint32 *pLow, int bitIndex,
- const int* pModifierTable) {
- etc1_uint32 bestScore = ~0;
- int bestIndex = 0;
- int pixelR = pIn[0];
- int pixelG = pIn[1];
- int pixelB = pIn[2];
- int r = pBaseColors[0];
- int g = pBaseColors[1];
- int b = pBaseColors[2];
- for (int i = 0; i < 4; i++) {
- int modifier = pModifierTable[i];
- int decodedG = clamp(g + modifier);
- etc1_uint32 score = (etc1_uint32) (6 * square(decodedG - pixelG));
- if (score >= bestScore) {
- continue;
- }
- int decodedR = clamp(r + modifier);
- score += (etc1_uint32) (3 * square(decodedR - pixelR));
- if (score >= bestScore) {
- continue;
- }
- int decodedB = clamp(b + modifier);
- score += (etc1_uint32) square(decodedB - pixelB);
- if (score < bestScore) {
- bestScore = score;
- bestIndex = i;
- }
- }
- etc1_uint32 lowMask = (((bestIndex >> 1) << 16) | (bestIndex & 1))
- << bitIndex;
- *pLow |= lowMask;
- return bestScore;
-}
-
-static
-void etc_encode_subblock_helper(const etc1_byte* pIn, etc1_uint32 inMask,
- etc_compressed* pCompressed, bool flipped, bool second,
- const etc1_byte* pBaseColors, const int* pModifierTable) {
- int score = pCompressed->score;
- if (flipped) {
- int by = 0;
- if (second) {
- by = 2;
- }
- for (int y = 0; y < 2; y++) {
- int yy = by + y;
- for (int x = 0; x < 4; x++) {
- int i = x + 4 * yy;
- if (inMask & (1 << i)) {
- score += chooseModifier(pBaseColors, pIn + i * 3,
- &pCompressed->low, yy + x * 4, pModifierTable);
- }
- }
- }
- } else {
- int bx = 0;
- if (second) {
- bx = 2;
- }
- for (int y = 0; y < 4; y++) {
- for (int x = 0; x < 2; x++) {
- int xx = bx + x;
- int i = xx + 4 * y;
- if (inMask & (1 << i)) {
- score += chooseModifier(pBaseColors, pIn + i * 3,
- &pCompressed->low, y + xx * 4, pModifierTable);
- }
- }
- }
- }
- pCompressed->score = score;
-}
-
-static bool inRange4bitSigned(int color) {
- return color >= -4 && color <= 3;
-}
-
-static void etc_encodeBaseColors(etc1_byte* pBaseColors,
- const etc1_byte* pColors, etc_compressed* pCompressed) {
- int r1, g1, b1, r2, g2, b2; // 8 bit base colors for sub-blocks
- bool differential;
- {
- int r51 = convert8To5(pColors[0]);
- int g51 = convert8To5(pColors[1]);
- int b51 = convert8To5(pColors[2]);
- int r52 = convert8To5(pColors[3]);
- int g52 = convert8To5(pColors[4]);
- int b52 = convert8To5(pColors[5]);
-
- r1 = convert5To8(r51);
- g1 = convert5To8(g51);
- b1 = convert5To8(b51);
-
- int dr = r52 - r51;
- int dg = g52 - g51;
- int db = b52 - b51;
-
- differential = inRange4bitSigned(dr) && inRange4bitSigned(dg)
- && inRange4bitSigned(db);
- if (differential) {
- r2 = convert5To8(r51 + dr);
- g2 = convert5To8(g51 + dg);
- b2 = convert5To8(b51 + db);
- pCompressed->high |= (r51 << 27) | ((7 & dr) << 24) | (g51 << 19)
- | ((7 & dg) << 16) | (b51 << 11) | ((7 & db) << 8) | 2;
- }
- }
-
- if (!differential) {
- int r41 = convert8To4(pColors[0]);
- int g41 = convert8To4(pColors[1]);
- int b41 = convert8To4(pColors[2]);
- int r42 = convert8To4(pColors[3]);
- int g42 = convert8To4(pColors[4]);
- int b42 = convert8To4(pColors[5]);
- r1 = convert4To8(r41);
- g1 = convert4To8(g41);
- b1 = convert4To8(b41);
- r2 = convert4To8(r42);
- g2 = convert4To8(g42);
- b2 = convert4To8(b42);
- pCompressed->high |= (r41 << 28) | (r42 << 24) | (g41 << 20) | (g42
- << 16) | (b41 << 12) | (b42 << 8);
- }
- pBaseColors[0] = r1;
- pBaseColors[1] = g1;
- pBaseColors[2] = b1;
- pBaseColors[3] = r2;
- pBaseColors[4] = g2;
- pBaseColors[5] = b2;
-}
-
-static
-void etc_encode_block_helper(const etc1_byte* pIn, etc1_uint32 inMask,
- const etc1_byte* pColors, etc_compressed* pCompressed, bool flipped) {
- pCompressed->score = ~0;
- pCompressed->high = (flipped ? 1 : 0);
- pCompressed->low = 0;
-
- etc1_byte pBaseColors[6];
-
- etc_encodeBaseColors(pBaseColors, pColors, pCompressed);
-
- int originalHigh = pCompressed->high;
-
- const int* pModifierTable = kModifierTable;
- for (int i = 0; i < 8; i++, pModifierTable += 4) {
- etc_compressed temp;
- temp.score = 0;
- temp.high = originalHigh | (i << 5);
- temp.low = 0;
- etc_encode_subblock_helper(pIn, inMask, &temp, flipped, false,
- pBaseColors, pModifierTable);
- take_best(pCompressed, &temp);
- }
- pModifierTable = kModifierTable;
- etc_compressed firstHalf = *pCompressed;
- for (int i = 0; i < 8; i++, pModifierTable += 4) {
- etc_compressed temp;
- temp.score = firstHalf.score;
- temp.high = firstHalf.high | (i << 2);
- temp.low = firstHalf.low;
- etc_encode_subblock_helper(pIn, inMask, &temp, flipped, true,
- pBaseColors + 3, pModifierTable);
- if (i == 0) {
- *pCompressed = temp;
- } else {
- take_best(pCompressed, &temp);
- }
- }
-}
-
-static void writeBigEndian(etc1_byte* pOut, etc1_uint32 d) {
- pOut[0] = (etc1_byte)(d >> 24);
- pOut[1] = (etc1_byte)(d >> 16);
- pOut[2] = (etc1_byte)(d >> 8);
- pOut[3] = (etc1_byte) d;
-}
-
-// Input is a 4 x 4 square of 3-byte pixels in form R, G, B
-// inmask is a 16-bit mask where bit (1 << (x + y * 4)) tells whether the corresponding (x,y)
-// pixel is valid or not. Invalid pixel color values are ignored when compressing.
-// Output is an ETC1 compressed version of the data.
-
-void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 inMask,
- etc1_byte* pOut) {
- etc1_byte colors[6];
- etc1_byte flippedColors[6];
- etc_average_colors_subblock(pIn, inMask, colors, false, false);
- etc_average_colors_subblock(pIn, inMask, colors + 3, false, true);
- etc_average_colors_subblock(pIn, inMask, flippedColors, true, false);
- etc_average_colors_subblock(pIn, inMask, flippedColors + 3, true, true);
-
- etc_compressed a, b;
- etc_encode_block_helper(pIn, inMask, colors, &a, false);
- etc_encode_block_helper(pIn, inMask, flippedColors, &b, true);
- take_best(&a, &b);
- writeBigEndian(pOut, a.high);
- writeBigEndian(pOut + 4, a.low);
-}
-
-// Return the size of the encoded image data (does not include size of PKM header).
-
-etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height) {
- return (((width + 3) & ~3) * ((height + 3) & ~3)) >> 1;
-}
-
-// Encode an entire image.
-// pIn - pointer to the image data. Formatted such that the Red component of
-// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset;
-// pOut - pointer to encoded data. Must be large enough to store entire encoded image.
-
-int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height,
- etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut) {
- if (pixelSize < 2 || pixelSize > 3) {
- return -1;
- }
- static const unsigned short kYMask[] = { 0x0, 0xf, 0xff, 0xfff, 0xffff };
- static const unsigned short kXMask[] = { 0x0, 0x1111, 0x3333, 0x7777,
- 0xffff };
- etc1_byte block[ETC1_DECODED_BLOCK_SIZE];
- etc1_byte encoded[ETC1_ENCODED_BLOCK_SIZE];
-
- etc1_uint32 encodedWidth = (width + 3) & ~3;
- etc1_uint32 encodedHeight = (height + 3) & ~3;
-
- for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {
- etc1_uint32 yEnd = height - y;
- if (yEnd > 4) {
- yEnd = 4;
- }
- int ymask = kYMask[yEnd];
- for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {
- etc1_uint32 xEnd = width - x;
- if (xEnd > 4) {
- xEnd = 4;
- }
- int mask = ymask & kXMask[xEnd];
- for (etc1_uint32 cy = 0; cy < yEnd; cy++) {
- etc1_byte* q = block + (cy * 4) * 3;
- const etc1_byte* p = pIn + pixelSize * x + stride * (y + cy);
- if (pixelSize == 3) {
- memcpy(q, p, xEnd * 3);
- } else {
- for (etc1_uint32 cx = 0; cx < xEnd; cx++) {
- int pixel = (p[1] << 8) | p[0];
- *q++ = convert5To8(pixel >> 11);
- *q++ = convert6To8(pixel >> 5);
- *q++ = convert5To8(pixel);
- p += pixelSize;
- }
- }
- }
- etc1_encode_block(block, mask, encoded);
- memcpy(pOut, encoded, sizeof(encoded));
- pOut += sizeof(encoded);
- }
- }
- return 0;
-}
-
-// Decode an entire image.
-// pIn - pointer to encoded data.
-// pOut - pointer to the image data. Will be written such that the Red component of
-// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset. Must be
-// large enough to store entire image.
-
-
-int etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut,
- etc1_uint32 width, etc1_uint32 height,
- etc1_uint32 pixelSize, etc1_uint32 stride) {
- if (pixelSize < 2 || pixelSize > 3) {
- return -1;
- }
- etc1_byte block[ETC1_DECODED_BLOCK_SIZE];
-
- etc1_uint32 encodedWidth = (width + 3) & ~3;
- etc1_uint32 encodedHeight = (height + 3) & ~3;
-
- for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {
- etc1_uint32 yEnd = height - y;
- if (yEnd > 4) {
- yEnd = 4;
- }
- for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {
- etc1_uint32 xEnd = width - x;
- if (xEnd > 4) {
- xEnd = 4;
- }
- etc1_decode_block(pIn, block);
- pIn += ETC1_ENCODED_BLOCK_SIZE;
- for (etc1_uint32 cy = 0; cy < yEnd; cy++) {
- const etc1_byte* q = block + (cy * 4) * 3;
- etc1_byte* p = pOut + pixelSize * x + stride * (y + cy);
- if (pixelSize == 3) {
- memcpy(p, q, xEnd * 3);
- } else {
- for (etc1_uint32 cx = 0; cx < xEnd; cx++) {
- etc1_byte r = *q++;
- etc1_byte g = *q++;
- etc1_byte b = *q++;
- etc1_uint32 pixel = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
- *p++ = (etc1_byte) pixel;
- *p++ = (etc1_byte) (pixel >> 8);
- }
- }
- }
- }
- }
- return 0;
-}
-
-static const char kMagic[] = { 'P', 'K', 'M', ' ', '1', '0' };
-
-static const etc1_uint32 ETC1_PKM_FORMAT_OFFSET = 6;
-static const etc1_uint32 ETC1_PKM_ENCODED_WIDTH_OFFSET = 8;
-static const etc1_uint32 ETC1_PKM_ENCODED_HEIGHT_OFFSET = 10;
-static const etc1_uint32 ETC1_PKM_WIDTH_OFFSET = 12;
-static const etc1_uint32 ETC1_PKM_HEIGHT_OFFSET = 14;
-
-static const etc1_uint32 ETC1_RGB_NO_MIPMAPS = 0;
-
-static void writeBEUint16(etc1_byte* pOut, etc1_uint32 data) {
- pOut[0] = (etc1_byte) (data >> 8);
- pOut[1] = (etc1_byte) data;
-}
-
-static etc1_uint32 readBEUint16(const etc1_byte* pIn) {
- return (pIn[0] << 8) | pIn[1];
-}
-
-// Format a PKM header
-
-void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height) {
- memcpy(pHeader, kMagic, sizeof(kMagic));
- etc1_uint32 encodedWidth = (width + 3) & ~3;
- etc1_uint32 encodedHeight = (height + 3) & ~3;
- writeBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET, ETC1_RGB_NO_MIPMAPS);
- writeBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET, encodedWidth);
- writeBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET, encodedHeight);
- writeBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET, width);
- writeBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET, height);
-}
-
-// Check if a PKM header is correctly formatted.
-
-etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader) {
- if (memcmp(pHeader, kMagic, sizeof(kMagic))) {
- return false;
- }
- etc1_uint32 format = readBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET);
- etc1_uint32 encodedWidth = readBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET);
- etc1_uint32 encodedHeight = readBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET);
- etc1_uint32 width = readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET);
- etc1_uint32 height = readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET);
- return format == ETC1_RGB_NO_MIPMAPS &&
- encodedWidth >= width && encodedWidth - width < 4 &&
- encodedHeight >= height && encodedHeight - height < 4;
-}
-
-// Read the image width from a PKM header
-
-etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader) {
- return readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET);
-}
-
-// Read the image height from a PKM header
-
-etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader){
- return readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET);
-}
diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
deleted file mode 100644
index 4345c2b..0000000
--- a/opengl/libs/GLES2/gl2.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/ioctl.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-#include "hooks.h"
-#include "egl_impl.h"
-
-using namespace android;
-
-// ----------------------------------------------------------------------------
-// Actual GL entry-points
-// ----------------------------------------------------------------------------
-
-#undef API_ENTRY
-#undef CALL_GL_API
-#undef CALL_GL_API_RETURN
-
-#define DEBUG_CALL_GL_API 0
-
-#if USE_FAST_TLS_KEY
-
- #ifdef HAVE_ARM_TLS_REGISTER
- #define GET_TLS(reg) \
- "mrc p15, 0, " #reg ", c13, c0, 3 \n"
- #else
- #define GET_TLS(reg) \
- "mov " #reg ", #0xFFFF0FFF \n" \
- "ldr " #reg ", [" #reg ", #-15] \n"
- #endif
-
- #define API_ENTRY(_api) __attribute__((naked)) _api
-
- #define CALL_GL_API(_api, ...) \
- asm volatile( \
- GET_TLS(r12) \
- "ldr r12, [r12, %[tls]] \n" \
- "cmp r12, #0 \n" \
- "ldrne pc, [r12, %[api]] \n" \
- "mov r0, #0 \n" \
- "bx lr \n" \
- : \
- : [tls] "J"(TLS_SLOT_OPENGL_API*4), \
- [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \
- : \
- );
-
- #define CALL_GL_API_RETURN(_api, ...) \
- CALL_GL_API(_api, __VA_ARGS__) \
- return 0; // placate gcc's warnings. never reached.
-
-#else
-
- #define API_ENTRY(_api) _api
-
-#if DEBUG_CALL_GL_API
-
- #define CALL_GL_API(_api, ...) \
- gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
- _c->_api(__VA_ARGS__); \
- GLenum status = GL_NO_ERROR; \
- while ((status = glGetError()) != GL_NO_ERROR) { \
- ALOGD("[" #_api "] 0x%x", status); \
- }
-
-#else
-
- #define CALL_GL_API(_api, ...) \
- gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
- _c->_api(__VA_ARGS__);
-
-#endif
-
- #define CALL_GL_API_RETURN(_api, ...) \
- gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
- return _c->_api(__VA_ARGS__)
-
-#endif
-
-
-extern "C" {
-#include "gl2_api.in"
-#include "gl2ext_api.in"
-}
-
-#undef API_ENTRY
-#undef CALL_GL_API
-#undef CALL_GL_API_RETURN
-
-/*
- * glGetString() is special because we expose some extensions in the wrapper
- */
-
-extern "C" const GLubyte * __glGetString(GLenum name);
-
-const GLubyte * glGetString(GLenum name)
-{
- const GLubyte * ret = egl_get_string_for_current_context(name);
- if (ret == NULL) {
- ret = __glGetString(name);
- }
- return ret;
-}
diff --git a/opengl/libs/GLES2/gl2_api.in b/opengl/libs/GLES2/gl2_api.in
deleted file mode 100644
index 9a89a52..0000000
--- a/opengl/libs/GLES2/gl2_api.in
+++ /dev/null
@@ -1,426 +0,0 @@
-void API_ENTRY(glActiveTexture)(GLenum texture) {
- CALL_GL_API(glActiveTexture, texture);
-}
-void API_ENTRY(glAttachShader)(GLuint program, GLuint shader) {
- CALL_GL_API(glAttachShader, program, shader);
-}
-void API_ENTRY(glBindAttribLocation)(GLuint program, GLuint index, const GLchar* name) {
- CALL_GL_API(glBindAttribLocation, program, index, name);
-}
-void API_ENTRY(glBindBuffer)(GLenum target, GLuint buffer) {
- CALL_GL_API(glBindBuffer, target, buffer);
-}
-void API_ENTRY(glBindFramebuffer)(GLenum target, GLuint framebuffer) {
- CALL_GL_API(glBindFramebuffer, target, framebuffer);
-}
-void API_ENTRY(glBindRenderbuffer)(GLenum target, GLuint renderbuffer) {
- CALL_GL_API(glBindRenderbuffer, target, renderbuffer);
-}
-void API_ENTRY(glBindTexture)(GLenum target, GLuint texture) {
- CALL_GL_API(glBindTexture, target, texture);
-}
-void API_ENTRY(glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
- CALL_GL_API(glBlendColor, red, green, blue, alpha);
-}
-void API_ENTRY(glBlendEquation)( GLenum mode ) {
- CALL_GL_API(glBlendEquation, mode);
-}
-void API_ENTRY(glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) {
- CALL_GL_API(glBlendEquationSeparate, modeRGB, modeAlpha);
-}
-void API_ENTRY(glBlendFunc)(GLenum sfactor, GLenum dfactor) {
- CALL_GL_API(glBlendFunc, sfactor, dfactor);
-}
-void API_ENTRY(glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
- CALL_GL_API(glBlendFuncSeparate, srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) {
- CALL_GL_API(glBufferData, target, size, data, usage);
-}
-void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) {
- CALL_GL_API(glBufferSubData, target, offset, size, data);
-}
-GLenum API_ENTRY(glCheckFramebufferStatus)(GLenum target) {
- CALL_GL_API_RETURN(glCheckFramebufferStatus, target);
-}
-void API_ENTRY(glClear)(GLbitfield mask) {
- CALL_GL_API(glClear, mask);
-}
-void API_ENTRY(glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
- CALL_GL_API(glClearColor, red, green, blue, alpha);
-}
-void API_ENTRY(glClearDepthf)(GLclampf depth) {
- CALL_GL_API(glClearDepthf, depth);
-}
-void API_ENTRY(glClearStencil)(GLint s) {
- CALL_GL_API(glClearStencil, s);
-}
-void API_ENTRY(glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
- CALL_GL_API(glColorMask, red, green, blue, alpha);
-}
-void API_ENTRY(glCompileShader)(GLuint shader) {
- CALL_GL_API(glCompileShader, shader);
-}
-void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) {
- CALL_GL_API(glCompressedTexImage2D, target, level, internalformat, width, height, border, imageSize, data);
-}
-void API_ENTRY(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) {
- CALL_GL_API(glCompressedTexSubImage2D, target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-void API_ENTRY(glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
- CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y, width, height, border);
-}
-void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glCopyTexSubImage2D, target, level, xoffset, yoffset, x, y, width, height);
-}
-GLuint API_ENTRY(glCreateProgram)(void) {
- CALL_GL_API_RETURN(glCreateProgram);
-}
-GLuint API_ENTRY(glCreateShader)(GLenum type) {
- CALL_GL_API_RETURN(glCreateShader, type);
-}
-void API_ENTRY(glCullFace)(GLenum mode) {
- CALL_GL_API(glCullFace, mode);
-}
-void API_ENTRY(glDeleteBuffers)(GLsizei n, const GLuint* buffers) {
- CALL_GL_API(glDeleteBuffers, n, buffers);
-}
-void API_ENTRY(glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers) {
- CALL_GL_API(glDeleteFramebuffers, n, framebuffers);
-}
-void API_ENTRY(glDeleteProgram)(GLuint program) {
- CALL_GL_API(glDeleteProgram, program);
-}
-void API_ENTRY(glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers) {
- CALL_GL_API(glDeleteRenderbuffers, n, renderbuffers);
-}
-void API_ENTRY(glDeleteShader)(GLuint shader) {
- CALL_GL_API(glDeleteShader, shader);
-}
-void API_ENTRY(glDeleteTextures)(GLsizei n, const GLuint* textures) {
- CALL_GL_API(glDeleteTextures, n, textures);
-}
-void API_ENTRY(glDepthFunc)(GLenum func) {
- CALL_GL_API(glDepthFunc, func);
-}
-void API_ENTRY(glDepthMask)(GLboolean flag) {
- CALL_GL_API(glDepthMask, flag);
-}
-void API_ENTRY(glDepthRangef)(GLclampf zNear, GLclampf zFar) {
- CALL_GL_API(glDepthRangef, zNear, zFar);
-}
-void API_ENTRY(glDetachShader)(GLuint program, GLuint shader) {
- CALL_GL_API(glDetachShader, program, shader);
-}
-void API_ENTRY(glDisable)(GLenum cap) {
- CALL_GL_API(glDisable, cap);
-}
-void API_ENTRY(glDisableVertexAttribArray)(GLuint index) {
- CALL_GL_API(glDisableVertexAttribArray, index);
-}
-void API_ENTRY(glDrawArrays)(GLenum mode, GLint first, GLsizei count) {
- CALL_GL_API(glDrawArrays, mode, first, count);
-}
-void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
- CALL_GL_API(glDrawElements, mode, count, type, indices);
-}
-void API_ENTRY(glEnable)(GLenum cap) {
- CALL_GL_API(glEnable, cap);
-}
-void API_ENTRY(glEnableVertexAttribArray)(GLuint index) {
- CALL_GL_API(glEnableVertexAttribArray, index);
-}
-void API_ENTRY(glFinish)(void) {
- CALL_GL_API(glFinish);
-}
-void API_ENTRY(glFlush)(void) {
- CALL_GL_API(glFlush);
-}
-void API_ENTRY(glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
- CALL_GL_API(glFramebufferRenderbuffer, target, attachment, renderbuffertarget, renderbuffer);
-}
-void API_ENTRY(glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
- CALL_GL_API(glFramebufferTexture2D, target, attachment, textarget, texture, level);
-}
-void API_ENTRY(glFrontFace)(GLenum mode) {
- CALL_GL_API(glFrontFace, mode);
-}
-void API_ENTRY(glGenBuffers)(GLsizei n, GLuint* buffers) {
- CALL_GL_API(glGenBuffers, n, buffers);
-}
-void API_ENTRY(glGenerateMipmap)(GLenum target) {
- CALL_GL_API(glGenerateMipmap, target);
-}
-void API_ENTRY(glGenFramebuffers)(GLsizei n, GLuint* framebuffers) {
- CALL_GL_API(glGenFramebuffers, n, framebuffers);
-}
-void API_ENTRY(glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers) {
- CALL_GL_API(glGenRenderbuffers, n, renderbuffers);
-}
-void API_ENTRY(glGenTextures)(GLsizei n, GLuint* textures) {
- CALL_GL_API(glGenTextures, n, textures);
-}
-void API_ENTRY(glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
- CALL_GL_API(glGetActiveAttrib, program, index, bufsize, length, size, type, name);
-}
-void API_ENTRY(glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
- CALL_GL_API(glGetActiveUniform, program, index, bufsize, length, size, type, name);
-}
-void API_ENTRY(glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
- CALL_GL_API(glGetAttachedShaders, program, maxcount, count, shaders);
-}
-int API_ENTRY(glGetAttribLocation)(GLuint program, const GLchar* name) {
- CALL_GL_API_RETURN(glGetAttribLocation, program, name);
-}
-void API_ENTRY(glGetBooleanv)(GLenum pname, GLboolean* params) {
- CALL_GL_API(glGetBooleanv, pname, params);
-}
-void API_ENTRY(glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) {
- CALL_GL_API(glGetBufferParameteriv, target, pname, params);
-}
-GLenum API_ENTRY(glGetError)(void) {
- CALL_GL_API_RETURN(glGetError);
-}
-void API_ENTRY(glGetFloatv)(GLenum pname, GLfloat* params) {
- CALL_GL_API(glGetFloatv, pname, params);
-}
-void API_ENTRY(glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
- CALL_GL_API(glGetFramebufferAttachmentParameteriv, target, attachment, pname, params);
-}
-void API_ENTRY(glGetIntegerv)(GLenum pname, GLint* params) {
- CALL_GL_API(glGetIntegerv, pname, params);
-}
-void API_ENTRY(glGetProgramiv)(GLuint program, GLenum pname, GLint* params) {
- CALL_GL_API(glGetProgramiv, program, pname, params);
-}
-void API_ENTRY(glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
- CALL_GL_API(glGetProgramInfoLog, program, bufsize, length, infolog);
-}
-void API_ENTRY(glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) {
- CALL_GL_API(glGetRenderbufferParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetShaderiv)(GLuint shader, GLenum pname, GLint* params) {
- CALL_GL_API(glGetShaderiv, shader, pname, params);
-}
-void API_ENTRY(glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
- CALL_GL_API(glGetShaderInfoLog, shader, bufsize, length, infolog);
-}
-void API_ENTRY(glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
- CALL_GL_API(glGetShaderPrecisionFormat, shadertype, precisiontype, range, precision);
-}
-void API_ENTRY(glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) {
- CALL_GL_API(glGetShaderSource, shader, bufsize, length, source);
-}
-const GLubyte* API_ENTRY(__glGetString)(GLenum name) {
- CALL_GL_API_RETURN(glGetString, name);
-}
-void API_ENTRY(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) {
- CALL_GL_API(glGetTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params) {
- CALL_GL_API(glGetTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetUniformfv)(GLuint program, GLint location, GLfloat* params) {
- CALL_GL_API(glGetUniformfv, program, location, params);
-}
-void API_ENTRY(glGetUniformiv)(GLuint program, GLint location, GLint* params) {
- CALL_GL_API(glGetUniformiv, program, location, params);
-}
-int API_ENTRY(glGetUniformLocation)(GLuint program, const GLchar* name) {
- CALL_GL_API_RETURN(glGetUniformLocation, program, name);
-}
-void API_ENTRY(glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) {
- CALL_GL_API(glGetVertexAttribfv, index, pname, params);
-}
-void API_ENTRY(glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) {
- CALL_GL_API(glGetVertexAttribiv, index, pname, params);
-}
-void API_ENTRY(glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid** pointer) {
- CALL_GL_API(glGetVertexAttribPointerv, index, pname, pointer);
-}
-void API_ENTRY(glHint)(GLenum target, GLenum mode) {
- CALL_GL_API(glHint, target, mode);
-}
-GLboolean API_ENTRY(glIsBuffer)(GLuint buffer) {
- CALL_GL_API_RETURN(glIsBuffer, buffer);
-}
-GLboolean API_ENTRY(glIsEnabled)(GLenum cap) {
- CALL_GL_API_RETURN(glIsEnabled, cap);
-}
-GLboolean API_ENTRY(glIsFramebuffer)(GLuint framebuffer) {
- CALL_GL_API_RETURN(glIsFramebuffer, framebuffer);
-}
-GLboolean API_ENTRY(glIsProgram)(GLuint program) {
- CALL_GL_API_RETURN(glIsProgram, program);
-}
-GLboolean API_ENTRY(glIsRenderbuffer)(GLuint renderbuffer) {
- CALL_GL_API_RETURN(glIsRenderbuffer, renderbuffer);
-}
-GLboolean API_ENTRY(glIsShader)(GLuint shader) {
- CALL_GL_API_RETURN(glIsShader, shader);
-}
-GLboolean API_ENTRY(glIsTexture)(GLuint texture) {
- CALL_GL_API_RETURN(glIsTexture, texture);
-}
-void API_ENTRY(glLineWidth)(GLfloat width) {
- CALL_GL_API(glLineWidth, width);
-}
-void API_ENTRY(glLinkProgram)(GLuint program) {
- CALL_GL_API(glLinkProgram, program);
-}
-void API_ENTRY(glPixelStorei)(GLenum pname, GLint param) {
- CALL_GL_API(glPixelStorei, pname, param);
-}
-void API_ENTRY(glPolygonOffset)(GLfloat factor, GLfloat units) {
- CALL_GL_API(glPolygonOffset, factor, units);
-}
-void API_ENTRY(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) {
- CALL_GL_API(glReadPixels, x, y, width, height, format, type, pixels);
-}
-void API_ENTRY(glReleaseShaderCompiler)(void) {
- CALL_GL_API(glReleaseShaderCompiler);
-}
-void API_ENTRY(glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorage, target, internalformat, width, height);
-}
-void API_ENTRY(glSampleCoverage)(GLclampf value, GLboolean invert) {
- CALL_GL_API(glSampleCoverage, value, invert);
-}
-void API_ENTRY(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glScissor, x, y, width, height);
-}
-void API_ENTRY(glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) {
- CALL_GL_API(glShaderBinary, n, shaders, binaryformat, binary, length);
-}
-void API_ENTRY(glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) {
- CALL_GL_API(glShaderSource, shader, count, string, length);
-}
-void API_ENTRY(glStencilFunc)(GLenum func, GLint ref, GLuint mask) {
- CALL_GL_API(glStencilFunc, func, ref, mask);
-}
-void API_ENTRY(glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) {
- CALL_GL_API(glStencilFuncSeparate, face, func, ref, mask);
-}
-void API_ENTRY(glStencilMask)(GLuint mask) {
- CALL_GL_API(glStencilMask, mask);
-}
-void API_ENTRY(glStencilMaskSeparate)(GLenum face, GLuint mask) {
- CALL_GL_API(glStencilMaskSeparate, face, mask);
-}
-void API_ENTRY(glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) {
- CALL_GL_API(glStencilOp, fail, zfail, zpass);
-}
-void API_ENTRY(glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
- CALL_GL_API(glStencilOpSeparate, face, fail, zfail, zpass);
-}
-void API_ENTRY(glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
- CALL_GL_API(glTexImage2D, target, level, internalformat, width, height, border, format, type, pixels);
-}
-void API_ENTRY(glTexParameterf)(GLenum target, GLenum pname, GLfloat param) {
- CALL_GL_API(glTexParameterf, target, pname, param);
-}
-void API_ENTRY(glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) {
- CALL_GL_API(glTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glTexParameteri)(GLenum target, GLenum pname, GLint param) {
- CALL_GL_API(glTexParameteri, target, pname, param);
-}
-void API_ENTRY(glTexParameteriv)(GLenum target, GLenum pname, const GLint* params) {
- CALL_GL_API(glTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) {
- CALL_GL_API(glTexSubImage2D, target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-void API_ENTRY(glUniform1f)(GLint location, GLfloat x) {
- CALL_GL_API(glUniform1f, location, x);
-}
-void API_ENTRY(glUniform1fv)(GLint location, GLsizei count, const GLfloat* v) {
- CALL_GL_API(glUniform1fv, location, count, v);
-}
-void API_ENTRY(glUniform1i)(GLint location, GLint x) {
- CALL_GL_API(glUniform1i, location, x);
-}
-void API_ENTRY(glUniform1iv)(GLint location, GLsizei count, const GLint* v) {
- CALL_GL_API(glUniform1iv, location, count, v);
-}
-void API_ENTRY(glUniform2f)(GLint location, GLfloat x, GLfloat y) {
- CALL_GL_API(glUniform2f, location, x, y);
-}
-void API_ENTRY(glUniform2fv)(GLint location, GLsizei count, const GLfloat* v) {
- CALL_GL_API(glUniform2fv, location, count, v);
-}
-void API_ENTRY(glUniform2i)(GLint location, GLint x, GLint y) {
- CALL_GL_API(glUniform2i, location, x, y);
-}
-void API_ENTRY(glUniform2iv)(GLint location, GLsizei count, const GLint* v) {
- CALL_GL_API(glUniform2iv, location, count, v);
-}
-void API_ENTRY(glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z) {
- CALL_GL_API(glUniform3f, location, x, y, z);
-}
-void API_ENTRY(glUniform3fv)(GLint location, GLsizei count, const GLfloat* v) {
- CALL_GL_API(glUniform3fv, location, count, v);
-}
-void API_ENTRY(glUniform3i)(GLint location, GLint x, GLint y, GLint z) {
- CALL_GL_API(glUniform3i, location, x, y, z);
-}
-void API_ENTRY(glUniform3iv)(GLint location, GLsizei count, const GLint* v) {
- CALL_GL_API(glUniform3iv, location, count, v);
-}
-void API_ENTRY(glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
- CALL_GL_API(glUniform4f, location, x, y, z, w);
-}
-void API_ENTRY(glUniform4fv)(GLint location, GLsizei count, const GLfloat* v) {
- CALL_GL_API(glUniform4fv, location, count, v);
-}
-void API_ENTRY(glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w) {
- CALL_GL_API(glUniform4i, location, x, y, z, w);
-}
-void API_ENTRY(glUniform4iv)(GLint location, GLsizei count, const GLint* v) {
- CALL_GL_API(glUniform4iv, location, count, v);
-}
-void API_ENTRY(glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
- CALL_GL_API(glUniformMatrix2fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
- CALL_GL_API(glUniformMatrix3fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
- CALL_GL_API(glUniformMatrix4fv, location, count, transpose, value);
-}
-void API_ENTRY(glUseProgram)(GLuint program) {
- CALL_GL_API(glUseProgram, program);
-}
-void API_ENTRY(glValidateProgram)(GLuint program) {
- CALL_GL_API(glValidateProgram, program);
-}
-void API_ENTRY(glVertexAttrib1f)(GLuint indx, GLfloat x) {
- CALL_GL_API(glVertexAttrib1f, indx, x);
-}
-void API_ENTRY(glVertexAttrib1fv)(GLuint indx, const GLfloat* values) {
- CALL_GL_API(glVertexAttrib1fv, indx, values);
-}
-void API_ENTRY(glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y) {
- CALL_GL_API(glVertexAttrib2f, indx, x, y);
-}
-void API_ENTRY(glVertexAttrib2fv)(GLuint indx, const GLfloat* values) {
- CALL_GL_API(glVertexAttrib2fv, indx, values);
-}
-void API_ENTRY(glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
- CALL_GL_API(glVertexAttrib3f, indx, x, y, z);
-}
-void API_ENTRY(glVertexAttrib3fv)(GLuint indx, const GLfloat* values) {
- CALL_GL_API(glVertexAttrib3fv, indx, values);
-}
-void API_ENTRY(glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
- CALL_GL_API(glVertexAttrib4f, indx, x, y, z, w);
-}
-void API_ENTRY(glVertexAttrib4fv)(GLuint indx, const GLfloat* values) {
- CALL_GL_API(glVertexAttrib4fv, indx, values);
-}
-void API_ENTRY(glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) {
- CALL_GL_API(glVertexAttribPointer, indx, size, type, normalized, stride, ptr);
-}
-void API_ENTRY(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glViewport, x, y, width, height);
-}
diff --git a/opengl/libs/GLES2/gl2ext_api.in b/opengl/libs/GLES2/gl2ext_api.in
deleted file mode 100644
index c381075..0000000
--- a/opengl/libs/GLES2/gl2ext_api.in
+++ /dev/null
@@ -1,363 +0,0 @@
-void API_ENTRY(glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image) {
- CALL_GL_API(glEGLImageTargetTexture2DOES, target, image);
-}
-void API_ENTRY(glEGLImageTargetRenderbufferStorageOES)(GLenum target, GLeglImageOES image) {
- CALL_GL_API(glEGLImageTargetRenderbufferStorageOES, target, image);
-}
-void API_ENTRY(glGetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary) {
- CALL_GL_API(glGetProgramBinaryOES, program, bufSize, length, binaryFormat, binary);
-}
-void API_ENTRY(glProgramBinaryOES)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length) {
- CALL_GL_API(glProgramBinaryOES, program, binaryFormat, binary, length);
-}
-void* API_ENTRY(glMapBufferOES)(GLenum target, GLenum access) {
- CALL_GL_API_RETURN(glMapBufferOES, target, access);
-}
-GLboolean API_ENTRY(glUnmapBufferOES)(GLenum target) {
- CALL_GL_API_RETURN(glUnmapBufferOES, target);
-}
-void API_ENTRY(glGetBufferPointervOES)(GLenum target, GLenum pname, GLvoid** params) {
- CALL_GL_API(glGetBufferPointervOES, target, pname, params);
-}
-void API_ENTRY(glTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
- CALL_GL_API(glTexImage3DOES, target, level, internalformat, width, height, depth, border, format, type, pixels);
-}
-void API_ENTRY(glTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels) {
- CALL_GL_API(glTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-}
-void API_ENTRY(glCopyTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glCopyTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, x, y, width, height);
-}
-void API_ENTRY(glCompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data) {
- CALL_GL_API(glCompressedTexImage3DOES, target, level, internalformat, width, height, depth, border, imageSize, data);
-}
-void API_ENTRY(glCompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data) {
- CALL_GL_API(glCompressedTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
-}
-void API_ENTRY(glFramebufferTexture3DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
- CALL_GL_API(glFramebufferTexture3DOES, target, attachment, textarget, texture, level, zoffset);
-}
-void API_ENTRY(glBindVertexArrayOES)(GLuint array) {
- CALL_GL_API(glBindVertexArrayOES, array);
-}
-void API_ENTRY(glDeleteVertexArraysOES)(GLsizei n, const GLuint *arrays) {
- CALL_GL_API(glDeleteVertexArraysOES, n, arrays);
-}
-void API_ENTRY(glGenVertexArraysOES)(GLsizei n, GLuint *arrays) {
- CALL_GL_API(glGenVertexArraysOES, n, arrays);
-}
-GLboolean API_ENTRY(glIsVertexArrayOES)(GLuint array) {
- CALL_GL_API_RETURN(glIsVertexArrayOES, array);
-}
-void API_ENTRY(glGetPerfMonitorGroupsAMD)(GLint *numGroups, GLsizei groupsSize, GLuint *groups) {
- CALL_GL_API(glGetPerfMonitorGroupsAMD, numGroups, groupsSize, groups);
-}
-void API_ENTRY(glGetPerfMonitorCountersAMD)(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters) {
- CALL_GL_API(glGetPerfMonitorCountersAMD, group, numCounters, maxActiveCounters, counterSize, counters);
-}
-void API_ENTRY(glGetPerfMonitorGroupStringAMD)(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString) {
- CALL_GL_API(glGetPerfMonitorGroupStringAMD, group, bufSize, length, groupString);
-}
-void API_ENTRY(glGetPerfMonitorCounterStringAMD)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString) {
- CALL_GL_API(glGetPerfMonitorCounterStringAMD, group, counter, bufSize, length, counterString);
-}
-void API_ENTRY(glGetPerfMonitorCounterInfoAMD)(GLuint group, GLuint counter, GLenum pname, GLvoid *data) {
- CALL_GL_API(glGetPerfMonitorCounterInfoAMD, group, counter, pname, data);
-}
-void API_ENTRY(glGenPerfMonitorsAMD)(GLsizei n, GLuint *monitors) {
- CALL_GL_API(glGenPerfMonitorsAMD, n, monitors);
-}
-void API_ENTRY(glDeletePerfMonitorsAMD)(GLsizei n, GLuint *monitors) {
- CALL_GL_API(glDeletePerfMonitorsAMD, n, monitors);
-}
-void API_ENTRY(glSelectPerfMonitorCountersAMD)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList) {
- CALL_GL_API(glSelectPerfMonitorCountersAMD, monitor, enable, group, numCounters, countersList);
-}
-void API_ENTRY(glBeginPerfMonitorAMD)(GLuint monitor) {
- CALL_GL_API(glBeginPerfMonitorAMD, monitor);
-}
-void API_ENTRY(glEndPerfMonitorAMD)(GLuint monitor) {
- CALL_GL_API(glEndPerfMonitorAMD, monitor);
-}
-void API_ENTRY(glGetPerfMonitorCounterDataAMD)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) {
- CALL_GL_API(glGetPerfMonitorCounterDataAMD, monitor, pname, dataSize, data, bytesWritten);
-}
-void API_ENTRY(glBlitFramebufferANGLE)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
- CALL_GL_API(glBlitFramebufferANGLE, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-}
-void API_ENTRY(glRenderbufferStorageMultisampleANGLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageMultisampleANGLE, target, samples, internalformat, width, height);
-}
-void API_ENTRY(glRenderbufferStorageMultisampleAPPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageMultisampleAPPLE, target, samples, internalformat, width, height);
-}
-void API_ENTRY(glResolveMultisampleFramebufferAPPLE)(void) {
- CALL_GL_API(glResolveMultisampleFramebufferAPPLE);
-}
-void API_ENTRY(glLabelObjectEXT)(GLenum type, GLuint object, GLsizei length, const GLchar *label) {
- CALL_GL_API(glLabelObjectEXT, type, object, length, label);
-}
-void API_ENTRY(glGetObjectLabelEXT)(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label) {
- CALL_GL_API(glGetObjectLabelEXT, type, object, bufSize, length, label);
-}
-void API_ENTRY(glInsertEventMarkerEXT)(GLsizei length, const GLchar *marker) {
- CALL_GL_API(glInsertEventMarkerEXT, length, marker);
-}
-void API_ENTRY(glPushGroupMarkerEXT)(GLsizei length, const GLchar *marker) {
- CALL_GL_API(glPushGroupMarkerEXT, length, marker);
-}
-void API_ENTRY(glPopGroupMarkerEXT)(void) {
- CALL_GL_API(glPopGroupMarkerEXT);
-}
-void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
- CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments);
-}
-void API_ENTRY(glRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageMultisampleEXT, target, samples, internalformat, width, height);
-}
-void API_ENTRY(glFramebufferTexture2DMultisampleEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
- CALL_GL_API(glFramebufferTexture2DMultisampleEXT, target, attachment, textarget, texture, level, samples);
-}
-void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
- CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount);
-}
-void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
- CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount);
-}
-void API_ENTRY(glGenQueriesEXT)(GLsizei n, GLuint *ids) {
- CALL_GL_API(glGenQueriesEXT, n, ids);
-}
-void API_ENTRY(glDeleteQueriesEXT)(GLsizei n, const GLuint *ids) {
- CALL_GL_API(glDeleteQueriesEXT, n, ids);
-}
-GLboolean API_ENTRY(glIsQueryEXT)(GLuint id) {
- CALL_GL_API_RETURN(glIsQueryEXT, id);
-}
-void API_ENTRY(glBeginQueryEXT)(GLenum target, GLuint id) {
- CALL_GL_API(glBeginQueryEXT, target, id);
-}
-void API_ENTRY(glEndQueryEXT)(GLenum target) {
- CALL_GL_API(glEndQueryEXT, target);
-}
-void API_ENTRY(glGetQueryivEXT)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetQueryivEXT, target, pname, params);
-}
-void API_ENTRY(glGetQueryObjectuivEXT)(GLuint id, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetQueryObjectuivEXT, id, pname, params);
-}
-GLenum API_ENTRY(glGetGraphicsResetStatusEXT)(void) {
- CALL_GL_API_RETURN(glGetGraphicsResetStatusEXT);
-}
-void API_ENTRY(glReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
- CALL_GL_API(glReadnPixelsEXT, x, y, width, height, format, type, bufSize, data);
-}
-void API_ENTRY(glGetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, float *params) {
- CALL_GL_API(glGetnUniformfvEXT, program, location, bufSize, params);
-}
-void API_ENTRY(glGetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
- CALL_GL_API(glGetnUniformivEXT, program, location, bufSize, params);
-}
-void API_ENTRY(glUseProgramStagesEXT)(GLuint pipeline, GLbitfield stages, GLuint program) {
- CALL_GL_API(glUseProgramStagesEXT, pipeline, stages, program);
-}
-void API_ENTRY(glActiveShaderProgramEXT)(GLuint pipeline, GLuint program) {
- CALL_GL_API(glActiveShaderProgramEXT, pipeline, program);
-}
-GLuint API_ENTRY(glCreateShaderProgramvEXT)(GLenum type, GLsizei count, const GLchar **strings) {
- CALL_GL_API_RETURN(glCreateShaderProgramvEXT, type, count, strings);
-}
-void API_ENTRY(glBindProgramPipelineEXT)(GLuint pipeline) {
- CALL_GL_API(glBindProgramPipelineEXT, pipeline);
-}
-void API_ENTRY(glDeleteProgramPipelinesEXT)(GLsizei n, const GLuint *pipelines) {
- CALL_GL_API(glDeleteProgramPipelinesEXT, n, pipelines);
-}
-void API_ENTRY(glGenProgramPipelinesEXT)(GLsizei n, GLuint *pipelines) {
- CALL_GL_API(glGenProgramPipelinesEXT, n, pipelines);
-}
-GLboolean API_ENTRY(glIsProgramPipelineEXT)(GLuint pipeline) {
- CALL_GL_API_RETURN(glIsProgramPipelineEXT, pipeline);
-}
-void API_ENTRY(glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value) {
- CALL_GL_API(glProgramParameteriEXT, program, pname, value);
-}
-void API_ENTRY(glGetProgramPipelineivEXT)(GLuint pipeline, GLenum pname, GLint *params) {
- CALL_GL_API(glGetProgramPipelineivEXT, pipeline, pname, params);
-}
-void API_ENTRY(glProgramUniform1iEXT)(GLuint program, GLint location, GLint x) {
- CALL_GL_API(glProgramUniform1iEXT, program, location, x);
-}
-void API_ENTRY(glProgramUniform2iEXT)(GLuint program, GLint location, GLint x, GLint y) {
- CALL_GL_API(glProgramUniform2iEXT, program, location, x, y);
-}
-void API_ENTRY(glProgramUniform3iEXT)(GLuint program, GLint location, GLint x, GLint y, GLint z) {
- CALL_GL_API(glProgramUniform3iEXT, program, location, x, y, z);
-}
-void API_ENTRY(glProgramUniform4iEXT)(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) {
- CALL_GL_API(glProgramUniform4iEXT, program, location, x, y, z, w);
-}
-void API_ENTRY(glProgramUniform1fEXT)(GLuint program, GLint location, GLfloat x) {
- CALL_GL_API(glProgramUniform1fEXT, program, location, x);
-}
-void API_ENTRY(glProgramUniform2fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y) {
- CALL_GL_API(glProgramUniform2fEXT, program, location, x, y);
-}
-void API_ENTRY(glProgramUniform3fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) {
- CALL_GL_API(glProgramUniform3fEXT, program, location, x, y, z);
-}
-void API_ENTRY(glProgramUniform4fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
- CALL_GL_API(glProgramUniform4fEXT, program, location, x, y, z, w);
-}
-void API_ENTRY(glProgramUniform1ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform1ivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform2ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform2ivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform3ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform3ivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform4ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform4ivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform1fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform1fvEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform2fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform2fvEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform3fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform3fvEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform4fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform4fvEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniformMatrix2fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix2fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix3fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix3fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix4fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix4fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glValidateProgramPipelineEXT)(GLuint pipeline) {
- CALL_GL_API(glValidateProgramPipelineEXT, pipeline);
-}
-void API_ENTRY(glGetProgramPipelineInfoLogEXT)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
- CALL_GL_API(glGetProgramPipelineInfoLogEXT, pipeline, bufSize, length, infoLog);
-}
-void API_ENTRY(glTexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
- CALL_GL_API(glTexStorage1DEXT, target, levels, internalformat, width);
-}
-void API_ENTRY(glTexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glTexStorage2DEXT, target, levels, internalformat, width, height);
-}
-void API_ENTRY(glTexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
- CALL_GL_API(glTexStorage3DEXT, target, levels, internalformat, width, height, depth);
-}
-void API_ENTRY(glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
- CALL_GL_API(glTextureStorage1DEXT, texture, target, levels, internalformat, width);
-}
-void API_ENTRY(glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glTextureStorage2DEXT, texture, target, levels, internalformat, width, height);
-}
-void API_ENTRY(glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
- CALL_GL_API(glTextureStorage3DEXT, texture, target, levels, internalformat, width, height, depth);
-}
-void API_ENTRY(glRenderbufferStorageMultisampleIMG)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageMultisampleIMG, target, samples, internalformat, width, height);
-}
-void API_ENTRY(glFramebufferTexture2DMultisampleIMG)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
- CALL_GL_API(glFramebufferTexture2DMultisampleIMG, target, attachment, textarget, texture, level, samples);
-}
-void API_ENTRY(glCoverageMaskNV)(GLboolean mask) {
- CALL_GL_API(glCoverageMaskNV, mask);
-}
-void API_ENTRY(glCoverageOperationNV)(GLenum operation) {
- CALL_GL_API(glCoverageOperationNV, operation);
-}
-void API_ENTRY(glDrawBuffersNV)(GLsizei n, const GLenum *bufs) {
- CALL_GL_API(glDrawBuffersNV, n, bufs);
-}
-void API_ENTRY(glDeleteFencesNV)(GLsizei n, const GLuint *fences) {
- CALL_GL_API(glDeleteFencesNV, n, fences);
-}
-void API_ENTRY(glGenFencesNV)(GLsizei n, GLuint *fences) {
- CALL_GL_API(glGenFencesNV, n, fences);
-}
-GLboolean API_ENTRY(glIsFenceNV)(GLuint fence) {
- CALL_GL_API_RETURN(glIsFenceNV, fence);
-}
-GLboolean API_ENTRY(glTestFenceNV)(GLuint fence) {
- CALL_GL_API_RETURN(glTestFenceNV, fence);
-}
-void API_ENTRY(glGetFenceivNV)(GLuint fence, GLenum pname, GLint *params) {
- CALL_GL_API(glGetFenceivNV, fence, pname, params);
-}
-void API_ENTRY(glFinishFenceNV)(GLuint fence) {
- CALL_GL_API(glFinishFenceNV, fence);
-}
-void API_ENTRY(glSetFenceNV)(GLuint fence, GLenum condition) {
- CALL_GL_API(glSetFenceNV, fence, condition);
-}
-void API_ENTRY(glReadBufferNV)(GLenum mode) {
- CALL_GL_API(glReadBufferNV, mode);
-}
-void API_ENTRY(glAlphaFuncQCOM)(GLenum func, GLclampf ref) {
- CALL_GL_API(glAlphaFuncQCOM, func, ref);
-}
-void API_ENTRY(glGetDriverControlsQCOM)(GLint *num, GLsizei size, GLuint *driverControls) {
- CALL_GL_API(glGetDriverControlsQCOM, num, size, driverControls);
-}
-void API_ENTRY(glGetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) {
- CALL_GL_API(glGetDriverControlStringQCOM, driverControl, bufSize, length, driverControlString);
-}
-void API_ENTRY(glEnableDriverControlQCOM)(GLuint driverControl) {
- CALL_GL_API(glEnableDriverControlQCOM, driverControl);
-}
-void API_ENTRY(glDisableDriverControlQCOM)(GLuint driverControl) {
- CALL_GL_API(glDisableDriverControlQCOM, driverControl);
-}
-void API_ENTRY(glExtGetTexturesQCOM)(GLuint *textures, GLint maxTextures, GLint *numTextures) {
- CALL_GL_API(glExtGetTexturesQCOM, textures, maxTextures, numTextures);
-}
-void API_ENTRY(glExtGetBuffersQCOM)(GLuint *buffers, GLint maxBuffers, GLint *numBuffers) {
- CALL_GL_API(glExtGetBuffersQCOM, buffers, maxBuffers, numBuffers);
-}
-void API_ENTRY(glExtGetRenderbuffersQCOM)(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) {
- CALL_GL_API(glExtGetRenderbuffersQCOM, renderbuffers, maxRenderbuffers, numRenderbuffers);
-}
-void API_ENTRY(glExtGetFramebuffersQCOM)(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) {
- CALL_GL_API(glExtGetFramebuffersQCOM, framebuffers, maxFramebuffers, numFramebuffers);
-}
-void API_ENTRY(glExtGetTexLevelParameterivQCOM)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) {
- CALL_GL_API(glExtGetTexLevelParameterivQCOM, texture, face, level, pname, params);
-}
-void API_ENTRY(glExtTexObjectStateOverrideiQCOM)(GLenum target, GLenum pname, GLint param) {
- CALL_GL_API(glExtTexObjectStateOverrideiQCOM, target, pname, param);
-}
-void API_ENTRY(glExtGetTexSubImageQCOM)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels) {
- CALL_GL_API(glExtGetTexSubImageQCOM, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
-}
-void API_ENTRY(glExtGetBufferPointervQCOM)(GLenum target, GLvoid **params) {
- CALL_GL_API(glExtGetBufferPointervQCOM, target, params);
-}
-void API_ENTRY(glExtGetShadersQCOM)(GLuint *shaders, GLint maxShaders, GLint *numShaders) {
- CALL_GL_API(glExtGetShadersQCOM, shaders, maxShaders, numShaders);
-}
-void API_ENTRY(glExtGetProgramsQCOM)(GLuint *programs, GLint maxPrograms, GLint *numPrograms) {
- CALL_GL_API(glExtGetProgramsQCOM, programs, maxPrograms, numPrograms);
-}
-GLboolean API_ENTRY(glExtIsProgramBinaryQCOM)(GLuint program) {
- CALL_GL_API_RETURN(glExtIsProgramBinaryQCOM, program);
-}
-void API_ENTRY(glExtGetProgramBinarySourceQCOM)(GLuint program, GLenum shadertype, GLchar *source, GLint *length) {
- CALL_GL_API(glExtGetProgramBinarySourceQCOM, program, shadertype, source, length);
-}
-void API_ENTRY(glStartTilingQCOM)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) {
- CALL_GL_API(glStartTilingQCOM, x, y, width, height, preserveMask);
-}
-void API_ENTRY(glEndTilingQCOM)(GLbitfield preserveMask) {
- CALL_GL_API(glEndTilingQCOM, preserveMask);
-}
diff --git a/opengl/libs/GLES_CM/gl.cpp b/opengl/libs/GLES_CM/gl.cpp
deleted file mode 100644
index adcb60d..0000000
--- a/opengl/libs/GLES_CM/gl.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/ioctl.h>
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-#include "hooks.h"
-#include "egl_impl.h"
-
-using namespace android;
-
-// set this to 1 for crude GL debugging
-#define CHECK_FOR_GL_ERRORS 0
-
-// ----------------------------------------------------------------------------
-// extensions for the framework
-// ----------------------------------------------------------------------------
-
-extern "C" {
-GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
- const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-}
-
-void glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count) {
- glColorPointer(size, type, stride, ptr);
-}
-void glNormalPointerBounds(GLenum type, GLsizei stride,
- const GLvoid *pointer, GLsizei count) {
- glNormalPointer(type, stride, pointer);
-}
-void glTexCoordPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glTexCoordPointer(size, type, stride, pointer);
-}
-void glVertexPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glVertexPointer(size, type, stride, pointer);
-}
-
-void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glPointSizePointerOES(type, stride, pointer);
-}
-
-GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glMatrixIndexPointerOES(size, type, stride, pointer);
-}
-
-GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glWeightPointerOES(size, type, stride, pointer);
-}
-
-// ----------------------------------------------------------------------------
-// Actual GL entry-points
-// ----------------------------------------------------------------------------
-
-#undef API_ENTRY
-#undef CALL_GL_API
-#undef CALL_GL_API_RETURN
-
-#if USE_FAST_TLS_KEY && !CHECK_FOR_GL_ERRORS
-
- #ifdef HAVE_ARM_TLS_REGISTER
- #define GET_TLS(reg) \
- "mrc p15, 0, " #reg ", c13, c0, 3 \n"
- #else
- #define GET_TLS(reg) \
- "mov " #reg ", #0xFFFF0FFF \n" \
- "ldr " #reg ", [" #reg ", #-15] \n"
- #endif
-
- #define API_ENTRY(_api) __attribute__((naked)) _api
-
- #define CALL_GL_API(_api, ...) \
- asm volatile( \
- GET_TLS(r12) \
- "ldr r12, [r12, %[tls]] \n" \
- "cmp r12, #0 \n" \
- "ldrne pc, [r12, %[api]] \n" \
- "mov r0, #0 \n" \
- "bx lr \n" \
- : \
- : [tls] "J"(TLS_SLOT_OPENGL_API*4), \
- [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \
- : \
- );
-
- #define CALL_GL_API_RETURN(_api, ...) \
- CALL_GL_API(_api, __VA_ARGS__) \
- return 0; // placate gcc's warnings. never reached.
-
-#else
-
- #if CHECK_FOR_GL_ERRORS
-
- #define CHECK_GL_ERRORS(_api) \
- do { GLint err = glGetError(); \
- ALOGE_IF(err != GL_NO_ERROR, "%s failed (0x%04X)", #_api, err); \
- } while(false);
-
- #else
-
- #define CHECK_GL_ERRORS(_api) do { } while(false);
-
- #endif
-
-
- #define API_ENTRY(_api) _api
-
- #define CALL_GL_API(_api, ...) \
- gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
- _c->_api(__VA_ARGS__); \
- CHECK_GL_ERRORS(_api)
-
- #define CALL_GL_API_RETURN(_api, ...) \
- gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
- return _c->_api(__VA_ARGS__)
-
-#endif
-
-
-extern "C" {
-#include "gl_api.in"
-#include "glext_api.in"
-}
-
-#undef API_ENTRY
-#undef CALL_GL_API
-#undef CALL_GL_API_RETURN
-
-/*
- * glGetString() is special because we expose some extensions in the wrapper
- */
-
-extern "C" const GLubyte * __glGetString(GLenum name);
-
-const GLubyte * glGetString(GLenum name)
-{
- const GLubyte * ret = egl_get_string_for_current_context(name);
- if (ret == NULL) {
- ret = __glGetString(name);
- }
- return ret;
-}
diff --git a/opengl/libs/GLES_CM/gl_api.in b/opengl/libs/GLES_CM/gl_api.in
deleted file mode 100644
index c8f6b0c..0000000
--- a/opengl/libs/GLES_CM/gl_api.in
+++ /dev/null
@@ -1,435 +0,0 @@
-void API_ENTRY(glAlphaFunc)(GLenum func, GLclampf ref) {
- CALL_GL_API(glAlphaFunc, func, ref);
-}
-void API_ENTRY(glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
- CALL_GL_API(glClearColor, red, green, blue, alpha);
-}
-void API_ENTRY(glClearDepthf)(GLclampf depth) {
- CALL_GL_API(glClearDepthf, depth);
-}
-void API_ENTRY(glClipPlanef)(GLenum plane, const GLfloat *equation) {
- CALL_GL_API(glClipPlanef, plane, equation);
-}
-void API_ENTRY(glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
- CALL_GL_API(glColor4f, red, green, blue, alpha);
-}
-void API_ENTRY(glDepthRangef)(GLclampf zNear, GLclampf zFar) {
- CALL_GL_API(glDepthRangef, zNear, zFar);
-}
-void API_ENTRY(glFogf)(GLenum pname, GLfloat param) {
- CALL_GL_API(glFogf, pname, param);
-}
-void API_ENTRY(glFogfv)(GLenum pname, const GLfloat *params) {
- CALL_GL_API(glFogfv, pname, params);
-}
-void API_ENTRY(glFrustumf)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
- CALL_GL_API(glFrustumf, left, right, bottom, top, zNear, zFar);
-}
-void API_ENTRY(glGetClipPlanef)(GLenum pname, GLfloat eqn[4]) {
- CALL_GL_API(glGetClipPlanef, pname, eqn);
-}
-void API_ENTRY(glGetFloatv)(GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetFloatv, pname, params);
-}
-void API_ENTRY(glGetLightfv)(GLenum light, GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetLightfv, light, pname, params);
-}
-void API_ENTRY(glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetMaterialfv, face, pname, params);
-}
-void API_ENTRY(glGetTexEnvfv)(GLenum env, GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetTexEnvfv, env, pname, params);
-}
-void API_ENTRY(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glLightModelf)(GLenum pname, GLfloat param) {
- CALL_GL_API(glLightModelf, pname, param);
-}
-void API_ENTRY(glLightModelfv)(GLenum pname, const GLfloat *params) {
- CALL_GL_API(glLightModelfv, pname, params);
-}
-void API_ENTRY(glLightf)(GLenum light, GLenum pname, GLfloat param) {
- CALL_GL_API(glLightf, light, pname, param);
-}
-void API_ENTRY(glLightfv)(GLenum light, GLenum pname, const GLfloat *params) {
- CALL_GL_API(glLightfv, light, pname, params);
-}
-void API_ENTRY(glLineWidth)(GLfloat width) {
- CALL_GL_API(glLineWidth, width);
-}
-void API_ENTRY(glLoadMatrixf)(const GLfloat *m) {
- CALL_GL_API(glLoadMatrixf, m);
-}
-void API_ENTRY(glMaterialf)(GLenum face, GLenum pname, GLfloat param) {
- CALL_GL_API(glMaterialf, face, pname, param);
-}
-void API_ENTRY(glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params) {
- CALL_GL_API(glMaterialfv, face, pname, params);
-}
-void API_ENTRY(glMultMatrixf)(const GLfloat *m) {
- CALL_GL_API(glMultMatrixf, m);
-}
-void API_ENTRY(glMultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
- CALL_GL_API(glMultiTexCoord4f, target, s, t, r, q);
-}
-void API_ENTRY(glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz) {
- CALL_GL_API(glNormal3f, nx, ny, nz);
-}
-void API_ENTRY(glOrthof)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
- CALL_GL_API(glOrthof, left, right, bottom, top, zNear, zFar);
-}
-void API_ENTRY(glPointParameterf)(GLenum pname, GLfloat param) {
- CALL_GL_API(glPointParameterf, pname, param);
-}
-void API_ENTRY(glPointParameterfv)(GLenum pname, const GLfloat *params) {
- CALL_GL_API(glPointParameterfv, pname, params);
-}
-void API_ENTRY(glPointSize)(GLfloat size) {
- CALL_GL_API(glPointSize, size);
-}
-void API_ENTRY(glPolygonOffset)(GLfloat factor, GLfloat units) {
- CALL_GL_API(glPolygonOffset, factor, units);
-}
-void API_ENTRY(glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
- CALL_GL_API(glRotatef, angle, x, y, z);
-}
-void API_ENTRY(glScalef)(GLfloat x, GLfloat y, GLfloat z) {
- CALL_GL_API(glScalef, x, y, z);
-}
-void API_ENTRY(glTexEnvf)(GLenum target, GLenum pname, GLfloat param) {
- CALL_GL_API(glTexEnvf, target, pname, param);
-}
-void API_ENTRY(glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params) {
- CALL_GL_API(glTexEnvfv, target, pname, params);
-}
-void API_ENTRY(glTexParameterf)(GLenum target, GLenum pname, GLfloat param) {
- CALL_GL_API(glTexParameterf, target, pname, param);
-}
-void API_ENTRY(glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params) {
- CALL_GL_API(glTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glTranslatef)(GLfloat x, GLfloat y, GLfloat z) {
- CALL_GL_API(glTranslatef, x, y, z);
-}
-void API_ENTRY(glActiveTexture)(GLenum texture) {
- CALL_GL_API(glActiveTexture, texture);
-}
-void API_ENTRY(glAlphaFuncx)(GLenum func, GLclampx ref) {
- CALL_GL_API(glAlphaFuncx, func, ref);
-}
-void API_ENTRY(glBindBuffer)(GLenum target, GLuint buffer) {
- CALL_GL_API(glBindBuffer, target, buffer);
-}
-void API_ENTRY(glBindTexture)(GLenum target, GLuint texture) {
- CALL_GL_API(glBindTexture, target, texture);
-}
-void API_ENTRY(glBlendFunc)(GLenum sfactor, GLenum dfactor) {
- CALL_GL_API(glBlendFunc, sfactor, dfactor);
-}
-void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) {
- CALL_GL_API(glBufferData, target, size, data, usage);
-}
-void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) {
- CALL_GL_API(glBufferSubData, target, offset, size, data);
-}
-void API_ENTRY(glClear)(GLbitfield mask) {
- CALL_GL_API(glClear, mask);
-}
-void API_ENTRY(glClearColorx)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
- CALL_GL_API(glClearColorx, red, green, blue, alpha);
-}
-void API_ENTRY(glClearDepthx)(GLclampx depth) {
- CALL_GL_API(glClearDepthx, depth);
-}
-void API_ENTRY(glClearStencil)(GLint s) {
- CALL_GL_API(glClearStencil, s);
-}
-void API_ENTRY(glClientActiveTexture)(GLenum texture) {
- CALL_GL_API(glClientActiveTexture, texture);
-}
-void API_ENTRY(glClipPlanex)(GLenum plane, const GLfixed *equation) {
- CALL_GL_API(glClipPlanex, plane, equation);
-}
-void API_ENTRY(glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) {
- CALL_GL_API(glColor4ub, red, green, blue, alpha);
-}
-void API_ENTRY(glColor4x)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
- CALL_GL_API(glColor4x, red, green, blue, alpha);
-}
-void API_ENTRY(glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
- CALL_GL_API(glColorMask, red, green, blue, alpha);
-}
-void API_ENTRY(glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- CALL_GL_API(glColorPointer, size, type, stride, pointer);
-}
-void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
- CALL_GL_API(glCompressedTexImage2D, target, level, internalformat, width, height, border, imageSize, data);
-}
-void API_ENTRY(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
- CALL_GL_API(glCompressedTexSubImage2D, target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-void API_ENTRY(glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
- CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y, width, height, border);
-}
-void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glCopyTexSubImage2D, target, level, xoffset, yoffset, x, y, width, height);
-}
-void API_ENTRY(glCullFace)(GLenum mode) {
- CALL_GL_API(glCullFace, mode);
-}
-void API_ENTRY(glDeleteBuffers)(GLsizei n, const GLuint *buffers) {
- CALL_GL_API(glDeleteBuffers, n, buffers);
-}
-void API_ENTRY(glDeleteTextures)(GLsizei n, const GLuint *textures) {
- CALL_GL_API(glDeleteTextures, n, textures);
-}
-void API_ENTRY(glDepthFunc)(GLenum func) {
- CALL_GL_API(glDepthFunc, func);
-}
-void API_ENTRY(glDepthMask)(GLboolean flag) {
- CALL_GL_API(glDepthMask, flag);
-}
-void API_ENTRY(glDepthRangex)(GLclampx zNear, GLclampx zFar) {
- CALL_GL_API(glDepthRangex, zNear, zFar);
-}
-void API_ENTRY(glDisable)(GLenum cap) {
- CALL_GL_API(glDisable, cap);
-}
-void API_ENTRY(glDisableClientState)(GLenum array) {
- CALL_GL_API(glDisableClientState, array);
-}
-void API_ENTRY(glDrawArrays)(GLenum mode, GLint first, GLsizei count) {
- CALL_GL_API(glDrawArrays, mode, first, count);
-}
-void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) {
- CALL_GL_API(glDrawElements, mode, count, type, indices);
-}
-void API_ENTRY(glEnable)(GLenum cap) {
- CALL_GL_API(glEnable, cap);
-}
-void API_ENTRY(glEnableClientState)(GLenum array) {
- CALL_GL_API(glEnableClientState, array);
-}
-void API_ENTRY(glFinish)(void) {
- CALL_GL_API(glFinish);
-}
-void API_ENTRY(glFlush)(void) {
- CALL_GL_API(glFlush);
-}
-void API_ENTRY(glFogx)(GLenum pname, GLfixed param) {
- CALL_GL_API(glFogx, pname, param);
-}
-void API_ENTRY(glFogxv)(GLenum pname, const GLfixed *params) {
- CALL_GL_API(glFogxv, pname, params);
-}
-void API_ENTRY(glFrontFace)(GLenum mode) {
- CALL_GL_API(glFrontFace, mode);
-}
-void API_ENTRY(glFrustumx)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
- CALL_GL_API(glFrustumx, left, right, bottom, top, zNear, zFar);
-}
-void API_ENTRY(glGetBooleanv)(GLenum pname, GLboolean *params) {
- CALL_GL_API(glGetBooleanv, pname, params);
-}
-void API_ENTRY(glGetBufferParameteriv)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetBufferParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetClipPlanex)(GLenum pname, GLfixed eqn[4]) {
- CALL_GL_API(glGetClipPlanex, pname, eqn);
-}
-void API_ENTRY(glGenBuffers)(GLsizei n, GLuint *buffers) {
- CALL_GL_API(glGenBuffers, n, buffers);
-}
-void API_ENTRY(glGenTextures)(GLsizei n, GLuint *textures) {
- CALL_GL_API(glGenTextures, n, textures);
-}
-GLenum API_ENTRY(glGetError)(void) {
- CALL_GL_API_RETURN(glGetError);
-}
-void API_ENTRY(glGetFixedv)(GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetFixedv, pname, params);
-}
-void API_ENTRY(glGetIntegerv)(GLenum pname, GLint *params) {
- CALL_GL_API(glGetIntegerv, pname, params);
-}
-void API_ENTRY(glGetLightxv)(GLenum light, GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetLightxv, light, pname, params);
-}
-void API_ENTRY(glGetMaterialxv)(GLenum face, GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetMaterialxv, face, pname, params);
-}
-void API_ENTRY(glGetPointerv)(GLenum pname, GLvoid **params) {
- CALL_GL_API(glGetPointerv, pname, params);
-}
-const GLubyte * API_ENTRY(__glGetString)(GLenum name) {
- CALL_GL_API_RETURN(glGetString, name);
-}
-void API_ENTRY(glGetTexEnviv)(GLenum env, GLenum pname, GLint *params) {
- CALL_GL_API(glGetTexEnviv, env, pname, params);
-}
-void API_ENTRY(glGetTexEnvxv)(GLenum env, GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetTexEnvxv, env, pname, params);
-}
-void API_ENTRY(glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetTexParameterxv)(GLenum target, GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetTexParameterxv, target, pname, params);
-}
-void API_ENTRY(glHint)(GLenum target, GLenum mode) {
- CALL_GL_API(glHint, target, mode);
-}
-GLboolean API_ENTRY(glIsBuffer)(GLuint buffer) {
- CALL_GL_API_RETURN(glIsBuffer, buffer);
-}
-GLboolean API_ENTRY(glIsEnabled)(GLenum cap) {
- CALL_GL_API_RETURN(glIsEnabled, cap);
-}
-GLboolean API_ENTRY(glIsTexture)(GLuint texture) {
- CALL_GL_API_RETURN(glIsTexture, texture);
-}
-void API_ENTRY(glLightModelx)(GLenum pname, GLfixed param) {
- CALL_GL_API(glLightModelx, pname, param);
-}
-void API_ENTRY(glLightModelxv)(GLenum pname, const GLfixed *params) {
- CALL_GL_API(glLightModelxv, pname, params);
-}
-void API_ENTRY(glLightx)(GLenum light, GLenum pname, GLfixed param) {
- CALL_GL_API(glLightx, light, pname, param);
-}
-void API_ENTRY(glLightxv)(GLenum light, GLenum pname, const GLfixed *params) {
- CALL_GL_API(glLightxv, light, pname, params);
-}
-void API_ENTRY(glLineWidthx)(GLfixed width) {
- CALL_GL_API(glLineWidthx, width);
-}
-void API_ENTRY(glLoadIdentity)(void) {
- CALL_GL_API(glLoadIdentity);
-}
-void API_ENTRY(glLoadMatrixx)(const GLfixed *m) {
- CALL_GL_API(glLoadMatrixx, m);
-}
-void API_ENTRY(glLogicOp)(GLenum opcode) {
- CALL_GL_API(glLogicOp, opcode);
-}
-void API_ENTRY(glMaterialx)(GLenum face, GLenum pname, GLfixed param) {
- CALL_GL_API(glMaterialx, face, pname, param);
-}
-void API_ENTRY(glMaterialxv)(GLenum face, GLenum pname, const GLfixed *params) {
- CALL_GL_API(glMaterialxv, face, pname, params);
-}
-void API_ENTRY(glMatrixMode)(GLenum mode) {
- CALL_GL_API(glMatrixMode, mode);
-}
-void API_ENTRY(glMultMatrixx)(const GLfixed *m) {
- CALL_GL_API(glMultMatrixx, m);
-}
-void API_ENTRY(glMultiTexCoord4x)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
- CALL_GL_API(glMultiTexCoord4x, target, s, t, r, q);
-}
-void API_ENTRY(glNormal3x)(GLfixed nx, GLfixed ny, GLfixed nz) {
- CALL_GL_API(glNormal3x, nx, ny, nz);
-}
-void API_ENTRY(glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer) {
- CALL_GL_API(glNormalPointer, type, stride, pointer);
-}
-void API_ENTRY(glOrthox)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
- CALL_GL_API(glOrthox, left, right, bottom, top, zNear, zFar);
-}
-void API_ENTRY(glPixelStorei)(GLenum pname, GLint param) {
- CALL_GL_API(glPixelStorei, pname, param);
-}
-void API_ENTRY(glPointParameterx)(GLenum pname, GLfixed param) {
- CALL_GL_API(glPointParameterx, pname, param);
-}
-void API_ENTRY(glPointParameterxv)(GLenum pname, const GLfixed *params) {
- CALL_GL_API(glPointParameterxv, pname, params);
-}
-void API_ENTRY(glPointSizex)(GLfixed size) {
- CALL_GL_API(glPointSizex, size);
-}
-void API_ENTRY(glPolygonOffsetx)(GLfixed factor, GLfixed units) {
- CALL_GL_API(glPolygonOffsetx, factor, units);
-}
-void API_ENTRY(glPopMatrix)(void) {
- CALL_GL_API(glPopMatrix);
-}
-void API_ENTRY(glPushMatrix)(void) {
- CALL_GL_API(glPushMatrix);
-}
-void API_ENTRY(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) {
- CALL_GL_API(glReadPixels, x, y, width, height, format, type, pixels);
-}
-void API_ENTRY(glRotatex)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
- CALL_GL_API(glRotatex, angle, x, y, z);
-}
-void API_ENTRY(glSampleCoverage)(GLclampf value, GLboolean invert) {
- CALL_GL_API(glSampleCoverage, value, invert);
-}
-void API_ENTRY(glSampleCoveragex)(GLclampx value, GLboolean invert) {
- CALL_GL_API(glSampleCoveragex, value, invert);
-}
-void API_ENTRY(glScalex)(GLfixed x, GLfixed y, GLfixed z) {
- CALL_GL_API(glScalex, x, y, z);
-}
-void API_ENTRY(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glScissor, x, y, width, height);
-}
-void API_ENTRY(glShadeModel)(GLenum mode) {
- CALL_GL_API(glShadeModel, mode);
-}
-void API_ENTRY(glStencilFunc)(GLenum func, GLint ref, GLuint mask) {
- CALL_GL_API(glStencilFunc, func, ref, mask);
-}
-void API_ENTRY(glStencilMask)(GLuint mask) {
- CALL_GL_API(glStencilMask, mask);
-}
-void API_ENTRY(glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) {
- CALL_GL_API(glStencilOp, fail, zfail, zpass);
-}
-void API_ENTRY(glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- CALL_GL_API(glTexCoordPointer, size, type, stride, pointer);
-}
-void API_ENTRY(glTexEnvi)(GLenum target, GLenum pname, GLint param) {
- CALL_GL_API(glTexEnvi, target, pname, param);
-}
-void API_ENTRY(glTexEnvx)(GLenum target, GLenum pname, GLfixed param) {
- CALL_GL_API(glTexEnvx, target, pname, param);
-}
-void API_ENTRY(glTexEnviv)(GLenum target, GLenum pname, const GLint *params) {
- CALL_GL_API(glTexEnviv, target, pname, params);
-}
-void API_ENTRY(glTexEnvxv)(GLenum target, GLenum pname, const GLfixed *params) {
- CALL_GL_API(glTexEnvxv, target, pname, params);
-}
-void API_ENTRY(glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
- CALL_GL_API(glTexImage2D, target, level, internalformat, width, height, border, format, type, pixels);
-}
-void API_ENTRY(glTexParameteri)(GLenum target, GLenum pname, GLint param) {
- CALL_GL_API(glTexParameteri, target, pname, param);
-}
-void API_ENTRY(glTexParameterx)(GLenum target, GLenum pname, GLfixed param) {
- CALL_GL_API(glTexParameterx, target, pname, param);
-}
-void API_ENTRY(glTexParameteriv)(GLenum target, GLenum pname, const GLint *params) {
- CALL_GL_API(glTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glTexParameterxv)(GLenum target, GLenum pname, const GLfixed *params) {
- CALL_GL_API(glTexParameterxv, target, pname, params);
-}
-void API_ENTRY(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
- CALL_GL_API(glTexSubImage2D, target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-void API_ENTRY(glTranslatex)(GLfixed x, GLfixed y, GLfixed z) {
- CALL_GL_API(glTranslatex, x, y, z);
-}
-void API_ENTRY(glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- CALL_GL_API(glVertexPointer, size, type, stride, pointer);
-}
-void API_ENTRY(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glViewport, x, y, width, height);
-}
-void API_ENTRY(glPointSizePointerOES)(GLenum type, GLsizei stride, const GLvoid *pointer) {
- CALL_GL_API(glPointSizePointerOES, type, stride, pointer);
-}
diff --git a/opengl/libs/GLES_CM/glext_api.in b/opengl/libs/GLES_CM/glext_api.in
deleted file mode 100644
index 7cd6cb5..0000000
--- a/opengl/libs/GLES_CM/glext_api.in
+++ /dev/null
@@ -1,420 +0,0 @@
-void API_ENTRY(glBlendEquationSeparateOES)(GLenum modeRGB, GLenum modeAlpha) {
- CALL_GL_API(glBlendEquationSeparateOES, modeRGB, modeAlpha);
-}
-void API_ENTRY(glBlendFuncSeparateOES)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
- CALL_GL_API(glBlendFuncSeparateOES, srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-void API_ENTRY(glBlendEquationOES)(GLenum mode) {
- CALL_GL_API(glBlendEquationOES, mode);
-}
-void API_ENTRY(glDrawTexsOES)(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) {
- CALL_GL_API(glDrawTexsOES, x, y, z, width, height);
-}
-void API_ENTRY(glDrawTexiOES)(GLint x, GLint y, GLint z, GLint width, GLint height) {
- CALL_GL_API(glDrawTexiOES, x, y, z, width, height);
-}
-void API_ENTRY(glDrawTexxOES)(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) {
- CALL_GL_API(glDrawTexxOES, x, y, z, width, height);
-}
-void API_ENTRY(glDrawTexsvOES)(const GLshort *coords) {
- CALL_GL_API(glDrawTexsvOES, coords);
-}
-void API_ENTRY(glDrawTexivOES)(const GLint *coords) {
- CALL_GL_API(glDrawTexivOES, coords);
-}
-void API_ENTRY(glDrawTexxvOES)(const GLfixed *coords) {
- CALL_GL_API(glDrawTexxvOES, coords);
-}
-void API_ENTRY(glDrawTexfOES)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
- CALL_GL_API(glDrawTexfOES, x, y, z, width, height);
-}
-void API_ENTRY(glDrawTexfvOES)(const GLfloat *coords) {
- CALL_GL_API(glDrawTexfvOES, coords);
-}
-void API_ENTRY(glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image) {
- CALL_GL_API(glEGLImageTargetTexture2DOES, target, image);
-}
-void API_ENTRY(glEGLImageTargetRenderbufferStorageOES)(GLenum target, GLeglImageOES image) {
- CALL_GL_API(glEGLImageTargetRenderbufferStorageOES, target, image);
-}
-void API_ENTRY(glAlphaFuncxOES)(GLenum func, GLclampx ref) {
- CALL_GL_API(glAlphaFuncxOES, func, ref);
-}
-void API_ENTRY(glClearColorxOES)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
- CALL_GL_API(glClearColorxOES, red, green, blue, alpha);
-}
-void API_ENTRY(glClearDepthxOES)(GLclampx depth) {
- CALL_GL_API(glClearDepthxOES, depth);
-}
-void API_ENTRY(glClipPlanexOES)(GLenum plane, const GLfixed *equation) {
- CALL_GL_API(glClipPlanexOES, plane, equation);
-}
-void API_ENTRY(glColor4xOES)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
- CALL_GL_API(glColor4xOES, red, green, blue, alpha);
-}
-void API_ENTRY(glDepthRangexOES)(GLclampx zNear, GLclampx zFar) {
- CALL_GL_API(glDepthRangexOES, zNear, zFar);
-}
-void API_ENTRY(glFogxOES)(GLenum pname, GLfixed param) {
- CALL_GL_API(glFogxOES, pname, param);
-}
-void API_ENTRY(glFogxvOES)(GLenum pname, const GLfixed *params) {
- CALL_GL_API(glFogxvOES, pname, params);
-}
-void API_ENTRY(glFrustumxOES)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
- CALL_GL_API(glFrustumxOES, left, right, bottom, top, zNear, zFar);
-}
-void API_ENTRY(glGetClipPlanexOES)(GLenum pname, GLfixed eqn[4]) {
- CALL_GL_API(glGetClipPlanexOES, pname, eqn);
-}
-void API_ENTRY(glGetFixedvOES)(GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetFixedvOES, pname, params);
-}
-void API_ENTRY(glGetLightxvOES)(GLenum light, GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetLightxvOES, light, pname, params);
-}
-void API_ENTRY(glGetMaterialxvOES)(GLenum face, GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetMaterialxvOES, face, pname, params);
-}
-void API_ENTRY(glGetTexEnvxvOES)(GLenum env, GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetTexEnvxvOES, env, pname, params);
-}
-void API_ENTRY(glGetTexParameterxvOES)(GLenum target, GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetTexParameterxvOES, target, pname, params);
-}
-void API_ENTRY(glLightModelxOES)(GLenum pname, GLfixed param) {
- CALL_GL_API(glLightModelxOES, pname, param);
-}
-void API_ENTRY(glLightModelxvOES)(GLenum pname, const GLfixed *params) {
- CALL_GL_API(glLightModelxvOES, pname, params);
-}
-void API_ENTRY(glLightxOES)(GLenum light, GLenum pname, GLfixed param) {
- CALL_GL_API(glLightxOES, light, pname, param);
-}
-void API_ENTRY(glLightxvOES)(GLenum light, GLenum pname, const GLfixed *params) {
- CALL_GL_API(glLightxvOES, light, pname, params);
-}
-void API_ENTRY(glLineWidthxOES)(GLfixed width) {
- CALL_GL_API(glLineWidthxOES, width);
-}
-void API_ENTRY(glLoadMatrixxOES)(const GLfixed *m) {
- CALL_GL_API(glLoadMatrixxOES, m);
-}
-void API_ENTRY(glMaterialxOES)(GLenum face, GLenum pname, GLfixed param) {
- CALL_GL_API(glMaterialxOES, face, pname, param);
-}
-void API_ENTRY(glMaterialxvOES)(GLenum face, GLenum pname, const GLfixed *params) {
- CALL_GL_API(glMaterialxvOES, face, pname, params);
-}
-void API_ENTRY(glMultMatrixxOES)(const GLfixed *m) {
- CALL_GL_API(glMultMatrixxOES, m);
-}
-void API_ENTRY(glMultiTexCoord4xOES)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
- CALL_GL_API(glMultiTexCoord4xOES, target, s, t, r, q);
-}
-void API_ENTRY(glNormal3xOES)(GLfixed nx, GLfixed ny, GLfixed nz) {
- CALL_GL_API(glNormal3xOES, nx, ny, nz);
-}
-void API_ENTRY(glOrthoxOES)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
- CALL_GL_API(glOrthoxOES, left, right, bottom, top, zNear, zFar);
-}
-void API_ENTRY(glPointParameterxOES)(GLenum pname, GLfixed param) {
- CALL_GL_API(glPointParameterxOES, pname, param);
-}
-void API_ENTRY(glPointParameterxvOES)(GLenum pname, const GLfixed *params) {
- CALL_GL_API(glPointParameterxvOES, pname, params);
-}
-void API_ENTRY(glPointSizexOES)(GLfixed size) {
- CALL_GL_API(glPointSizexOES, size);
-}
-void API_ENTRY(glPolygonOffsetxOES)(GLfixed factor, GLfixed units) {
- CALL_GL_API(glPolygonOffsetxOES, factor, units);
-}
-void API_ENTRY(glRotatexOES)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
- CALL_GL_API(glRotatexOES, angle, x, y, z);
-}
-void API_ENTRY(glSampleCoveragexOES)(GLclampx value, GLboolean invert) {
- CALL_GL_API(glSampleCoveragexOES, value, invert);
-}
-void API_ENTRY(glScalexOES)(GLfixed x, GLfixed y, GLfixed z) {
- CALL_GL_API(glScalexOES, x, y, z);
-}
-void API_ENTRY(glTexEnvxOES)(GLenum target, GLenum pname, GLfixed param) {
- CALL_GL_API(glTexEnvxOES, target, pname, param);
-}
-void API_ENTRY(glTexEnvxvOES)(GLenum target, GLenum pname, const GLfixed *params) {
- CALL_GL_API(glTexEnvxvOES, target, pname, params);
-}
-void API_ENTRY(glTexParameterxOES)(GLenum target, GLenum pname, GLfixed param) {
- CALL_GL_API(glTexParameterxOES, target, pname, param);
-}
-void API_ENTRY(glTexParameterxvOES)(GLenum target, GLenum pname, const GLfixed *params) {
- CALL_GL_API(glTexParameterxvOES, target, pname, params);
-}
-void API_ENTRY(glTranslatexOES)(GLfixed x, GLfixed y, GLfixed z) {
- CALL_GL_API(glTranslatexOES, x, y, z);
-}
-GLboolean API_ENTRY(glIsRenderbufferOES)(GLuint renderbuffer) {
- CALL_GL_API_RETURN(glIsRenderbufferOES, renderbuffer);
-}
-void API_ENTRY(glBindRenderbufferOES)(GLenum target, GLuint renderbuffer) {
- CALL_GL_API(glBindRenderbufferOES, target, renderbuffer);
-}
-void API_ENTRY(glDeleteRenderbuffersOES)(GLsizei n, const GLuint* renderbuffers) {
- CALL_GL_API(glDeleteRenderbuffersOES, n, renderbuffers);
-}
-void API_ENTRY(glGenRenderbuffersOES)(GLsizei n, GLuint* renderbuffers) {
- CALL_GL_API(glGenRenderbuffersOES, n, renderbuffers);
-}
-void API_ENTRY(glRenderbufferStorageOES)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageOES, target, internalformat, width, height);
-}
-void API_ENTRY(glGetRenderbufferParameterivOES)(GLenum target, GLenum pname, GLint* params) {
- CALL_GL_API(glGetRenderbufferParameterivOES, target, pname, params);
-}
-GLboolean API_ENTRY(glIsFramebufferOES)(GLuint framebuffer) {
- CALL_GL_API_RETURN(glIsFramebufferOES, framebuffer);
-}
-void API_ENTRY(glBindFramebufferOES)(GLenum target, GLuint framebuffer) {
- CALL_GL_API(glBindFramebufferOES, target, framebuffer);
-}
-void API_ENTRY(glDeleteFramebuffersOES)(GLsizei n, const GLuint* framebuffers) {
- CALL_GL_API(glDeleteFramebuffersOES, n, framebuffers);
-}
-void API_ENTRY(glGenFramebuffersOES)(GLsizei n, GLuint* framebuffers) {
- CALL_GL_API(glGenFramebuffersOES, n, framebuffers);
-}
-GLenum API_ENTRY(glCheckFramebufferStatusOES)(GLenum target) {
- CALL_GL_API_RETURN(glCheckFramebufferStatusOES, target);
-}
-void API_ENTRY(glFramebufferRenderbufferOES)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
- CALL_GL_API(glFramebufferRenderbufferOES, target, attachment, renderbuffertarget, renderbuffer);
-}
-void API_ENTRY(glFramebufferTexture2DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
- CALL_GL_API(glFramebufferTexture2DOES, target, attachment, textarget, texture, level);
-}
-void API_ENTRY(glGetFramebufferAttachmentParameterivOES)(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
- CALL_GL_API(glGetFramebufferAttachmentParameterivOES, target, attachment, pname, params);
-}
-void API_ENTRY(glGenerateMipmapOES)(GLenum target) {
- CALL_GL_API(glGenerateMipmapOES, target);
-}
-void* API_ENTRY(glMapBufferOES)(GLenum target, GLenum access) {
- CALL_GL_API_RETURN(glMapBufferOES, target, access);
-}
-GLboolean API_ENTRY(glUnmapBufferOES)(GLenum target) {
- CALL_GL_API_RETURN(glUnmapBufferOES, target);
-}
-void API_ENTRY(glGetBufferPointervOES)(GLenum target, GLenum pname, GLvoid ** params) {
- CALL_GL_API(glGetBufferPointervOES, target, pname, params);
-}
-void API_ENTRY(glCurrentPaletteMatrixOES)(GLuint matrixpaletteindex) {
- CALL_GL_API(glCurrentPaletteMatrixOES, matrixpaletteindex);
-}
-void API_ENTRY(glLoadPaletteFromModelViewMatrixOES)(void) {
- CALL_GL_API(glLoadPaletteFromModelViewMatrixOES);
-}
-void API_ENTRY(glMatrixIndexPointerOES)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- CALL_GL_API(glMatrixIndexPointerOES, size, type, stride, pointer);
-}
-void API_ENTRY(glWeightPointerOES)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- CALL_GL_API(glWeightPointerOES, size, type, stride, pointer);
-}
-GLbitfield API_ENTRY(glQueryMatrixxOES)(GLfixed mantissa[16], GLint exponent[16]) {
- CALL_GL_API_RETURN(glQueryMatrixxOES, mantissa, exponent);
-}
-void API_ENTRY(glDepthRangefOES)(GLclampf zNear, GLclampf zFar) {
- CALL_GL_API(glDepthRangefOES, zNear, zFar);
-}
-void API_ENTRY(glFrustumfOES)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
- CALL_GL_API(glFrustumfOES, left, right, bottom, top, zNear, zFar);
-}
-void API_ENTRY(glOrthofOES)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
- CALL_GL_API(glOrthofOES, left, right, bottom, top, zNear, zFar);
-}
-void API_ENTRY(glClipPlanefOES)(GLenum plane, const GLfloat *equation) {
- CALL_GL_API(glClipPlanefOES, plane, equation);
-}
-void API_ENTRY(glGetClipPlanefOES)(GLenum pname, GLfloat eqn[4]) {
- CALL_GL_API(glGetClipPlanefOES, pname, eqn);
-}
-void API_ENTRY(glClearDepthfOES)(GLclampf depth) {
- CALL_GL_API(glClearDepthfOES, depth);
-}
-void API_ENTRY(glTexGenfOES)(GLenum coord, GLenum pname, GLfloat param) {
- CALL_GL_API(glTexGenfOES, coord, pname, param);
-}
-void API_ENTRY(glTexGenfvOES)(GLenum coord, GLenum pname, const GLfloat *params) {
- CALL_GL_API(glTexGenfvOES, coord, pname, params);
-}
-void API_ENTRY(glTexGeniOES)(GLenum coord, GLenum pname, GLint param) {
- CALL_GL_API(glTexGeniOES, coord, pname, param);
-}
-void API_ENTRY(glTexGenivOES)(GLenum coord, GLenum pname, const GLint *params) {
- CALL_GL_API(glTexGenivOES, coord, pname, params);
-}
-void API_ENTRY(glTexGenxOES)(GLenum coord, GLenum pname, GLfixed param) {
- CALL_GL_API(glTexGenxOES, coord, pname, param);
-}
-void API_ENTRY(glTexGenxvOES)(GLenum coord, GLenum pname, const GLfixed *params) {
- CALL_GL_API(glTexGenxvOES, coord, pname, params);
-}
-void API_ENTRY(glGetTexGenfvOES)(GLenum coord, GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetTexGenfvOES, coord, pname, params);
-}
-void API_ENTRY(glGetTexGenivOES)(GLenum coord, GLenum pname, GLint *params) {
- CALL_GL_API(glGetTexGenivOES, coord, pname, params);
-}
-void API_ENTRY(glGetTexGenxvOES)(GLenum coord, GLenum pname, GLfixed *params) {
- CALL_GL_API(glGetTexGenxvOES, coord, pname, params);
-}
-void API_ENTRY(glBindVertexArrayOES)(GLuint array) {
- CALL_GL_API(glBindVertexArrayOES, array);
-}
-void API_ENTRY(glDeleteVertexArraysOES)(GLsizei n, const GLuint *arrays) {
- CALL_GL_API(glDeleteVertexArraysOES, n, arrays);
-}
-void API_ENTRY(glGenVertexArraysOES)(GLsizei n, GLuint *arrays) {
- CALL_GL_API(glGenVertexArraysOES, n, arrays);
-}
-GLboolean API_ENTRY(glIsVertexArrayOES)(GLuint array) {
- CALL_GL_API_RETURN(glIsVertexArrayOES, array);
-}
-void API_ENTRY(glRenderbufferStorageMultisampleAPPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageMultisampleAPPLE, target, samples, internalformat, width, height);
-}
-void API_ENTRY(glResolveMultisampleFramebufferAPPLE)(void) {
- CALL_GL_API(glResolveMultisampleFramebufferAPPLE);
-}
-void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
- CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments);
-}
-void API_ENTRY(glRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageMultisampleEXT, target, samples, internalformat, width, height);
-}
-void API_ENTRY(glFramebufferTexture2DMultisampleEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
- CALL_GL_API(glFramebufferTexture2DMultisampleEXT, target, attachment, textarget, texture, level, samples);
-}
-void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
- CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount);
-}
-void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
- CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount);
-}
-GLenum API_ENTRY(glGetGraphicsResetStatusEXT)(void) {
- CALL_GL_API_RETURN(glGetGraphicsResetStatusEXT);
-}
-void API_ENTRY(glReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
- CALL_GL_API(glReadnPixelsEXT, x, y, width, height, format, type, bufSize, data);
-}
-void API_ENTRY(glGetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, float *params) {
- CALL_GL_API(glGetnUniformfvEXT, program, location, bufSize, params);
-}
-void API_ENTRY(glGetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
- CALL_GL_API(glGetnUniformivEXT, program, location, bufSize, params);
-}
-void API_ENTRY(glTexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
- CALL_GL_API(glTexStorage1DEXT, target, levels, internalformat, width);
-}
-void API_ENTRY(glTexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glTexStorage2DEXT, target, levels, internalformat, width, height);
-}
-void API_ENTRY(glTexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
- CALL_GL_API(glTexStorage3DEXT, target, levels, internalformat, width, height, depth);
-}
-void API_ENTRY(glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
- CALL_GL_API(glTextureStorage1DEXT, texture, target, levels, internalformat, width);
-}
-void API_ENTRY(glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glTextureStorage2DEXT, texture, target, levels, internalformat, width, height);
-}
-void API_ENTRY(glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
- CALL_GL_API(glTextureStorage3DEXT, texture, target, levels, internalformat, width, height, depth);
-}
-void API_ENTRY(glClipPlanefIMG)(GLenum p, const GLfloat *eqn) {
- CALL_GL_API(glClipPlanefIMG, p, eqn);
-}
-void API_ENTRY(glClipPlanexIMG)(GLenum p, const GLfixed *eqn) {
- CALL_GL_API(glClipPlanexIMG, p, eqn);
-}
-void API_ENTRY(glRenderbufferStorageMultisampleIMG)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageMultisampleIMG, target, samples, internalformat, width, height);
-}
-void API_ENTRY(glFramebufferTexture2DMultisampleIMG)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
- CALL_GL_API(glFramebufferTexture2DMultisampleIMG, target, attachment, textarget, texture, level, samples);
-}
-void API_ENTRY(glDeleteFencesNV)(GLsizei n, const GLuint *fences) {
- CALL_GL_API(glDeleteFencesNV, n, fences);
-}
-void API_ENTRY(glGenFencesNV)(GLsizei n, GLuint *fences) {
- CALL_GL_API(glGenFencesNV, n, fences);
-}
-GLboolean API_ENTRY(glIsFenceNV)(GLuint fence) {
- CALL_GL_API_RETURN(glIsFenceNV, fence);
-}
-GLboolean API_ENTRY(glTestFenceNV)(GLuint fence) {
- CALL_GL_API_RETURN(glTestFenceNV, fence);
-}
-void API_ENTRY(glGetFenceivNV)(GLuint fence, GLenum pname, GLint *params) {
- CALL_GL_API(glGetFenceivNV, fence, pname, params);
-}
-void API_ENTRY(glFinishFenceNV)(GLuint fence) {
- CALL_GL_API(glFinishFenceNV, fence);
-}
-void API_ENTRY(glSetFenceNV)(GLuint fence, GLenum condition) {
- CALL_GL_API(glSetFenceNV, fence, condition);
-}
-void API_ENTRY(glGetDriverControlsQCOM)(GLint *num, GLsizei size, GLuint *driverControls) {
- CALL_GL_API(glGetDriverControlsQCOM, num, size, driverControls);
-}
-void API_ENTRY(glGetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) {
- CALL_GL_API(glGetDriverControlStringQCOM, driverControl, bufSize, length, driverControlString);
-}
-void API_ENTRY(glEnableDriverControlQCOM)(GLuint driverControl) {
- CALL_GL_API(glEnableDriverControlQCOM, driverControl);
-}
-void API_ENTRY(glDisableDriverControlQCOM)(GLuint driverControl) {
- CALL_GL_API(glDisableDriverControlQCOM, driverControl);
-}
-void API_ENTRY(glExtGetTexturesQCOM)(GLuint *textures, GLint maxTextures, GLint *numTextures) {
- CALL_GL_API(glExtGetTexturesQCOM, textures, maxTextures, numTextures);
-}
-void API_ENTRY(glExtGetBuffersQCOM)(GLuint *buffers, GLint maxBuffers, GLint *numBuffers) {
- CALL_GL_API(glExtGetBuffersQCOM, buffers, maxBuffers, numBuffers);
-}
-void API_ENTRY(glExtGetRenderbuffersQCOM)(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) {
- CALL_GL_API(glExtGetRenderbuffersQCOM, renderbuffers, maxRenderbuffers, numRenderbuffers);
-}
-void API_ENTRY(glExtGetFramebuffersQCOM)(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) {
- CALL_GL_API(glExtGetFramebuffersQCOM, framebuffers, maxFramebuffers, numFramebuffers);
-}
-void API_ENTRY(glExtGetTexLevelParameterivQCOM)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) {
- CALL_GL_API(glExtGetTexLevelParameterivQCOM, texture, face, level, pname, params);
-}
-void API_ENTRY(glExtTexObjectStateOverrideiQCOM)(GLenum target, GLenum pname, GLint param) {
- CALL_GL_API(glExtTexObjectStateOverrideiQCOM, target, pname, param);
-}
-void API_ENTRY(glExtGetTexSubImageQCOM)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels) {
- CALL_GL_API(glExtGetTexSubImageQCOM, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
-}
-void API_ENTRY(glExtGetBufferPointervQCOM)(GLenum target, GLvoid **params) {
- CALL_GL_API(glExtGetBufferPointervQCOM, target, params);
-}
-void API_ENTRY(glExtGetShadersQCOM)(GLuint *shaders, GLint maxShaders, GLint *numShaders) {
- CALL_GL_API(glExtGetShadersQCOM, shaders, maxShaders, numShaders);
-}
-void API_ENTRY(glExtGetProgramsQCOM)(GLuint *programs, GLint maxPrograms, GLint *numPrograms) {
- CALL_GL_API(glExtGetProgramsQCOM, programs, maxPrograms, numPrograms);
-}
-GLboolean API_ENTRY(glExtIsProgramBinaryQCOM)(GLuint program) {
- CALL_GL_API_RETURN(glExtIsProgramBinaryQCOM, program);
-}
-void API_ENTRY(glExtGetProgramBinarySourceQCOM)(GLuint program, GLenum shadertype, GLchar *source, GLint *length) {
- CALL_GL_API(glExtGetProgramBinarySourceQCOM, program, shadertype, source, length);
-}
-void API_ENTRY(glStartTilingQCOM)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) {
- CALL_GL_API(glStartTilingQCOM, x, y, width, height, preserveMask);
-}
-void API_ENTRY(glEndTilingQCOM)(GLbitfield preserveMask) {
- CALL_GL_API(glEndTilingQCOM, preserveMask);
-}
diff --git a/opengl/libs/GLES_trace/.gitignore b/opengl/libs/GLES_trace/.gitignore
deleted file mode 100644
index 8df825e..0000000
--- a/opengl/libs/GLES_trace/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-java
-*.pyc
-*.swp
-pyratemp.py
diff --git a/opengl/libs/GLES_trace/Android.mk b/opengl/libs/GLES_trace/Android.mk
deleted file mode 100644
index 465b6b2..0000000
--- a/opengl/libs/GLES_trace/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- src/gltrace_api.cpp \
- src/gltrace_context.cpp \
- src/gltrace_egl.cpp \
- src/gltrace_eglapi.cpp \
- src/gltrace_fixup.cpp \
- src/gltrace_hooks.cpp \
- src/gltrace.pb.cpp \
- src/gltrace_transport.cpp
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH) \
- $(LOCAL_PATH)/../ \
- external/stlport/stlport \
- external/protobuf/src \
- external \
- bionic
-
-LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
-LOCAL_STATIC_LIBRARIES := libprotobuf-cpp-2.3.0-lite liblzf
-LOCAL_SHARED_LIBRARIES := libcutils libutils libstlport
-
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-
-LOCAL_CFLAGS += -DLOG_TAG=\"libGLES_trace\"
-
-# we need to access the private Bionic header <bionic_tls.h>
-# on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER
-# behavior from the bionic Android.mk file
-ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true)
- LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-LOCAL_C_INCLUDES += bionic/libc/private
-
-LOCAL_MODULE:= libGLES_trace
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/opengl/libs/GLES_trace/DESIGN.txt b/opengl/libs/GLES_trace/DESIGN.txt
deleted file mode 100644
index a189e1d..0000000
--- a/opengl/libs/GLES_trace/DESIGN.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-Design of the GLES Tracing Library
-
-Code Runtime Behavior:
-
- Initialization:
-
- egl_display_t::initialize() calls initEglTraceLevel() to figure out whether tracing should be
- enabled. Currently, the shell properties "debug.egl.trace" and "debug.egl.debug_proc" together
- control whether tracing should be enabled for a certain process. If tracing is enabled, this
- calls GLTrace_start() to start the trace server.
-
- Note that initEglTraceLevel() is also called from early_egl_init(), but that happens in the
- context of the zygote, so that invocation has no effect.
-
- egl_display_t::initialize() then calls setGLHooksThreadSpecific() where we set the thread
- specific gl_hooks structure to point to the trace implementation. From this point on, every
- GLES call is redirected to the trace implementation.
-
- Application runtime:
-
- While the application is running, all its GLES calls are directly routed to their corresponding
- trace implementation.
-
- For EGL calls, the trace library provides a bunch of functions that must be explicitly called
- from the EGL library. These functions are declared in glestrace.h
-
- Application shutdown:
-
- Currently, the application is killed when the user stops tracing from the frontend GUI. We need
- to explore if a more graceful method of stopping the application, or detaching tracing from the
- application is required.
-
-Code Structure:
-
- glestrace.h declares all the hooks exposed by libglestrace. These are used by EGL/egl.cpp and
- EGL/eglApi.cpp to initialize the trace library, and to inform the library of EGL calls.
-
- All GL calls are present in GLES_Trace/src/gltrace_api.cpp. This file is generated by the
- GLES_Trace/src/genapi.py script. The structure of all the functions looks like this:
-
- void GLTrace_glFunction(args) {
- // declare a protobuf
- // copy arguments into the protobuf
- // call the original GLES function
- // if there is a return value, save it into the protobuf
- // fixup the protobuf if necessary
- // transport the protobuf to the host
- }
-
- The fixupGLMessage() call does any custom processing of the protobuf based on the GLES call.
- This typically amounts to copying the data corresponding to input or output pointers.
diff --git a/opengl/libs/GLES_trace/dev.make b/opengl/libs/GLES_trace/dev.make
deleted file mode 100644
index a46260c..0000000
--- a/opengl/libs/GLES_trace/dev.make
+++ /dev/null
@@ -1,14 +0,0 @@
-## NOTE
-## This file is used for development purposes only. It is not used by the build system.
-
-# generate protocol buffer files
-genproto: gltrace.proto
- aprotoc --cpp_out=src --java_out=java gltrace.proto
- mv src/gltrace.pb.cc src/gltrace.pb.cpp
-
-sync:
- adb root
- adb remount
- adb shell stop
- adb sync
- adb shell start
diff --git a/opengl/libs/GLES_trace/gltrace.proto b/opengl/libs/GLES_trace/gltrace.proto
deleted file mode 100644
index bbf3554..0000000
--- a/opengl/libs/GLES_trace/gltrace.proto
+++ /dev/null
@@ -1,555 +0,0 @@
-/*
- * Copyright (C) 2011 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 android.gltrace;
-
-option optimize_for = LITE_RUNTIME;
-
-option java_package = "com.android.ide.eclipse.gltrace";
-option java_outer_classname = "GLProtoBuf";
-
-message GLMessage {
- enum Function {
- glActiveTexture = 0;
- glAlphaFunc = 1;
- glAlphaFuncx = 2;
- glAlphaFuncxOES = 3;
- glAttachShader = 4;
- glBeginPerfMonitorAMD = 5;
- glBindAttribLocation = 6;
- glBindBuffer = 7;
- glBindFramebuffer = 8;
- glBindFramebufferOES = 9;
- glBindRenderbuffer = 10;
- glBindRenderbufferOES = 11;
- glBindTexture = 12;
- glBindVertexArrayOES = 13;
- glBlendColor = 14;
- glBlendEquation = 15;
- glBlendEquationOES = 16;
- glBlendEquationSeparate = 17;
- glBlendEquationSeparateOES = 18;
- glBlendFunc = 19;
- glBlendFuncSeparate = 20;
- glBlendFuncSeparateOES = 21;
- glBufferData = 22;
- glBufferSubData = 23;
- glCheckFramebufferStatus = 24;
- glCheckFramebufferStatusOES = 25;
- glClearColor = 26;
- glClearColorx = 27;
- glClearColorxOES = 28;
- glClearDepthf = 29;
- glClearDepthfOES = 30;
- glClearDepthx = 31;
- glClearDepthxOES = 32;
- glClear = 33;
- glClearStencil = 34;
- glClientActiveTexture = 35;
- glClipPlanef = 36;
- glClipPlanefIMG = 37;
- glClipPlanefOES = 38;
- glClipPlanex = 39;
- glClipPlanexIMG = 40;
- glClipPlanexOES = 41;
- glColor4f = 42;
- glColor4ub = 43;
- glColor4x = 44;
- glColor4xOES = 45;
- glColorMask = 46;
- glColorPointer = 47;
- glCompileShader = 48;
- glCompressedTexImage2D = 49;
- glCompressedTexImage3DOES = 50;
- glCompressedTexSubImage2D = 51;
- glCompressedTexSubImage3DOES = 52;
- glCopyTexImage2D = 53;
- glCopyTexSubImage2D = 54;
- glCopyTexSubImage3DOES = 55;
- glCoverageMaskNV = 56;
- glCoverageOperationNV = 57;
- glCreateProgram = 58;
- glCreateShader = 59;
- glCullFace = 60;
- glCurrentPaletteMatrixOES = 61;
- glDeleteBuffers = 62;
- glDeleteFencesNV = 63;
- glDeleteFramebuffers = 64;
- glDeleteFramebuffersOES = 65;
- glDeletePerfMonitorsAMD = 66;
- glDeleteProgram = 67;
- glDeleteRenderbuffers = 68;
- glDeleteRenderbuffersOES = 69;
- glDeleteShader = 70;
- glDeleteTextures = 71;
- glDeleteVertexArraysOES = 72;
- glDepthFunc = 73;
- glDepthMask = 74;
- glDepthRangef = 75;
- glDepthRangefOES = 76;
- glDepthRangex = 77;
- glDepthRangexOES = 78;
- glDetachShader = 79;
- glDisableClientState = 80;
- glDisableDriverControlQCOM = 81;
- glDisable = 82;
- glDisableVertexAttribArray = 83;
- glDiscardFramebufferEXT = 84;
- glDrawArrays = 85;
- glDrawElements = 86;
- glDrawTexfOES = 87;
- glDrawTexfvOES = 88;
- glDrawTexiOES = 89;
- glDrawTexivOES = 90;
- glDrawTexsOES = 91;
- glDrawTexsvOES = 92;
- glDrawTexxOES = 93;
- glDrawTexxvOES = 94;
- glEGLImageTargetRenderbufferStorageOES = 95;
- glEGLImageTargetTexture2DOES = 96;
- glEnableClientState = 97;
- glEnableDriverControlQCOM = 98;
- glEnable = 99;
- glEnableVertexAttribArray = 100;
- glEndPerfMonitorAMD = 101;
- glEndTilingQCOM = 102;
- glExtGetBufferPointervQCOM = 103;
- glExtGetBuffersQCOM = 104;
- glExtGetFramebuffersQCOM = 105;
- glExtGetProgramBinarySourceQCOM = 106;
- glExtGetProgramsQCOM = 107;
- glExtGetRenderbuffersQCOM = 108;
- glExtGetShadersQCOM = 109;
- glExtGetTexLevelParameterivQCOM = 110;
- glExtGetTexSubImageQCOM = 111;
- glExtGetTexturesQCOM = 112;
- glExtIsProgramBinaryQCOM = 113;
- glExtTexObjectStateOverrideiQCOM = 114;
- glFinishFenceNV = 115;
- glFinish = 116;
- glFlush = 117;
- glFogf = 118;
- glFogfv = 119;
- glFogx = 120;
- glFogxOES = 121;
- glFogxv = 122;
- glFogxvOES = 123;
- glFramebufferRenderbuffer = 124;
- glFramebufferRenderbufferOES = 125;
- glFramebufferTexture2D = 126;
- glFramebufferTexture2DMultisampleIMG = 127;
- glFramebufferTexture2DOES = 128;
- glFramebufferTexture3DOES = 129;
- glFrontFace = 130;
- glFrustumf = 131;
- glFrustumfOES = 132;
- glFrustumx = 133;
- glFrustumxOES = 134;
- glGenBuffers = 135;
- glGenerateMipmap = 136;
- glGenerateMipmapOES = 137;
- glGenFencesNV = 138;
- glGenFramebuffers = 139;
- glGenFramebuffersOES = 140;
- glGenPerfMonitorsAMD = 141;
- glGenRenderbuffers = 142;
- glGenRenderbuffersOES = 143;
- glGenTextures = 144;
- glGenVertexArraysOES = 145;
- glGetActiveAttrib = 146;
- glGetActiveUniform = 147;
- glGetAttachedShaders = 148;
- glGetAttribLocation = 149;
- glGetBooleanv = 150;
- glGetBufferParameteriv = 151;
- glGetBufferPointervOES = 152;
- glGetClipPlanef = 153;
- glGetClipPlanefOES = 154;
- glGetClipPlanex = 155;
- glGetClipPlanexOES = 156;
- glGetDriverControlsQCOM = 157;
- glGetDriverControlStringQCOM = 158;
- glGetError = 159;
- glGetFenceivNV = 160;
- glGetFixedv = 161;
- glGetFixedvOES = 162;
- glGetFloatv = 163;
- glGetFramebufferAttachmentParameteriv = 164;
- glGetFramebufferAttachmentParameterivOES = 165;
- glGetIntegerv = 166;
- glGetLightfv = 167;
- glGetLightxv = 168;
- glGetLightxvOES = 169;
- glGetMaterialfv = 170;
- glGetMaterialxv = 171;
- glGetMaterialxvOES = 172;
- glGetPerfMonitorCounterDataAMD = 173;
- glGetPerfMonitorCounterInfoAMD = 174;
- glGetPerfMonitorCountersAMD = 175;
- glGetPerfMonitorCounterStringAMD = 176;
- glGetPerfMonitorGroupsAMD = 177;
- glGetPerfMonitorGroupStringAMD = 178;
- glGetPointerv = 179;
- glGetProgramBinaryOES = 180;
- glGetProgramInfoLog = 181;
- glGetProgramiv = 182;
- glGetRenderbufferParameteriv = 183;
- glGetRenderbufferParameterivOES = 184;
- glGetShaderInfoLog = 185;
- glGetShaderiv = 186;
- glGetShaderPrecisionFormat = 187;
- glGetShaderSource = 188;
- glGetString = 189;
- glGetTexEnvfv = 190;
- glGetTexEnviv = 191;
- glGetTexEnvxv = 192;
- glGetTexEnvxvOES = 193;
- glGetTexGenfvOES = 194;
- glGetTexGenivOES = 195;
- glGetTexGenxvOES = 196;
- glGetTexParameterfv = 197;
- glGetTexParameteriv = 198;
- glGetTexParameterxv = 199;
- glGetTexParameterxvOES = 200;
- glGetUniformfv = 201;
- glGetUniformiv = 202;
- glGetUniformLocation = 203;
- glGetVertexAttribfv = 204;
- glGetVertexAttribiv = 205;
- glGetVertexAttribPointerv = 206;
- glHint = 207;
- glIsBuffer = 208;
- glIsEnabled = 209;
- glIsFenceNV = 210;
- glIsFramebuffer = 211;
- glIsFramebufferOES = 212;
- glIsProgram = 213;
- glIsRenderbuffer = 214;
- glIsRenderbufferOES = 215;
- glIsShader = 216;
- glIsTexture = 217;
- glIsVertexArrayOES = 218;
- glLightf = 219;
- glLightfv = 220;
- glLightModelf = 221;
- glLightModelfv = 222;
- glLightModelx = 223;
- glLightModelxOES = 224;
- glLightModelxv = 225;
- glLightModelxvOES = 226;
- glLightx = 227;
- glLightxOES = 228;
- glLightxv = 229;
- glLightxvOES = 230;
- glLineWidth = 231;
- glLineWidthx = 232;
- glLineWidthxOES = 233;
- glLinkProgram = 234;
- glLoadIdentity = 235;
- glLoadMatrixf = 236;
- glLoadMatrixx = 237;
- glLoadMatrixxOES = 238;
- glLoadPaletteFromModelViewMatrixOES = 239;
- glLogicOp = 240;
- glMapBufferOES = 241;
- glMaterialf = 242;
- glMaterialfv = 243;
- glMaterialx = 244;
- glMaterialxOES = 245;
- glMaterialxv = 246;
- glMaterialxvOES = 247;
- glMatrixIndexPointerOES = 248;
- glMatrixMode = 249;
- glMultiDrawArraysEXT = 250;
- glMultiDrawElementsEXT = 251;
- glMultiTexCoord4f = 252;
- glMultiTexCoord4x = 253;
- glMultiTexCoord4xOES = 254;
- glMultMatrixf = 255;
- glMultMatrixx = 256;
- glMultMatrixxOES = 257;
- glNormal3f = 258;
- glNormal3x = 259;
- glNormal3xOES = 260;
- glNormalPointer = 261;
- glOrthof = 262;
- glOrthofOES = 263;
- glOrthox = 264;
- glOrthoxOES = 265;
- glPixelStorei = 266;
- glPointParameterf = 267;
- glPointParameterfv = 268;
- glPointParameterx = 269;
- glPointParameterxOES = 270;
- glPointParameterxv = 271;
- glPointParameterxvOES = 272;
- glPointSize = 273;
- glPointSizePointerOES = 274;
- glPointSizex = 275;
- glPointSizexOES = 276;
- glPolygonOffset = 277;
- glPolygonOffsetx = 278;
- glPolygonOffsetxOES = 279;
- glPopMatrix = 280;
- glProgramBinaryOES = 281;
- glPushMatrix = 282;
- glQueryMatrixxOES = 283;
- glReadPixels = 284;
- glReleaseShaderCompiler = 285;
- glRenderbufferStorage = 286;
- glRenderbufferStorageMultisampleIMG = 287;
- glRenderbufferStorageOES = 288;
- glRotatef = 289;
- glRotatex = 290;
- glRotatexOES = 291;
- glSampleCoverage = 292;
- glSampleCoveragex = 293;
- glSampleCoveragexOES = 294;
- glScalef = 295;
- glScalex = 296;
- glScalexOES = 297;
- glScissor = 298;
- glSelectPerfMonitorCountersAMD = 299;
- glSetFenceNV = 300;
- glShadeModel = 301;
- glShaderBinary = 302;
- glShaderSource = 303;
- glStartTilingQCOM = 304;
- glStencilFunc = 305;
- glStencilFuncSeparate = 306;
- glStencilMask = 307;
- glStencilMaskSeparate = 308;
- glStencilOp = 309;
- glStencilOpSeparate = 310;
- glTestFenceNV = 311;
- glTexCoordPointer = 312;
- glTexEnvf = 313;
- glTexEnvfv = 314;
- glTexEnvi = 315;
- glTexEnviv = 316;
- glTexEnvx = 317;
- glTexEnvxOES = 318;
- glTexEnvxv = 319;
- glTexEnvxvOES = 320;
- glTexGenfOES = 321;
- glTexGenfvOES = 322;
- glTexGeniOES = 323;
- glTexGenivOES = 324;
- glTexGenxOES = 325;
- glTexGenxvOES = 326;
- glTexImage2D = 327;
- glTexImage3DOES = 328;
- glTexParameterf = 329;
- glTexParameterfv = 330;
- glTexParameteri = 331;
- glTexParameteriv = 332;
- glTexParameterx = 333;
- glTexParameterxOES = 334;
- glTexParameterxv = 335;
- glTexParameterxvOES = 336;
- glTexSubImage2D = 337;
- glTexSubImage3DOES = 338;
- glTranslatef = 339;
- glTranslatex = 340;
- glTranslatexOES = 341;
- glUniform1f = 342;
- glUniform1fv = 343;
- glUniform1i = 344;
- glUniform1iv = 345;
- glUniform2f = 346;
- glUniform2fv = 347;
- glUniform2i = 348;
- glUniform2iv = 349;
- glUniform3f = 350;
- glUniform3fv = 351;
- glUniform3i = 352;
- glUniform3iv = 353;
- glUniform4f = 354;
- glUniform4fv = 355;
- glUniform4i = 356;
- glUniform4iv = 357;
- glUniformMatrix2fv = 358;
- glUniformMatrix3fv = 359;
- glUniformMatrix4fv = 360;
- glUnmapBufferOES = 361;
- glUseProgram = 362;
- glValidateProgram = 363;
- glVertexAttrib1f = 364;
- glVertexAttrib1fv = 365;
- glVertexAttrib2f = 366;
- glVertexAttrib2fv = 367;
- glVertexAttrib3f = 368;
- glVertexAttrib3fv = 369;
- glVertexAttrib4f = 370;
- glVertexAttrib4fv = 371;
- glVertexAttribPointer = 372;
- glVertexPointer = 373;
- glViewport = 374;
- glWeightPointerOES = 375;
-
- glActiveShaderProgramEXT = 502;
- glAlphaFuncQCOM = 503;
- glBeginQueryEXT = 504;
- glBindProgramPipelineEXT = 505;
- glBlitFramebufferANGLE = 506;
- glCreateShaderProgramvEXT = 507;
- glDeleteProgramPipelinesEXT = 508;
- glDeleteQueriesEXT = 509;
- glDrawBuffersNV = 510;
- glEndQueryEXT = 511;
- glFramebufferTexture2DMultisampleEXT = 512;
- glGenProgramPipelinesEXT = 513;
- glGenQueriesEXT = 514;
- glGetGraphicsResetStatusEXT = 515;
- glGetObjectLabelEXT = 516;
- glGetProgramPipelineInfoLogEXT = 517;
- glGetProgramPipelineivEXT = 518;
- glGetQueryObjectuivEXT = 519;
- glGetQueryivEXT = 520;
- glGetnUniformfvEXT = 521;
- glGetnUniformivEXT = 521;
- glInsertEventMarkerEXT = 522;
- glIsProgramPipelineEXT = 523;
- glIsQueryEXT = 524;
- glLabelObjectEXT = 525;
- glPopGroupMarkerEXT = 526;
- glProgramParameteriEXT = 527;
- glProgramUniform1fEXT = 528;
- glProgramUniform1fvEXT = 529;
- glProgramUniform1iEXT = 530;
- glProgramUniform1ivEXT = 531;
- glProgramUniform2fEXT = 532;
- glProgramUniform2fvEXT = 533;
- glProgramUniform2iEXT = 534;
- glProgramUniform2ivEXT = 535;
- glProgramUniform3fEXT = 536;
- glProgramUniform3fvEXT = 537;
- glProgramUniform3iEXT = 538;
- glProgramUniform3ivEXT = 539;
- glProgramUniform4fEXT = 540;
- glProgramUniform4fvEXT = 541;
- glProgramUniform4iEXT = 542;
- glProgramUniform4ivEXT = 543;
- glProgramUniformMatrix2fvEXT = 544;
- glProgramUniformMatrix3fvEXT = 545;
- glProgramUniformMatrix4fvEXT = 546;
- glPushGroupMarkerEXT = 547;
- glReadBufferNV = 548;
- glReadnPixelsEXT = 549;
- glRenderbufferStorageMultisampleANGLE = 550;
- glRenderbufferStorageMultisampleAPPLE = 551;
- glRenderbufferStorageMultisampleEXT = 552;
- glResolveMultisampleFramebufferAPPLE = 553;
- glTexStorage1DEXT = 554;
- glTexStorage2DEXT = 555;
- glTexStorage3DEXT = 556;
- glTextureStorage1DEXT = 557;
- glTextureStorage2DEXT = 558;
- glTextureStorage3DEXT = 559;
- glUseProgramStagesEXT = 560;
- glValidateProgramPipelineEXT = 561;
-
- eglGetDisplay = 2000;
- eglInitialize = 2001;
- eglTerminate = 2002;
- eglGetConfigs = 2003;
- eglChooseConfig = 2004;
- eglGetConfigAttrib = 2005;
- eglCreateWindowSurface = 2006;
- eglCreatePixmapSurface = 2007;
- eglCreatePbufferSurface = 2008;
- eglDestroySurface = 2009;
- eglQuerySurface = 2010;
- eglCreateContext = 2011;
- eglDestroyContext = 2012;
- eglMakeCurrent = 2013;
- eglGetCurrentContext = 2014;
- eglGetCurrentSurface = 2015;
- eglGetCurrentDisplay = 2016;
- eglQueryContext = 2017;
- eglWaitGL = 2018;
- eglWaitNative = 2019;
- eglSwapBuffers = 2020;
- eglCopyBuffers = 2021;
- eglGetError = 2022;
- eglQueryString = 2023;
- eglGetProcAddress = 2024;
- eglSurfaceAttrib = 2025;
- eglBindTexImage = 2026;
- eglReleaseTexImage = 2027;
- eglSwapInterval = 2028;
- eglBindAPI = 2029;
- eglQueryAPI = 2030;
- eglWaitClient = 2031;
- eglReleaseThread = 2032;
- eglCreatePbufferFromClientBuffer = 2033;
- eglLockSurfaceKHR = 2034;
- eglUnlockSurfaceKHR = 2035;
- eglCreateImageKHR = 2036;
- eglDestroyImageKHR = 2037;
- eglCreateSyncKHR = 2038;
- eglDestroySyncKHR = 2039;
- eglClientWaitSyncKHR = 2040;
- eglGetSyncAttribKHR = 2041;
- eglSetSwapRectangleANDROID = 2042;
- eglGetRenderBufferANDROID = 2043;
- eglGetSystemTimeFrequencyNV = 2044;
- eglGetSystemTimeNV = 2045;
-
- invalid = 3000;
- glVertexAttribPointerData = 3001;
- }
-
- // A GL call's return data and arguments are formatted into this DataType
- message DataType {
- enum Type {
- VOID = 1; // GLvoid
- CHAR = 2; // GLchar
- BYTE = 3; // GLbyte, GLubyte
- INT = 4; // GLbitfield, GLshort, GLint, GLsizei, GLushort, GLuint, GLfixed
- FLOAT = 5; // GLfloat, GLclampf
- BOOL = 6; // GLboolean
- ENUM = 7; // GLenum
- };
-
- required Type type = 1 [default = VOID];
- required bool isArray = 2 [default = false];
-
- repeated int32 intValue = 3;
- repeated float floatValue = 4;
- repeated bytes charValue = 5;
- repeated bytes rawBytes = 6;
- repeated bool boolValue = 7;
- }
-
- message FrameBuffer {
- required int32 width = 1;
- required int32 height = 2;
- repeated bytes contents = 3;
- }
-
- required int32 context_id = 1; // GL context ID
- required int64 start_time = 2; // time when call was invoked
- required int32 duration = 3; // duration of the call (MONOTONIC TIME)
-
- required Function function = 4 [default = invalid]; // GL function called
- repeated DataType args = 5; // GL function's arguments
- optional DataType returnValue = 6; // GL function's return value
-
- optional FrameBuffer fb = 7; // contents of the framebuffer
-
- optional int32 threadtime = 8; // duration of the call (THREAD TIME)
-};
diff --git a/opengl/libs/GLES_trace/src/gltrace.pb.cpp b/opengl/libs/GLES_trace/src/gltrace.pb.cpp
deleted file mode 100644
index d587c49..0000000
--- a/opengl/libs/GLES_trace/src/gltrace.pb.cpp
+++ /dev/null
@@ -1,2081 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
-#include "gltrace.pb.h"
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-// @@protoc_insertion_point(includes)
-
-namespace android {
-namespace gltrace {
-
-void protobuf_ShutdownFile_gltrace_2eproto() {
- delete GLMessage::default_instance_;
- delete GLMessage_DataType::default_instance_;
- delete GLMessage_FrameBuffer::default_instance_;
-}
-
-void protobuf_AddDesc_gltrace_2eproto() {
- static bool already_here = false;
- if (already_here) return;
- already_here = true;
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- GLMessage::default_instance_ = new GLMessage();
- GLMessage_DataType::default_instance_ = new GLMessage_DataType();
- GLMessage_FrameBuffer::default_instance_ = new GLMessage_FrameBuffer();
- GLMessage::default_instance_->InitAsDefaultInstance();
- GLMessage_DataType::default_instance_->InitAsDefaultInstance();
- GLMessage_FrameBuffer::default_instance_->InitAsDefaultInstance();
- ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_gltrace_2eproto);
-}
-
-// Force AddDescriptors() to be called at static initialization time.
-struct StaticDescriptorInitializer_gltrace_2eproto {
- StaticDescriptorInitializer_gltrace_2eproto() {
- protobuf_AddDesc_gltrace_2eproto();
- }
-} static_descriptor_initializer_gltrace_2eproto_;
-
-
-// ===================================================================
-
-bool GLMessage_Function_IsValid(int value) {
- switch(value) {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- case 27:
- case 28:
- case 29:
- case 30:
- case 31:
- case 32:
- case 33:
- case 34:
- case 35:
- case 36:
- case 37:
- case 38:
- case 39:
- case 40:
- case 41:
- case 42:
- case 43:
- case 44:
- case 45:
- case 46:
- case 47:
- case 48:
- case 49:
- case 50:
- case 51:
- case 52:
- case 53:
- case 54:
- case 55:
- case 56:
- case 57:
- case 58:
- case 59:
- case 60:
- case 61:
- case 62:
- case 63:
- case 64:
- case 65:
- case 66:
- case 67:
- case 68:
- case 69:
- case 70:
- case 71:
- case 72:
- case 73:
- case 74:
- case 75:
- case 76:
- case 77:
- case 78:
- case 79:
- case 80:
- case 81:
- case 82:
- case 83:
- case 84:
- case 85:
- case 86:
- case 87:
- case 88:
- case 89:
- case 90:
- case 91:
- case 92:
- case 93:
- case 94:
- case 95:
- case 96:
- case 97:
- case 98:
- case 99:
- case 100:
- case 101:
- case 102:
- case 103:
- case 104:
- case 105:
- case 106:
- case 107:
- case 108:
- case 109:
- case 110:
- case 111:
- case 112:
- case 113:
- case 114:
- case 115:
- case 116:
- case 117:
- case 118:
- case 119:
- case 120:
- case 121:
- case 122:
- case 123:
- case 124:
- case 125:
- case 126:
- case 127:
- case 128:
- case 129:
- case 130:
- case 131:
- case 132:
- case 133:
- case 134:
- case 135:
- case 136:
- case 137:
- case 138:
- case 139:
- case 140:
- case 141:
- case 142:
- case 143:
- case 144:
- case 145:
- case 146:
- case 147:
- case 148:
- case 149:
- case 150:
- case 151:
- case 152:
- case 153:
- case 154:
- case 155:
- case 156:
- case 157:
- case 158:
- case 159:
- case 160:
- case 161:
- case 162:
- case 163:
- case 164:
- case 165:
- case 166:
- case 167:
- case 168:
- case 169:
- case 170:
- case 171:
- case 172:
- case 173:
- case 174:
- case 175:
- case 176:
- case 177:
- case 178:
- case 179:
- case 180:
- case 181:
- case 182:
- case 183:
- case 184:
- case 185:
- case 186:
- case 187:
- case 188:
- case 189:
- case 190:
- case 191:
- case 192:
- case 193:
- case 194:
- case 195:
- case 196:
- case 197:
- case 198:
- case 199:
- case 200:
- case 201:
- case 202:
- case 203:
- case 204:
- case 205:
- case 206:
- case 207:
- case 208:
- case 209:
- case 210:
- case 211:
- case 212:
- case 213:
- case 214:
- case 215:
- case 216:
- case 217:
- case 218:
- case 219:
- case 220:
- case 221:
- case 222:
- case 223:
- case 224:
- case 225:
- case 226:
- case 227:
- case 228:
- case 229:
- case 230:
- case 231:
- case 232:
- case 233:
- case 234:
- case 235:
- case 236:
- case 237:
- case 238:
- case 239:
- case 240:
- case 241:
- case 242:
- case 243:
- case 244:
- case 245:
- case 246:
- case 247:
- case 248:
- case 249:
- case 250:
- case 251:
- case 252:
- case 253:
- case 254:
- case 255:
- case 256:
- case 257:
- case 258:
- case 259:
- case 260:
- case 261:
- case 262:
- case 263:
- case 264:
- case 265:
- case 266:
- case 267:
- case 268:
- case 269:
- case 270:
- case 271:
- case 272:
- case 273:
- case 274:
- case 275:
- case 276:
- case 277:
- case 278:
- case 279:
- case 280:
- case 281:
- case 282:
- case 283:
- case 284:
- case 285:
- case 286:
- case 287:
- case 288:
- case 289:
- case 290:
- case 291:
- case 292:
- case 293:
- case 294:
- case 295:
- case 296:
- case 297:
- case 298:
- case 299:
- case 300:
- case 301:
- case 302:
- case 303:
- case 304:
- case 305:
- case 306:
- case 307:
- case 308:
- case 309:
- case 310:
- case 311:
- case 312:
- case 313:
- case 314:
- case 315:
- case 316:
- case 317:
- case 318:
- case 319:
- case 320:
- case 321:
- case 322:
- case 323:
- case 324:
- case 325:
- case 326:
- case 327:
- case 328:
- case 329:
- case 330:
- case 331:
- case 332:
- case 333:
- case 334:
- case 335:
- case 336:
- case 337:
- case 338:
- case 339:
- case 340:
- case 341:
- case 342:
- case 343:
- case 344:
- case 345:
- case 346:
- case 347:
- case 348:
- case 349:
- case 350:
- case 351:
- case 352:
- case 353:
- case 354:
- case 355:
- case 356:
- case 357:
- case 358:
- case 359:
- case 360:
- case 361:
- case 362:
- case 363:
- case 364:
- case 365:
- case 366:
- case 367:
- case 368:
- case 369:
- case 370:
- case 371:
- case 372:
- case 373:
- case 374:
- case 375:
- case 502:
- case 503:
- case 504:
- case 505:
- case 506:
- case 507:
- case 508:
- case 509:
- case 510:
- case 511:
- case 512:
- case 513:
- case 514:
- case 515:
- case 516:
- case 517:
- case 518:
- case 519:
- case 520:
- case 521:
- case 522:
- case 523:
- case 524:
- case 525:
- case 526:
- case 527:
- case 528:
- case 529:
- case 530:
- case 531:
- case 532:
- case 533:
- case 534:
- case 535:
- case 536:
- case 537:
- case 538:
- case 539:
- case 540:
- case 541:
- case 542:
- case 543:
- case 544:
- case 545:
- case 546:
- case 547:
- case 548:
- case 549:
- case 550:
- case 551:
- case 552:
- case 553:
- case 554:
- case 555:
- case 556:
- case 557:
- case 558:
- case 559:
- case 560:
- case 561:
- case 2000:
- case 2001:
- case 2002:
- case 2003:
- case 2004:
- case 2005:
- case 2006:
- case 2007:
- case 2008:
- case 2009:
- case 2010:
- case 2011:
- case 2012:
- case 2013:
- case 2014:
- case 2015:
- case 2016:
- case 2017:
- case 2018:
- case 2019:
- case 2020:
- case 2021:
- case 2022:
- case 2023:
- case 2024:
- case 2025:
- case 2026:
- case 2027:
- case 2028:
- case 2029:
- case 2030:
- case 2031:
- case 2032:
- case 2033:
- case 2034:
- case 2035:
- case 2036:
- case 2037:
- case 2038:
- case 2039:
- case 2040:
- case 2041:
- case 2042:
- case 2043:
- case 2044:
- case 2045:
- case 3000:
- case 3001:
- return true;
- default:
- return false;
- }
-}
-
-#ifndef _MSC_VER
-const GLMessage_Function GLMessage::glActiveTexture;
-const GLMessage_Function GLMessage::glAlphaFunc;
-const GLMessage_Function GLMessage::glAlphaFuncx;
-const GLMessage_Function GLMessage::glAlphaFuncxOES;
-const GLMessage_Function GLMessage::glAttachShader;
-const GLMessage_Function GLMessage::glBeginPerfMonitorAMD;
-const GLMessage_Function GLMessage::glBindAttribLocation;
-const GLMessage_Function GLMessage::glBindBuffer;
-const GLMessage_Function GLMessage::glBindFramebuffer;
-const GLMessage_Function GLMessage::glBindFramebufferOES;
-const GLMessage_Function GLMessage::glBindRenderbuffer;
-const GLMessage_Function GLMessage::glBindRenderbufferOES;
-const GLMessage_Function GLMessage::glBindTexture;
-const GLMessage_Function GLMessage::glBindVertexArrayOES;
-const GLMessage_Function GLMessage::glBlendColor;
-const GLMessage_Function GLMessage::glBlendEquation;
-const GLMessage_Function GLMessage::glBlendEquationOES;
-const GLMessage_Function GLMessage::glBlendEquationSeparate;
-const GLMessage_Function GLMessage::glBlendEquationSeparateOES;
-const GLMessage_Function GLMessage::glBlendFunc;
-const GLMessage_Function GLMessage::glBlendFuncSeparate;
-const GLMessage_Function GLMessage::glBlendFuncSeparateOES;
-const GLMessage_Function GLMessage::glBufferData;
-const GLMessage_Function GLMessage::glBufferSubData;
-const GLMessage_Function GLMessage::glCheckFramebufferStatus;
-const GLMessage_Function GLMessage::glCheckFramebufferStatusOES;
-const GLMessage_Function GLMessage::glClearColor;
-const GLMessage_Function GLMessage::glClearColorx;
-const GLMessage_Function GLMessage::glClearColorxOES;
-const GLMessage_Function GLMessage::glClearDepthf;
-const GLMessage_Function GLMessage::glClearDepthfOES;
-const GLMessage_Function GLMessage::glClearDepthx;
-const GLMessage_Function GLMessage::glClearDepthxOES;
-const GLMessage_Function GLMessage::glClear;
-const GLMessage_Function GLMessage::glClearStencil;
-const GLMessage_Function GLMessage::glClientActiveTexture;
-const GLMessage_Function GLMessage::glClipPlanef;
-const GLMessage_Function GLMessage::glClipPlanefIMG;
-const GLMessage_Function GLMessage::glClipPlanefOES;
-const GLMessage_Function GLMessage::glClipPlanex;
-const GLMessage_Function GLMessage::glClipPlanexIMG;
-const GLMessage_Function GLMessage::glClipPlanexOES;
-const GLMessage_Function GLMessage::glColor4f;
-const GLMessage_Function GLMessage::glColor4ub;
-const GLMessage_Function GLMessage::glColor4x;
-const GLMessage_Function GLMessage::glColor4xOES;
-const GLMessage_Function GLMessage::glColorMask;
-const GLMessage_Function GLMessage::glColorPointer;
-const GLMessage_Function GLMessage::glCompileShader;
-const GLMessage_Function GLMessage::glCompressedTexImage2D;
-const GLMessage_Function GLMessage::glCompressedTexImage3DOES;
-const GLMessage_Function GLMessage::glCompressedTexSubImage2D;
-const GLMessage_Function GLMessage::glCompressedTexSubImage3DOES;
-const GLMessage_Function GLMessage::glCopyTexImage2D;
-const GLMessage_Function GLMessage::glCopyTexSubImage2D;
-const GLMessage_Function GLMessage::glCopyTexSubImage3DOES;
-const GLMessage_Function GLMessage::glCoverageMaskNV;
-const GLMessage_Function GLMessage::glCoverageOperationNV;
-const GLMessage_Function GLMessage::glCreateProgram;
-const GLMessage_Function GLMessage::glCreateShader;
-const GLMessage_Function GLMessage::glCullFace;
-const GLMessage_Function GLMessage::glCurrentPaletteMatrixOES;
-const GLMessage_Function GLMessage::glDeleteBuffers;
-const GLMessage_Function GLMessage::glDeleteFencesNV;
-const GLMessage_Function GLMessage::glDeleteFramebuffers;
-const GLMessage_Function GLMessage::glDeleteFramebuffersOES;
-const GLMessage_Function GLMessage::glDeletePerfMonitorsAMD;
-const GLMessage_Function GLMessage::glDeleteProgram;
-const GLMessage_Function GLMessage::glDeleteRenderbuffers;
-const GLMessage_Function GLMessage::glDeleteRenderbuffersOES;
-const GLMessage_Function GLMessage::glDeleteShader;
-const GLMessage_Function GLMessage::glDeleteTextures;
-const GLMessage_Function GLMessage::glDeleteVertexArraysOES;
-const GLMessage_Function GLMessage::glDepthFunc;
-const GLMessage_Function GLMessage::glDepthMask;
-const GLMessage_Function GLMessage::glDepthRangef;
-const GLMessage_Function GLMessage::glDepthRangefOES;
-const GLMessage_Function GLMessage::glDepthRangex;
-const GLMessage_Function GLMessage::glDepthRangexOES;
-const GLMessage_Function GLMessage::glDetachShader;
-const GLMessage_Function GLMessage::glDisableClientState;
-const GLMessage_Function GLMessage::glDisableDriverControlQCOM;
-const GLMessage_Function GLMessage::glDisable;
-const GLMessage_Function GLMessage::glDisableVertexAttribArray;
-const GLMessage_Function GLMessage::glDiscardFramebufferEXT;
-const GLMessage_Function GLMessage::glDrawArrays;
-const GLMessage_Function GLMessage::glDrawElements;
-const GLMessage_Function GLMessage::glDrawTexfOES;
-const GLMessage_Function GLMessage::glDrawTexfvOES;
-const GLMessage_Function GLMessage::glDrawTexiOES;
-const GLMessage_Function GLMessage::glDrawTexivOES;
-const GLMessage_Function GLMessage::glDrawTexsOES;
-const GLMessage_Function GLMessage::glDrawTexsvOES;
-const GLMessage_Function GLMessage::glDrawTexxOES;
-const GLMessage_Function GLMessage::glDrawTexxvOES;
-const GLMessage_Function GLMessage::glEGLImageTargetRenderbufferStorageOES;
-const GLMessage_Function GLMessage::glEGLImageTargetTexture2DOES;
-const GLMessage_Function GLMessage::glEnableClientState;
-const GLMessage_Function GLMessage::glEnableDriverControlQCOM;
-const GLMessage_Function GLMessage::glEnable;
-const GLMessage_Function GLMessage::glEnableVertexAttribArray;
-const GLMessage_Function GLMessage::glEndPerfMonitorAMD;
-const GLMessage_Function GLMessage::glEndTilingQCOM;
-const GLMessage_Function GLMessage::glExtGetBufferPointervQCOM;
-const GLMessage_Function GLMessage::glExtGetBuffersQCOM;
-const GLMessage_Function GLMessage::glExtGetFramebuffersQCOM;
-const GLMessage_Function GLMessage::glExtGetProgramBinarySourceQCOM;
-const GLMessage_Function GLMessage::glExtGetProgramsQCOM;
-const GLMessage_Function GLMessage::glExtGetRenderbuffersQCOM;
-const GLMessage_Function GLMessage::glExtGetShadersQCOM;
-const GLMessage_Function GLMessage::glExtGetTexLevelParameterivQCOM;
-const GLMessage_Function GLMessage::glExtGetTexSubImageQCOM;
-const GLMessage_Function GLMessage::glExtGetTexturesQCOM;
-const GLMessage_Function GLMessage::glExtIsProgramBinaryQCOM;
-const GLMessage_Function GLMessage::glExtTexObjectStateOverrideiQCOM;
-const GLMessage_Function GLMessage::glFinishFenceNV;
-const GLMessage_Function GLMessage::glFinish;
-const GLMessage_Function GLMessage::glFlush;
-const GLMessage_Function GLMessage::glFogf;
-const GLMessage_Function GLMessage::glFogfv;
-const GLMessage_Function GLMessage::glFogx;
-const GLMessage_Function GLMessage::glFogxOES;
-const GLMessage_Function GLMessage::glFogxv;
-const GLMessage_Function GLMessage::glFogxvOES;
-const GLMessage_Function GLMessage::glFramebufferRenderbuffer;
-const GLMessage_Function GLMessage::glFramebufferRenderbufferOES;
-const GLMessage_Function GLMessage::glFramebufferTexture2D;
-const GLMessage_Function GLMessage::glFramebufferTexture2DMultisampleIMG;
-const GLMessage_Function GLMessage::glFramebufferTexture2DOES;
-const GLMessage_Function GLMessage::glFramebufferTexture3DOES;
-const GLMessage_Function GLMessage::glFrontFace;
-const GLMessage_Function GLMessage::glFrustumf;
-const GLMessage_Function GLMessage::glFrustumfOES;
-const GLMessage_Function GLMessage::glFrustumx;
-const GLMessage_Function GLMessage::glFrustumxOES;
-const GLMessage_Function GLMessage::glGenBuffers;
-const GLMessage_Function GLMessage::glGenerateMipmap;
-const GLMessage_Function GLMessage::glGenerateMipmapOES;
-const GLMessage_Function GLMessage::glGenFencesNV;
-const GLMessage_Function GLMessage::glGenFramebuffers;
-const GLMessage_Function GLMessage::glGenFramebuffersOES;
-const GLMessage_Function GLMessage::glGenPerfMonitorsAMD;
-const GLMessage_Function GLMessage::glGenRenderbuffers;
-const GLMessage_Function GLMessage::glGenRenderbuffersOES;
-const GLMessage_Function GLMessage::glGenTextures;
-const GLMessage_Function GLMessage::glGenVertexArraysOES;
-const GLMessage_Function GLMessage::glGetActiveAttrib;
-const GLMessage_Function GLMessage::glGetActiveUniform;
-const GLMessage_Function GLMessage::glGetAttachedShaders;
-const GLMessage_Function GLMessage::glGetAttribLocation;
-const GLMessage_Function GLMessage::glGetBooleanv;
-const GLMessage_Function GLMessage::glGetBufferParameteriv;
-const GLMessage_Function GLMessage::glGetBufferPointervOES;
-const GLMessage_Function GLMessage::glGetClipPlanef;
-const GLMessage_Function GLMessage::glGetClipPlanefOES;
-const GLMessage_Function GLMessage::glGetClipPlanex;
-const GLMessage_Function GLMessage::glGetClipPlanexOES;
-const GLMessage_Function GLMessage::glGetDriverControlsQCOM;
-const GLMessage_Function GLMessage::glGetDriverControlStringQCOM;
-const GLMessage_Function GLMessage::glGetError;
-const GLMessage_Function GLMessage::glGetFenceivNV;
-const GLMessage_Function GLMessage::glGetFixedv;
-const GLMessage_Function GLMessage::glGetFixedvOES;
-const GLMessage_Function GLMessage::glGetFloatv;
-const GLMessage_Function GLMessage::glGetFramebufferAttachmentParameteriv;
-const GLMessage_Function GLMessage::glGetFramebufferAttachmentParameterivOES;
-const GLMessage_Function GLMessage::glGetIntegerv;
-const GLMessage_Function GLMessage::glGetLightfv;
-const GLMessage_Function GLMessage::glGetLightxv;
-const GLMessage_Function GLMessage::glGetLightxvOES;
-const GLMessage_Function GLMessage::glGetMaterialfv;
-const GLMessage_Function GLMessage::glGetMaterialxv;
-const GLMessage_Function GLMessage::glGetMaterialxvOES;
-const GLMessage_Function GLMessage::glGetPerfMonitorCounterDataAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorCounterInfoAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorCountersAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorCounterStringAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorGroupsAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorGroupStringAMD;
-const GLMessage_Function GLMessage::glGetPointerv;
-const GLMessage_Function GLMessage::glGetProgramBinaryOES;
-const GLMessage_Function GLMessage::glGetProgramInfoLog;
-const GLMessage_Function GLMessage::glGetProgramiv;
-const GLMessage_Function GLMessage::glGetRenderbufferParameteriv;
-const GLMessage_Function GLMessage::glGetRenderbufferParameterivOES;
-const GLMessage_Function GLMessage::glGetShaderInfoLog;
-const GLMessage_Function GLMessage::glGetShaderiv;
-const GLMessage_Function GLMessage::glGetShaderPrecisionFormat;
-const GLMessage_Function GLMessage::glGetShaderSource;
-const GLMessage_Function GLMessage::glGetString;
-const GLMessage_Function GLMessage::glGetTexEnvfv;
-const GLMessage_Function GLMessage::glGetTexEnviv;
-const GLMessage_Function GLMessage::glGetTexEnvxv;
-const GLMessage_Function GLMessage::glGetTexEnvxvOES;
-const GLMessage_Function GLMessage::glGetTexGenfvOES;
-const GLMessage_Function GLMessage::glGetTexGenivOES;
-const GLMessage_Function GLMessage::glGetTexGenxvOES;
-const GLMessage_Function GLMessage::glGetTexParameterfv;
-const GLMessage_Function GLMessage::glGetTexParameteriv;
-const GLMessage_Function GLMessage::glGetTexParameterxv;
-const GLMessage_Function GLMessage::glGetTexParameterxvOES;
-const GLMessage_Function GLMessage::glGetUniformfv;
-const GLMessage_Function GLMessage::glGetUniformiv;
-const GLMessage_Function GLMessage::glGetUniformLocation;
-const GLMessage_Function GLMessage::glGetVertexAttribfv;
-const GLMessage_Function GLMessage::glGetVertexAttribiv;
-const GLMessage_Function GLMessage::glGetVertexAttribPointerv;
-const GLMessage_Function GLMessage::glHint;
-const GLMessage_Function GLMessage::glIsBuffer;
-const GLMessage_Function GLMessage::glIsEnabled;
-const GLMessage_Function GLMessage::glIsFenceNV;
-const GLMessage_Function GLMessage::glIsFramebuffer;
-const GLMessage_Function GLMessage::glIsFramebufferOES;
-const GLMessage_Function GLMessage::glIsProgram;
-const GLMessage_Function GLMessage::glIsRenderbuffer;
-const GLMessage_Function GLMessage::glIsRenderbufferOES;
-const GLMessage_Function GLMessage::glIsShader;
-const GLMessage_Function GLMessage::glIsTexture;
-const GLMessage_Function GLMessage::glIsVertexArrayOES;
-const GLMessage_Function GLMessage::glLightf;
-const GLMessage_Function GLMessage::glLightfv;
-const GLMessage_Function GLMessage::glLightModelf;
-const GLMessage_Function GLMessage::glLightModelfv;
-const GLMessage_Function GLMessage::glLightModelx;
-const GLMessage_Function GLMessage::glLightModelxOES;
-const GLMessage_Function GLMessage::glLightModelxv;
-const GLMessage_Function GLMessage::glLightModelxvOES;
-const GLMessage_Function GLMessage::glLightx;
-const GLMessage_Function GLMessage::glLightxOES;
-const GLMessage_Function GLMessage::glLightxv;
-const GLMessage_Function GLMessage::glLightxvOES;
-const GLMessage_Function GLMessage::glLineWidth;
-const GLMessage_Function GLMessage::glLineWidthx;
-const GLMessage_Function GLMessage::glLineWidthxOES;
-const GLMessage_Function GLMessage::glLinkProgram;
-const GLMessage_Function GLMessage::glLoadIdentity;
-const GLMessage_Function GLMessage::glLoadMatrixf;
-const GLMessage_Function GLMessage::glLoadMatrixx;
-const GLMessage_Function GLMessage::glLoadMatrixxOES;
-const GLMessage_Function GLMessage::glLoadPaletteFromModelViewMatrixOES;
-const GLMessage_Function GLMessage::glLogicOp;
-const GLMessage_Function GLMessage::glMapBufferOES;
-const GLMessage_Function GLMessage::glMaterialf;
-const GLMessage_Function GLMessage::glMaterialfv;
-const GLMessage_Function GLMessage::glMaterialx;
-const GLMessage_Function GLMessage::glMaterialxOES;
-const GLMessage_Function GLMessage::glMaterialxv;
-const GLMessage_Function GLMessage::glMaterialxvOES;
-const GLMessage_Function GLMessage::glMatrixIndexPointerOES;
-const GLMessage_Function GLMessage::glMatrixMode;
-const GLMessage_Function GLMessage::glMultiDrawArraysEXT;
-const GLMessage_Function GLMessage::glMultiDrawElementsEXT;
-const GLMessage_Function GLMessage::glMultiTexCoord4f;
-const GLMessage_Function GLMessage::glMultiTexCoord4x;
-const GLMessage_Function GLMessage::glMultiTexCoord4xOES;
-const GLMessage_Function GLMessage::glMultMatrixf;
-const GLMessage_Function GLMessage::glMultMatrixx;
-const GLMessage_Function GLMessage::glMultMatrixxOES;
-const GLMessage_Function GLMessage::glNormal3f;
-const GLMessage_Function GLMessage::glNormal3x;
-const GLMessage_Function GLMessage::glNormal3xOES;
-const GLMessage_Function GLMessage::glNormalPointer;
-const GLMessage_Function GLMessage::glOrthof;
-const GLMessage_Function GLMessage::glOrthofOES;
-const GLMessage_Function GLMessage::glOrthox;
-const GLMessage_Function GLMessage::glOrthoxOES;
-const GLMessage_Function GLMessage::glPixelStorei;
-const GLMessage_Function GLMessage::glPointParameterf;
-const GLMessage_Function GLMessage::glPointParameterfv;
-const GLMessage_Function GLMessage::glPointParameterx;
-const GLMessage_Function GLMessage::glPointParameterxOES;
-const GLMessage_Function GLMessage::glPointParameterxv;
-const GLMessage_Function GLMessage::glPointParameterxvOES;
-const GLMessage_Function GLMessage::glPointSize;
-const GLMessage_Function GLMessage::glPointSizePointerOES;
-const GLMessage_Function GLMessage::glPointSizex;
-const GLMessage_Function GLMessage::glPointSizexOES;
-const GLMessage_Function GLMessage::glPolygonOffset;
-const GLMessage_Function GLMessage::glPolygonOffsetx;
-const GLMessage_Function GLMessage::glPolygonOffsetxOES;
-const GLMessage_Function GLMessage::glPopMatrix;
-const GLMessage_Function GLMessage::glProgramBinaryOES;
-const GLMessage_Function GLMessage::glPushMatrix;
-const GLMessage_Function GLMessage::glQueryMatrixxOES;
-const GLMessage_Function GLMessage::glReadPixels;
-const GLMessage_Function GLMessage::glReleaseShaderCompiler;
-const GLMessage_Function GLMessage::glRenderbufferStorage;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleIMG;
-const GLMessage_Function GLMessage::glRenderbufferStorageOES;
-const GLMessage_Function GLMessage::glRotatef;
-const GLMessage_Function GLMessage::glRotatex;
-const GLMessage_Function GLMessage::glRotatexOES;
-const GLMessage_Function GLMessage::glSampleCoverage;
-const GLMessage_Function GLMessage::glSampleCoveragex;
-const GLMessage_Function GLMessage::glSampleCoveragexOES;
-const GLMessage_Function GLMessage::glScalef;
-const GLMessage_Function GLMessage::glScalex;
-const GLMessage_Function GLMessage::glScalexOES;
-const GLMessage_Function GLMessage::glScissor;
-const GLMessage_Function GLMessage::glSelectPerfMonitorCountersAMD;
-const GLMessage_Function GLMessage::glSetFenceNV;
-const GLMessage_Function GLMessage::glShadeModel;
-const GLMessage_Function GLMessage::glShaderBinary;
-const GLMessage_Function GLMessage::glShaderSource;
-const GLMessage_Function GLMessage::glStartTilingQCOM;
-const GLMessage_Function GLMessage::glStencilFunc;
-const GLMessage_Function GLMessage::glStencilFuncSeparate;
-const GLMessage_Function GLMessage::glStencilMask;
-const GLMessage_Function GLMessage::glStencilMaskSeparate;
-const GLMessage_Function GLMessage::glStencilOp;
-const GLMessage_Function GLMessage::glStencilOpSeparate;
-const GLMessage_Function GLMessage::glTestFenceNV;
-const GLMessage_Function GLMessage::glTexCoordPointer;
-const GLMessage_Function GLMessage::glTexEnvf;
-const GLMessage_Function GLMessage::glTexEnvfv;
-const GLMessage_Function GLMessage::glTexEnvi;
-const GLMessage_Function GLMessage::glTexEnviv;
-const GLMessage_Function GLMessage::glTexEnvx;
-const GLMessage_Function GLMessage::glTexEnvxOES;
-const GLMessage_Function GLMessage::glTexEnvxv;
-const GLMessage_Function GLMessage::glTexEnvxvOES;
-const GLMessage_Function GLMessage::glTexGenfOES;
-const GLMessage_Function GLMessage::glTexGenfvOES;
-const GLMessage_Function GLMessage::glTexGeniOES;
-const GLMessage_Function GLMessage::glTexGenivOES;
-const GLMessage_Function GLMessage::glTexGenxOES;
-const GLMessage_Function GLMessage::glTexGenxvOES;
-const GLMessage_Function GLMessage::glTexImage2D;
-const GLMessage_Function GLMessage::glTexImage3DOES;
-const GLMessage_Function GLMessage::glTexParameterf;
-const GLMessage_Function GLMessage::glTexParameterfv;
-const GLMessage_Function GLMessage::glTexParameteri;
-const GLMessage_Function GLMessage::glTexParameteriv;
-const GLMessage_Function GLMessage::glTexParameterx;
-const GLMessage_Function GLMessage::glTexParameterxOES;
-const GLMessage_Function GLMessage::glTexParameterxv;
-const GLMessage_Function GLMessage::glTexParameterxvOES;
-const GLMessage_Function GLMessage::glTexSubImage2D;
-const GLMessage_Function GLMessage::glTexSubImage3DOES;
-const GLMessage_Function GLMessage::glTranslatef;
-const GLMessage_Function GLMessage::glTranslatex;
-const GLMessage_Function GLMessage::glTranslatexOES;
-const GLMessage_Function GLMessage::glUniform1f;
-const GLMessage_Function GLMessage::glUniform1fv;
-const GLMessage_Function GLMessage::glUniform1i;
-const GLMessage_Function GLMessage::glUniform1iv;
-const GLMessage_Function GLMessage::glUniform2f;
-const GLMessage_Function GLMessage::glUniform2fv;
-const GLMessage_Function GLMessage::glUniform2i;
-const GLMessage_Function GLMessage::glUniform2iv;
-const GLMessage_Function GLMessage::glUniform3f;
-const GLMessage_Function GLMessage::glUniform3fv;
-const GLMessage_Function GLMessage::glUniform3i;
-const GLMessage_Function GLMessage::glUniform3iv;
-const GLMessage_Function GLMessage::glUniform4f;
-const GLMessage_Function GLMessage::glUniform4fv;
-const GLMessage_Function GLMessage::glUniform4i;
-const GLMessage_Function GLMessage::glUniform4iv;
-const GLMessage_Function GLMessage::glUniformMatrix2fv;
-const GLMessage_Function GLMessage::glUniformMatrix3fv;
-const GLMessage_Function GLMessage::glUniformMatrix4fv;
-const GLMessage_Function GLMessage::glUnmapBufferOES;
-const GLMessage_Function GLMessage::glUseProgram;
-const GLMessage_Function GLMessage::glValidateProgram;
-const GLMessage_Function GLMessage::glVertexAttrib1f;
-const GLMessage_Function GLMessage::glVertexAttrib1fv;
-const GLMessage_Function GLMessage::glVertexAttrib2f;
-const GLMessage_Function GLMessage::glVertexAttrib2fv;
-const GLMessage_Function GLMessage::glVertexAttrib3f;
-const GLMessage_Function GLMessage::glVertexAttrib3fv;
-const GLMessage_Function GLMessage::glVertexAttrib4f;
-const GLMessage_Function GLMessage::glVertexAttrib4fv;
-const GLMessage_Function GLMessage::glVertexAttribPointer;
-const GLMessage_Function GLMessage::glVertexPointer;
-const GLMessage_Function GLMessage::glViewport;
-const GLMessage_Function GLMessage::glWeightPointerOES;
-const GLMessage_Function GLMessage::glActiveShaderProgramEXT;
-const GLMessage_Function GLMessage::glAlphaFuncQCOM;
-const GLMessage_Function GLMessage::glBeginQueryEXT;
-const GLMessage_Function GLMessage::glBindProgramPipelineEXT;
-const GLMessage_Function GLMessage::glBlitFramebufferANGLE;
-const GLMessage_Function GLMessage::glCreateShaderProgramvEXT;
-const GLMessage_Function GLMessage::glDeleteProgramPipelinesEXT;
-const GLMessage_Function GLMessage::glDeleteQueriesEXT;
-const GLMessage_Function GLMessage::glDrawBuffersNV;
-const GLMessage_Function GLMessage::glEndQueryEXT;
-const GLMessage_Function GLMessage::glFramebufferTexture2DMultisampleEXT;
-const GLMessage_Function GLMessage::glGenProgramPipelinesEXT;
-const GLMessage_Function GLMessage::glGenQueriesEXT;
-const GLMessage_Function GLMessage::glGetGraphicsResetStatusEXT;
-const GLMessage_Function GLMessage::glGetObjectLabelEXT;
-const GLMessage_Function GLMessage::glGetProgramPipelineInfoLogEXT;
-const GLMessage_Function GLMessage::glGetProgramPipelineivEXT;
-const GLMessage_Function GLMessage::glGetQueryObjectuivEXT;
-const GLMessage_Function GLMessage::glGetQueryivEXT;
-const GLMessage_Function GLMessage::glGetnUniformfvEXT;
-const GLMessage_Function GLMessage::glGetnUniformivEXT;
-const GLMessage_Function GLMessage::glInsertEventMarkerEXT;
-const GLMessage_Function GLMessage::glIsProgramPipelineEXT;
-const GLMessage_Function GLMessage::glIsQueryEXT;
-const GLMessage_Function GLMessage::glLabelObjectEXT;
-const GLMessage_Function GLMessage::glPopGroupMarkerEXT;
-const GLMessage_Function GLMessage::glProgramParameteriEXT;
-const GLMessage_Function GLMessage::glProgramUniform1fEXT;
-const GLMessage_Function GLMessage::glProgramUniform1fvEXT;
-const GLMessage_Function GLMessage::glProgramUniform1iEXT;
-const GLMessage_Function GLMessage::glProgramUniform1ivEXT;
-const GLMessage_Function GLMessage::glProgramUniform2fEXT;
-const GLMessage_Function GLMessage::glProgramUniform2fvEXT;
-const GLMessage_Function GLMessage::glProgramUniform2iEXT;
-const GLMessage_Function GLMessage::glProgramUniform2ivEXT;
-const GLMessage_Function GLMessage::glProgramUniform3fEXT;
-const GLMessage_Function GLMessage::glProgramUniform3fvEXT;
-const GLMessage_Function GLMessage::glProgramUniform3iEXT;
-const GLMessage_Function GLMessage::glProgramUniform3ivEXT;
-const GLMessage_Function GLMessage::glProgramUniform4fEXT;
-const GLMessage_Function GLMessage::glProgramUniform4fvEXT;
-const GLMessage_Function GLMessage::glProgramUniform4iEXT;
-const GLMessage_Function GLMessage::glProgramUniform4ivEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix2fvEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix3fvEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix4fvEXT;
-const GLMessage_Function GLMessage::glPushGroupMarkerEXT;
-const GLMessage_Function GLMessage::glReadBufferNV;
-const GLMessage_Function GLMessage::glReadnPixelsEXT;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleANGLE;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleAPPLE;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleEXT;
-const GLMessage_Function GLMessage::glResolveMultisampleFramebufferAPPLE;
-const GLMessage_Function GLMessage::glTexStorage1DEXT;
-const GLMessage_Function GLMessage::glTexStorage2DEXT;
-const GLMessage_Function GLMessage::glTexStorage3DEXT;
-const GLMessage_Function GLMessage::glTextureStorage1DEXT;
-const GLMessage_Function GLMessage::glTextureStorage2DEXT;
-const GLMessage_Function GLMessage::glTextureStorage3DEXT;
-const GLMessage_Function GLMessage::glUseProgramStagesEXT;
-const GLMessage_Function GLMessage::glValidateProgramPipelineEXT;
-const GLMessage_Function GLMessage::eglGetDisplay;
-const GLMessage_Function GLMessage::eglInitialize;
-const GLMessage_Function GLMessage::eglTerminate;
-const GLMessage_Function GLMessage::eglGetConfigs;
-const GLMessage_Function GLMessage::eglChooseConfig;
-const GLMessage_Function GLMessage::eglGetConfigAttrib;
-const GLMessage_Function GLMessage::eglCreateWindowSurface;
-const GLMessage_Function GLMessage::eglCreatePixmapSurface;
-const GLMessage_Function GLMessage::eglCreatePbufferSurface;
-const GLMessage_Function GLMessage::eglDestroySurface;
-const GLMessage_Function GLMessage::eglQuerySurface;
-const GLMessage_Function GLMessage::eglCreateContext;
-const GLMessage_Function GLMessage::eglDestroyContext;
-const GLMessage_Function GLMessage::eglMakeCurrent;
-const GLMessage_Function GLMessage::eglGetCurrentContext;
-const GLMessage_Function GLMessage::eglGetCurrentSurface;
-const GLMessage_Function GLMessage::eglGetCurrentDisplay;
-const GLMessage_Function GLMessage::eglQueryContext;
-const GLMessage_Function GLMessage::eglWaitGL;
-const GLMessage_Function GLMessage::eglWaitNative;
-const GLMessage_Function GLMessage::eglSwapBuffers;
-const GLMessage_Function GLMessage::eglCopyBuffers;
-const GLMessage_Function GLMessage::eglGetError;
-const GLMessage_Function GLMessage::eglQueryString;
-const GLMessage_Function GLMessage::eglGetProcAddress;
-const GLMessage_Function GLMessage::eglSurfaceAttrib;
-const GLMessage_Function GLMessage::eglBindTexImage;
-const GLMessage_Function GLMessage::eglReleaseTexImage;
-const GLMessage_Function GLMessage::eglSwapInterval;
-const GLMessage_Function GLMessage::eglBindAPI;
-const GLMessage_Function GLMessage::eglQueryAPI;
-const GLMessage_Function GLMessage::eglWaitClient;
-const GLMessage_Function GLMessage::eglReleaseThread;
-const GLMessage_Function GLMessage::eglCreatePbufferFromClientBuffer;
-const GLMessage_Function GLMessage::eglLockSurfaceKHR;
-const GLMessage_Function GLMessage::eglUnlockSurfaceKHR;
-const GLMessage_Function GLMessage::eglCreateImageKHR;
-const GLMessage_Function GLMessage::eglDestroyImageKHR;
-const GLMessage_Function GLMessage::eglCreateSyncKHR;
-const GLMessage_Function GLMessage::eglDestroySyncKHR;
-const GLMessage_Function GLMessage::eglClientWaitSyncKHR;
-const GLMessage_Function GLMessage::eglGetSyncAttribKHR;
-const GLMessage_Function GLMessage::eglSetSwapRectangleANDROID;
-const GLMessage_Function GLMessage::eglGetRenderBufferANDROID;
-const GLMessage_Function GLMessage::eglGetSystemTimeFrequencyNV;
-const GLMessage_Function GLMessage::eglGetSystemTimeNV;
-const GLMessage_Function GLMessage::invalid;
-const GLMessage_Function GLMessage::glVertexAttribPointerData;
-const GLMessage_Function GLMessage::Function_MIN;
-const GLMessage_Function GLMessage::Function_MAX;
-const int GLMessage::Function_ARRAYSIZE;
-#endif // _MSC_VER
-bool GLMessage_DataType_Type_IsValid(int value) {
- switch(value) {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- return true;
- default:
- return false;
- }
-}
-
-#ifndef _MSC_VER
-const GLMessage_DataType_Type GLMessage_DataType::VOID;
-const GLMessage_DataType_Type GLMessage_DataType::CHAR;
-const GLMessage_DataType_Type GLMessage_DataType::BYTE;
-const GLMessage_DataType_Type GLMessage_DataType::INT;
-const GLMessage_DataType_Type GLMessage_DataType::FLOAT;
-const GLMessage_DataType_Type GLMessage_DataType::BOOL;
-const GLMessage_DataType_Type GLMessage_DataType::ENUM;
-const GLMessage_DataType_Type GLMessage_DataType::Type_MIN;
-const GLMessage_DataType_Type GLMessage_DataType::Type_MAX;
-const int GLMessage_DataType::Type_ARRAYSIZE;
-#endif // _MSC_VER
-#ifndef _MSC_VER
-const int GLMessage_DataType::kTypeFieldNumber;
-const int GLMessage_DataType::kIsArrayFieldNumber;
-const int GLMessage_DataType::kIntValueFieldNumber;
-const int GLMessage_DataType::kFloatValueFieldNumber;
-const int GLMessage_DataType::kCharValueFieldNumber;
-const int GLMessage_DataType::kRawBytesFieldNumber;
-const int GLMessage_DataType::kBoolValueFieldNumber;
-#endif // !_MSC_VER
-
-GLMessage_DataType::GLMessage_DataType()
- : ::google::protobuf::MessageLite() {
- SharedCtor();
-}
-
-void GLMessage_DataType::InitAsDefaultInstance() {
-}
-
-GLMessage_DataType::GLMessage_DataType(const GLMessage_DataType& from)
- : ::google::protobuf::MessageLite() {
- SharedCtor();
- MergeFrom(from);
-}
-
-void GLMessage_DataType::SharedCtor() {
- _cached_size_ = 0;
- type_ = 1;
- isarray_ = false;
- ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-GLMessage_DataType::~GLMessage_DataType() {
- SharedDtor();
-}
-
-void GLMessage_DataType::SharedDtor() {
- if (this != default_instance_) {
- }
-}
-
-void GLMessage_DataType::SetCachedSize(int size) const {
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _cached_size_ = size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const GLMessage_DataType& GLMessage_DataType::default_instance() {
- if (default_instance_ == NULL) protobuf_AddDesc_gltrace_2eproto(); return *default_instance_;
-}
-
-GLMessage_DataType* GLMessage_DataType::default_instance_ = NULL;
-
-GLMessage_DataType* GLMessage_DataType::New() const {
- return new GLMessage_DataType;
-}
-
-void GLMessage_DataType::Clear() {
- if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
- type_ = 1;
- isarray_ = false;
- }
- intvalue_.Clear();
- floatvalue_.Clear();
- charvalue_.Clear();
- rawbytes_.Clear();
- boolvalue_.Clear();
- ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-bool GLMessage_DataType::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
- ::google::protobuf::uint32 tag;
- while ((tag = input->ReadTag()) != 0) {
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
- // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
- case 1: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- if (::android::gltrace::GLMessage_DataType_Type_IsValid(value)) {
- set_type(static_cast< ::android::gltrace::GLMessage_DataType_Type >(value));
- }
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(16)) goto parse_isArray;
- break;
- }
-
- // required bool isArray = 2 [default = false];
- case 2: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- parse_isArray:
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
- input, &isarray_)));
- _set_bit(1);
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(24)) goto parse_intValue;
- break;
- }
-
- // repeated int32 intValue = 3;
- case 3: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- parse_intValue:
- DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
- ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
- 1, 24, input, this->mutable_intvalue())));
- } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
- == ::google::protobuf::internal::WireFormatLite::
- WIRETYPE_LENGTH_DELIMITED) {
- DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
- ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
- input, this->mutable_intvalue())));
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(24)) goto parse_intValue;
- if (input->ExpectTag(37)) goto parse_floatValue;
- break;
- }
-
- // repeated float floatValue = 4;
- case 4: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
- parse_floatValue:
- DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
- float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
- 1, 37, input, this->mutable_floatvalue())));
- } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
- == ::google::protobuf::internal::WireFormatLite::
- WIRETYPE_LENGTH_DELIMITED) {
- DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
- float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
- input, this->mutable_floatvalue())));
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(37)) goto parse_floatValue;
- if (input->ExpectTag(42)) goto parse_charValue;
- break;
- }
-
- // repeated bytes charValue = 5;
- case 5: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
- parse_charValue:
- DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
- input, this->add_charvalue()));
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(42)) goto parse_charValue;
- if (input->ExpectTag(50)) goto parse_rawBytes;
- break;
- }
-
- // repeated bytes rawBytes = 6;
- case 6: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
- parse_rawBytes:
- DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
- input, this->add_rawbytes()));
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(50)) goto parse_rawBytes;
- if (input->ExpectTag(56)) goto parse_boolValue;
- break;
- }
-
- // repeated bool boolValue = 7;
- case 7: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- parse_boolValue:
- DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
- bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
- 1, 56, input, this->mutable_boolvalue())));
- } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
- == ::google::protobuf::internal::WireFormatLite::
- WIRETYPE_LENGTH_DELIMITED) {
- DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
- bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
- input, this->mutable_boolvalue())));
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(56)) goto parse_boolValue;
- if (input->ExpectAtEnd()) return true;
- break;
- }
-
- default: {
- handle_uninterpreted:
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
- return true;
- }
- DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
- break;
- }
- }
- }
- return true;
-#undef DO_
-}
-
-void GLMessage_DataType::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
- if (_has_bit(0)) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
- 1, this->type(), output);
- }
-
- // required bool isArray = 2 [default = false];
- if (_has_bit(1)) {
- ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->isarray(), output);
- }
-
- // repeated int32 intValue = 3;
- for (int i = 0; i < this->intvalue_size(); i++) {
- ::google::protobuf::internal::WireFormatLite::WriteInt32(
- 3, this->intvalue(i), output);
- }
-
- // repeated float floatValue = 4;
- for (int i = 0; i < this->floatvalue_size(); i++) {
- ::google::protobuf::internal::WireFormatLite::WriteFloat(
- 4, this->floatvalue(i), output);
- }
-
- // repeated bytes charValue = 5;
- for (int i = 0; i < this->charvalue_size(); i++) {
- ::google::protobuf::internal::WireFormatLite::WriteBytes(
- 5, this->charvalue(i), output);
- }
-
- // repeated bytes rawBytes = 6;
- for (int i = 0; i < this->rawbytes_size(); i++) {
- ::google::protobuf::internal::WireFormatLite::WriteBytes(
- 6, this->rawbytes(i), output);
- }
-
- // repeated bool boolValue = 7;
- for (int i = 0; i < this->boolvalue_size(); i++) {
- ::google::protobuf::internal::WireFormatLite::WriteBool(
- 7, this->boolvalue(i), output);
- }
-
-}
-
-int GLMessage_DataType::ByteSize() const {
- int total_size = 0;
-
- if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
- // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
- if (has_type()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
- }
-
- // required bool isArray = 2 [default = false];
- if (has_isarray()) {
- total_size += 1 + 1;
- }
-
- }
- // repeated int32 intValue = 3;
- {
- int data_size = 0;
- for (int i = 0; i < this->intvalue_size(); i++) {
- data_size += ::google::protobuf::internal::WireFormatLite::
- Int32Size(this->intvalue(i));
- }
- total_size += 1 * this->intvalue_size() + data_size;
- }
-
- // repeated float floatValue = 4;
- {
- int data_size = 0;
- data_size = 4 * this->floatvalue_size();
- total_size += 1 * this->floatvalue_size() + data_size;
- }
-
- // repeated bytes charValue = 5;
- total_size += 1 * this->charvalue_size();
- for (int i = 0; i < this->charvalue_size(); i++) {
- total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
- this->charvalue(i));
- }
-
- // repeated bytes rawBytes = 6;
- total_size += 1 * this->rawbytes_size();
- for (int i = 0; i < this->rawbytes_size(); i++) {
- total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
- this->rawbytes(i));
- }
-
- // repeated bool boolValue = 7;
- {
- int data_size = 0;
- data_size = 1 * this->boolvalue_size();
- total_size += 1 * this->boolvalue_size() + data_size;
- }
-
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _cached_size_ = total_size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
- return total_size;
-}
-
-void GLMessage_DataType::CheckTypeAndMergeFrom(
- const ::google::protobuf::MessageLite& from) {
- MergeFrom(*::google::protobuf::down_cast<const GLMessage_DataType*>(&from));
-}
-
-void GLMessage_DataType::MergeFrom(const GLMessage_DataType& from) {
- GOOGLE_CHECK_NE(&from, this);
- intvalue_.MergeFrom(from.intvalue_);
- floatvalue_.MergeFrom(from.floatvalue_);
- charvalue_.MergeFrom(from.charvalue_);
- rawbytes_.MergeFrom(from.rawbytes_);
- boolvalue_.MergeFrom(from.boolvalue_);
- if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
- if (from._has_bit(0)) {
- set_type(from.type());
- }
- if (from._has_bit(1)) {
- set_isarray(from.isarray());
- }
- }
-}
-
-void GLMessage_DataType::CopyFrom(const GLMessage_DataType& from) {
- if (&from == this) return;
- Clear();
- MergeFrom(from);
-}
-
-bool GLMessage_DataType::IsInitialized() const {
- if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
-
- return true;
-}
-
-void GLMessage_DataType::Swap(GLMessage_DataType* other) {
- if (other != this) {
- std::swap(type_, other->type_);
- std::swap(isarray_, other->isarray_);
- intvalue_.Swap(&other->intvalue_);
- floatvalue_.Swap(&other->floatvalue_);
- charvalue_.Swap(&other->charvalue_);
- rawbytes_.Swap(&other->rawbytes_);
- boolvalue_.Swap(&other->boolvalue_);
- std::swap(_has_bits_[0], other->_has_bits_[0]);
- std::swap(_cached_size_, other->_cached_size_);
- }
-}
-
-::std::string GLMessage_DataType::GetTypeName() const {
- return "android.gltrace.GLMessage.DataType";
-}
-
-
-// -------------------------------------------------------------------
-
-#ifndef _MSC_VER
-const int GLMessage_FrameBuffer::kWidthFieldNumber;
-const int GLMessage_FrameBuffer::kHeightFieldNumber;
-const int GLMessage_FrameBuffer::kContentsFieldNumber;
-#endif // !_MSC_VER
-
-GLMessage_FrameBuffer::GLMessage_FrameBuffer()
- : ::google::protobuf::MessageLite() {
- SharedCtor();
-}
-
-void GLMessage_FrameBuffer::InitAsDefaultInstance() {
-}
-
-GLMessage_FrameBuffer::GLMessage_FrameBuffer(const GLMessage_FrameBuffer& from)
- : ::google::protobuf::MessageLite() {
- SharedCtor();
- MergeFrom(from);
-}
-
-void GLMessage_FrameBuffer::SharedCtor() {
- _cached_size_ = 0;
- width_ = 0;
- height_ = 0;
- ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-GLMessage_FrameBuffer::~GLMessage_FrameBuffer() {
- SharedDtor();
-}
-
-void GLMessage_FrameBuffer::SharedDtor() {
- if (this != default_instance_) {
- }
-}
-
-void GLMessage_FrameBuffer::SetCachedSize(int size) const {
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _cached_size_ = size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const GLMessage_FrameBuffer& GLMessage_FrameBuffer::default_instance() {
- if (default_instance_ == NULL) protobuf_AddDesc_gltrace_2eproto(); return *default_instance_;
-}
-
-GLMessage_FrameBuffer* GLMessage_FrameBuffer::default_instance_ = NULL;
-
-GLMessage_FrameBuffer* GLMessage_FrameBuffer::New() const {
- return new GLMessage_FrameBuffer;
-}
-
-void GLMessage_FrameBuffer::Clear() {
- if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
- width_ = 0;
- height_ = 0;
- }
- contents_.Clear();
- ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-bool GLMessage_FrameBuffer::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
- ::google::protobuf::uint32 tag;
- while ((tag = input->ReadTag()) != 0) {
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
- // required int32 width = 1;
- case 1: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
- input, &width_)));
- _set_bit(0);
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(16)) goto parse_height;
- break;
- }
-
- // required int32 height = 2;
- case 2: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- parse_height:
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
- input, &height_)));
- _set_bit(1);
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(26)) goto parse_contents;
- break;
- }
-
- // repeated bytes contents = 3;
- case 3: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
- parse_contents:
- DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
- input, this->add_contents()));
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(26)) goto parse_contents;
- if (input->ExpectAtEnd()) return true;
- break;
- }
-
- default: {
- handle_uninterpreted:
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
- return true;
- }
- DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
- break;
- }
- }
- }
- return true;
-#undef DO_
-}
-
-void GLMessage_FrameBuffer::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // required int32 width = 1;
- if (_has_bit(0)) {
- ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->width(), output);
- }
-
- // required int32 height = 2;
- if (_has_bit(1)) {
- ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->height(), output);
- }
-
- // repeated bytes contents = 3;
- for (int i = 0; i < this->contents_size(); i++) {
- ::google::protobuf::internal::WireFormatLite::WriteBytes(
- 3, this->contents(i), output);
- }
-
-}
-
-int GLMessage_FrameBuffer::ByteSize() const {
- int total_size = 0;
-
- if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
- // required int32 width = 1;
- if (has_width()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- this->width());
- }
-
- // required int32 height = 2;
- if (has_height()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- this->height());
- }
-
- }
- // repeated bytes contents = 3;
- total_size += 1 * this->contents_size();
- for (int i = 0; i < this->contents_size(); i++) {
- total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
- this->contents(i));
- }
-
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _cached_size_ = total_size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
- return total_size;
-}
-
-void GLMessage_FrameBuffer::CheckTypeAndMergeFrom(
- const ::google::protobuf::MessageLite& from) {
- MergeFrom(*::google::protobuf::down_cast<const GLMessage_FrameBuffer*>(&from));
-}
-
-void GLMessage_FrameBuffer::MergeFrom(const GLMessage_FrameBuffer& from) {
- GOOGLE_CHECK_NE(&from, this);
- contents_.MergeFrom(from.contents_);
- if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
- if (from._has_bit(0)) {
- set_width(from.width());
- }
- if (from._has_bit(1)) {
- set_height(from.height());
- }
- }
-}
-
-void GLMessage_FrameBuffer::CopyFrom(const GLMessage_FrameBuffer& from) {
- if (&from == this) return;
- Clear();
- MergeFrom(from);
-}
-
-bool GLMessage_FrameBuffer::IsInitialized() const {
- if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
-
- return true;
-}
-
-void GLMessage_FrameBuffer::Swap(GLMessage_FrameBuffer* other) {
- if (other != this) {
- std::swap(width_, other->width_);
- std::swap(height_, other->height_);
- contents_.Swap(&other->contents_);
- std::swap(_has_bits_[0], other->_has_bits_[0]);
- std::swap(_cached_size_, other->_cached_size_);
- }
-}
-
-::std::string GLMessage_FrameBuffer::GetTypeName() const {
- return "android.gltrace.GLMessage.FrameBuffer";
-}
-
-
-// -------------------------------------------------------------------
-
-#ifndef _MSC_VER
-const int GLMessage::kContextIdFieldNumber;
-const int GLMessage::kStartTimeFieldNumber;
-const int GLMessage::kDurationFieldNumber;
-const int GLMessage::kFunctionFieldNumber;
-const int GLMessage::kArgsFieldNumber;
-const int GLMessage::kReturnValueFieldNumber;
-const int GLMessage::kFbFieldNumber;
-const int GLMessage::kThreadtimeFieldNumber;
-#endif // !_MSC_VER
-
-GLMessage::GLMessage()
- : ::google::protobuf::MessageLite() {
- SharedCtor();
-}
-
-void GLMessage::InitAsDefaultInstance() {
- returnvalue_ = const_cast< ::android::gltrace::GLMessage_DataType*>(&::android::gltrace::GLMessage_DataType::default_instance());
- fb_ = const_cast< ::android::gltrace::GLMessage_FrameBuffer*>(&::android::gltrace::GLMessage_FrameBuffer::default_instance());
-}
-
-GLMessage::GLMessage(const GLMessage& from)
- : ::google::protobuf::MessageLite() {
- SharedCtor();
- MergeFrom(from);
-}
-
-void GLMessage::SharedCtor() {
- _cached_size_ = 0;
- context_id_ = 0;
- start_time_ = GOOGLE_LONGLONG(0);
- duration_ = 0;
- function_ = 3000;
- returnvalue_ = NULL;
- fb_ = NULL;
- threadtime_ = 0;
- ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-GLMessage::~GLMessage() {
- SharedDtor();
-}
-
-void GLMessage::SharedDtor() {
- if (this != default_instance_) {
- delete returnvalue_;
- delete fb_;
- }
-}
-
-void GLMessage::SetCachedSize(int size) const {
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _cached_size_ = size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const GLMessage& GLMessage::default_instance() {
- if (default_instance_ == NULL) protobuf_AddDesc_gltrace_2eproto(); return *default_instance_;
-}
-
-GLMessage* GLMessage::default_instance_ = NULL;
-
-GLMessage* GLMessage::New() const {
- return new GLMessage;
-}
-
-void GLMessage::Clear() {
- if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
- context_id_ = 0;
- start_time_ = GOOGLE_LONGLONG(0);
- duration_ = 0;
- function_ = 3000;
- if (_has_bit(5)) {
- if (returnvalue_ != NULL) returnvalue_->::android::gltrace::GLMessage_DataType::Clear();
- }
- if (_has_bit(6)) {
- if (fb_ != NULL) fb_->::android::gltrace::GLMessage_FrameBuffer::Clear();
- }
- threadtime_ = 0;
- }
- args_.Clear();
- ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-bool GLMessage::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
- ::google::protobuf::uint32 tag;
- while ((tag = input->ReadTag()) != 0) {
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
- // required int32 context_id = 1;
- case 1: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
- input, &context_id_)));
- _set_bit(0);
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(16)) goto parse_start_time;
- break;
- }
-
- // required int64 start_time = 2;
- case 2: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- parse_start_time:
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
- input, &start_time_)));
- _set_bit(1);
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(24)) goto parse_duration;
- break;
- }
-
- // required int32 duration = 3;
- case 3: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- parse_duration:
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
- input, &duration_)));
- _set_bit(2);
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(32)) goto parse_function;
- break;
- }
-
- // required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
- case 4: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- parse_function:
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- if (::android::gltrace::GLMessage_Function_IsValid(value)) {
- set_function(static_cast< ::android::gltrace::GLMessage_Function >(value));
- }
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(42)) goto parse_args;
- break;
- }
-
- // repeated .android.gltrace.GLMessage.DataType args = 5;
- case 5: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
- parse_args:
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
- input, add_args()));
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(42)) goto parse_args;
- if (input->ExpectTag(50)) goto parse_returnValue;
- break;
- }
-
- // optional .android.gltrace.GLMessage.DataType returnValue = 6;
- case 6: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
- parse_returnValue:
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
- input, mutable_returnvalue()));
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(58)) goto parse_fb;
- break;
- }
-
- // optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
- case 7: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
- parse_fb:
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
- input, mutable_fb()));
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectTag(64)) goto parse_threadtime;
- break;
- }
-
- // optional int32 threadtime = 8;
- case 8: {
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
- parse_threadtime:
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
- input, &threadtime_)));
- _set_bit(7);
- } else {
- goto handle_uninterpreted;
- }
- if (input->ExpectAtEnd()) return true;
- break;
- }
-
- default: {
- handle_uninterpreted:
- if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
- return true;
- }
- DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
- break;
- }
- }
- }
- return true;
-#undef DO_
-}
-
-void GLMessage::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // required int32 context_id = 1;
- if (_has_bit(0)) {
- ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->context_id(), output);
- }
-
- // required int64 start_time = 2;
- if (_has_bit(1)) {
- ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->start_time(), output);
- }
-
- // required int32 duration = 3;
- if (_has_bit(2)) {
- ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->duration(), output);
- }
-
- // required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
- if (_has_bit(3)) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
- 4, this->function(), output);
- }
-
- // repeated .android.gltrace.GLMessage.DataType args = 5;
- for (int i = 0; i < this->args_size(); i++) {
- ::google::protobuf::internal::WireFormatLite::WriteMessage(
- 5, this->args(i), output);
- }
-
- // optional .android.gltrace.GLMessage.DataType returnValue = 6;
- if (_has_bit(5)) {
- ::google::protobuf::internal::WireFormatLite::WriteMessage(
- 6, this->returnvalue(), output);
- }
-
- // optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
- if (_has_bit(6)) {
- ::google::protobuf::internal::WireFormatLite::WriteMessage(
- 7, this->fb(), output);
- }
-
- // optional int32 threadtime = 8;
- if (_has_bit(7)) {
- ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->threadtime(), output);
- }
-
-}
-
-int GLMessage::ByteSize() const {
- int total_size = 0;
-
- if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
- // required int32 context_id = 1;
- if (has_context_id()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- this->context_id());
- }
-
- // required int64 start_time = 2;
- if (has_start_time()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int64Size(
- this->start_time());
- }
-
- // required int32 duration = 3;
- if (has_duration()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- this->duration());
- }
-
- // required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
- if (has_function()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->function());
- }
-
- // optional .android.gltrace.GLMessage.DataType returnValue = 6;
- if (has_returnvalue()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
- this->returnvalue());
- }
-
- // optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
- if (has_fb()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
- this->fb());
- }
-
- // optional int32 threadtime = 8;
- if (has_threadtime()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- this->threadtime());
- }
-
- }
- // repeated .android.gltrace.GLMessage.DataType args = 5;
- total_size += 1 * this->args_size();
- for (int i = 0; i < this->args_size(); i++) {
- total_size +=
- ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
- this->args(i));
- }
-
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _cached_size_ = total_size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
- return total_size;
-}
-
-void GLMessage::CheckTypeAndMergeFrom(
- const ::google::protobuf::MessageLite& from) {
- MergeFrom(*::google::protobuf::down_cast<const GLMessage*>(&from));
-}
-
-void GLMessage::MergeFrom(const GLMessage& from) {
- GOOGLE_CHECK_NE(&from, this);
- args_.MergeFrom(from.args_);
- if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
- if (from._has_bit(0)) {
- set_context_id(from.context_id());
- }
- if (from._has_bit(1)) {
- set_start_time(from.start_time());
- }
- if (from._has_bit(2)) {
- set_duration(from.duration());
- }
- if (from._has_bit(3)) {
- set_function(from.function());
- }
- if (from._has_bit(5)) {
- mutable_returnvalue()->::android::gltrace::GLMessage_DataType::MergeFrom(from.returnvalue());
- }
- if (from._has_bit(6)) {
- mutable_fb()->::android::gltrace::GLMessage_FrameBuffer::MergeFrom(from.fb());
- }
- if (from._has_bit(7)) {
- set_threadtime(from.threadtime());
- }
- }
-}
-
-void GLMessage::CopyFrom(const GLMessage& from) {
- if (&from == this) return;
- Clear();
- MergeFrom(from);
-}
-
-bool GLMessage::IsInitialized() const {
- if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
-
- for (int i = 0; i < args_size(); i++) {
- if (!this->args(i).IsInitialized()) return false;
- }
- if (has_returnvalue()) {
- if (!this->returnvalue().IsInitialized()) return false;
- }
- if (has_fb()) {
- if (!this->fb().IsInitialized()) return false;
- }
- return true;
-}
-
-void GLMessage::Swap(GLMessage* other) {
- if (other != this) {
- std::swap(context_id_, other->context_id_);
- std::swap(start_time_, other->start_time_);
- std::swap(duration_, other->duration_);
- std::swap(function_, other->function_);
- args_.Swap(&other->args_);
- std::swap(returnvalue_, other->returnvalue_);
- std::swap(fb_, other->fb_);
- std::swap(threadtime_, other->threadtime_);
- std::swap(_has_bits_[0], other->_has_bits_[0]);
- std::swap(_cached_size_, other->_cached_size_);
- }
-}
-
-::std::string GLMessage::GetTypeName() const {
- return "android.gltrace.GLMessage";
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-} // namespace gltrace
-} // namespace android
-
-// @@protoc_insertion_point(global_scope)
diff --git a/opengl/libs/GLES_trace/src/gltrace.pb.h b/opengl/libs/GLES_trace/src/gltrace.pb.h
deleted file mode 100644
index 0901be7..0000000
--- a/opengl/libs/GLES_trace/src/gltrace.pb.h
+++ /dev/null
@@ -1,1895 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: gltrace.proto
-
-#ifndef PROTOBUF_gltrace_2eproto__INCLUDED
-#define PROTOBUF_gltrace_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 2003000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers. Please update
-#error your headers.
-#endif
-#if 2003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers. Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/repeated_field.h>
-#include <google/protobuf/extension_set.h>
-// @@protoc_insertion_point(includes)
-
-namespace android {
-namespace gltrace {
-
-// Internal implementation detail -- do not call these.
-void protobuf_AddDesc_gltrace_2eproto();
-void protobuf_AssignDesc_gltrace_2eproto();
-void protobuf_ShutdownFile_gltrace_2eproto();
-
-class GLMessage;
-class GLMessage_DataType;
-class GLMessage_FrameBuffer;
-
-enum GLMessage_DataType_Type {
- GLMessage_DataType_Type_VOID = 1,
- GLMessage_DataType_Type_CHAR = 2,
- GLMessage_DataType_Type_BYTE = 3,
- GLMessage_DataType_Type_INT = 4,
- GLMessage_DataType_Type_FLOAT = 5,
- GLMessage_DataType_Type_BOOL = 6,
- GLMessage_DataType_Type_ENUM = 7
-};
-bool GLMessage_DataType_Type_IsValid(int value);
-const GLMessage_DataType_Type GLMessage_DataType_Type_Type_MIN = GLMessage_DataType_Type_VOID;
-const GLMessage_DataType_Type GLMessage_DataType_Type_Type_MAX = GLMessage_DataType_Type_ENUM;
-const int GLMessage_DataType_Type_Type_ARRAYSIZE = GLMessage_DataType_Type_Type_MAX + 1;
-
-enum GLMessage_Function {
- GLMessage_Function_glActiveTexture = 0,
- GLMessage_Function_glAlphaFunc = 1,
- GLMessage_Function_glAlphaFuncx = 2,
- GLMessage_Function_glAlphaFuncxOES = 3,
- GLMessage_Function_glAttachShader = 4,
- GLMessage_Function_glBeginPerfMonitorAMD = 5,
- GLMessage_Function_glBindAttribLocation = 6,
- GLMessage_Function_glBindBuffer = 7,
- GLMessage_Function_glBindFramebuffer = 8,
- GLMessage_Function_glBindFramebufferOES = 9,
- GLMessage_Function_glBindRenderbuffer = 10,
- GLMessage_Function_glBindRenderbufferOES = 11,
- GLMessage_Function_glBindTexture = 12,
- GLMessage_Function_glBindVertexArrayOES = 13,
- GLMessage_Function_glBlendColor = 14,
- GLMessage_Function_glBlendEquation = 15,
- GLMessage_Function_glBlendEquationOES = 16,
- GLMessage_Function_glBlendEquationSeparate = 17,
- GLMessage_Function_glBlendEquationSeparateOES = 18,
- GLMessage_Function_glBlendFunc = 19,
- GLMessage_Function_glBlendFuncSeparate = 20,
- GLMessage_Function_glBlendFuncSeparateOES = 21,
- GLMessage_Function_glBufferData = 22,
- GLMessage_Function_glBufferSubData = 23,
- GLMessage_Function_glCheckFramebufferStatus = 24,
- GLMessage_Function_glCheckFramebufferStatusOES = 25,
- GLMessage_Function_glClearColor = 26,
- GLMessage_Function_glClearColorx = 27,
- GLMessage_Function_glClearColorxOES = 28,
- GLMessage_Function_glClearDepthf = 29,
- GLMessage_Function_glClearDepthfOES = 30,
- GLMessage_Function_glClearDepthx = 31,
- GLMessage_Function_glClearDepthxOES = 32,
- GLMessage_Function_glClear = 33,
- GLMessage_Function_glClearStencil = 34,
- GLMessage_Function_glClientActiveTexture = 35,
- GLMessage_Function_glClipPlanef = 36,
- GLMessage_Function_glClipPlanefIMG = 37,
- GLMessage_Function_glClipPlanefOES = 38,
- GLMessage_Function_glClipPlanex = 39,
- GLMessage_Function_glClipPlanexIMG = 40,
- GLMessage_Function_glClipPlanexOES = 41,
- GLMessage_Function_glColor4f = 42,
- GLMessage_Function_glColor4ub = 43,
- GLMessage_Function_glColor4x = 44,
- GLMessage_Function_glColor4xOES = 45,
- GLMessage_Function_glColorMask = 46,
- GLMessage_Function_glColorPointer = 47,
- GLMessage_Function_glCompileShader = 48,
- GLMessage_Function_glCompressedTexImage2D = 49,
- GLMessage_Function_glCompressedTexImage3DOES = 50,
- GLMessage_Function_glCompressedTexSubImage2D = 51,
- GLMessage_Function_glCompressedTexSubImage3DOES = 52,
- GLMessage_Function_glCopyTexImage2D = 53,
- GLMessage_Function_glCopyTexSubImage2D = 54,
- GLMessage_Function_glCopyTexSubImage3DOES = 55,
- GLMessage_Function_glCoverageMaskNV = 56,
- GLMessage_Function_glCoverageOperationNV = 57,
- GLMessage_Function_glCreateProgram = 58,
- GLMessage_Function_glCreateShader = 59,
- GLMessage_Function_glCullFace = 60,
- GLMessage_Function_glCurrentPaletteMatrixOES = 61,
- GLMessage_Function_glDeleteBuffers = 62,
- GLMessage_Function_glDeleteFencesNV = 63,
- GLMessage_Function_glDeleteFramebuffers = 64,
- GLMessage_Function_glDeleteFramebuffersOES = 65,
- GLMessage_Function_glDeletePerfMonitorsAMD = 66,
- GLMessage_Function_glDeleteProgram = 67,
- GLMessage_Function_glDeleteRenderbuffers = 68,
- GLMessage_Function_glDeleteRenderbuffersOES = 69,
- GLMessage_Function_glDeleteShader = 70,
- GLMessage_Function_glDeleteTextures = 71,
- GLMessage_Function_glDeleteVertexArraysOES = 72,
- GLMessage_Function_glDepthFunc = 73,
- GLMessage_Function_glDepthMask = 74,
- GLMessage_Function_glDepthRangef = 75,
- GLMessage_Function_glDepthRangefOES = 76,
- GLMessage_Function_glDepthRangex = 77,
- GLMessage_Function_glDepthRangexOES = 78,
- GLMessage_Function_glDetachShader = 79,
- GLMessage_Function_glDisableClientState = 80,
- GLMessage_Function_glDisableDriverControlQCOM = 81,
- GLMessage_Function_glDisable = 82,
- GLMessage_Function_glDisableVertexAttribArray = 83,
- GLMessage_Function_glDiscardFramebufferEXT = 84,
- GLMessage_Function_glDrawArrays = 85,
- GLMessage_Function_glDrawElements = 86,
- GLMessage_Function_glDrawTexfOES = 87,
- GLMessage_Function_glDrawTexfvOES = 88,
- GLMessage_Function_glDrawTexiOES = 89,
- GLMessage_Function_glDrawTexivOES = 90,
- GLMessage_Function_glDrawTexsOES = 91,
- GLMessage_Function_glDrawTexsvOES = 92,
- GLMessage_Function_glDrawTexxOES = 93,
- GLMessage_Function_glDrawTexxvOES = 94,
- GLMessage_Function_glEGLImageTargetRenderbufferStorageOES = 95,
- GLMessage_Function_glEGLImageTargetTexture2DOES = 96,
- GLMessage_Function_glEnableClientState = 97,
- GLMessage_Function_glEnableDriverControlQCOM = 98,
- GLMessage_Function_glEnable = 99,
- GLMessage_Function_glEnableVertexAttribArray = 100,
- GLMessage_Function_glEndPerfMonitorAMD = 101,
- GLMessage_Function_glEndTilingQCOM = 102,
- GLMessage_Function_glExtGetBufferPointervQCOM = 103,
- GLMessage_Function_glExtGetBuffersQCOM = 104,
- GLMessage_Function_glExtGetFramebuffersQCOM = 105,
- GLMessage_Function_glExtGetProgramBinarySourceQCOM = 106,
- GLMessage_Function_glExtGetProgramsQCOM = 107,
- GLMessage_Function_glExtGetRenderbuffersQCOM = 108,
- GLMessage_Function_glExtGetShadersQCOM = 109,
- GLMessage_Function_glExtGetTexLevelParameterivQCOM = 110,
- GLMessage_Function_glExtGetTexSubImageQCOM = 111,
- GLMessage_Function_glExtGetTexturesQCOM = 112,
- GLMessage_Function_glExtIsProgramBinaryQCOM = 113,
- GLMessage_Function_glExtTexObjectStateOverrideiQCOM = 114,
- GLMessage_Function_glFinishFenceNV = 115,
- GLMessage_Function_glFinish = 116,
- GLMessage_Function_glFlush = 117,
- GLMessage_Function_glFogf = 118,
- GLMessage_Function_glFogfv = 119,
- GLMessage_Function_glFogx = 120,
- GLMessage_Function_glFogxOES = 121,
- GLMessage_Function_glFogxv = 122,
- GLMessage_Function_glFogxvOES = 123,
- GLMessage_Function_glFramebufferRenderbuffer = 124,
- GLMessage_Function_glFramebufferRenderbufferOES = 125,
- GLMessage_Function_glFramebufferTexture2D = 126,
- GLMessage_Function_glFramebufferTexture2DMultisampleIMG = 127,
- GLMessage_Function_glFramebufferTexture2DOES = 128,
- GLMessage_Function_glFramebufferTexture3DOES = 129,
- GLMessage_Function_glFrontFace = 130,
- GLMessage_Function_glFrustumf = 131,
- GLMessage_Function_glFrustumfOES = 132,
- GLMessage_Function_glFrustumx = 133,
- GLMessage_Function_glFrustumxOES = 134,
- GLMessage_Function_glGenBuffers = 135,
- GLMessage_Function_glGenerateMipmap = 136,
- GLMessage_Function_glGenerateMipmapOES = 137,
- GLMessage_Function_glGenFencesNV = 138,
- GLMessage_Function_glGenFramebuffers = 139,
- GLMessage_Function_glGenFramebuffersOES = 140,
- GLMessage_Function_glGenPerfMonitorsAMD = 141,
- GLMessage_Function_glGenRenderbuffers = 142,
- GLMessage_Function_glGenRenderbuffersOES = 143,
- GLMessage_Function_glGenTextures = 144,
- GLMessage_Function_glGenVertexArraysOES = 145,
- GLMessage_Function_glGetActiveAttrib = 146,
- GLMessage_Function_glGetActiveUniform = 147,
- GLMessage_Function_glGetAttachedShaders = 148,
- GLMessage_Function_glGetAttribLocation = 149,
- GLMessage_Function_glGetBooleanv = 150,
- GLMessage_Function_glGetBufferParameteriv = 151,
- GLMessage_Function_glGetBufferPointervOES = 152,
- GLMessage_Function_glGetClipPlanef = 153,
- GLMessage_Function_glGetClipPlanefOES = 154,
- GLMessage_Function_glGetClipPlanex = 155,
- GLMessage_Function_glGetClipPlanexOES = 156,
- GLMessage_Function_glGetDriverControlsQCOM = 157,
- GLMessage_Function_glGetDriverControlStringQCOM = 158,
- GLMessage_Function_glGetError = 159,
- GLMessage_Function_glGetFenceivNV = 160,
- GLMessage_Function_glGetFixedv = 161,
- GLMessage_Function_glGetFixedvOES = 162,
- GLMessage_Function_glGetFloatv = 163,
- GLMessage_Function_glGetFramebufferAttachmentParameteriv = 164,
- GLMessage_Function_glGetFramebufferAttachmentParameterivOES = 165,
- GLMessage_Function_glGetIntegerv = 166,
- GLMessage_Function_glGetLightfv = 167,
- GLMessage_Function_glGetLightxv = 168,
- GLMessage_Function_glGetLightxvOES = 169,
- GLMessage_Function_glGetMaterialfv = 170,
- GLMessage_Function_glGetMaterialxv = 171,
- GLMessage_Function_glGetMaterialxvOES = 172,
- GLMessage_Function_glGetPerfMonitorCounterDataAMD = 173,
- GLMessage_Function_glGetPerfMonitorCounterInfoAMD = 174,
- GLMessage_Function_glGetPerfMonitorCountersAMD = 175,
- GLMessage_Function_glGetPerfMonitorCounterStringAMD = 176,
- GLMessage_Function_glGetPerfMonitorGroupsAMD = 177,
- GLMessage_Function_glGetPerfMonitorGroupStringAMD = 178,
- GLMessage_Function_glGetPointerv = 179,
- GLMessage_Function_glGetProgramBinaryOES = 180,
- GLMessage_Function_glGetProgramInfoLog = 181,
- GLMessage_Function_glGetProgramiv = 182,
- GLMessage_Function_glGetRenderbufferParameteriv = 183,
- GLMessage_Function_glGetRenderbufferParameterivOES = 184,
- GLMessage_Function_glGetShaderInfoLog = 185,
- GLMessage_Function_glGetShaderiv = 186,
- GLMessage_Function_glGetShaderPrecisionFormat = 187,
- GLMessage_Function_glGetShaderSource = 188,
- GLMessage_Function_glGetString = 189,
- GLMessage_Function_glGetTexEnvfv = 190,
- GLMessage_Function_glGetTexEnviv = 191,
- GLMessage_Function_glGetTexEnvxv = 192,
- GLMessage_Function_glGetTexEnvxvOES = 193,
- GLMessage_Function_glGetTexGenfvOES = 194,
- GLMessage_Function_glGetTexGenivOES = 195,
- GLMessage_Function_glGetTexGenxvOES = 196,
- GLMessage_Function_glGetTexParameterfv = 197,
- GLMessage_Function_glGetTexParameteriv = 198,
- GLMessage_Function_glGetTexParameterxv = 199,
- GLMessage_Function_glGetTexParameterxvOES = 200,
- GLMessage_Function_glGetUniformfv = 201,
- GLMessage_Function_glGetUniformiv = 202,
- GLMessage_Function_glGetUniformLocation = 203,
- GLMessage_Function_glGetVertexAttribfv = 204,
- GLMessage_Function_glGetVertexAttribiv = 205,
- GLMessage_Function_glGetVertexAttribPointerv = 206,
- GLMessage_Function_glHint = 207,
- GLMessage_Function_glIsBuffer = 208,
- GLMessage_Function_glIsEnabled = 209,
- GLMessage_Function_glIsFenceNV = 210,
- GLMessage_Function_glIsFramebuffer = 211,
- GLMessage_Function_glIsFramebufferOES = 212,
- GLMessage_Function_glIsProgram = 213,
- GLMessage_Function_glIsRenderbuffer = 214,
- GLMessage_Function_glIsRenderbufferOES = 215,
- GLMessage_Function_glIsShader = 216,
- GLMessage_Function_glIsTexture = 217,
- GLMessage_Function_glIsVertexArrayOES = 218,
- GLMessage_Function_glLightf = 219,
- GLMessage_Function_glLightfv = 220,
- GLMessage_Function_glLightModelf = 221,
- GLMessage_Function_glLightModelfv = 222,
- GLMessage_Function_glLightModelx = 223,
- GLMessage_Function_glLightModelxOES = 224,
- GLMessage_Function_glLightModelxv = 225,
- GLMessage_Function_glLightModelxvOES = 226,
- GLMessage_Function_glLightx = 227,
- GLMessage_Function_glLightxOES = 228,
- GLMessage_Function_glLightxv = 229,
- GLMessage_Function_glLightxvOES = 230,
- GLMessage_Function_glLineWidth = 231,
- GLMessage_Function_glLineWidthx = 232,
- GLMessage_Function_glLineWidthxOES = 233,
- GLMessage_Function_glLinkProgram = 234,
- GLMessage_Function_glLoadIdentity = 235,
- GLMessage_Function_glLoadMatrixf = 236,
- GLMessage_Function_glLoadMatrixx = 237,
- GLMessage_Function_glLoadMatrixxOES = 238,
- GLMessage_Function_glLoadPaletteFromModelViewMatrixOES = 239,
- GLMessage_Function_glLogicOp = 240,
- GLMessage_Function_glMapBufferOES = 241,
- GLMessage_Function_glMaterialf = 242,
- GLMessage_Function_glMaterialfv = 243,
- GLMessage_Function_glMaterialx = 244,
- GLMessage_Function_glMaterialxOES = 245,
- GLMessage_Function_glMaterialxv = 246,
- GLMessage_Function_glMaterialxvOES = 247,
- GLMessage_Function_glMatrixIndexPointerOES = 248,
- GLMessage_Function_glMatrixMode = 249,
- GLMessage_Function_glMultiDrawArraysEXT = 250,
- GLMessage_Function_glMultiDrawElementsEXT = 251,
- GLMessage_Function_glMultiTexCoord4f = 252,
- GLMessage_Function_glMultiTexCoord4x = 253,
- GLMessage_Function_glMultiTexCoord4xOES = 254,
- GLMessage_Function_glMultMatrixf = 255,
- GLMessage_Function_glMultMatrixx = 256,
- GLMessage_Function_glMultMatrixxOES = 257,
- GLMessage_Function_glNormal3f = 258,
- GLMessage_Function_glNormal3x = 259,
- GLMessage_Function_glNormal3xOES = 260,
- GLMessage_Function_glNormalPointer = 261,
- GLMessage_Function_glOrthof = 262,
- GLMessage_Function_glOrthofOES = 263,
- GLMessage_Function_glOrthox = 264,
- GLMessage_Function_glOrthoxOES = 265,
- GLMessage_Function_glPixelStorei = 266,
- GLMessage_Function_glPointParameterf = 267,
- GLMessage_Function_glPointParameterfv = 268,
- GLMessage_Function_glPointParameterx = 269,
- GLMessage_Function_glPointParameterxOES = 270,
- GLMessage_Function_glPointParameterxv = 271,
- GLMessage_Function_glPointParameterxvOES = 272,
- GLMessage_Function_glPointSize = 273,
- GLMessage_Function_glPointSizePointerOES = 274,
- GLMessage_Function_glPointSizex = 275,
- GLMessage_Function_glPointSizexOES = 276,
- GLMessage_Function_glPolygonOffset = 277,
- GLMessage_Function_glPolygonOffsetx = 278,
- GLMessage_Function_glPolygonOffsetxOES = 279,
- GLMessage_Function_glPopMatrix = 280,
- GLMessage_Function_glProgramBinaryOES = 281,
- GLMessage_Function_glPushMatrix = 282,
- GLMessage_Function_glQueryMatrixxOES = 283,
- GLMessage_Function_glReadPixels = 284,
- GLMessage_Function_glReleaseShaderCompiler = 285,
- GLMessage_Function_glRenderbufferStorage = 286,
- GLMessage_Function_glRenderbufferStorageMultisampleIMG = 287,
- GLMessage_Function_glRenderbufferStorageOES = 288,
- GLMessage_Function_glRotatef = 289,
- GLMessage_Function_glRotatex = 290,
- GLMessage_Function_glRotatexOES = 291,
- GLMessage_Function_glSampleCoverage = 292,
- GLMessage_Function_glSampleCoveragex = 293,
- GLMessage_Function_glSampleCoveragexOES = 294,
- GLMessage_Function_glScalef = 295,
- GLMessage_Function_glScalex = 296,
- GLMessage_Function_glScalexOES = 297,
- GLMessage_Function_glScissor = 298,
- GLMessage_Function_glSelectPerfMonitorCountersAMD = 299,
- GLMessage_Function_glSetFenceNV = 300,
- GLMessage_Function_glShadeModel = 301,
- GLMessage_Function_glShaderBinary = 302,
- GLMessage_Function_glShaderSource = 303,
- GLMessage_Function_glStartTilingQCOM = 304,
- GLMessage_Function_glStencilFunc = 305,
- GLMessage_Function_glStencilFuncSeparate = 306,
- GLMessage_Function_glStencilMask = 307,
- GLMessage_Function_glStencilMaskSeparate = 308,
- GLMessage_Function_glStencilOp = 309,
- GLMessage_Function_glStencilOpSeparate = 310,
- GLMessage_Function_glTestFenceNV = 311,
- GLMessage_Function_glTexCoordPointer = 312,
- GLMessage_Function_glTexEnvf = 313,
- GLMessage_Function_glTexEnvfv = 314,
- GLMessage_Function_glTexEnvi = 315,
- GLMessage_Function_glTexEnviv = 316,
- GLMessage_Function_glTexEnvx = 317,
- GLMessage_Function_glTexEnvxOES = 318,
- GLMessage_Function_glTexEnvxv = 319,
- GLMessage_Function_glTexEnvxvOES = 320,
- GLMessage_Function_glTexGenfOES = 321,
- GLMessage_Function_glTexGenfvOES = 322,
- GLMessage_Function_glTexGeniOES = 323,
- GLMessage_Function_glTexGenivOES = 324,
- GLMessage_Function_glTexGenxOES = 325,
- GLMessage_Function_glTexGenxvOES = 326,
- GLMessage_Function_glTexImage2D = 327,
- GLMessage_Function_glTexImage3DOES = 328,
- GLMessage_Function_glTexParameterf = 329,
- GLMessage_Function_glTexParameterfv = 330,
- GLMessage_Function_glTexParameteri = 331,
- GLMessage_Function_glTexParameteriv = 332,
- GLMessage_Function_glTexParameterx = 333,
- GLMessage_Function_glTexParameterxOES = 334,
- GLMessage_Function_glTexParameterxv = 335,
- GLMessage_Function_glTexParameterxvOES = 336,
- GLMessage_Function_glTexSubImage2D = 337,
- GLMessage_Function_glTexSubImage3DOES = 338,
- GLMessage_Function_glTranslatef = 339,
- GLMessage_Function_glTranslatex = 340,
- GLMessage_Function_glTranslatexOES = 341,
- GLMessage_Function_glUniform1f = 342,
- GLMessage_Function_glUniform1fv = 343,
- GLMessage_Function_glUniform1i = 344,
- GLMessage_Function_glUniform1iv = 345,
- GLMessage_Function_glUniform2f = 346,
- GLMessage_Function_glUniform2fv = 347,
- GLMessage_Function_glUniform2i = 348,
- GLMessage_Function_glUniform2iv = 349,
- GLMessage_Function_glUniform3f = 350,
- GLMessage_Function_glUniform3fv = 351,
- GLMessage_Function_glUniform3i = 352,
- GLMessage_Function_glUniform3iv = 353,
- GLMessage_Function_glUniform4f = 354,
- GLMessage_Function_glUniform4fv = 355,
- GLMessage_Function_glUniform4i = 356,
- GLMessage_Function_glUniform4iv = 357,
- GLMessage_Function_glUniformMatrix2fv = 358,
- GLMessage_Function_glUniformMatrix3fv = 359,
- GLMessage_Function_glUniformMatrix4fv = 360,
- GLMessage_Function_glUnmapBufferOES = 361,
- GLMessage_Function_glUseProgram = 362,
- GLMessage_Function_glValidateProgram = 363,
- GLMessage_Function_glVertexAttrib1f = 364,
- GLMessage_Function_glVertexAttrib1fv = 365,
- GLMessage_Function_glVertexAttrib2f = 366,
- GLMessage_Function_glVertexAttrib2fv = 367,
- GLMessage_Function_glVertexAttrib3f = 368,
- GLMessage_Function_glVertexAttrib3fv = 369,
- GLMessage_Function_glVertexAttrib4f = 370,
- GLMessage_Function_glVertexAttrib4fv = 371,
- GLMessage_Function_glVertexAttribPointer = 372,
- GLMessage_Function_glVertexPointer = 373,
- GLMessage_Function_glViewport = 374,
- GLMessage_Function_glWeightPointerOES = 375,
- GLMessage_Function_glActiveShaderProgramEXT = 502,
- GLMessage_Function_glAlphaFuncQCOM = 503,
- GLMessage_Function_glBeginQueryEXT = 504,
- GLMessage_Function_glBindProgramPipelineEXT = 505,
- GLMessage_Function_glBlitFramebufferANGLE = 506,
- GLMessage_Function_glCreateShaderProgramvEXT = 507,
- GLMessage_Function_glDeleteProgramPipelinesEXT = 508,
- GLMessage_Function_glDeleteQueriesEXT = 509,
- GLMessage_Function_glDrawBuffersNV = 510,
- GLMessage_Function_glEndQueryEXT = 511,
- GLMessage_Function_glFramebufferTexture2DMultisampleEXT = 512,
- GLMessage_Function_glGenProgramPipelinesEXT = 513,
- GLMessage_Function_glGenQueriesEXT = 514,
- GLMessage_Function_glGetGraphicsResetStatusEXT = 515,
- GLMessage_Function_glGetObjectLabelEXT = 516,
- GLMessage_Function_glGetProgramPipelineInfoLogEXT = 517,
- GLMessage_Function_glGetProgramPipelineivEXT = 518,
- GLMessage_Function_glGetQueryObjectuivEXT = 519,
- GLMessage_Function_glGetQueryivEXT = 520,
- GLMessage_Function_glGetnUniformfvEXT = 521,
- GLMessage_Function_glGetnUniformivEXT = 521,
- GLMessage_Function_glInsertEventMarkerEXT = 522,
- GLMessage_Function_glIsProgramPipelineEXT = 523,
- GLMessage_Function_glIsQueryEXT = 524,
- GLMessage_Function_glLabelObjectEXT = 525,
- GLMessage_Function_glPopGroupMarkerEXT = 526,
- GLMessage_Function_glProgramParameteriEXT = 527,
- GLMessage_Function_glProgramUniform1fEXT = 528,
- GLMessage_Function_glProgramUniform1fvEXT = 529,
- GLMessage_Function_glProgramUniform1iEXT = 530,
- GLMessage_Function_glProgramUniform1ivEXT = 531,
- GLMessage_Function_glProgramUniform2fEXT = 532,
- GLMessage_Function_glProgramUniform2fvEXT = 533,
- GLMessage_Function_glProgramUniform2iEXT = 534,
- GLMessage_Function_glProgramUniform2ivEXT = 535,
- GLMessage_Function_glProgramUniform3fEXT = 536,
- GLMessage_Function_glProgramUniform3fvEXT = 537,
- GLMessage_Function_glProgramUniform3iEXT = 538,
- GLMessage_Function_glProgramUniform3ivEXT = 539,
- GLMessage_Function_glProgramUniform4fEXT = 540,
- GLMessage_Function_glProgramUniform4fvEXT = 541,
- GLMessage_Function_glProgramUniform4iEXT = 542,
- GLMessage_Function_glProgramUniform4ivEXT = 543,
- GLMessage_Function_glProgramUniformMatrix2fvEXT = 544,
- GLMessage_Function_glProgramUniformMatrix3fvEXT = 545,
- GLMessage_Function_glProgramUniformMatrix4fvEXT = 546,
- GLMessage_Function_glPushGroupMarkerEXT = 547,
- GLMessage_Function_glReadBufferNV = 548,
- GLMessage_Function_glReadnPixelsEXT = 549,
- GLMessage_Function_glRenderbufferStorageMultisampleANGLE = 550,
- GLMessage_Function_glRenderbufferStorageMultisampleAPPLE = 551,
- GLMessage_Function_glRenderbufferStorageMultisampleEXT = 552,
- GLMessage_Function_glResolveMultisampleFramebufferAPPLE = 553,
- GLMessage_Function_glTexStorage1DEXT = 554,
- GLMessage_Function_glTexStorage2DEXT = 555,
- GLMessage_Function_glTexStorage3DEXT = 556,
- GLMessage_Function_glTextureStorage1DEXT = 557,
- GLMessage_Function_glTextureStorage2DEXT = 558,
- GLMessage_Function_glTextureStorage3DEXT = 559,
- GLMessage_Function_glUseProgramStagesEXT = 560,
- GLMessage_Function_glValidateProgramPipelineEXT = 561,
- GLMessage_Function_eglGetDisplay = 2000,
- GLMessage_Function_eglInitialize = 2001,
- GLMessage_Function_eglTerminate = 2002,
- GLMessage_Function_eglGetConfigs = 2003,
- GLMessage_Function_eglChooseConfig = 2004,
- GLMessage_Function_eglGetConfigAttrib = 2005,
- GLMessage_Function_eglCreateWindowSurface = 2006,
- GLMessage_Function_eglCreatePixmapSurface = 2007,
- GLMessage_Function_eglCreatePbufferSurface = 2008,
- GLMessage_Function_eglDestroySurface = 2009,
- GLMessage_Function_eglQuerySurface = 2010,
- GLMessage_Function_eglCreateContext = 2011,
- GLMessage_Function_eglDestroyContext = 2012,
- GLMessage_Function_eglMakeCurrent = 2013,
- GLMessage_Function_eglGetCurrentContext = 2014,
- GLMessage_Function_eglGetCurrentSurface = 2015,
- GLMessage_Function_eglGetCurrentDisplay = 2016,
- GLMessage_Function_eglQueryContext = 2017,
- GLMessage_Function_eglWaitGL = 2018,
- GLMessage_Function_eglWaitNative = 2019,
- GLMessage_Function_eglSwapBuffers = 2020,
- GLMessage_Function_eglCopyBuffers = 2021,
- GLMessage_Function_eglGetError = 2022,
- GLMessage_Function_eglQueryString = 2023,
- GLMessage_Function_eglGetProcAddress = 2024,
- GLMessage_Function_eglSurfaceAttrib = 2025,
- GLMessage_Function_eglBindTexImage = 2026,
- GLMessage_Function_eglReleaseTexImage = 2027,
- GLMessage_Function_eglSwapInterval = 2028,
- GLMessage_Function_eglBindAPI = 2029,
- GLMessage_Function_eglQueryAPI = 2030,
- GLMessage_Function_eglWaitClient = 2031,
- GLMessage_Function_eglReleaseThread = 2032,
- GLMessage_Function_eglCreatePbufferFromClientBuffer = 2033,
- GLMessage_Function_eglLockSurfaceKHR = 2034,
- GLMessage_Function_eglUnlockSurfaceKHR = 2035,
- GLMessage_Function_eglCreateImageKHR = 2036,
- GLMessage_Function_eglDestroyImageKHR = 2037,
- GLMessage_Function_eglCreateSyncKHR = 2038,
- GLMessage_Function_eglDestroySyncKHR = 2039,
- GLMessage_Function_eglClientWaitSyncKHR = 2040,
- GLMessage_Function_eglGetSyncAttribKHR = 2041,
- GLMessage_Function_eglSetSwapRectangleANDROID = 2042,
- GLMessage_Function_eglGetRenderBufferANDROID = 2043,
- GLMessage_Function_eglGetSystemTimeFrequencyNV = 2044,
- GLMessage_Function_eglGetSystemTimeNV = 2045,
- GLMessage_Function_invalid = 3000,
- GLMessage_Function_glVertexAttribPointerData = 3001
-};
-bool GLMessage_Function_IsValid(int value);
-const GLMessage_Function GLMessage_Function_Function_MIN = GLMessage_Function_glActiveTexture;
-const GLMessage_Function GLMessage_Function_Function_MAX = GLMessage_Function_glVertexAttribPointerData;
-const int GLMessage_Function_Function_ARRAYSIZE = GLMessage_Function_Function_MAX + 1;
-
-// ===================================================================
-
-class GLMessage_DataType : public ::google::protobuf::MessageLite {
- public:
- GLMessage_DataType();
- virtual ~GLMessage_DataType();
-
- GLMessage_DataType(const GLMessage_DataType& from);
-
- inline GLMessage_DataType& operator=(const GLMessage_DataType& from) {
- CopyFrom(from);
- return *this;
- }
-
- static const GLMessage_DataType& default_instance();
-
- void Swap(GLMessage_DataType* other);
-
- // implements Message ----------------------------------------------
-
- GLMessage_DataType* New() const;
- void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
- void CopyFrom(const GLMessage_DataType& from);
- void MergeFrom(const GLMessage_DataType& from);
- void Clear();
- bool IsInitialized() const;
-
- int ByteSize() const;
- bool MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input);
- void SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const;
- int GetCachedSize() const { return _cached_size_; }
- private:
- void SharedCtor();
- void SharedDtor();
- void SetCachedSize(int size) const;
- public:
-
- ::std::string GetTypeName() const;
-
- // nested types ----------------------------------------------------
-
- typedef GLMessage_DataType_Type Type;
- static const Type VOID = GLMessage_DataType_Type_VOID;
- static const Type CHAR = GLMessage_DataType_Type_CHAR;
- static const Type BYTE = GLMessage_DataType_Type_BYTE;
- static const Type INT = GLMessage_DataType_Type_INT;
- static const Type FLOAT = GLMessage_DataType_Type_FLOAT;
- static const Type BOOL = GLMessage_DataType_Type_BOOL;
- static const Type ENUM = GLMessage_DataType_Type_ENUM;
- static inline bool Type_IsValid(int value) {
- return GLMessage_DataType_Type_IsValid(value);
- }
- static const Type Type_MIN =
- GLMessage_DataType_Type_Type_MIN;
- static const Type Type_MAX =
- GLMessage_DataType_Type_Type_MAX;
- static const int Type_ARRAYSIZE =
- GLMessage_DataType_Type_Type_ARRAYSIZE;
-
- // accessors -------------------------------------------------------
-
- // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
- inline bool has_type() const;
- inline void clear_type();
- static const int kTypeFieldNumber = 1;
- inline ::android::gltrace::GLMessage_DataType_Type type() const;
- inline void set_type(::android::gltrace::GLMessage_DataType_Type value);
-
- // required bool isArray = 2 [default = false];
- inline bool has_isarray() const;
- inline void clear_isarray();
- static const int kIsArrayFieldNumber = 2;
- inline bool isarray() const;
- inline void set_isarray(bool value);
-
- // repeated int32 intValue = 3;
- inline int intvalue_size() const;
- inline void clear_intvalue();
- static const int kIntValueFieldNumber = 3;
- inline ::google::protobuf::int32 intvalue(int index) const;
- inline void set_intvalue(int index, ::google::protobuf::int32 value);
- inline void add_intvalue(::google::protobuf::int32 value);
- inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
- intvalue() const;
- inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
- mutable_intvalue();
-
- // repeated float floatValue = 4;
- inline int floatvalue_size() const;
- inline void clear_floatvalue();
- static const int kFloatValueFieldNumber = 4;
- inline float floatvalue(int index) const;
- inline void set_floatvalue(int index, float value);
- inline void add_floatvalue(float value);
- inline const ::google::protobuf::RepeatedField< float >&
- floatvalue() const;
- inline ::google::protobuf::RepeatedField< float >*
- mutable_floatvalue();
-
- // repeated bytes charValue = 5;
- inline int charvalue_size() const;
- inline void clear_charvalue();
- static const int kCharValueFieldNumber = 5;
- inline const ::std::string& charvalue(int index) const;
- inline ::std::string* mutable_charvalue(int index);
- inline void set_charvalue(int index, const ::std::string& value);
- inline void set_charvalue(int index, const char* value);
- inline void set_charvalue(int index, const void* value, size_t size);
- inline ::std::string* add_charvalue();
- inline void add_charvalue(const ::std::string& value);
- inline void add_charvalue(const char* value);
- inline void add_charvalue(const void* value, size_t size);
- inline const ::google::protobuf::RepeatedPtrField< ::std::string>& charvalue() const;
- inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_charvalue();
-
- // repeated bytes rawBytes = 6;
- inline int rawbytes_size() const;
- inline void clear_rawbytes();
- static const int kRawBytesFieldNumber = 6;
- inline const ::std::string& rawbytes(int index) const;
- inline ::std::string* mutable_rawbytes(int index);
- inline void set_rawbytes(int index, const ::std::string& value);
- inline void set_rawbytes(int index, const char* value);
- inline void set_rawbytes(int index, const void* value, size_t size);
- inline ::std::string* add_rawbytes();
- inline void add_rawbytes(const ::std::string& value);
- inline void add_rawbytes(const char* value);
- inline void add_rawbytes(const void* value, size_t size);
- inline const ::google::protobuf::RepeatedPtrField< ::std::string>& rawbytes() const;
- inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_rawbytes();
-
- // repeated bool boolValue = 7;
- inline int boolvalue_size() const;
- inline void clear_boolvalue();
- static const int kBoolValueFieldNumber = 7;
- inline bool boolvalue(int index) const;
- inline void set_boolvalue(int index, bool value);
- inline void add_boolvalue(bool value);
- inline const ::google::protobuf::RepeatedField< bool >&
- boolvalue() const;
- inline ::google::protobuf::RepeatedField< bool >*
- mutable_boolvalue();
-
- // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage.DataType)
- private:
- mutable int _cached_size_;
-
- int type_;
- bool isarray_;
- ::google::protobuf::RepeatedField< ::google::protobuf::int32 > intvalue_;
- ::google::protobuf::RepeatedField< float > floatvalue_;
- ::google::protobuf::RepeatedPtrField< ::std::string> charvalue_;
- ::google::protobuf::RepeatedPtrField< ::std::string> rawbytes_;
- ::google::protobuf::RepeatedField< bool > boolvalue_;
- friend void protobuf_AddDesc_gltrace_2eproto();
- friend void protobuf_AssignDesc_gltrace_2eproto();
- friend void protobuf_ShutdownFile_gltrace_2eproto();
-
- ::google::protobuf::uint32 _has_bits_[(7 + 31) / 32];
-
- // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
- inline bool _has_bit(int index) const {
- return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
- }
- inline void _set_bit(int index) {
- _has_bits_[index / 32] |= (1u << (index % 32));
- }
- inline void _clear_bit(int index) {
- _has_bits_[index / 32] &= ~(1u << (index % 32));
- }
-
- void InitAsDefaultInstance();
- static GLMessage_DataType* default_instance_;
-};
-// -------------------------------------------------------------------
-
-class GLMessage_FrameBuffer : public ::google::protobuf::MessageLite {
- public:
- GLMessage_FrameBuffer();
- virtual ~GLMessage_FrameBuffer();
-
- GLMessage_FrameBuffer(const GLMessage_FrameBuffer& from);
-
- inline GLMessage_FrameBuffer& operator=(const GLMessage_FrameBuffer& from) {
- CopyFrom(from);
- return *this;
- }
-
- static const GLMessage_FrameBuffer& default_instance();
-
- void Swap(GLMessage_FrameBuffer* other);
-
- // implements Message ----------------------------------------------
-
- GLMessage_FrameBuffer* New() const;
- void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
- void CopyFrom(const GLMessage_FrameBuffer& from);
- void MergeFrom(const GLMessage_FrameBuffer& from);
- void Clear();
- bool IsInitialized() const;
-
- int ByteSize() const;
- bool MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input);
- void SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const;
- int GetCachedSize() const { return _cached_size_; }
- private:
- void SharedCtor();
- void SharedDtor();
- void SetCachedSize(int size) const;
- public:
-
- ::std::string GetTypeName() const;
-
- // nested types ----------------------------------------------------
-
- // accessors -------------------------------------------------------
-
- // required int32 width = 1;
- inline bool has_width() const;
- inline void clear_width();
- static const int kWidthFieldNumber = 1;
- inline ::google::protobuf::int32 width() const;
- inline void set_width(::google::protobuf::int32 value);
-
- // required int32 height = 2;
- inline bool has_height() const;
- inline void clear_height();
- static const int kHeightFieldNumber = 2;
- inline ::google::protobuf::int32 height() const;
- inline void set_height(::google::protobuf::int32 value);
-
- // repeated bytes contents = 3;
- inline int contents_size() const;
- inline void clear_contents();
- static const int kContentsFieldNumber = 3;
- inline const ::std::string& contents(int index) const;
- inline ::std::string* mutable_contents(int index);
- inline void set_contents(int index, const ::std::string& value);
- inline void set_contents(int index, const char* value);
- inline void set_contents(int index, const void* value, size_t size);
- inline ::std::string* add_contents();
- inline void add_contents(const ::std::string& value);
- inline void add_contents(const char* value);
- inline void add_contents(const void* value, size_t size);
- inline const ::google::protobuf::RepeatedPtrField< ::std::string>& contents() const;
- inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_contents();
-
- // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage.FrameBuffer)
- private:
- mutable int _cached_size_;
-
- ::google::protobuf::int32 width_;
- ::google::protobuf::int32 height_;
- ::google::protobuf::RepeatedPtrField< ::std::string> contents_;
- friend void protobuf_AddDesc_gltrace_2eproto();
- friend void protobuf_AssignDesc_gltrace_2eproto();
- friend void protobuf_ShutdownFile_gltrace_2eproto();
-
- ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
-
- // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
- inline bool _has_bit(int index) const {
- return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
- }
- inline void _set_bit(int index) {
- _has_bits_[index / 32] |= (1u << (index % 32));
- }
- inline void _clear_bit(int index) {
- _has_bits_[index / 32] &= ~(1u << (index % 32));
- }
-
- void InitAsDefaultInstance();
- static GLMessage_FrameBuffer* default_instance_;
-};
-// -------------------------------------------------------------------
-
-class GLMessage : public ::google::protobuf::MessageLite {
- public:
- GLMessage();
- virtual ~GLMessage();
-
- GLMessage(const GLMessage& from);
-
- inline GLMessage& operator=(const GLMessage& from) {
- CopyFrom(from);
- return *this;
- }
-
- static const GLMessage& default_instance();
-
- void Swap(GLMessage* other);
-
- // implements Message ----------------------------------------------
-
- GLMessage* New() const;
- void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
- void CopyFrom(const GLMessage& from);
- void MergeFrom(const GLMessage& from);
- void Clear();
- bool IsInitialized() const;
-
- int ByteSize() const;
- bool MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input);
- void SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const;
- int GetCachedSize() const { return _cached_size_; }
- private:
- void SharedCtor();
- void SharedDtor();
- void SetCachedSize(int size) const;
- public:
-
- ::std::string GetTypeName() const;
-
- // nested types ----------------------------------------------------
-
- typedef GLMessage_DataType DataType;
- typedef GLMessage_FrameBuffer FrameBuffer;
-
- typedef GLMessage_Function Function;
- static const Function glActiveTexture = GLMessage_Function_glActiveTexture;
- static const Function glAlphaFunc = GLMessage_Function_glAlphaFunc;
- static const Function glAlphaFuncx = GLMessage_Function_glAlphaFuncx;
- static const Function glAlphaFuncxOES = GLMessage_Function_glAlphaFuncxOES;
- static const Function glAttachShader = GLMessage_Function_glAttachShader;
- static const Function glBeginPerfMonitorAMD = GLMessage_Function_glBeginPerfMonitorAMD;
- static const Function glBindAttribLocation = GLMessage_Function_glBindAttribLocation;
- static const Function glBindBuffer = GLMessage_Function_glBindBuffer;
- static const Function glBindFramebuffer = GLMessage_Function_glBindFramebuffer;
- static const Function glBindFramebufferOES = GLMessage_Function_glBindFramebufferOES;
- static const Function glBindRenderbuffer = GLMessage_Function_glBindRenderbuffer;
- static const Function glBindRenderbufferOES = GLMessage_Function_glBindRenderbufferOES;
- static const Function glBindTexture = GLMessage_Function_glBindTexture;
- static const Function glBindVertexArrayOES = GLMessage_Function_glBindVertexArrayOES;
- static const Function glBlendColor = GLMessage_Function_glBlendColor;
- static const Function glBlendEquation = GLMessage_Function_glBlendEquation;
- static const Function glBlendEquationOES = GLMessage_Function_glBlendEquationOES;
- static const Function glBlendEquationSeparate = GLMessage_Function_glBlendEquationSeparate;
- static const Function glBlendEquationSeparateOES = GLMessage_Function_glBlendEquationSeparateOES;
- static const Function glBlendFunc = GLMessage_Function_glBlendFunc;
- static const Function glBlendFuncSeparate = GLMessage_Function_glBlendFuncSeparate;
- static const Function glBlendFuncSeparateOES = GLMessage_Function_glBlendFuncSeparateOES;
- static const Function glBufferData = GLMessage_Function_glBufferData;
- static const Function glBufferSubData = GLMessage_Function_glBufferSubData;
- static const Function glCheckFramebufferStatus = GLMessage_Function_glCheckFramebufferStatus;
- static const Function glCheckFramebufferStatusOES = GLMessage_Function_glCheckFramebufferStatusOES;
- static const Function glClearColor = GLMessage_Function_glClearColor;
- static const Function glClearColorx = GLMessage_Function_glClearColorx;
- static const Function glClearColorxOES = GLMessage_Function_glClearColorxOES;
- static const Function glClearDepthf = GLMessage_Function_glClearDepthf;
- static const Function glClearDepthfOES = GLMessage_Function_glClearDepthfOES;
- static const Function glClearDepthx = GLMessage_Function_glClearDepthx;
- static const Function glClearDepthxOES = GLMessage_Function_glClearDepthxOES;
- static const Function glClear = GLMessage_Function_glClear;
- static const Function glClearStencil = GLMessage_Function_glClearStencil;
- static const Function glClientActiveTexture = GLMessage_Function_glClientActiveTexture;
- static const Function glClipPlanef = GLMessage_Function_glClipPlanef;
- static const Function glClipPlanefIMG = GLMessage_Function_glClipPlanefIMG;
- static const Function glClipPlanefOES = GLMessage_Function_glClipPlanefOES;
- static const Function glClipPlanex = GLMessage_Function_glClipPlanex;
- static const Function glClipPlanexIMG = GLMessage_Function_glClipPlanexIMG;
- static const Function glClipPlanexOES = GLMessage_Function_glClipPlanexOES;
- static const Function glColor4f = GLMessage_Function_glColor4f;
- static const Function glColor4ub = GLMessage_Function_glColor4ub;
- static const Function glColor4x = GLMessage_Function_glColor4x;
- static const Function glColor4xOES = GLMessage_Function_glColor4xOES;
- static const Function glColorMask = GLMessage_Function_glColorMask;
- static const Function glColorPointer = GLMessage_Function_glColorPointer;
- static const Function glCompileShader = GLMessage_Function_glCompileShader;
- static const Function glCompressedTexImage2D = GLMessage_Function_glCompressedTexImage2D;
- static const Function glCompressedTexImage3DOES = GLMessage_Function_glCompressedTexImage3DOES;
- static const Function glCompressedTexSubImage2D = GLMessage_Function_glCompressedTexSubImage2D;
- static const Function glCompressedTexSubImage3DOES = GLMessage_Function_glCompressedTexSubImage3DOES;
- static const Function glCopyTexImage2D = GLMessage_Function_glCopyTexImage2D;
- static const Function glCopyTexSubImage2D = GLMessage_Function_glCopyTexSubImage2D;
- static const Function glCopyTexSubImage3DOES = GLMessage_Function_glCopyTexSubImage3DOES;
- static const Function glCoverageMaskNV = GLMessage_Function_glCoverageMaskNV;
- static const Function glCoverageOperationNV = GLMessage_Function_glCoverageOperationNV;
- static const Function glCreateProgram = GLMessage_Function_glCreateProgram;
- static const Function glCreateShader = GLMessage_Function_glCreateShader;
- static const Function glCullFace = GLMessage_Function_glCullFace;
- static const Function glCurrentPaletteMatrixOES = GLMessage_Function_glCurrentPaletteMatrixOES;
- static const Function glDeleteBuffers = GLMessage_Function_glDeleteBuffers;
- static const Function glDeleteFencesNV = GLMessage_Function_glDeleteFencesNV;
- static const Function glDeleteFramebuffers = GLMessage_Function_glDeleteFramebuffers;
- static const Function glDeleteFramebuffersOES = GLMessage_Function_glDeleteFramebuffersOES;
- static const Function glDeletePerfMonitorsAMD = GLMessage_Function_glDeletePerfMonitorsAMD;
- static const Function glDeleteProgram = GLMessage_Function_glDeleteProgram;
- static const Function glDeleteRenderbuffers = GLMessage_Function_glDeleteRenderbuffers;
- static const Function glDeleteRenderbuffersOES = GLMessage_Function_glDeleteRenderbuffersOES;
- static const Function glDeleteShader = GLMessage_Function_glDeleteShader;
- static const Function glDeleteTextures = GLMessage_Function_glDeleteTextures;
- static const Function glDeleteVertexArraysOES = GLMessage_Function_glDeleteVertexArraysOES;
- static const Function glDepthFunc = GLMessage_Function_glDepthFunc;
- static const Function glDepthMask = GLMessage_Function_glDepthMask;
- static const Function glDepthRangef = GLMessage_Function_glDepthRangef;
- static const Function glDepthRangefOES = GLMessage_Function_glDepthRangefOES;
- static const Function glDepthRangex = GLMessage_Function_glDepthRangex;
- static const Function glDepthRangexOES = GLMessage_Function_glDepthRangexOES;
- static const Function glDetachShader = GLMessage_Function_glDetachShader;
- static const Function glDisableClientState = GLMessage_Function_glDisableClientState;
- static const Function glDisableDriverControlQCOM = GLMessage_Function_glDisableDriverControlQCOM;
- static const Function glDisable = GLMessage_Function_glDisable;
- static const Function glDisableVertexAttribArray = GLMessage_Function_glDisableVertexAttribArray;
- static const Function glDiscardFramebufferEXT = GLMessage_Function_glDiscardFramebufferEXT;
- static const Function glDrawArrays = GLMessage_Function_glDrawArrays;
- static const Function glDrawElements = GLMessage_Function_glDrawElements;
- static const Function glDrawTexfOES = GLMessage_Function_glDrawTexfOES;
- static const Function glDrawTexfvOES = GLMessage_Function_glDrawTexfvOES;
- static const Function glDrawTexiOES = GLMessage_Function_glDrawTexiOES;
- static const Function glDrawTexivOES = GLMessage_Function_glDrawTexivOES;
- static const Function glDrawTexsOES = GLMessage_Function_glDrawTexsOES;
- static const Function glDrawTexsvOES = GLMessage_Function_glDrawTexsvOES;
- static const Function glDrawTexxOES = GLMessage_Function_glDrawTexxOES;
- static const Function glDrawTexxvOES = GLMessage_Function_glDrawTexxvOES;
- static const Function glEGLImageTargetRenderbufferStorageOES = GLMessage_Function_glEGLImageTargetRenderbufferStorageOES;
- static const Function glEGLImageTargetTexture2DOES = GLMessage_Function_glEGLImageTargetTexture2DOES;
- static const Function glEnableClientState = GLMessage_Function_glEnableClientState;
- static const Function glEnableDriverControlQCOM = GLMessage_Function_glEnableDriverControlQCOM;
- static const Function glEnable = GLMessage_Function_glEnable;
- static const Function glEnableVertexAttribArray = GLMessage_Function_glEnableVertexAttribArray;
- static const Function glEndPerfMonitorAMD = GLMessage_Function_glEndPerfMonitorAMD;
- static const Function glEndTilingQCOM = GLMessage_Function_glEndTilingQCOM;
- static const Function glExtGetBufferPointervQCOM = GLMessage_Function_glExtGetBufferPointervQCOM;
- static const Function glExtGetBuffersQCOM = GLMessage_Function_glExtGetBuffersQCOM;
- static const Function glExtGetFramebuffersQCOM = GLMessage_Function_glExtGetFramebuffersQCOM;
- static const Function glExtGetProgramBinarySourceQCOM = GLMessage_Function_glExtGetProgramBinarySourceQCOM;
- static const Function glExtGetProgramsQCOM = GLMessage_Function_glExtGetProgramsQCOM;
- static const Function glExtGetRenderbuffersQCOM = GLMessage_Function_glExtGetRenderbuffersQCOM;
- static const Function glExtGetShadersQCOM = GLMessage_Function_glExtGetShadersQCOM;
- static const Function glExtGetTexLevelParameterivQCOM = GLMessage_Function_glExtGetTexLevelParameterivQCOM;
- static const Function glExtGetTexSubImageQCOM = GLMessage_Function_glExtGetTexSubImageQCOM;
- static const Function glExtGetTexturesQCOM = GLMessage_Function_glExtGetTexturesQCOM;
- static const Function glExtIsProgramBinaryQCOM = GLMessage_Function_glExtIsProgramBinaryQCOM;
- static const Function glExtTexObjectStateOverrideiQCOM = GLMessage_Function_glExtTexObjectStateOverrideiQCOM;
- static const Function glFinishFenceNV = GLMessage_Function_glFinishFenceNV;
- static const Function glFinish = GLMessage_Function_glFinish;
- static const Function glFlush = GLMessage_Function_glFlush;
- static const Function glFogf = GLMessage_Function_glFogf;
- static const Function glFogfv = GLMessage_Function_glFogfv;
- static const Function glFogx = GLMessage_Function_glFogx;
- static const Function glFogxOES = GLMessage_Function_glFogxOES;
- static const Function glFogxv = GLMessage_Function_glFogxv;
- static const Function glFogxvOES = GLMessage_Function_glFogxvOES;
- static const Function glFramebufferRenderbuffer = GLMessage_Function_glFramebufferRenderbuffer;
- static const Function glFramebufferRenderbufferOES = GLMessage_Function_glFramebufferRenderbufferOES;
- static const Function glFramebufferTexture2D = GLMessage_Function_glFramebufferTexture2D;
- static const Function glFramebufferTexture2DMultisampleIMG = GLMessage_Function_glFramebufferTexture2DMultisampleIMG;
- static const Function glFramebufferTexture2DOES = GLMessage_Function_glFramebufferTexture2DOES;
- static const Function glFramebufferTexture3DOES = GLMessage_Function_glFramebufferTexture3DOES;
- static const Function glFrontFace = GLMessage_Function_glFrontFace;
- static const Function glFrustumf = GLMessage_Function_glFrustumf;
- static const Function glFrustumfOES = GLMessage_Function_glFrustumfOES;
- static const Function glFrustumx = GLMessage_Function_glFrustumx;
- static const Function glFrustumxOES = GLMessage_Function_glFrustumxOES;
- static const Function glGenBuffers = GLMessage_Function_glGenBuffers;
- static const Function glGenerateMipmap = GLMessage_Function_glGenerateMipmap;
- static const Function glGenerateMipmapOES = GLMessage_Function_glGenerateMipmapOES;
- static const Function glGenFencesNV = GLMessage_Function_glGenFencesNV;
- static const Function glGenFramebuffers = GLMessage_Function_glGenFramebuffers;
- static const Function glGenFramebuffersOES = GLMessage_Function_glGenFramebuffersOES;
- static const Function glGenPerfMonitorsAMD = GLMessage_Function_glGenPerfMonitorsAMD;
- static const Function glGenRenderbuffers = GLMessage_Function_glGenRenderbuffers;
- static const Function glGenRenderbuffersOES = GLMessage_Function_glGenRenderbuffersOES;
- static const Function glGenTextures = GLMessage_Function_glGenTextures;
- static const Function glGenVertexArraysOES = GLMessage_Function_glGenVertexArraysOES;
- static const Function glGetActiveAttrib = GLMessage_Function_glGetActiveAttrib;
- static const Function glGetActiveUniform = GLMessage_Function_glGetActiveUniform;
- static const Function glGetAttachedShaders = GLMessage_Function_glGetAttachedShaders;
- static const Function glGetAttribLocation = GLMessage_Function_glGetAttribLocation;
- static const Function glGetBooleanv = GLMessage_Function_glGetBooleanv;
- static const Function glGetBufferParameteriv = GLMessage_Function_glGetBufferParameteriv;
- static const Function glGetBufferPointervOES = GLMessage_Function_glGetBufferPointervOES;
- static const Function glGetClipPlanef = GLMessage_Function_glGetClipPlanef;
- static const Function glGetClipPlanefOES = GLMessage_Function_glGetClipPlanefOES;
- static const Function glGetClipPlanex = GLMessage_Function_glGetClipPlanex;
- static const Function glGetClipPlanexOES = GLMessage_Function_glGetClipPlanexOES;
- static const Function glGetDriverControlsQCOM = GLMessage_Function_glGetDriverControlsQCOM;
- static const Function glGetDriverControlStringQCOM = GLMessage_Function_glGetDriverControlStringQCOM;
- static const Function glGetError = GLMessage_Function_glGetError;
- static const Function glGetFenceivNV = GLMessage_Function_glGetFenceivNV;
- static const Function glGetFixedv = GLMessage_Function_glGetFixedv;
- static const Function glGetFixedvOES = GLMessage_Function_glGetFixedvOES;
- static const Function glGetFloatv = GLMessage_Function_glGetFloatv;
- static const Function glGetFramebufferAttachmentParameteriv = GLMessage_Function_glGetFramebufferAttachmentParameteriv;
- static const Function glGetFramebufferAttachmentParameterivOES = GLMessage_Function_glGetFramebufferAttachmentParameterivOES;
- static const Function glGetIntegerv = GLMessage_Function_glGetIntegerv;
- static const Function glGetLightfv = GLMessage_Function_glGetLightfv;
- static const Function glGetLightxv = GLMessage_Function_glGetLightxv;
- static const Function glGetLightxvOES = GLMessage_Function_glGetLightxvOES;
- static const Function glGetMaterialfv = GLMessage_Function_glGetMaterialfv;
- static const Function glGetMaterialxv = GLMessage_Function_glGetMaterialxv;
- static const Function glGetMaterialxvOES = GLMessage_Function_glGetMaterialxvOES;
- static const Function glGetPerfMonitorCounterDataAMD = GLMessage_Function_glGetPerfMonitorCounterDataAMD;
- static const Function glGetPerfMonitorCounterInfoAMD = GLMessage_Function_glGetPerfMonitorCounterInfoAMD;
- static const Function glGetPerfMonitorCountersAMD = GLMessage_Function_glGetPerfMonitorCountersAMD;
- static const Function glGetPerfMonitorCounterStringAMD = GLMessage_Function_glGetPerfMonitorCounterStringAMD;
- static const Function glGetPerfMonitorGroupsAMD = GLMessage_Function_glGetPerfMonitorGroupsAMD;
- static const Function glGetPerfMonitorGroupStringAMD = GLMessage_Function_glGetPerfMonitorGroupStringAMD;
- static const Function glGetPointerv = GLMessage_Function_glGetPointerv;
- static const Function glGetProgramBinaryOES = GLMessage_Function_glGetProgramBinaryOES;
- static const Function glGetProgramInfoLog = GLMessage_Function_glGetProgramInfoLog;
- static const Function glGetProgramiv = GLMessage_Function_glGetProgramiv;
- static const Function glGetRenderbufferParameteriv = GLMessage_Function_glGetRenderbufferParameteriv;
- static const Function glGetRenderbufferParameterivOES = GLMessage_Function_glGetRenderbufferParameterivOES;
- static const Function glGetShaderInfoLog = GLMessage_Function_glGetShaderInfoLog;
- static const Function glGetShaderiv = GLMessage_Function_glGetShaderiv;
- static const Function glGetShaderPrecisionFormat = GLMessage_Function_glGetShaderPrecisionFormat;
- static const Function glGetShaderSource = GLMessage_Function_glGetShaderSource;
- static const Function glGetString = GLMessage_Function_glGetString;
- static const Function glGetTexEnvfv = GLMessage_Function_glGetTexEnvfv;
- static const Function glGetTexEnviv = GLMessage_Function_glGetTexEnviv;
- static const Function glGetTexEnvxv = GLMessage_Function_glGetTexEnvxv;
- static const Function glGetTexEnvxvOES = GLMessage_Function_glGetTexEnvxvOES;
- static const Function glGetTexGenfvOES = GLMessage_Function_glGetTexGenfvOES;
- static const Function glGetTexGenivOES = GLMessage_Function_glGetTexGenivOES;
- static const Function glGetTexGenxvOES = GLMessage_Function_glGetTexGenxvOES;
- static const Function glGetTexParameterfv = GLMessage_Function_glGetTexParameterfv;
- static const Function glGetTexParameteriv = GLMessage_Function_glGetTexParameteriv;
- static const Function glGetTexParameterxv = GLMessage_Function_glGetTexParameterxv;
- static const Function glGetTexParameterxvOES = GLMessage_Function_glGetTexParameterxvOES;
- static const Function glGetUniformfv = GLMessage_Function_glGetUniformfv;
- static const Function glGetUniformiv = GLMessage_Function_glGetUniformiv;
- static const Function glGetUniformLocation = GLMessage_Function_glGetUniformLocation;
- static const Function glGetVertexAttribfv = GLMessage_Function_glGetVertexAttribfv;
- static const Function glGetVertexAttribiv = GLMessage_Function_glGetVertexAttribiv;
- static const Function glGetVertexAttribPointerv = GLMessage_Function_glGetVertexAttribPointerv;
- static const Function glHint = GLMessage_Function_glHint;
- static const Function glIsBuffer = GLMessage_Function_glIsBuffer;
- static const Function glIsEnabled = GLMessage_Function_glIsEnabled;
- static const Function glIsFenceNV = GLMessage_Function_glIsFenceNV;
- static const Function glIsFramebuffer = GLMessage_Function_glIsFramebuffer;
- static const Function glIsFramebufferOES = GLMessage_Function_glIsFramebufferOES;
- static const Function glIsProgram = GLMessage_Function_glIsProgram;
- static const Function glIsRenderbuffer = GLMessage_Function_glIsRenderbuffer;
- static const Function glIsRenderbufferOES = GLMessage_Function_glIsRenderbufferOES;
- static const Function glIsShader = GLMessage_Function_glIsShader;
- static const Function glIsTexture = GLMessage_Function_glIsTexture;
- static const Function glIsVertexArrayOES = GLMessage_Function_glIsVertexArrayOES;
- static const Function glLightf = GLMessage_Function_glLightf;
- static const Function glLightfv = GLMessage_Function_glLightfv;
- static const Function glLightModelf = GLMessage_Function_glLightModelf;
- static const Function glLightModelfv = GLMessage_Function_glLightModelfv;
- static const Function glLightModelx = GLMessage_Function_glLightModelx;
- static const Function glLightModelxOES = GLMessage_Function_glLightModelxOES;
- static const Function glLightModelxv = GLMessage_Function_glLightModelxv;
- static const Function glLightModelxvOES = GLMessage_Function_glLightModelxvOES;
- static const Function glLightx = GLMessage_Function_glLightx;
- static const Function glLightxOES = GLMessage_Function_glLightxOES;
- static const Function glLightxv = GLMessage_Function_glLightxv;
- static const Function glLightxvOES = GLMessage_Function_glLightxvOES;
- static const Function glLineWidth = GLMessage_Function_glLineWidth;
- static const Function glLineWidthx = GLMessage_Function_glLineWidthx;
- static const Function glLineWidthxOES = GLMessage_Function_glLineWidthxOES;
- static const Function glLinkProgram = GLMessage_Function_glLinkProgram;
- static const Function glLoadIdentity = GLMessage_Function_glLoadIdentity;
- static const Function glLoadMatrixf = GLMessage_Function_glLoadMatrixf;
- static const Function glLoadMatrixx = GLMessage_Function_glLoadMatrixx;
- static const Function glLoadMatrixxOES = GLMessage_Function_glLoadMatrixxOES;
- static const Function glLoadPaletteFromModelViewMatrixOES = GLMessage_Function_glLoadPaletteFromModelViewMatrixOES;
- static const Function glLogicOp = GLMessage_Function_glLogicOp;
- static const Function glMapBufferOES = GLMessage_Function_glMapBufferOES;
- static const Function glMaterialf = GLMessage_Function_glMaterialf;
- static const Function glMaterialfv = GLMessage_Function_glMaterialfv;
- static const Function glMaterialx = GLMessage_Function_glMaterialx;
- static const Function glMaterialxOES = GLMessage_Function_glMaterialxOES;
- static const Function glMaterialxv = GLMessage_Function_glMaterialxv;
- static const Function glMaterialxvOES = GLMessage_Function_glMaterialxvOES;
- static const Function glMatrixIndexPointerOES = GLMessage_Function_glMatrixIndexPointerOES;
- static const Function glMatrixMode = GLMessage_Function_glMatrixMode;
- static const Function glMultiDrawArraysEXT = GLMessage_Function_glMultiDrawArraysEXT;
- static const Function glMultiDrawElementsEXT = GLMessage_Function_glMultiDrawElementsEXT;
- static const Function glMultiTexCoord4f = GLMessage_Function_glMultiTexCoord4f;
- static const Function glMultiTexCoord4x = GLMessage_Function_glMultiTexCoord4x;
- static const Function glMultiTexCoord4xOES = GLMessage_Function_glMultiTexCoord4xOES;
- static const Function glMultMatrixf = GLMessage_Function_glMultMatrixf;
- static const Function glMultMatrixx = GLMessage_Function_glMultMatrixx;
- static const Function glMultMatrixxOES = GLMessage_Function_glMultMatrixxOES;
- static const Function glNormal3f = GLMessage_Function_glNormal3f;
- static const Function glNormal3x = GLMessage_Function_glNormal3x;
- static const Function glNormal3xOES = GLMessage_Function_glNormal3xOES;
- static const Function glNormalPointer = GLMessage_Function_glNormalPointer;
- static const Function glOrthof = GLMessage_Function_glOrthof;
- static const Function glOrthofOES = GLMessage_Function_glOrthofOES;
- static const Function glOrthox = GLMessage_Function_glOrthox;
- static const Function glOrthoxOES = GLMessage_Function_glOrthoxOES;
- static const Function glPixelStorei = GLMessage_Function_glPixelStorei;
- static const Function glPointParameterf = GLMessage_Function_glPointParameterf;
- static const Function glPointParameterfv = GLMessage_Function_glPointParameterfv;
- static const Function glPointParameterx = GLMessage_Function_glPointParameterx;
- static const Function glPointParameterxOES = GLMessage_Function_glPointParameterxOES;
- static const Function glPointParameterxv = GLMessage_Function_glPointParameterxv;
- static const Function glPointParameterxvOES = GLMessage_Function_glPointParameterxvOES;
- static const Function glPointSize = GLMessage_Function_glPointSize;
- static const Function glPointSizePointerOES = GLMessage_Function_glPointSizePointerOES;
- static const Function glPointSizex = GLMessage_Function_glPointSizex;
- static const Function glPointSizexOES = GLMessage_Function_glPointSizexOES;
- static const Function glPolygonOffset = GLMessage_Function_glPolygonOffset;
- static const Function glPolygonOffsetx = GLMessage_Function_glPolygonOffsetx;
- static const Function glPolygonOffsetxOES = GLMessage_Function_glPolygonOffsetxOES;
- static const Function glPopMatrix = GLMessage_Function_glPopMatrix;
- static const Function glProgramBinaryOES = GLMessage_Function_glProgramBinaryOES;
- static const Function glPushMatrix = GLMessage_Function_glPushMatrix;
- static const Function glQueryMatrixxOES = GLMessage_Function_glQueryMatrixxOES;
- static const Function glReadPixels = GLMessage_Function_glReadPixels;
- static const Function glReleaseShaderCompiler = GLMessage_Function_glReleaseShaderCompiler;
- static const Function glRenderbufferStorage = GLMessage_Function_glRenderbufferStorage;
- static const Function glRenderbufferStorageMultisampleIMG = GLMessage_Function_glRenderbufferStorageMultisampleIMG;
- static const Function glRenderbufferStorageOES = GLMessage_Function_glRenderbufferStorageOES;
- static const Function glRotatef = GLMessage_Function_glRotatef;
- static const Function glRotatex = GLMessage_Function_glRotatex;
- static const Function glRotatexOES = GLMessage_Function_glRotatexOES;
- static const Function glSampleCoverage = GLMessage_Function_glSampleCoverage;
- static const Function glSampleCoveragex = GLMessage_Function_glSampleCoveragex;
- static const Function glSampleCoveragexOES = GLMessage_Function_glSampleCoveragexOES;
- static const Function glScalef = GLMessage_Function_glScalef;
- static const Function glScalex = GLMessage_Function_glScalex;
- static const Function glScalexOES = GLMessage_Function_glScalexOES;
- static const Function glScissor = GLMessage_Function_glScissor;
- static const Function glSelectPerfMonitorCountersAMD = GLMessage_Function_glSelectPerfMonitorCountersAMD;
- static const Function glSetFenceNV = GLMessage_Function_glSetFenceNV;
- static const Function glShadeModel = GLMessage_Function_glShadeModel;
- static const Function glShaderBinary = GLMessage_Function_glShaderBinary;
- static const Function glShaderSource = GLMessage_Function_glShaderSource;
- static const Function glStartTilingQCOM = GLMessage_Function_glStartTilingQCOM;
- static const Function glStencilFunc = GLMessage_Function_glStencilFunc;
- static const Function glStencilFuncSeparate = GLMessage_Function_glStencilFuncSeparate;
- static const Function glStencilMask = GLMessage_Function_glStencilMask;
- static const Function glStencilMaskSeparate = GLMessage_Function_glStencilMaskSeparate;
- static const Function glStencilOp = GLMessage_Function_glStencilOp;
- static const Function glStencilOpSeparate = GLMessage_Function_glStencilOpSeparate;
- static const Function glTestFenceNV = GLMessage_Function_glTestFenceNV;
- static const Function glTexCoordPointer = GLMessage_Function_glTexCoordPointer;
- static const Function glTexEnvf = GLMessage_Function_glTexEnvf;
- static const Function glTexEnvfv = GLMessage_Function_glTexEnvfv;
- static const Function glTexEnvi = GLMessage_Function_glTexEnvi;
- static const Function glTexEnviv = GLMessage_Function_glTexEnviv;
- static const Function glTexEnvx = GLMessage_Function_glTexEnvx;
- static const Function glTexEnvxOES = GLMessage_Function_glTexEnvxOES;
- static const Function glTexEnvxv = GLMessage_Function_glTexEnvxv;
- static const Function glTexEnvxvOES = GLMessage_Function_glTexEnvxvOES;
- static const Function glTexGenfOES = GLMessage_Function_glTexGenfOES;
- static const Function glTexGenfvOES = GLMessage_Function_glTexGenfvOES;
- static const Function glTexGeniOES = GLMessage_Function_glTexGeniOES;
- static const Function glTexGenivOES = GLMessage_Function_glTexGenivOES;
- static const Function glTexGenxOES = GLMessage_Function_glTexGenxOES;
- static const Function glTexGenxvOES = GLMessage_Function_glTexGenxvOES;
- static const Function glTexImage2D = GLMessage_Function_glTexImage2D;
- static const Function glTexImage3DOES = GLMessage_Function_glTexImage3DOES;
- static const Function glTexParameterf = GLMessage_Function_glTexParameterf;
- static const Function glTexParameterfv = GLMessage_Function_glTexParameterfv;
- static const Function glTexParameteri = GLMessage_Function_glTexParameteri;
- static const Function glTexParameteriv = GLMessage_Function_glTexParameteriv;
- static const Function glTexParameterx = GLMessage_Function_glTexParameterx;
- static const Function glTexParameterxOES = GLMessage_Function_glTexParameterxOES;
- static const Function glTexParameterxv = GLMessage_Function_glTexParameterxv;
- static const Function glTexParameterxvOES = GLMessage_Function_glTexParameterxvOES;
- static const Function glTexSubImage2D = GLMessage_Function_glTexSubImage2D;
- static const Function glTexSubImage3DOES = GLMessage_Function_glTexSubImage3DOES;
- static const Function glTranslatef = GLMessage_Function_glTranslatef;
- static const Function glTranslatex = GLMessage_Function_glTranslatex;
- static const Function glTranslatexOES = GLMessage_Function_glTranslatexOES;
- static const Function glUniform1f = GLMessage_Function_glUniform1f;
- static const Function glUniform1fv = GLMessage_Function_glUniform1fv;
- static const Function glUniform1i = GLMessage_Function_glUniform1i;
- static const Function glUniform1iv = GLMessage_Function_glUniform1iv;
- static const Function glUniform2f = GLMessage_Function_glUniform2f;
- static const Function glUniform2fv = GLMessage_Function_glUniform2fv;
- static const Function glUniform2i = GLMessage_Function_glUniform2i;
- static const Function glUniform2iv = GLMessage_Function_glUniform2iv;
- static const Function glUniform3f = GLMessage_Function_glUniform3f;
- static const Function glUniform3fv = GLMessage_Function_glUniform3fv;
- static const Function glUniform3i = GLMessage_Function_glUniform3i;
- static const Function glUniform3iv = GLMessage_Function_glUniform3iv;
- static const Function glUniform4f = GLMessage_Function_glUniform4f;
- static const Function glUniform4fv = GLMessage_Function_glUniform4fv;
- static const Function glUniform4i = GLMessage_Function_glUniform4i;
- static const Function glUniform4iv = GLMessage_Function_glUniform4iv;
- static const Function glUniformMatrix2fv = GLMessage_Function_glUniformMatrix2fv;
- static const Function glUniformMatrix3fv = GLMessage_Function_glUniformMatrix3fv;
- static const Function glUniformMatrix4fv = GLMessage_Function_glUniformMatrix4fv;
- static const Function glUnmapBufferOES = GLMessage_Function_glUnmapBufferOES;
- static const Function glUseProgram = GLMessage_Function_glUseProgram;
- static const Function glValidateProgram = GLMessage_Function_glValidateProgram;
- static const Function glVertexAttrib1f = GLMessage_Function_glVertexAttrib1f;
- static const Function glVertexAttrib1fv = GLMessage_Function_glVertexAttrib1fv;
- static const Function glVertexAttrib2f = GLMessage_Function_glVertexAttrib2f;
- static const Function glVertexAttrib2fv = GLMessage_Function_glVertexAttrib2fv;
- static const Function glVertexAttrib3f = GLMessage_Function_glVertexAttrib3f;
- static const Function glVertexAttrib3fv = GLMessage_Function_glVertexAttrib3fv;
- static const Function glVertexAttrib4f = GLMessage_Function_glVertexAttrib4f;
- static const Function glVertexAttrib4fv = GLMessage_Function_glVertexAttrib4fv;
- static const Function glVertexAttribPointer = GLMessage_Function_glVertexAttribPointer;
- static const Function glVertexPointer = GLMessage_Function_glVertexPointer;
- static const Function glViewport = GLMessage_Function_glViewport;
- static const Function glWeightPointerOES = GLMessage_Function_glWeightPointerOES;
- static const Function glActiveShaderProgramEXT = GLMessage_Function_glActiveShaderProgramEXT;
- static const Function glAlphaFuncQCOM = GLMessage_Function_glAlphaFuncQCOM;
- static const Function glBeginQueryEXT = GLMessage_Function_glBeginQueryEXT;
- static const Function glBindProgramPipelineEXT = GLMessage_Function_glBindProgramPipelineEXT;
- static const Function glBlitFramebufferANGLE = GLMessage_Function_glBlitFramebufferANGLE;
- static const Function glCreateShaderProgramvEXT = GLMessage_Function_glCreateShaderProgramvEXT;
- static const Function glDeleteProgramPipelinesEXT = GLMessage_Function_glDeleteProgramPipelinesEXT;
- static const Function glDeleteQueriesEXT = GLMessage_Function_glDeleteQueriesEXT;
- static const Function glDrawBuffersNV = GLMessage_Function_glDrawBuffersNV;
- static const Function glEndQueryEXT = GLMessage_Function_glEndQueryEXT;
- static const Function glFramebufferTexture2DMultisampleEXT = GLMessage_Function_glFramebufferTexture2DMultisampleEXT;
- static const Function glGenProgramPipelinesEXT = GLMessage_Function_glGenProgramPipelinesEXT;
- static const Function glGenQueriesEXT = GLMessage_Function_glGenQueriesEXT;
- static const Function glGetGraphicsResetStatusEXT = GLMessage_Function_glGetGraphicsResetStatusEXT;
- static const Function glGetObjectLabelEXT = GLMessage_Function_glGetObjectLabelEXT;
- static const Function glGetProgramPipelineInfoLogEXT = GLMessage_Function_glGetProgramPipelineInfoLogEXT;
- static const Function glGetProgramPipelineivEXT = GLMessage_Function_glGetProgramPipelineivEXT;
- static const Function glGetQueryObjectuivEXT = GLMessage_Function_glGetQueryObjectuivEXT;
- static const Function glGetQueryivEXT = GLMessage_Function_glGetQueryivEXT;
- static const Function glGetnUniformfvEXT = GLMessage_Function_glGetnUniformfvEXT;
- static const Function glGetnUniformivEXT = GLMessage_Function_glGetnUniformivEXT;
- static const Function glInsertEventMarkerEXT = GLMessage_Function_glInsertEventMarkerEXT;
- static const Function glIsProgramPipelineEXT = GLMessage_Function_glIsProgramPipelineEXT;
- static const Function glIsQueryEXT = GLMessage_Function_glIsQueryEXT;
- static const Function glLabelObjectEXT = GLMessage_Function_glLabelObjectEXT;
- static const Function glPopGroupMarkerEXT = GLMessage_Function_glPopGroupMarkerEXT;
- static const Function glProgramParameteriEXT = GLMessage_Function_glProgramParameteriEXT;
- static const Function glProgramUniform1fEXT = GLMessage_Function_glProgramUniform1fEXT;
- static const Function glProgramUniform1fvEXT = GLMessage_Function_glProgramUniform1fvEXT;
- static const Function glProgramUniform1iEXT = GLMessage_Function_glProgramUniform1iEXT;
- static const Function glProgramUniform1ivEXT = GLMessage_Function_glProgramUniform1ivEXT;
- static const Function glProgramUniform2fEXT = GLMessage_Function_glProgramUniform2fEXT;
- static const Function glProgramUniform2fvEXT = GLMessage_Function_glProgramUniform2fvEXT;
- static const Function glProgramUniform2iEXT = GLMessage_Function_glProgramUniform2iEXT;
- static const Function glProgramUniform2ivEXT = GLMessage_Function_glProgramUniform2ivEXT;
- static const Function glProgramUniform3fEXT = GLMessage_Function_glProgramUniform3fEXT;
- static const Function glProgramUniform3fvEXT = GLMessage_Function_glProgramUniform3fvEXT;
- static const Function glProgramUniform3iEXT = GLMessage_Function_glProgramUniform3iEXT;
- static const Function glProgramUniform3ivEXT = GLMessage_Function_glProgramUniform3ivEXT;
- static const Function glProgramUniform4fEXT = GLMessage_Function_glProgramUniform4fEXT;
- static const Function glProgramUniform4fvEXT = GLMessage_Function_glProgramUniform4fvEXT;
- static const Function glProgramUniform4iEXT = GLMessage_Function_glProgramUniform4iEXT;
- static const Function glProgramUniform4ivEXT = GLMessage_Function_glProgramUniform4ivEXT;
- static const Function glProgramUniformMatrix2fvEXT = GLMessage_Function_glProgramUniformMatrix2fvEXT;
- static const Function glProgramUniformMatrix3fvEXT = GLMessage_Function_glProgramUniformMatrix3fvEXT;
- static const Function glProgramUniformMatrix4fvEXT = GLMessage_Function_glProgramUniformMatrix4fvEXT;
- static const Function glPushGroupMarkerEXT = GLMessage_Function_glPushGroupMarkerEXT;
- static const Function glReadBufferNV = GLMessage_Function_glReadBufferNV;
- static const Function glReadnPixelsEXT = GLMessage_Function_glReadnPixelsEXT;
- static const Function glRenderbufferStorageMultisampleANGLE = GLMessage_Function_glRenderbufferStorageMultisampleANGLE;
- static const Function glRenderbufferStorageMultisampleAPPLE = GLMessage_Function_glRenderbufferStorageMultisampleAPPLE;
- static const Function glRenderbufferStorageMultisampleEXT = GLMessage_Function_glRenderbufferStorageMultisampleEXT;
- static const Function glResolveMultisampleFramebufferAPPLE = GLMessage_Function_glResolveMultisampleFramebufferAPPLE;
- static const Function glTexStorage1DEXT = GLMessage_Function_glTexStorage1DEXT;
- static const Function glTexStorage2DEXT = GLMessage_Function_glTexStorage2DEXT;
- static const Function glTexStorage3DEXT = GLMessage_Function_glTexStorage3DEXT;
- static const Function glTextureStorage1DEXT = GLMessage_Function_glTextureStorage1DEXT;
- static const Function glTextureStorage2DEXT = GLMessage_Function_glTextureStorage2DEXT;
- static const Function glTextureStorage3DEXT = GLMessage_Function_glTextureStorage3DEXT;
- static const Function glUseProgramStagesEXT = GLMessage_Function_glUseProgramStagesEXT;
- static const Function glValidateProgramPipelineEXT = GLMessage_Function_glValidateProgramPipelineEXT;
- static const Function eglGetDisplay = GLMessage_Function_eglGetDisplay;
- static const Function eglInitialize = GLMessage_Function_eglInitialize;
- static const Function eglTerminate = GLMessage_Function_eglTerminate;
- static const Function eglGetConfigs = GLMessage_Function_eglGetConfigs;
- static const Function eglChooseConfig = GLMessage_Function_eglChooseConfig;
- static const Function eglGetConfigAttrib = GLMessage_Function_eglGetConfigAttrib;
- static const Function eglCreateWindowSurface = GLMessage_Function_eglCreateWindowSurface;
- static const Function eglCreatePixmapSurface = GLMessage_Function_eglCreatePixmapSurface;
- static const Function eglCreatePbufferSurface = GLMessage_Function_eglCreatePbufferSurface;
- static const Function eglDestroySurface = GLMessage_Function_eglDestroySurface;
- static const Function eglQuerySurface = GLMessage_Function_eglQuerySurface;
- static const Function eglCreateContext = GLMessage_Function_eglCreateContext;
- static const Function eglDestroyContext = GLMessage_Function_eglDestroyContext;
- static const Function eglMakeCurrent = GLMessage_Function_eglMakeCurrent;
- static const Function eglGetCurrentContext = GLMessage_Function_eglGetCurrentContext;
- static const Function eglGetCurrentSurface = GLMessage_Function_eglGetCurrentSurface;
- static const Function eglGetCurrentDisplay = GLMessage_Function_eglGetCurrentDisplay;
- static const Function eglQueryContext = GLMessage_Function_eglQueryContext;
- static const Function eglWaitGL = GLMessage_Function_eglWaitGL;
- static const Function eglWaitNative = GLMessage_Function_eglWaitNative;
- static const Function eglSwapBuffers = GLMessage_Function_eglSwapBuffers;
- static const Function eglCopyBuffers = GLMessage_Function_eglCopyBuffers;
- static const Function eglGetError = GLMessage_Function_eglGetError;
- static const Function eglQueryString = GLMessage_Function_eglQueryString;
- static const Function eglGetProcAddress = GLMessage_Function_eglGetProcAddress;
- static const Function eglSurfaceAttrib = GLMessage_Function_eglSurfaceAttrib;
- static const Function eglBindTexImage = GLMessage_Function_eglBindTexImage;
- static const Function eglReleaseTexImage = GLMessage_Function_eglReleaseTexImage;
- static const Function eglSwapInterval = GLMessage_Function_eglSwapInterval;
- static const Function eglBindAPI = GLMessage_Function_eglBindAPI;
- static const Function eglQueryAPI = GLMessage_Function_eglQueryAPI;
- static const Function eglWaitClient = GLMessage_Function_eglWaitClient;
- static const Function eglReleaseThread = GLMessage_Function_eglReleaseThread;
- static const Function eglCreatePbufferFromClientBuffer = GLMessage_Function_eglCreatePbufferFromClientBuffer;
- static const Function eglLockSurfaceKHR = GLMessage_Function_eglLockSurfaceKHR;
- static const Function eglUnlockSurfaceKHR = GLMessage_Function_eglUnlockSurfaceKHR;
- static const Function eglCreateImageKHR = GLMessage_Function_eglCreateImageKHR;
- static const Function eglDestroyImageKHR = GLMessage_Function_eglDestroyImageKHR;
- static const Function eglCreateSyncKHR = GLMessage_Function_eglCreateSyncKHR;
- static const Function eglDestroySyncKHR = GLMessage_Function_eglDestroySyncKHR;
- static const Function eglClientWaitSyncKHR = GLMessage_Function_eglClientWaitSyncKHR;
- static const Function eglGetSyncAttribKHR = GLMessage_Function_eglGetSyncAttribKHR;
- static const Function eglSetSwapRectangleANDROID = GLMessage_Function_eglSetSwapRectangleANDROID;
- static const Function eglGetRenderBufferANDROID = GLMessage_Function_eglGetRenderBufferANDROID;
- static const Function eglGetSystemTimeFrequencyNV = GLMessage_Function_eglGetSystemTimeFrequencyNV;
- static const Function eglGetSystemTimeNV = GLMessage_Function_eglGetSystemTimeNV;
- static const Function invalid = GLMessage_Function_invalid;
- static const Function glVertexAttribPointerData = GLMessage_Function_glVertexAttribPointerData;
- static inline bool Function_IsValid(int value) {
- return GLMessage_Function_IsValid(value);
- }
- static const Function Function_MIN =
- GLMessage_Function_Function_MIN;
- static const Function Function_MAX =
- GLMessage_Function_Function_MAX;
- static const int Function_ARRAYSIZE =
- GLMessage_Function_Function_ARRAYSIZE;
-
- // accessors -------------------------------------------------------
-
- // required int32 context_id = 1;
- inline bool has_context_id() const;
- inline void clear_context_id();
- static const int kContextIdFieldNumber = 1;
- inline ::google::protobuf::int32 context_id() const;
- inline void set_context_id(::google::protobuf::int32 value);
-
- // required int64 start_time = 2;
- inline bool has_start_time() const;
- inline void clear_start_time();
- static const int kStartTimeFieldNumber = 2;
- inline ::google::protobuf::int64 start_time() const;
- inline void set_start_time(::google::protobuf::int64 value);
-
- // required int32 duration = 3;
- inline bool has_duration() const;
- inline void clear_duration();
- static const int kDurationFieldNumber = 3;
- inline ::google::protobuf::int32 duration() const;
- inline void set_duration(::google::protobuf::int32 value);
-
- // required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
- inline bool has_function() const;
- inline void clear_function();
- static const int kFunctionFieldNumber = 4;
- inline ::android::gltrace::GLMessage_Function function() const;
- inline void set_function(::android::gltrace::GLMessage_Function value);
-
- // repeated .android.gltrace.GLMessage.DataType args = 5;
- inline int args_size() const;
- inline void clear_args();
- static const int kArgsFieldNumber = 5;
- inline const ::android::gltrace::GLMessage_DataType& args(int index) const;
- inline ::android::gltrace::GLMessage_DataType* mutable_args(int index);
- inline ::android::gltrace::GLMessage_DataType* add_args();
- inline const ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType >&
- args() const;
- inline ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType >*
- mutable_args();
-
- // optional .android.gltrace.GLMessage.DataType returnValue = 6;
- inline bool has_returnvalue() const;
- inline void clear_returnvalue();
- static const int kReturnValueFieldNumber = 6;
- inline const ::android::gltrace::GLMessage_DataType& returnvalue() const;
- inline ::android::gltrace::GLMessage_DataType* mutable_returnvalue();
-
- // optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
- inline bool has_fb() const;
- inline void clear_fb();
- static const int kFbFieldNumber = 7;
- inline const ::android::gltrace::GLMessage_FrameBuffer& fb() const;
- inline ::android::gltrace::GLMessage_FrameBuffer* mutable_fb();
-
- // optional int32 threadtime = 8;
- inline bool has_threadtime() const;
- inline void clear_threadtime();
- static const int kThreadtimeFieldNumber = 8;
- inline ::google::protobuf::int32 threadtime() const;
- inline void set_threadtime(::google::protobuf::int32 value);
-
- // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage)
- private:
- mutable int _cached_size_;
-
- ::google::protobuf::int32 context_id_;
- ::google::protobuf::int64 start_time_;
- ::google::protobuf::int32 duration_;
- int function_;
- ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType > args_;
- ::android::gltrace::GLMessage_DataType* returnvalue_;
- ::android::gltrace::GLMessage_FrameBuffer* fb_;
- ::google::protobuf::int32 threadtime_;
- friend void protobuf_AddDesc_gltrace_2eproto();
- friend void protobuf_AssignDesc_gltrace_2eproto();
- friend void protobuf_ShutdownFile_gltrace_2eproto();
-
- ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32];
-
- // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
- inline bool _has_bit(int index) const {
- return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
- }
- inline void _set_bit(int index) {
- _has_bits_[index / 32] |= (1u << (index % 32));
- }
- inline void _clear_bit(int index) {
- _has_bits_[index / 32] &= ~(1u << (index % 32));
- }
-
- void InitAsDefaultInstance();
- static GLMessage* default_instance_;
-};
-// ===================================================================
-
-
-// ===================================================================
-
-// GLMessage_DataType
-
-// required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
-inline bool GLMessage_DataType::has_type() const {
- return _has_bit(0);
-}
-inline void GLMessage_DataType::clear_type() {
- type_ = 1;
- _clear_bit(0);
-}
-inline ::android::gltrace::GLMessage_DataType_Type GLMessage_DataType::type() const {
- return static_cast< ::android::gltrace::GLMessage_DataType_Type >(type_);
-}
-inline void GLMessage_DataType::set_type(::android::gltrace::GLMessage_DataType_Type value) {
- GOOGLE_DCHECK(::android::gltrace::GLMessage_DataType_Type_IsValid(value));
- _set_bit(0);
- type_ = value;
-}
-
-// required bool isArray = 2 [default = false];
-inline bool GLMessage_DataType::has_isarray() const {
- return _has_bit(1);
-}
-inline void GLMessage_DataType::clear_isarray() {
- isarray_ = false;
- _clear_bit(1);
-}
-inline bool GLMessage_DataType::isarray() const {
- return isarray_;
-}
-inline void GLMessage_DataType::set_isarray(bool value) {
- _set_bit(1);
- isarray_ = value;
-}
-
-// repeated int32 intValue = 3;
-inline int GLMessage_DataType::intvalue_size() const {
- return intvalue_.size();
-}
-inline void GLMessage_DataType::clear_intvalue() {
- intvalue_.Clear();
-}
-inline ::google::protobuf::int32 GLMessage_DataType::intvalue(int index) const {
- return intvalue_.Get(index);
-}
-inline void GLMessage_DataType::set_intvalue(int index, ::google::protobuf::int32 value) {
- intvalue_.Set(index, value);
-}
-inline void GLMessage_DataType::add_intvalue(::google::protobuf::int32 value) {
- intvalue_.Add(value);
-}
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
-GLMessage_DataType::intvalue() const {
- return intvalue_;
-}
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
-GLMessage_DataType::mutable_intvalue() {
- return &intvalue_;
-}
-
-// repeated float floatValue = 4;
-inline int GLMessage_DataType::floatvalue_size() const {
- return floatvalue_.size();
-}
-inline void GLMessage_DataType::clear_floatvalue() {
- floatvalue_.Clear();
-}
-inline float GLMessage_DataType::floatvalue(int index) const {
- return floatvalue_.Get(index);
-}
-inline void GLMessage_DataType::set_floatvalue(int index, float value) {
- floatvalue_.Set(index, value);
-}
-inline void GLMessage_DataType::add_floatvalue(float value) {
- floatvalue_.Add(value);
-}
-inline const ::google::protobuf::RepeatedField< float >&
-GLMessage_DataType::floatvalue() const {
- return floatvalue_;
-}
-inline ::google::protobuf::RepeatedField< float >*
-GLMessage_DataType::mutable_floatvalue() {
- return &floatvalue_;
-}
-
-// repeated bytes charValue = 5;
-inline int GLMessage_DataType::charvalue_size() const {
- return charvalue_.size();
-}
-inline void GLMessage_DataType::clear_charvalue() {
- charvalue_.Clear();
-}
-inline const ::std::string& GLMessage_DataType::charvalue(int index) const {
- return charvalue_.Get(index);
-}
-inline ::std::string* GLMessage_DataType::mutable_charvalue(int index) {
- return charvalue_.Mutable(index);
-}
-inline void GLMessage_DataType::set_charvalue(int index, const ::std::string& value) {
- charvalue_.Mutable(index)->assign(value);
-}
-inline void GLMessage_DataType::set_charvalue(int index, const char* value) {
- charvalue_.Mutable(index)->assign(value);
-}
-inline void GLMessage_DataType::set_charvalue(int index, const void* value, size_t size) {
- charvalue_.Mutable(index)->assign(
- reinterpret_cast<const char*>(value), size);
-}
-inline ::std::string* GLMessage_DataType::add_charvalue() {
- return charvalue_.Add();
-}
-inline void GLMessage_DataType::add_charvalue(const ::std::string& value) {
- charvalue_.Add()->assign(value);
-}
-inline void GLMessage_DataType::add_charvalue(const char* value) {
- charvalue_.Add()->assign(value);
-}
-inline void GLMessage_DataType::add_charvalue(const void* value, size_t size) {
- charvalue_.Add()->assign(reinterpret_cast<const char*>(value), size);
-}
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
-GLMessage_DataType::charvalue() const {
- return charvalue_;
-}
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
-GLMessage_DataType::mutable_charvalue() {
- return &charvalue_;
-}
-
-// repeated bytes rawBytes = 6;
-inline int GLMessage_DataType::rawbytes_size() const {
- return rawbytes_.size();
-}
-inline void GLMessage_DataType::clear_rawbytes() {
- rawbytes_.Clear();
-}
-inline const ::std::string& GLMessage_DataType::rawbytes(int index) const {
- return rawbytes_.Get(index);
-}
-inline ::std::string* GLMessage_DataType::mutable_rawbytes(int index) {
- return rawbytes_.Mutable(index);
-}
-inline void GLMessage_DataType::set_rawbytes(int index, const ::std::string& value) {
- rawbytes_.Mutable(index)->assign(value);
-}
-inline void GLMessage_DataType::set_rawbytes(int index, const char* value) {
- rawbytes_.Mutable(index)->assign(value);
-}
-inline void GLMessage_DataType::set_rawbytes(int index, const void* value, size_t size) {
- rawbytes_.Mutable(index)->assign(
- reinterpret_cast<const char*>(value), size);
-}
-inline ::std::string* GLMessage_DataType::add_rawbytes() {
- return rawbytes_.Add();
-}
-inline void GLMessage_DataType::add_rawbytes(const ::std::string& value) {
- rawbytes_.Add()->assign(value);
-}
-inline void GLMessage_DataType::add_rawbytes(const char* value) {
- rawbytes_.Add()->assign(value);
-}
-inline void GLMessage_DataType::add_rawbytes(const void* value, size_t size) {
- rawbytes_.Add()->assign(reinterpret_cast<const char*>(value), size);
-}
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
-GLMessage_DataType::rawbytes() const {
- return rawbytes_;
-}
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
-GLMessage_DataType::mutable_rawbytes() {
- return &rawbytes_;
-}
-
-// repeated bool boolValue = 7;
-inline int GLMessage_DataType::boolvalue_size() const {
- return boolvalue_.size();
-}
-inline void GLMessage_DataType::clear_boolvalue() {
- boolvalue_.Clear();
-}
-inline bool GLMessage_DataType::boolvalue(int index) const {
- return boolvalue_.Get(index);
-}
-inline void GLMessage_DataType::set_boolvalue(int index, bool value) {
- boolvalue_.Set(index, value);
-}
-inline void GLMessage_DataType::add_boolvalue(bool value) {
- boolvalue_.Add(value);
-}
-inline const ::google::protobuf::RepeatedField< bool >&
-GLMessage_DataType::boolvalue() const {
- return boolvalue_;
-}
-inline ::google::protobuf::RepeatedField< bool >*
-GLMessage_DataType::mutable_boolvalue() {
- return &boolvalue_;
-}
-
-// -------------------------------------------------------------------
-
-// GLMessage_FrameBuffer
-
-// required int32 width = 1;
-inline bool GLMessage_FrameBuffer::has_width() const {
- return _has_bit(0);
-}
-inline void GLMessage_FrameBuffer::clear_width() {
- width_ = 0;
- _clear_bit(0);
-}
-inline ::google::protobuf::int32 GLMessage_FrameBuffer::width() const {
- return width_;
-}
-inline void GLMessage_FrameBuffer::set_width(::google::protobuf::int32 value) {
- _set_bit(0);
- width_ = value;
-}
-
-// required int32 height = 2;
-inline bool GLMessage_FrameBuffer::has_height() const {
- return _has_bit(1);
-}
-inline void GLMessage_FrameBuffer::clear_height() {
- height_ = 0;
- _clear_bit(1);
-}
-inline ::google::protobuf::int32 GLMessage_FrameBuffer::height() const {
- return height_;
-}
-inline void GLMessage_FrameBuffer::set_height(::google::protobuf::int32 value) {
- _set_bit(1);
- height_ = value;
-}
-
-// repeated bytes contents = 3;
-inline int GLMessage_FrameBuffer::contents_size() const {
- return contents_.size();
-}
-inline void GLMessage_FrameBuffer::clear_contents() {
- contents_.Clear();
-}
-inline const ::std::string& GLMessage_FrameBuffer::contents(int index) const {
- return contents_.Get(index);
-}
-inline ::std::string* GLMessage_FrameBuffer::mutable_contents(int index) {
- return contents_.Mutable(index);
-}
-inline void GLMessage_FrameBuffer::set_contents(int index, const ::std::string& value) {
- contents_.Mutable(index)->assign(value);
-}
-inline void GLMessage_FrameBuffer::set_contents(int index, const char* value) {
- contents_.Mutable(index)->assign(value);
-}
-inline void GLMessage_FrameBuffer::set_contents(int index, const void* value, size_t size) {
- contents_.Mutable(index)->assign(
- reinterpret_cast<const char*>(value), size);
-}
-inline ::std::string* GLMessage_FrameBuffer::add_contents() {
- return contents_.Add();
-}
-inline void GLMessage_FrameBuffer::add_contents(const ::std::string& value) {
- contents_.Add()->assign(value);
-}
-inline void GLMessage_FrameBuffer::add_contents(const char* value) {
- contents_.Add()->assign(value);
-}
-inline void GLMessage_FrameBuffer::add_contents(const void* value, size_t size) {
- contents_.Add()->assign(reinterpret_cast<const char*>(value), size);
-}
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
-GLMessage_FrameBuffer::contents() const {
- return contents_;
-}
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
-GLMessage_FrameBuffer::mutable_contents() {
- return &contents_;
-}
-
-// -------------------------------------------------------------------
-
-// GLMessage
-
-// required int32 context_id = 1;
-inline bool GLMessage::has_context_id() const {
- return _has_bit(0);
-}
-inline void GLMessage::clear_context_id() {
- context_id_ = 0;
- _clear_bit(0);
-}
-inline ::google::protobuf::int32 GLMessage::context_id() const {
- return context_id_;
-}
-inline void GLMessage::set_context_id(::google::protobuf::int32 value) {
- _set_bit(0);
- context_id_ = value;
-}
-
-// required int64 start_time = 2;
-inline bool GLMessage::has_start_time() const {
- return _has_bit(1);
-}
-inline void GLMessage::clear_start_time() {
- start_time_ = GOOGLE_LONGLONG(0);
- _clear_bit(1);
-}
-inline ::google::protobuf::int64 GLMessage::start_time() const {
- return start_time_;
-}
-inline void GLMessage::set_start_time(::google::protobuf::int64 value) {
- _set_bit(1);
- start_time_ = value;
-}
-
-// required int32 duration = 3;
-inline bool GLMessage::has_duration() const {
- return _has_bit(2);
-}
-inline void GLMessage::clear_duration() {
- duration_ = 0;
- _clear_bit(2);
-}
-inline ::google::protobuf::int32 GLMessage::duration() const {
- return duration_;
-}
-inline void GLMessage::set_duration(::google::protobuf::int32 value) {
- _set_bit(2);
- duration_ = value;
-}
-
-// required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
-inline bool GLMessage::has_function() const {
- return _has_bit(3);
-}
-inline void GLMessage::clear_function() {
- function_ = 3000;
- _clear_bit(3);
-}
-inline ::android::gltrace::GLMessage_Function GLMessage::function() const {
- return static_cast< ::android::gltrace::GLMessage_Function >(function_);
-}
-inline void GLMessage::set_function(::android::gltrace::GLMessage_Function value) {
- GOOGLE_DCHECK(::android::gltrace::GLMessage_Function_IsValid(value));
- _set_bit(3);
- function_ = value;
-}
-
-// repeated .android.gltrace.GLMessage.DataType args = 5;
-inline int GLMessage::args_size() const {
- return args_.size();
-}
-inline void GLMessage::clear_args() {
- args_.Clear();
-}
-inline const ::android::gltrace::GLMessage_DataType& GLMessage::args(int index) const {
- return args_.Get(index);
-}
-inline ::android::gltrace::GLMessage_DataType* GLMessage::mutable_args(int index) {
- return args_.Mutable(index);
-}
-inline ::android::gltrace::GLMessage_DataType* GLMessage::add_args() {
- return args_.Add();
-}
-inline const ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType >&
-GLMessage::args() const {
- return args_;
-}
-inline ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType >*
-GLMessage::mutable_args() {
- return &args_;
-}
-
-// optional .android.gltrace.GLMessage.DataType returnValue = 6;
-inline bool GLMessage::has_returnvalue() const {
- return _has_bit(5);
-}
-inline void GLMessage::clear_returnvalue() {
- if (returnvalue_ != NULL) returnvalue_->::android::gltrace::GLMessage_DataType::Clear();
- _clear_bit(5);
-}
-inline const ::android::gltrace::GLMessage_DataType& GLMessage::returnvalue() const {
- return returnvalue_ != NULL ? *returnvalue_ : *default_instance_->returnvalue_;
-}
-inline ::android::gltrace::GLMessage_DataType* GLMessage::mutable_returnvalue() {
- _set_bit(5);
- if (returnvalue_ == NULL) returnvalue_ = new ::android::gltrace::GLMessage_DataType;
- return returnvalue_;
-}
-
-// optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
-inline bool GLMessage::has_fb() const {
- return _has_bit(6);
-}
-inline void GLMessage::clear_fb() {
- if (fb_ != NULL) fb_->::android::gltrace::GLMessage_FrameBuffer::Clear();
- _clear_bit(6);
-}
-inline const ::android::gltrace::GLMessage_FrameBuffer& GLMessage::fb() const {
- return fb_ != NULL ? *fb_ : *default_instance_->fb_;
-}
-inline ::android::gltrace::GLMessage_FrameBuffer* GLMessage::mutable_fb() {
- _set_bit(6);
- if (fb_ == NULL) fb_ = new ::android::gltrace::GLMessage_FrameBuffer;
- return fb_;
-}
-
-// optional int32 threadtime = 8;
-inline bool GLMessage::has_threadtime() const {
- return _has_bit(7);
-}
-inline void GLMessage::clear_threadtime() {
- threadtime_ = 0;
- _clear_bit(7);
-}
-inline ::google::protobuf::int32 GLMessage::threadtime() const {
- return threadtime_;
-}
-inline void GLMessage::set_threadtime(::google::protobuf::int32 value) {
- _set_bit(7);
- threadtime_ = value;
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-} // namespace gltrace
-} // namespace android
-
-// @@protoc_insertion_point(global_scope)
-
-#endif // PROTOBUF_gltrace_2eproto__INCLUDED
diff --git a/opengl/libs/GLES_trace/src/gltrace_api.cpp b/opengl/libs/GLES_trace/src/gltrace_api.cpp
deleted file mode 100644
index cef6cbb..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_api.cpp
+++ /dev/null
@@ -1,17862 +0,0 @@
-/*
- * Copyright 2011, 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.
- *
- * THIS FILE WAS GENERATED BY A SCRIPT. DO NOT EDIT.
- */
-
-#include <cutils/log.h>
-#include <utils/Timers.h>
-#include <GLES2/gl2.h>
-
-#include "gltrace.pb.h"
-#include "gltrace_context.h"
-#include "gltrace_fixup.h"
-#include "gltrace_transport.h"
-
-namespace android {
-namespace gltrace {
-
-// Definitions for GL2 APIs
-
-void GLTrace_glActiveTexture(GLenum texture) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glActiveTexture);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::ENUM);
- arg_texture->add_intvalue((int)texture);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glActiveTexture(texture);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glAttachShader(GLuint program, GLuint shader) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glAttachShader);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument shader
- GLMessage_DataType *arg_shader = glmsg.add_args();
- arg_shader->set_isarray(false);
- arg_shader->set_type(GLMessage::DataType::INT);
- arg_shader->add_intvalue(shader);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glAttachShader(program, shader);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindAttribLocation(GLuint program, GLuint index, const GLchar* name) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBindAttribLocation);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument index
- GLMessage_DataType *arg_index = glmsg.add_args();
- arg_index->set_isarray(false);
- arg_index->set_type(GLMessage::DataType::INT);
- arg_index->add_intvalue(index);
-
- // copy argument name
- GLMessage_DataType *arg_name = glmsg.add_args();
- arg_name->set_isarray(false);
- arg_name->set_type(GLMessage::DataType::INT);
- arg_name->add_intvalue((int)name);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBindAttribLocation(program, index, name);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) name,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindBuffer(GLenum target, GLuint buffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBindBuffer);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument buffer
- GLMessage_DataType *arg_buffer = glmsg.add_args();
- arg_buffer->set_isarray(false);
- arg_buffer->set_type(GLMessage::DataType::INT);
- arg_buffer->add_intvalue(buffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBindBuffer(target, buffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindFramebuffer(GLenum target, GLuint framebuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBindFramebuffer);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument framebuffer
- GLMessage_DataType *arg_framebuffer = glmsg.add_args();
- arg_framebuffer->set_isarray(false);
- arg_framebuffer->set_type(GLMessage::DataType::INT);
- arg_framebuffer->add_intvalue(framebuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBindFramebuffer(target, framebuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBindRenderbuffer);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument renderbuffer
- GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
- arg_renderbuffer->set_isarray(false);
- arg_renderbuffer->set_type(GLMessage::DataType::INT);
- arg_renderbuffer->add_intvalue(renderbuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBindRenderbuffer(target, renderbuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindTexture(GLenum target, GLuint texture) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBindTexture);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBindTexture(target, texture);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBlendColor);
-
- // copy argument red
- GLMessage_DataType *arg_red = glmsg.add_args();
- arg_red->set_isarray(false);
- arg_red->set_type(GLMessage::DataType::FLOAT);
- arg_red->add_floatvalue(red);
-
- // copy argument green
- GLMessage_DataType *arg_green = glmsg.add_args();
- arg_green->set_isarray(false);
- arg_green->set_type(GLMessage::DataType::FLOAT);
- arg_green->add_floatvalue(green);
-
- // copy argument blue
- GLMessage_DataType *arg_blue = glmsg.add_args();
- arg_blue->set_isarray(false);
- arg_blue->set_type(GLMessage::DataType::FLOAT);
- arg_blue->add_floatvalue(blue);
-
- // copy argument alpha
- GLMessage_DataType *arg_alpha = glmsg.add_args();
- arg_alpha->set_isarray(false);
- arg_alpha->set_type(GLMessage::DataType::FLOAT);
- arg_alpha->add_floatvalue(alpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBlendColor(red, green, blue, alpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendEquation(GLenum mode) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBlendEquation);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBlendEquation(mode);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBlendEquationSeparate);
-
- // copy argument modeRGB
- GLMessage_DataType *arg_modeRGB = glmsg.add_args();
- arg_modeRGB->set_isarray(false);
- arg_modeRGB->set_type(GLMessage::DataType::ENUM);
- arg_modeRGB->add_intvalue((int)modeRGB);
-
- // copy argument modeAlpha
- GLMessage_DataType *arg_modeAlpha = glmsg.add_args();
- arg_modeAlpha->set_isarray(false);
- arg_modeAlpha->set_type(GLMessage::DataType::ENUM);
- arg_modeAlpha->add_intvalue((int)modeAlpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBlendEquationSeparate(modeRGB, modeAlpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendFunc(GLenum sfactor, GLenum dfactor) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBlendFunc);
-
- // copy argument sfactor
- GLMessage_DataType *arg_sfactor = glmsg.add_args();
- arg_sfactor->set_isarray(false);
- arg_sfactor->set_type(GLMessage::DataType::ENUM);
- arg_sfactor->add_intvalue((int)sfactor);
-
- // copy argument dfactor
- GLMessage_DataType *arg_dfactor = glmsg.add_args();
- arg_dfactor->set_isarray(false);
- arg_dfactor->set_type(GLMessage::DataType::ENUM);
- arg_dfactor->add_intvalue((int)dfactor);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBlendFunc(sfactor, dfactor);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBlendFuncSeparate);
-
- // copy argument srcRGB
- GLMessage_DataType *arg_srcRGB = glmsg.add_args();
- arg_srcRGB->set_isarray(false);
- arg_srcRGB->set_type(GLMessage::DataType::ENUM);
- arg_srcRGB->add_intvalue((int)srcRGB);
-
- // copy argument dstRGB
- GLMessage_DataType *arg_dstRGB = glmsg.add_args();
- arg_dstRGB->set_isarray(false);
- arg_dstRGB->set_type(GLMessage::DataType::ENUM);
- arg_dstRGB->add_intvalue((int)dstRGB);
-
- // copy argument srcAlpha
- GLMessage_DataType *arg_srcAlpha = glmsg.add_args();
- arg_srcAlpha->set_isarray(false);
- arg_srcAlpha->set_type(GLMessage::DataType::ENUM);
- arg_srcAlpha->add_intvalue((int)srcAlpha);
-
- // copy argument dstAlpha
- GLMessage_DataType *arg_dstAlpha = glmsg.add_args();
- arg_dstAlpha->set_isarray(false);
- arg_dstAlpha->set_type(GLMessage::DataType::ENUM);
- arg_dstAlpha->add_intvalue((int)dstAlpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBufferData);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument data
- GLMessage_DataType *arg_data = glmsg.add_args();
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::INT);
- arg_data->add_intvalue((int)data);
-
- // copy argument usage
- GLMessage_DataType *arg_usage = glmsg.add_args();
- arg_usage->set_isarray(false);
- arg_usage->set_type(GLMessage::DataType::ENUM);
- arg_usage->add_intvalue((int)usage);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBufferData(target, size, data, usage);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) data,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBufferSubData);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument offset
- GLMessage_DataType *arg_offset = glmsg.add_args();
- arg_offset->set_isarray(false);
- arg_offset->set_type(GLMessage::DataType::INT);
- arg_offset->add_intvalue(offset);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument data
- GLMessage_DataType *arg_data = glmsg.add_args();
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::INT);
- arg_data->add_intvalue((int)data);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBufferSubData(target, offset, size, data);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) data,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glCheckFramebufferStatus(GLenum target) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCheckFramebufferStatus);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLenum retValue = glContext->hooks->gl.glCheckFramebufferStatus(target);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::ENUM);
- rt->add_intvalue((int)retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glClear(GLbitfield mask) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClear);
-
- // copy argument mask
- GLMessage_DataType *arg_mask = glmsg.add_args();
- arg_mask->set_isarray(false);
- arg_mask->set_type(GLMessage::DataType::INT);
- arg_mask->add_intvalue(mask);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClear(mask);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClearColor);
-
- // copy argument red
- GLMessage_DataType *arg_red = glmsg.add_args();
- arg_red->set_isarray(false);
- arg_red->set_type(GLMessage::DataType::FLOAT);
- arg_red->add_floatvalue(red);
-
- // copy argument green
- GLMessage_DataType *arg_green = glmsg.add_args();
- arg_green->set_isarray(false);
- arg_green->set_type(GLMessage::DataType::FLOAT);
- arg_green->add_floatvalue(green);
-
- // copy argument blue
- GLMessage_DataType *arg_blue = glmsg.add_args();
- arg_blue->set_isarray(false);
- arg_blue->set_type(GLMessage::DataType::FLOAT);
- arg_blue->add_floatvalue(blue);
-
- // copy argument alpha
- GLMessage_DataType *arg_alpha = glmsg.add_args();
- arg_alpha->set_isarray(false);
- arg_alpha->set_type(GLMessage::DataType::FLOAT);
- arg_alpha->add_floatvalue(alpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClearColor(red, green, blue, alpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearDepthf(GLclampf depth) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClearDepthf);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::FLOAT);
- arg_depth->add_floatvalue(depth);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClearDepthf(depth);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearStencil(GLint s) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClearStencil);
-
- // copy argument s
- GLMessage_DataType *arg_s = glmsg.add_args();
- arg_s->set_isarray(false);
- arg_s->set_type(GLMessage::DataType::INT);
- arg_s->add_intvalue(s);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClearStencil(s);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glColorMask);
-
- // copy argument red
- GLMessage_DataType *arg_red = glmsg.add_args();
- arg_red->set_isarray(false);
- arg_red->set_type(GLMessage::DataType::BOOL);
- arg_red->add_boolvalue(red);
-
- // copy argument green
- GLMessage_DataType *arg_green = glmsg.add_args();
- arg_green->set_isarray(false);
- arg_green->set_type(GLMessage::DataType::BOOL);
- arg_green->add_boolvalue(green);
-
- // copy argument blue
- GLMessage_DataType *arg_blue = glmsg.add_args();
- arg_blue->set_isarray(false);
- arg_blue->set_type(GLMessage::DataType::BOOL);
- arg_blue->add_boolvalue(blue);
-
- // copy argument alpha
- GLMessage_DataType *arg_alpha = glmsg.add_args();
- arg_alpha->set_isarray(false);
- arg_alpha->set_type(GLMessage::DataType::BOOL);
- arg_alpha->add_boolvalue(alpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glColorMask(red, green, blue, alpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompileShader(GLuint shader) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCompileShader);
-
- // copy argument shader
- GLMessage_DataType *arg_shader = glmsg.add_args();
- arg_shader->set_isarray(false);
- arg_shader->set_type(GLMessage::DataType::INT);
- arg_shader->add_intvalue(shader);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCompileShader(shader);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCompressedTexImage2D);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument border
- GLMessage_DataType *arg_border = glmsg.add_args();
- arg_border->set_isarray(false);
- arg_border->set_type(GLMessage::DataType::INT);
- arg_border->add_intvalue(border);
-
- // copy argument imageSize
- GLMessage_DataType *arg_imageSize = glmsg.add_args();
- arg_imageSize->set_isarray(false);
- arg_imageSize->set_type(GLMessage::DataType::INT);
- arg_imageSize->add_intvalue(imageSize);
-
- // copy argument data
- GLMessage_DataType *arg_data = glmsg.add_args();
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::INT);
- arg_data->add_intvalue((int)data);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) data,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCompressedTexSubImage2D);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument xoffset
- GLMessage_DataType *arg_xoffset = glmsg.add_args();
- arg_xoffset->set_isarray(false);
- arg_xoffset->set_type(GLMessage::DataType::INT);
- arg_xoffset->add_intvalue(xoffset);
-
- // copy argument yoffset
- GLMessage_DataType *arg_yoffset = glmsg.add_args();
- arg_yoffset->set_isarray(false);
- arg_yoffset->set_type(GLMessage::DataType::INT);
- arg_yoffset->add_intvalue(yoffset);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument format
- GLMessage_DataType *arg_format = glmsg.add_args();
- arg_format->set_isarray(false);
- arg_format->set_type(GLMessage::DataType::ENUM);
- arg_format->add_intvalue((int)format);
-
- // copy argument imageSize
- GLMessage_DataType *arg_imageSize = glmsg.add_args();
- arg_imageSize->set_isarray(false);
- arg_imageSize->set_type(GLMessage::DataType::INT);
- arg_imageSize->add_intvalue(imageSize);
-
- // copy argument data
- GLMessage_DataType *arg_data = glmsg.add_args();
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::INT);
- arg_data->add_intvalue((int)data);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) data,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCopyTexImage2D);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument border
- GLMessage_DataType *arg_border = glmsg.add_args();
- arg_border->set_isarray(false);
- arg_border->set_type(GLMessage::DataType::INT);
- arg_border->add_intvalue(border);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCopyTexSubImage2D);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument xoffset
- GLMessage_DataType *arg_xoffset = glmsg.add_args();
- arg_xoffset->set_isarray(false);
- arg_xoffset->set_type(GLMessage::DataType::INT);
- arg_xoffset->add_intvalue(xoffset);
-
- // copy argument yoffset
- GLMessage_DataType *arg_yoffset = glmsg.add_args();
- arg_yoffset->set_isarray(false);
- arg_yoffset->set_type(GLMessage::DataType::INT);
- arg_yoffset->add_intvalue(yoffset);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLuint GLTrace_glCreateProgram(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCreateProgram);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLuint retValue = glContext->hooks->gl.glCreateProgram();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::INT);
- rt->add_intvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-GLuint GLTrace_glCreateShader(GLenum type) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCreateShader);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLuint retValue = glContext->hooks->gl.glCreateShader(type);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::INT);
- rt->add_intvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glCullFace(GLenum mode) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCullFace);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCullFace(mode);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteBuffers(GLsizei n, const GLuint* buffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteBuffers);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument buffers
- GLMessage_DataType *arg_buffers = glmsg.add_args();
- arg_buffers->set_isarray(false);
- arg_buffers->set_type(GLMessage::DataType::INT);
- arg_buffers->add_intvalue((int)buffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteBuffers(n, buffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) buffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteFramebuffers);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument framebuffers
- GLMessage_DataType *arg_framebuffers = glmsg.add_args();
- arg_framebuffers->set_isarray(false);
- arg_framebuffers->set_type(GLMessage::DataType::INT);
- arg_framebuffers->add_intvalue((int)framebuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteFramebuffers(n, framebuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) framebuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteProgram(GLuint program) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteProgram);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteProgram(program);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteRenderbuffers);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument renderbuffers
- GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
- arg_renderbuffers->set_isarray(false);
- arg_renderbuffers->set_type(GLMessage::DataType::INT);
- arg_renderbuffers->add_intvalue((int)renderbuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteRenderbuffers(n, renderbuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) renderbuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteShader(GLuint shader) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteShader);
-
- // copy argument shader
- GLMessage_DataType *arg_shader = glmsg.add_args();
- arg_shader->set_isarray(false);
- arg_shader->set_type(GLMessage::DataType::INT);
- arg_shader->add_intvalue(shader);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteShader(shader);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteTextures(GLsizei n, const GLuint* textures) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteTextures);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument textures
- GLMessage_DataType *arg_textures = glmsg.add_args();
- arg_textures->set_isarray(false);
- arg_textures->set_type(GLMessage::DataType::INT);
- arg_textures->add_intvalue((int)textures);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteTextures(n, textures);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) textures,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthFunc(GLenum func) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDepthFunc);
-
- // copy argument func
- GLMessage_DataType *arg_func = glmsg.add_args();
- arg_func->set_isarray(false);
- arg_func->set_type(GLMessage::DataType::ENUM);
- arg_func->add_intvalue((int)func);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDepthFunc(func);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthMask(GLboolean flag) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDepthMask);
-
- // copy argument flag
- GLMessage_DataType *arg_flag = glmsg.add_args();
- arg_flag->set_isarray(false);
- arg_flag->set_type(GLMessage::DataType::BOOL);
- arg_flag->add_boolvalue(flag);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDepthMask(flag);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthRangef(GLclampf zNear, GLclampf zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDepthRangef);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::FLOAT);
- arg_zNear->add_floatvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::FLOAT);
- arg_zFar->add_floatvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDepthRangef(zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDetachShader(GLuint program, GLuint shader) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDetachShader);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument shader
- GLMessage_DataType *arg_shader = glmsg.add_args();
- arg_shader->set_isarray(false);
- arg_shader->set_type(GLMessage::DataType::INT);
- arg_shader->add_intvalue(shader);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDetachShader(program, shader);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDisable(GLenum cap) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDisable);
-
- // copy argument cap
- GLMessage_DataType *arg_cap = glmsg.add_args();
- arg_cap->set_isarray(false);
- arg_cap->set_type(GLMessage::DataType::ENUM);
- arg_cap->add_intvalue((int)cap);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDisable(cap);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDisableVertexAttribArray(GLuint index) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDisableVertexAttribArray);
-
- // copy argument index
- GLMessage_DataType *arg_index = glmsg.add_args();
- arg_index->set_isarray(false);
- arg_index->set_type(GLMessage::DataType::INT);
- arg_index->add_intvalue(index);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDisableVertexAttribArray(index);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawArrays(GLenum mode, GLint first, GLsizei count) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawArrays);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // copy argument first
- GLMessage_DataType *arg_first = glmsg.add_args();
- arg_first->set_isarray(false);
- arg_first->set_type(GLMessage::DataType::INT);
- arg_first->add_intvalue(first);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawArrays(mode, first, count);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawElements);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument indices
- GLMessage_DataType *arg_indices = glmsg.add_args();
- arg_indices->set_isarray(false);
- arg_indices->set_type(GLMessage::DataType::INT);
- arg_indices->add_intvalue((int)indices);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawElements(mode, count, type, indices);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) indices,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEnable(GLenum cap) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glEnable);
-
- // copy argument cap
- GLMessage_DataType *arg_cap = glmsg.add_args();
- arg_cap->set_isarray(false);
- arg_cap->set_type(GLMessage::DataType::ENUM);
- arg_cap->add_intvalue((int)cap);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glEnable(cap);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEnableVertexAttribArray(GLuint index) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glEnableVertexAttribArray);
-
- // copy argument index
- GLMessage_DataType *arg_index = glmsg.add_args();
- arg_index->set_isarray(false);
- arg_index->set_type(GLMessage::DataType::INT);
- arg_index->add_intvalue(index);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glEnableVertexAttribArray(index);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFinish(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFinish);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFinish();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFlush(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFlush);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFlush();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFramebufferRenderbuffer);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument attachment
- GLMessage_DataType *arg_attachment = glmsg.add_args();
- arg_attachment->set_isarray(false);
- arg_attachment->set_type(GLMessage::DataType::ENUM);
- arg_attachment->add_intvalue((int)attachment);
-
- // copy argument renderbuffertarget
- GLMessage_DataType *arg_renderbuffertarget = glmsg.add_args();
- arg_renderbuffertarget->set_isarray(false);
- arg_renderbuffertarget->set_type(GLMessage::DataType::ENUM);
- arg_renderbuffertarget->add_intvalue((int)renderbuffertarget);
-
- // copy argument renderbuffer
- GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
- arg_renderbuffer->set_isarray(false);
- arg_renderbuffer->set_type(GLMessage::DataType::INT);
- arg_renderbuffer->add_intvalue(renderbuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFramebufferTexture2D);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument attachment
- GLMessage_DataType *arg_attachment = glmsg.add_args();
- arg_attachment->set_isarray(false);
- arg_attachment->set_type(GLMessage::DataType::ENUM);
- arg_attachment->add_intvalue((int)attachment);
-
- // copy argument textarget
- GLMessage_DataType *arg_textarget = glmsg.add_args();
- arg_textarget->set_isarray(false);
- arg_textarget->set_type(GLMessage::DataType::ENUM);
- arg_textarget->add_intvalue((int)textarget);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFramebufferTexture2D(target, attachment, textarget, texture, level);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrontFace(GLenum mode) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFrontFace);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFrontFace(mode);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenBuffers(GLsizei n, GLuint* buffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenBuffers);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument buffers
- GLMessage_DataType *arg_buffers = glmsg.add_args();
- arg_buffers->set_isarray(false);
- arg_buffers->set_type(GLMessage::DataType::INT);
- arg_buffers->add_intvalue((int)buffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenBuffers(n, buffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) buffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenerateMipmap(GLenum target) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenerateMipmap);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenerateMipmap(target);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenFramebuffers(GLsizei n, GLuint* framebuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenFramebuffers);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument framebuffers
- GLMessage_DataType *arg_framebuffers = glmsg.add_args();
- arg_framebuffers->set_isarray(false);
- arg_framebuffers->set_type(GLMessage::DataType::INT);
- arg_framebuffers->add_intvalue((int)framebuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenFramebuffers(n, framebuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) framebuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenRenderbuffers(GLsizei n, GLuint* renderbuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenRenderbuffers);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument renderbuffers
- GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
- arg_renderbuffers->set_isarray(false);
- arg_renderbuffers->set_type(GLMessage::DataType::INT);
- arg_renderbuffers->add_intvalue((int)renderbuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenRenderbuffers(n, renderbuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) renderbuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenTextures(GLsizei n, GLuint* textures) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenTextures);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument textures
- GLMessage_DataType *arg_textures = glmsg.add_args();
- arg_textures->set_isarray(false);
- arg_textures->set_type(GLMessage::DataType::INT);
- arg_textures->add_intvalue((int)textures);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenTextures(n, textures);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) textures,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetActiveAttrib);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument index
- GLMessage_DataType *arg_index = glmsg.add_args();
- arg_index->set_isarray(false);
- arg_index->set_type(GLMessage::DataType::INT);
- arg_index->add_intvalue(index);
-
- // copy argument bufsize
- GLMessage_DataType *arg_bufsize = glmsg.add_args();
- arg_bufsize->set_isarray(false);
- arg_bufsize->set_type(GLMessage::DataType::INT);
- arg_bufsize->add_intvalue(bufsize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue((int)size);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::INT);
- arg_type->add_intvalue((int)type);
-
- // copy argument name
- GLMessage_DataType *arg_name = glmsg.add_args();
- arg_name->set_isarray(false);
- arg_name->set_type(GLMessage::DataType::INT);
- arg_name->add_intvalue((int)name);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetActiveAttrib(program, index, bufsize, length, size, type, name);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) size,
- (void *) type,
- (void *) name,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetActiveUniform);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument index
- GLMessage_DataType *arg_index = glmsg.add_args();
- arg_index->set_isarray(false);
- arg_index->set_type(GLMessage::DataType::INT);
- arg_index->add_intvalue(index);
-
- // copy argument bufsize
- GLMessage_DataType *arg_bufsize = glmsg.add_args();
- arg_bufsize->set_isarray(false);
- arg_bufsize->set_type(GLMessage::DataType::INT);
- arg_bufsize->add_intvalue(bufsize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue((int)size);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::INT);
- arg_type->add_intvalue((int)type);
-
- // copy argument name
- GLMessage_DataType *arg_name = glmsg.add_args();
- arg_name->set_isarray(false);
- arg_name->set_type(GLMessage::DataType::INT);
- arg_name->add_intvalue((int)name);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetActiveUniform(program, index, bufsize, length, size, type, name);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) size,
- (void *) type,
- (void *) name,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetAttachedShaders);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument maxcount
- GLMessage_DataType *arg_maxcount = glmsg.add_args();
- arg_maxcount->set_isarray(false);
- arg_maxcount->set_type(GLMessage::DataType::INT);
- arg_maxcount->add_intvalue(maxcount);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue((int)count);
-
- // copy argument shaders
- GLMessage_DataType *arg_shaders = glmsg.add_args();
- arg_shaders->set_isarray(false);
- arg_shaders->set_type(GLMessage::DataType::INT);
- arg_shaders->add_intvalue((int)shaders);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetAttachedShaders(program, maxcount, count, shaders);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) count,
- (void *) shaders,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-int GLTrace_glGetAttribLocation(GLuint program, const GLchar* name) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetAttribLocation);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument name
- GLMessage_DataType *arg_name = glmsg.add_args();
- arg_name->set_isarray(false);
- arg_name->set_type(GLMessage::DataType::INT);
- arg_name->add_intvalue((int)name);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- int retValue = glContext->hooks->gl.glGetAttribLocation(program, name);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::INT);
- rt->add_intvalue(retValue);
-
- void *pointerArgs[] = {
- (void *) name,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glGetBooleanv(GLenum pname, GLboolean* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetBooleanv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetBooleanv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetBufferParameteriv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetBufferParameteriv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glGetError(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetError);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLenum retValue = glContext->hooks->gl.glGetError();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::ENUM);
- rt->add_intvalue((int)retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glGetFloatv(GLenum pname, GLfloat* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetFloatv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetFloatv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetFramebufferAttachmentParameteriv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument attachment
- GLMessage_DataType *arg_attachment = glmsg.add_args();
- arg_attachment->set_isarray(false);
- arg_attachment->set_type(GLMessage::DataType::ENUM);
- arg_attachment->add_intvalue((int)attachment);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetIntegerv(GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetIntegerv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetIntegerv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramiv(GLuint program, GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetProgramiv);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetProgramiv(program, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetProgramInfoLog);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument bufsize
- GLMessage_DataType *arg_bufsize = glmsg.add_args();
- arg_bufsize->set_isarray(false);
- arg_bufsize->set_type(GLMessage::DataType::INT);
- arg_bufsize->add_intvalue(bufsize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument infolog
- GLMessage_DataType *arg_infolog = glmsg.add_args();
- arg_infolog->set_isarray(false);
- arg_infolog->set_type(GLMessage::DataType::INT);
- arg_infolog->add_intvalue((int)infolog);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetProgramInfoLog(program, bufsize, length, infolog);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) infolog,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetRenderbufferParameteriv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetRenderbufferParameteriv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetShaderiv(GLuint shader, GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetShaderiv);
-
- // copy argument shader
- GLMessage_DataType *arg_shader = glmsg.add_args();
- arg_shader->set_isarray(false);
- arg_shader->set_type(GLMessage::DataType::INT);
- arg_shader->add_intvalue(shader);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetShaderiv(shader, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetShaderInfoLog);
-
- // copy argument shader
- GLMessage_DataType *arg_shader = glmsg.add_args();
- arg_shader->set_isarray(false);
- arg_shader->set_type(GLMessage::DataType::INT);
- arg_shader->add_intvalue(shader);
-
- // copy argument bufsize
- GLMessage_DataType *arg_bufsize = glmsg.add_args();
- arg_bufsize->set_isarray(false);
- arg_bufsize->set_type(GLMessage::DataType::INT);
- arg_bufsize->add_intvalue(bufsize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument infolog
- GLMessage_DataType *arg_infolog = glmsg.add_args();
- arg_infolog->set_isarray(false);
- arg_infolog->set_type(GLMessage::DataType::INT);
- arg_infolog->add_intvalue((int)infolog);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetShaderInfoLog(shader, bufsize, length, infolog);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) infolog,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetShaderPrecisionFormat);
-
- // copy argument shadertype
- GLMessage_DataType *arg_shadertype = glmsg.add_args();
- arg_shadertype->set_isarray(false);
- arg_shadertype->set_type(GLMessage::DataType::ENUM);
- arg_shadertype->add_intvalue((int)shadertype);
-
- // copy argument precisiontype
- GLMessage_DataType *arg_precisiontype = glmsg.add_args();
- arg_precisiontype->set_isarray(false);
- arg_precisiontype->set_type(GLMessage::DataType::ENUM);
- arg_precisiontype->add_intvalue((int)precisiontype);
-
- // copy argument range
- GLMessage_DataType *arg_range = glmsg.add_args();
- arg_range->set_isarray(false);
- arg_range->set_type(GLMessage::DataType::INT);
- arg_range->add_intvalue((int)range);
-
- // copy argument precision
- GLMessage_DataType *arg_precision = glmsg.add_args();
- arg_precision->set_isarray(false);
- arg_precision->set_type(GLMessage::DataType::INT);
- arg_precision->add_intvalue((int)precision);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) range,
- (void *) precision,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetShaderSource);
-
- // copy argument shader
- GLMessage_DataType *arg_shader = glmsg.add_args();
- arg_shader->set_isarray(false);
- arg_shader->set_type(GLMessage::DataType::INT);
- arg_shader->add_intvalue(shader);
-
- // copy argument bufsize
- GLMessage_DataType *arg_bufsize = glmsg.add_args();
- arg_bufsize->set_isarray(false);
- arg_bufsize->set_type(GLMessage::DataType::INT);
- arg_bufsize->add_intvalue(bufsize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument source
- GLMessage_DataType *arg_source = glmsg.add_args();
- arg_source->set_isarray(false);
- arg_source->set_type(GLMessage::DataType::INT);
- arg_source->add_intvalue((int)source);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetShaderSource(shader, bufsize, length, source);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) source,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-const GLubyte* GLTrace_glGetString(GLenum name) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetString);
-
- // copy argument name
- GLMessage_DataType *arg_name = glmsg.add_args();
- arg_name->set_isarray(false);
- arg_name->set_type(GLMessage::DataType::ENUM);
- arg_name->add_intvalue((int)name);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- const GLubyte* retValue = glContext->hooks->gl.glGetString(name);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::INT);
- rt->add_intvalue((int)retValue);
-
- void *pointerArgs[] = {
- (void *) retValue,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexParameterfv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexParameterfv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexParameteriv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexParameteriv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetUniformfv(GLuint program, GLint location, GLfloat* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetUniformfv);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetUniformfv(program, location, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetUniformiv(GLuint program, GLint location, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetUniformiv);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetUniformiv(program, location, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-int GLTrace_glGetUniformLocation(GLuint program, const GLchar* name) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetUniformLocation);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument name
- GLMessage_DataType *arg_name = glmsg.add_args();
- arg_name->set_isarray(false);
- arg_name->set_type(GLMessage::DataType::INT);
- arg_name->add_intvalue((int)name);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- int retValue = glContext->hooks->gl.glGetUniformLocation(program, name);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::INT);
- rt->add_intvalue(retValue);
-
- void *pointerArgs[] = {
- (void *) name,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetVertexAttribfv);
-
- // copy argument index
- GLMessage_DataType *arg_index = glmsg.add_args();
- arg_index->set_isarray(false);
- arg_index->set_type(GLMessage::DataType::INT);
- arg_index->add_intvalue(index);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetVertexAttribfv(index, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetVertexAttribiv);
-
- // copy argument index
- GLMessage_DataType *arg_index = glmsg.add_args();
- arg_index->set_isarray(false);
- arg_index->set_type(GLMessage::DataType::INT);
- arg_index->add_intvalue(index);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetVertexAttribiv(index, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetVertexAttribPointerv);
-
- // copy argument index
- GLMessage_DataType *arg_index = glmsg.add_args();
- arg_index->set_isarray(false);
- arg_index->set_type(GLMessage::DataType::INT);
- arg_index->add_intvalue(index);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument pointer
- GLMessage_DataType *arg_pointer = glmsg.add_args();
- arg_pointer->set_isarray(false);
- arg_pointer->set_type(GLMessage::DataType::INT);
- arg_pointer->add_intvalue((int)pointer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetVertexAttribPointerv(index, pname, pointer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pointer,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glHint(GLenum target, GLenum mode) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glHint);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glHint(target, mode);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsBuffer(GLuint buffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsBuffer);
-
- // copy argument buffer
- GLMessage_DataType *arg_buffer = glmsg.add_args();
- arg_buffer->set_isarray(false);
- arg_buffer->set_type(GLMessage::DataType::INT);
- arg_buffer->add_intvalue(buffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsBuffer(buffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-GLboolean GLTrace_glIsEnabled(GLenum cap) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsEnabled);
-
- // copy argument cap
- GLMessage_DataType *arg_cap = glmsg.add_args();
- arg_cap->set_isarray(false);
- arg_cap->set_type(GLMessage::DataType::ENUM);
- arg_cap->add_intvalue((int)cap);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsEnabled(cap);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-GLboolean GLTrace_glIsFramebuffer(GLuint framebuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsFramebuffer);
-
- // copy argument framebuffer
- GLMessage_DataType *arg_framebuffer = glmsg.add_args();
- arg_framebuffer->set_isarray(false);
- arg_framebuffer->set_type(GLMessage::DataType::INT);
- arg_framebuffer->add_intvalue(framebuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsFramebuffer(framebuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-GLboolean GLTrace_glIsProgram(GLuint program) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsProgram);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsProgram(program);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-GLboolean GLTrace_glIsRenderbuffer(GLuint renderbuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsRenderbuffer);
-
- // copy argument renderbuffer
- GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
- arg_renderbuffer->set_isarray(false);
- arg_renderbuffer->set_type(GLMessage::DataType::INT);
- arg_renderbuffer->add_intvalue(renderbuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsRenderbuffer(renderbuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-GLboolean GLTrace_glIsShader(GLuint shader) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsShader);
-
- // copy argument shader
- GLMessage_DataType *arg_shader = glmsg.add_args();
- arg_shader->set_isarray(false);
- arg_shader->set_type(GLMessage::DataType::INT);
- arg_shader->add_intvalue(shader);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsShader(shader);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-GLboolean GLTrace_glIsTexture(GLuint texture) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsTexture);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsTexture(texture);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glLineWidth(GLfloat width) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLineWidth);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::FLOAT);
- arg_width->add_floatvalue(width);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLineWidth(width);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLinkProgram(GLuint program) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLinkProgram);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLinkProgram(program);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPixelStorei(GLenum pname, GLint param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPixelStorei);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPixelStorei(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPolygonOffset(GLfloat factor, GLfloat units) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPolygonOffset);
-
- // copy argument factor
- GLMessage_DataType *arg_factor = glmsg.add_args();
- arg_factor->set_isarray(false);
- arg_factor->set_type(GLMessage::DataType::FLOAT);
- arg_factor->add_floatvalue(factor);
-
- // copy argument units
- GLMessage_DataType *arg_units = glmsg.add_args();
- arg_units->set_isarray(false);
- arg_units->set_type(GLMessage::DataType::FLOAT);
- arg_units->add_floatvalue(units);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPolygonOffset(factor, units);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glReadPixels);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument format
- GLMessage_DataType *arg_format = glmsg.add_args();
- arg_format->set_isarray(false);
- arg_format->set_type(GLMessage::DataType::ENUM);
- arg_format->add_intvalue((int)format);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument pixels
- GLMessage_DataType *arg_pixels = glmsg.add_args();
- arg_pixels->set_isarray(false);
- arg_pixels->set_type(GLMessage::DataType::INT);
- arg_pixels->add_intvalue((int)pixels);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glReadPixels(x, y, width, height, format, type, pixels);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pixels,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glReleaseShaderCompiler(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glReleaseShaderCompiler);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glReleaseShaderCompiler();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glRenderbufferStorage);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glRenderbufferStorage(target, internalformat, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSampleCoverage(GLclampf value, GLboolean invert) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glSampleCoverage);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::FLOAT);
- arg_value->add_floatvalue(value);
-
- // copy argument invert
- GLMessage_DataType *arg_invert = glmsg.add_args();
- arg_invert->set_isarray(false);
- arg_invert->set_type(GLMessage::DataType::BOOL);
- arg_invert->add_boolvalue(invert);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glSampleCoverage(value, invert);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glScissor(GLint x, GLint y, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glScissor);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glScissor(x, y, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glShaderBinary);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument shaders
- GLMessage_DataType *arg_shaders = glmsg.add_args();
- arg_shaders->set_isarray(false);
- arg_shaders->set_type(GLMessage::DataType::INT);
- arg_shaders->add_intvalue((int)shaders);
-
- // copy argument binaryformat
- GLMessage_DataType *arg_binaryformat = glmsg.add_args();
- arg_binaryformat->set_isarray(false);
- arg_binaryformat->set_type(GLMessage::DataType::ENUM);
- arg_binaryformat->add_intvalue((int)binaryformat);
-
- // copy argument binary
- GLMessage_DataType *arg_binary = glmsg.add_args();
- arg_binary->set_isarray(false);
- arg_binary->set_type(GLMessage::DataType::INT);
- arg_binary->add_intvalue((int)binary);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue(length);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glShaderBinary(n, shaders, binaryformat, binary, length);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) shaders,
- (void *) binary,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glShaderSource);
-
- // copy argument shader
- GLMessage_DataType *arg_shader = glmsg.add_args();
- arg_shader->set_isarray(false);
- arg_shader->set_type(GLMessage::DataType::INT);
- arg_shader->add_intvalue(shader);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument string
- GLMessage_DataType *arg_string = glmsg.add_args();
- arg_string->set_isarray(false);
- arg_string->set_type(GLMessage::DataType::INT);
- arg_string->add_intvalue((int)string);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glShaderSource(shader, count, string, length);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) string,
- (void *) length,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilFunc(GLenum func, GLint ref, GLuint mask) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glStencilFunc);
-
- // copy argument func
- GLMessage_DataType *arg_func = glmsg.add_args();
- arg_func->set_isarray(false);
- arg_func->set_type(GLMessage::DataType::ENUM);
- arg_func->add_intvalue((int)func);
-
- // copy argument ref
- GLMessage_DataType *arg_ref = glmsg.add_args();
- arg_ref->set_isarray(false);
- arg_ref->set_type(GLMessage::DataType::INT);
- arg_ref->add_intvalue(ref);
-
- // copy argument mask
- GLMessage_DataType *arg_mask = glmsg.add_args();
- arg_mask->set_isarray(false);
- arg_mask->set_type(GLMessage::DataType::INT);
- arg_mask->add_intvalue(mask);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glStencilFunc(func, ref, mask);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glStencilFuncSeparate);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument func
- GLMessage_DataType *arg_func = glmsg.add_args();
- arg_func->set_isarray(false);
- arg_func->set_type(GLMessage::DataType::ENUM);
- arg_func->add_intvalue((int)func);
-
- // copy argument ref
- GLMessage_DataType *arg_ref = glmsg.add_args();
- arg_ref->set_isarray(false);
- arg_ref->set_type(GLMessage::DataType::INT);
- arg_ref->add_intvalue(ref);
-
- // copy argument mask
- GLMessage_DataType *arg_mask = glmsg.add_args();
- arg_mask->set_isarray(false);
- arg_mask->set_type(GLMessage::DataType::INT);
- arg_mask->add_intvalue(mask);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glStencilFuncSeparate(face, func, ref, mask);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilMask(GLuint mask) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glStencilMask);
-
- // copy argument mask
- GLMessage_DataType *arg_mask = glmsg.add_args();
- arg_mask->set_isarray(false);
- arg_mask->set_type(GLMessage::DataType::INT);
- arg_mask->add_intvalue(mask);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glStencilMask(mask);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilMaskSeparate(GLenum face, GLuint mask) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glStencilMaskSeparate);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument mask
- GLMessage_DataType *arg_mask = glmsg.add_args();
- arg_mask->set_isarray(false);
- arg_mask->set_type(GLMessage::DataType::INT);
- arg_mask->add_intvalue(mask);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glStencilMaskSeparate(face, mask);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glStencilOp);
-
- // copy argument fail
- GLMessage_DataType *arg_fail = glmsg.add_args();
- arg_fail->set_isarray(false);
- arg_fail->set_type(GLMessage::DataType::ENUM);
- arg_fail->add_intvalue((int)fail);
-
- // copy argument zfail
- GLMessage_DataType *arg_zfail = glmsg.add_args();
- arg_zfail->set_isarray(false);
- arg_zfail->set_type(GLMessage::DataType::ENUM);
- arg_zfail->add_intvalue((int)zfail);
-
- // copy argument zpass
- GLMessage_DataType *arg_zpass = glmsg.add_args();
- arg_zpass->set_isarray(false);
- arg_zpass->set_type(GLMessage::DataType::ENUM);
- arg_zpass->add_intvalue((int)zpass);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glStencilOp(fail, zfail, zpass);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glStencilOpSeparate);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument fail
- GLMessage_DataType *arg_fail = glmsg.add_args();
- arg_fail->set_isarray(false);
- arg_fail->set_type(GLMessage::DataType::ENUM);
- arg_fail->add_intvalue((int)fail);
-
- // copy argument zfail
- GLMessage_DataType *arg_zfail = glmsg.add_args();
- arg_zfail->set_isarray(false);
- arg_zfail->set_type(GLMessage::DataType::ENUM);
- arg_zfail->add_intvalue((int)zfail);
-
- // copy argument zpass
- GLMessage_DataType *arg_zpass = glmsg.add_args();
- arg_zpass->set_isarray(false);
- arg_zpass->set_type(GLMessage::DataType::ENUM);
- arg_zpass->add_intvalue((int)zpass);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glStencilOpSeparate(face, fail, zfail, zpass);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexImage2D);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::INT);
- arg_internalformat->add_intvalue(internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument border
- GLMessage_DataType *arg_border = glmsg.add_args();
- arg_border->set_isarray(false);
- arg_border->set_type(GLMessage::DataType::INT);
- arg_border->add_intvalue(border);
-
- // copy argument format
- GLMessage_DataType *arg_format = glmsg.add_args();
- arg_format->set_isarray(false);
- arg_format->set_type(GLMessage::DataType::ENUM);
- arg_format->add_intvalue((int)format);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument pixels
- GLMessage_DataType *arg_pixels = glmsg.add_args();
- arg_pixels->set_isarray(false);
- arg_pixels->set_type(GLMessage::DataType::INT);
- arg_pixels->add_intvalue((int)pixels);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pixels,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterf(GLenum target, GLenum pname, GLfloat param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexParameterf);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::FLOAT);
- arg_param->add_floatvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexParameterf(target, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexParameterfv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexParameterfv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameteri(GLenum target, GLenum pname, GLint param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexParameteri);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexParameteri(target, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameteriv(GLenum target, GLenum pname, const GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexParameteriv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexParameteriv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexSubImage2D);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument xoffset
- GLMessage_DataType *arg_xoffset = glmsg.add_args();
- arg_xoffset->set_isarray(false);
- arg_xoffset->set_type(GLMessage::DataType::INT);
- arg_xoffset->add_intvalue(xoffset);
-
- // copy argument yoffset
- GLMessage_DataType *arg_yoffset = glmsg.add_args();
- arg_yoffset->set_isarray(false);
- arg_yoffset->set_type(GLMessage::DataType::INT);
- arg_yoffset->add_intvalue(yoffset);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument format
- GLMessage_DataType *arg_format = glmsg.add_args();
- arg_format->set_isarray(false);
- arg_format->set_type(GLMessage::DataType::ENUM);
- arg_format->add_intvalue((int)format);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument pixels
- GLMessage_DataType *arg_pixels = glmsg.add_args();
- arg_pixels->set_isarray(false);
- arg_pixels->set_type(GLMessage::DataType::INT);
- arg_pixels->add_intvalue((int)pixels);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pixels,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform1f(GLint location, GLfloat x) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform1f);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform1f(location, x);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform1fv(GLint location, GLsizei count, const GLfloat* v) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform1fv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument v
- GLMessage_DataType *arg_v = glmsg.add_args();
- arg_v->set_isarray(false);
- arg_v->set_type(GLMessage::DataType::INT);
- arg_v->add_intvalue((int)v);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform1fv(location, count, v);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) v,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform1i(GLint location, GLint x) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform1i);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform1i(location, x);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform1iv(GLint location, GLsizei count, const GLint* v) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform1iv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument v
- GLMessage_DataType *arg_v = glmsg.add_args();
- arg_v->set_isarray(false);
- arg_v->set_type(GLMessage::DataType::INT);
- arg_v->add_intvalue((int)v);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform1iv(location, count, v);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) v,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2f(GLint location, GLfloat x, GLfloat y) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform2f);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform2f(location, x, y);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2fv(GLint location, GLsizei count, const GLfloat* v) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform2fv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument v
- GLMessage_DataType *arg_v = glmsg.add_args();
- arg_v->set_isarray(false);
- arg_v->set_type(GLMessage::DataType::INT);
- arg_v->add_intvalue((int)v);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform2fv(location, count, v);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) v,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2i(GLint location, GLint x, GLint y) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform2i);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform2i(location, x, y);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2iv(GLint location, GLsizei count, const GLint* v) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform2iv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument v
- GLMessage_DataType *arg_v = glmsg.add_args();
- arg_v->set_isarray(false);
- arg_v->set_type(GLMessage::DataType::INT);
- arg_v->add_intvalue((int)v);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform2iv(location, count, v);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) v,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform3f);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform3f(location, x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3fv(GLint location, GLsizei count, const GLfloat* v) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform3fv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument v
- GLMessage_DataType *arg_v = glmsg.add_args();
- arg_v->set_isarray(false);
- arg_v->set_type(GLMessage::DataType::INT);
- arg_v->add_intvalue((int)v);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform3fv(location, count, v);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) v,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3i(GLint location, GLint x, GLint y, GLint z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform3i);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform3i(location, x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3iv(GLint location, GLsizei count, const GLint* v) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform3iv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument v
- GLMessage_DataType *arg_v = glmsg.add_args();
- arg_v->set_isarray(false);
- arg_v->set_type(GLMessage::DataType::INT);
- arg_v->add_intvalue((int)v);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform3iv(location, count, v);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) v,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform4f);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // copy argument w
- GLMessage_DataType *arg_w = glmsg.add_args();
- arg_w->set_isarray(false);
- arg_w->set_type(GLMessage::DataType::FLOAT);
- arg_w->add_floatvalue(w);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform4f(location, x, y, z, w);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4fv(GLint location, GLsizei count, const GLfloat* v) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform4fv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument v
- GLMessage_DataType *arg_v = glmsg.add_args();
- arg_v->set_isarray(false);
- arg_v->set_type(GLMessage::DataType::INT);
- arg_v->add_intvalue((int)v);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform4fv(location, count, v);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) v,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform4i);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // copy argument w
- GLMessage_DataType *arg_w = glmsg.add_args();
- arg_w->set_isarray(false);
- arg_w->set_type(GLMessage::DataType::INT);
- arg_w->add_intvalue(w);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform4i(location, x, y, z, w);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4iv(GLint location, GLsizei count, const GLint* v) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniform4iv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument v
- GLMessage_DataType *arg_v = glmsg.add_args();
- arg_v->set_isarray(false);
- arg_v->set_type(GLMessage::DataType::INT);
- arg_v->add_intvalue((int)v);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniform4iv(location, count, v);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) v,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniformMatrix2fv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument transpose
- GLMessage_DataType *arg_transpose = glmsg.add_args();
- arg_transpose->set_isarray(false);
- arg_transpose->set_type(GLMessage::DataType::BOOL);
- arg_transpose->add_boolvalue(transpose);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniformMatrix2fv(location, count, transpose, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniformMatrix3fv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument transpose
- GLMessage_DataType *arg_transpose = glmsg.add_args();
- arg_transpose->set_isarray(false);
- arg_transpose->set_type(GLMessage::DataType::BOOL);
- arg_transpose->add_boolvalue(transpose);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniformMatrix3fv(location, count, transpose, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUniformMatrix4fv);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument transpose
- GLMessage_DataType *arg_transpose = glmsg.add_args();
- arg_transpose->set_isarray(false);
- arg_transpose->set_type(GLMessage::DataType::BOOL);
- arg_transpose->add_boolvalue(transpose);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUniformMatrix4fv(location, count, transpose, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUseProgram(GLuint program) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUseProgram);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUseProgram(program);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glValidateProgram(GLuint program) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glValidateProgram);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glValidateProgram(program);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib1f(GLuint indx, GLfloat x) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexAttrib1f);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexAttrib1f(indx, x);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib1fv(GLuint indx, const GLfloat* values) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexAttrib1fv);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument values
- GLMessage_DataType *arg_values = glmsg.add_args();
- arg_values->set_isarray(false);
- arg_values->set_type(GLMessage::DataType::INT);
- arg_values->add_intvalue((int)values);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexAttrib1fv(indx, values);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) values,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexAttrib2f);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexAttrib2f(indx, x, y);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib2fv(GLuint indx, const GLfloat* values) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexAttrib2fv);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument values
- GLMessage_DataType *arg_values = glmsg.add_args();
- arg_values->set_isarray(false);
- arg_values->set_type(GLMessage::DataType::INT);
- arg_values->add_intvalue((int)values);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexAttrib2fv(indx, values);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) values,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexAttrib3f);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexAttrib3f(indx, x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib3fv(GLuint indx, const GLfloat* values) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexAttrib3fv);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument values
- GLMessage_DataType *arg_values = glmsg.add_args();
- arg_values->set_isarray(false);
- arg_values->set_type(GLMessage::DataType::INT);
- arg_values->add_intvalue((int)values);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexAttrib3fv(indx, values);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) values,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexAttrib4f);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // copy argument w
- GLMessage_DataType *arg_w = glmsg.add_args();
- arg_w->set_isarray(false);
- arg_w->set_type(GLMessage::DataType::FLOAT);
- arg_w->add_floatvalue(w);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexAttrib4f(indx, x, y, z, w);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib4fv(GLuint indx, const GLfloat* values) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexAttrib4fv);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument values
- GLMessage_DataType *arg_values = glmsg.add_args();
- arg_values->set_isarray(false);
- arg_values->set_type(GLMessage::DataType::INT);
- arg_values->add_intvalue((int)values);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexAttrib4fv(indx, values);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) values,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexAttribPointer);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument normalized
- GLMessage_DataType *arg_normalized = glmsg.add_args();
- arg_normalized->set_isarray(false);
- arg_normalized->set_type(GLMessage::DataType::BOOL);
- arg_normalized->add_boolvalue(normalized);
-
- // copy argument stride
- GLMessage_DataType *arg_stride = glmsg.add_args();
- arg_stride->set_isarray(false);
- arg_stride->set_type(GLMessage::DataType::INT);
- arg_stride->add_intvalue(stride);
-
- // copy argument ptr
- GLMessage_DataType *arg_ptr = glmsg.add_args();
- arg_ptr->set_isarray(false);
- arg_ptr->set_type(GLMessage::DataType::INT);
- arg_ptr->add_intvalue((int)ptr);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) ptr,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glViewport);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glViewport(x, y, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-
-// Definitions for GL2Ext APIs
-
-void GLTrace_glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glEGLImageTargetTexture2DOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument image
- GLMessage_DataType *arg_image = glmsg.add_args();
- arg_image->set_isarray(false);
- arg_image->set_type(GLMessage::DataType::INT);
- arg_image->add_intvalue((int)image);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glEGLImageTargetTexture2DOES(target, image);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) image,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glEGLImageTargetRenderbufferStorageOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument image
- GLMessage_DataType *arg_image = glmsg.add_args();
- arg_image->set_isarray(false);
- arg_image->set_type(GLMessage::DataType::INT);
- arg_image->add_intvalue((int)image);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glEGLImageTargetRenderbufferStorageOES(target, image);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) image,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetProgramBinaryOES);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument bufSize
- GLMessage_DataType *arg_bufSize = glmsg.add_args();
- arg_bufSize->set_isarray(false);
- arg_bufSize->set_type(GLMessage::DataType::INT);
- arg_bufSize->add_intvalue(bufSize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument binaryFormat
- GLMessage_DataType *arg_binaryFormat = glmsg.add_args();
- arg_binaryFormat->set_isarray(false);
- arg_binaryFormat->set_type(GLMessage::DataType::INT);
- arg_binaryFormat->add_intvalue((int)binaryFormat);
-
- // copy argument binary
- GLMessage_DataType *arg_binary = glmsg.add_args();
- arg_binary->set_isarray(false);
- arg_binary->set_type(GLMessage::DataType::INT);
- arg_binary->add_intvalue((int)binary);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) binaryFormat,
- (void *) binary,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramBinaryOES);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument binaryFormat
- GLMessage_DataType *arg_binaryFormat = glmsg.add_args();
- arg_binaryFormat->set_isarray(false);
- arg_binaryFormat->set_type(GLMessage::DataType::ENUM);
- arg_binaryFormat->add_intvalue((int)binaryFormat);
-
- // copy argument binary
- GLMessage_DataType *arg_binary = glmsg.add_args();
- arg_binary->set_isarray(false);
- arg_binary->set_type(GLMessage::DataType::INT);
- arg_binary->add_intvalue((int)binary);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue(length);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramBinaryOES(program, binaryFormat, binary, length);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) binary,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void* GLTrace_glMapBufferOES(GLenum target, GLenum access) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMapBufferOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument access
- GLMessage_DataType *arg_access = glmsg.add_args();
- arg_access->set_isarray(false);
- arg_access->set_type(GLMessage::DataType::ENUM);
- arg_access->add_intvalue((int)access);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- void* retValue = glContext->hooks->gl.glMapBufferOES(target, access);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::INT);
- rt->add_intvalue((int)retValue);
-
- void *pointerArgs[] = {
- (void *) retValue,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-GLboolean GLTrace_glUnmapBufferOES(GLenum target) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUnmapBufferOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glUnmapBufferOES(target);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetBufferPointervOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetBufferPointervOES(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexImage3DOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::INT);
- arg_depth->add_intvalue(depth);
-
- // copy argument border
- GLMessage_DataType *arg_border = glmsg.add_args();
- arg_border->set_isarray(false);
- arg_border->set_type(GLMessage::DataType::INT);
- arg_border->add_intvalue(border);
-
- // copy argument format
- GLMessage_DataType *arg_format = glmsg.add_args();
- arg_format->set_isarray(false);
- arg_format->set_type(GLMessage::DataType::ENUM);
- arg_format->add_intvalue((int)format);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument pixels
- GLMessage_DataType *arg_pixels = glmsg.add_args();
- arg_pixels->set_isarray(false);
- arg_pixels->set_type(GLMessage::DataType::INT);
- arg_pixels->add_intvalue((int)pixels);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexImage3DOES(target, level, internalformat, width, height, depth, border, format, type, pixels);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pixels,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexSubImage3DOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument xoffset
- GLMessage_DataType *arg_xoffset = glmsg.add_args();
- arg_xoffset->set_isarray(false);
- arg_xoffset->set_type(GLMessage::DataType::INT);
- arg_xoffset->add_intvalue(xoffset);
-
- // copy argument yoffset
- GLMessage_DataType *arg_yoffset = glmsg.add_args();
- arg_yoffset->set_isarray(false);
- arg_yoffset->set_type(GLMessage::DataType::INT);
- arg_yoffset->add_intvalue(yoffset);
-
- // copy argument zoffset
- GLMessage_DataType *arg_zoffset = glmsg.add_args();
- arg_zoffset->set_isarray(false);
- arg_zoffset->set_type(GLMessage::DataType::INT);
- arg_zoffset->add_intvalue(zoffset);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::INT);
- arg_depth->add_intvalue(depth);
-
- // copy argument format
- GLMessage_DataType *arg_format = glmsg.add_args();
- arg_format->set_isarray(false);
- arg_format->set_type(GLMessage::DataType::ENUM);
- arg_format->add_intvalue((int)format);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument pixels
- GLMessage_DataType *arg_pixels = glmsg.add_args();
- arg_pixels->set_isarray(false);
- arg_pixels->set_type(GLMessage::DataType::INT);
- arg_pixels->add_intvalue((int)pixels);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pixels,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCopyTexSubImage3DOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument xoffset
- GLMessage_DataType *arg_xoffset = glmsg.add_args();
- arg_xoffset->set_isarray(false);
- arg_xoffset->set_type(GLMessage::DataType::INT);
- arg_xoffset->add_intvalue(xoffset);
-
- // copy argument yoffset
- GLMessage_DataType *arg_yoffset = glmsg.add_args();
- arg_yoffset->set_isarray(false);
- arg_yoffset->set_type(GLMessage::DataType::INT);
- arg_yoffset->add_intvalue(yoffset);
-
- // copy argument zoffset
- GLMessage_DataType *arg_zoffset = glmsg.add_args();
- arg_zoffset->set_isarray(false);
- arg_zoffset->set_type(GLMessage::DataType::INT);
- arg_zoffset->add_intvalue(zoffset);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCopyTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, x, y, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCompressedTexImage3DOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::INT);
- arg_depth->add_intvalue(depth);
-
- // copy argument border
- GLMessage_DataType *arg_border = glmsg.add_args();
- arg_border->set_isarray(false);
- arg_border->set_type(GLMessage::DataType::INT);
- arg_border->add_intvalue(border);
-
- // copy argument imageSize
- GLMessage_DataType *arg_imageSize = glmsg.add_args();
- arg_imageSize->set_isarray(false);
- arg_imageSize->set_type(GLMessage::DataType::INT);
- arg_imageSize->add_intvalue(imageSize);
-
- // copy argument data
- GLMessage_DataType *arg_data = glmsg.add_args();
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::INT);
- arg_data->add_intvalue((int)data);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCompressedTexImage3DOES(target, level, internalformat, width, height, depth, border, imageSize, data);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) data,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCompressedTexSubImage3DOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument xoffset
- GLMessage_DataType *arg_xoffset = glmsg.add_args();
- arg_xoffset->set_isarray(false);
- arg_xoffset->set_type(GLMessage::DataType::INT);
- arg_xoffset->add_intvalue(xoffset);
-
- // copy argument yoffset
- GLMessage_DataType *arg_yoffset = glmsg.add_args();
- arg_yoffset->set_isarray(false);
- arg_yoffset->set_type(GLMessage::DataType::INT);
- arg_yoffset->add_intvalue(yoffset);
-
- // copy argument zoffset
- GLMessage_DataType *arg_zoffset = glmsg.add_args();
- arg_zoffset->set_isarray(false);
- arg_zoffset->set_type(GLMessage::DataType::INT);
- arg_zoffset->add_intvalue(zoffset);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::INT);
- arg_depth->add_intvalue(depth);
-
- // copy argument format
- GLMessage_DataType *arg_format = glmsg.add_args();
- arg_format->set_isarray(false);
- arg_format->set_type(GLMessage::DataType::ENUM);
- arg_format->add_intvalue((int)format);
-
- // copy argument imageSize
- GLMessage_DataType *arg_imageSize = glmsg.add_args();
- arg_imageSize->set_isarray(false);
- arg_imageSize->set_type(GLMessage::DataType::INT);
- arg_imageSize->add_intvalue(imageSize);
-
- // copy argument data
- GLMessage_DataType *arg_data = glmsg.add_args();
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::INT);
- arg_data->add_intvalue((int)data);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCompressedTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) data,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFramebufferTexture3DOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument attachment
- GLMessage_DataType *arg_attachment = glmsg.add_args();
- arg_attachment->set_isarray(false);
- arg_attachment->set_type(GLMessage::DataType::ENUM);
- arg_attachment->add_intvalue((int)attachment);
-
- // copy argument textarget
- GLMessage_DataType *arg_textarget = glmsg.add_args();
- arg_textarget->set_isarray(false);
- arg_textarget->set_type(GLMessage::DataType::ENUM);
- arg_textarget->add_intvalue((int)textarget);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument zoffset
- GLMessage_DataType *arg_zoffset = glmsg.add_args();
- arg_zoffset->set_isarray(false);
- arg_zoffset->set_type(GLMessage::DataType::INT);
- arg_zoffset->add_intvalue(zoffset);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindVertexArrayOES(GLuint array) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBindVertexArrayOES);
-
- // copy argument array
- GLMessage_DataType *arg_array = glmsg.add_args();
- arg_array->set_isarray(false);
- arg_array->set_type(GLMessage::DataType::INT);
- arg_array->add_intvalue(array);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBindVertexArrayOES(array);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteVertexArraysOES);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument arrays
- GLMessage_DataType *arg_arrays = glmsg.add_args();
- arg_arrays->set_isarray(false);
- arg_arrays->set_type(GLMessage::DataType::INT);
- arg_arrays->add_intvalue((int)arrays);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteVertexArraysOES(n, arrays);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) arrays,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenVertexArraysOES(GLsizei n, GLuint *arrays) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenVertexArraysOES);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument arrays
- GLMessage_DataType *arg_arrays = glmsg.add_args();
- arg_arrays->set_isarray(false);
- arg_arrays->set_type(GLMessage::DataType::INT);
- arg_arrays->add_intvalue((int)arrays);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenVertexArraysOES(n, arrays);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) arrays,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsVertexArrayOES(GLuint array) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsVertexArrayOES);
-
- // copy argument array
- GLMessage_DataType *arg_array = glmsg.add_args();
- arg_array->set_isarray(false);
- arg_array->set_type(GLMessage::DataType::INT);
- arg_array->add_intvalue(array);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsVertexArrayOES(array);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glGetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetPerfMonitorGroupsAMD);
-
- // copy argument numGroups
- GLMessage_DataType *arg_numGroups = glmsg.add_args();
- arg_numGroups->set_isarray(false);
- arg_numGroups->set_type(GLMessage::DataType::INT);
- arg_numGroups->add_intvalue((int)numGroups);
-
- // copy argument groupsSize
- GLMessage_DataType *arg_groupsSize = glmsg.add_args();
- arg_groupsSize->set_isarray(false);
- arg_groupsSize->set_type(GLMessage::DataType::INT);
- arg_groupsSize->add_intvalue(groupsSize);
-
- // copy argument groups
- GLMessage_DataType *arg_groups = glmsg.add_args();
- arg_groups->set_isarray(false);
- arg_groups->set_type(GLMessage::DataType::INT);
- arg_groups->add_intvalue((int)groups);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetPerfMonitorGroupsAMD(numGroups, groupsSize, groups);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) numGroups,
- (void *) groups,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorCountersAMD(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetPerfMonitorCountersAMD);
-
- // copy argument group
- GLMessage_DataType *arg_group = glmsg.add_args();
- arg_group->set_isarray(false);
- arg_group->set_type(GLMessage::DataType::INT);
- arg_group->add_intvalue(group);
-
- // copy argument numCounters
- GLMessage_DataType *arg_numCounters = glmsg.add_args();
- arg_numCounters->set_isarray(false);
- arg_numCounters->set_type(GLMessage::DataType::INT);
- arg_numCounters->add_intvalue((int)numCounters);
-
- // copy argument maxActiveCounters
- GLMessage_DataType *arg_maxActiveCounters = glmsg.add_args();
- arg_maxActiveCounters->set_isarray(false);
- arg_maxActiveCounters->set_type(GLMessage::DataType::INT);
- arg_maxActiveCounters->add_intvalue((int)maxActiveCounters);
-
- // copy argument counterSize
- GLMessage_DataType *arg_counterSize = glmsg.add_args();
- arg_counterSize->set_isarray(false);
- arg_counterSize->set_type(GLMessage::DataType::INT);
- arg_counterSize->add_intvalue(counterSize);
-
- // copy argument counters
- GLMessage_DataType *arg_counters = glmsg.add_args();
- arg_counters->set_isarray(false);
- arg_counters->set_type(GLMessage::DataType::INT);
- arg_counters->add_intvalue((int)counters);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetPerfMonitorCountersAMD(group, numCounters, maxActiveCounters, counterSize, counters);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) numCounters,
- (void *) maxActiveCounters,
- (void *) counters,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetPerfMonitorGroupStringAMD);
-
- // copy argument group
- GLMessage_DataType *arg_group = glmsg.add_args();
- arg_group->set_isarray(false);
- arg_group->set_type(GLMessage::DataType::INT);
- arg_group->add_intvalue(group);
-
- // copy argument bufSize
- GLMessage_DataType *arg_bufSize = glmsg.add_args();
- arg_bufSize->set_isarray(false);
- arg_bufSize->set_type(GLMessage::DataType::INT);
- arg_bufSize->add_intvalue(bufSize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument groupString
- GLMessage_DataType *arg_groupString = glmsg.add_args();
- arg_groupString->set_isarray(false);
- arg_groupString->set_type(GLMessage::DataType::INT);
- arg_groupString->add_intvalue((int)groupString);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetPerfMonitorGroupStringAMD(group, bufSize, length, groupString);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) groupString,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetPerfMonitorCounterStringAMD);
-
- // copy argument group
- GLMessage_DataType *arg_group = glmsg.add_args();
- arg_group->set_isarray(false);
- arg_group->set_type(GLMessage::DataType::INT);
- arg_group->add_intvalue(group);
-
- // copy argument counter
- GLMessage_DataType *arg_counter = glmsg.add_args();
- arg_counter->set_isarray(false);
- arg_counter->set_type(GLMessage::DataType::INT);
- arg_counter->add_intvalue(counter);
-
- // copy argument bufSize
- GLMessage_DataType *arg_bufSize = glmsg.add_args();
- arg_bufSize->set_isarray(false);
- arg_bufSize->set_type(GLMessage::DataType::INT);
- arg_bufSize->add_intvalue(bufSize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument counterString
- GLMessage_DataType *arg_counterString = glmsg.add_args();
- arg_counterString->set_isarray(false);
- arg_counterString->set_type(GLMessage::DataType::INT);
- arg_counterString->add_intvalue((int)counterString);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) counterString,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid *data) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetPerfMonitorCounterInfoAMD);
-
- // copy argument group
- GLMessage_DataType *arg_group = glmsg.add_args();
- arg_group->set_isarray(false);
- arg_group->set_type(GLMessage::DataType::INT);
- arg_group->add_intvalue(group);
-
- // copy argument counter
- GLMessage_DataType *arg_counter = glmsg.add_args();
- arg_counter->set_isarray(false);
- arg_counter->set_type(GLMessage::DataType::INT);
- arg_counter->add_intvalue(counter);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument data
- GLMessage_DataType *arg_data = glmsg.add_args();
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::INT);
- arg_data->add_intvalue((int)data);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetPerfMonitorCounterInfoAMD(group, counter, pname, data);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) data,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenPerfMonitorsAMD(GLsizei n, GLuint *monitors) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenPerfMonitorsAMD);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument monitors
- GLMessage_DataType *arg_monitors = glmsg.add_args();
- arg_monitors->set_isarray(false);
- arg_monitors->set_type(GLMessage::DataType::INT);
- arg_monitors->add_intvalue((int)monitors);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenPerfMonitorsAMD(n, monitors);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) monitors,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeletePerfMonitorsAMD(GLsizei n, GLuint *monitors) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeletePerfMonitorsAMD);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument monitors
- GLMessage_DataType *arg_monitors = glmsg.add_args();
- arg_monitors->set_isarray(false);
- arg_monitors->set_type(GLMessage::DataType::INT);
- arg_monitors->add_intvalue((int)monitors);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeletePerfMonitorsAMD(n, monitors);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) monitors,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glSelectPerfMonitorCountersAMD);
-
- // copy argument monitor
- GLMessage_DataType *arg_monitor = glmsg.add_args();
- arg_monitor->set_isarray(false);
- arg_monitor->set_type(GLMessage::DataType::INT);
- arg_monitor->add_intvalue(monitor);
-
- // copy argument enable
- GLMessage_DataType *arg_enable = glmsg.add_args();
- arg_enable->set_isarray(false);
- arg_enable->set_type(GLMessage::DataType::BOOL);
- arg_enable->add_boolvalue(enable);
-
- // copy argument group
- GLMessage_DataType *arg_group = glmsg.add_args();
- arg_group->set_isarray(false);
- arg_group->set_type(GLMessage::DataType::INT);
- arg_group->add_intvalue(group);
-
- // copy argument numCounters
- GLMessage_DataType *arg_numCounters = glmsg.add_args();
- arg_numCounters->set_isarray(false);
- arg_numCounters->set_type(GLMessage::DataType::INT);
- arg_numCounters->add_intvalue(numCounters);
-
- // copy argument countersList
- GLMessage_DataType *arg_countersList = glmsg.add_args();
- arg_countersList->set_isarray(false);
- arg_countersList->set_type(GLMessage::DataType::INT);
- arg_countersList->add_intvalue((int)countersList);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glSelectPerfMonitorCountersAMD(monitor, enable, group, numCounters, countersList);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) countersList,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBeginPerfMonitorAMD(GLuint monitor) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBeginPerfMonitorAMD);
-
- // copy argument monitor
- GLMessage_DataType *arg_monitor = glmsg.add_args();
- arg_monitor->set_isarray(false);
- arg_monitor->set_type(GLMessage::DataType::INT);
- arg_monitor->add_intvalue(monitor);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBeginPerfMonitorAMD(monitor);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEndPerfMonitorAMD(GLuint monitor) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glEndPerfMonitorAMD);
-
- // copy argument monitor
- GLMessage_DataType *arg_monitor = glmsg.add_args();
- arg_monitor->set_isarray(false);
- arg_monitor->set_type(GLMessage::DataType::INT);
- arg_monitor->add_intvalue(monitor);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glEndPerfMonitorAMD(monitor);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetPerfMonitorCounterDataAMD);
-
- // copy argument monitor
- GLMessage_DataType *arg_monitor = glmsg.add_args();
- arg_monitor->set_isarray(false);
- arg_monitor->set_type(GLMessage::DataType::INT);
- arg_monitor->add_intvalue(monitor);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument dataSize
- GLMessage_DataType *arg_dataSize = glmsg.add_args();
- arg_dataSize->set_isarray(false);
- arg_dataSize->set_type(GLMessage::DataType::INT);
- arg_dataSize->add_intvalue(dataSize);
-
- // copy argument data
- GLMessage_DataType *arg_data = glmsg.add_args();
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::INT);
- arg_data->add_intvalue((int)data);
-
- // copy argument bytesWritten
- GLMessage_DataType *arg_bytesWritten = glmsg.add_args();
- arg_bytesWritten->set_isarray(false);
- arg_bytesWritten->set_type(GLMessage::DataType::INT);
- arg_bytesWritten->add_intvalue((int)bytesWritten);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetPerfMonitorCounterDataAMD(monitor, pname, dataSize, data, bytesWritten);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) data,
- (void *) bytesWritten,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBlitFramebufferANGLE);
-
- // copy argument srcX0
- GLMessage_DataType *arg_srcX0 = glmsg.add_args();
- arg_srcX0->set_isarray(false);
- arg_srcX0->set_type(GLMessage::DataType::INT);
- arg_srcX0->add_intvalue(srcX0);
-
- // copy argument srcY0
- GLMessage_DataType *arg_srcY0 = glmsg.add_args();
- arg_srcY0->set_isarray(false);
- arg_srcY0->set_type(GLMessage::DataType::INT);
- arg_srcY0->add_intvalue(srcY0);
-
- // copy argument srcX1
- GLMessage_DataType *arg_srcX1 = glmsg.add_args();
- arg_srcX1->set_isarray(false);
- arg_srcX1->set_type(GLMessage::DataType::INT);
- arg_srcX1->add_intvalue(srcX1);
-
- // copy argument srcY1
- GLMessage_DataType *arg_srcY1 = glmsg.add_args();
- arg_srcY1->set_isarray(false);
- arg_srcY1->set_type(GLMessage::DataType::INT);
- arg_srcY1->add_intvalue(srcY1);
-
- // copy argument dstX0
- GLMessage_DataType *arg_dstX0 = glmsg.add_args();
- arg_dstX0->set_isarray(false);
- arg_dstX0->set_type(GLMessage::DataType::INT);
- arg_dstX0->add_intvalue(dstX0);
-
- // copy argument dstY0
- GLMessage_DataType *arg_dstY0 = glmsg.add_args();
- arg_dstY0->set_isarray(false);
- arg_dstY0->set_type(GLMessage::DataType::INT);
- arg_dstY0->add_intvalue(dstY0);
-
- // copy argument dstX1
- GLMessage_DataType *arg_dstX1 = glmsg.add_args();
- arg_dstX1->set_isarray(false);
- arg_dstX1->set_type(GLMessage::DataType::INT);
- arg_dstX1->add_intvalue(dstX1);
-
- // copy argument dstY1
- GLMessage_DataType *arg_dstY1 = glmsg.add_args();
- arg_dstY1->set_isarray(false);
- arg_dstY1->set_type(GLMessage::DataType::INT);
- arg_dstY1->add_intvalue(dstY1);
-
- // copy argument mask
- GLMessage_DataType *arg_mask = glmsg.add_args();
- arg_mask->set_isarray(false);
- arg_mask->set_type(GLMessage::DataType::INT);
- arg_mask->add_intvalue(mask);
-
- // copy argument filter
- GLMessage_DataType *arg_filter = glmsg.add_args();
- arg_filter->set_isarray(false);
- arg_filter->set_type(GLMessage::DataType::ENUM);
- arg_filter->add_intvalue((int)filter);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleANGLE);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument samples
- GLMessage_DataType *arg_samples = glmsg.add_args();
- arg_samples->set_isarray(false);
- arg_samples->set_type(GLMessage::DataType::INT);
- arg_samples->add_intvalue(samples);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glRenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleAPPLE);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument samples
- GLMessage_DataType *arg_samples = glmsg.add_args();
- arg_samples->set_isarray(false);
- arg_samples->set_type(GLMessage::DataType::INT);
- arg_samples->add_intvalue(samples);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glRenderbufferStorageMultisampleAPPLE(target, samples, internalformat, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glResolveMultisampleFramebufferAPPLE(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glResolveMultisampleFramebufferAPPLE);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glResolveMultisampleFramebufferAPPLE();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLabelObjectEXT);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument object
- GLMessage_DataType *arg_object = glmsg.add_args();
- arg_object->set_isarray(false);
- arg_object->set_type(GLMessage::DataType::INT);
- arg_object->add_intvalue(object);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue(length);
-
- // copy argument label
- GLMessage_DataType *arg_label = glmsg.add_args();
- arg_label->set_isarray(false);
- arg_label->set_type(GLMessage::DataType::INT);
- arg_label->add_intvalue((int)label);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLabelObjectEXT(type, object, length, label);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) label,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetObjectLabelEXT);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument object
- GLMessage_DataType *arg_object = glmsg.add_args();
- arg_object->set_isarray(false);
- arg_object->set_type(GLMessage::DataType::INT);
- arg_object->add_intvalue(object);
-
- // copy argument bufSize
- GLMessage_DataType *arg_bufSize = glmsg.add_args();
- arg_bufSize->set_isarray(false);
- arg_bufSize->set_type(GLMessage::DataType::INT);
- arg_bufSize->add_intvalue(bufSize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument label
- GLMessage_DataType *arg_label = glmsg.add_args();
- arg_label->set_isarray(false);
- arg_label->set_type(GLMessage::DataType::INT);
- arg_label->add_intvalue((int)label);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetObjectLabelEXT(type, object, bufSize, length, label);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) label,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glInsertEventMarkerEXT(GLsizei length, const GLchar *marker) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glInsertEventMarkerEXT);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue(length);
-
- // copy argument marker
- GLMessage_DataType *arg_marker = glmsg.add_args();
- arg_marker->set_isarray(false);
- arg_marker->set_type(GLMessage::DataType::INT);
- arg_marker->add_intvalue((int)marker);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glInsertEventMarkerEXT(length, marker);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) marker,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPushGroupMarkerEXT(GLsizei length, const GLchar *marker) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPushGroupMarkerEXT);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue(length);
-
- // copy argument marker
- GLMessage_DataType *arg_marker = glmsg.add_args();
- arg_marker->set_isarray(false);
- arg_marker->set_type(GLMessage::DataType::INT);
- arg_marker->add_intvalue((int)marker);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPushGroupMarkerEXT(length, marker);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) marker,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPopGroupMarkerEXT(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPopGroupMarkerEXT);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPopGroupMarkerEXT();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDiscardFramebufferEXT);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument numAttachments
- GLMessage_DataType *arg_numAttachments = glmsg.add_args();
- arg_numAttachments->set_isarray(false);
- arg_numAttachments->set_type(GLMessage::DataType::INT);
- arg_numAttachments->add_intvalue(numAttachments);
-
- // copy argument attachments
- GLMessage_DataType *arg_attachments = glmsg.add_args();
- arg_attachments->set_isarray(false);
- arg_attachments->set_type(GLMessage::DataType::INT);
- arg_attachments->add_intvalue((int)attachments);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDiscardFramebufferEXT(target, numAttachments, attachments);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) attachments,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleEXT);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument samples
- GLMessage_DataType *arg_samples = glmsg.add_args();
- arg_samples->set_isarray(false);
- arg_samples->set_type(GLMessage::DataType::INT);
- arg_samples->add_intvalue(samples);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFramebufferTexture2DMultisampleEXT);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument attachment
- GLMessage_DataType *arg_attachment = glmsg.add_args();
- arg_attachment->set_isarray(false);
- arg_attachment->set_type(GLMessage::DataType::ENUM);
- arg_attachment->add_intvalue((int)attachment);
-
- // copy argument textarget
- GLMessage_DataType *arg_textarget = glmsg.add_args();
- arg_textarget->set_isarray(false);
- arg_textarget->set_type(GLMessage::DataType::ENUM);
- arg_textarget->add_intvalue((int)textarget);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument samples
- GLMessage_DataType *arg_samples = glmsg.add_args();
- arg_samples->set_isarray(false);
- arg_samples->set_type(GLMessage::DataType::INT);
- arg_samples->add_intvalue(samples);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture, level, samples);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMultiDrawArraysEXT);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // copy argument first
- GLMessage_DataType *arg_first = glmsg.add_args();
- arg_first->set_isarray(false);
- arg_first->set_type(GLMessage::DataType::INT);
- arg_first->add_intvalue((int)first);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue((int)count);
-
- // copy argument primcount
- GLMessage_DataType *arg_primcount = glmsg.add_args();
- arg_primcount->set_isarray(false);
- arg_primcount->set_type(GLMessage::DataType::INT);
- arg_primcount->add_intvalue(primcount);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMultiDrawArraysEXT(mode, first, count, primcount);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) first,
- (void *) count,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMultiDrawElementsEXT);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue((int)count);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument indices
- GLMessage_DataType *arg_indices = glmsg.add_args();
- arg_indices->set_isarray(false);
- arg_indices->set_type(GLMessage::DataType::INT);
- arg_indices->add_intvalue((int)indices);
-
- // copy argument primcount
- GLMessage_DataType *arg_primcount = glmsg.add_args();
- arg_primcount->set_isarray(false);
- arg_primcount->set_type(GLMessage::DataType::INT);
- arg_primcount->add_intvalue(primcount);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMultiDrawElementsEXT(mode, count, type, indices, primcount);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) count,
- (void *) indices,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenQueriesEXT(GLsizei n, GLuint *ids) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenQueriesEXT);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument ids
- GLMessage_DataType *arg_ids = glmsg.add_args();
- arg_ids->set_isarray(false);
- arg_ids->set_type(GLMessage::DataType::INT);
- arg_ids->add_intvalue((int)ids);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenQueriesEXT(n, ids);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) ids,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteQueriesEXT(GLsizei n, const GLuint *ids) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteQueriesEXT);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument ids
- GLMessage_DataType *arg_ids = glmsg.add_args();
- arg_ids->set_isarray(false);
- arg_ids->set_type(GLMessage::DataType::INT);
- arg_ids->add_intvalue((int)ids);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteQueriesEXT(n, ids);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) ids,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsQueryEXT(GLuint id) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsQueryEXT);
-
- // copy argument id
- GLMessage_DataType *arg_id = glmsg.add_args();
- arg_id->set_isarray(false);
- arg_id->set_type(GLMessage::DataType::INT);
- arg_id->add_intvalue(id);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsQueryEXT(id);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glBeginQueryEXT(GLenum target, GLuint id) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBeginQueryEXT);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument id
- GLMessage_DataType *arg_id = glmsg.add_args();
- arg_id->set_isarray(false);
- arg_id->set_type(GLMessage::DataType::INT);
- arg_id->add_intvalue(id);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBeginQueryEXT(target, id);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEndQueryEXT(GLenum target) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glEndQueryEXT);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glEndQueryEXT(target);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetQueryivEXT(GLenum target, GLenum pname, GLint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetQueryivEXT);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetQueryivEXT(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetQueryObjectuivEXT);
-
- // copy argument id
- GLMessage_DataType *arg_id = glmsg.add_args();
- arg_id->set_isarray(false);
- arg_id->set_type(GLMessage::DataType::INT);
- arg_id->add_intvalue(id);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetQueryObjectuivEXT(id, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glGetGraphicsResetStatusEXT(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetGraphicsResetStatusEXT);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLenum retValue = glContext->hooks->gl.glGetGraphicsResetStatusEXT();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::ENUM);
- rt->add_intvalue((int)retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glReadnPixelsEXT);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument format
- GLMessage_DataType *arg_format = glmsg.add_args();
- arg_format->set_isarray(false);
- arg_format->set_type(GLMessage::DataType::ENUM);
- arg_format->add_intvalue((int)format);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument bufSize
- GLMessage_DataType *arg_bufSize = glmsg.add_args();
- arg_bufSize->set_isarray(false);
- arg_bufSize->set_type(GLMessage::DataType::INT);
- arg_bufSize->add_intvalue(bufSize);
-
- // copy argument data
- GLMessage_DataType *arg_data = glmsg.add_args();
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::INT);
- arg_data->add_intvalue((int)data);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glReadnPixelsEXT(x, y, width, height, format, type, bufSize, data);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) data,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, float *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetnUniformfvEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument bufSize
- GLMessage_DataType *arg_bufSize = glmsg.add_args();
- arg_bufSize->set_isarray(false);
- arg_bufSize->set_type(GLMessage::DataType::INT);
- arg_bufSize->add_intvalue(bufSize);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetnUniformfvEXT(program, location, bufSize, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetnUniformivEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument bufSize
- GLMessage_DataType *arg_bufSize = glmsg.add_args();
- arg_bufSize->set_isarray(false);
- arg_bufSize->set_type(GLMessage::DataType::INT);
- arg_bufSize->add_intvalue(bufSize);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetnUniformivEXT(program, location, bufSize, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glUseProgramStagesEXT);
-
- // copy argument pipeline
- GLMessage_DataType *arg_pipeline = glmsg.add_args();
- arg_pipeline->set_isarray(false);
- arg_pipeline->set_type(GLMessage::DataType::INT);
- arg_pipeline->add_intvalue(pipeline);
-
- // copy argument stages
- GLMessage_DataType *arg_stages = glmsg.add_args();
- arg_stages->set_isarray(false);
- arg_stages->set_type(GLMessage::DataType::INT);
- arg_stages->add_intvalue(stages);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glUseProgramStagesEXT(pipeline, stages, program);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glActiveShaderProgramEXT(GLuint pipeline, GLuint program) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glActiveShaderProgramEXT);
-
- // copy argument pipeline
- GLMessage_DataType *arg_pipeline = glmsg.add_args();
- arg_pipeline->set_isarray(false);
- arg_pipeline->set_type(GLMessage::DataType::INT);
- arg_pipeline->add_intvalue(pipeline);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glActiveShaderProgramEXT(pipeline, program);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLuint GLTrace_glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar **strings) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCreateShaderProgramvEXT);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument strings
- GLMessage_DataType *arg_strings = glmsg.add_args();
- arg_strings->set_isarray(false);
- arg_strings->set_type(GLMessage::DataType::INT);
- arg_strings->add_intvalue((int)strings);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLuint retValue = glContext->hooks->gl.glCreateShaderProgramvEXT(type, count, strings);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::INT);
- rt->add_intvalue(retValue);
-
- void *pointerArgs[] = {
- (void *) strings,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glBindProgramPipelineEXT(GLuint pipeline) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBindProgramPipelineEXT);
-
- // copy argument pipeline
- GLMessage_DataType *arg_pipeline = glmsg.add_args();
- arg_pipeline->set_isarray(false);
- arg_pipeline->set_type(GLMessage::DataType::INT);
- arg_pipeline->add_intvalue(pipeline);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBindProgramPipelineEXT(pipeline);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteProgramPipelinesEXT(GLsizei n, const GLuint *pipelines) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteProgramPipelinesEXT);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument pipelines
- GLMessage_DataType *arg_pipelines = glmsg.add_args();
- arg_pipelines->set_isarray(false);
- arg_pipelines->set_type(GLMessage::DataType::INT);
- arg_pipelines->add_intvalue((int)pipelines);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteProgramPipelinesEXT(n, pipelines);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pipelines,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenProgramPipelinesEXT(GLsizei n, GLuint *pipelines) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenProgramPipelinesEXT);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument pipelines
- GLMessage_DataType *arg_pipelines = glmsg.add_args();
- arg_pipelines->set_isarray(false);
- arg_pipelines->set_type(GLMessage::DataType::INT);
- arg_pipelines->add_intvalue((int)pipelines);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenProgramPipelinesEXT(n, pipelines);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pipelines,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsProgramPipelineEXT(GLuint pipeline) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsProgramPipelineEXT);
-
- // copy argument pipeline
- GLMessage_DataType *arg_pipeline = glmsg.add_args();
- arg_pipeline->set_isarray(false);
- arg_pipeline->set_type(GLMessage::DataType::INT);
- arg_pipeline->add_intvalue(pipeline);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsProgramPipelineEXT(pipeline);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramParameteriEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue(value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramParameteriEXT(program, pname, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetProgramPipelineivEXT);
-
- // copy argument pipeline
- GLMessage_DataType *arg_pipeline = glmsg.add_args();
- arg_pipeline->set_isarray(false);
- arg_pipeline->set_type(GLMessage::DataType::INT);
- arg_pipeline->add_intvalue(pipeline);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetProgramPipelineivEXT(pipeline, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1iEXT(GLuint program, GLint location, GLint x) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform1iEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform1iEXT(program, location, x);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2iEXT(GLuint program, GLint location, GLint x, GLint y) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform2iEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform2iEXT(program, location, x, y);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform3iEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform3iEXT(program, location, x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform4iEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // copy argument w
- GLMessage_DataType *arg_w = glmsg.add_args();
- arg_w->set_isarray(false);
- arg_w->set_type(GLMessage::DataType::INT);
- arg_w->add_intvalue(w);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform4iEXT(program, location, x, y, z, w);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat x) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform1fEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform1fEXT(program, location, x);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat x, GLfloat y) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform2fEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform2fEXT(program, location, x, y);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform3fEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform3fEXT(program, location, x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform4fEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // copy argument w
- GLMessage_DataType *arg_w = glmsg.add_args();
- arg_w->set_isarray(false);
- arg_w->set_type(GLMessage::DataType::FLOAT);
- arg_w->add_floatvalue(w);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform4fEXT(program, location, x, y, z, w);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform1ivEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform1ivEXT(program, location, count, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform2ivEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform2ivEXT(program, location, count, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform3ivEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform3ivEXT(program, location, count, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform4ivEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform4ivEXT(program, location, count, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform1fvEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform1fvEXT(program, location, count, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform2fvEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform2fvEXT(program, location, count, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform3fvEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform3fvEXT(program, location, count, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniform4fvEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniform4fvEXT(program, location, count, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniformMatrix2fvEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument transpose
- GLMessage_DataType *arg_transpose = glmsg.add_args();
- arg_transpose->set_isarray(false);
- arg_transpose->set_type(GLMessage::DataType::BOOL);
- arg_transpose->add_boolvalue(transpose);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniformMatrix2fvEXT(program, location, count, transpose, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniformMatrix3fvEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument transpose
- GLMessage_DataType *arg_transpose = glmsg.add_args();
- arg_transpose->set_isarray(false);
- arg_transpose->set_type(GLMessage::DataType::BOOL);
- arg_transpose->add_boolvalue(transpose);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniformMatrix3fvEXT(program, location, count, transpose, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glProgramUniformMatrix4fvEXT);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument location
- GLMessage_DataType *arg_location = glmsg.add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-
- // copy argument count
- GLMessage_DataType *arg_count = glmsg.add_args();
- arg_count->set_isarray(false);
- arg_count->set_type(GLMessage::DataType::INT);
- arg_count->add_intvalue(count);
-
- // copy argument transpose
- GLMessage_DataType *arg_transpose = glmsg.add_args();
- arg_transpose->set_isarray(false);
- arg_transpose->set_type(GLMessage::DataType::BOOL);
- arg_transpose->add_boolvalue(transpose);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue((int)value);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glProgramUniformMatrix4fvEXT(program, location, count, transpose, value);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) value,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glValidateProgramPipelineEXT(GLuint pipeline) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glValidateProgramPipelineEXT);
-
- // copy argument pipeline
- GLMessage_DataType *arg_pipeline = glmsg.add_args();
- arg_pipeline->set_isarray(false);
- arg_pipeline->set_type(GLMessage::DataType::INT);
- arg_pipeline->add_intvalue(pipeline);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glValidateProgramPipelineEXT(pipeline);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetProgramPipelineInfoLogEXT);
-
- // copy argument pipeline
- GLMessage_DataType *arg_pipeline = glmsg.add_args();
- arg_pipeline->set_isarray(false);
- arg_pipeline->set_type(GLMessage::DataType::INT);
- arg_pipeline->add_intvalue(pipeline);
-
- // copy argument bufSize
- GLMessage_DataType *arg_bufSize = glmsg.add_args();
- arg_bufSize->set_isarray(false);
- arg_bufSize->set_type(GLMessage::DataType::INT);
- arg_bufSize->add_intvalue(bufSize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument infoLog
- GLMessage_DataType *arg_infoLog = glmsg.add_args();
- arg_infoLog->set_isarray(false);
- arg_infoLog->set_type(GLMessage::DataType::INT);
- arg_infoLog->add_intvalue((int)infoLog);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetProgramPipelineInfoLogEXT(pipeline, bufSize, length, infoLog);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) infoLog,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexStorage1DEXT);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument levels
- GLMessage_DataType *arg_levels = glmsg.add_args();
- arg_levels->set_isarray(false);
- arg_levels->set_type(GLMessage::DataType::INT);
- arg_levels->add_intvalue(levels);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexStorage1DEXT(target, levels, internalformat, width);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexStorage2DEXT);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument levels
- GLMessage_DataType *arg_levels = glmsg.add_args();
- arg_levels->set_isarray(false);
- arg_levels->set_type(GLMessage::DataType::INT);
- arg_levels->add_intvalue(levels);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexStorage2DEXT(target, levels, internalformat, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexStorage3DEXT);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument levels
- GLMessage_DataType *arg_levels = glmsg.add_args();
- arg_levels->set_isarray(false);
- arg_levels->set_type(GLMessage::DataType::INT);
- arg_levels->add_intvalue(levels);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::INT);
- arg_depth->add_intvalue(depth);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexStorage3DEXT(target, levels, internalformat, width, height, depth);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTextureStorage1DEXT);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument levels
- GLMessage_DataType *arg_levels = glmsg.add_args();
- arg_levels->set_isarray(false);
- arg_levels->set_type(GLMessage::DataType::INT);
- arg_levels->add_intvalue(levels);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTextureStorage1DEXT(texture, target, levels, internalformat, width);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTextureStorage2DEXT);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument levels
- GLMessage_DataType *arg_levels = glmsg.add_args();
- arg_levels->set_isarray(false);
- arg_levels->set_type(GLMessage::DataType::INT);
- arg_levels->add_intvalue(levels);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTextureStorage2DEXT(texture, target, levels, internalformat, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTextureStorage3DEXT);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument levels
- GLMessage_DataType *arg_levels = glmsg.add_args();
- arg_levels->set_isarray(false);
- arg_levels->set_type(GLMessage::DataType::INT);
- arg_levels->add_intvalue(levels);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::INT);
- arg_depth->add_intvalue(depth);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleIMG);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument samples
- GLMessage_DataType *arg_samples = glmsg.add_args();
- arg_samples->set_isarray(false);
- arg_samples->set_type(GLMessage::DataType::INT);
- arg_samples->add_intvalue(samples);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glRenderbufferStorageMultisampleIMG(target, samples, internalformat, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFramebufferTexture2DMultisampleIMG);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument attachment
- GLMessage_DataType *arg_attachment = glmsg.add_args();
- arg_attachment->set_isarray(false);
- arg_attachment->set_type(GLMessage::DataType::ENUM);
- arg_attachment->add_intvalue((int)attachment);
-
- // copy argument textarget
- GLMessage_DataType *arg_textarget = glmsg.add_args();
- arg_textarget->set_isarray(false);
- arg_textarget->set_type(GLMessage::DataType::ENUM);
- arg_textarget->add_intvalue((int)textarget);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument samples
- GLMessage_DataType *arg_samples = glmsg.add_args();
- arg_samples->set_isarray(false);
- arg_samples->set_type(GLMessage::DataType::INT);
- arg_samples->add_intvalue(samples);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFramebufferTexture2DMultisampleIMG(target, attachment, textarget, texture, level, samples);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCoverageMaskNV(GLboolean mask) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCoverageMaskNV);
-
- // copy argument mask
- GLMessage_DataType *arg_mask = glmsg.add_args();
- arg_mask->set_isarray(false);
- arg_mask->set_type(GLMessage::DataType::BOOL);
- arg_mask->add_boolvalue(mask);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCoverageMaskNV(mask);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCoverageOperationNV(GLenum operation) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCoverageOperationNV);
-
- // copy argument operation
- GLMessage_DataType *arg_operation = glmsg.add_args();
- arg_operation->set_isarray(false);
- arg_operation->set_type(GLMessage::DataType::ENUM);
- arg_operation->add_intvalue((int)operation);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCoverageOperationNV(operation);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawBuffersNV(GLsizei n, const GLenum *bufs) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawBuffersNV);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument bufs
- GLMessage_DataType *arg_bufs = glmsg.add_args();
- arg_bufs->set_isarray(false);
- arg_bufs->set_type(GLMessage::DataType::INT);
- arg_bufs->add_intvalue((int)bufs);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawBuffersNV(n, bufs);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) bufs,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteFencesNV(GLsizei n, const GLuint *fences) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteFencesNV);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument fences
- GLMessage_DataType *arg_fences = glmsg.add_args();
- arg_fences->set_isarray(false);
- arg_fences->set_type(GLMessage::DataType::INT);
- arg_fences->add_intvalue((int)fences);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteFencesNV(n, fences);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) fences,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenFencesNV(GLsizei n, GLuint *fences) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenFencesNV);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument fences
- GLMessage_DataType *arg_fences = glmsg.add_args();
- arg_fences->set_isarray(false);
- arg_fences->set_type(GLMessage::DataType::INT);
- arg_fences->add_intvalue((int)fences);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenFencesNV(n, fences);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) fences,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsFenceNV(GLuint fence) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsFenceNV);
-
- // copy argument fence
- GLMessage_DataType *arg_fence = glmsg.add_args();
- arg_fence->set_isarray(false);
- arg_fence->set_type(GLMessage::DataType::INT);
- arg_fence->add_intvalue(fence);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsFenceNV(fence);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-GLboolean GLTrace_glTestFenceNV(GLuint fence) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTestFenceNV);
-
- // copy argument fence
- GLMessage_DataType *arg_fence = glmsg.add_args();
- arg_fence->set_isarray(false);
- arg_fence->set_type(GLMessage::DataType::INT);
- arg_fence->add_intvalue(fence);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glTestFenceNV(fence);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glGetFenceivNV(GLuint fence, GLenum pname, GLint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetFenceivNV);
-
- // copy argument fence
- GLMessage_DataType *arg_fence = glmsg.add_args();
- arg_fence->set_isarray(false);
- arg_fence->set_type(GLMessage::DataType::INT);
- arg_fence->add_intvalue(fence);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetFenceivNV(fence, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFinishFenceNV(GLuint fence) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFinishFenceNV);
-
- // copy argument fence
- GLMessage_DataType *arg_fence = glmsg.add_args();
- arg_fence->set_isarray(false);
- arg_fence->set_type(GLMessage::DataType::INT);
- arg_fence->add_intvalue(fence);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFinishFenceNV(fence);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSetFenceNV(GLuint fence, GLenum condition) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glSetFenceNV);
-
- // copy argument fence
- GLMessage_DataType *arg_fence = glmsg.add_args();
- arg_fence->set_isarray(false);
- arg_fence->set_type(GLMessage::DataType::INT);
- arg_fence->add_intvalue(fence);
-
- // copy argument condition
- GLMessage_DataType *arg_condition = glmsg.add_args();
- arg_condition->set_isarray(false);
- arg_condition->set_type(GLMessage::DataType::ENUM);
- arg_condition->add_intvalue((int)condition);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glSetFenceNV(fence, condition);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glReadBufferNV(GLenum mode) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glReadBufferNV);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glReadBufferNV(mode);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glAlphaFuncQCOM(GLenum func, GLclampf ref) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glAlphaFuncQCOM);
-
- // copy argument func
- GLMessage_DataType *arg_func = glmsg.add_args();
- arg_func->set_isarray(false);
- arg_func->set_type(GLMessage::DataType::ENUM);
- arg_func->add_intvalue((int)func);
-
- // copy argument ref
- GLMessage_DataType *arg_ref = glmsg.add_args();
- arg_ref->set_isarray(false);
- arg_ref->set_type(GLMessage::DataType::FLOAT);
- arg_ref->add_floatvalue(ref);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glAlphaFuncQCOM(func, ref);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetDriverControlsQCOM);
-
- // copy argument num
- GLMessage_DataType *arg_num = glmsg.add_args();
- arg_num->set_isarray(false);
- arg_num->set_type(GLMessage::DataType::INT);
- arg_num->add_intvalue((int)num);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument driverControls
- GLMessage_DataType *arg_driverControls = glmsg.add_args();
- arg_driverControls->set_isarray(false);
- arg_driverControls->set_type(GLMessage::DataType::INT);
- arg_driverControls->add_intvalue((int)driverControls);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetDriverControlsQCOM(num, size, driverControls);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) num,
- (void *) driverControls,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetDriverControlStringQCOM);
-
- // copy argument driverControl
- GLMessage_DataType *arg_driverControl = glmsg.add_args();
- arg_driverControl->set_isarray(false);
- arg_driverControl->set_type(GLMessage::DataType::INT);
- arg_driverControl->add_intvalue(driverControl);
-
- // copy argument bufSize
- GLMessage_DataType *arg_bufSize = glmsg.add_args();
- arg_bufSize->set_isarray(false);
- arg_bufSize->set_type(GLMessage::DataType::INT);
- arg_bufSize->add_intvalue(bufSize);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // copy argument driverControlString
- GLMessage_DataType *arg_driverControlString = glmsg.add_args();
- arg_driverControlString->set_isarray(false);
- arg_driverControlString->set_type(GLMessage::DataType::INT);
- arg_driverControlString->add_intvalue((int)driverControlString);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetDriverControlStringQCOM(driverControl, bufSize, length, driverControlString);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) length,
- (void *) driverControlString,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEnableDriverControlQCOM(GLuint driverControl) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glEnableDriverControlQCOM);
-
- // copy argument driverControl
- GLMessage_DataType *arg_driverControl = glmsg.add_args();
- arg_driverControl->set_isarray(false);
- arg_driverControl->set_type(GLMessage::DataType::INT);
- arg_driverControl->add_intvalue(driverControl);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glEnableDriverControlQCOM(driverControl);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDisableDriverControlQCOM(GLuint driverControl) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDisableDriverControlQCOM);
-
- // copy argument driverControl
- GLMessage_DataType *arg_driverControl = glmsg.add_args();
- arg_driverControl->set_isarray(false);
- arg_driverControl->set_type(GLMessage::DataType::INT);
- arg_driverControl->add_intvalue(driverControl);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDisableDriverControlQCOM(driverControl);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetTexturesQCOM(GLuint *textures, GLint maxTextures, GLint *numTextures) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetTexturesQCOM);
-
- // copy argument textures
- GLMessage_DataType *arg_textures = glmsg.add_args();
- arg_textures->set_isarray(false);
- arg_textures->set_type(GLMessage::DataType::INT);
- arg_textures->add_intvalue((int)textures);
-
- // copy argument maxTextures
- GLMessage_DataType *arg_maxTextures = glmsg.add_args();
- arg_maxTextures->set_isarray(false);
- arg_maxTextures->set_type(GLMessage::DataType::INT);
- arg_maxTextures->add_intvalue(maxTextures);
-
- // copy argument numTextures
- GLMessage_DataType *arg_numTextures = glmsg.add_args();
- arg_numTextures->set_isarray(false);
- arg_numTextures->set_type(GLMessage::DataType::INT);
- arg_numTextures->add_intvalue((int)numTextures);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetTexturesQCOM(textures, maxTextures, numTextures);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) textures,
- (void *) numTextures,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetBuffersQCOM(GLuint *buffers, GLint maxBuffers, GLint *numBuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetBuffersQCOM);
-
- // copy argument buffers
- GLMessage_DataType *arg_buffers = glmsg.add_args();
- arg_buffers->set_isarray(false);
- arg_buffers->set_type(GLMessage::DataType::INT);
- arg_buffers->add_intvalue((int)buffers);
-
- // copy argument maxBuffers
- GLMessage_DataType *arg_maxBuffers = glmsg.add_args();
- arg_maxBuffers->set_isarray(false);
- arg_maxBuffers->set_type(GLMessage::DataType::INT);
- arg_maxBuffers->add_intvalue(maxBuffers);
-
- // copy argument numBuffers
- GLMessage_DataType *arg_numBuffers = glmsg.add_args();
- arg_numBuffers->set_isarray(false);
- arg_numBuffers->set_type(GLMessage::DataType::INT);
- arg_numBuffers->add_intvalue((int)numBuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetBuffersQCOM(buffers, maxBuffers, numBuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) buffers,
- (void *) numBuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetRenderbuffersQCOM(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetRenderbuffersQCOM);
-
- // copy argument renderbuffers
- GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
- arg_renderbuffers->set_isarray(false);
- arg_renderbuffers->set_type(GLMessage::DataType::INT);
- arg_renderbuffers->add_intvalue((int)renderbuffers);
-
- // copy argument maxRenderbuffers
- GLMessage_DataType *arg_maxRenderbuffers = glmsg.add_args();
- arg_maxRenderbuffers->set_isarray(false);
- arg_maxRenderbuffers->set_type(GLMessage::DataType::INT);
- arg_maxRenderbuffers->add_intvalue(maxRenderbuffers);
-
- // copy argument numRenderbuffers
- GLMessage_DataType *arg_numRenderbuffers = glmsg.add_args();
- arg_numRenderbuffers->set_isarray(false);
- arg_numRenderbuffers->set_type(GLMessage::DataType::INT);
- arg_numRenderbuffers->add_intvalue((int)numRenderbuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetRenderbuffersQCOM(renderbuffers, maxRenderbuffers, numRenderbuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) renderbuffers,
- (void *) numRenderbuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetFramebuffersQCOM(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetFramebuffersQCOM);
-
- // copy argument framebuffers
- GLMessage_DataType *arg_framebuffers = glmsg.add_args();
- arg_framebuffers->set_isarray(false);
- arg_framebuffers->set_type(GLMessage::DataType::INT);
- arg_framebuffers->add_intvalue((int)framebuffers);
-
- // copy argument maxFramebuffers
- GLMessage_DataType *arg_maxFramebuffers = glmsg.add_args();
- arg_maxFramebuffers->set_isarray(false);
- arg_maxFramebuffers->set_type(GLMessage::DataType::INT);
- arg_maxFramebuffers->add_intvalue(maxFramebuffers);
-
- // copy argument numFramebuffers
- GLMessage_DataType *arg_numFramebuffers = glmsg.add_args();
- arg_numFramebuffers->set_isarray(false);
- arg_numFramebuffers->set_type(GLMessage::DataType::INT);
- arg_numFramebuffers->add_intvalue((int)numFramebuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetFramebuffersQCOM(framebuffers, maxFramebuffers, numFramebuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) framebuffers,
- (void *) numFramebuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetTexLevelParameterivQCOM);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetTexLevelParameterivQCOM(texture, face, level, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtTexObjectStateOverrideiQCOM);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtTexObjectStateOverrideiQCOM(target, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetTexSubImageQCOM);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // copy argument xoffset
- GLMessage_DataType *arg_xoffset = glmsg.add_args();
- arg_xoffset->set_isarray(false);
- arg_xoffset->set_type(GLMessage::DataType::INT);
- arg_xoffset->add_intvalue(xoffset);
-
- // copy argument yoffset
- GLMessage_DataType *arg_yoffset = glmsg.add_args();
- arg_yoffset->set_isarray(false);
- arg_yoffset->set_type(GLMessage::DataType::INT);
- arg_yoffset->add_intvalue(yoffset);
-
- // copy argument zoffset
- GLMessage_DataType *arg_zoffset = glmsg.add_args();
- arg_zoffset->set_isarray(false);
- arg_zoffset->set_type(GLMessage::DataType::INT);
- arg_zoffset->add_intvalue(zoffset);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::INT);
- arg_depth->add_intvalue(depth);
-
- // copy argument format
- GLMessage_DataType *arg_format = glmsg.add_args();
- arg_format->set_isarray(false);
- arg_format->set_type(GLMessage::DataType::ENUM);
- arg_format->add_intvalue((int)format);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument texels
- GLMessage_DataType *arg_texels = glmsg.add_args();
- arg_texels->set_isarray(false);
- arg_texels->set_type(GLMessage::DataType::INT);
- arg_texels->add_intvalue((int)texels);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetTexSubImageQCOM(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) texels,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetBufferPointervQCOM(GLenum target, GLvoid **params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetBufferPointervQCOM);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetBufferPointervQCOM(target, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetShadersQCOM(GLuint *shaders, GLint maxShaders, GLint *numShaders) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetShadersQCOM);
-
- // copy argument shaders
- GLMessage_DataType *arg_shaders = glmsg.add_args();
- arg_shaders->set_isarray(false);
- arg_shaders->set_type(GLMessage::DataType::INT);
- arg_shaders->add_intvalue((int)shaders);
-
- // copy argument maxShaders
- GLMessage_DataType *arg_maxShaders = glmsg.add_args();
- arg_maxShaders->set_isarray(false);
- arg_maxShaders->set_type(GLMessage::DataType::INT);
- arg_maxShaders->add_intvalue(maxShaders);
-
- // copy argument numShaders
- GLMessage_DataType *arg_numShaders = glmsg.add_args();
- arg_numShaders->set_isarray(false);
- arg_numShaders->set_type(GLMessage::DataType::INT);
- arg_numShaders->add_intvalue((int)numShaders);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetShadersQCOM(shaders, maxShaders, numShaders);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) shaders,
- (void *) numShaders,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetProgramsQCOM(GLuint *programs, GLint maxPrograms, GLint *numPrograms) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetProgramsQCOM);
-
- // copy argument programs
- GLMessage_DataType *arg_programs = glmsg.add_args();
- arg_programs->set_isarray(false);
- arg_programs->set_type(GLMessage::DataType::INT);
- arg_programs->add_intvalue((int)programs);
-
- // copy argument maxPrograms
- GLMessage_DataType *arg_maxPrograms = glmsg.add_args();
- arg_maxPrograms->set_isarray(false);
- arg_maxPrograms->set_type(GLMessage::DataType::INT);
- arg_maxPrograms->add_intvalue(maxPrograms);
-
- // copy argument numPrograms
- GLMessage_DataType *arg_numPrograms = glmsg.add_args();
- arg_numPrograms->set_isarray(false);
- arg_numPrograms->set_type(GLMessage::DataType::INT);
- arg_numPrograms->add_intvalue((int)numPrograms);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetProgramsQCOM(programs, maxPrograms, numPrograms);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) programs,
- (void *) numPrograms,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glExtIsProgramBinaryQCOM(GLuint program) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtIsProgramBinaryQCOM);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glExtIsProgramBinaryQCOM(program);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar *source, GLint *length) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glExtGetProgramBinarySourceQCOM);
-
- // copy argument program
- GLMessage_DataType *arg_program = glmsg.add_args();
- arg_program->set_isarray(false);
- arg_program->set_type(GLMessage::DataType::INT);
- arg_program->add_intvalue(program);
-
- // copy argument shadertype
- GLMessage_DataType *arg_shadertype = glmsg.add_args();
- arg_shadertype->set_isarray(false);
- arg_shadertype->set_type(GLMessage::DataType::ENUM);
- arg_shadertype->add_intvalue((int)shadertype);
-
- // copy argument source
- GLMessage_DataType *arg_source = glmsg.add_args();
- arg_source->set_isarray(false);
- arg_source->set_type(GLMessage::DataType::INT);
- arg_source->add_intvalue((int)source);
-
- // copy argument length
- GLMessage_DataType *arg_length = glmsg.add_args();
- arg_length->set_isarray(false);
- arg_length->set_type(GLMessage::DataType::INT);
- arg_length->add_intvalue((int)length);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glExtGetProgramBinarySourceQCOM(program, shadertype, source, length);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) source,
- (void *) length,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glStartTilingQCOM);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // copy argument preserveMask
- GLMessage_DataType *arg_preserveMask = glmsg.add_args();
- arg_preserveMask->set_isarray(false);
- arg_preserveMask->set_type(GLMessage::DataType::INT);
- arg_preserveMask->add_intvalue(preserveMask);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glStartTilingQCOM(x, y, width, height, preserveMask);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEndTilingQCOM(GLbitfield preserveMask) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glEndTilingQCOM);
-
- // copy argument preserveMask
- GLMessage_DataType *arg_preserveMask = glmsg.add_args();
- arg_preserveMask->set_isarray(false);
- arg_preserveMask->set_type(GLMessage::DataType::INT);
- arg_preserveMask->add_intvalue(preserveMask);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glEndTilingQCOM(preserveMask);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-
-// Definitions for GL1 APIs
-
-void GLTrace_glAlphaFunc(GLenum func, GLclampf ref) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glAlphaFunc);
-
- // copy argument func
- GLMessage_DataType *arg_func = glmsg.add_args();
- arg_func->set_isarray(false);
- arg_func->set_type(GLMessage::DataType::ENUM);
- arg_func->add_intvalue((int)func);
-
- // copy argument ref
- GLMessage_DataType *arg_ref = glmsg.add_args();
- arg_ref->set_isarray(false);
- arg_ref->set_type(GLMessage::DataType::FLOAT);
- arg_ref->add_floatvalue(ref);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glAlphaFunc(func, ref);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanef(GLenum plane, const GLfloat *equation) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClipPlanef);
-
- // copy argument plane
- GLMessage_DataType *arg_plane = glmsg.add_args();
- arg_plane->set_isarray(false);
- arg_plane->set_type(GLMessage::DataType::ENUM);
- arg_plane->add_intvalue((int)plane);
-
- // copy argument equation
- GLMessage_DataType *arg_equation = glmsg.add_args();
- arg_equation->set_isarray(false);
- arg_equation->set_type(GLMessage::DataType::INT);
- arg_equation->add_intvalue((int)equation);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClipPlanef(plane, equation);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) equation,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glColor4f);
-
- // copy argument red
- GLMessage_DataType *arg_red = glmsg.add_args();
- arg_red->set_isarray(false);
- arg_red->set_type(GLMessage::DataType::FLOAT);
- arg_red->add_floatvalue(red);
-
- // copy argument green
- GLMessage_DataType *arg_green = glmsg.add_args();
- arg_green->set_isarray(false);
- arg_green->set_type(GLMessage::DataType::FLOAT);
- arg_green->add_floatvalue(green);
-
- // copy argument blue
- GLMessage_DataType *arg_blue = glmsg.add_args();
- arg_blue->set_isarray(false);
- arg_blue->set_type(GLMessage::DataType::FLOAT);
- arg_blue->add_floatvalue(blue);
-
- // copy argument alpha
- GLMessage_DataType *arg_alpha = glmsg.add_args();
- arg_alpha->set_isarray(false);
- arg_alpha->set_type(GLMessage::DataType::FLOAT);
- arg_alpha->add_floatvalue(alpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glColor4f(red, green, blue, alpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogf(GLenum pname, GLfloat param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFogf);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::FLOAT);
- arg_param->add_floatvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFogf(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogfv(GLenum pname, const GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFogfv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFogfv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFrustumf);
-
- // copy argument left
- GLMessage_DataType *arg_left = glmsg.add_args();
- arg_left->set_isarray(false);
- arg_left->set_type(GLMessage::DataType::FLOAT);
- arg_left->add_floatvalue(left);
-
- // copy argument right
- GLMessage_DataType *arg_right = glmsg.add_args();
- arg_right->set_isarray(false);
- arg_right->set_type(GLMessage::DataType::FLOAT);
- arg_right->add_floatvalue(right);
-
- // copy argument bottom
- GLMessage_DataType *arg_bottom = glmsg.add_args();
- arg_bottom->set_isarray(false);
- arg_bottom->set_type(GLMessage::DataType::FLOAT);
- arg_bottom->add_floatvalue(bottom);
-
- // copy argument top
- GLMessage_DataType *arg_top = glmsg.add_args();
- arg_top->set_isarray(false);
- arg_top->set_type(GLMessage::DataType::FLOAT);
- arg_top->add_floatvalue(top);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::FLOAT);
- arg_zNear->add_floatvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::FLOAT);
- arg_zFar->add_floatvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFrustumf(left, right, bottom, top, zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetClipPlanef(GLenum pname, GLfloat eqn[4]) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetClipPlanef);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument eqn
- GLMessage_DataType *arg_eqn = glmsg.add_args();
- arg_eqn->set_isarray(false);
- arg_eqn->set_type(GLMessage::DataType::INT);
- arg_eqn->add_intvalue((int)eqn);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetClipPlanef(pname, eqn);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) eqn,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetLightfv(GLenum light, GLenum pname, GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetLightfv);
-
- // copy argument light
- GLMessage_DataType *arg_light = glmsg.add_args();
- arg_light->set_isarray(false);
- arg_light->set_type(GLMessage::DataType::ENUM);
- arg_light->add_intvalue((int)light);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetLightfv(light, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetMaterialfv);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetMaterialfv(face, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexEnvfv(GLenum env, GLenum pname, GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexEnvfv);
-
- // copy argument env
- GLMessage_DataType *arg_env = glmsg.add_args();
- arg_env->set_isarray(false);
- arg_env->set_type(GLMessage::DataType::ENUM);
- arg_env->add_intvalue((int)env);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexEnvfv(env, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelf(GLenum pname, GLfloat param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightModelf);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::FLOAT);
- arg_param->add_floatvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightModelf(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelfv(GLenum pname, const GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightModelfv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightModelfv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightf(GLenum light, GLenum pname, GLfloat param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightf);
-
- // copy argument light
- GLMessage_DataType *arg_light = glmsg.add_args();
- arg_light->set_isarray(false);
- arg_light->set_type(GLMessage::DataType::ENUM);
- arg_light->add_intvalue((int)light);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::FLOAT);
- arg_param->add_floatvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightf(light, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightfv(GLenum light, GLenum pname, const GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightfv);
-
- // copy argument light
- GLMessage_DataType *arg_light = glmsg.add_args();
- arg_light->set_isarray(false);
- arg_light->set_type(GLMessage::DataType::ENUM);
- arg_light->add_intvalue((int)light);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightfv(light, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadMatrixf(const GLfloat *m) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLoadMatrixf);
-
- // copy argument m
- GLMessage_DataType *arg_m = glmsg.add_args();
- arg_m->set_isarray(false);
- arg_m->set_type(GLMessage::DataType::INT);
- arg_m->add_intvalue((int)m);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLoadMatrixf(m);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) m,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialf(GLenum face, GLenum pname, GLfloat param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMaterialf);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::FLOAT);
- arg_param->add_floatvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMaterialf(face, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMaterialfv);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMaterialfv(face, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultMatrixf(const GLfloat *m) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMultMatrixf);
-
- // copy argument m
- GLMessage_DataType *arg_m = glmsg.add_args();
- arg_m->set_isarray(false);
- arg_m->set_type(GLMessage::DataType::INT);
- arg_m->add_intvalue((int)m);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMultMatrixf(m);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) m,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMultiTexCoord4f);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument s
- GLMessage_DataType *arg_s = glmsg.add_args();
- arg_s->set_isarray(false);
- arg_s->set_type(GLMessage::DataType::FLOAT);
- arg_s->add_floatvalue(s);
-
- // copy argument t
- GLMessage_DataType *arg_t = glmsg.add_args();
- arg_t->set_isarray(false);
- arg_t->set_type(GLMessage::DataType::FLOAT);
- arg_t->add_floatvalue(t);
-
- // copy argument r
- GLMessage_DataType *arg_r = glmsg.add_args();
- arg_r->set_isarray(false);
- arg_r->set_type(GLMessage::DataType::FLOAT);
- arg_r->add_floatvalue(r);
-
- // copy argument q
- GLMessage_DataType *arg_q = glmsg.add_args();
- arg_q->set_isarray(false);
- arg_q->set_type(GLMessage::DataType::FLOAT);
- arg_q->add_floatvalue(q);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMultiTexCoord4f(target, s, t, r, q);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glNormal3f);
-
- // copy argument nx
- GLMessage_DataType *arg_nx = glmsg.add_args();
- arg_nx->set_isarray(false);
- arg_nx->set_type(GLMessage::DataType::FLOAT);
- arg_nx->add_floatvalue(nx);
-
- // copy argument ny
- GLMessage_DataType *arg_ny = glmsg.add_args();
- arg_ny->set_isarray(false);
- arg_ny->set_type(GLMessage::DataType::FLOAT);
- arg_ny->add_floatvalue(ny);
-
- // copy argument nz
- GLMessage_DataType *arg_nz = glmsg.add_args();
- arg_nz->set_isarray(false);
- arg_nz->set_type(GLMessage::DataType::FLOAT);
- arg_nz->add_floatvalue(nz);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glNormal3f(nx, ny, nz);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glOrthof);
-
- // copy argument left
- GLMessage_DataType *arg_left = glmsg.add_args();
- arg_left->set_isarray(false);
- arg_left->set_type(GLMessage::DataType::FLOAT);
- arg_left->add_floatvalue(left);
-
- // copy argument right
- GLMessage_DataType *arg_right = glmsg.add_args();
- arg_right->set_isarray(false);
- arg_right->set_type(GLMessage::DataType::FLOAT);
- arg_right->add_floatvalue(right);
-
- // copy argument bottom
- GLMessage_DataType *arg_bottom = glmsg.add_args();
- arg_bottom->set_isarray(false);
- arg_bottom->set_type(GLMessage::DataType::FLOAT);
- arg_bottom->add_floatvalue(bottom);
-
- // copy argument top
- GLMessage_DataType *arg_top = glmsg.add_args();
- arg_top->set_isarray(false);
- arg_top->set_type(GLMessage::DataType::FLOAT);
- arg_top->add_floatvalue(top);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::FLOAT);
- arg_zNear->add_floatvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::FLOAT);
- arg_zFar->add_floatvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glOrthof(left, right, bottom, top, zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterf(GLenum pname, GLfloat param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointParameterf);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::FLOAT);
- arg_param->add_floatvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointParameterf(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterfv(GLenum pname, const GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointParameterfv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointParameterfv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointSize(GLfloat size) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointSize);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::FLOAT);
- arg_size->add_floatvalue(size);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointSize(size);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glRotatef);
-
- // copy argument angle
- GLMessage_DataType *arg_angle = glmsg.add_args();
- arg_angle->set_isarray(false);
- arg_angle->set_type(GLMessage::DataType::FLOAT);
- arg_angle->add_floatvalue(angle);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glRotatef(angle, x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glScalef(GLfloat x, GLfloat y, GLfloat z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glScalef);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glScalef(x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvf(GLenum target, GLenum pname, GLfloat param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexEnvf);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::FLOAT);
- arg_param->add_floatvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexEnvf(target, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexEnvfv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexEnvfv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTranslatef(GLfloat x, GLfloat y, GLfloat z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTranslatef);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTranslatef(x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glAlphaFuncx(GLenum func, GLclampx ref) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glAlphaFuncx);
-
- // copy argument func
- GLMessage_DataType *arg_func = glmsg.add_args();
- arg_func->set_isarray(false);
- arg_func->set_type(GLMessage::DataType::ENUM);
- arg_func->add_intvalue((int)func);
-
- // copy argument ref
- GLMessage_DataType *arg_ref = glmsg.add_args();
- arg_ref->set_isarray(false);
- arg_ref->set_type(GLMessage::DataType::INT);
- arg_ref->add_intvalue(ref);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glAlphaFuncx(func, ref);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClearColorx);
-
- // copy argument red
- GLMessage_DataType *arg_red = glmsg.add_args();
- arg_red->set_isarray(false);
- arg_red->set_type(GLMessage::DataType::INT);
- arg_red->add_intvalue(red);
-
- // copy argument green
- GLMessage_DataType *arg_green = glmsg.add_args();
- arg_green->set_isarray(false);
- arg_green->set_type(GLMessage::DataType::INT);
- arg_green->add_intvalue(green);
-
- // copy argument blue
- GLMessage_DataType *arg_blue = glmsg.add_args();
- arg_blue->set_isarray(false);
- arg_blue->set_type(GLMessage::DataType::INT);
- arg_blue->add_intvalue(blue);
-
- // copy argument alpha
- GLMessage_DataType *arg_alpha = glmsg.add_args();
- arg_alpha->set_isarray(false);
- arg_alpha->set_type(GLMessage::DataType::INT);
- arg_alpha->add_intvalue(alpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClearColorx(red, green, blue, alpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearDepthx(GLclampx depth) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClearDepthx);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::INT);
- arg_depth->add_intvalue(depth);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClearDepthx(depth);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClientActiveTexture(GLenum texture) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClientActiveTexture);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::ENUM);
- arg_texture->add_intvalue((int)texture);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClientActiveTexture(texture);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanex(GLenum plane, const GLfixed *equation) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClipPlanex);
-
- // copy argument plane
- GLMessage_DataType *arg_plane = glmsg.add_args();
- arg_plane->set_isarray(false);
- arg_plane->set_type(GLMessage::DataType::ENUM);
- arg_plane->add_intvalue((int)plane);
-
- // copy argument equation
- GLMessage_DataType *arg_equation = glmsg.add_args();
- arg_equation->set_isarray(false);
- arg_equation->set_type(GLMessage::DataType::INT);
- arg_equation->add_intvalue((int)equation);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClipPlanex(plane, equation);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) equation,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glColor4ub);
-
- // copy argument red
- GLMessage_DataType *arg_red = glmsg.add_args();
- arg_red->set_isarray(false);
- arg_red->set_type(GLMessage::DataType::BYTE);
- arg_red->add_intvalue((int)red);
-
- // copy argument green
- GLMessage_DataType *arg_green = glmsg.add_args();
- arg_green->set_isarray(false);
- arg_green->set_type(GLMessage::DataType::BYTE);
- arg_green->add_intvalue((int)green);
-
- // copy argument blue
- GLMessage_DataType *arg_blue = glmsg.add_args();
- arg_blue->set_isarray(false);
- arg_blue->set_type(GLMessage::DataType::BYTE);
- arg_blue->add_intvalue((int)blue);
-
- // copy argument alpha
- GLMessage_DataType *arg_alpha = glmsg.add_args();
- arg_alpha->set_isarray(false);
- arg_alpha->set_type(GLMessage::DataType::BYTE);
- arg_alpha->add_intvalue((int)alpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glColor4ub(red, green, blue, alpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glColor4x);
-
- // copy argument red
- GLMessage_DataType *arg_red = glmsg.add_args();
- arg_red->set_isarray(false);
- arg_red->set_type(GLMessage::DataType::INT);
- arg_red->add_intvalue(red);
-
- // copy argument green
- GLMessage_DataType *arg_green = glmsg.add_args();
- arg_green->set_isarray(false);
- arg_green->set_type(GLMessage::DataType::INT);
- arg_green->add_intvalue(green);
-
- // copy argument blue
- GLMessage_DataType *arg_blue = glmsg.add_args();
- arg_blue->set_isarray(false);
- arg_blue->set_type(GLMessage::DataType::INT);
- arg_blue->add_intvalue(blue);
-
- // copy argument alpha
- GLMessage_DataType *arg_alpha = glmsg.add_args();
- arg_alpha->set_isarray(false);
- arg_alpha->set_type(GLMessage::DataType::INT);
- arg_alpha->add_intvalue(alpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glColor4x(red, green, blue, alpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glColorPointer);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument stride
- GLMessage_DataType *arg_stride = glmsg.add_args();
- arg_stride->set_isarray(false);
- arg_stride->set_type(GLMessage::DataType::INT);
- arg_stride->add_intvalue(stride);
-
- // copy argument pointer
- GLMessage_DataType *arg_pointer = glmsg.add_args();
- arg_pointer->set_isarray(false);
- arg_pointer->set_type(GLMessage::DataType::INT);
- arg_pointer->add_intvalue((int)pointer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glColorPointer(size, type, stride, pointer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pointer,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthRangex(GLclampx zNear, GLclampx zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDepthRangex);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::INT);
- arg_zNear->add_intvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::INT);
- arg_zFar->add_intvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDepthRangex(zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDisableClientState(GLenum array) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDisableClientState);
-
- // copy argument array
- GLMessage_DataType *arg_array = glmsg.add_args();
- arg_array->set_isarray(false);
- arg_array->set_type(GLMessage::DataType::ENUM);
- arg_array->add_intvalue((int)array);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDisableClientState(array);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEnableClientState(GLenum array) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glEnableClientState);
-
- // copy argument array
- GLMessage_DataType *arg_array = glmsg.add_args();
- arg_array->set_isarray(false);
- arg_array->set_type(GLMessage::DataType::ENUM);
- arg_array->add_intvalue((int)array);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glEnableClientState(array);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogx(GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFogx);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFogx(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogxv(GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFogxv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFogxv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFrustumx);
-
- // copy argument left
- GLMessage_DataType *arg_left = glmsg.add_args();
- arg_left->set_isarray(false);
- arg_left->set_type(GLMessage::DataType::INT);
- arg_left->add_intvalue(left);
-
- // copy argument right
- GLMessage_DataType *arg_right = glmsg.add_args();
- arg_right->set_isarray(false);
- arg_right->set_type(GLMessage::DataType::INT);
- arg_right->add_intvalue(right);
-
- // copy argument bottom
- GLMessage_DataType *arg_bottom = glmsg.add_args();
- arg_bottom->set_isarray(false);
- arg_bottom->set_type(GLMessage::DataType::INT);
- arg_bottom->add_intvalue(bottom);
-
- // copy argument top
- GLMessage_DataType *arg_top = glmsg.add_args();
- arg_top->set_isarray(false);
- arg_top->set_type(GLMessage::DataType::INT);
- arg_top->add_intvalue(top);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::INT);
- arg_zNear->add_intvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::INT);
- arg_zFar->add_intvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFrustumx(left, right, bottom, top, zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetClipPlanex(GLenum pname, GLfixed eqn[4]) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetClipPlanex);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument eqn
- GLMessage_DataType *arg_eqn = glmsg.add_args();
- arg_eqn->set_isarray(false);
- arg_eqn->set_type(GLMessage::DataType::INT);
- arg_eqn->add_intvalue((int)eqn);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetClipPlanex(pname, eqn);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) eqn,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFixedv(GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetFixedv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetFixedv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetLightxv(GLenum light, GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetLightxv);
-
- // copy argument light
- GLMessage_DataType *arg_light = glmsg.add_args();
- arg_light->set_isarray(false);
- arg_light->set_type(GLMessage::DataType::ENUM);
- arg_light->add_intvalue((int)light);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetLightxv(light, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetMaterialxv(GLenum face, GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetMaterialxv);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetMaterialxv(face, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPointerv(GLenum pname, GLvoid **params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetPointerv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetPointerv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexEnviv(GLenum env, GLenum pname, GLint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexEnviv);
-
- // copy argument env
- GLMessage_DataType *arg_env = glmsg.add_args();
- arg_env->set_isarray(false);
- arg_env->set_type(GLMessage::DataType::ENUM);
- arg_env->add_intvalue((int)env);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexEnviv(env, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexEnvxv(GLenum env, GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexEnvxv);
-
- // copy argument env
- GLMessage_DataType *arg_env = glmsg.add_args();
- arg_env->set_isarray(false);
- arg_env->set_type(GLMessage::DataType::ENUM);
- arg_env->add_intvalue((int)env);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexEnvxv(env, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexParameterxv(GLenum target, GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexParameterxv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexParameterxv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelx(GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightModelx);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightModelx(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelxv(GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightModelxv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightModelxv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightx(GLenum light, GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightx);
-
- // copy argument light
- GLMessage_DataType *arg_light = glmsg.add_args();
- arg_light->set_isarray(false);
- arg_light->set_type(GLMessage::DataType::ENUM);
- arg_light->add_intvalue((int)light);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightx(light, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightxv(GLenum light, GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightxv);
-
- // copy argument light
- GLMessage_DataType *arg_light = glmsg.add_args();
- arg_light->set_isarray(false);
- arg_light->set_type(GLMessage::DataType::ENUM);
- arg_light->add_intvalue((int)light);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightxv(light, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLineWidthx(GLfixed width) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLineWidthx);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLineWidthx(width);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadIdentity(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLoadIdentity);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLoadIdentity();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadMatrixx(const GLfixed *m) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLoadMatrixx);
-
- // copy argument m
- GLMessage_DataType *arg_m = glmsg.add_args();
- arg_m->set_isarray(false);
- arg_m->set_type(GLMessage::DataType::INT);
- arg_m->add_intvalue((int)m);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLoadMatrixx(m);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) m,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLogicOp(GLenum opcode) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLogicOp);
-
- // copy argument opcode
- GLMessage_DataType *arg_opcode = glmsg.add_args();
- arg_opcode->set_isarray(false);
- arg_opcode->set_type(GLMessage::DataType::ENUM);
- arg_opcode->add_intvalue((int)opcode);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLogicOp(opcode);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialx(GLenum face, GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMaterialx);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMaterialx(face, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialxv(GLenum face, GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMaterialxv);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMaterialxv(face, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMatrixMode(GLenum mode) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMatrixMode);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMatrixMode(mode);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultMatrixx(const GLfixed *m) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMultMatrixx);
-
- // copy argument m
- GLMessage_DataType *arg_m = glmsg.add_args();
- arg_m->set_isarray(false);
- arg_m->set_type(GLMessage::DataType::INT);
- arg_m->add_intvalue((int)m);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMultMatrixx(m);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) m,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMultiTexCoord4x);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument s
- GLMessage_DataType *arg_s = glmsg.add_args();
- arg_s->set_isarray(false);
- arg_s->set_type(GLMessage::DataType::INT);
- arg_s->add_intvalue(s);
-
- // copy argument t
- GLMessage_DataType *arg_t = glmsg.add_args();
- arg_t->set_isarray(false);
- arg_t->set_type(GLMessage::DataType::INT);
- arg_t->add_intvalue(t);
-
- // copy argument r
- GLMessage_DataType *arg_r = glmsg.add_args();
- arg_r->set_isarray(false);
- arg_r->set_type(GLMessage::DataType::INT);
- arg_r->add_intvalue(r);
-
- // copy argument q
- GLMessage_DataType *arg_q = glmsg.add_args();
- arg_q->set_isarray(false);
- arg_q->set_type(GLMessage::DataType::INT);
- arg_q->add_intvalue(q);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMultiTexCoord4x(target, s, t, r, q);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glNormal3x);
-
- // copy argument nx
- GLMessage_DataType *arg_nx = glmsg.add_args();
- arg_nx->set_isarray(false);
- arg_nx->set_type(GLMessage::DataType::INT);
- arg_nx->add_intvalue(nx);
-
- // copy argument ny
- GLMessage_DataType *arg_ny = glmsg.add_args();
- arg_ny->set_isarray(false);
- arg_ny->set_type(GLMessage::DataType::INT);
- arg_ny->add_intvalue(ny);
-
- // copy argument nz
- GLMessage_DataType *arg_nz = glmsg.add_args();
- arg_nz->set_isarray(false);
- arg_nz->set_type(GLMessage::DataType::INT);
- arg_nz->add_intvalue(nz);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glNormal3x(nx, ny, nz);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glNormalPointer);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument stride
- GLMessage_DataType *arg_stride = glmsg.add_args();
- arg_stride->set_isarray(false);
- arg_stride->set_type(GLMessage::DataType::INT);
- arg_stride->add_intvalue(stride);
-
- // copy argument pointer
- GLMessage_DataType *arg_pointer = glmsg.add_args();
- arg_pointer->set_isarray(false);
- arg_pointer->set_type(GLMessage::DataType::INT);
- arg_pointer->add_intvalue((int)pointer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glNormalPointer(type, stride, pointer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pointer,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glOrthox);
-
- // copy argument left
- GLMessage_DataType *arg_left = glmsg.add_args();
- arg_left->set_isarray(false);
- arg_left->set_type(GLMessage::DataType::INT);
- arg_left->add_intvalue(left);
-
- // copy argument right
- GLMessage_DataType *arg_right = glmsg.add_args();
- arg_right->set_isarray(false);
- arg_right->set_type(GLMessage::DataType::INT);
- arg_right->add_intvalue(right);
-
- // copy argument bottom
- GLMessage_DataType *arg_bottom = glmsg.add_args();
- arg_bottom->set_isarray(false);
- arg_bottom->set_type(GLMessage::DataType::INT);
- arg_bottom->add_intvalue(bottom);
-
- // copy argument top
- GLMessage_DataType *arg_top = glmsg.add_args();
- arg_top->set_isarray(false);
- arg_top->set_type(GLMessage::DataType::INT);
- arg_top->add_intvalue(top);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::INT);
- arg_zNear->add_intvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::INT);
- arg_zFar->add_intvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glOrthox(left, right, bottom, top, zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterx(GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointParameterx);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointParameterx(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterxv(GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointParameterxv);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointParameterxv(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointSizex(GLfixed size) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointSizex);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointSizex(size);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPolygonOffsetx(GLfixed factor, GLfixed units) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPolygonOffsetx);
-
- // copy argument factor
- GLMessage_DataType *arg_factor = glmsg.add_args();
- arg_factor->set_isarray(false);
- arg_factor->set_type(GLMessage::DataType::INT);
- arg_factor->add_intvalue(factor);
-
- // copy argument units
- GLMessage_DataType *arg_units = glmsg.add_args();
- arg_units->set_isarray(false);
- arg_units->set_type(GLMessage::DataType::INT);
- arg_units->add_intvalue(units);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPolygonOffsetx(factor, units);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPopMatrix(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPopMatrix);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPopMatrix();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPushMatrix(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPushMatrix);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPushMatrix();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glRotatex);
-
- // copy argument angle
- GLMessage_DataType *arg_angle = glmsg.add_args();
- arg_angle->set_isarray(false);
- arg_angle->set_type(GLMessage::DataType::INT);
- arg_angle->add_intvalue(angle);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glRotatex(angle, x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSampleCoveragex(GLclampx value, GLboolean invert) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glSampleCoveragex);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue(value);
-
- // copy argument invert
- GLMessage_DataType *arg_invert = glmsg.add_args();
- arg_invert->set_isarray(false);
- arg_invert->set_type(GLMessage::DataType::BOOL);
- arg_invert->add_boolvalue(invert);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glSampleCoveragex(value, invert);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glScalex(GLfixed x, GLfixed y, GLfixed z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glScalex);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glScalex(x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glShadeModel(GLenum mode) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glShadeModel);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glShadeModel(mode);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexCoordPointer);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument stride
- GLMessage_DataType *arg_stride = glmsg.add_args();
- arg_stride->set_isarray(false);
- arg_stride->set_type(GLMessage::DataType::INT);
- arg_stride->add_intvalue(stride);
-
- // copy argument pointer
- GLMessage_DataType *arg_pointer = glmsg.add_args();
- arg_pointer->set_isarray(false);
- arg_pointer->set_type(GLMessage::DataType::INT);
- arg_pointer->add_intvalue((int)pointer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexCoordPointer(size, type, stride, pointer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pointer,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvi(GLenum target, GLenum pname, GLint param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexEnvi);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexEnvi(target, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvx(GLenum target, GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexEnvx);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexEnvx(target, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnviv(GLenum target, GLenum pname, const GLint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexEnviv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexEnviv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvxv(GLenum target, GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexEnvxv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexEnvxv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterx(GLenum target, GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexParameterx);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexParameterx(target, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterxv(GLenum target, GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexParameterxv);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexParameterxv(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTranslatex(GLfixed x, GLfixed y, GLfixed z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTranslatex);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTranslatex(x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glVertexPointer);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument stride
- GLMessage_DataType *arg_stride = glmsg.add_args();
- arg_stride->set_isarray(false);
- arg_stride->set_type(GLMessage::DataType::INT);
- arg_stride->add_intvalue(stride);
-
- // copy argument pointer
- GLMessage_DataType *arg_pointer = glmsg.add_args();
- arg_pointer->set_isarray(false);
- arg_pointer->set_type(GLMessage::DataType::INT);
- arg_pointer->add_intvalue((int)pointer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glVertexPointer(size, type, stride, pointer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pointer,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *pointer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointSizePointerOES);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument stride
- GLMessage_DataType *arg_stride = glmsg.add_args();
- arg_stride->set_isarray(false);
- arg_stride->set_type(GLMessage::DataType::INT);
- arg_stride->add_intvalue(stride);
-
- // copy argument pointer
- GLMessage_DataType *arg_pointer = glmsg.add_args();
- arg_pointer->set_isarray(false);
- arg_pointer->set_type(GLMessage::DataType::INT);
- arg_pointer->add_intvalue((int)pointer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointSizePointerOES(type, stride, pointer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pointer,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-
-// Definitions for GL1Ext APIs
-
-void GLTrace_glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBlendEquationSeparateOES);
-
- // copy argument modeRGB
- GLMessage_DataType *arg_modeRGB = glmsg.add_args();
- arg_modeRGB->set_isarray(false);
- arg_modeRGB->set_type(GLMessage::DataType::ENUM);
- arg_modeRGB->add_intvalue((int)modeRGB);
-
- // copy argument modeAlpha
- GLMessage_DataType *arg_modeAlpha = glmsg.add_args();
- arg_modeAlpha->set_isarray(false);
- arg_modeAlpha->set_type(GLMessage::DataType::ENUM);
- arg_modeAlpha->add_intvalue((int)modeAlpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBlendEquationSeparateOES(modeRGB, modeAlpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBlendFuncSeparateOES);
-
- // copy argument srcRGB
- GLMessage_DataType *arg_srcRGB = glmsg.add_args();
- arg_srcRGB->set_isarray(false);
- arg_srcRGB->set_type(GLMessage::DataType::ENUM);
- arg_srcRGB->add_intvalue((int)srcRGB);
-
- // copy argument dstRGB
- GLMessage_DataType *arg_dstRGB = glmsg.add_args();
- arg_dstRGB->set_isarray(false);
- arg_dstRGB->set_type(GLMessage::DataType::ENUM);
- arg_dstRGB->add_intvalue((int)dstRGB);
-
- // copy argument srcAlpha
- GLMessage_DataType *arg_srcAlpha = glmsg.add_args();
- arg_srcAlpha->set_isarray(false);
- arg_srcAlpha->set_type(GLMessage::DataType::ENUM);
- arg_srcAlpha->add_intvalue((int)srcAlpha);
-
- // copy argument dstAlpha
- GLMessage_DataType *arg_dstAlpha = glmsg.add_args();
- arg_dstAlpha->set_isarray(false);
- arg_dstAlpha->set_type(GLMessage::DataType::ENUM);
- arg_dstAlpha->add_intvalue((int)dstAlpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendEquationOES(GLenum mode) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBlendEquationOES);
-
- // copy argument mode
- GLMessage_DataType *arg_mode = glmsg.add_args();
- arg_mode->set_isarray(false);
- arg_mode->set_type(GLMessage::DataType::ENUM);
- arg_mode->add_intvalue((int)mode);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBlendEquationOES(mode);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawTexsOES);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawTexsOES(x, y, z, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawTexiOES);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawTexiOES(x, y, z, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawTexxOES);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawTexxOES(x, y, z, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexsvOES(const GLshort *coords) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawTexsvOES);
-
- // copy argument coords
- GLMessage_DataType *arg_coords = glmsg.add_args();
- arg_coords->set_isarray(false);
- arg_coords->set_type(GLMessage::DataType::INT);
- arg_coords->add_intvalue((int)coords);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawTexsvOES(coords);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) coords,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexivOES(const GLint *coords) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawTexivOES);
-
- // copy argument coords
- GLMessage_DataType *arg_coords = glmsg.add_args();
- arg_coords->set_isarray(false);
- arg_coords->set_type(GLMessage::DataType::INT);
- arg_coords->add_intvalue((int)coords);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawTexivOES(coords);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) coords,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexxvOES(const GLfixed *coords) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawTexxvOES);
-
- // copy argument coords
- GLMessage_DataType *arg_coords = glmsg.add_args();
- arg_coords->set_isarray(false);
- arg_coords->set_type(GLMessage::DataType::INT);
- arg_coords->add_intvalue((int)coords);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawTexxvOES(coords);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) coords,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawTexfOES);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::FLOAT);
- arg_x->add_floatvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::FLOAT);
- arg_y->add_floatvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::FLOAT);
- arg_z->add_floatvalue(z);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::FLOAT);
- arg_width->add_floatvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::FLOAT);
- arg_height->add_floatvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawTexfOES(x, y, z, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexfvOES(const GLfloat *coords) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDrawTexfvOES);
-
- // copy argument coords
- GLMessage_DataType *arg_coords = glmsg.add_args();
- arg_coords->set_isarray(false);
- arg_coords->set_type(GLMessage::DataType::INT);
- arg_coords->add_intvalue((int)coords);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDrawTexfvOES(coords);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) coords,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glAlphaFuncxOES(GLenum func, GLclampx ref) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glAlphaFuncxOES);
-
- // copy argument func
- GLMessage_DataType *arg_func = glmsg.add_args();
- arg_func->set_isarray(false);
- arg_func->set_type(GLMessage::DataType::ENUM);
- arg_func->add_intvalue((int)func);
-
- // copy argument ref
- GLMessage_DataType *arg_ref = glmsg.add_args();
- arg_ref->set_isarray(false);
- arg_ref->set_type(GLMessage::DataType::INT);
- arg_ref->add_intvalue(ref);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glAlphaFuncxOES(func, ref);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClearColorxOES);
-
- // copy argument red
- GLMessage_DataType *arg_red = glmsg.add_args();
- arg_red->set_isarray(false);
- arg_red->set_type(GLMessage::DataType::INT);
- arg_red->add_intvalue(red);
-
- // copy argument green
- GLMessage_DataType *arg_green = glmsg.add_args();
- arg_green->set_isarray(false);
- arg_green->set_type(GLMessage::DataType::INT);
- arg_green->add_intvalue(green);
-
- // copy argument blue
- GLMessage_DataType *arg_blue = glmsg.add_args();
- arg_blue->set_isarray(false);
- arg_blue->set_type(GLMessage::DataType::INT);
- arg_blue->add_intvalue(blue);
-
- // copy argument alpha
- GLMessage_DataType *arg_alpha = glmsg.add_args();
- arg_alpha->set_isarray(false);
- arg_alpha->set_type(GLMessage::DataType::INT);
- arg_alpha->add_intvalue(alpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClearColorxOES(red, green, blue, alpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearDepthxOES(GLclampx depth) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClearDepthxOES);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::INT);
- arg_depth->add_intvalue(depth);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClearDepthxOES(depth);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanexOES(GLenum plane, const GLfixed *equation) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClipPlanexOES);
-
- // copy argument plane
- GLMessage_DataType *arg_plane = glmsg.add_args();
- arg_plane->set_isarray(false);
- arg_plane->set_type(GLMessage::DataType::ENUM);
- arg_plane->add_intvalue((int)plane);
-
- // copy argument equation
- GLMessage_DataType *arg_equation = glmsg.add_args();
- arg_equation->set_isarray(false);
- arg_equation->set_type(GLMessage::DataType::INT);
- arg_equation->add_intvalue((int)equation);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClipPlanexOES(plane, equation);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) equation,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glColor4xOES);
-
- // copy argument red
- GLMessage_DataType *arg_red = glmsg.add_args();
- arg_red->set_isarray(false);
- arg_red->set_type(GLMessage::DataType::INT);
- arg_red->add_intvalue(red);
-
- // copy argument green
- GLMessage_DataType *arg_green = glmsg.add_args();
- arg_green->set_isarray(false);
- arg_green->set_type(GLMessage::DataType::INT);
- arg_green->add_intvalue(green);
-
- // copy argument blue
- GLMessage_DataType *arg_blue = glmsg.add_args();
- arg_blue->set_isarray(false);
- arg_blue->set_type(GLMessage::DataType::INT);
- arg_blue->add_intvalue(blue);
-
- // copy argument alpha
- GLMessage_DataType *arg_alpha = glmsg.add_args();
- arg_alpha->set_isarray(false);
- arg_alpha->set_type(GLMessage::DataType::INT);
- arg_alpha->add_intvalue(alpha);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glColor4xOES(red, green, blue, alpha);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthRangexOES(GLclampx zNear, GLclampx zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDepthRangexOES);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::INT);
- arg_zNear->add_intvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::INT);
- arg_zFar->add_intvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDepthRangexOES(zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogxOES(GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFogxOES);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFogxOES(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogxvOES(GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFogxvOES);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFogxvOES(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFrustumxOES);
-
- // copy argument left
- GLMessage_DataType *arg_left = glmsg.add_args();
- arg_left->set_isarray(false);
- arg_left->set_type(GLMessage::DataType::INT);
- arg_left->add_intvalue(left);
-
- // copy argument right
- GLMessage_DataType *arg_right = glmsg.add_args();
- arg_right->set_isarray(false);
- arg_right->set_type(GLMessage::DataType::INT);
- arg_right->add_intvalue(right);
-
- // copy argument bottom
- GLMessage_DataType *arg_bottom = glmsg.add_args();
- arg_bottom->set_isarray(false);
- arg_bottom->set_type(GLMessage::DataType::INT);
- arg_bottom->add_intvalue(bottom);
-
- // copy argument top
- GLMessage_DataType *arg_top = glmsg.add_args();
- arg_top->set_isarray(false);
- arg_top->set_type(GLMessage::DataType::INT);
- arg_top->add_intvalue(top);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::INT);
- arg_zNear->add_intvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::INT);
- arg_zFar->add_intvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFrustumxOES(left, right, bottom, top, zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetClipPlanexOES(GLenum pname, GLfixed eqn[4]) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetClipPlanexOES);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument eqn
- GLMessage_DataType *arg_eqn = glmsg.add_args();
- arg_eqn->set_isarray(false);
- arg_eqn->set_type(GLMessage::DataType::INT);
- arg_eqn->add_intvalue((int)eqn);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetClipPlanexOES(pname, eqn);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) eqn,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFixedvOES(GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetFixedvOES);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetFixedvOES(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetLightxvOES(GLenum light, GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetLightxvOES);
-
- // copy argument light
- GLMessage_DataType *arg_light = glmsg.add_args();
- arg_light->set_isarray(false);
- arg_light->set_type(GLMessage::DataType::ENUM);
- arg_light->add_intvalue((int)light);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetLightxvOES(light, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetMaterialxvOES);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetMaterialxvOES(face, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexEnvxvOES);
-
- // copy argument env
- GLMessage_DataType *arg_env = glmsg.add_args();
- arg_env->set_isarray(false);
- arg_env->set_type(GLMessage::DataType::ENUM);
- arg_env->add_intvalue((int)env);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexEnvxvOES(env, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexParameterxvOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexParameterxvOES(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelxOES(GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightModelxOES);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightModelxOES(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelxvOES(GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightModelxvOES);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightModelxvOES(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightxOES(GLenum light, GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightxOES);
-
- // copy argument light
- GLMessage_DataType *arg_light = glmsg.add_args();
- arg_light->set_isarray(false);
- arg_light->set_type(GLMessage::DataType::ENUM);
- arg_light->add_intvalue((int)light);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightxOES(light, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightxvOES(GLenum light, GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLightxvOES);
-
- // copy argument light
- GLMessage_DataType *arg_light = glmsg.add_args();
- arg_light->set_isarray(false);
- arg_light->set_type(GLMessage::DataType::ENUM);
- arg_light->add_intvalue((int)light);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLightxvOES(light, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLineWidthxOES(GLfixed width) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLineWidthxOES);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLineWidthxOES(width);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadMatrixxOES(const GLfixed *m) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLoadMatrixxOES);
-
- // copy argument m
- GLMessage_DataType *arg_m = glmsg.add_args();
- arg_m->set_isarray(false);
- arg_m->set_type(GLMessage::DataType::INT);
- arg_m->add_intvalue((int)m);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLoadMatrixxOES(m);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) m,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialxOES(GLenum face, GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMaterialxOES);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMaterialxOES(face, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialxvOES(GLenum face, GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMaterialxvOES);
-
- // copy argument face
- GLMessage_DataType *arg_face = glmsg.add_args();
- arg_face->set_isarray(false);
- arg_face->set_type(GLMessage::DataType::ENUM);
- arg_face->add_intvalue((int)face);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMaterialxvOES(face, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultMatrixxOES(const GLfixed *m) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMultMatrixxOES);
-
- // copy argument m
- GLMessage_DataType *arg_m = glmsg.add_args();
- arg_m->set_isarray(false);
- arg_m->set_type(GLMessage::DataType::INT);
- arg_m->add_intvalue((int)m);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMultMatrixxOES(m);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) m,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMultiTexCoord4xOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument s
- GLMessage_DataType *arg_s = glmsg.add_args();
- arg_s->set_isarray(false);
- arg_s->set_type(GLMessage::DataType::INT);
- arg_s->add_intvalue(s);
-
- // copy argument t
- GLMessage_DataType *arg_t = glmsg.add_args();
- arg_t->set_isarray(false);
- arg_t->set_type(GLMessage::DataType::INT);
- arg_t->add_intvalue(t);
-
- // copy argument r
- GLMessage_DataType *arg_r = glmsg.add_args();
- arg_r->set_isarray(false);
- arg_r->set_type(GLMessage::DataType::INT);
- arg_r->add_intvalue(r);
-
- // copy argument q
- GLMessage_DataType *arg_q = glmsg.add_args();
- arg_q->set_isarray(false);
- arg_q->set_type(GLMessage::DataType::INT);
- arg_q->add_intvalue(q);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMultiTexCoord4xOES(target, s, t, r, q);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glNormal3xOES);
-
- // copy argument nx
- GLMessage_DataType *arg_nx = glmsg.add_args();
- arg_nx->set_isarray(false);
- arg_nx->set_type(GLMessage::DataType::INT);
- arg_nx->add_intvalue(nx);
-
- // copy argument ny
- GLMessage_DataType *arg_ny = glmsg.add_args();
- arg_ny->set_isarray(false);
- arg_ny->set_type(GLMessage::DataType::INT);
- arg_ny->add_intvalue(ny);
-
- // copy argument nz
- GLMessage_DataType *arg_nz = glmsg.add_args();
- arg_nz->set_isarray(false);
- arg_nz->set_type(GLMessage::DataType::INT);
- arg_nz->add_intvalue(nz);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glNormal3xOES(nx, ny, nz);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glOrthoxOES);
-
- // copy argument left
- GLMessage_DataType *arg_left = glmsg.add_args();
- arg_left->set_isarray(false);
- arg_left->set_type(GLMessage::DataType::INT);
- arg_left->add_intvalue(left);
-
- // copy argument right
- GLMessage_DataType *arg_right = glmsg.add_args();
- arg_right->set_isarray(false);
- arg_right->set_type(GLMessage::DataType::INT);
- arg_right->add_intvalue(right);
-
- // copy argument bottom
- GLMessage_DataType *arg_bottom = glmsg.add_args();
- arg_bottom->set_isarray(false);
- arg_bottom->set_type(GLMessage::DataType::INT);
- arg_bottom->add_intvalue(bottom);
-
- // copy argument top
- GLMessage_DataType *arg_top = glmsg.add_args();
- arg_top->set_isarray(false);
- arg_top->set_type(GLMessage::DataType::INT);
- arg_top->add_intvalue(top);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::INT);
- arg_zNear->add_intvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::INT);
- arg_zFar->add_intvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glOrthoxOES(left, right, bottom, top, zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterxOES(GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointParameterxOES);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointParameterxOES(pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterxvOES(GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointParameterxvOES);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointParameterxvOES(pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointSizexOES(GLfixed size) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPointSizexOES);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPointSizexOES(size);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPolygonOffsetxOES(GLfixed factor, GLfixed units) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glPolygonOffsetxOES);
-
- // copy argument factor
- GLMessage_DataType *arg_factor = glmsg.add_args();
- arg_factor->set_isarray(false);
- arg_factor->set_type(GLMessage::DataType::INT);
- arg_factor->add_intvalue(factor);
-
- // copy argument units
- GLMessage_DataType *arg_units = glmsg.add_args();
- arg_units->set_isarray(false);
- arg_units->set_type(GLMessage::DataType::INT);
- arg_units->add_intvalue(units);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glPolygonOffsetxOES(factor, units);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glRotatexOES);
-
- // copy argument angle
- GLMessage_DataType *arg_angle = glmsg.add_args();
- arg_angle->set_isarray(false);
- arg_angle->set_type(GLMessage::DataType::INT);
- arg_angle->add_intvalue(angle);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glRotatexOES(angle, x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSampleCoveragexOES(GLclampx value, GLboolean invert) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glSampleCoveragexOES);
-
- // copy argument value
- GLMessage_DataType *arg_value = glmsg.add_args();
- arg_value->set_isarray(false);
- arg_value->set_type(GLMessage::DataType::INT);
- arg_value->add_intvalue(value);
-
- // copy argument invert
- GLMessage_DataType *arg_invert = glmsg.add_args();
- arg_invert->set_isarray(false);
- arg_invert->set_type(GLMessage::DataType::BOOL);
- arg_invert->add_boolvalue(invert);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glSampleCoveragexOES(value, invert);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glScalexOES(GLfixed x, GLfixed y, GLfixed z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glScalexOES);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glScalexOES(x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvxOES(GLenum target, GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexEnvxOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexEnvxOES(target, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexEnvxvOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexEnvxvOES(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterxOES(GLenum target, GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexParameterxOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexParameterxOES(target, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexParameterxvOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexParameterxvOES(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTranslatexOES(GLfixed x, GLfixed y, GLfixed z) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTranslatexOES);
-
- // copy argument x
- GLMessage_DataType *arg_x = glmsg.add_args();
- arg_x->set_isarray(false);
- arg_x->set_type(GLMessage::DataType::INT);
- arg_x->add_intvalue(x);
-
- // copy argument y
- GLMessage_DataType *arg_y = glmsg.add_args();
- arg_y->set_isarray(false);
- arg_y->set_type(GLMessage::DataType::INT);
- arg_y->add_intvalue(y);
-
- // copy argument z
- GLMessage_DataType *arg_z = glmsg.add_args();
- arg_z->set_isarray(false);
- arg_z->set_type(GLMessage::DataType::INT);
- arg_z->add_intvalue(z);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTranslatexOES(x, y, z);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsRenderbufferOES(GLuint renderbuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsRenderbufferOES);
-
- // copy argument renderbuffer
- GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
- arg_renderbuffer->set_isarray(false);
- arg_renderbuffer->set_type(GLMessage::DataType::INT);
- arg_renderbuffer->add_intvalue(renderbuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsRenderbufferOES(renderbuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glBindRenderbufferOES(GLenum target, GLuint renderbuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBindRenderbufferOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument renderbuffer
- GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
- arg_renderbuffer->set_isarray(false);
- arg_renderbuffer->set_type(GLMessage::DataType::INT);
- arg_renderbuffer->add_intvalue(renderbuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBindRenderbufferOES(target, renderbuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteRenderbuffersOES);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument renderbuffers
- GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
- arg_renderbuffers->set_isarray(false);
- arg_renderbuffers->set_type(GLMessage::DataType::INT);
- arg_renderbuffers->add_intvalue((int)renderbuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteRenderbuffersOES(n, renderbuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) renderbuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenRenderbuffersOES);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument renderbuffers
- GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
- arg_renderbuffers->set_isarray(false);
- arg_renderbuffers->set_type(GLMessage::DataType::INT);
- arg_renderbuffers->add_intvalue((int)renderbuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenRenderbuffersOES(n, renderbuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) renderbuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glRenderbufferStorageOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument internalformat
- GLMessage_DataType *arg_internalformat = glmsg.add_args();
- arg_internalformat->set_isarray(false);
- arg_internalformat->set_type(GLMessage::DataType::ENUM);
- arg_internalformat->add_intvalue((int)internalformat);
-
- // copy argument width
- GLMessage_DataType *arg_width = glmsg.add_args();
- arg_width->set_isarray(false);
- arg_width->set_type(GLMessage::DataType::INT);
- arg_width->add_intvalue(width);
-
- // copy argument height
- GLMessage_DataType *arg_height = glmsg.add_args();
- arg_height->set_isarray(false);
- arg_height->set_type(GLMessage::DataType::INT);
- arg_height->add_intvalue(height);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glRenderbufferStorageOES(target, internalformat, width, height);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetRenderbufferParameterivOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetRenderbufferParameterivOES(target, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsFramebufferOES(GLuint framebuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glIsFramebufferOES);
-
- // copy argument framebuffer
- GLMessage_DataType *arg_framebuffer = glmsg.add_args();
- arg_framebuffer->set_isarray(false);
- arg_framebuffer->set_type(GLMessage::DataType::INT);
- arg_framebuffer->add_intvalue(framebuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLboolean retValue = glContext->hooks->gl.glIsFramebufferOES(framebuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::BOOL);
- rt->add_boolvalue(retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glBindFramebufferOES(GLenum target, GLuint framebuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glBindFramebufferOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument framebuffer
- GLMessage_DataType *arg_framebuffer = glmsg.add_args();
- arg_framebuffer->set_isarray(false);
- arg_framebuffer->set_type(GLMessage::DataType::INT);
- arg_framebuffer->add_intvalue(framebuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glBindFramebufferOES(target, framebuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDeleteFramebuffersOES);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument framebuffers
- GLMessage_DataType *arg_framebuffers = glmsg.add_args();
- arg_framebuffers->set_isarray(false);
- arg_framebuffers->set_type(GLMessage::DataType::INT);
- arg_framebuffers->add_intvalue((int)framebuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDeleteFramebuffersOES(n, framebuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) framebuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenFramebuffersOES(GLsizei n, GLuint* framebuffers) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenFramebuffersOES);
-
- // copy argument n
- GLMessage_DataType *arg_n = glmsg.add_args();
- arg_n->set_isarray(false);
- arg_n->set_type(GLMessage::DataType::INT);
- arg_n->add_intvalue(n);
-
- // copy argument framebuffers
- GLMessage_DataType *arg_framebuffers = glmsg.add_args();
- arg_framebuffers->set_isarray(false);
- arg_framebuffers->set_type(GLMessage::DataType::INT);
- arg_framebuffers->add_intvalue((int)framebuffers);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenFramebuffersOES(n, framebuffers);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) framebuffers,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glCheckFramebufferStatusOES(GLenum target) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCheckFramebufferStatusOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLenum retValue = glContext->hooks->gl.glCheckFramebufferStatusOES(target);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::ENUM);
- rt->add_intvalue((int)retValue);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFramebufferRenderbufferOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument attachment
- GLMessage_DataType *arg_attachment = glmsg.add_args();
- arg_attachment->set_isarray(false);
- arg_attachment->set_type(GLMessage::DataType::ENUM);
- arg_attachment->add_intvalue((int)attachment);
-
- // copy argument renderbuffertarget
- GLMessage_DataType *arg_renderbuffertarget = glmsg.add_args();
- arg_renderbuffertarget->set_isarray(false);
- arg_renderbuffertarget->set_type(GLMessage::DataType::ENUM);
- arg_renderbuffertarget->add_intvalue((int)renderbuffertarget);
-
- // copy argument renderbuffer
- GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
- arg_renderbuffer->set_isarray(false);
- arg_renderbuffer->set_type(GLMessage::DataType::INT);
- arg_renderbuffer->add_intvalue(renderbuffer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, renderbuffer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFramebufferTexture2DOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument attachment
- GLMessage_DataType *arg_attachment = glmsg.add_args();
- arg_attachment->set_isarray(false);
- arg_attachment->set_type(GLMessage::DataType::ENUM);
- arg_attachment->add_intvalue((int)attachment);
-
- // copy argument textarget
- GLMessage_DataType *arg_textarget = glmsg.add_args();
- arg_textarget->set_isarray(false);
- arg_textarget->set_type(GLMessage::DataType::ENUM);
- arg_textarget->add_intvalue((int)textarget);
-
- // copy argument texture
- GLMessage_DataType *arg_texture = glmsg.add_args();
- arg_texture->set_isarray(false);
- arg_texture->set_type(GLMessage::DataType::INT);
- arg_texture->add_intvalue(texture);
-
- // copy argument level
- GLMessage_DataType *arg_level = glmsg.add_args();
- arg_level->set_isarray(false);
- arg_level->set_type(GLMessage::DataType::INT);
- arg_level->add_intvalue(level);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFramebufferTexture2DOES(target, attachment, textarget, texture, level);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetFramebufferAttachmentParameterivOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // copy argument attachment
- GLMessage_DataType *arg_attachment = glmsg.add_args();
- arg_attachment->set_isarray(false);
- arg_attachment->set_type(GLMessage::DataType::ENUM);
- arg_attachment->add_intvalue((int)attachment);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetFramebufferAttachmentParameterivOES(target, attachment, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenerateMipmapOES(GLenum target) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGenerateMipmapOES);
-
- // copy argument target
- GLMessage_DataType *arg_target = glmsg.add_args();
- arg_target->set_isarray(false);
- arg_target->set_type(GLMessage::DataType::ENUM);
- arg_target->add_intvalue((int)target);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGenerateMipmapOES(target);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCurrentPaletteMatrixOES(GLuint matrixpaletteindex) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glCurrentPaletteMatrixOES);
-
- // copy argument matrixpaletteindex
- GLMessage_DataType *arg_matrixpaletteindex = glmsg.add_args();
- arg_matrixpaletteindex->set_isarray(false);
- arg_matrixpaletteindex->set_type(GLMessage::DataType::INT);
- arg_matrixpaletteindex->add_intvalue(matrixpaletteindex);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glCurrentPaletteMatrixOES(matrixpaletteindex);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadPaletteFromModelViewMatrixOES(void) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glLoadPaletteFromModelViewMatrixOES);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glLoadPaletteFromModelViewMatrixOES();
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glMatrixIndexPointerOES);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument stride
- GLMessage_DataType *arg_stride = glmsg.add_args();
- arg_stride->set_isarray(false);
- arg_stride->set_type(GLMessage::DataType::INT);
- arg_stride->add_intvalue(stride);
-
- // copy argument pointer
- GLMessage_DataType *arg_pointer = glmsg.add_args();
- arg_pointer->set_isarray(false);
- arg_pointer->set_type(GLMessage::DataType::INT);
- arg_pointer->add_intvalue((int)pointer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glMatrixIndexPointerOES(size, type, stride, pointer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pointer,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glWeightPointerOES);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument stride
- GLMessage_DataType *arg_stride = glmsg.add_args();
- arg_stride->set_isarray(false);
- arg_stride->set_type(GLMessage::DataType::INT);
- arg_stride->add_intvalue(stride);
-
- // copy argument pointer
- GLMessage_DataType *arg_pointer = glmsg.add_args();
- arg_pointer->set_isarray(false);
- arg_pointer->set_type(GLMessage::DataType::INT);
- arg_pointer->add_intvalue((int)pointer);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glWeightPointerOES(size, type, stride, pointer);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) pointer,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-GLbitfield GLTrace_glQueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glQueryMatrixxOES);
-
- // copy argument mantissa
- GLMessage_DataType *arg_mantissa = glmsg.add_args();
- arg_mantissa->set_isarray(false);
- arg_mantissa->set_type(GLMessage::DataType::INT);
- arg_mantissa->add_intvalue((int)mantissa);
-
- // copy argument exponent
- GLMessage_DataType *arg_exponent = glmsg.add_args();
- arg_exponent->set_isarray(false);
- arg_exponent->set_type(GLMessage::DataType::INT);
- arg_exponent->add_intvalue((int)exponent);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- GLbitfield retValue = glContext->hooks->gl.glQueryMatrixxOES(mantissa, exponent);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::INT);
- rt->add_intvalue(retValue);
-
- void *pointerArgs[] = {
- (void *) mantissa,
- (void *) exponent,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-
- return retValue;
-}
-
-void GLTrace_glDepthRangefOES(GLclampf zNear, GLclampf zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glDepthRangefOES);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::FLOAT);
- arg_zNear->add_floatvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::FLOAT);
- arg_zFar->add_floatvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glDepthRangefOES(zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glFrustumfOES);
-
- // copy argument left
- GLMessage_DataType *arg_left = glmsg.add_args();
- arg_left->set_isarray(false);
- arg_left->set_type(GLMessage::DataType::FLOAT);
- arg_left->add_floatvalue(left);
-
- // copy argument right
- GLMessage_DataType *arg_right = glmsg.add_args();
- arg_right->set_isarray(false);
- arg_right->set_type(GLMessage::DataType::FLOAT);
- arg_right->add_floatvalue(right);
-
- // copy argument bottom
- GLMessage_DataType *arg_bottom = glmsg.add_args();
- arg_bottom->set_isarray(false);
- arg_bottom->set_type(GLMessage::DataType::FLOAT);
- arg_bottom->add_floatvalue(bottom);
-
- // copy argument top
- GLMessage_DataType *arg_top = glmsg.add_args();
- arg_top->set_isarray(false);
- arg_top->set_type(GLMessage::DataType::FLOAT);
- arg_top->add_floatvalue(top);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::FLOAT);
- arg_zNear->add_floatvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::FLOAT);
- arg_zFar->add_floatvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glFrustumfOES(left, right, bottom, top, zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glOrthofOES);
-
- // copy argument left
- GLMessage_DataType *arg_left = glmsg.add_args();
- arg_left->set_isarray(false);
- arg_left->set_type(GLMessage::DataType::FLOAT);
- arg_left->add_floatvalue(left);
-
- // copy argument right
- GLMessage_DataType *arg_right = glmsg.add_args();
- arg_right->set_isarray(false);
- arg_right->set_type(GLMessage::DataType::FLOAT);
- arg_right->add_floatvalue(right);
-
- // copy argument bottom
- GLMessage_DataType *arg_bottom = glmsg.add_args();
- arg_bottom->set_isarray(false);
- arg_bottom->set_type(GLMessage::DataType::FLOAT);
- arg_bottom->add_floatvalue(bottom);
-
- // copy argument top
- GLMessage_DataType *arg_top = glmsg.add_args();
- arg_top->set_isarray(false);
- arg_top->set_type(GLMessage::DataType::FLOAT);
- arg_top->add_floatvalue(top);
-
- // copy argument zNear
- GLMessage_DataType *arg_zNear = glmsg.add_args();
- arg_zNear->set_isarray(false);
- arg_zNear->set_type(GLMessage::DataType::FLOAT);
- arg_zNear->add_floatvalue(zNear);
-
- // copy argument zFar
- GLMessage_DataType *arg_zFar = glmsg.add_args();
- arg_zFar->set_isarray(false);
- arg_zFar->set_type(GLMessage::DataType::FLOAT);
- arg_zFar->add_floatvalue(zFar);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glOrthofOES(left, right, bottom, top, zNear, zFar);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanefOES(GLenum plane, const GLfloat *equation) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClipPlanefOES);
-
- // copy argument plane
- GLMessage_DataType *arg_plane = glmsg.add_args();
- arg_plane->set_isarray(false);
- arg_plane->set_type(GLMessage::DataType::ENUM);
- arg_plane->add_intvalue((int)plane);
-
- // copy argument equation
- GLMessage_DataType *arg_equation = glmsg.add_args();
- arg_equation->set_isarray(false);
- arg_equation->set_type(GLMessage::DataType::INT);
- arg_equation->add_intvalue((int)equation);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClipPlanefOES(plane, equation);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) equation,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetClipPlanefOES);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument eqn
- GLMessage_DataType *arg_eqn = glmsg.add_args();
- arg_eqn->set_isarray(false);
- arg_eqn->set_type(GLMessage::DataType::INT);
- arg_eqn->add_intvalue((int)eqn);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetClipPlanefOES(pname, eqn);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) eqn,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearDepthfOES(GLclampf depth) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClearDepthfOES);
-
- // copy argument depth
- GLMessage_DataType *arg_depth = glmsg.add_args();
- arg_depth->set_isarray(false);
- arg_depth->set_type(GLMessage::DataType::FLOAT);
- arg_depth->add_floatvalue(depth);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClearDepthfOES(depth);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenfOES(GLenum coord, GLenum pname, GLfloat param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexGenfOES);
-
- // copy argument coord
- GLMessage_DataType *arg_coord = glmsg.add_args();
- arg_coord->set_isarray(false);
- arg_coord->set_type(GLMessage::DataType::ENUM);
- arg_coord->add_intvalue((int)coord);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::FLOAT);
- arg_param->add_floatvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexGenfOES(coord, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexGenfvOES);
-
- // copy argument coord
- GLMessage_DataType *arg_coord = glmsg.add_args();
- arg_coord->set_isarray(false);
- arg_coord->set_type(GLMessage::DataType::ENUM);
- arg_coord->add_intvalue((int)coord);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexGenfvOES(coord, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGeniOES(GLenum coord, GLenum pname, GLint param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexGeniOES);
-
- // copy argument coord
- GLMessage_DataType *arg_coord = glmsg.add_args();
- arg_coord->set_isarray(false);
- arg_coord->set_type(GLMessage::DataType::ENUM);
- arg_coord->add_intvalue((int)coord);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexGeniOES(coord, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenivOES(GLenum coord, GLenum pname, const GLint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexGenivOES);
-
- // copy argument coord
- GLMessage_DataType *arg_coord = glmsg.add_args();
- arg_coord->set_isarray(false);
- arg_coord->set_type(GLMessage::DataType::ENUM);
- arg_coord->add_intvalue((int)coord);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexGenivOES(coord, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenxOES(GLenum coord, GLenum pname, GLfixed param) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexGenxOES);
-
- // copy argument coord
- GLMessage_DataType *arg_coord = glmsg.add_args();
- arg_coord->set_isarray(false);
- arg_coord->set_type(GLMessage::DataType::ENUM);
- arg_coord->add_intvalue((int)coord);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument param
- GLMessage_DataType *arg_param = glmsg.add_args();
- arg_param->set_isarray(false);
- arg_param->set_type(GLMessage::DataType::INT);
- arg_param->add_intvalue(param);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexGenxOES(coord, pname, param);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glTexGenxvOES);
-
- // copy argument coord
- GLMessage_DataType *arg_coord = glmsg.add_args();
- arg_coord->set_isarray(false);
- arg_coord->set_type(GLMessage::DataType::ENUM);
- arg_coord->add_intvalue((int)coord);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glTexGenxvOES(coord, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexGenfvOES);
-
- // copy argument coord
- GLMessage_DataType *arg_coord = glmsg.add_args();
- arg_coord->set_isarray(false);
- arg_coord->set_type(GLMessage::DataType::ENUM);
- arg_coord->add_intvalue((int)coord);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexGenfvOES(coord, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexGenivOES(GLenum coord, GLenum pname, GLint *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexGenivOES);
-
- // copy argument coord
- GLMessage_DataType *arg_coord = glmsg.add_args();
- arg_coord->set_isarray(false);
- arg_coord->set_type(GLMessage::DataType::ENUM);
- arg_coord->add_intvalue((int)coord);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexGenivOES(coord, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glGetTexGenxvOES);
-
- // copy argument coord
- GLMessage_DataType *arg_coord = glmsg.add_args();
- arg_coord->set_isarray(false);
- arg_coord->set_type(GLMessage::DataType::ENUM);
- arg_coord->add_intvalue((int)coord);
-
- // copy argument pname
- GLMessage_DataType *arg_pname = glmsg.add_args();
- arg_pname->set_isarray(false);
- arg_pname->set_type(GLMessage::DataType::ENUM);
- arg_pname->add_intvalue((int)pname);
-
- // copy argument params
- GLMessage_DataType *arg_params = glmsg.add_args();
- arg_params->set_isarray(false);
- arg_params->set_type(GLMessage::DataType::INT);
- arg_params->add_intvalue((int)params);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glGetTexGenxvOES(coord, pname, params);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) params,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanefIMG(GLenum p, const GLfloat *eqn) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClipPlanefIMG);
-
- // copy argument p
- GLMessage_DataType *arg_p = glmsg.add_args();
- arg_p->set_isarray(false);
- arg_p->set_type(GLMessage::DataType::ENUM);
- arg_p->add_intvalue((int)p);
-
- // copy argument eqn
- GLMessage_DataType *arg_eqn = glmsg.add_args();
- arg_eqn->set_isarray(false);
- arg_eqn->set_type(GLMessage::DataType::INT);
- arg_eqn->add_intvalue((int)eqn);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClipPlanefIMG(p, eqn);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) eqn,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanexIMG(GLenum p, const GLfixed *eqn) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::glClipPlanexIMG);
-
- // copy argument p
- GLMessage_DataType *arg_p = glmsg.add_args();
- arg_p->set_isarray(false);
- arg_p->set_type(GLMessage::DataType::ENUM);
- arg_p->add_intvalue((int)p);
-
- // copy argument eqn
- GLMessage_DataType *arg_eqn = glmsg.add_args();
- arg_eqn->set_isarray(false);
- arg_eqn->set_type(GLMessage::DataType::INT);
- arg_eqn->add_intvalue((int)eqn);
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
- glContext->hooks->gl.glClipPlanexIMG(p, eqn);
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- void *pointerArgs[] = {
- (void *) eqn,
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-}
-
-
-}; // namespace gltrace
-}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_api.h b/opengl/libs/GLES_trace/src/gltrace_api.h
deleted file mode 100644
index debcac0..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_api.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * Copyright 2011, 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.
- *
- * THIS FILE WAS GENERATED BY A SCRIPT. DO NOT EDIT.
- */
-
-namespace android {
-namespace gltrace {
-
-// Declarations for GL2 APIs
-
-void GLTrace_glActiveTexture(GLenum texture);
-void GLTrace_glAttachShader(GLuint program, GLuint shader);
-void GLTrace_glBindAttribLocation(GLuint program, GLuint index, const GLchar* name);
-void GLTrace_glBindBuffer(GLenum target, GLuint buffer);
-void GLTrace_glBindFramebuffer(GLenum target, GLuint framebuffer);
-void GLTrace_glBindRenderbuffer(GLenum target, GLuint renderbuffer);
-void GLTrace_glBindTexture(GLenum target, GLuint texture);
-void GLTrace_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-void GLTrace_glBlendEquation(GLenum mode);
-void GLTrace_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
-void GLTrace_glBlendFunc(GLenum sfactor, GLenum dfactor);
-void GLTrace_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-void GLTrace_glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
-void GLTrace_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
-GLenum GLTrace_glCheckFramebufferStatus(GLenum target);
-void GLTrace_glClear(GLbitfield mask);
-void GLTrace_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-void GLTrace_glClearDepthf(GLclampf depth);
-void GLTrace_glClearStencil(GLint s);
-void GLTrace_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-void GLTrace_glCompileShader(GLuint shader);
-void GLTrace_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
-void GLTrace_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
-void GLTrace_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-void GLTrace_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLuint GLTrace_glCreateProgram(void);
-GLuint GLTrace_glCreateShader(GLenum type);
-void GLTrace_glCullFace(GLenum mode);
-void GLTrace_glDeleteBuffers(GLsizei n, const GLuint* buffers);
-void GLTrace_glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
-void GLTrace_glDeleteProgram(GLuint program);
-void GLTrace_glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
-void GLTrace_glDeleteShader(GLuint shader);
-void GLTrace_glDeleteTextures(GLsizei n, const GLuint* textures);
-void GLTrace_glDepthFunc(GLenum func);
-void GLTrace_glDepthMask(GLboolean flag);
-void GLTrace_glDepthRangef(GLclampf zNear, GLclampf zFar);
-void GLTrace_glDetachShader(GLuint program, GLuint shader);
-void GLTrace_glDisable(GLenum cap);
-void GLTrace_glDisableVertexAttribArray(GLuint index);
-void GLTrace_glDrawArrays(GLenum mode, GLint first, GLsizei count);
-void GLTrace_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
-void GLTrace_glEnable(GLenum cap);
-void GLTrace_glEnableVertexAttribArray(GLuint index);
-void GLTrace_glFinish(void);
-void GLTrace_glFlush(void);
-void GLTrace_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-void GLTrace_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-void GLTrace_glFrontFace(GLenum mode);
-void GLTrace_glGenBuffers(GLsizei n, GLuint* buffers);
-void GLTrace_glGenerateMipmap(GLenum target);
-void GLTrace_glGenFramebuffers(GLsizei n, GLuint* framebuffers);
-void GLTrace_glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
-void GLTrace_glGenTextures(GLsizei n, GLuint* textures);
-void GLTrace_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-void GLTrace_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-void GLTrace_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
-int GLTrace_glGetAttribLocation(GLuint program, const GLchar* name);
-void GLTrace_glGetBooleanv(GLenum pname, GLboolean* params);
-void GLTrace_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
-GLenum GLTrace_glGetError(void);
-void GLTrace_glGetFloatv(GLenum pname, GLfloat* params);
-void GLTrace_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
-void GLTrace_glGetIntegerv(GLenum pname, GLint* params);
-void GLTrace_glGetProgramiv(GLuint program, GLenum pname, GLint* params);
-void GLTrace_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-void GLTrace_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
-void GLTrace_glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
-void GLTrace_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-void GLTrace_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
-void GLTrace_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
-const GLubyte* GLTrace_glGetString(GLenum name);
-void GLTrace_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
-void GLTrace_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
-void GLTrace_glGetUniformfv(GLuint program, GLint location, GLfloat* params);
-void GLTrace_glGetUniformiv(GLuint program, GLint location, GLint* params);
-int GLTrace_glGetUniformLocation(GLuint program, const GLchar* name);
-void GLTrace_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
-void GLTrace_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
-void GLTrace_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
-void GLTrace_glHint(GLenum target, GLenum mode);
-GLboolean GLTrace_glIsBuffer(GLuint buffer);
-GLboolean GLTrace_glIsEnabled(GLenum cap);
-GLboolean GLTrace_glIsFramebuffer(GLuint framebuffer);
-GLboolean GLTrace_glIsProgram(GLuint program);
-GLboolean GLTrace_glIsRenderbuffer(GLuint renderbuffer);
-GLboolean GLTrace_glIsShader(GLuint shader);
-GLboolean GLTrace_glIsTexture(GLuint texture);
-void GLTrace_glLineWidth(GLfloat width);
-void GLTrace_glLinkProgram(GLuint program);
-void GLTrace_glPixelStorei(GLenum pname, GLint param);
-void GLTrace_glPolygonOffset(GLfloat factor, GLfloat units);
-void GLTrace_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
-void GLTrace_glReleaseShaderCompiler(void);
-void GLTrace_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glSampleCoverage(GLclampf value, GLboolean invert);
-void GLTrace_glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
-void GLTrace_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
-void GLTrace_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
-void GLTrace_glStencilFunc(GLenum func, GLint ref, GLuint mask);
-void GLTrace_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
-void GLTrace_glStencilMask(GLuint mask);
-void GLTrace_glStencilMaskSeparate(GLenum face, GLuint mask);
-void GLTrace_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
-void GLTrace_glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
-void GLTrace_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
-void GLTrace_glTexParameterf(GLenum target, GLenum pname, GLfloat param);
-void GLTrace_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
-void GLTrace_glTexParameteri(GLenum target, GLenum pname, GLint param);
-void GLTrace_glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
-void GLTrace_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
-void GLTrace_glUniform1f(GLint location, GLfloat x);
-void GLTrace_glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
-void GLTrace_glUniform1i(GLint location, GLint x);
-void GLTrace_glUniform1iv(GLint location, GLsizei count, const GLint* v);
-void GLTrace_glUniform2f(GLint location, GLfloat x, GLfloat y);
-void GLTrace_glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
-void GLTrace_glUniform2i(GLint location, GLint x, GLint y);
-void GLTrace_glUniform2iv(GLint location, GLsizei count, const GLint* v);
-void GLTrace_glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
-void GLTrace_glUniform3i(GLint location, GLint x, GLint y, GLint z);
-void GLTrace_glUniform3iv(GLint location, GLsizei count, const GLint* v);
-void GLTrace_glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-void GLTrace_glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
-void GLTrace_glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
-void GLTrace_glUniform4iv(GLint location, GLsizei count, const GLint* v);
-void GLTrace_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-void GLTrace_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-void GLTrace_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-void GLTrace_glUseProgram(GLuint program);
-void GLTrace_glValidateProgram(GLuint program);
-void GLTrace_glVertexAttrib1f(GLuint indx, GLfloat x);
-void GLTrace_glVertexAttrib1fv(GLuint indx, const GLfloat* values);
-void GLTrace_glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
-void GLTrace_glVertexAttrib2fv(GLuint indx, const GLfloat* values);
-void GLTrace_glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glVertexAttrib3fv(GLuint indx, const GLfloat* values);
-void GLTrace_glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-void GLTrace_glVertexAttrib4fv(GLuint indx, const GLfloat* values);
-void GLTrace_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
-void GLTrace_glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
-
-// Declarations for GL2Ext APIs
-
-void GLTrace_glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
-void GLTrace_glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
-void GLTrace_glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-void GLTrace_glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
-void* GLTrace_glMapBufferOES(GLenum target, GLenum access);
-GLboolean GLTrace_glUnmapBufferOES(GLenum target);
-void GLTrace_glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params);
-void GLTrace_glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
-void GLTrace_glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
-void GLTrace_glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-void GLTrace_glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
-void GLTrace_glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
-void GLTrace_glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-void GLTrace_glBindVertexArrayOES(GLuint array);
-void GLTrace_glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays);
-void GLTrace_glGenVertexArraysOES(GLsizei n, GLuint *arrays);
-GLboolean GLTrace_glIsVertexArrayOES(GLuint array);
-void GLTrace_glGetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-void GLTrace_glGetPerfMonitorCountersAMD(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-void GLTrace_glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-void GLTrace_glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-void GLTrace_glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid *data);
-void GLTrace_glGenPerfMonitorsAMD(GLsizei n, GLuint *monitors);
-void GLTrace_glDeletePerfMonitorsAMD(GLsizei n, GLuint *monitors);
-void GLTrace_glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
-void GLTrace_glBeginPerfMonitorAMD(GLuint monitor);
-void GLTrace_glEndPerfMonitorAMD(GLuint monitor);
-void GLTrace_glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-void GLTrace_glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-void GLTrace_glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glResolveMultisampleFramebufferAPPLE(void);
-void GLTrace_glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label);
-void GLTrace_glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
-void GLTrace_glInsertEventMarkerEXT(GLsizei length, const GLchar *marker);
-void GLTrace_glPushGroupMarkerEXT(GLsizei length, const GLchar *marker);
-void GLTrace_glPopGroupMarkerEXT(void);
-void GLTrace_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments);
-void GLTrace_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-void GLTrace_glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-void GLTrace_glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-void GLTrace_glGenQueriesEXT(GLsizei n, GLuint *ids);
-void GLTrace_glDeleteQueriesEXT(GLsizei n, const GLuint *ids);
-GLboolean GLTrace_glIsQueryEXT(GLuint id);
-void GLTrace_glBeginQueryEXT(GLenum target, GLuint id);
-void GLTrace_glEndQueryEXT(GLenum target);
-void GLTrace_glGetQueryivEXT(GLenum target, GLenum pname, GLint *params);
-void GLTrace_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params);
-GLenum GLTrace_glGetGraphicsResetStatusEXT(void);
-void GLTrace_glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-void GLTrace_glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, float *params);
-void GLTrace_glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params);
-void GLTrace_glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program);
-void GLTrace_glActiveShaderProgramEXT(GLuint pipeline, GLuint program);
-GLuint GLTrace_glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar **strings);
-void GLTrace_glBindProgramPipelineEXT(GLuint pipeline);
-void GLTrace_glDeleteProgramPipelinesEXT(GLsizei n, const GLuint *pipelines);
-void GLTrace_glGenProgramPipelinesEXT(GLsizei n, GLuint *pipelines);
-GLboolean GLTrace_glIsProgramPipelineEXT(GLuint pipeline);
-void GLTrace_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value);
-void GLTrace_glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint *params);
-void GLTrace_glProgramUniform1iEXT(GLuint program, GLint location, GLint x);
-void GLTrace_glProgramUniform2iEXT(GLuint program, GLint location, GLint x, GLint y);
-void GLTrace_glProgramUniform3iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z);
-void GLTrace_glProgramUniform4iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
-void GLTrace_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat x);
-void GLTrace_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat x, GLfloat y);
-void GLTrace_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-void GLTrace_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
-void GLTrace_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
-void GLTrace_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
-void GLTrace_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
-void GLTrace_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
-void GLTrace_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
-void GLTrace_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
-void GLTrace_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
-void GLTrace_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-void GLTrace_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-void GLTrace_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-void GLTrace_glValidateProgramPipelineEXT(GLuint pipeline);
-void GLTrace_glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-void GLTrace_glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-void GLTrace_glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-void GLTrace_glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-void GLTrace_glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-void GLTrace_glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-void GLTrace_glCoverageMaskNV(GLboolean mask);
-void GLTrace_glCoverageOperationNV(GLenum operation);
-void GLTrace_glDrawBuffersNV(GLsizei n, const GLenum *bufs);
-void GLTrace_glDeleteFencesNV(GLsizei n, const GLuint *fences);
-void GLTrace_glGenFencesNV(GLsizei n, GLuint *fences);
-GLboolean GLTrace_glIsFenceNV(GLuint fence);
-GLboolean GLTrace_glTestFenceNV(GLuint fence);
-void GLTrace_glGetFenceivNV(GLuint fence, GLenum pname, GLint *params);
-void GLTrace_glFinishFenceNV(GLuint fence);
-void GLTrace_glSetFenceNV(GLuint fence, GLenum condition);
-void GLTrace_glReadBufferNV(GLenum mode);
-void GLTrace_glAlphaFuncQCOM(GLenum func, GLclampf ref);
-void GLTrace_glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls);
-void GLTrace_glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
-void GLTrace_glEnableDriverControlQCOM(GLuint driverControl);
-void GLTrace_glDisableDriverControlQCOM(GLuint driverControl);
-void GLTrace_glExtGetTexturesQCOM(GLuint *textures, GLint maxTextures, GLint *numTextures);
-void GLTrace_glExtGetBuffersQCOM(GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
-void GLTrace_glExtGetRenderbuffersQCOM(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
-void GLTrace_glExtGetFramebuffersQCOM(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
-void GLTrace_glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
-void GLTrace_glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
-void GLTrace_glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
-void GLTrace_glExtGetBufferPointervQCOM(GLenum target, GLvoid **params);
-void GLTrace_glExtGetShadersQCOM(GLuint *shaders, GLint maxShaders, GLint *numShaders);
-void GLTrace_glExtGetProgramsQCOM(GLuint *programs, GLint maxPrograms, GLint *numPrograms);
-GLboolean GLTrace_glExtIsProgramBinaryQCOM(GLuint program);
-void GLTrace_glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar *source, GLint *length);
-void GLTrace_glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
-void GLTrace_glEndTilingQCOM(GLbitfield preserveMask);
-
-// Declarations for GL1 APIs
-
-void GLTrace_glAlphaFunc(GLenum func, GLclampf ref);
-void GLTrace_glClipPlanef(GLenum plane, const GLfloat *equation);
-void GLTrace_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-void GLTrace_glFogf(GLenum pname, GLfloat param);
-void GLTrace_glFogfv(GLenum pname, const GLfloat *params);
-void GLTrace_glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-void GLTrace_glGetClipPlanef(GLenum pname, GLfloat eqn[4]);
-void GLTrace_glGetLightfv(GLenum light, GLenum pname, GLfloat *params);
-void GLTrace_glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params);
-void GLTrace_glGetTexEnvfv(GLenum env, GLenum pname, GLfloat *params);
-void GLTrace_glLightModelf(GLenum pname, GLfloat param);
-void GLTrace_glLightModelfv(GLenum pname, const GLfloat *params);
-void GLTrace_glLightf(GLenum light, GLenum pname, GLfloat param);
-void GLTrace_glLightfv(GLenum light, GLenum pname, const GLfloat *params);
-void GLTrace_glLoadMatrixf(const GLfloat *m);
-void GLTrace_glMaterialf(GLenum face, GLenum pname, GLfloat param);
-void GLTrace_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params);
-void GLTrace_glMultMatrixf(const GLfloat *m);
-void GLTrace_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-void GLTrace_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
-void GLTrace_glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-void GLTrace_glPointParameterf(GLenum pname, GLfloat param);
-void GLTrace_glPointParameterfv(GLenum pname, const GLfloat *params);
-void GLTrace_glPointSize(GLfloat size);
-void GLTrace_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glScalef(GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glTexEnvf(GLenum target, GLenum pname, GLfloat param);
-void GLTrace_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params);
-void GLTrace_glTranslatef(GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glAlphaFuncx(GLenum func, GLclampx ref);
-void GLTrace_glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
-void GLTrace_glClearDepthx(GLclampx depth);
-void GLTrace_glClientActiveTexture(GLenum texture);
-void GLTrace_glClipPlanex(GLenum plane, const GLfixed *equation);
-void GLTrace_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-void GLTrace_glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-void GLTrace_glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-void GLTrace_glDepthRangex(GLclampx zNear, GLclampx zFar);
-void GLTrace_glDisableClientState(GLenum array);
-void GLTrace_glEnableClientState(GLenum array);
-void GLTrace_glFogx(GLenum pname, GLfixed param);
-void GLTrace_glFogxv(GLenum pname, const GLfixed *params);
-void GLTrace_glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-void GLTrace_glGetClipPlanex(GLenum pname, GLfixed eqn[4]);
-void GLTrace_glGetFixedv(GLenum pname, GLfixed *params);
-void GLTrace_glGetLightxv(GLenum light, GLenum pname, GLfixed *params);
-void GLTrace_glGetMaterialxv(GLenum face, GLenum pname, GLfixed *params);
-void GLTrace_glGetPointerv(GLenum pname, GLvoid **params);
-void GLTrace_glGetTexEnviv(GLenum env, GLenum pname, GLint *params);
-void GLTrace_glGetTexEnvxv(GLenum env, GLenum pname, GLfixed *params);
-void GLTrace_glGetTexParameterxv(GLenum target, GLenum pname, GLfixed *params);
-void GLTrace_glLightModelx(GLenum pname, GLfixed param);
-void GLTrace_glLightModelxv(GLenum pname, const GLfixed *params);
-void GLTrace_glLightx(GLenum light, GLenum pname, GLfixed param);
-void GLTrace_glLightxv(GLenum light, GLenum pname, const GLfixed *params);
-void GLTrace_glLineWidthx(GLfixed width);
-void GLTrace_glLoadIdentity(void);
-void GLTrace_glLoadMatrixx(const GLfixed *m);
-void GLTrace_glLogicOp(GLenum opcode);
-void GLTrace_glMaterialx(GLenum face, GLenum pname, GLfixed param);
-void GLTrace_glMaterialxv(GLenum face, GLenum pname, const GLfixed *params);
-void GLTrace_glMatrixMode(GLenum mode);
-void GLTrace_glMultMatrixx(const GLfixed *m);
-void GLTrace_glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-void GLTrace_glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz);
-void GLTrace_glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer);
-void GLTrace_glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-void GLTrace_glPointParameterx(GLenum pname, GLfixed param);
-void GLTrace_glPointParameterxv(GLenum pname, const GLfixed *params);
-void GLTrace_glPointSizex(GLfixed size);
-void GLTrace_glPolygonOffsetx(GLfixed factor, GLfixed units);
-void GLTrace_glPopMatrix(void);
-void GLTrace_glPushMatrix(void);
-void GLTrace_glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glSampleCoveragex(GLclampx value, GLboolean invert);
-void GLTrace_glScalex(GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glShadeModel(GLenum mode);
-void GLTrace_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-void GLTrace_glTexEnvi(GLenum target, GLenum pname, GLint param);
-void GLTrace_glTexEnvx(GLenum target, GLenum pname, GLfixed param);
-void GLTrace_glTexEnviv(GLenum target, GLenum pname, const GLint *params);
-void GLTrace_glTexEnvxv(GLenum target, GLenum pname, const GLfixed *params);
-void GLTrace_glTexParameterx(GLenum target, GLenum pname, GLfixed param);
-void GLTrace_glTexParameterxv(GLenum target, GLenum pname, const GLfixed *params);
-void GLTrace_glTranslatex(GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-void GLTrace_glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *pointer);
-
-// Declarations for GL1Ext APIs
-
-void GLTrace_glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha);
-void GLTrace_glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-void GLTrace_glBlendEquationOES(GLenum mode);
-void GLTrace_glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
-void GLTrace_glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height);
-void GLTrace_glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
-void GLTrace_glDrawTexsvOES(const GLshort *coords);
-void GLTrace_glDrawTexivOES(const GLint *coords);
-void GLTrace_glDrawTexxvOES(const GLfixed *coords);
-void GLTrace_glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
-void GLTrace_glDrawTexfvOES(const GLfloat *coords);
-void GLTrace_glAlphaFuncxOES(GLenum func, GLclampx ref);
-void GLTrace_glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
-void GLTrace_glClearDepthxOES(GLclampx depth);
-void GLTrace_glClipPlanexOES(GLenum plane, const GLfixed *equation);
-void GLTrace_glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-void GLTrace_glDepthRangexOES(GLclampx zNear, GLclampx zFar);
-void GLTrace_glFogxOES(GLenum pname, GLfixed param);
-void GLTrace_glFogxvOES(GLenum pname, const GLfixed *params);
-void GLTrace_glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-void GLTrace_glGetClipPlanexOES(GLenum pname, GLfixed eqn[4]);
-void GLTrace_glGetFixedvOES(GLenum pname, GLfixed *params);
-void GLTrace_glGetLightxvOES(GLenum light, GLenum pname, GLfixed *params);
-void GLTrace_glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed *params);
-void GLTrace_glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed *params);
-void GLTrace_glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed *params);
-void GLTrace_glLightModelxOES(GLenum pname, GLfixed param);
-void GLTrace_glLightModelxvOES(GLenum pname, const GLfixed *params);
-void GLTrace_glLightxOES(GLenum light, GLenum pname, GLfixed param);
-void GLTrace_glLightxvOES(GLenum light, GLenum pname, const GLfixed *params);
-void GLTrace_glLineWidthxOES(GLfixed width);
-void GLTrace_glLoadMatrixxOES(const GLfixed *m);
-void GLTrace_glMaterialxOES(GLenum face, GLenum pname, GLfixed param);
-void GLTrace_glMaterialxvOES(GLenum face, GLenum pname, const GLfixed *params);
-void GLTrace_glMultMatrixxOES(const GLfixed *m);
-void GLTrace_glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-void GLTrace_glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz);
-void GLTrace_glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-void GLTrace_glPointParameterxOES(GLenum pname, GLfixed param);
-void GLTrace_glPointParameterxvOES(GLenum pname, const GLfixed *params);
-void GLTrace_glPointSizexOES(GLfixed size);
-void GLTrace_glPolygonOffsetxOES(GLfixed factor, GLfixed units);
-void GLTrace_glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glSampleCoveragexOES(GLclampx value, GLboolean invert);
-void GLTrace_glScalexOES(GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glTexEnvxOES(GLenum target, GLenum pname, GLfixed param);
-void GLTrace_glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed *params);
-void GLTrace_glTexParameterxOES(GLenum target, GLenum pname, GLfixed param);
-void GLTrace_glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed *params);
-void GLTrace_glTranslatexOES(GLfixed x, GLfixed y, GLfixed z);
-GLboolean GLTrace_glIsRenderbufferOES(GLuint renderbuffer);
-void GLTrace_glBindRenderbufferOES(GLenum target, GLuint renderbuffer);
-void GLTrace_glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers);
-void GLTrace_glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers);
-void GLTrace_glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params);
-GLboolean GLTrace_glIsFramebufferOES(GLuint framebuffer);
-void GLTrace_glBindFramebufferOES(GLenum target, GLuint framebuffer);
-void GLTrace_glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers);
-void GLTrace_glGenFramebuffersOES(GLsizei n, GLuint* framebuffers);
-GLenum GLTrace_glCheckFramebufferStatusOES(GLenum target);
-void GLTrace_glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-void GLTrace_glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-void GLTrace_glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params);
-void GLTrace_glGenerateMipmapOES(GLenum target);
-void GLTrace_glCurrentPaletteMatrixOES(GLuint matrixpaletteindex);
-void GLTrace_glLoadPaletteFromModelViewMatrixOES(void);
-void GLTrace_glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-void GLTrace_glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLbitfield GLTrace_glQueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]);
-void GLTrace_glDepthRangefOES(GLclampf zNear, GLclampf zFar);
-void GLTrace_glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-void GLTrace_glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-void GLTrace_glClipPlanefOES(GLenum plane, const GLfloat *equation);
-void GLTrace_glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]);
-void GLTrace_glClearDepthfOES(GLclampf depth);
-void GLTrace_glTexGenfOES(GLenum coord, GLenum pname, GLfloat param);
-void GLTrace_glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params);
-void GLTrace_glTexGeniOES(GLenum coord, GLenum pname, GLint param);
-void GLTrace_glTexGenivOES(GLenum coord, GLenum pname, const GLint *params);
-void GLTrace_glTexGenxOES(GLenum coord, GLenum pname, GLfixed param);
-void GLTrace_glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params);
-void GLTrace_glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params);
-void GLTrace_glGetTexGenivOES(GLenum coord, GLenum pname, GLint *params);
-void GLTrace_glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params);
-void GLTrace_glClipPlanefIMG(GLenum p, const GLfloat *eqn);
-void GLTrace_glClipPlanexIMG(GLenum p, const GLfixed *eqn);
-
-}; // namespace gltrace
-}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_context.cpp b/opengl/libs/GLES_trace/src/gltrace_context.cpp
deleted file mode 100644
index 45dbb43..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_context.cpp
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#include <pthread.h>
-#include <cutils/log.h>
-
-extern "C" {
-#include "liblzf/lzf.h"
-}
-
-#include "gltrace_context.h"
-
-namespace android {
-namespace gltrace {
-
-using ::android::gl_hooks_t;
-
-static pthread_key_t sTLSKey = -1;
-static pthread_once_t sPthreadOnceKey = PTHREAD_ONCE_INIT;
-
-void createTLSKey() {
- pthread_key_create(&sTLSKey, NULL);
-}
-
-GLTraceContext *getGLTraceContext() {
- return (GLTraceContext*) pthread_getspecific(sTLSKey);
-}
-
-void setGLTraceContext(GLTraceContext *c) {
- pthread_setspecific(sTLSKey, c);
-}
-
-void setupTraceContextThreadSpecific(GLTraceContext *context) {
- pthread_once(&sPthreadOnceKey, createTLSKey);
- setGLTraceContext(context);
-}
-
-void releaseContext() {
- GLTraceContext *c = getGLTraceContext();
- if (c != NULL) {
- delete c;
- setGLTraceContext(NULL);
- }
-}
-
-GLTraceState::GLTraceState(TCPStream *stream) {
- mTraceContextIds = 0;
- mStream = stream;
-
- mCollectFbOnEglSwap = false;
- mCollectFbOnGlDraw = false;
- mCollectTextureDataOnGlTexImage = false;
- pthread_rwlock_init(&mTraceOptionsRwLock, NULL);
-}
-
-GLTraceState::~GLTraceState() {
- if (mStream) {
- mStream->closeStream();
- mStream = NULL;
- }
-}
-
-TCPStream *GLTraceState::getStream() {
- return mStream;
-}
-
-void GLTraceState::safeSetValue(bool *ptr, bool value, pthread_rwlock_t *lock) {
- pthread_rwlock_wrlock(lock);
- *ptr = value;
- pthread_rwlock_unlock(lock);
-}
-
-bool GLTraceState::safeGetValue(bool *ptr, pthread_rwlock_t *lock) {
- pthread_rwlock_rdlock(lock);
- bool value = *ptr;
- pthread_rwlock_unlock(lock);
- return value;
-}
-
-void GLTraceState::setCollectFbOnEglSwap(bool en) {
- safeSetValue(&mCollectFbOnEglSwap, en, &mTraceOptionsRwLock);
-}
-
-void GLTraceState::setCollectFbOnGlDraw(bool en) {
- safeSetValue(&mCollectFbOnGlDraw, en, &mTraceOptionsRwLock);
-}
-
-void GLTraceState::setCollectTextureDataOnGlTexImage(bool en) {
- safeSetValue(&mCollectTextureDataOnGlTexImage, en, &mTraceOptionsRwLock);
-}
-
-bool GLTraceState::shouldCollectFbOnEglSwap() {
- return safeGetValue(&mCollectFbOnEglSwap, &mTraceOptionsRwLock);
-}
-
-bool GLTraceState::shouldCollectFbOnGlDraw() {
- return safeGetValue(&mCollectFbOnGlDraw, &mTraceOptionsRwLock);
-}
-
-bool GLTraceState::shouldCollectTextureDataOnGlTexImage() {
- return safeGetValue(&mCollectTextureDataOnGlTexImage, &mTraceOptionsRwLock);
-}
-
-GLTraceContext *GLTraceState::createTraceContext(int version, EGLContext eglContext) {
- int id = __sync_fetch_and_add(&mTraceContextIds, 1);
-
- const size_t DEFAULT_BUFFER_SIZE = 8192;
- BufferedOutputStream *stream = new BufferedOutputStream(mStream, DEFAULT_BUFFER_SIZE);
- GLTraceContext *traceContext = new GLTraceContext(id, this, stream);
- mPerContextState[eglContext] = traceContext;
-
- return traceContext;
-}
-
-GLTraceContext *GLTraceState::getTraceContext(EGLContext c) {
- return mPerContextState[c];
-}
-
-GLTraceContext::GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream) :
- mId(id),
- mState(state),
- mBufferedOutputStream(stream),
- mElementArrayBuffers(DefaultKeyedVector<GLuint, ElementArrayBuffer*>(NULL))
-{
- fbcontents = fbcompressed = NULL;
- fbcontentsSize = 0;
-}
-
-int GLTraceContext::getId() {
- return mId;
-}
-
-GLTraceState *GLTraceContext::getGlobalTraceState() {
- return mState;
-}
-
-void GLTraceContext::resizeFBMemory(unsigned minSize) {
- if (fbcontentsSize >= minSize) {
- return;
- }
-
- if (fbcontents != NULL) {
- free(fbcontents);
- free(fbcompressed);
- }
-
- fbcontents = malloc(minSize);
- fbcompressed = malloc(minSize);
-
- fbcontentsSize = minSize;
-}
-
-/** obtain a pointer to the compressed framebuffer image */
-void GLTraceContext::getCompressedFB(void **fb, unsigned *fbsize, unsigned *fbwidth,
- unsigned *fbheight, FBBinding fbToRead) {
- int viewport[4] = {};
- hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
- unsigned fbContentsSize = viewport[2] * viewport[3] * 4;
-
- resizeFBMemory(fbContentsSize);
-
- // switch current framebuffer binding if necessary
- GLint currentFb = -1;
- bool fbSwitched = false;
- if (fbToRead != CURRENTLY_BOUND_FB) {
- hooks->gl.glGetIntegerv(GL_FRAMEBUFFER_BINDING, ¤tFb);
-
- if (currentFb != 0) {
- hooks->gl.glBindFramebuffer(GL_FRAMEBUFFER, 0);
- fbSwitched = true;
- }
- }
-
- hooks->gl.glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
- GL_RGBA, GL_UNSIGNED_BYTE, fbcontents);
-
- // switch back to previously bound buffer if necessary
- if (fbSwitched) {
- hooks->gl.glBindFramebuffer(GL_FRAMEBUFFER, currentFb);
- }
-
- *fbsize = lzf_compress(fbcontents, fbContentsSize, fbcompressed, fbContentsSize);
- *fb = fbcompressed;
- *fbwidth = viewport[2];
- *fbheight = viewport[3];
-}
-
-void GLTraceContext::traceGLMessage(GLMessage *msg) {
- mBufferedOutputStream->send(msg);
-
- GLMessage_Function func = msg->function();
- if (func == GLMessage::eglSwapBuffers
- || func == GLMessage::glDrawArrays
- || func == GLMessage::glDrawElements) {
- mBufferedOutputStream->flush();
- }
-}
-
-void GLTraceContext::bindBuffer(GLuint bufferId, GLvoid *data, GLsizeiptr size) {
- // free previously bound buffer if any
- ElementArrayBuffer *oldBuffer = mElementArrayBuffers.valueFor(bufferId);
- if (oldBuffer != NULL) {
- delete oldBuffer;
- }
-
- mElementArrayBuffers.add(bufferId, new ElementArrayBuffer(data, size));
-}
-
-void GLTraceContext::getBuffer(GLuint bufferId, GLvoid **data, GLsizeiptr *size) {
- ElementArrayBuffer *buffer = mElementArrayBuffers.valueFor(bufferId);
- if (buffer == NULL) {
- *data = NULL;
- *size = 0;
- } else {
- *data = buffer->getBuffer();
- *size = buffer->getSize();
- }
-}
-
-void GLTraceContext::updateBufferSubData(GLuint bufferId, GLintptr offset, GLvoid *data,
- GLsizeiptr size) {
- ElementArrayBuffer *buffer = mElementArrayBuffers.valueFor(bufferId);
- if (buffer != NULL) {
- buffer->updateSubBuffer(offset, data, size);
- }
-}
-
-void GLTraceContext::deleteBuffer(GLuint bufferId) {
- ElementArrayBuffer *buffer = mElementArrayBuffers.valueFor(bufferId);
- if (buffer != NULL) {
- delete buffer;
- mElementArrayBuffers.removeItem(bufferId);
- }
-}
-
-ElementArrayBuffer::ElementArrayBuffer(GLvoid *buf, GLsizeiptr size) {
- mBuf = malloc(size);
- mSize = size;
-
- if (buf != NULL) {
- memcpy(mBuf, buf, size);
- }
-}
-
-ElementArrayBuffer::~ElementArrayBuffer() {
- if (mBuf != NULL) {
- free(mBuf);
- mSize = 0;
- }
-
- mBuf = NULL;
-}
-
-void ElementArrayBuffer::updateSubBuffer(GLintptr offset, const GLvoid* data, GLsizeiptr size) {
- if (offset + size <= mSize) {
- memcpy((char*)mBuf + offset, data, size);
- }
-}
-
-GLvoid *ElementArrayBuffer::getBuffer() {
- return mBuf;
-}
-
-GLsizeiptr ElementArrayBuffer::getSize() {
- return mSize;
-}
-
-}; // namespace gltrace
-}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_context.h b/opengl/libs/GLES_trace/src/gltrace_context.h
deleted file mode 100644
index 323cfdc..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_context.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#ifndef __GLTRACE_CONTEXT_H_
-#define __GLTRACE_CONTEXT_H_
-
-#include <map>
-#include <pthread.h>
-#include <utils/KeyedVector.h>
-
-#include "hooks.h"
-#include "gltrace_transport.h"
-
-namespace android {
-namespace gltrace {
-
-using ::android::gl_hooks_t;
-
-enum FBBinding {CURRENTLY_BOUND_FB, FB0};
-
-class GLTraceState;
-
-class ElementArrayBuffer {
- GLvoid *mBuf;
- GLsizeiptr mSize;
-
-public:
- ElementArrayBuffer():mBuf(NULL), mSize(0) {}
- ElementArrayBuffer(GLvoid *buf, GLsizeiptr size);
- ~ElementArrayBuffer();
-
- void updateSubBuffer(GLintptr offset, const GLvoid* data, GLsizeiptr size);
- GLvoid *getBuffer();
- GLsizeiptr getSize();
-};
-
-/** GL Trace Context info associated with each EGLContext */
-class GLTraceContext {
- int mId; /* unique context id */
- GLTraceState *mState; /* parent GL Trace state (for per process GL Trace State Info) */
-
- void *fbcontents; /* memory area to read framebuffer contents */
- void *fbcompressed; /* destination for lzf compressed framebuffer */
- unsigned fbcontentsSize; /* size of fbcontents & fbcompressed buffers */
-
- BufferedOutputStream *mBufferedOutputStream; /* stream where trace info is sent */
-
- /* list of element array buffers in use. */
- DefaultKeyedVector<GLuint, ElementArrayBuffer*> mElementArrayBuffers;
-
- void resizeFBMemory(unsigned minSize);
-public:
- gl_hooks_t *hooks;
-
- GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream);
- int getId();
- GLTraceState *getGlobalTraceState();
- void getCompressedFB(void **fb, unsigned *fbsize,
- unsigned *fbwidth, unsigned *fbheight,
- FBBinding fbToRead);
-
- // Methods to work with element array buffers
- void bindBuffer(GLuint bufferId, GLvoid *data, GLsizeiptr size);
- void getBuffer(GLuint bufferId, GLvoid **data, GLsizeiptr *size);
- void updateBufferSubData(GLuint bufferId, GLintptr offset, GLvoid *data, GLsizeiptr size);
- void deleteBuffer(GLuint bufferId);
-
- void traceGLMessage(GLMessage *msg);
-};
-
-/** Per process trace state. */
-class GLTraceState {
- int mTraceContextIds;
- TCPStream *mStream;
- std::map<EGLContext, GLTraceContext*> mPerContextState;
-
- /* Options controlling additional data to be collected on
- certain trace calls. */
- bool mCollectFbOnEglSwap;
- bool mCollectFbOnGlDraw;
- bool mCollectTextureDataOnGlTexImage;
- pthread_rwlock_t mTraceOptionsRwLock;
-
- /* helper methods to get/set values using provided lock for mutual exclusion. */
- void safeSetValue(bool *ptr, bool value, pthread_rwlock_t *lock);
- bool safeGetValue(bool *ptr, pthread_rwlock_t *lock);
-public:
- GLTraceState(TCPStream *stream);
- ~GLTraceState();
-
- GLTraceContext *createTraceContext(int version, EGLContext c);
- GLTraceContext *getTraceContext(EGLContext c);
-
- TCPStream *getStream();
-
- /* Methods to set trace options. */
- void setCollectFbOnEglSwap(bool en);
- void setCollectFbOnGlDraw(bool en);
- void setCollectTextureDataOnGlTexImage(bool en);
-
- /* Methods to retrieve trace options. */
- bool shouldCollectFbOnEglSwap();
- bool shouldCollectFbOnGlDraw();
- bool shouldCollectTextureDataOnGlTexImage();
-};
-
-void setupTraceContextThreadSpecific(GLTraceContext *context);
-GLTraceContext *getGLTraceContext();
-void releaseContext();
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.cpp b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
deleted file mode 100644
index 9d1682a..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_egl.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#include <cutils/log.h>
-#include <utils/Timers.h>
-
-#include "gltrace.pb.h"
-#include "gltrace_context.h"
-#include "gltrace_fixup.h"
-#include "gltrace_transport.h"
-
-namespace android {
-namespace gltrace {
-
-void GLTrace_eglCreateContext(int version, int contextId) {
- GLMessage glmessage;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmessage.set_context_id(contextId);
- glmessage.set_function(GLMessage::eglCreateContext);
-
- // copy argument version
- GLMessage_DataType *arg_version = glmessage.add_args();
- arg_version->set_isarray(false);
- arg_version->set_type(GLMessage::DataType::INT);
- arg_version->add_intvalue(version);
-
- // copy argument context
- GLMessage_DataType *arg_context = glmessage.add_args();
- arg_context->set_isarray(false);
- arg_context->set_type(GLMessage::DataType::INT);
- arg_context->add_intvalue(contextId);
-
- // set start time and duration
- glmessage.set_start_time(systemTime());
- glmessage.set_duration(0);
-
- glContext->traceGLMessage(&glmessage);
-}
-
-void GLTrace_eglMakeCurrent(int contextId) {
- GLMessage glmessage;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmessage.set_context_id(contextId);
- glmessage.set_function(GLMessage::eglMakeCurrent);
-
- // copy argument context
- GLMessage_DataType *arg_context = glmessage.add_args();
- arg_context->set_isarray(false);
- arg_context->set_type(GLMessage::DataType::INT);
- arg_context->add_intvalue(contextId);
-
- // set start time and duration
- glmessage.set_start_time(systemTime());
- glmessage.set_duration(0);
-
- glContext->traceGLMessage(&glmessage);
-}
-
-void GLTrace_eglSwapBuffers(void *dpy, void *draw) {
- GLMessage glmessage;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmessage.set_context_id(glContext->getId());
- glmessage.set_function(GLMessage::eglSwapBuffers);
-
- if (glContext->getGlobalTraceState()->shouldCollectFbOnEglSwap()) {
- // read FB0 since that is what is displayed on the screen
- fixup_addFBContents(glContext, &glmessage, FB0);
- }
-
- // set start time and duration
- glmessage.set_start_time(systemTime());
- glmessage.set_duration(0);
-
- glContext->traceGLMessage(&glmessage);
-}
-
-};
-};
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.h b/opengl/libs/GLES_trace/src/gltrace_egl.h
deleted file mode 100644
index f4684c5..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_egl.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#ifndef __GLTRACE_EGL_H_
-#define __GLTRACE_EGL_H_
-
-namespace android {
-namespace gltrace {
-
-void GLTrace_eglCreateContext(int version, int contextId);
-void GLTrace_eglMakeCurrent(int contextId);
-void GLTrace_eglSwapBuffers(void *dpy, void *draw);
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp b/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp
deleted file mode 100644
index c442153..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#include <arpa/inet.h>
-#include <stdlib.h>
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-#include "hooks.h"
-#include "glestrace.h"
-
-#include "gltrace_context.h"
-#include "gltrace_egl.h"
-#include "gltrace_hooks.h"
-#include "gltrace_transport.h"
-
-namespace android {
-
-using gltrace::GLTraceState;
-using gltrace::GLTraceContext;
-using gltrace::TCPStream;
-
-static GLTraceState *sGLTraceState;
-static pthread_t sReceiveThreadId;
-
-/**
- * Task that monitors the control stream from the host and updates
- * the trace status according to commands received from the host.
- */
-static void *commandReceiveTask(void *arg) {
- GLTraceState *state = (GLTraceState *)arg;
- TCPStream *stream = state->getStream();
-
- // Currently, there are very few user configurable settings.
- // As a result, they can be encoded in a single integer.
- int cmd;
- enum TraceSettingsMasks {
- READ_FB_ON_EGLSWAP_MASK = 1 << 0,
- READ_FB_ON_GLDRAW_MASK = 1 << 1,
- READ_TEXTURE_DATA_ON_GLTEXIMAGE_MASK = 1 << 2,
- };
-
- while (true) {
- int n = stream->receive(&cmd, 4);
- if (n != 4) {
- break;
- }
-
- cmd = ntohl(cmd);
-
- bool collectFbOnEglSwap = (cmd & READ_FB_ON_EGLSWAP_MASK) != 0;
- bool collectFbOnGlDraw = (cmd & READ_FB_ON_GLDRAW_MASK) != 0;
- bool collectTextureData = (cmd & READ_TEXTURE_DATA_ON_GLTEXIMAGE_MASK) != 0;
-
- state->setCollectFbOnEglSwap(collectFbOnEglSwap);
- state->setCollectFbOnGlDraw(collectFbOnGlDraw);
- state->setCollectTextureDataOnGlTexImage(collectTextureData);
-
- ALOGD("trace options: eglswap: %d, gldraw: %d, texImage: %d",
- collectFbOnEglSwap, collectFbOnGlDraw, collectTextureData);
- }
-
- return NULL;
-}
-
-void GLTrace_start() {
- char udsName[PROPERTY_VALUE_MAX];
-
- property_get("debug.egl.debug_portname", udsName, "gltrace");
- int clientSocket = gltrace::acceptClientConnection(udsName);
- if (clientSocket < 0) {
- ALOGE("Error creating GLTrace server socket. Quitting application.");
- exit(-1);
- }
-
- // create communication channel to the host
- TCPStream *stream = new TCPStream(clientSocket);
-
- // initialize tracing state
- sGLTraceState = new GLTraceState(stream);
-
- pthread_create(&sReceiveThreadId, NULL, commandReceiveTask, sGLTraceState);
-}
-
-void GLTrace_stop() {
- delete sGLTraceState;
- sGLTraceState = NULL;
-}
-
-void GLTrace_eglCreateContext(int version, EGLContext c) {
- // update trace state for new EGL context
- GLTraceContext *traceContext = sGLTraceState->createTraceContext(version, c);
- gltrace::setupTraceContextThreadSpecific(traceContext);
-
- // trace command through to the host
- gltrace::GLTrace_eglCreateContext(version, traceContext->getId());
-}
-
-void GLTrace_eglMakeCurrent(const unsigned version, gl_hooks_t *hooks, EGLContext c) {
- // setup per context state
- GLTraceContext *traceContext = sGLTraceState->getTraceContext(c);
- traceContext->hooks = hooks;
- gltrace::setupTraceContextThreadSpecific(traceContext);
-
- // trace command through to the host
- gltrace::GLTrace_eglMakeCurrent(traceContext->getId());
-}
-
-void GLTrace_eglReleaseThread() {
- gltrace::releaseContext();
-}
-
-void GLTrace_eglSwapBuffers(void *dpy, void *draw) {
- gltrace::GLTrace_eglSwapBuffers(dpy, draw);
-}
-
-gl_hooks_t *GLTrace_getGLHooks() {
- return gltrace::getGLHooks();
-}
-
-}
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
deleted file mode 100644
index 3597b26..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
+++ /dev/null
@@ -1,834 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#include <cutils/log.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include "gltrace.pb.h"
-#include "gltrace_api.h"
-#include "gltrace_context.h"
-#include "gltrace_fixup.h"
-
-namespace android {
-namespace gltrace {
-
-unsigned getBytesPerTexel(const GLenum format, const GLenum type) {
- /*
- Description from glTexImage2D spec:
-
- Data is read from data as a sequence of unsigned bytes or shorts, depending on type.
- When type is GL_UNSIGNED_BYTE, each of the bytes is interpreted as one color component.
- When type is one of GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4, or
- GL_UNSIGNED_SHORT_5_5_5_1, each unsigned short value is interpreted as containing all
- the components for a single texel, with the color components arranged according to
- format. Color components are treated as groups of one, two, three, or four values,
- again based on format. Groups of components are referred to as texels.
-
- width × height texels are read from memory, starting at location data. By default,
- these texels are taken from adjacent memory locations, except that after all width
- texels are read, the read pointer is advanced to the next four-byte boundary.
- The four-byte row alignment is specified by glPixelStorei with argument
- GL_UNPACK_ALIGNMENT, and it can be set to one, two, four, or eight bytes.
- */
-
- switch (type) {
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- return 2;
- case GL_UNSIGNED_BYTE:
- break;
- default:
- ALOGE("GetBytesPerPixel: unknown type %x", type);
- }
-
- switch (format) {
- case GL_ALPHA:
- case GL_LUMINANCE:
- return 1;
- case GL_LUMINANCE_ALPHA:
- return 2;
- case GL_RGB:
- return 3;
- case GL_RGBA:
- case 0x80E1: // GL_BGRA_EXT
- return 4;
- default:
- ALOGE("GetBytesPerPixel: unknown format %x", format);
- }
-
- return 1; // in doubt...
-}
-
-void fixup_GenericFloatArray(int argIndex, int nFloats, GLMessage *glmsg, void *src) {
- GLMessage_DataType *arg_floatarray = glmsg->mutable_args(argIndex);
- GLfloat *floatp = (GLfloat *)src;
-
- if (floatp == NULL) {
- return;
- }
-
- arg_floatarray->set_type(GLMessage::DataType::FLOAT);
- arg_floatarray->set_isarray(true);
- arg_floatarray->clear_floatvalue();
-
- for (int i = 0; i < nFloats; i++, floatp++) {
- arg_floatarray->add_floatvalue(*floatp);
- }
-}
-
-void fixup_GenericIntArray(int argIndex, int nInts, GLMessage *glmsg, void *src) {
- GLMessage_DataType *arg_intarray = glmsg->mutable_args(argIndex);
- GLint *intp = (GLint *)src;
-
- if (intp == NULL) {
- return;
- }
-
- arg_intarray->set_type(GLMessage::DataType::INT);
- arg_intarray->set_isarray(true);
- arg_intarray->clear_intvalue();
-
- for (int i = 0; i < nInts; i++, intp++) {
- arg_intarray->add_intvalue(*intp);
- }
-}
-
-void fixup_GenericEnumArray(int argIndex, int nEnums, GLMessage *glmsg, void *src) {
- // fixup as if they were ints
- fixup_GenericIntArray(argIndex, nEnums, glmsg, src);
-
- // and then set the data type to be enum
- GLMessage_DataType *arg_enumarray = glmsg->mutable_args(argIndex);
- arg_enumarray->set_type(GLMessage::DataType::ENUM);
-}
-
-/** Generic helper function: extract pointer at argIndex and
- replace it with the C style string at *pointer */
-void fixup_CStringPtr(int argIndex, GLMessage *glmsg, void *src) {
- GLMessage_DataType *arg = glmsg->mutable_args(argIndex);
- GLchar *ptr = (GLchar *) src;
-
- arg->set_type(GLMessage::DataType::CHAR);
- arg->set_isarray(true);
- arg->add_charvalue(ptr);
-}
-
-void fixup_glGetString(GLMessage *glmsg, void *pointersToFixup[]) {
- /* const GLubyte* GLTrace_glGetString(GLenum name) */
- GLMessage_DataType *ret = glmsg->mutable_returnvalue();
- GLchar *ptr = (GLchar *) pointersToFixup[0];
-
- if (ptr != NULL) {
- ret->set_type(GLMessage::DataType::CHAR);
- ret->set_isarray(true);
- ret->add_charvalue(ptr);
- }
-}
-
-/* Add the contents of the framebuffer to the protobuf message */
-void fixup_addFBContents(GLTraceContext *context, GLMessage *glmsg, FBBinding fbToRead) {
- void *fbcontents;
- unsigned fbsize, fbwidth, fbheight;
- context->getCompressedFB(&fbcontents, &fbsize, &fbwidth, &fbheight, fbToRead);
-
- GLMessage_FrameBuffer *fb = glmsg->mutable_fb();
- fb->set_width(fbwidth);
- fb->set_height(fbheight);
- fb->add_contents(fbcontents, fbsize);
-}
-
-/** Common fixup routing for glTexImage2D & glTexSubImage2D. */
-void fixup_glTexImage(int widthIndex, int heightIndex, GLMessage *glmsg, void *dataSrc) {
- GLMessage_DataType arg_width = glmsg->args(widthIndex);
- GLMessage_DataType arg_height = glmsg->args(heightIndex);
-
- GLMessage_DataType arg_format = glmsg->args(6);
- GLMessage_DataType arg_type = glmsg->args(7);
- GLMessage_DataType *arg_data = glmsg->mutable_args(8);
-
- GLsizei width = arg_width.intvalue(0);
- GLsizei height = arg_height.intvalue(0);
- GLenum format = arg_format.intvalue(0);
- GLenum type = arg_type.intvalue(0);
- void *data = (void *) dataSrc;
-
- int bytesPerTexel = getBytesPerTexel(format, type);
-
- arg_data->set_type(GLMessage::DataType::BYTE);
- arg_data->clear_rawbytes();
-
- if (data != NULL) {
- arg_data->set_isarray(true);
- arg_data->add_rawbytes(data, bytesPerTexel * width * height);
- } else {
- arg_data->set_isarray(false);
- arg_data->set_type(GLMessage::DataType::VOID);
- }
-}
-
-
-void fixup_glTexImage2D(GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glTexImage2D(GLenum target,
- GLint level,
- GLint internalformat,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *data);
- */
- int widthIndex = 3;
- int heightIndex = 4;
- fixup_glTexImage(widthIndex, heightIndex, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glTexSubImage2D(GLMessage *glmsg, void *pointersToFixup[]) {
- /*
- void glTexSubImage2D(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const GLvoid * data);
- */
- int widthIndex = 4;
- int heightIndex = 5;
- fixup_glTexImage(widthIndex, heightIndex, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glShaderSource(GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glShaderSource(GLuint shader, GLsizei count, const GLchar** string,
- const GLint* length) */
- GLMessage_DataType arg_count = glmsg->args(1);
- GLMessage_DataType arg_lenp = glmsg->args(3);
- GLMessage_DataType *arg_strpp = glmsg->mutable_args(2);
-
- GLsizei count = arg_count.intvalue(0);
- GLchar **stringpp = (GLchar **) pointersToFixup[0];
- GLint *lengthp = (GLint *) pointersToFixup[1];
-
- arg_strpp->set_type(GLMessage::DataType::CHAR);
- arg_strpp->set_isarray(true);
- arg_strpp->clear_charvalue();
-
- ::std::string src = "";
- for (int i = 0; i < count; i++) {
- if (lengthp != NULL)
- src.append(*stringpp, *lengthp);
- else
- src.append(*stringpp); // assume null terminated
- stringpp++;
- lengthp++;
- }
-
- arg_strpp->add_charvalue(src);
-}
-
-void fixup_glUniformGenericInteger(int argIndex, int nIntegers, GLMessage *glmsg,
- void *pointersToFixup[]) {
- /* void glUniform?iv(GLint location, GLsizei count, const GLint *value); */
- fixup_GenericIntArray(argIndex, nIntegers, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glUniformGeneric(int argIndex, int nFloats, GLMessage *glmsg, void *src) {
- fixup_GenericFloatArray(argIndex, nFloats, glmsg, src);
-}
-
-void fixup_glUniformMatrixGeneric(int matrixSize, GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glUniformMatrix?fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat* value) */
- GLMessage_DataType arg_count = glmsg->args(1);
- int n_matrices = arg_count.intvalue(0);
- fixup_glUniformGeneric(3, matrixSize * matrixSize * n_matrices, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glGenGeneric(GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glGen*(GLsizei n, GLuint * buffers); */
- GLMessage_DataType arg_n = glmsg->args(0);
- GLsizei n = arg_n.intvalue(0);
-
- fixup_GenericIntArray(1, n, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glDeleteGeneric(GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glDelete*(GLsizei n, GLuint *buffers); */
- GLMessage_DataType arg_n = glmsg->args(0);
- GLsizei n = arg_n.intvalue(0);
-
- fixup_GenericIntArray(1, n, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glGetBooleanv(GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glGetBooleanv(GLenum pname, GLboolean *params); */
- GLMessage_DataType *arg_params = glmsg->mutable_args(1);
- GLboolean *src = (GLboolean*) pointersToFixup[0];
-
- arg_params->set_type(GLMessage::DataType::BOOL);
- arg_params->set_isarray(true);
- arg_params->clear_boolvalue();
- arg_params->add_boolvalue(*src);
-}
-
-void fixup_glGetFloatv(GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glGetFloatv(GLenum pname, GLfloat *params); */
- GLMessage_DataType *arg_params = glmsg->mutable_args(1);
- GLfloat *src = (GLfloat*) pointersToFixup[0];
-
- arg_params->set_type(GLMessage::DataType::FLOAT);
- arg_params->set_isarray(true);
- arg_params->clear_floatvalue();
- arg_params->add_floatvalue(*src);
-}
-
-void fixup_glLinkProgram(GLMessage *glmsg) {
- /* void glLinkProgram(GLuint program); */
- GLuint program = glmsg->args(0).intvalue(0);
-
- /* We don't have to fixup this call, but as soon as a program is linked,
- we obtain information about all active attributes and uniforms to
- pass on to the debugger. Note that in order to pass this info to
- the debugger, all we need to do is call the trace versions of the
- necessary calls. */
-
- GLint n, maxNameLength;
- GLchar *name;
- GLint size;
- GLenum type;
-
- // obtain info regarding active attributes
- GLTrace_glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &n);
- GLTrace_glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxNameLength);
-
- name = (GLchar *) malloc(maxNameLength);
- for (int i = 0; i < n; i++) {
- GLTrace_glGetActiveAttrib(program, i, maxNameLength, NULL, &size, &type, name);
- }
- free(name);
-
- // obtain info regarding active uniforms
- GLTrace_glGetProgramiv(program, GL_ACTIVE_UNIFORMS, &n);
- GLTrace_glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxNameLength);
-
- name = (GLchar *) malloc(maxNameLength);
- for (int i = 0; i < n; i++) {
- GLTrace_glGetActiveUniform(program, i, maxNameLength, NULL, &size, &type, name);
- }
- free(name);
-}
-
-/** Given a glGetActive[Uniform|Attrib] call, obtain the location
- * of the variable of given name in the call.
- */
-int getShaderVariableLocation(GLTraceContext *context, GLMessage *glmsg, GLchar *name) {
- GLMessage_Function func = glmsg->function();
- if (func != GLMessage::glGetActiveAttrib && func != GLMessage::glGetActiveUniform) {
- return -1;
- }
-
- int program = glmsg->args(0).intvalue(0);
-
- if (func == GLMessage::glGetActiveAttrib) {
- return context->hooks->gl.glGetAttribLocation(program, name);
- } else {
- return context->hooks->gl.glGetUniformLocation(program, name);
- }
-}
-
-void fixup_glGetActiveAttribOrUniform(GLTraceContext *context, GLMessage *glmsg,
- void *pointersToFixup[]) {
- /* void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize,
- GLsizei* length, GLint* size, GLenum* type, GLchar* name); */
- /* void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize,
- GLsizei* length, GLint* size, GLenum* type, GLchar* name) */
-
- fixup_GenericIntArray(3, 1, glmsg, pointersToFixup[0]); // length
- fixup_GenericIntArray(4, 1, glmsg, pointersToFixup[1]); // size
- fixup_GenericEnumArray(5, 1, glmsg, pointersToFixup[2]); // type
- fixup_CStringPtr(6, glmsg, pointersToFixup[3]); // name
-
- // The index argument in the glGetActive[Attrib|Uniform] functions
- // does not correspond to the actual location index as used in
- // glUniform*() or glVertexAttrib*() to actually upload the data.
- // In order to make things simpler for the debugger, we also pass
- // a hidden location argument that stores the actual location.
- // append the location value to the end of the argument list
- int location = getShaderVariableLocation(context, glmsg, (GLchar*)pointersToFixup[3]);
- GLMessage_DataType *arg_location = glmsg->add_args();
- arg_location->set_isarray(false);
- arg_location->set_type(GLMessage::DataType::INT);
- arg_location->add_intvalue(location);
-}
-
-GLint glGetInteger(GLTraceContext *context, GLenum param) {
- GLint x;
- context->hooks->gl.glGetIntegerv(param, &x);
- return x;
-}
-
-GLint glGetVertexAttrib(GLTraceContext *context, GLuint index, GLenum pname) {
- GLint x;
- context->hooks->gl.glGetVertexAttribiv(index, pname, &x);
- return x;
-}
-
-bool isUsingArrayBuffers(GLTraceContext *context) {
- return glGetInteger(context, GL_ARRAY_BUFFER_BINDING) != 0;
-}
-
-bool isUsingElementArrayBuffers(GLTraceContext *context) {
- return glGetInteger(context, GL_ELEMENT_ARRAY_BUFFER_BINDING) != 0;
-}
-
-/** Copy @len bytes of data from @src into the @dataIndex'th argument of the message. */
-void addGlBufferData(GLMessage *glmsg, int dataIndex, GLvoid *src, GLsizeiptr len) {
- GLMessage_DataType *arg_datap = glmsg->mutable_args(dataIndex);
- arg_datap->set_type(GLMessage::DataType::VOID);
- arg_datap->set_isarray(true);
- arg_datap->clear_intvalue();
- arg_datap->add_rawbytes(src, len);
-}
-
-void fixup_glBufferData(GLTraceContext *context, GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) */
- GLsizeiptr size = glmsg->args(1).intvalue(0);
- GLvoid *datap = (GLvoid *) pointersToFixup[0];
-
- // Save element array buffers for future use to fixup glVertexAttribPointers
- // when a glDrawElements() call is performed.
- GLenum target = glmsg->args(0).intvalue(0);
- if (target == GL_ELEMENT_ARRAY_BUFFER) {
- GLint bufferId = glGetInteger(context, GL_ELEMENT_ARRAY_BUFFER_BINDING);
- context->bindBuffer(bufferId, datap, size);
- }
-
- // add buffer data to the protobuf message
- if (datap != NULL) {
- addGlBufferData(glmsg, 2, datap, size);
- }
-}
-
-void fixup_glBufferSubData(GLTraceContext *context, GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) */
- GLenum target = glmsg->args(0).intvalue(0);
- GLintptr offset = glmsg->args(1).intvalue(0);
- GLsizeiptr size = glmsg->args(2).intvalue(0);
- GLvoid *datap = (GLvoid *) pointersToFixup[0];
- if (target == GL_ELEMENT_ARRAY_BUFFER) {
- GLint bufferId = glGetInteger(context, GL_ELEMENT_ARRAY_BUFFER_BINDING);
- context->updateBufferSubData(bufferId, offset, datap, size);
- }
-
- // add buffer data to the protobuf message
- addGlBufferData(glmsg, 3, datap, size);
-}
-
-/** Obtain the size of each vertex attribute. */
-int vertexAttribSize(GLenum type, GLsizei numComponents) {
- int sizePerComponent;
-
- switch(type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- sizePerComponent = 1;
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- sizePerComponent = 2;
- break;
- case GL_FIXED:
- case GL_FLOAT:
- default:
- sizePerComponent = 4;
- break;
- }
-
- return sizePerComponent * numComponents;
-}
-
-/** Create and send a glVertexAttribPointerData trace message to the host. */
-void trace_glVertexAttribPointerData(GLTraceContext *context,
- GLuint indx, GLint size, GLenum type,
- GLboolean normalized, GLsizei stride, const GLvoid* ptr,
- GLuint minIndex, GLuint maxIndex, nsecs_t startTime) {
- /* void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type,
- GLboolean normalized, GLsizei stride, const GLvoid* ptr,
- int minIndex, int maxIndex) */
- GLMessage glmsg;
- GLTraceContext *glContext = context;
-
- glmsg.set_function(GLMessage::glVertexAttribPointerData);
-
- // copy argument indx
- GLMessage_DataType *arg_indx = glmsg.add_args();
- arg_indx->set_isarray(false);
- arg_indx->set_type(GLMessage::DataType::INT);
- arg_indx->add_intvalue(indx);
-
- // copy argument size
- GLMessage_DataType *arg_size = glmsg.add_args();
- arg_size->set_isarray(false);
- arg_size->set_type(GLMessage::DataType::INT);
- arg_size->add_intvalue(size);
-
- // copy argument type
- GLMessage_DataType *arg_type = glmsg.add_args();
- arg_type->set_isarray(false);
- arg_type->set_type(GLMessage::DataType::ENUM);
- arg_type->add_intvalue((int)type);
-
- // copy argument normalized
- GLMessage_DataType *arg_normalized = glmsg.add_args();
- arg_normalized->set_isarray(false);
- arg_normalized->set_type(GLMessage::DataType::BOOL);
- arg_normalized->add_boolvalue(normalized);
-
- // copy argument stride
- GLMessage_DataType *arg_stride = glmsg.add_args();
- arg_stride->set_isarray(false);
- arg_stride->set_type(GLMessage::DataType::INT);
- arg_stride->add_intvalue(stride);
-
- // copy argument ptr
- GLMessage_DataType *arg_ptr = glmsg.add_args();
- arg_ptr->set_isarray(true);
- arg_ptr->set_type(GLMessage::DataType::BYTE);
- int perVertexSize = vertexAttribSize(type, size);
- GLchar *p = (GLchar*) ptr;
- std::string data;
- for (GLuint i = minIndex; i < maxIndex; i++) {
- data.append(p, perVertexSize);
- p += stride == 0 ? perVertexSize : stride;
- }
- arg_ptr->add_rawbytes(data);
-
- // copy argument min index
- GLMessage_DataType *arg_min = glmsg.add_args();
- arg_min->set_isarray(false);
- arg_min->set_type(GLMessage::DataType::INT);
- arg_min->add_intvalue(minIndex);
-
- // copy argument max index
- GLMessage_DataType *arg_max = glmsg.add_args();
- arg_max->set_isarray(false);
- arg_max->set_type(GLMessage::DataType::INT);
- arg_max->add_intvalue(maxIndex);
-
- glmsg.set_context_id(context->getId());
- glmsg.set_start_time(startTime);
- glmsg.set_threadtime(0);
- glmsg.set_duration(0);
-
- context->traceGLMessage(&glmsg);
-}
-
-void findMinAndMaxIndices(GLvoid *indices, GLsizei count, GLenum type,
- GLuint *minIndex, GLuint *maxIndex) {
- GLuint index;
- *minIndex = UINT_MAX;
- *maxIndex = 0;
-
- if (indices == NULL) {
- return;
- }
-
- for (GLsizei i = 0; i < count; i++) {
- if (type == GL_UNSIGNED_BYTE) {
- index = *((GLubyte*) indices + i);
- } else {
- index = *((GLushort*) indices + i);
- }
-
- if (index < *minIndex) *minIndex = index;
- if (index > *maxIndex) *maxIndex = index;
- }
-}
-
-void trace_VertexAttribPointerData(GLTraceContext *context,
- GLuint minIndex, GLuint maxIndex, nsecs_t time) {
- GLuint maxAttribs = glGetInteger(context, GL_MAX_VERTEX_ATTRIBS);
- for (GLuint index = 0; index < maxAttribs; index++) {
- if (!glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_ENABLED)) {
- // vertex array disabled
- continue;
- }
-
- if (glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)) {
- // vbo
- continue;
- }
-
- GLint size = glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_SIZE);
- GLenum type = glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_TYPE);
- GLboolean norm = glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED);
- GLsizei stride = glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_STRIDE);
- GLvoid* ptr;
- context->hooks->gl.glGetVertexAttribPointerv(index, GL_VERTEX_ATTRIB_ARRAY_POINTER, &ptr);
-
- trace_glVertexAttribPointerData(context,
- index, size, type, norm, stride, ptr,
- minIndex, maxIndex, time);
- }
-}
-
-void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMessage *glmsg) {
- /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */
- GLsizei count = glmsg->args(2).intvalue(0);
-
- // Vertex attrib pointer data patchup calls should appear as if
- // they occurred right before the draw call.
- nsecs_t time = glmsg->start_time() - 1;
-
- trace_VertexAttribPointerData(context, 0, count, time);
-}
-
-void trace_VertexAttribPointerDataForGlDrawElements(GLTraceContext *context, GLMessage *glmsg,
- GLvoid *indices) {
- /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */
- GLsizei count = glmsg->args(1).intvalue(0);
- GLenum type = glmsg->args(2).intvalue(0);
- GLuint index;
-
- GLuint minIndex, maxIndex;
-
- // The index buffer is either passed in as an argument to the glDrawElements() call,
- // or it is stored in the current GL_ELEMENT_ARRAY_BUFFER.
- GLvoid *indexBuffer;
- if (isUsingElementArrayBuffers(context)) {
- GLsizeiptr eaBufferSize;
- GLuint bufferId = glGetInteger(context, GL_ELEMENT_ARRAY_BUFFER_BINDING);
- context->getBuffer(bufferId, &indexBuffer, &eaBufferSize);
- } else {
- indexBuffer = indices;
- }
-
- // Rather than sending vertex attribute data that corresponds to the indices
- // being drawn, we send the vertex attribute data for the entire range of
- // indices being drawn, including the ones not drawn. The min & max indices
- // provide the range of indices being drawn.
- findMinAndMaxIndices(indexBuffer, count, type, &minIndex, &maxIndex);
-
- // Vertex attrib pointer data patchup calls should appear as if
- // they occurred right before the draw call.
- nsecs_t time = glmsg->start_time() - 1;
-
- trace_VertexAttribPointerData(context, minIndex, maxIndex + 1, time);
-}
-
-void fixup_glDrawArrays(GLTraceContext *context, GLMessage *glmsg) {
- // Trace all vertex attribute data stored in client space.
- trace_VertexAttribPointerDataForGlDrawArrays(context, glmsg);
-
- // Attach the FB if requested
- if (context->getGlobalTraceState()->shouldCollectFbOnGlDraw()) {
- fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
- }
-}
-
-void fixup_glDrawElements(GLTraceContext *context, GLMessage *glmsg, void *pointersToFixup[]) {
- /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */
- GLvoid *indices = pointersToFixup[0];
- GLenum type = glmsg->args(2).intvalue(0);
- GLsizei count = glmsg->args(1).intvalue(0);
- GLuint index;
-
- // Trace all vertex attribute data stored in client space.
- trace_VertexAttribPointerDataForGlDrawElements(context, glmsg, indices);
-
- // Fixup indices argument
- if (!isUsingElementArrayBuffers(context)) {
- GLMessage_DataType *arg_indices = glmsg->mutable_args(3);
- arg_indices->set_isarray(true);
- arg_indices->clear_intvalue();
- arg_indices->set_type(GLMessage::DataType::INT);
- for (GLsizei i = 0; i < count; i++) {
- if (type == GL_UNSIGNED_BYTE) {
- index = *((GLubyte*) indices + i);
- } else {
- index = *((GLushort*) indices + i);
- }
- arg_indices->add_intvalue(index);
- }
- }
-
- // Attach the FB if requested
- if (context->getGlobalTraceState()->shouldCollectFbOnGlDraw()) {
- fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
- }
-}
-
-void fixupGLMessage(GLTraceContext *context, nsecs_t wallStart, nsecs_t wallEnd,
- nsecs_t threadStart, nsecs_t threadEnd,
- GLMessage *glmsg, void *pointersToFixup[]) {
- // for all messages, set the current context id
- glmsg->set_context_id(context->getId());
-
- // set start time and duration
- glmsg->set_start_time(wallStart);
- glmsg->set_duration((unsigned)(wallEnd - wallStart));
- glmsg->set_threadtime((unsigned)(threadEnd - threadStart));
-
- // do any custom message dependent processing
- switch (glmsg->function()) {
- case GLMessage::glDeleteBuffers: /* glDeleteBuffers(GLsizei n, GLuint *buffers); */
- case GLMessage::glDeleteFramebuffers: /* glDeleteFramebuffers(GLsizei n, GLuint *buffers); */
- case GLMessage::glDeleteRenderbuffers:/* glDeleteRenderbuffers(GLsizei n, GLuint *buffers); */
- case GLMessage::glDeleteTextures: /* glDeleteTextures(GLsizei n, GLuint *textures); */
- fixup_glDeleteGeneric(glmsg, pointersToFixup);
- break;
- case GLMessage::glGenBuffers: /* void glGenBuffers(GLsizei n, GLuint *buffers); */
- case GLMessage::glGenFramebuffers: /* void glGenFramebuffers(GLsizei n, GLuint *buffers); */
- case GLMessage::glGenRenderbuffers: /* void glGenFramebuffers(GLsizei n, GLuint *buffers); */
- case GLMessage::glGenTextures: /* void glGenTextures(GLsizei n, GLuint *textures); */
- fixup_glGenGeneric(glmsg, pointersToFixup);
- break;
- case GLMessage::glLinkProgram: /* void glLinkProgram(GLuint program); */
- fixup_glLinkProgram(glmsg);
- break;
- case GLMessage::glGetActiveAttrib:
- fixup_glGetActiveAttribOrUniform(context, glmsg, pointersToFixup);
- break;
- case GLMessage::glGetActiveUniform:
- fixup_glGetActiveAttribOrUniform(context, glmsg, pointersToFixup);
- break;
- case GLMessage::glBindAttribLocation:
- /* void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name); */
- fixup_CStringPtr(2, glmsg, pointersToFixup[0]);
- break;
- case GLMessage::glGetAttribLocation:
- case GLMessage::glGetUniformLocation:
- /* int glGetAttribLocation(GLuint program, const GLchar* name) */
- /* int glGetUniformLocation(GLuint program, const GLchar* name) */
- fixup_CStringPtr(1, glmsg, pointersToFixup[0]);
- break;
- case GLMessage::glGetBooleanv:
- fixup_glGetBooleanv(glmsg, pointersToFixup);
- break;
- case GLMessage::glGetFloatv:
- fixup_glGetFloatv(glmsg, pointersToFixup);
- break;
- case GLMessage::glGetIntegerv: /* void glGetIntegerv(GLenum pname, GLint *params); */
- fixup_GenericIntArray(1, 1, glmsg, pointersToFixup[0]);
- break;
- case GLMessage::glGetProgramiv:
- case GLMessage::glGetRenderbufferParameteriv:
- case GLMessage::glGetShaderiv:
- /* void glGetProgramiv(GLuint program, GLenum pname, GLint* params) */
- /* void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) */
- /* void glGetShaderiv(GLuint shader, GLenum pname, GLint* params) */
- fixup_GenericIntArray(2, 1, glmsg, pointersToFixup[0]);
- break;
- case GLMessage::glGetString:
- fixup_glGetString(glmsg, pointersToFixup);
- break;
- case GLMessage::glTexImage2D:
- if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
- fixup_glTexImage2D(glmsg, pointersToFixup);
- }
- break;
- case GLMessage::glTexSubImage2D:
- if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
- fixup_glTexSubImage2D(glmsg, pointersToFixup);
- }
- break;
- case GLMessage::glShaderSource:
- fixup_glShaderSource(glmsg, pointersToFixup);
- break;
- case GLMessage::glUniform1iv:
- /* void glUniform1iv(GLint location, GLsizei count, const GLint *value); */
- fixup_glUniformGenericInteger(2, 1, glmsg, pointersToFixup);
- break;
- case GLMessage::glUniform2iv:
- /* void glUniform2iv(GLint location, GLsizei count, const GLint *value); */
- fixup_glUniformGenericInteger(2, 2, glmsg, pointersToFixup);
- break;
- case GLMessage::glUniform3iv:
- /* void glUniform3iv(GLint location, GLsizei count, const GLint *value); */
- fixup_glUniformGenericInteger(2, 3, glmsg, pointersToFixup);
- break;
- case GLMessage::glUniform4iv:
- /* void glUniform4iv(GLint location, GLsizei count, const GLint *value); */
- fixup_glUniformGenericInteger(2, 4, glmsg, pointersToFixup);
- break;
- case GLMessage::glUniform1fv:
- /* void glUniform1fv(GLint location, GLsizei count, const GLfloat *value); */
- fixup_glUniformGeneric(2, 1, glmsg, pointersToFixup[0]);
- break;
- case GLMessage::glUniform2fv:
- /* void glUniform2fv(GLint location, GLsizei count, const GLfloat *value); */
- fixup_glUniformGeneric(2, 2, glmsg, pointersToFixup[0]);
- break;
- case GLMessage::glUniform3fv:
- /* void glUniform3fv(GLint location, GLsizei count, const GLfloat *value); */
- fixup_glUniformGeneric(2, 3, glmsg, pointersToFixup[0]);
- break;
- case GLMessage::glUniform4fv:
- /* void glUniform4fv(GLint location, GLsizei count, const GLfloat *value); */
- fixup_glUniformGeneric(2, 4, glmsg, pointersToFixup[0]);
- break;
- case GLMessage::glUniformMatrix2fv:
- /* void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat* value) */
- fixup_glUniformMatrixGeneric(2, glmsg, pointersToFixup);
- break;
- case GLMessage::glUniformMatrix3fv:
- /* void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat* value) */
- fixup_glUniformMatrixGeneric(3, glmsg, pointersToFixup);
- break;
- case GLMessage::glUniformMatrix4fv:
- /* void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat* value) */
- fixup_glUniformMatrixGeneric(4, glmsg, pointersToFixup);
- break;
- case GLMessage::glBufferData:
- /* void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) */
- fixup_glBufferData(context, glmsg, pointersToFixup);
- break;
- case GLMessage::glBufferSubData:
- /* void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) */
- fixup_glBufferSubData(context, glmsg, pointersToFixup);
- break;
- case GLMessage::glDrawArrays:
- /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */
- fixup_glDrawArrays(context, glmsg);
- break;
- case GLMessage::glDrawElements:
- /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */
- fixup_glDrawElements(context, glmsg, pointersToFixup);
- break;
- case GLMessage::glPushGroupMarkerEXT:
- /* void PushGroupMarkerEXT(sizei length, const char *marker); */
- fixup_CStringPtr(1, glmsg, pointersToFixup[0]);
- break;
- case GLMessage::glInsertEventMarkerEXT:
- /* void InsertEventMarkerEXT(sizei length, const char *marker); */
- fixup_CStringPtr(1, glmsg, pointersToFixup[0]);
- break;
- default:
- break;
- }
-}
-
-};
-};
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.h b/opengl/libs/GLES_trace/src/gltrace_fixup.h
deleted file mode 100644
index fe30125..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_fixup.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#ifndef __GLTRACE_FIXUP_H_
-#define __GLTRACE_FIXUP_H_
-
-#include <utils/Timers.h>
-
-#include "gltrace.pb.h"
-#include "gltrace_context.h"
-
-namespace android {
-namespace gltrace {
-
-void fixupGLMessage(GLTraceContext *curContext, nsecs_t wallStart, nsecs_t wallEnd,
- nsecs_t threadStart, nsecs_t threadEnd,
- GLMessage *message, void *pointersToFixup[]);
-void fixup_addFBContents(GLTraceContext *curContext, GLMessage *message, FBBinding fbToRead);
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_hooks.cpp b/opengl/libs/GLES_trace/src/gltrace_hooks.cpp
deleted file mode 100644
index de8d463..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_hooks.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#include "hooks.h"
-#include "gltrace_api.h"
-#include "gltrace_hooks.h"
-
-namespace android {
-namespace gltrace {
-
-// Hook up all the GLTrace functions
-#define GL_ENTRY(_r, _api, ...) GLTrace_ ## _api,
-EGLAPI gl_hooks_t gHooksDebug = {
- {
- #include "entries.in"
- },
- {
- {0}
- }
-};
-#undef GL_ENTRY
-
-gl_hooks_t *getGLHooks() {
- return &gHooksDebug;
-}
-
-};
-};
diff --git a/opengl/libs/GLES_trace/src/gltrace_hooks.h b/opengl/libs/GLES_trace/src/gltrace_hooks.h
deleted file mode 100644
index c946a09..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_hooks.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#ifndef __GLD_HOOKS_H_
-#define __GLD_HOOKS_H_
-
-#include "hooks.h"
-
-namespace android {
-namespace gltrace {
-
-using ::android::gl_hooks_t;
-
-gl_hooks_t *getGLHooks();
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.cpp b/opengl/libs/GLES_trace/src/gltrace_transport.cpp
deleted file mode 100644
index 5251b12..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_transport.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <netinet/in.h>
-
-#include <cutils/log.h>
-
-#include "gltrace_transport.h"
-
-namespace android {
-namespace gltrace {
-
-int acceptClientConnection(char *sockname) {
- int serverSocket = socket(AF_LOCAL, SOCK_STREAM, 0);
- if (serverSocket < 0) {
- ALOGE("Error (%d) while creating socket. Check if app has network permissions.",
- serverSocket);
- return -1;
- }
-
- struct sockaddr_un server, client;
-
- memset(&server, 0, sizeof server);
- server.sun_family = AF_UNIX;
- // the first byte of sun_path should be '\0' for abstract namespace
- strcpy(server.sun_path + 1, sockname);
-
- // note that sockaddr_len should be set to the exact size of the buffer that is used.
- socklen_t sockaddr_len = sizeof(server.sun_family) + strlen(sockname) + 1;
- if (bind(serverSocket, (struct sockaddr *) &server, sockaddr_len) < 0) {
- close(serverSocket);
- ALOGE("Failed to bind the server socket");
- return -1;
- }
-
- if (listen(serverSocket, 1) < 0) {
- close(serverSocket);
- ALOGE("Failed to listen on server socket");
- return -1;
- }
-
- ALOGD("gltrace::waitForClientConnection: server listening @ path %s", sockname);
-
- int clientSocket = accept(serverSocket, (struct sockaddr *)&client, &sockaddr_len);
- if (clientSocket < 0) {
- close(serverSocket);
- ALOGE("Failed to accept client connection");
- return -1;
- }
-
- ALOGD("gltrace::waitForClientConnection: client connected.");
-
- // do not accept any more incoming connections
- close(serverSocket);
-
- return clientSocket;
-}
-
-TCPStream::TCPStream(int socket) {
- mSocket = socket;
- pthread_mutex_init(&mSocketWriteMutex, NULL);
-}
-
-TCPStream::~TCPStream() {
- pthread_mutex_destroy(&mSocketWriteMutex);
-}
-
-void TCPStream::closeStream() {
- if (mSocket > 0) {
- close(mSocket);
- mSocket = 0;
- }
-}
-
-int TCPStream::send(void *buf, size_t len) {
- if (mSocket <= 0) {
- return -1;
- }
-
- pthread_mutex_lock(&mSocketWriteMutex);
- int n = write(mSocket, buf, len);
- pthread_mutex_unlock(&mSocketWriteMutex);
-
- return n;
-}
-
-int TCPStream::receive(void *data, size_t len) {
- if (mSocket <= 0) {
- return -1;
- }
-
- return read(mSocket, data, len);
-}
-
-BufferedOutputStream::BufferedOutputStream(TCPStream *stream, size_t bufferSize) {
- mStream = stream;
-
- mBufferSize = bufferSize;
- mStringBuffer = "";
- mStringBuffer.reserve(bufferSize);
-}
-
-int BufferedOutputStream::flush() {
- if (mStringBuffer.size() == 0) {
- return 0;
- }
-
- int n = mStream->send((void *)mStringBuffer.data(), mStringBuffer.size());
- mStringBuffer.clear();
- return n;
-}
-
-void BufferedOutputStream::enqueueMessage(GLMessage *msg) {
- const uint32_t len = msg->ByteSize();
-
- mStringBuffer.append((const char *)&len, sizeof(len)); // append header
- msg->AppendToString(&mStringBuffer); // append message
-}
-
-int BufferedOutputStream::send(GLMessage *msg) {
- enqueueMessage(msg);
-
- if (mStringBuffer.size() > mBufferSize) {
- return flush();
- }
-
- return 0;
-}
-
-}; // namespace gltrace
-}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.h b/opengl/libs/GLES_trace/src/gltrace_transport.h
deleted file mode 100644
index 3665035..0000000
--- a/opengl/libs/GLES_trace/src/gltrace_transport.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2011, 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.
- */
-
-#ifndef __GLTRACE_TRANSPORT_H_
-#define __GLTRACE_TRANSPORT_H_
-
-#include <pthread.h>
-
-#include "gltrace.pb.h"
-
-namespace android {
-namespace gltrace {
-
-/**
- * TCPStream provides a TCP based communication channel from the device to
- * the host for transferring GLMessages.
- */
-class TCPStream {
- int mSocket;
- pthread_mutex_t mSocketWriteMutex;
-public:
- /** Create a TCP based communication channel over @socket */
- TCPStream(int socket);
- ~TCPStream();
-
- /** Close the channel. */
- void closeStream();
-
- /** Send @data of size @len to host. . Returns -1 on error, 0 on success. */
- int send(void *data, size_t len);
-
- /** Receive data into @buf from the remote end. This is a blocking call. */
- int receive(void *buf, size_t size);
-};
-
-/**
- * BufferedOutputStream provides buffering of data sent to the underlying
- * unbuffered channel.
- */
-class BufferedOutputStream {
- TCPStream *mStream;
-
- size_t mBufferSize;
- std::string mStringBuffer;
-
- /** Enqueue message into internal buffer. */
- void enqueueMessage(GLMessage *msg);
-public:
- /**
- * Construct a Buffered stream of size @bufferSize, using @stream as
- * its underlying channel for transport.
- */
- BufferedOutputStream(TCPStream *stream, size_t bufferSize);
-
- /**
- * Send @msg. The message could be buffered and sent later with a
- * subsequent message. Returns -1 on error, 0 on success.
- */
- int send(GLMessage *msg);
-
- /** Send any buffered messages, returns -1 on error, 0 on success. */
- int flush();
-};
-
-/**
- * Utility method: start a server listening at @sockName (unix domain socket,
- * abstract namespace path), and wait for a client connection.
- * Returns the connected client socket on success, or -1 on failure.
- */
-int acceptClientConnection(char *sockName);
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/tools/genapi.py b/opengl/libs/GLES_trace/tools/genapi.py
deleted file mode 100755
index 24034c1..0000000
--- a/opengl/libs/GLES_trace/tools/genapi.py
+++ /dev/null
@@ -1,408 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2011 Google Inc.
-#
-# 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.
-#
-# ABOUT
-# This script is used to generate the trace implementations of all
-# OpenGL calls. When executed, it reads the specs for the OpenGL calls
-# from the files GLES2/gl2_api.in, GLES2/gl2ext_api.in, GLES_CM/gl_api.in,
-# and GLES_CM/glext_api.in, and generates trace versions for all the
-# defined functions.
-#
-# PREREQUISITES
-# To generate C++ files, this script uses the 'pyratemp' template
-# module. The only reason to use pyratemp is that it is extremly
-# simple to install:
-# $ wget http://www.simple-is-better.org/template/pyratemp-current/pyratemp.py
-# Put the file in the GLES_trace/tools folder, or update PYTHONPATH
-# to point to wherever it was downloaded.
-#
-# USAGE
-# $ cd GLES_trace - run the program from GLES2_trace folder
-# $ ./tools/genapi.py - generates a .cpp and .h file
-# $ mv *.cpp *.h src/ - move the generated files into the src folder
-
-import sys
-import re
-import pyratemp
-
-# Constants corresponding to the protobuf DataType.Type
-class DataType:
- def __init__(self, name):
- self.name = name
-
- def __str__(self):
- if self.name == "pointer": # pointers map to the INT DataType
- return "INT"
- return self.name.upper()
-
- def getProtobufCall(self):
- if self.name == "void":
- raise ValueError("Attempt to set void value")
- elif self.name == "char" or self.name == "byte" \
- or self.name == "pointer" or self.name == "enum":
- return "add_intvalue((int)"
- elif self.name == "int":
- return "add_intvalue("
- elif self.name == "float":
- return "add_floatvalue("
- elif self.name == "bool":
- return "add_boolvalue("
- else:
- raise ValueError("Unknown value type %s" % self.name)
-
-DataType.VOID = DataType("void")
-DataType.CHAR = DataType("char")
-DataType.BYTE = DataType("byte")
-DataType.ENUM = DataType("enum")
-DataType.BOOL = DataType("bool")
-DataType.INT = DataType("int")
-DataType.FLOAT = DataType("float")
-DataType.POINTER = DataType("pointer")
-
-# mapping of GL types to protobuf DataType
-GL2PROTOBUF_TYPE_MAP = {
- "GLvoid":DataType.VOID,
- "void":DataType.VOID,
- "GLchar":DataType.CHAR,
- "GLenum":DataType.ENUM,
- "GLboolean":DataType.BOOL,
- "GLbitfield":DataType.INT,
- "GLbyte":DataType.BYTE,
- "GLshort":DataType.INT,
- "GLint":DataType.INT,
- "int":DataType.INT,
- "GLsizei":DataType.INT,
- "GLubyte":DataType.BYTE,
- "GLushort":DataType.INT,
- "GLuint":DataType.INT,
- "GLfloat":DataType.FLOAT,
- "GLclampf":DataType.FLOAT,
- "GLfixed":DataType.INT,
- "GLclampx":DataType.INT,
- "GLsizeiptr":DataType.INT,
- "GLintptr":DataType.INT,
- "GLeglImageOES":DataType.POINTER,
-}
-
-API_SPECS = [
- ('GL2','../GLES2/gl2_api.in'),
- ('GL2Ext','../GLES2/gl2ext_api.in'),
- ('GL1','../GLES_CM/gl_api.in'),
- ('GL1Ext','../GLES_CM/glext_api.in'),
-]
-
-HEADER_LICENSE = """/*
- * Copyright 2011, 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.
- *
- * THIS FILE WAS GENERATED BY A SCRIPT. DO NOT EDIT.
- */
-"""
-
-HEADER_INCLUDES = """
-#include <cutils/log.h>
-#include <utils/Timers.h>
-#include <GLES2/gl2.h>
-
-#include "gltrace.pb.h"
-#include "gltrace_context.h"
-#include "gltrace_fixup.h"
-#include "gltrace_transport.h"
-"""
-
-HEADER_NAMESPACE_START = """
-namespace android {
-namespace gltrace {
-"""
-
-FOOTER_TEXT = """
-}; // namespace gltrace
-}; // namespace android
-"""
-
-TRACE_CALL_TEMPLATE = pyratemp.Template(
-"""$!retType!$ GLTrace_$!func!$($!inputArgList!$) {
- GLMessage glmsg;
- GLTraceContext *glContext = getGLTraceContext();
-
- glmsg.set_function(GLMessage::$!func!$);
-<!--(if len(parsedArgs) > 0)-->
- <!--(for argname, argtype in parsedArgs)-->
-
- // copy argument $!argname!$
- GLMessage_DataType *arg_$!argname!$ = glmsg.add_args();
- arg_$!argname!$->set_isarray(false);
- arg_$!argname!$->set_type(GLMessage::DataType::$!argtype!$);
- arg_$!argname!$->$!argtype.getProtobufCall()!$$!argname!$);
- <!--(end)-->
-<!--(end)-->
-
- // call function
- nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
- nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-<!--(if retType != "void")-->
- $!retType!$ retValue = glContext->hooks->gl.$!callsite!$;
-<!--(else)-->
- glContext->hooks->gl.$!callsite!$;
-<!--(end)-->
- nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
- nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-<!--(if retType != "void")-->
-
- // set return value
- GLMessage_DataType *rt = glmsg.mutable_returnvalue();
- rt->set_isarray(false);
- rt->set_type(GLMessage::DataType::$!retDataType!$);
- rt->$!retDataType.getProtobufCall()!$retValue);
-<!--(end)-->
-
- void *pointerArgs[] = {
-<!--(for argname, argtype in parsedArgs)-->
- <!--(if argtype == DataType.POINTER)-->
- (void *) $!argname!$,
- <!--(end)-->
-<!--(end)-->
-<!--(if retDataType == DataType.POINTER)-->
- (void *) retValue,
-<!--(end)-->
- };
-
- fixupGLMessage(glContext, wallStartTime, wallEndTime,
- threadStartTime, threadEndTime,
- &glmsg, pointerArgs);
- glContext->traceGLMessage(&glmsg);
-<!--(if retType != "void")-->
-
- return retValue;
-<!--(end)-->
-}
-""")
-
-def getDataTypeFromKw(kw):
- """ Get the data type given declaration.
- All pointer declarations are of type DataType.POINTER
-
- e.g.: GLvoid -> DataType.VOID"""
-
- if kw.count('*') > 0:
- return DataType.POINTER
- return GL2PROTOBUF_TYPE_MAP.get(kw)
-
-def getNameTypePair(decl):
- """ Split declaration of a variable to a tuple of (variable name, DataType).
- e.g. "const GLChar* varName" -> (varName, POINTER) """
- elements = decl.strip().split(' ')
- name = None
- if len(elements) > 1:
- name = " ".join(elements[-1:]).strip() # last element is the name
- dataType = " ".join(elements[:-1]).strip() # everything else is the data type
-
- # if name is a pointer (e.g. "*ptr"), then remove the "*" from the name
- # and add it to the data type
- pointersInName = name.count("*")
- if pointersInName > 0:
- name = name.replace("*", "")
- dataType += "*" * pointersInName
-
- # if name is an array (e.g. "array[10]"), then remove the "[X]" from the name
- # and make the datatype to be a pointer
- arraysInName = name.count("[")
- if arraysInName > 0:
- name = name.split('[')[0]
- dataType += "*"
- else:
- dataType = elements[0]
- return (name, getDataTypeFromKw(dataType))
-
-def parseArgs(arglist):
- """ Parse the argument list into a list of (var name, DataType) tuples """
- args = arglist.split(',')
- args = map(lambda x: x.strip(), args) # remove unnecessary whitespaces
- argtypelist = map(getNameTypePair, args) # split arg into arg type and arg name
- if len(argtypelist) == 1:
- (name, argtype) = argtypelist[0]
- if argtype == DataType.VOID:
- return []
-
- return argtypelist
-
-class ApiCall(object):
- """An ApiCall models all information about a single OpenGL API"""
-
- # Regex to match API_ENTRY specification:
- # e.g. void API_ENTRY(glActiveTexture)(GLenum texture) {
- # the regex uses a non greedy match (?) to match the first closing paren
- API_ENTRY_REGEX = "(.*)API_ENTRY\(.*?\)\((.*?)\)"
-
- # Regex to match CALL_GL_API specification:
- # e.g. CALL_GL_API(glCullFace, mode);
- # CALL_GL_API_RETURN(glCreateProgram);
- CALL_GL_API_REGEX = "CALL_GL_API(_RETURN)?\((.*)\);"
-
- def __init__(self, prefix, apientry, callsite):
- """Construct an ApiCall from its specification.
-
- The specification is provided by the two arguments:
- prefix: prefix to use for function names
- defn: specification line containing API_ENTRY macro
- e.g: void API_ENTRY(glActiveTexture)(GLenum texture) {
- callsite: specification line containing CALL_GL_API macro
- e.g: CALL_GL_API(glActiveTexture, texture);
- """
- self.prefix = prefix
- self.ret = self.getReturnType(apientry)
- self.arglist = self.getArgList(apientry)
-
- # some functions (e.g. __glEGLImageTargetRenderbufferStorageOES), define their
- # names one way in the API_ENTRY and another way in the CALL_GL_API macros.
- # so self.func is reassigned based on what is there in the call site
- self.func = self.getFunc(callsite)
- self.callsite = self.getCallSite(callsite)
-
- def getReturnType(self, apientry):
- '''Extract the return type from the API_ENTRY specification'''
- m = re.search(self.API_ENTRY_REGEX, apientry)
- if not m:
- raise ValueError("%s does not match API_ENTRY specification %s"
- % (apientry, self.API_ENTRY_REGEX))
-
- return m.group(1).strip()
-
- def getArgList(self, apientry):
- '''Extract the argument list from the API_ENTRY specification'''
- m = re.search(self.API_ENTRY_REGEX, apientry)
- if not m:
- raise ValueError("%s does not match API_ENTRY specification %s"
- % (apientry, self.API_ENTRY_REGEX))
-
- return m.group(2).strip()
-
- def parseCallSite(self, callsite):
- m = re.search(self.CALL_GL_API_REGEX, callsite)
- if not m:
- raise ValueError("%s does not match CALL_GL_API specification (%s)"
- % (callsite, self.CALL_GL_API_REGEX))
-
- arglist = m.group(2)
- args = arglist.split(',')
- args = map(lambda x: x.strip(), args)
-
- return args
-
- def getCallSite(self, callsite):
- '''Extract the callsite from the CALL_GL_API specification'''
- args = self.parseCallSite(callsite)
- return "%s(%s)" % (args[0], ", ".join(args[1:]))
-
- def getFunc(self, callsite):
- '''Extract the function name from the CALL_GL_API specification'''
- args = self.parseCallSite(callsite)
- return args[0]
-
- def genDeclaration(self):
- return "%s GLTrace_%s(%s);" % (self.ret, self.func, self.arglist)
-
- def genCode(self):
- return TRACE_CALL_TEMPLATE(func = self.func,
- retType = self.ret,
- retDataType = getDataTypeFromKw(self.ret),
- inputArgList = self.arglist,
- callsite = self.callsite,
- parsedArgs = parseArgs(self.arglist),
- DataType=DataType)
-
-def getApis(apiEntryFile, prefix):
- '''Get a list of all ApiCalls in provided specification file'''
- lines = open(apiEntryFile).readlines()
-
- apis = []
- for i in range(0, len(lines)/3):
- apis.append(ApiCall(prefix, lines[i*3], lines[i*3+1]))
-
- return apis
-
-def parseAllSpecs(specs):
- apis = []
- for name, specfile in specs:
- a = getApis(specfile, name)
- print 'Parsed %s APIs from %s, # of entries = %d' % (name, specfile, len(a))
- apis.extend(a)
- return apis
-
-def removeDuplicates(apis):
- '''Remove all duplicate function entries.
-
- The input list contains functions declared in GL1 and GL2 APIs.
- This will return a list that contains only the first function if there are
- multiple functions with the same name.'''
- uniqs = []
- funcs = set()
- for api in apis:
- if api.func not in funcs:
- uniqs.append(api)
- funcs.add(api.func)
-
- return uniqs
-
-def genHeaders(apis, fname):
- lines = []
- lines.append(HEADER_LICENSE)
- lines.append(HEADER_NAMESPACE_START)
- prefix = ""
- for api in apis:
- if prefix != api.prefix:
- lines.append("\n// Declarations for %s APIs\n\n" % api.prefix)
- prefix = api.prefix
- lines.append(api.genDeclaration())
- lines.append("\n")
- lines.append(FOOTER_TEXT)
-
- with open(fname, "w") as f:
- f.writelines(lines)
-
-def genSrcs(apis, fname):
- lines = []
- lines.append(HEADER_LICENSE)
- lines.append(HEADER_INCLUDES)
- lines.append(HEADER_NAMESPACE_START)
- prefix = ""
- for api in apis:
- if prefix != api.prefix:
- lines.append("\n// Definitions for %s APIs\n\n" % api.prefix)
- prefix = api.prefix
- lines.append(api.genCode())
- lines.append("\n")
- lines.append(FOOTER_TEXT)
-
- with open(fname, "w") as f:
- f.writelines(lines)
-
-if __name__ == '__main__':
- apis = parseAllSpecs(API_SPECS) # read in all the specfiles
- apis = removeDuplicates(apis) # remove duplication of functions common to GL1 and GL2
- genHeaders(apis, 'gltrace_api.h') # generate header file
- genSrcs(apis, 'gltrace_api.cpp') # generate source file
diff --git a/opengl/libs/GLES_trace/tools/testgenapi.py b/opengl/libs/GLES_trace/tools/testgenapi.py
deleted file mode 100644
index fe14954..0000000
--- a/opengl/libs/GLES_trace/tools/testgenapi.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2011 Google Inc.
-#
-# 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.
-#
-# USAGE
-# $ cd GLES_trace/tools
-# $ python testgenapi.py
-
-import unittest
-from genapi import DataType, ApiCall, getApis, parseArgs
-
-class TestApiCall(unittest.TestCase):
- def test_parsing(self):
- apientry = 'void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, ' \
- 'GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ' \
- 'GLsizei height) {'
- callsite = 'CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y,' \
- 'width, height, border);'
-
- api = ApiCall("GL", apientry, callsite)
- self.assertEqual(api.func, "glCopyTexImage2D")
- self.assertEqual(api.callsite, 'glCopyTexImage2D(target, level, internalformat, ' \
- 'x, y, width, height, border)')
- self.assertEqual(api.ret, 'void')
- self.assertEqual(api.arglist, 'GLenum target, GLint level, ' \
- 'GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ' \
- 'GLsizei height')
-
- def test_num_functions_parsed(self):
- gl2_apis = getApis('../../GLES2/gl2_api.in', 'GL2')
- gl2ext_apis = getApis('../../GLES2/gl2ext_api.in', 'GL2Ext')
- gl_apis = getApis('../../GLES_CM/gl_api.in', "GL1")
- glext_apis = getApis('../../GLES_CM/glext_api.in', 'GL1Ext')
-
- self.assertEqual(len(gl2_apis), 142)
- self.assertEqual(len(gl2ext_apis), 121)
- self.assertEqual(len(gl_apis), 145)
- self.assertEqual(len(glext_apis), 140)
-
- def test_parseArgs(self):
- args = parseArgs("void")
- self.assertEqual(len(args), 0)
-
- args = parseArgs("GLchar a")
- self.assertEqual(args, [("a", DataType.CHAR)])
-
- args = parseArgs("GLchar *a")
- self.assertEqual(args, [("a", DataType.POINTER)])
-
- args = parseArgs("GLint exponent[16]")
- self.assertEqual(args, [("exponent", DataType.POINTER)])
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/opengl/libs/debug.in b/opengl/libs/debug.in
deleted file mode 100644
index 882b2da..0000000
--- a/opengl/libs/debug.in
+++ /dev/null
@@ -1,235 +0,0 @@
-// the following functions are not defined in GLESv2_dbg
-TRACE_GL_VOID(glAlphaFunc, (GLenum func, GLclampf ref), (func, ref), 2, "GLenum", func, "GLclampf", ref)
-TRACE_GL_VOID(glAlphaFuncx, (GLenum func, GLclampx ref), (func, ref), 2, "GLenum", func, "GLclampx", ref)
-TRACE_GL_VOID(glAlphaFuncxOES, (GLenum func, GLclampx ref), (func, ref), 2, "GLenum", func, "GLclampx", ref)
-TRACE_GL_VOID(glBeginPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
-TRACE_GL_VOID(glBindFramebufferOES, (GLenum target, GLuint framebuffer), (target, framebuffer), 2, "GLenum", target, "GLuint", framebuffer)
-TRACE_GL_VOID(glBindRenderbufferOES, (GLenum target, GLuint renderbuffer), (target, renderbuffer), 2, "GLenum", target, "GLuint", renderbuffer)
-TRACE_GL_VOID(glBindVertexArrayOES, (GLuint array), (array), 1, "GLuint", array)
-TRACE_GL_VOID(glBlendEquationOES, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glBlendEquationSeparateOES, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha), 2, "GLenum", modeRGB, "GLenum", modeAlpha)
-TRACE_GL_VOID(glBlendFuncSeparateOES, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha), 4, "GLenum", srcRGB, "GLenum", dstRGB, "GLenum", srcAlpha, "GLenum", dstAlpha)
-TRACE_GL(GLenum, glCheckFramebufferStatusOES, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glClearColorx, (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha), (red, green, blue, alpha), 4, "GLclampx", red, "GLclampx", green, "GLclampx", blue, "GLclampx", alpha)
-TRACE_GL_VOID(glClearColorxOES, (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha), (red, green, blue, alpha), 4, "GLclampx", red, "GLclampx", green, "GLclampx", blue, "GLclampx", alpha)
-TRACE_GL_VOID(glClearDepthfOES, (GLclampf depth), (depth), 1, "GLclampf", depth)
-TRACE_GL_VOID(glClearDepthx, (GLclampx depth), (depth), 1, "GLclampx", depth)
-TRACE_GL_VOID(glClearDepthxOES, (GLclampx depth), (depth), 1, "GLclampx", depth)
-TRACE_GL_VOID(glClientActiveTexture, (GLenum texture), (texture), 1, "GLenum", texture)
-TRACE_GL_VOID(glClipPlanef, (GLenum plane, const GLfloat *equation), (plane, equation), 2, "GLenum", plane, "const GLfloat *", equation)
-TRACE_GL_VOID(glClipPlanefIMG, (GLenum p, const GLfloat *eqn), (p, eqn), 2, "GLenum", p, "const GLfloat *", eqn)
-TRACE_GL_VOID(glClipPlanefOES, (GLenum plane, const GLfloat *equation), (plane, equation), 2, "GLenum", plane, "const GLfloat *", equation)
-TRACE_GL_VOID(glClipPlanex, (GLenum plane, const GLfixed *equation), (plane, equation), 2, "GLenum", plane, "const GLfixed *", equation)
-TRACE_GL_VOID(glClipPlanexIMG, (GLenum p, const GLfixed *eqn), (p, eqn), 2, "GLenum", p, "const GLfixed *", eqn)
-TRACE_GL_VOID(glClipPlanexOES, (GLenum plane, const GLfixed *equation), (plane, equation), 2, "GLenum", plane, "const GLfixed *", equation)
-TRACE_GL_VOID(glColor4f, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red, green, blue, alpha), 4, "GLfloat", red, "GLfloat", green, "GLfloat", blue, "GLfloat", alpha)
-TRACE_GL_VOID(glColor4ub, (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha), (red, green, blue, alpha), 4, "GLubyte", red, "GLubyte", green, "GLubyte", blue, "GLubyte", alpha)
-TRACE_GL_VOID(glColor4x, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha), 4, "GLfixed", red, "GLfixed", green, "GLfixed", blue, "GLfixed", alpha)
-TRACE_GL_VOID(glColor4xOES, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha), 4, "GLfixed", red, "GLfixed", green, "GLfixed", blue, "GLfixed", alpha)
-TRACE_GL_VOID(glColorPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glCompressedTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data), (target, level, internalformat, width, height, depth, border, imageSize, data), 9, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLint", border, "GLsizei", imageSize, "const GLvoid*", data)
-TRACE_GL_VOID(glCompressedTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLsizei", imageSize, "const GLvoid*", data)
-TRACE_GL_VOID(glCopyTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, zoffset, x, y, width, height), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glCoverageMaskNV, (GLboolean mask), (mask), 1, "GLboolean", mask)
-TRACE_GL_VOID(glCoverageOperationNV, (GLenum operation), (operation), 1, "GLenum", operation)
-TRACE_GL_VOID(glCurrentPaletteMatrixOES, (GLuint matrixpaletteindex), (matrixpaletteindex), 1, "GLuint", matrixpaletteindex)
-TRACE_GL_VOID(glDeleteFencesNV, (GLsizei n, const GLuint *fences), (n, fences), 2, "GLsizei", n, "const GLuint *", fences)
-TRACE_GL_VOID(glDeleteFramebuffersOES, (GLsizei n, const GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "const GLuint*", framebuffers)
-TRACE_GL_VOID(glDeletePerfMonitorsAMD, (GLsizei n, GLuint *monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
-TRACE_GL_VOID(glDeleteRenderbuffersOES, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "const GLuint*", renderbuffers)
-TRACE_GL_VOID(glDeleteVertexArraysOES, (GLsizei n, const GLuint *arrays), (n, arrays), 2, "GLsizei", n, "const GLuint *", arrays)
-TRACE_GL_VOID(glDepthRangefOES, (GLclampf zNear, GLclampf zFar), (zNear, zFar), 2, "GLclampf", zNear, "GLclampf", zFar)
-TRACE_GL_VOID(glDepthRangex, (GLclampx zNear, GLclampx zFar), (zNear, zFar), 2, "GLclampx", zNear, "GLclampx", zFar)
-TRACE_GL_VOID(glDepthRangexOES, (GLclampx zNear, GLclampx zFar), (zNear, zFar), 2, "GLclampx", zNear, "GLclampx", zFar)
-TRACE_GL_VOID(glDisableClientState, (GLenum array), (array), 1, "GLenum", array)
-TRACE_GL_VOID(glDisableDriverControlQCOM, (GLuint driverControl), (driverControl), 1, "GLuint", driverControl)
-TRACE_GL_VOID(glDiscardFramebufferEXT, (GLenum target, GLsizei numAttachments, const GLenum *attachments), (target, numAttachments, attachments), 3, "GLenum", target, "GLsizei", numAttachments, "const GLenum *", attachments)
-TRACE_GL_VOID(glDrawTexfOES, (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height), (x, y, z, width, height), 5, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", width, "GLfloat", height)
-TRACE_GL_VOID(glDrawTexfvOES, (const GLfloat *coords), (coords), 1, "const GLfloat *", coords)
-TRACE_GL_VOID(glDrawTexiOES, (GLint x, GLint y, GLint z, GLint width, GLint height), (x, y, z, width, height), 5, "GLint", x, "GLint", y, "GLint", z, "GLint", width, "GLint", height)
-TRACE_GL_VOID(glDrawTexivOES, (const GLint *coords), (coords), 1, "const GLint *", coords)
-TRACE_GL_VOID(glDrawTexsOES, (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height), (x, y, z, width, height), 5, "GLshort", x, "GLshort", y, "GLshort", z, "GLshort", width, "GLshort", height)
-TRACE_GL_VOID(glDrawTexsvOES, (const GLshort *coords), (coords), 1, "const GLshort *", coords)
-TRACE_GL_VOID(glDrawTexxOES, (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height), (x, y, z, width, height), 5, "GLfixed", x, "GLfixed", y, "GLfixed", z, "GLfixed", width, "GLfixed", height)
-TRACE_GL_VOID(glDrawTexxvOES, (const GLfixed *coords), (coords), 1, "const GLfixed *", coords)
-TRACE_GL_VOID(glEGLImageTargetRenderbufferStorageOES, (GLenum target, GLeglImageOES image), (target, image), 2, "GLenum", target, "GLeglImageOES", image)
-TRACE_GL_VOID(glEGLImageTargetTexture2DOES, (GLenum target, GLeglImageOES image), (target, image), 2, "GLenum", target, "GLeglImageOES", image)
-TRACE_GL_VOID(glEnableClientState, (GLenum array), (array), 1, "GLenum", array)
-TRACE_GL_VOID(glEnableDriverControlQCOM, (GLuint driverControl), (driverControl), 1, "GLuint", driverControl)
-TRACE_GL_VOID(glEndPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
-TRACE_GL_VOID(glEndTilingQCOM, (GLbitfield preserveMask), (preserveMask), 1, "GLbitfield", preserveMask)
-TRACE_GL_VOID(glExtGetBufferPointervQCOM, (GLenum target, GLvoid **params), (target, params), 2, "GLenum", target, "GLvoid **", params)
-TRACE_GL_VOID(glExtGetBuffersQCOM, (GLuint *buffers, GLint maxBuffers, GLint *numBuffers), (buffers, maxBuffers, numBuffers), 3, "GLuint *", buffers, "GLint", maxBuffers, "GLint *", numBuffers)
-TRACE_GL_VOID(glExtGetFramebuffersQCOM, (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers), (framebuffers, maxFramebuffers, numFramebuffers), 3, "GLuint *", framebuffers, "GLint", maxFramebuffers, "GLint *", numFramebuffers)
-TRACE_GL_VOID(glExtGetProgramBinarySourceQCOM, (GLuint program, GLenum shadertype, GLchar *source, GLint *length), (program, shadertype, source, length), 4, "GLuint", program, "GLenum", shadertype, "GLchar *", source, "GLint *", length)
-TRACE_GL_VOID(glExtGetProgramsQCOM, (GLuint *programs, GLint maxPrograms, GLint *numPrograms), (programs, maxPrograms, numPrograms), 3, "GLuint *", programs, "GLint", maxPrograms, "GLint *", numPrograms)
-TRACE_GL_VOID(glExtGetRenderbuffersQCOM, (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers), (renderbuffers, maxRenderbuffers, numRenderbuffers), 3, "GLuint *", renderbuffers, "GLint", maxRenderbuffers, "GLint *", numRenderbuffers)
-TRACE_GL_VOID(glExtGetShadersQCOM, (GLuint *shaders, GLint maxShaders, GLint *numShaders), (shaders, maxShaders, numShaders), 3, "GLuint *", shaders, "GLint", maxShaders, "GLint *", numShaders)
-TRACE_GL_VOID(glExtGetTexLevelParameterivQCOM, (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params), (texture, face, level, pname, params), 5, "GLuint", texture, "GLenum", face, "GLint", level, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glExtGetTexSubImageQCOM, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLenum", type, "GLvoid *", texels)
-TRACE_GL_VOID(glExtGetTexturesQCOM, (GLuint *textures, GLint maxTextures, GLint *numTextures), (textures, maxTextures, numTextures), 3, "GLuint *", textures, "GLint", maxTextures, "GLint *", numTextures)
-TRACE_GL(GLboolean, glExtIsProgramBinaryQCOM, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glExtTexObjectStateOverrideiQCOM, (GLenum target, GLenum pname, GLint param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glFinishFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
-TRACE_GL_VOID(glFogf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glFogfv, (GLenum pname, const GLfloat *params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glFogx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glFogxOES, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glFogxv, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glFogxvOES, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glFramebufferRenderbufferOES, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer), 4, "GLenum", target, "GLenum", attachment, "GLenum", renderbuffertarget, "GLuint", renderbuffer)
-TRACE_GL_VOID(glFramebufferTexture2DMultisampleIMG, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples), (target, attachment, textarget, texture, level, samples), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLsizei", samples)
-TRACE_GL_VOID(glFramebufferTexture2DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level), 5, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level)
-TRACE_GL_VOID(glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset), (target, attachment, textarget, texture, level, zoffset), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLint", zoffset)
-TRACE_GL_VOID(glFrustumf, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfloat", left, "GLfloat", right, "GLfloat", bottom, "GLfloat", top, "GLfloat", zNear, "GLfloat", zFar)
-TRACE_GL_VOID(glFrustumfOES, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfloat", left, "GLfloat", right, "GLfloat", bottom, "GLfloat", top, "GLfloat", zNear, "GLfloat", zFar)
-TRACE_GL_VOID(glFrustumx, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfixed", left, "GLfixed", right, "GLfixed", bottom, "GLfixed", top, "GLfixed", zNear, "GLfixed", zFar)
-TRACE_GL_VOID(glFrustumxOES, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfixed", left, "GLfixed", right, "GLfixed", bottom, "GLfixed", top, "GLfixed", zNear, "GLfixed", zFar)
-TRACE_GL_VOID(glGenFencesNV, (GLsizei n, GLuint *fences), (n, fences), 2, "GLsizei", n, "GLuint *", fences)
-TRACE_GL_VOID(glGenFramebuffersOES, (GLsizei n, GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "GLuint*", framebuffers)
-TRACE_GL_VOID(glGenPerfMonitorsAMD, (GLsizei n, GLuint *monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
-TRACE_GL_VOID(glGenRenderbuffersOES, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "GLuint*", renderbuffers)
-TRACE_GL_VOID(glGenVertexArraysOES, (GLsizei n, GLuint *arrays), (n, arrays), 2, "GLsizei", n, "GLuint *", arrays)
-TRACE_GL_VOID(glGenerateMipmapOES, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glGetBufferPointervOES, (GLenum target, GLenum pname, GLvoid ** params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLvoid **", params)
-TRACE_GL_VOID(glGetClipPlanef, (GLenum pname, GLfloat eqn[4]), (pname, eqn), 2, "GLenum", pname, "GLfloat", eqn)
-TRACE_GL_VOID(glGetClipPlanefOES, (GLenum pname, GLfloat eqn[4]), (pname, eqn), 2, "GLenum", pname, "GLfloat", eqn)
-TRACE_GL_VOID(glGetClipPlanex, (GLenum pname, GLfixed eqn[4]), (pname, eqn), 2, "GLenum", pname, "GLfixed", eqn)
-TRACE_GL_VOID(glGetClipPlanexOES, (GLenum pname, GLfixed eqn[4]), (pname, eqn), 2, "GLenum", pname, "GLfixed", eqn)
-TRACE_GL_VOID(glGetDriverControlStringQCOM, (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString), (driverControl, bufSize, length, driverControlString), 4, "GLuint", driverControl, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", driverControlString)
-TRACE_GL_VOID(glGetDriverControlsQCOM, (GLint *num, GLsizei size, GLuint *driverControls), (num, size, driverControls), 3, "GLint *", num, "GLsizei", size, "GLuint *", driverControls)
-TRACE_GL_VOID(glGetFenceivNV, (GLuint fence, GLenum pname, GLint *params), (fence, pname, params), 3, "GLuint", fence, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetFixedv, (GLenum pname, GLfixed *params), (pname, params), 2, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetFixedvOES, (GLenum pname, GLfixed *params), (pname, params), 2, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetFramebufferAttachmentParameterivOES, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params), 4, "GLenum", target, "GLenum", attachment, "GLenum", pname, "GLint*", params)
-TRACE_GL_VOID(glGetLightfv, (GLenum light, GLenum pname, GLfloat *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetLightxv, (GLenum light, GLenum pname, GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetLightxvOES, (GLenum light, GLenum pname, GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetMaterialfv, (GLenum face, GLenum pname, GLfloat *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetMaterialxv, (GLenum face, GLenum pname, GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetMaterialxvOES, (GLenum face, GLenum pname, GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetPerfMonitorCounterDataAMD, (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten), (monitor, pname, dataSize, data, bytesWritten), 5, "GLuint", monitor, "GLenum", pname, "GLsizei", dataSize, "GLuint *", data, "GLint *", bytesWritten)
-TRACE_GL_VOID(glGetPerfMonitorCounterInfoAMD, (GLuint group, GLuint counter, GLenum pname, GLvoid *data), (group, counter, pname, data), 4, "GLuint", group, "GLuint", counter, "GLenum", pname, "GLvoid *", data)
-TRACE_GL_VOID(glGetPerfMonitorCounterStringAMD, (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString), (group, counter, bufSize, length, counterString), 5, "GLuint", group, "GLuint", counter, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", counterString)
-TRACE_GL_VOID(glGetPerfMonitorCountersAMD, (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters), (group, numCounters, maxActiveCounters, counterSize, counters), 5, "GLuint", group, "GLint *", numCounters, "GLint *", maxActiveCounters, "GLsizei", counterSize, "GLuint *", counters)
-TRACE_GL_VOID(glGetPerfMonitorGroupStringAMD, (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString), (group, bufSize, length, groupString), 4, "GLuint", group, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", groupString)
-TRACE_GL_VOID(glGetPerfMonitorGroupsAMD, (GLint *numGroups, GLsizei groupsSize, GLuint *groups), (numGroups, groupsSize, groups), 3, "GLint *", numGroups, "GLsizei", groupsSize, "GLuint *", groups)
-TRACE_GL_VOID(glGetPointerv, (GLenum pname, GLvoid **params), (pname, params), 2, "GLenum", pname, "GLvoid **", params)
-TRACE_GL_VOID(glGetProgramBinaryOES, (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary), (program, bufSize, length, binaryFormat, binary), 5, "GLuint", program, "GLsizei", bufSize, "GLsizei *", length, "GLenum *", binaryFormat, "GLvoid *", binary)
-TRACE_GL_VOID(glGetRenderbufferParameterivOES, (GLenum target, GLenum pname, GLint* params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint*", params)
-TRACE_GL_VOID(glGetTexEnvfv, (GLenum env, GLenum pname, GLfloat *params), (env, pname, params), 3, "GLenum", env, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetTexEnviv, (GLenum env, GLenum pname, GLint *params), (env, pname, params), 3, "GLenum", env, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexEnvxv, (GLenum env, GLenum pname, GLfixed *params), (env, pname, params), 3, "GLenum", env, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexEnvxvOES, (GLenum env, GLenum pname, GLfixed *params), (env, pname, params), 3, "GLenum", env, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexGenfvOES, (GLenum coord, GLenum pname, GLfloat *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetTexGenivOES, (GLenum coord, GLenum pname, GLint *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexGenxvOES, (GLenum coord, GLenum pname, GLfixed *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexParameterxv, (GLenum target, GLenum pname, GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexParameterxvOES, (GLenum target, GLenum pname, GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfixed *", params)
-TRACE_GL(GLboolean, glIsFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
-TRACE_GL(GLboolean, glIsFramebufferOES, (GLuint framebuffer), (framebuffer), 1, "GLuint", framebuffer)
-TRACE_GL(GLboolean, glIsRenderbufferOES, (GLuint renderbuffer), (renderbuffer), 1, "GLuint", renderbuffer)
-TRACE_GL(GLboolean, glIsVertexArrayOES, (GLuint array), (array), 1, "GLuint", array)
-TRACE_GL_VOID(glLightModelf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glLightModelfv, (GLenum pname, const GLfloat *params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glLightModelx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightModelxOES, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightModelxv, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLightModelxvOES, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLightf, (GLenum light, GLenum pname, GLfloat param), (light, pname, param), 3, "GLenum", light, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glLightfv, (GLenum light, GLenum pname, const GLfloat *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glLightx, (GLenum light, GLenum pname, GLfixed param), (light, pname, param), 3, "GLenum", light, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightxOES, (GLenum light, GLenum pname, GLfixed param), (light, pname, param), 3, "GLenum", light, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightxv, (GLenum light, GLenum pname, const GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLightxvOES, (GLenum light, GLenum pname, const GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLineWidthx, (GLfixed width), (width), 1, "GLfixed", width)
-TRACE_GL_VOID(glLineWidthxOES, (GLfixed width), (width), 1, "GLfixed", width)
-TRACE_GL_VOID(glLoadIdentity, (void), (), 0)
-TRACE_GL_VOID(glLoadMatrixf, (const GLfloat *m), (m), 1, "const GLfloat *", m)
-TRACE_GL_VOID(glLoadMatrixx, (const GLfixed *m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glLoadMatrixxOES, (const GLfixed *m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glLoadPaletteFromModelViewMatrixOES, (void), (), 0)
-TRACE_GL_VOID(glLogicOp, (GLenum opcode), (opcode), 1, "GLenum", opcode)
-TRACE_GL(void*, glMapBufferOES, (GLenum target, GLenum access), (target, access), 2, "GLenum", target, "GLenum", access)
-TRACE_GL_VOID(glMaterialf, (GLenum face, GLenum pname, GLfloat param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glMaterialfv, (GLenum face, GLenum pname, const GLfloat *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glMaterialx, (GLenum face, GLenum pname, GLfixed param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glMaterialxOES, (GLenum face, GLenum pname, GLfixed param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glMaterialxv, (GLenum face, GLenum pname, const GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glMaterialxvOES, (GLenum face, GLenum pname, const GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glMatrixIndexPointerOES, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glMatrixMode, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glMultMatrixf, (const GLfloat *m), (m), 1, "const GLfloat *", m)
-TRACE_GL_VOID(glMultMatrixx, (const GLfixed *m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glMultMatrixxOES, (const GLfixed *m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glMultiDrawArraysEXT, (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount), (mode, first, count, primcount), 4, "GLenum", mode, "GLint *", first, "GLsizei *", count, "GLsizei", primcount)
-TRACE_GL_VOID(glMultiDrawElementsEXT, (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount), (mode, count, type, indices, primcount), 5, "GLenum", mode, "const GLsizei *", count, "GLenum", type, "const GLvoid* *", indices, "GLsizei", primcount)
-TRACE_GL_VOID(glMultiTexCoord4f, (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q), (target, s, t, r, q), 5, "GLenum", target, "GLfloat", s, "GLfloat", t, "GLfloat", r, "GLfloat", q)
-TRACE_GL_VOID(glMultiTexCoord4x, (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q), (target, s, t, r, q), 5, "GLenum", target, "GLfixed", s, "GLfixed", t, "GLfixed", r, "GLfixed", q)
-TRACE_GL_VOID(glMultiTexCoord4xOES, (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q), (target, s, t, r, q), 5, "GLenum", target, "GLfixed", s, "GLfixed", t, "GLfixed", r, "GLfixed", q)
-TRACE_GL_VOID(glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz), (nx, ny, nz), 3, "GLfloat", nx, "GLfloat", ny, "GLfloat", nz)
-TRACE_GL_VOID(glNormal3x, (GLfixed nx, GLfixed ny, GLfixed nz), (nx, ny, nz), 3, "GLfixed", nx, "GLfixed", ny, "GLfixed", nz)
-TRACE_GL_VOID(glNormal3xOES, (GLfixed nx, GLfixed ny, GLfixed nz), (nx, ny, nz), 3, "GLfixed", nx, "GLfixed", ny, "GLfixed", nz)
-TRACE_GL_VOID(glNormalPointer, (GLenum type, GLsizei stride, const GLvoid *pointer), (type, stride, pointer), 3, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glOrthof, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfloat", left, "GLfloat", right, "GLfloat", bottom, "GLfloat", top, "GLfloat", zNear, "GLfloat", zFar)
-TRACE_GL_VOID(glOrthofOES, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfloat", left, "GLfloat", right, "GLfloat", bottom, "GLfloat", top, "GLfloat", zNear, "GLfloat", zFar)
-TRACE_GL_VOID(glOrthox, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfixed", left, "GLfixed", right, "GLfixed", bottom, "GLfixed", top, "GLfixed", zNear, "GLfixed", zFar)
-TRACE_GL_VOID(glOrthoxOES, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfixed", left, "GLfixed", right, "GLfixed", bottom, "GLfixed", top, "GLfixed", zNear, "GLfixed", zFar)
-TRACE_GL_VOID(glPointParameterf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glPointParameterfv, (GLenum pname, const GLfloat *params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glPointParameterx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glPointParameterxOES, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glPointParameterxv, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glPointParameterxvOES, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glPointSize, (GLfloat size), (size), 1, "GLfloat", size)
-TRACE_GL_VOID(glPointSizePointerOES, (GLenum type, GLsizei stride, const GLvoid *pointer), (type, stride, pointer), 3, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glPointSizex, (GLfixed size), (size), 1, "GLfixed", size)
-TRACE_GL_VOID(glPointSizexOES, (GLfixed size), (size), 1, "GLfixed", size)
-TRACE_GL_VOID(glPolygonOffsetx, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
-TRACE_GL_VOID(glPolygonOffsetxOES, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
-TRACE_GL_VOID(glPopMatrix, (void), (), 0)
-TRACE_GL_VOID(glProgramBinaryOES, (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length), (program, binaryFormat, binary, length), 4, "GLuint", program, "GLenum", binaryFormat, "const GLvoid *", binary, "GLint", length)
-TRACE_GL_VOID(glPushMatrix, (void), (), 0)
-TRACE_GL(GLbitfield, glQueryMatrixxOES, (GLfixed mantissa[16], GLint exponent[16]), (mantissa, exponent), 2, "GLfixed", mantissa, "GLint", exponent)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleIMG, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageOES, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height), 4, "GLenum", target, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRotatef, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z), (angle, x, y, z), 4, "GLfloat", angle, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glRotatex, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glRotatexOES, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glSampleCoveragex, (GLclampx value, GLboolean invert), (value, invert), 2, "GLclampx", value, "GLboolean", invert)
-TRACE_GL_VOID(glSampleCoveragexOES, (GLclampx value, GLboolean invert), (value, invert), 2, "GLclampx", value, "GLboolean", invert)
-TRACE_GL_VOID(glScalef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z), 3, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glScalex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glScalexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glSelectPerfMonitorCountersAMD, (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList), (monitor, enable, group, numCounters, countersList), 5, "GLuint", monitor, "GLboolean", enable, "GLuint", group, "GLint", numCounters, "GLuint *", countersList)
-TRACE_GL_VOID(glSetFenceNV, (GLuint fence, GLenum condition), (fence, condition), 2, "GLuint", fence, "GLenum", condition)
-TRACE_GL_VOID(glShadeModel, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glStartTilingQCOM, (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask), (x, y, width, height, preserveMask), 5, "GLuint", x, "GLuint", y, "GLuint", width, "GLuint", height, "GLbitfield", preserveMask)
-TRACE_GL(GLboolean, glTestFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
-TRACE_GL_VOID(glTexCoordPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glTexEnvf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glTexEnvfv, (GLenum target, GLenum pname, const GLfloat *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glTexEnvi, (GLenum target, GLenum pname, GLint param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glTexEnviv, (GLenum target, GLenum pname, const GLint *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLint *", params)
-TRACE_GL_VOID(glTexEnvx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexEnvxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexEnvxv, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexEnvxvOES, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexGenfOES, (GLenum coord, GLenum pname, GLfloat param), (coord, pname, param), 3, "GLenum", coord, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glTexGenfvOES, (GLenum coord, GLenum pname, const GLfloat *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glTexGeniOES, (GLenum coord, GLenum pname, GLint param), (coord, pname, param), 3, "GLenum", coord, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glTexGenivOES, (GLenum coord, GLenum pname, const GLint *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "const GLint *", params)
-TRACE_GL_VOID(glTexGenxOES, (GLenum coord, GLenum pname, GLfixed param), (coord, pname, param), 3, "GLenum", coord, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexGenxvOES, (GLenum coord, GLenum pname, const GLfixed *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels), (target, level, internalformat, width, height, depth, border, format, type, pixels), 10, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLint", border, "GLenum", format, "GLenum", type, "const GLvoid*", pixels)
-TRACE_GL_VOID(glTexParameterx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexParameterxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexParameterxv, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexParameterxvOES, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLenum", type, "const GLvoid*", pixels)
-TRACE_GL_VOID(glTranslatef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z), 3, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glTranslatex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glTranslatexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL(GLboolean, glUnmapBufferOES, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glVertexPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glWeightPointerOES, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
diff --git a/opengl/libs/egl_impl.h b/opengl/libs/egl_impl.h
deleted file mode 100644
index cb0e908..0000000
--- a/opengl/libs/egl_impl.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#ifndef ANDROID_EGL_IMPL_H
-#define ANDROID_EGL_IMPL_H
-
-#include <ctype.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <EGL/eglplatform.h>
-
-#include "hooks.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-EGLAPI const GLubyte * egl_get_string_for_current_context(GLenum name);
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif /* ANDROID_EGL_IMPL_H */
diff --git a/opengl/libs/entries.in b/opengl/libs/entries.in
deleted file mode 100644
index 6316d78..0000000
--- a/opengl/libs/entries.in
+++ /dev/null
@@ -1,437 +0,0 @@
-GL_ENTRY(void, glActiveShaderProgramEXT, GLuint pipeline, GLuint program)
-GL_ENTRY(void, glActiveTexture, GLenum texture)
-GL_ENTRY(void, glAlphaFunc, GLenum func, GLclampf ref)
-GL_ENTRY(void, glAlphaFuncQCOM, GLenum func, GLclampf ref)
-GL_ENTRY(void, glAlphaFuncx, GLenum func, GLclampx ref)
-GL_ENTRY(void, glAlphaFuncxOES, GLenum func, GLclampx ref)
-GL_ENTRY(void, glAttachShader, GLuint program, GLuint shader)
-GL_ENTRY(void, glBeginPerfMonitorAMD, GLuint monitor)
-GL_ENTRY(void, glBeginQueryEXT, GLenum target, GLuint id)
-GL_ENTRY(void, glBindAttribLocation, GLuint program, GLuint index, const GLchar* name)
-GL_ENTRY(void, glBindBuffer, GLenum target, GLuint buffer)
-GL_ENTRY(void, glBindFramebuffer, GLenum target, GLuint framebuffer)
-GL_ENTRY(void, glBindFramebufferOES, GLenum target, GLuint framebuffer)
-GL_ENTRY(void, glBindProgramPipelineEXT, GLuint pipeline)
-GL_ENTRY(void, glBindRenderbuffer, GLenum target, GLuint renderbuffer)
-GL_ENTRY(void, glBindRenderbufferOES, GLenum target, GLuint renderbuffer)
-GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture)
-GL_ENTRY(void, glBindVertexArrayOES, GLuint array)
-GL_ENTRY(void, glBlendColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-GL_ENTRY(void, glBlendEquation, GLenum mode )
-GL_ENTRY(void, glBlendEquationOES, GLenum mode)
-GL_ENTRY(void, glBlendEquationSeparate, GLenum modeRGB, GLenum modeAlpha)
-GL_ENTRY(void, glBlendEquationSeparateOES, GLenum modeRGB, GLenum modeAlpha)
-GL_ENTRY(void, glBlendFunc, GLenum sfactor, GLenum dfactor)
-GL_ENTRY(void, glBlendFuncSeparate, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-GL_ENTRY(void, glBlendFuncSeparateOES, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-GL_ENTRY(void, glBlitFramebufferANGLE, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
-GL_ENTRY(void, glBufferData, GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
-GL_ENTRY(void, glBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
-GL_ENTRY(GLenum, glCheckFramebufferStatus, GLenum target)
-GL_ENTRY(GLenum, glCheckFramebufferStatusOES, GLenum target)
-GL_ENTRY(void, glClear, GLbitfield mask)
-GL_ENTRY(void, glClearColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-GL_ENTRY(void, glClearColorx, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-GL_ENTRY(void, glClearColorxOES, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-GL_ENTRY(void, glClearDepthf, GLclampf depth)
-GL_ENTRY(void, glClearDepthfOES, GLclampf depth)
-GL_ENTRY(void, glClearDepthx, GLclampx depth)
-GL_ENTRY(void, glClearDepthxOES, GLclampx depth)
-GL_ENTRY(void, glClearStencil, GLint s)
-GL_ENTRY(void, glClientActiveTexture, GLenum texture)
-GL_ENTRY(void, glClipPlanef, GLenum plane, const GLfloat *equation)
-GL_ENTRY(void, glClipPlanefIMG, GLenum p, const GLfloat *eqn)
-GL_ENTRY(void, glClipPlanefOES, GLenum plane, const GLfloat *equation)
-GL_ENTRY(void, glClipPlanex, GLenum plane, const GLfixed *equation)
-GL_ENTRY(void, glClipPlanexIMG, GLenum p, const GLfixed *eqn)
-GL_ENTRY(void, glClipPlanexOES, GLenum plane, const GLfixed *equation)
-GL_ENTRY(void, glColor4f, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-GL_ENTRY(void, glColor4ub, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
-GL_ENTRY(void, glColor4x, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-GL_ENTRY(void, glColor4xOES, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-GL_ENTRY(void, glColorMask, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-GL_ENTRY(void, glColorPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glCompileShader, GLuint shader)
-GL_ENTRY(void, glCompressedTexImage2D, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
-GL_ENTRY(void, glCompressedTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
-GL_ENTRY(void, glCompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
-GL_ENTRY(void, glCompressedTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
-GL_ENTRY(void, glCopyTexImage2D, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-GL_ENTRY(void, glCopyTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glCopyTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glCoverageMaskNV, GLboolean mask)
-GL_ENTRY(void, glCoverageOperationNV, GLenum operation)
-GL_ENTRY(GLuint, glCreateProgram, void)
-GL_ENTRY(GLuint, glCreateShader, GLenum type)
-GL_ENTRY(GLuint, glCreateShaderProgramvEXT, GLenum type, GLsizei count, const GLchar **strings)
-GL_ENTRY(void, glCullFace, GLenum mode)
-GL_ENTRY(void, glCurrentPaletteMatrixOES, GLuint matrixpaletteindex)
-GL_ENTRY(void, glDeleteBuffers, GLsizei n, const GLuint *buffers)
-GL_ENTRY(void, glDeleteFencesNV, GLsizei n, const GLuint *fences)
-GL_ENTRY(void, glDeleteFramebuffers, GLsizei n, const GLuint* framebuffers)
-GL_ENTRY(void, glDeleteFramebuffersOES, GLsizei n, const GLuint* framebuffers)
-GL_ENTRY(void, glDeletePerfMonitorsAMD, GLsizei n, GLuint *monitors)
-GL_ENTRY(void, glDeleteProgram, GLuint program)
-GL_ENTRY(void, glDeleteProgramPipelinesEXT, GLsizei n, const GLuint *pipelines)
-GL_ENTRY(void, glDeleteQueriesEXT, GLsizei n, const GLuint *ids)
-GL_ENTRY(void, glDeleteRenderbuffers, GLsizei n, const GLuint* renderbuffers)
-GL_ENTRY(void, glDeleteRenderbuffersOES, GLsizei n, const GLuint* renderbuffers)
-GL_ENTRY(void, glDeleteShader, GLuint shader)
-GL_ENTRY(void, glDeleteTextures, GLsizei n, const GLuint *textures)
-GL_ENTRY(void, glDeleteVertexArraysOES, GLsizei n, const GLuint *arrays)
-GL_ENTRY(void, glDepthFunc, GLenum func)
-GL_ENTRY(void, glDepthMask, GLboolean flag)
-GL_ENTRY(void, glDepthRangef, GLclampf zNear, GLclampf zFar)
-GL_ENTRY(void, glDepthRangefOES, GLclampf zNear, GLclampf zFar)
-GL_ENTRY(void, glDepthRangex, GLclampx zNear, GLclampx zFar)
-GL_ENTRY(void, glDepthRangexOES, GLclampx zNear, GLclampx zFar)
-GL_ENTRY(void, glDetachShader, GLuint program, GLuint shader)
-GL_ENTRY(void, glDisable, GLenum cap)
-GL_ENTRY(void, glDisableClientState, GLenum array)
-GL_ENTRY(void, glDisableDriverControlQCOM, GLuint driverControl)
-GL_ENTRY(void, glDisableVertexAttribArray, GLuint index)
-GL_ENTRY(void, glDiscardFramebufferEXT, GLenum target, GLsizei numAttachments, const GLenum *attachments)
-GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count)
-GL_ENTRY(void, glDrawBuffersNV, GLsizei n, const GLenum *bufs)
-GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
-GL_ENTRY(void, glDrawTexfOES, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
-GL_ENTRY(void, glDrawTexfvOES, const GLfloat *coords)
-GL_ENTRY(void, glDrawTexiOES, GLint x, GLint y, GLint z, GLint width, GLint height)
-GL_ENTRY(void, glDrawTexivOES, const GLint *coords)
-GL_ENTRY(void, glDrawTexsOES, GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
-GL_ENTRY(void, glDrawTexsvOES, const GLshort *coords)
-GL_ENTRY(void, glDrawTexxOES, GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
-GL_ENTRY(void, glDrawTexxvOES, const GLfixed *coords)
-GL_ENTRY(void, glEGLImageTargetRenderbufferStorageOES, GLenum target, GLeglImageOES image)
-GL_ENTRY(void, glEGLImageTargetTexture2DOES, GLenum target, GLeglImageOES image)
-GL_ENTRY(void, glEnable, GLenum cap)
-GL_ENTRY(void, glEnableClientState, GLenum array)
-GL_ENTRY(void, glEnableDriverControlQCOM, GLuint driverControl)
-GL_ENTRY(void, glEnableVertexAttribArray, GLuint index)
-GL_ENTRY(void, glEndPerfMonitorAMD, GLuint monitor)
-GL_ENTRY(void, glEndQueryEXT, GLenum target)
-GL_ENTRY(void, glEndTilingQCOM, GLbitfield preserveMask)
-GL_ENTRY(void, glExtGetBufferPointervQCOM, GLenum target, GLvoid **params)
-GL_ENTRY(void, glExtGetBuffersQCOM, GLuint *buffers, GLint maxBuffers, GLint *numBuffers)
-GL_ENTRY(void, glExtGetFramebuffersQCOM, GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers)
-GL_ENTRY(void, glExtGetProgramBinarySourceQCOM, GLuint program, GLenum shadertype, GLchar *source, GLint *length)
-GL_ENTRY(void, glExtGetProgramsQCOM, GLuint *programs, GLint maxPrograms, GLint *numPrograms)
-GL_ENTRY(void, glExtGetRenderbuffersQCOM, GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers)
-GL_ENTRY(void, glExtGetShadersQCOM, GLuint *shaders, GLint maxShaders, GLint *numShaders)
-GL_ENTRY(void, glExtGetTexLevelParameterivQCOM, GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params)
-GL_ENTRY(void, glExtGetTexSubImageQCOM, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels)
-GL_ENTRY(void, glExtGetTexturesQCOM, GLuint *textures, GLint maxTextures, GLint *numTextures)
-GL_ENTRY(GLboolean, glExtIsProgramBinaryQCOM, GLuint program)
-GL_ENTRY(void, glExtTexObjectStateOverrideiQCOM, GLenum target, GLenum pname, GLint param)
-GL_ENTRY(void, glFinish, void)
-GL_ENTRY(void, glFinishFenceNV, GLuint fence)
-GL_ENTRY(void, glFlush, void)
-GL_ENTRY(void, glFogf, GLenum pname, GLfloat param)
-GL_ENTRY(void, glFogfv, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glFogx, GLenum pname, GLfixed param)
-GL_ENTRY(void, glFogxOES, GLenum pname, GLfixed param)
-GL_ENTRY(void, glFogxv, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glFogxvOES, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glFramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-GL_ENTRY(void, glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-GL_ENTRY(void, glFramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-GL_ENTRY(void, glFramebufferTexture2DMultisampleEXT, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
-GL_ENTRY(void, glFramebufferTexture2DMultisampleIMG, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
-GL_ENTRY(void, glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-GL_ENTRY(void, glFramebufferTexture3DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-GL_ENTRY(void, glFrontFace, GLenum mode)
-GL_ENTRY(void, glFrustumf, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-GL_ENTRY(void, glFrustumfOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-GL_ENTRY(void, glFrustumx, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-GL_ENTRY(void, glFrustumxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-GL_ENTRY(void, glGenBuffers, GLsizei n, GLuint *buffers)
-GL_ENTRY(void, glGenFencesNV, GLsizei n, GLuint *fences)
-GL_ENTRY(void, glGenFramebuffers, GLsizei n, GLuint* framebuffers)
-GL_ENTRY(void, glGenFramebuffersOES, GLsizei n, GLuint* framebuffers)
-GL_ENTRY(void, glGenPerfMonitorsAMD, GLsizei n, GLuint *monitors)
-GL_ENTRY(void, glGenProgramPipelinesEXT, GLsizei n, GLuint *pipelines)
-GL_ENTRY(void, glGenQueriesEXT, GLsizei n, GLuint *ids)
-GL_ENTRY(void, glGenRenderbuffers, GLsizei n, GLuint* renderbuffers)
-GL_ENTRY(void, glGenRenderbuffersOES, GLsizei n, GLuint* renderbuffers)
-GL_ENTRY(void, glGenTextures, GLsizei n, GLuint *textures)
-GL_ENTRY(void, glGenVertexArraysOES, GLsizei n, GLuint *arrays)
-GL_ENTRY(void, glGenerateMipmap, GLenum target)
-GL_ENTRY(void, glGenerateMipmapOES, GLenum target)
-GL_ENTRY(void, glGetActiveAttrib, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-GL_ENTRY(void, glGetActiveUniform, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-GL_ENTRY(void, glGetAttachedShaders, GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
-GL_ENTRY(int, glGetAttribLocation, GLuint program, const GLchar* name)
-GL_ENTRY(void, glGetBooleanv, GLenum pname, GLboolean *params)
-GL_ENTRY(void, glGetBufferParameteriv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetBufferPointervOES, GLenum target, GLenum pname, GLvoid ** params)
-GL_ENTRY(void, glGetClipPlanef, GLenum pname, GLfloat eqn[4])
-GL_ENTRY(void, glGetClipPlanefOES, GLenum pname, GLfloat eqn[4])
-GL_ENTRY(void, glGetClipPlanex, GLenum pname, GLfixed eqn[4])
-GL_ENTRY(void, glGetClipPlanexOES, GLenum pname, GLfixed eqn[4])
-GL_ENTRY(void, glGetDriverControlStringQCOM, GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString)
-GL_ENTRY(void, glGetDriverControlsQCOM, GLint *num, GLsizei size, GLuint *driverControls)
-GL_ENTRY(GLenum, glGetError, void)
-GL_ENTRY(void, glGetFenceivNV, GLuint fence, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetFixedv, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetFixedvOES, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetFloatv, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetFramebufferAttachmentParameteriv, GLenum target, GLenum attachment, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetFramebufferAttachmentParameterivOES, GLenum target, GLenum attachment, GLenum pname, GLint* params)
-GL_ENTRY(GLenum, glGetGraphicsResetStatusEXT, void)
-GL_ENTRY(void, glGetIntegerv, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetLightfv, GLenum light, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetLightxv, GLenum light, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetLightxvOES, GLenum light, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetMaterialfv, GLenum face, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetMaterialxv, GLenum face, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetMaterialxvOES, GLenum face, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetObjectLabelEXT, GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label)
-GL_ENTRY(void, glGetPerfMonitorCounterDataAMD, GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten)
-GL_ENTRY(void, glGetPerfMonitorCounterInfoAMD, GLuint group, GLuint counter, GLenum pname, GLvoid *data)
-GL_ENTRY(void, glGetPerfMonitorCounterStringAMD, GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString)
-GL_ENTRY(void, glGetPerfMonitorCountersAMD, GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters)
-GL_ENTRY(void, glGetPerfMonitorGroupStringAMD, GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString)
-GL_ENTRY(void, glGetPerfMonitorGroupsAMD, GLint *numGroups, GLsizei groupsSize, GLuint *groups)
-GL_ENTRY(void, glGetPointerv, GLenum pname, GLvoid **params)
-GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary)
-GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-GL_ENTRY(void, glGetProgramPipelineInfoLogEXT, GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
-GL_ENTRY(void, glGetProgramPipelineivEXT, GLuint pipeline, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetProgramiv, GLuint program, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetQueryObjectuivEXT, GLuint id, GLenum pname, GLuint *params)
-GL_ENTRY(void, glGetQueryivEXT, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetRenderbufferParameteriv, GLenum target, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetRenderbufferParameterivOES, GLenum target, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetShaderInfoLog, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-GL_ENTRY(void, glGetShaderPrecisionFormat, GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-GL_ENTRY(void, glGetShaderSource, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
-GL_ENTRY(void, glGetShaderiv, GLuint shader, GLenum pname, GLint* params)
-GL_ENTRY(const GLubyte *, glGetString, GLenum name)
-GL_ENTRY(void, glGetTexEnvfv, GLenum env, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetTexEnviv, GLenum env, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexEnvxv, GLenum env, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetTexEnvxvOES, GLenum env, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetTexGenfvOES, GLenum coord, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetTexGenivOES, GLenum coord, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexGenxvOES, GLenum coord, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetTexParameterfv, GLenum target, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetTexParameteriv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexParameterxv, GLenum target, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetTexParameterxvOES, GLenum target, GLenum pname, GLfixed *params)
-GL_ENTRY(int, glGetUniformLocation, GLuint program, const GLchar* name)
-GL_ENTRY(void, glGetUniformfv, GLuint program, GLint location, GLfloat* params)
-GL_ENTRY(void, glGetUniformiv, GLuint program, GLint location, GLint* params)
-GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, GLvoid** pointer)
-GL_ENTRY(void, glGetVertexAttribfv, GLuint index, GLenum pname, GLfloat* params)
-GL_ENTRY(void, glGetVertexAttribiv, GLuint index, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetnUniformfvEXT, GLuint program, GLint location, GLsizei bufSize, float *params)
-GL_ENTRY(void, glGetnUniformivEXT, GLuint program, GLint location, GLsizei bufSize, GLint *params)
-GL_ENTRY(void, glHint, GLenum target, GLenum mode)
-GL_ENTRY(void, glInsertEventMarkerEXT, GLsizei length, const GLchar *marker)
-GL_ENTRY(GLboolean, glIsBuffer, GLuint buffer)
-GL_ENTRY(GLboolean, glIsEnabled, GLenum cap)
-GL_ENTRY(GLboolean, glIsFenceNV, GLuint fence)
-GL_ENTRY(GLboolean, glIsFramebuffer, GLuint framebuffer)
-GL_ENTRY(GLboolean, glIsFramebufferOES, GLuint framebuffer)
-GL_ENTRY(GLboolean, glIsProgram, GLuint program)
-GL_ENTRY(GLboolean, glIsProgramPipelineEXT, GLuint pipeline)
-GL_ENTRY(GLboolean, glIsQueryEXT, GLuint id)
-GL_ENTRY(GLboolean, glIsRenderbuffer, GLuint renderbuffer)
-GL_ENTRY(GLboolean, glIsRenderbufferOES, GLuint renderbuffer)
-GL_ENTRY(GLboolean, glIsShader, GLuint shader)
-GL_ENTRY(GLboolean, glIsTexture, GLuint texture)
-GL_ENTRY(GLboolean, glIsVertexArrayOES, GLuint array)
-GL_ENTRY(void, glLabelObjectEXT, GLenum type, GLuint object, GLsizei length, const GLchar *label)
-GL_ENTRY(void, glLightModelf, GLenum pname, GLfloat param)
-GL_ENTRY(void, glLightModelfv, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glLightModelx, GLenum pname, GLfixed param)
-GL_ENTRY(void, glLightModelxOES, GLenum pname, GLfixed param)
-GL_ENTRY(void, glLightModelxv, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glLightModelxvOES, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glLightf, GLenum light, GLenum pname, GLfloat param)
-GL_ENTRY(void, glLightfv, GLenum light, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glLightx, GLenum light, GLenum pname, GLfixed param)
-GL_ENTRY(void, glLightxOES, GLenum light, GLenum pname, GLfixed param)
-GL_ENTRY(void, glLightxv, GLenum light, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glLightxvOES, GLenum light, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glLineWidth, GLfloat width)
-GL_ENTRY(void, glLineWidthx, GLfixed width)
-GL_ENTRY(void, glLineWidthxOES, GLfixed width)
-GL_ENTRY(void, glLinkProgram, GLuint program)
-GL_ENTRY(void, glLoadIdentity, void)
-GL_ENTRY(void, glLoadMatrixf, const GLfloat *m)
-GL_ENTRY(void, glLoadMatrixx, const GLfixed *m)
-GL_ENTRY(void, glLoadMatrixxOES, const GLfixed *m)
-GL_ENTRY(void, glLoadPaletteFromModelViewMatrixOES, void)
-GL_ENTRY(void, glLogicOp, GLenum opcode)
-GL_ENTRY(void*, glMapBufferOES, GLenum target, GLenum access)
-GL_ENTRY(void, glMaterialf, GLenum face, GLenum pname, GLfloat param)
-GL_ENTRY(void, glMaterialfv, GLenum face, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glMaterialx, GLenum face, GLenum pname, GLfixed param)
-GL_ENTRY(void, glMaterialxOES, GLenum face, GLenum pname, GLfixed param)
-GL_ENTRY(void, glMaterialxv, GLenum face, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glMaterialxvOES, GLenum face, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glMatrixIndexPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glMatrixMode, GLenum mode)
-GL_ENTRY(void, glMultMatrixf, const GLfloat *m)
-GL_ENTRY(void, glMultMatrixx, const GLfixed *m)
-GL_ENTRY(void, glMultMatrixxOES, const GLfixed *m)
-GL_ENTRY(void, glMultiDrawArraysEXT, GLenum mode, GLint *first, GLsizei *count, GLsizei primcount)
-GL_ENTRY(void, glMultiDrawElementsEXT, GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount)
-GL_ENTRY(void, glMultiTexCoord4f, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-GL_ENTRY(void, glMultiTexCoord4x, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-GL_ENTRY(void, glMultiTexCoord4xOES, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-GL_ENTRY(void, glNormal3f, GLfloat nx, GLfloat ny, GLfloat nz)
-GL_ENTRY(void, glNormal3x, GLfixed nx, GLfixed ny, GLfixed nz)
-GL_ENTRY(void, glNormal3xOES, GLfixed nx, GLfixed ny, GLfixed nz)
-GL_ENTRY(void, glNormalPointer, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glOrthof, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-GL_ENTRY(void, glOrthofOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-GL_ENTRY(void, glOrthox, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-GL_ENTRY(void, glOrthoxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-GL_ENTRY(void, glPixelStorei, GLenum pname, GLint param)
-GL_ENTRY(void, glPointParameterf, GLenum pname, GLfloat param)
-GL_ENTRY(void, glPointParameterfv, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glPointParameterx, GLenum pname, GLfixed param)
-GL_ENTRY(void, glPointParameterxOES, GLenum pname, GLfixed param)
-GL_ENTRY(void, glPointParameterxv, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glPointParameterxvOES, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glPointSize, GLfloat size)
-GL_ENTRY(void, glPointSizePointerOES, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glPointSizex, GLfixed size)
-GL_ENTRY(void, glPointSizexOES, GLfixed size)
-GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units)
-GL_ENTRY(void, glPolygonOffsetx, GLfixed factor, GLfixed units)
-GL_ENTRY(void, glPolygonOffsetxOES, GLfixed factor, GLfixed units)
-GL_ENTRY(void, glPopGroupMarkerEXT, void)
-GL_ENTRY(void, glPopMatrix, void)
-GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length)
-GL_ENTRY(void, glProgramParameteriEXT, GLuint program, GLenum pname, GLint value)
-GL_ENTRY(void, glProgramUniform1fEXT, GLuint program, GLint location, GLfloat x)
-GL_ENTRY(void, glProgramUniform1fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform1iEXT, GLuint program, GLint location, GLint x)
-GL_ENTRY(void, glProgramUniform1ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform2fEXT, GLuint program, GLint location, GLfloat x, GLfloat y)
-GL_ENTRY(void, glProgramUniform2fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform2iEXT, GLuint program, GLint location, GLint x, GLint y)
-GL_ENTRY(void, glProgramUniform2ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform3fEXT, GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glProgramUniform3fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform3iEXT, GLuint program, GLint location, GLint x, GLint y, GLint z)
-GL_ENTRY(void, glProgramUniform3ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform4fEXT, GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-GL_ENTRY(void, glProgramUniform4fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform4iEXT, GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w)
-GL_ENTRY(void, glProgramUniform4ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniformMatrix2fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix3fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix4fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glPushGroupMarkerEXT, GLsizei length, const GLchar *marker)
-GL_ENTRY(void, glPushMatrix, void)
-GL_ENTRY(GLbitfield, glQueryMatrixxOES, GLfixed mantissa[16], GLint exponent[16])
-GL_ENTRY(void, glReadBufferNV, GLenum mode)
-GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
-GL_ENTRY(void, glReadnPixelsEXT, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)
-GL_ENTRY(void, glReleaseShaderCompiler, void)
-GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glRenderbufferStorageMultisampleANGLE, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glRenderbufferStorageMultisampleAPPLE, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glRenderbufferStorageMultisampleEXT, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glRenderbufferStorageMultisampleIMG, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glResolveMultisampleFramebufferAPPLE, void)
-GL_ENTRY(void, glRotatef, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glRotatex, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glRotatexOES, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glSampleCoverage, GLclampf value, GLboolean invert)
-GL_ENTRY(void, glSampleCoveragex, GLclampx value, GLboolean invert)
-GL_ENTRY(void, glSampleCoveragexOES, GLclampx value, GLboolean invert)
-GL_ENTRY(void, glScalef, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glScalex, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glScalexOES, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glScissor, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glSelectPerfMonitorCountersAMD, GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList)
-GL_ENTRY(void, glSetFenceNV, GLuint fence, GLenum condition)
-GL_ENTRY(void, glShadeModel, GLenum mode)
-GL_ENTRY(void, glShaderBinary, GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
-GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const GLchar** string, const GLint* length)
-GL_ENTRY(void, glStartTilingQCOM, GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
-GL_ENTRY(void, glStencilFunc, GLenum func, GLint ref, GLuint mask)
-GL_ENTRY(void, glStencilFuncSeparate, GLenum face, GLenum func, GLint ref, GLuint mask)
-GL_ENTRY(void, glStencilMask, GLuint mask)
-GL_ENTRY(void, glStencilMaskSeparate, GLenum face, GLuint mask)
-GL_ENTRY(void, glStencilOp, GLenum fail, GLenum zfail, GLenum zpass)
-GL_ENTRY(void, glStencilOpSeparate, GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-GL_ENTRY(GLboolean, glTestFenceNV, GLuint fence)
-GL_ENTRY(void, glTexCoordPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glTexEnvf, GLenum target, GLenum pname, GLfloat param)
-GL_ENTRY(void, glTexEnvfv, GLenum target, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glTexEnvi, GLenum target, GLenum pname, GLint param)
-GL_ENTRY(void, glTexEnviv, GLenum target, GLenum pname, const GLint *params)
-GL_ENTRY(void, glTexEnvx, GLenum target, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexEnvxOES, GLenum target, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexEnvxv, GLenum target, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexEnvxvOES, GLenum target, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexGenfOES, GLenum coord, GLenum pname, GLfloat param)
-GL_ENTRY(void, glTexGenfvOES, GLenum coord, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glTexGeniOES, GLenum coord, GLenum pname, GLint param)
-GL_ENTRY(void, glTexGenivOES, GLenum coord, GLenum pname, const GLint *params)
-GL_ENTRY(void, glTexGenxOES, GLenum coord, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexGenxvOES, GLenum coord, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexImage2D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
-GL_ENTRY(void, glTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-GL_ENTRY(void, glTexParameterf, GLenum target, GLenum pname, GLfloat param)
-GL_ENTRY(void, glTexParameterfv, GLenum target, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glTexParameteri, GLenum target, GLenum pname, GLint param)
-GL_ENTRY(void, glTexParameteriv, GLenum target, GLenum pname, const GLint *params)
-GL_ENTRY(void, glTexParameterx, GLenum target, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexParameterxOES, GLenum target, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexParameterxv, GLenum target, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexParameterxvOES, GLenum target, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexStorage1DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
-GL_ENTRY(void, glTexStorage2DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glTexStorage3DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
-GL_ENTRY(void, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
-GL_ENTRY(void, glTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
-GL_ENTRY(void, glTextureStorage1DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
-GL_ENTRY(void, glTextureStorage2DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glTextureStorage3DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
-GL_ENTRY(void, glTranslatef, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glTranslatex, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glTranslatexOES, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glUniform1f, GLint location, GLfloat x)
-GL_ENTRY(void, glUniform1fv, GLint location, GLsizei count, const GLfloat* v)
-GL_ENTRY(void, glUniform1i, GLint location, GLint x)
-GL_ENTRY(void, glUniform1iv, GLint location, GLsizei count, const GLint* v)
-GL_ENTRY(void, glUniform2f, GLint location, GLfloat x, GLfloat y)
-GL_ENTRY(void, glUniform2fv, GLint location, GLsizei count, const GLfloat* v)
-GL_ENTRY(void, glUniform2i, GLint location, GLint x, GLint y)
-GL_ENTRY(void, glUniform2iv, GLint location, GLsizei count, const GLint* v)
-GL_ENTRY(void, glUniform3f, GLint location, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glUniform3fv, GLint location, GLsizei count, const GLfloat* v)
-GL_ENTRY(void, glUniform3i, GLint location, GLint x, GLint y, GLint z)
-GL_ENTRY(void, glUniform3iv, GLint location, GLsizei count, const GLint* v)
-GL_ENTRY(void, glUniform4f, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-GL_ENTRY(void, glUniform4fv, GLint location, GLsizei count, const GLfloat* v)
-GL_ENTRY(void, glUniform4i, GLint location, GLint x, GLint y, GLint z, GLint w)
-GL_ENTRY(void, glUniform4iv, GLint location, GLsizei count, const GLint* v)
-GL_ENTRY(void, glUniformMatrix2fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-GL_ENTRY(void, glUniformMatrix3fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-GL_ENTRY(void, glUniformMatrix4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-GL_ENTRY(GLboolean, glUnmapBufferOES, GLenum target)
-GL_ENTRY(void, glUseProgram, GLuint program)
-GL_ENTRY(void, glUseProgramStagesEXT, GLuint pipeline, GLbitfield stages, GLuint program)
-GL_ENTRY(void, glValidateProgram, GLuint program)
-GL_ENTRY(void, glValidateProgramPipelineEXT, GLuint pipeline)
-GL_ENTRY(void, glVertexAttrib1f, GLuint indx, GLfloat x)
-GL_ENTRY(void, glVertexAttrib1fv, GLuint indx, const GLfloat* values)
-GL_ENTRY(void, glVertexAttrib2f, GLuint indx, GLfloat x, GLfloat y)
-GL_ENTRY(void, glVertexAttrib2fv, GLuint indx, const GLfloat* values)
-GL_ENTRY(void, glVertexAttrib3f, GLuint indx, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glVertexAttrib3fv, GLuint indx, const GLfloat* values)
-GL_ENTRY(void, glVertexAttrib4f, GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-GL_ENTRY(void, glVertexAttrib4fv, GLuint indx, const GLfloat* values)
-GL_ENTRY(void, glVertexAttribPointer, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
-GL_ENTRY(void, glVertexPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glViewport, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glWeightPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
diff --git a/opengl/libs/enums.in b/opengl/libs/enums.in
deleted file mode 100644
index bfbc866..0000000
--- a/opengl/libs/enums.in
+++ /dev/null
@@ -1,702 +0,0 @@
-GL_ENUM(0x0000,GL_POINTS)
-GL_ENUM(0x00000001,GL_VERTEX_SHADER_BIT_EXT)
-GL_ENUM(0x00000002,GL_FRAGMENT_SHADER_BIT_EXT)
-GL_ENUM(0x0001,GL_LINES)
-GL_ENUM(0x0002,GL_LINE_LOOP)
-GL_ENUM(0x0003,GL_LINE_STRIP)
-GL_ENUM(0x0004,GL_TRIANGLES)
-GL_ENUM(0x0005,GL_TRIANGLE_STRIP)
-GL_ENUM(0x0006,GL_TRIANGLE_FAN)
-GL_ENUM(0x0104,GL_ADD)
-GL_ENUM(0x0200,GL_NEVER)
-GL_ENUM(0x0201,GL_LESS)
-GL_ENUM(0x0202,GL_EQUAL)
-GL_ENUM(0x0203,GL_LEQUAL)
-GL_ENUM(0x0204,GL_GREATER)
-GL_ENUM(0x0205,GL_NOTEQUAL)
-GL_ENUM(0x0206,GL_GEQUAL)
-GL_ENUM(0x0207,GL_ALWAYS)
-GL_ENUM(0x0300,GL_SRC_COLOR)
-GL_ENUM(0x0301,GL_ONE_MINUS_SRC_COLOR)
-GL_ENUM(0x0302,GL_SRC_ALPHA)
-GL_ENUM(0x0303,GL_ONE_MINUS_SRC_ALPHA)
-GL_ENUM(0x0304,GL_DST_ALPHA)
-GL_ENUM(0x0305,GL_ONE_MINUS_DST_ALPHA)
-GL_ENUM(0x0306,GL_DST_COLOR)
-GL_ENUM(0x0307,GL_ONE_MINUS_DST_COLOR)
-GL_ENUM(0x0308,GL_SRC_ALPHA_SATURATE)
-GL_ENUM(0x0404,GL_FRONT)
-GL_ENUM(0x0405,GL_BACK)
-GL_ENUM(0x0408,GL_FRONT_AND_BACK)
-GL_ENUM(0x0500,GL_INVALID_ENUM)
-GL_ENUM(0x0501,GL_INVALID_VALUE)
-GL_ENUM(0x0502,GL_INVALID_OPERATION)
-GL_ENUM(0x0503,GL_STACK_OVERFLOW)
-GL_ENUM(0x0504,GL_STACK_UNDERFLOW)
-GL_ENUM(0x0505,GL_OUT_OF_MEMORY)
-GL_ENUM(0x0506,GL_INVALID_FRAMEBUFFER_OPERATION_OES)
-GL_ENUM(0x0800,GL_EXP)
-GL_ENUM(0x0801,GL_EXP2)
-GL_ENUM(0x0900,GL_CW)
-GL_ENUM(0x0901,GL_CCW)
-GL_ENUM(0x0B00,GL_CURRENT_COLOR)
-GL_ENUM(0x0B02,GL_CURRENT_NORMAL)
-GL_ENUM(0x0B03,GL_CURRENT_TEXTURE_COORDS)
-GL_ENUM(0x0B10,GL_POINT_SMOOTH)
-GL_ENUM(0x0B11,GL_POINT_SIZE)
-GL_ENUM(0x0B12,GL_SMOOTH_POINT_SIZE_RANGE)
-GL_ENUM(0x0B20,GL_LINE_SMOOTH)
-GL_ENUM(0x0B21,GL_LINE_WIDTH)
-GL_ENUM(0x0B22,GL_SMOOTH_LINE_WIDTH_RANGE)
-GL_ENUM(0x0B44,GL_CULL_FACE)
-GL_ENUM(0x0B45,GL_CULL_FACE_MODE)
-GL_ENUM(0x0B46,GL_FRONT_FACE)
-GL_ENUM(0x0B50,GL_LIGHTING)
-GL_ENUM(0x0B52,GL_LIGHT_MODEL_TWO_SIDE)
-GL_ENUM(0x0B53,GL_LIGHT_MODEL_AMBIENT)
-GL_ENUM(0x0B54,GL_SHADE_MODEL)
-GL_ENUM(0x0B57,GL_COLOR_MATERIAL)
-GL_ENUM(0x0B60,GL_FOG)
-GL_ENUM(0x0B62,GL_FOG_DENSITY)
-GL_ENUM(0x0B63,GL_FOG_START)
-GL_ENUM(0x0B64,GL_FOG_END)
-GL_ENUM(0x0B65,GL_FOG_MODE)
-GL_ENUM(0x0B66,GL_FOG_COLOR)
-GL_ENUM(0x0B70,GL_DEPTH_RANGE)
-GL_ENUM(0x0B71,GL_DEPTH_TEST)
-GL_ENUM(0x0B72,GL_DEPTH_WRITEMASK)
-GL_ENUM(0x0B73,GL_DEPTH_CLEAR_VALUE)
-GL_ENUM(0x0B74,GL_DEPTH_FUNC)
-GL_ENUM(0x0B90,GL_STENCIL_TEST)
-GL_ENUM(0x0B91,GL_STENCIL_CLEAR_VALUE)
-GL_ENUM(0x0B92,GL_STENCIL_FUNC)
-GL_ENUM(0x0B93,GL_STENCIL_VALUE_MASK)
-GL_ENUM(0x0B94,GL_STENCIL_FAIL)
-GL_ENUM(0x0B95,GL_STENCIL_PASS_DEPTH_FAIL)
-GL_ENUM(0x0B96,GL_STENCIL_PASS_DEPTH_PASS)
-GL_ENUM(0x0B97,GL_STENCIL_REF)
-GL_ENUM(0x0B98,GL_STENCIL_WRITEMASK)
-GL_ENUM(0x0BA0,GL_MATRIX_MODE)
-GL_ENUM(0x0BA1,GL_NORMALIZE)
-GL_ENUM(0x0BA2,GL_VIEWPORT)
-GL_ENUM(0x0BA3,GL_MODELVIEW_STACK_DEPTH)
-GL_ENUM(0x0BA4,GL_PROJECTION_STACK_DEPTH)
-GL_ENUM(0x0BA5,GL_TEXTURE_STACK_DEPTH)
-GL_ENUM(0x0BA6,GL_MODELVIEW_MATRIX)
-GL_ENUM(0x0BA7,GL_PROJECTION_MATRIX)
-GL_ENUM(0x0BA8,GL_TEXTURE_MATRIX)
-GL_ENUM(0x0BC0,GL_ALPHA_TEST)
-GL_ENUM(0x0BC1,GL_ALPHA_TEST_FUNC)
-GL_ENUM(0x0BC2,GL_ALPHA_TEST_REF)
-GL_ENUM(0x0BD0,GL_DITHER)
-GL_ENUM(0x0BE0,GL_BLEND_DST)
-GL_ENUM(0x0BE1,GL_BLEND_SRC)
-GL_ENUM(0x0BE2,GL_BLEND)
-GL_ENUM(0x0BF0,GL_LOGIC_OP_MODE)
-GL_ENUM(0x0BF2,GL_COLOR_LOGIC_OP)
-GL_ENUM(0x0C02,GL_READ_BUFFER_NV)
-GL_ENUM(0x0C10,GL_SCISSOR_BOX)
-GL_ENUM(0x0C11,GL_SCISSOR_TEST)
-GL_ENUM(0x0C22,GL_COLOR_CLEAR_VALUE)
-GL_ENUM(0x0C23,GL_COLOR_WRITEMASK)
-GL_ENUM(0x0C50,GL_PERSPECTIVE_CORRECTION_HINT)
-GL_ENUM(0x0C51,GL_POINT_SMOOTH_HINT)
-GL_ENUM(0x0C52,GL_LINE_SMOOTH_HINT)
-GL_ENUM(0x0C54,GL_FOG_HINT)
-GL_ENUM(0x0CF2,GL_UNPACK_ROW_LENGTH)
-GL_ENUM(0x0CF3,GL_UNPACK_SKIP_ROWS)
-GL_ENUM(0x0CF4,GL_UNPACK_SKIP_PIXELS)
-GL_ENUM(0x0CF5,GL_UNPACK_ALIGNMENT)
-GL_ENUM(0x0D05,GL_PACK_ALIGNMENT)
-GL_ENUM(0x0D1C,GL_ALPHA_SCALE)
-GL_ENUM(0x0D31,GL_MAX_LIGHTS)
-GL_ENUM(0x0D32,GL_MAX_CLIP_PLANES)
-GL_ENUM(0x0D33,GL_MAX_TEXTURE_SIZE)
-GL_ENUM(0x0D36,GL_MAX_MODELVIEW_STACK_DEPTH)
-GL_ENUM(0x0D38,GL_MAX_PROJECTION_STACK_DEPTH)
-GL_ENUM(0x0D39,GL_MAX_TEXTURE_STACK_DEPTH)
-GL_ENUM(0x0D3A,GL_MAX_VIEWPORT_DIMS)
-GL_ENUM(0x0D50,GL_SUBPIXEL_BITS)
-GL_ENUM(0x0D52,GL_RED_BITS)
-GL_ENUM(0x0D53,GL_GREEN_BITS)
-GL_ENUM(0x0D54,GL_BLUE_BITS)
-GL_ENUM(0x0D55,GL_ALPHA_BITS)
-GL_ENUM(0x0D56,GL_DEPTH_BITS)
-GL_ENUM(0x0D57,GL_STENCIL_BITS)
-GL_ENUM(0x0DE1,GL_TEXTURE_2D)
-GL_ENUM(0x1100,GL_DONT_CARE)
-GL_ENUM(0x1101,GL_FASTEST)
-GL_ENUM(0x1102,GL_NICEST)
-GL_ENUM(0x1200,GL_AMBIENT)
-GL_ENUM(0x1201,GL_DIFFUSE)
-GL_ENUM(0x1202,GL_SPECULAR)
-GL_ENUM(0x1203,GL_POSITION)
-GL_ENUM(0x1204,GL_SPOT_DIRECTION)
-GL_ENUM(0x1205,GL_SPOT_EXPONENT)
-GL_ENUM(0x1206,GL_SPOT_CUTOFF)
-GL_ENUM(0x1207,GL_CONSTANT_ATTENUATION)
-GL_ENUM(0x1208,GL_LINEAR_ATTENUATION)
-GL_ENUM(0x1209,GL_QUADRATIC_ATTENUATION)
-GL_ENUM(0x1400,GL_BYTE)
-GL_ENUM(0x1401,GL_UNSIGNED_BYTE)
-GL_ENUM(0x1402,GL_SHORT)
-GL_ENUM(0x1403,GL_UNSIGNED_SHORT)
-GL_ENUM(0x1404,GL_INT)
-GL_ENUM(0x1405,GL_UNSIGNED_INT)
-GL_ENUM(0x1406,GL_FLOAT)
-GL_ENUM(0x140C,GL_FIXED)
-GL_ENUM(0x1500,GL_CLEAR)
-GL_ENUM(0x1501,GL_AND)
-GL_ENUM(0x1502,GL_AND_REVERSE)
-GL_ENUM(0x1503,GL_COPY)
-GL_ENUM(0x1504,GL_AND_INVERTED)
-GL_ENUM(0x1505,GL_NOOP)
-GL_ENUM(0x1506,GL_XOR)
-GL_ENUM(0x1507,GL_OR)
-GL_ENUM(0x1508,GL_NOR)
-GL_ENUM(0x1509,GL_EQUIV)
-GL_ENUM(0x150A,GL_INVERT)
-GL_ENUM(0x150B,GL_OR_REVERSE)
-GL_ENUM(0x150C,GL_COPY_INVERTED)
-GL_ENUM(0x150D,GL_OR_INVERTED)
-GL_ENUM(0x150E,GL_NAND)
-GL_ENUM(0x150F,GL_SET)
-GL_ENUM(0x1600,GL_EMISSION)
-GL_ENUM(0x1601,GL_SHININESS)
-GL_ENUM(0x1602,GL_AMBIENT_AND_DIFFUSE)
-GL_ENUM(0x1700,GL_MODELVIEW)
-GL_ENUM(0x1701,GL_PROJECTION)
-GL_ENUM(0x1702,GL_TEXTURE)
-GL_ENUM(0x1800,GL_COLOR_EXT)
-GL_ENUM(0x1801,GL_DEPTH_EXT)
-GL_ENUM(0x1802,GL_STENCIL_EXT)
-GL_ENUM(0x1901,GL_STENCIL_INDEX)
-GL_ENUM(0x1902,GL_DEPTH_COMPONENT)
-GL_ENUM(0x1903,GL_RED_EXT)
-GL_ENUM(0x1906,GL_ALPHA)
-GL_ENUM(0x1907,GL_RGB)
-GL_ENUM(0x1908,GL_RGBA)
-GL_ENUM(0x1909,GL_LUMINANCE)
-GL_ENUM(0x190A,GL_LUMINANCE_ALPHA)
-GL_ENUM(0x1D00,GL_FLAT)
-GL_ENUM(0x1D01,GL_SMOOTH)
-GL_ENUM(0x1E00,GL_KEEP)
-GL_ENUM(0x1E01,GL_REPLACE)
-GL_ENUM(0x1E02,GL_INCR)
-GL_ENUM(0x1E03,GL_DECR)
-GL_ENUM(0x1F00,GL_VENDOR)
-GL_ENUM(0x1F01,GL_RENDERER)
-GL_ENUM(0x1F02,GL_VERSION)
-GL_ENUM(0x1F03,GL_EXTENSIONS)
-GL_ENUM(0x2100,GL_MODULATE)
-GL_ENUM(0x2101,GL_DECAL)
-GL_ENUM(0x2200,GL_TEXTURE_ENV_MODE)
-GL_ENUM(0x2201,GL_TEXTURE_ENV_COLOR)
-GL_ENUM(0x2300,GL_TEXTURE_ENV)
-GL_ENUM(0x2500,GL_TEXTURE_GEN_MODE_OES)
-GL_ENUM(0x2600,GL_NEAREST)
-GL_ENUM(0x2601,GL_LINEAR)
-GL_ENUM(0x2700,GL_NEAREST_MIPMAP_NEAREST)
-GL_ENUM(0x2701,GL_LINEAR_MIPMAP_NEAREST)
-GL_ENUM(0x2702,GL_NEAREST_MIPMAP_LINEAR)
-GL_ENUM(0x2703,GL_LINEAR_MIPMAP_LINEAR)
-GL_ENUM(0x2800,GL_TEXTURE_MAG_FILTER)
-GL_ENUM(0x2801,GL_TEXTURE_MIN_FILTER)
-GL_ENUM(0x2802,GL_TEXTURE_WRAP_S)
-GL_ENUM(0x2803,GL_TEXTURE_WRAP_T)
-GL_ENUM(0x2901,GL_REPEAT)
-GL_ENUM(0x2A00,GL_POLYGON_OFFSET_UNITS)
-GL_ENUM(0x3000,GL_CLIP_PLANE0)
-GL_ENUM(0x3001,GL_CLIP_PLANE1)
-GL_ENUM(0x3002,GL_CLIP_PLANE2)
-GL_ENUM(0x3003,GL_CLIP_PLANE3)
-GL_ENUM(0x3004,GL_CLIP_PLANE4)
-GL_ENUM(0x3005,GL_CLIP_PLANE5)
-GL_ENUM(0x4000,GL_LIGHT0)
-GL_ENUM(0x4001,GL_LIGHT1)
-GL_ENUM(0x4002,GL_LIGHT2)
-GL_ENUM(0x4003,GL_LIGHT3)
-GL_ENUM(0x4004,GL_LIGHT4)
-GL_ENUM(0x4005,GL_LIGHT5)
-GL_ENUM(0x4006,GL_LIGHT6)
-GL_ENUM(0x4007,GL_LIGHT7)
-GL_ENUM(0x8000,GL_COVERAGE_BUFFER_BIT_NV)
-GL_ENUM(0x8001,GL_CONSTANT_COLOR)
-GL_ENUM(0x8002,GL_ONE_MINUS_CONSTANT_COLOR)
-GL_ENUM(0x8003,GL_CONSTANT_ALPHA)
-GL_ENUM(0x8004,GL_ONE_MINUS_CONSTANT_ALPHA)
-GL_ENUM(0x8005,GL_BLEND_COLOR)
-GL_ENUM(0x8006,GL_FUNC_ADD_OES)
-GL_ENUM(0x8007,GL_MIN_EXT)
-GL_ENUM(0x8008,GL_MAX_EXT)
-GL_ENUM(0x8009,GL_BLEND_EQUATION_RGB_OES)
-GL_ENUM(0x800A,GL_FUNC_SUBTRACT_OES)
-GL_ENUM(0x800B,GL_FUNC_REVERSE_SUBTRACT_OES)
-GL_ENUM(0x8033,GL_UNSIGNED_SHORT_4_4_4_4)
-GL_ENUM(0x8034,GL_UNSIGNED_SHORT_5_5_5_1)
-GL_ENUM(0x8037,GL_POLYGON_OFFSET_FILL)
-GL_ENUM(0x8038,GL_POLYGON_OFFSET_FACTOR)
-GL_ENUM(0x803A,GL_RESCALE_NORMAL)
-GL_ENUM(0x803C,GL_ALPHA8_EXT)
-GL_ENUM(0x8040,GL_LUMINANCE8_EXT)
-GL_ENUM(0x8045,GL_LUMINANCE8_ALPHA8_EXT)
-GL_ENUM(0x8051,GL_RGB8_OES)
-GL_ENUM(0x8052,GL_RGB10_EXT)
-GL_ENUM(0x8056,GL_RGBA4_OES)
-GL_ENUM(0x8057,GL_RGB5_A1_OES)
-GL_ENUM(0x8058,GL_RGBA8_OES)
-GL_ENUM(0x8059,GL_RGB10_A2_EXT)
-GL_ENUM(0x8069,GL_TEXTURE_BINDING_2D)
-GL_ENUM(0x806A,GL_TEXTURE_BINDING_3D_OES)
-GL_ENUM(0x806F,GL_TEXTURE_3D_OES)
-GL_ENUM(0x8072,GL_TEXTURE_WRAP_R_OES)
-GL_ENUM(0x8073,GL_MAX_3D_TEXTURE_SIZE_OES)
-GL_ENUM(0x8074,GL_VERTEX_ARRAY)
-GL_ENUM(0x8075,GL_NORMAL_ARRAY)
-GL_ENUM(0x8076,GL_COLOR_ARRAY)
-GL_ENUM(0x8078,GL_TEXTURE_COORD_ARRAY)
-GL_ENUM(0x807A,GL_VERTEX_ARRAY_SIZE)
-GL_ENUM(0x807B,GL_VERTEX_ARRAY_TYPE)
-GL_ENUM(0x807C,GL_VERTEX_ARRAY_STRIDE)
-GL_ENUM(0x807E,GL_NORMAL_ARRAY_TYPE)
-GL_ENUM(0x807F,GL_NORMAL_ARRAY_STRIDE)
-GL_ENUM(0x8081,GL_COLOR_ARRAY_SIZE)
-GL_ENUM(0x8082,GL_COLOR_ARRAY_TYPE)
-GL_ENUM(0x8083,GL_COLOR_ARRAY_STRIDE)
-GL_ENUM(0x8088,GL_TEXTURE_COORD_ARRAY_SIZE)
-GL_ENUM(0x8089,GL_TEXTURE_COORD_ARRAY_TYPE)
-GL_ENUM(0x808A,GL_TEXTURE_COORD_ARRAY_STRIDE)
-GL_ENUM(0x808E,GL_VERTEX_ARRAY_POINTER)
-GL_ENUM(0x808F,GL_NORMAL_ARRAY_POINTER)
-GL_ENUM(0x8090,GL_COLOR_ARRAY_POINTER)
-GL_ENUM(0x8092,GL_TEXTURE_COORD_ARRAY_POINTER)
-GL_ENUM(0x809D,GL_MULTISAMPLE)
-GL_ENUM(0x809E,GL_SAMPLE_ALPHA_TO_COVERAGE)
-GL_ENUM(0x809F,GL_SAMPLE_ALPHA_TO_ONE)
-GL_ENUM(0x80A0,GL_SAMPLE_COVERAGE)
-GL_ENUM(0x80A8,GL_SAMPLE_BUFFERS)
-GL_ENUM(0x80A9,GL_SAMPLES)
-GL_ENUM(0x80AA,GL_SAMPLE_COVERAGE_VALUE)
-GL_ENUM(0x80AB,GL_SAMPLE_COVERAGE_INVERT)
-GL_ENUM(0x80C8,GL_BLEND_DST_RGB_OES)
-GL_ENUM(0x80C9,GL_BLEND_SRC_RGB_OES)
-GL_ENUM(0x80CA,GL_BLEND_DST_ALPHA_OES)
-GL_ENUM(0x80CB,GL_BLEND_SRC_ALPHA_OES)
-GL_ENUM(0x80E1,GL_BGRA_EXT)
-GL_ENUM(0x8126,GL_POINT_SIZE_MIN)
-GL_ENUM(0x8127,GL_POINT_SIZE_MAX)
-GL_ENUM(0x8128,GL_POINT_FADE_THRESHOLD_SIZE)
-GL_ENUM(0x8129,GL_POINT_DISTANCE_ATTENUATION)
-GL_ENUM(0x812F,GL_CLAMP_TO_EDGE)
-GL_ENUM(0x813D,GL_TEXTURE_MAX_LEVEL_APPLE)
-GL_ENUM(0x8191,GL_GENERATE_MIPMAP)
-GL_ENUM(0x8192,GL_GENERATE_MIPMAP_HINT)
-GL_ENUM(0x81A5,GL_DEPTH_COMPONENT16_OES)
-GL_ENUM(0x81A6,GL_DEPTH_COMPONENT24_OES)
-GL_ENUM(0x81A7,GL_DEPTH_COMPONENT32_OES)
-GL_ENUM(0x8210,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT)
-GL_ENUM(0x8211,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)
-GL_ENUM(0x8227,GL_RG_EXT)
-GL_ENUM(0x8229,GL_R8_EXT)
-GL_ENUM(0x822B,GL_RG8_EXT)
-GL_ENUM(0x822D,GL_R16F_EXT)
-GL_ENUM(0x822F,GL_RG16F_EXT)
-GL_ENUM(0x8252,GL_LOSE_CONTEXT_ON_RESET_EXT)
-GL_ENUM(0x8253,GL_GUILTY_CONTEXT_RESET_EXT)
-GL_ENUM(0x8254,GL_INNOCENT_CONTEXT_RESET_EXT)
-GL_ENUM(0x8255,GL_UNKNOWN_CONTEXT_RESET_EXT)
-GL_ENUM(0x8256,GL_RESET_NOTIFICATION_STRATEGY_EXT)
-GL_ENUM(0x8258,GL_PROGRAM_SEPARABLE_EXT)
-GL_ENUM(0x8259,GL_ACTIVE_PROGRAM_EXT)
-GL_ENUM(0x825A,GL_PROGRAM_PIPELINE_BINDING_EXT)
-GL_ENUM(0x8261,GL_NO_RESET_NOTIFICATION_EXT)
-GL_ENUM(0x8363,GL_UNSIGNED_SHORT_5_6_5)
-GL_ENUM(0x8365,GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT)
-GL_ENUM(0x8366,GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT)
-GL_ENUM(0x8368,GL_UNSIGNED_INT_2_10_10_10_REV_EXT)
-GL_ENUM(0x8370,GL_MIRRORED_REPEAT_OES)
-GL_ENUM(0x83F0,GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
-GL_ENUM(0x83F1,GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
-GL_ENUM(0x846D,GL_ALIASED_POINT_SIZE_RANGE)
-GL_ENUM(0x846E,GL_ALIASED_LINE_WIDTH_RANGE)
-GL_ENUM(0x84C0,GL_TEXTURE0)
-GL_ENUM(0x84C1,GL_TEXTURE1)
-GL_ENUM(0x84C2,GL_TEXTURE2)
-GL_ENUM(0x84C3,GL_TEXTURE3)
-GL_ENUM(0x84C4,GL_TEXTURE4)
-GL_ENUM(0x84C5,GL_TEXTURE5)
-GL_ENUM(0x84C6,GL_TEXTURE6)
-GL_ENUM(0x84C7,GL_TEXTURE7)
-GL_ENUM(0x84C8,GL_TEXTURE8)
-GL_ENUM(0x84C9,GL_TEXTURE9)
-GL_ENUM(0x84CA,GL_TEXTURE10)
-GL_ENUM(0x84CB,GL_TEXTURE11)
-GL_ENUM(0x84CC,GL_TEXTURE12)
-GL_ENUM(0x84CD,GL_TEXTURE13)
-GL_ENUM(0x84CE,GL_TEXTURE14)
-GL_ENUM(0x84CF,GL_TEXTURE15)
-GL_ENUM(0x84D0,GL_TEXTURE16)
-GL_ENUM(0x84D1,GL_TEXTURE17)
-GL_ENUM(0x84D2,GL_TEXTURE18)
-GL_ENUM(0x84D3,GL_TEXTURE19)
-GL_ENUM(0x84D4,GL_TEXTURE20)
-GL_ENUM(0x84D5,GL_TEXTURE21)
-GL_ENUM(0x84D6,GL_TEXTURE22)
-GL_ENUM(0x84D7,GL_TEXTURE23)
-GL_ENUM(0x84D8,GL_TEXTURE24)
-GL_ENUM(0x84D9,GL_TEXTURE25)
-GL_ENUM(0x84DA,GL_TEXTURE26)
-GL_ENUM(0x84DB,GL_TEXTURE27)
-GL_ENUM(0x84DC,GL_TEXTURE28)
-GL_ENUM(0x84DD,GL_TEXTURE29)
-GL_ENUM(0x84DE,GL_TEXTURE30)
-GL_ENUM(0x84DF,GL_TEXTURE31)
-GL_ENUM(0x84E0,GL_ACTIVE_TEXTURE)
-GL_ENUM(0x84E1,GL_CLIENT_ACTIVE_TEXTURE)
-GL_ENUM(0x84E2,GL_MAX_TEXTURE_UNITS)
-GL_ENUM(0x84E7,GL_SUBTRACT)
-GL_ENUM(0x84E8,GL_MAX_RENDERBUFFER_SIZE_OES)
-GL_ENUM(0x84F2,GL_ALL_COMPLETED_NV)
-GL_ENUM(0x84F3,GL_FENCE_STATUS_NV)
-GL_ENUM(0x84F4,GL_FENCE_CONDITION_NV)
-GL_ENUM(0x84F9,GL_DEPTH_STENCIL_OES)
-GL_ENUM(0x84FA,GL_UNSIGNED_INT_24_8_OES)
-GL_ENUM(0x84FD,GL_MAX_TEXTURE_LOD_BIAS_EXT)
-GL_ENUM(0x84FE,GL_TEXTURE_MAX_ANISOTROPY_EXT)
-GL_ENUM(0x84FF,GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT)
-GL_ENUM(0x8500,GL_TEXTURE_FILTER_CONTROL_EXT)
-GL_ENUM(0x8501,GL_TEXTURE_LOD_BIAS_EXT)
-GL_ENUM(0x8507,GL_INCR_WRAP_OES)
-GL_ENUM(0x8508,GL_DECR_WRAP_OES)
-GL_ENUM(0x8511,GL_NORMAL_MAP_OES)
-GL_ENUM(0x8512,GL_REFLECTION_MAP_OES)
-GL_ENUM(0x8513,GL_TEXTURE_CUBE_MAP_OES)
-GL_ENUM(0x8514,GL_TEXTURE_BINDING_CUBE_MAP_OES)
-GL_ENUM(0x8515,GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES)
-GL_ENUM(0x8516,GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES)
-GL_ENUM(0x8517,GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES)
-GL_ENUM(0x8518,GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES)
-GL_ENUM(0x8519,GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES)
-GL_ENUM(0x851A,GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES)
-GL_ENUM(0x851C,GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES)
-GL_ENUM(0x8570,GL_COMBINE)
-GL_ENUM(0x8571,GL_COMBINE_RGB)
-GL_ENUM(0x8572,GL_COMBINE_ALPHA)
-GL_ENUM(0x8573,GL_RGB_SCALE)
-GL_ENUM(0x8574,GL_ADD_SIGNED)
-GL_ENUM(0x8575,GL_INTERPOLATE)
-GL_ENUM(0x8576,GL_CONSTANT)
-GL_ENUM(0x8577,GL_PRIMARY_COLOR)
-GL_ENUM(0x8578,GL_PREVIOUS)
-GL_ENUM(0x8580,GL_SRC0_RGB)
-GL_ENUM(0x8581,GL_SRC1_RGB)
-GL_ENUM(0x8582,GL_SRC2_RGB)
-GL_ENUM(0x8588,GL_SRC0_ALPHA)
-GL_ENUM(0x8589,GL_SRC1_ALPHA)
-GL_ENUM(0x858A,GL_SRC2_ALPHA)
-GL_ENUM(0x8590,GL_OPERAND0_RGB)
-GL_ENUM(0x8591,GL_OPERAND1_RGB)
-GL_ENUM(0x8592,GL_OPERAND2_RGB)
-GL_ENUM(0x8598,GL_OPERAND0_ALPHA)
-GL_ENUM(0x8599,GL_OPERAND1_ALPHA)
-GL_ENUM(0x859A,GL_OPERAND2_ALPHA)
-GL_ENUM(0x85B5,GL_VERTEX_ARRAY_BINDING_OES)
-GL_ENUM(0x85BA,GL_UNSIGNED_SHORT_8_8_APPLE)
-GL_ENUM(0x85BB,GL_UNSIGNED_SHORT_8_8_REV_APPLE)
-GL_ENUM(0x8622,GL_VERTEX_ATTRIB_ARRAY_ENABLED)
-GL_ENUM(0x8623,GL_VERTEX_ATTRIB_ARRAY_SIZE)
-GL_ENUM(0x8624,GL_VERTEX_ATTRIB_ARRAY_STRIDE)
-GL_ENUM(0x8625,GL_VERTEX_ATTRIB_ARRAY_TYPE)
-GL_ENUM(0x8626,GL_CURRENT_VERTEX_ATTRIB)
-GL_ENUM(0x8645,GL_VERTEX_ATTRIB_ARRAY_POINTER)
-GL_ENUM(0x86A2,GL_NUM_COMPRESSED_TEXTURE_FORMATS)
-GL_ENUM(0x86A3,GL_COMPRESSED_TEXTURE_FORMATS)
-GL_ENUM(0x86A4,GL_MAX_VERTEX_UNITS_OES)
-GL_ENUM(0x86A9,GL_WEIGHT_ARRAY_TYPE_OES)
-GL_ENUM(0x86AA,GL_WEIGHT_ARRAY_STRIDE_OES)
-GL_ENUM(0x86AB,GL_WEIGHT_ARRAY_SIZE_OES)
-GL_ENUM(0x86AC,GL_WEIGHT_ARRAY_POINTER_OES)
-GL_ENUM(0x86AD,GL_WEIGHT_ARRAY_OES)
-GL_ENUM(0x86AE,GL_DOT3_RGB)
-GL_ENUM(0x86AF,GL_DOT3_RGBA)
-GL_ENUM(0x8740,GL_Z400_BINARY_AMD)
-GL_ENUM(0x8741,GL_PROGRAM_BINARY_LENGTH_OES)
-GL_ENUM(0x8764,GL_BUFFER_SIZE)
-GL_ENUM(0x8765,GL_BUFFER_USAGE)
-GL_ENUM(0x87EE,GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD)
-GL_ENUM(0x87F9,GL_3DC_X_AMD)
-GL_ENUM(0x87FA,GL_3DC_XY_AMD)
-GL_ENUM(0x87FE,GL_NUM_PROGRAM_BINARY_FORMATS_OES)
-GL_ENUM(0x87FF,GL_PROGRAM_BINARY_FORMATS_OES)
-GL_ENUM(0x8800,GL_STENCIL_BACK_FUNC)
-GL_ENUM(0x8801,GL_STENCIL_BACK_FAIL)
-GL_ENUM(0x8802,GL_STENCIL_BACK_PASS_DEPTH_FAIL)
-GL_ENUM(0x8803,GL_STENCIL_BACK_PASS_DEPTH_PASS)
-GL_ENUM(0x8814,GL_RGBA32F_EXT)
-GL_ENUM(0x8815,GL_RGB32F_EXT)
-GL_ENUM(0x8816,GL_ALPHA32F_EXT)
-GL_ENUM(0x8818,GL_LUMINANCE32F_EXT)
-GL_ENUM(0x8819,GL_LUMINANCE_ALPHA32F_EXT)
-GL_ENUM(0x881A,GL_RGBA16F_EXT)
-GL_ENUM(0x881B,GL_RGB16F_EXT)
-GL_ENUM(0x881C,GL_ALPHA16F_EXT)
-GL_ENUM(0x881E,GL_LUMINANCE16F_EXT)
-GL_ENUM(0x881F,GL_LUMINANCE_ALPHA16F_EXT)
-GL_ENUM(0x8823,GL_WRITEONLY_RENDERING_QCOM)
-GL_ENUM(0x8824,GL_MAX_DRAW_BUFFERS_NV)
-GL_ENUM(0x8825,GL_DRAW_BUFFER0_NV)
-GL_ENUM(0x8826,GL_DRAW_BUFFER1_NV)
-GL_ENUM(0x8827,GL_DRAW_BUFFER2_NV)
-GL_ENUM(0x8828,GL_DRAW_BUFFER3_NV)
-GL_ENUM(0x8829,GL_DRAW_BUFFER4_NV)
-GL_ENUM(0x882A,GL_DRAW_BUFFER5_NV)
-GL_ENUM(0x882B,GL_DRAW_BUFFER6_NV)
-GL_ENUM(0x882C,GL_DRAW_BUFFER7_NV)
-GL_ENUM(0x882D,GL_DRAW_BUFFER8_NV)
-GL_ENUM(0x882E,GL_DRAW_BUFFER9_NV)
-GL_ENUM(0x882F,GL_DRAW_BUFFER10_NV)
-GL_ENUM(0x8830,GL_DRAW_BUFFER11_NV)
-GL_ENUM(0x8831,GL_DRAW_BUFFER12_NV)
-GL_ENUM(0x8832,GL_DRAW_BUFFER13_NV)
-GL_ENUM(0x8833,GL_DRAW_BUFFER14_NV)
-GL_ENUM(0x8834,GL_DRAW_BUFFER15_NV)
-GL_ENUM(0x883D,GL_BLEND_EQUATION_ALPHA_OES)
-GL_ENUM(0x8840,GL_MATRIX_PALETTE_OES)
-GL_ENUM(0x8842,GL_MAX_PALETTE_MATRICES_OES)
-GL_ENUM(0x8843,GL_CURRENT_PALETTE_MATRIX_OES)
-GL_ENUM(0x8844,GL_MATRIX_INDEX_ARRAY_OES)
-GL_ENUM(0x8846,GL_MATRIX_INDEX_ARRAY_SIZE_OES)
-GL_ENUM(0x8847,GL_MATRIX_INDEX_ARRAY_TYPE_OES)
-GL_ENUM(0x8848,GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
-GL_ENUM(0x8849,GL_MATRIX_INDEX_ARRAY_POINTER_OES)
-GL_ENUM(0x884C,GL_TEXTURE_COMPARE_MODE_EXT)
-GL_ENUM(0x884D,GL_TEXTURE_COMPARE_FUNC_EXT)
-GL_ENUM(0x884E,GL_COMPARE_REF_TO_TEXTURE_EXT)
-GL_ENUM(0x8861,GL_POINT_SPRITE_OES)
-GL_ENUM(0x8862,GL_COORD_REPLACE_OES)
-GL_ENUM(0x8865,GL_CURRENT_QUERY_EXT)
-GL_ENUM(0x8866,GL_QUERY_RESULT_EXT)
-GL_ENUM(0x8867,GL_QUERY_RESULT_AVAILABLE_EXT)
-GL_ENUM(0x8869,GL_MAX_VERTEX_ATTRIBS)
-GL_ENUM(0x886A,GL_VERTEX_ATTRIB_ARRAY_NORMALIZED)
-GL_ENUM(0x8872,GL_MAX_TEXTURE_IMAGE_UNITS)
-GL_ENUM(0x8892,GL_ARRAY_BUFFER)
-GL_ENUM(0x8893,GL_ELEMENT_ARRAY_BUFFER)
-GL_ENUM(0x8894,GL_ARRAY_BUFFER_BINDING)
-GL_ENUM(0x8895,GL_ELEMENT_ARRAY_BUFFER_BINDING)
-GL_ENUM(0x8896,GL_VERTEX_ARRAY_BUFFER_BINDING)
-GL_ENUM(0x8897,GL_NORMAL_ARRAY_BUFFER_BINDING)
-GL_ENUM(0x8898,GL_COLOR_ARRAY_BUFFER_BINDING)
-GL_ENUM(0x889A,GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
-GL_ENUM(0x889E,GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
-GL_ENUM(0x889F,GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)
-GL_ENUM(0x88B9,GL_WRITE_ONLY_OES)
-GL_ENUM(0x88BB,GL_BUFFER_ACCESS_OES)
-GL_ENUM(0x88BC,GL_BUFFER_MAPPED_OES)
-GL_ENUM(0x88BD,GL_BUFFER_MAP_POINTER_OES)
-GL_ENUM(0x88E0,GL_STREAM_DRAW)
-GL_ENUM(0x88E4,GL_STATIC_DRAW)
-GL_ENUM(0x88E8,GL_DYNAMIC_DRAW)
-GL_ENUM(0x88F0,GL_DEPTH24_STENCIL8_OES)
-GL_ENUM(0x898A,GL_POINT_SIZE_ARRAY_TYPE_OES)
-GL_ENUM(0x898B,GL_POINT_SIZE_ARRAY_STRIDE_OES)
-GL_ENUM(0x898C,GL_POINT_SIZE_ARRAY_POINTER_OES)
-GL_ENUM(0x898D,GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
-GL_ENUM(0x898E,GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
-GL_ENUM(0x898F,GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
-GL_ENUM(0x8A1F,GL_RGB_422_APPLE)
-GL_ENUM(0x8A4F,GL_PROGRAM_PIPELINE_OBJECT_EXT)
-GL_ENUM(0x8B30,GL_FRAGMENT_SHADER)
-GL_ENUM(0x8B31,GL_VERTEX_SHADER)
-GL_ENUM(0x8B40,GL_PROGRAM_OBJECT_EXT)
-GL_ENUM(0x8B48,GL_SHADER_OBJECT_EXT)
-GL_ENUM(0x8B4C,GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS)
-GL_ENUM(0x8B4D,GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS)
-GL_ENUM(0x8B4F,GL_SHADER_TYPE)
-GL_ENUM(0x8B50,GL_FLOAT_VEC2)
-GL_ENUM(0x8B51,GL_FLOAT_VEC3)
-GL_ENUM(0x8B52,GL_FLOAT_VEC4)
-GL_ENUM(0x8B53,GL_INT_VEC2)
-GL_ENUM(0x8B54,GL_INT_VEC3)
-GL_ENUM(0x8B55,GL_INT_VEC4)
-GL_ENUM(0x8B56,GL_BOOL)
-GL_ENUM(0x8B57,GL_BOOL_VEC2)
-GL_ENUM(0x8B58,GL_BOOL_VEC3)
-GL_ENUM(0x8B59,GL_BOOL_VEC4)
-GL_ENUM(0x8B5A,GL_FLOAT_MAT2)
-GL_ENUM(0x8B5B,GL_FLOAT_MAT3)
-GL_ENUM(0x8B5C,GL_FLOAT_MAT4)
-GL_ENUM(0x8B5E,GL_SAMPLER_2D)
-GL_ENUM(0x8B5F,GL_SAMPLER_3D_OES)
-GL_ENUM(0x8B60,GL_SAMPLER_CUBE)
-GL_ENUM(0x8B62,GL_SAMPLER_2D_SHADOW_EXT)
-GL_ENUM(0x8B80,GL_DELETE_STATUS)
-GL_ENUM(0x8B81,GL_COMPILE_STATUS)
-GL_ENUM(0x8B82,GL_LINK_STATUS)
-GL_ENUM(0x8B83,GL_VALIDATE_STATUS)
-GL_ENUM(0x8B84,GL_INFO_LOG_LENGTH)
-GL_ENUM(0x8B85,GL_ATTACHED_SHADERS)
-GL_ENUM(0x8B86,GL_ACTIVE_UNIFORMS)
-GL_ENUM(0x8B87,GL_ACTIVE_UNIFORM_MAX_LENGTH)
-GL_ENUM(0x8B88,GL_SHADER_SOURCE_LENGTH)
-GL_ENUM(0x8B89,GL_ACTIVE_ATTRIBUTES)
-GL_ENUM(0x8B8A,GL_ACTIVE_ATTRIBUTE_MAX_LENGTH)
-GL_ENUM(0x8B8B,GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES)
-GL_ENUM(0x8B8C,GL_SHADING_LANGUAGE_VERSION)
-GL_ENUM(0x8B8D,GL_CURRENT_PROGRAM)
-GL_ENUM(0x8B90,GL_PALETTE4_RGB8_OES)
-GL_ENUM(0x8B91,GL_PALETTE4_RGBA8_OES)
-GL_ENUM(0x8B92,GL_PALETTE4_R5_G6_B5_OES)
-GL_ENUM(0x8B93,GL_PALETTE4_RGBA4_OES)
-GL_ENUM(0x8B94,GL_PALETTE4_RGB5_A1_OES)
-GL_ENUM(0x8B95,GL_PALETTE8_RGB8_OES)
-GL_ENUM(0x8B96,GL_PALETTE8_RGBA8_OES)
-GL_ENUM(0x8B97,GL_PALETTE8_R5_G6_B5_OES)
-GL_ENUM(0x8B98,GL_PALETTE8_RGBA4_OES)
-GL_ENUM(0x8B99,GL_PALETTE8_RGB5_A1_OES)
-GL_ENUM(0x8B9A,GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
-GL_ENUM(0x8B9B,GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
-GL_ENUM(0x8B9C,GL_POINT_SIZE_ARRAY_OES)
-GL_ENUM(0x8B9D,GL_TEXTURE_CROP_RECT_OES)
-GL_ENUM(0x8B9E,GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
-GL_ENUM(0x8B9F,GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
-GL_ENUM(0x8BC0,GL_COUNTER_TYPE_AMD)
-GL_ENUM(0x8BC1,GL_COUNTER_RANGE_AMD)
-GL_ENUM(0x8BC2,GL_UNSIGNED_INT64_AMD)
-GL_ENUM(0x8BC3,GL_PERCENTAGE_AMD)
-GL_ENUM(0x8BC4,GL_PERFMON_RESULT_AVAILABLE_AMD)
-GL_ENUM(0x8BC5,GL_PERFMON_RESULT_SIZE_AMD)
-GL_ENUM(0x8BC6,GL_PERFMON_RESULT_AMD)
-GL_ENUM(0x8BD2,GL_TEXTURE_WIDTH_QCOM)
-GL_ENUM(0x8BD3,GL_TEXTURE_HEIGHT_QCOM)
-GL_ENUM(0x8BD4,GL_TEXTURE_DEPTH_QCOM)
-GL_ENUM(0x8BD5,GL_TEXTURE_INTERNAL_FORMAT_QCOM)
-GL_ENUM(0x8BD6,GL_TEXTURE_FORMAT_QCOM)
-GL_ENUM(0x8BD7,GL_TEXTURE_TYPE_QCOM)
-GL_ENUM(0x8BD8,GL_TEXTURE_IMAGE_VALID_QCOM)
-GL_ENUM(0x8BD9,GL_TEXTURE_NUM_LEVELS_QCOM)
-GL_ENUM(0x8BDA,GL_TEXTURE_TARGET_QCOM)
-GL_ENUM(0x8BDB,GL_TEXTURE_OBJECT_VALID_QCOM)
-GL_ENUM(0x8BDC,GL_STATE_RESTORE)
-GL_ENUM(0x8C00,GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG)
-GL_ENUM(0x8C01,GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG)
-GL_ENUM(0x8C02,GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG)
-GL_ENUM(0x8C03,GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG)
-GL_ENUM(0x8C04,GL_MODULATE_COLOR_IMG)
-GL_ENUM(0x8C05,GL_RECIP_ADD_SIGNED_ALPHA_IMG)
-GL_ENUM(0x8C06,GL_TEXTURE_ALPHA_MODULATE_IMG)
-GL_ENUM(0x8C07,GL_FACTOR_ALPHA_MODULATE_IMG)
-GL_ENUM(0x8C08,GL_FRAGMENT_ALPHA_MODULATE_IMG)
-GL_ENUM(0x8C09,GL_ADD_BLEND_IMG)
-GL_ENUM(0x8C0A,GL_SGX_BINARY_IMG)
-GL_ENUM(0x8C17,GL_UNSIGNED_NORMALIZED_EXT)
-GL_ENUM(0x8C2F,GL_ANY_SAMPLES_PASSED_EXT)
-GL_ENUM(0x8C40,GL_SRGB_EXT)
-GL_ENUM(0x8C42,GL_SRGB_ALPHA_EXT)
-GL_ENUM(0x8C43,GL_SRGB8_ALPHA8_EXT)
-GL_ENUM(0x8C92,GL_ATC_RGB_AMD)
-GL_ENUM(0x8C93,GL_ATC_RGBA_EXPLICIT_ALPHA_AMD)
-GL_ENUM(0x8CA3,GL_STENCIL_BACK_REF)
-GL_ENUM(0x8CA4,GL_STENCIL_BACK_VALUE_MASK)
-GL_ENUM(0x8CA5,GL_STENCIL_BACK_WRITEMASK)
-GL_ENUM(0x8CA6,GL_FRAMEBUFFER_BINDING_OES)
-GL_ENUM(0x8CA7,GL_RENDERBUFFER_BINDING_OES)
-GL_ENUM(0x8CA8,GL_READ_FRAMEBUFFER_APPLE)
-GL_ENUM(0x8CA9,GL_DRAW_FRAMEBUFFER_APPLE)
-GL_ENUM(0x8CAA,GL_READ_FRAMEBUFFER_BINDING_APPLE)
-GL_ENUM(0x8CAB,GL_RENDERBUFFER_SAMPLES_APPLE)
-GL_ENUM(0x8CD0,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES)
-GL_ENUM(0x8CD1,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES)
-GL_ENUM(0x8CD2,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES)
-GL_ENUM(0x8CD3,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES)
-GL_ENUM(0x8CD4,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES)
-GL_ENUM(0x8CD5,GL_FRAMEBUFFER_COMPLETE_OES)
-GL_ENUM(0x8CD6,GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES)
-GL_ENUM(0x8CD7,GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES)
-GL_ENUM(0x8CD9,GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES)
-GL_ENUM(0x8CDA,GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES)
-GL_ENUM(0x8CDD,GL_FRAMEBUFFER_UNSUPPORTED_OES)
-GL_ENUM(0x8CDF,GL_MAX_COLOR_ATTACHMENTS_NV)
-GL_ENUM(0x8CE0,GL_COLOR_ATTACHMENT0_OES)
-GL_ENUM(0x8CE1,GL_COLOR_ATTACHMENT1_NV)
-GL_ENUM(0x8CE2,GL_COLOR_ATTACHMENT2_NV)
-GL_ENUM(0x8CE3,GL_COLOR_ATTACHMENT3_NV)
-GL_ENUM(0x8CE4,GL_COLOR_ATTACHMENT4_NV)
-GL_ENUM(0x8CE5,GL_COLOR_ATTACHMENT5_NV)
-GL_ENUM(0x8CE6,GL_COLOR_ATTACHMENT6_NV)
-GL_ENUM(0x8CE7,GL_COLOR_ATTACHMENT7_NV)
-GL_ENUM(0x8CE8,GL_COLOR_ATTACHMENT8_NV)
-GL_ENUM(0x8CE9,GL_COLOR_ATTACHMENT9_NV)
-GL_ENUM(0x8CEA,GL_COLOR_ATTACHMENT10_NV)
-GL_ENUM(0x8CEB,GL_COLOR_ATTACHMENT11_NV)
-GL_ENUM(0x8CEC,GL_COLOR_ATTACHMENT12_NV)
-GL_ENUM(0x8CED,GL_COLOR_ATTACHMENT13_NV)
-GL_ENUM(0x8CEE,GL_COLOR_ATTACHMENT14_NV)
-GL_ENUM(0x8CEF,GL_COLOR_ATTACHMENT15_NV)
-GL_ENUM(0x8D00,GL_DEPTH_ATTACHMENT_OES)
-GL_ENUM(0x8D20,GL_STENCIL_ATTACHMENT_OES)
-GL_ENUM(0x8D40,GL_FRAMEBUFFER_OES)
-GL_ENUM(0x8D41,GL_RENDERBUFFER_OES)
-GL_ENUM(0x8D42,GL_RENDERBUFFER_WIDTH_OES)
-GL_ENUM(0x8D43,GL_RENDERBUFFER_HEIGHT_OES)
-GL_ENUM(0x8D44,GL_RENDERBUFFER_INTERNAL_FORMAT_OES)
-GL_ENUM(0x8D46,GL_STENCIL_INDEX1_OES)
-GL_ENUM(0x8D47,GL_STENCIL_INDEX4_OES)
-GL_ENUM(0x8D48,GL_STENCIL_INDEX8_OES)
-GL_ENUM(0x8D50,GL_RENDERBUFFER_RED_SIZE_OES)
-GL_ENUM(0x8D51,GL_RENDERBUFFER_GREEN_SIZE_OES)
-GL_ENUM(0x8D52,GL_RENDERBUFFER_BLUE_SIZE_OES)
-GL_ENUM(0x8D53,GL_RENDERBUFFER_ALPHA_SIZE_OES)
-GL_ENUM(0x8D54,GL_RENDERBUFFER_DEPTH_SIZE_OES)
-GL_ENUM(0x8D55,GL_RENDERBUFFER_STENCIL_SIZE_OES)
-GL_ENUM(0x8D56,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE)
-GL_ENUM(0x8D57,GL_MAX_SAMPLES_APPLE)
-GL_ENUM(0x8D60,GL_TEXTURE_GEN_STR_OES)
-GL_ENUM(0x8D61,GL_HALF_FLOAT_OES)
-GL_ENUM(0x8D62,GL_RGB565_OES)
-GL_ENUM(0x8D64,GL_ETC1_RGB8_OES)
-GL_ENUM(0x8D65,GL_TEXTURE_EXTERNAL_OES)
-GL_ENUM(0x8D66,GL_SAMPLER_EXTERNAL_OES)
-GL_ENUM(0x8D67,GL_TEXTURE_BINDING_EXTERNAL_OES)
-GL_ENUM(0x8D68,GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES)
-GL_ENUM(0x8D6A,GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT)
-GL_ENUM(0x8D6C,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT)
-GL_ENUM(0x8DF0,GL_LOW_FLOAT)
-GL_ENUM(0x8DF1,GL_MEDIUM_FLOAT)
-GL_ENUM(0x8DF2,GL_HIGH_FLOAT)
-GL_ENUM(0x8DF3,GL_LOW_INT)
-GL_ENUM(0x8DF4,GL_MEDIUM_INT)
-GL_ENUM(0x8DF5,GL_HIGH_INT)
-GL_ENUM(0x8DF6,GL_UNSIGNED_INT_10_10_10_2_OES)
-GL_ENUM(0x8DF7,GL_INT_10_10_10_2_OES)
-GL_ENUM(0x8DF8,GL_SHADER_BINARY_FORMATS)
-GL_ENUM(0x8DF9,GL_NUM_SHADER_BINARY_FORMATS)
-GL_ENUM(0x8DFA,GL_SHADER_COMPILER)
-GL_ENUM(0x8DFB,GL_MAX_VERTEX_UNIFORM_VECTORS)
-GL_ENUM(0x8DFC,GL_MAX_VARYING_VECTORS)
-GL_ENUM(0x8DFD,GL_MAX_FRAGMENT_UNIFORM_VECTORS)
-GL_ENUM(0x8E2C,GL_DEPTH_COMPONENT16_NONLINEAR_NV)
-GL_ENUM(0x8ED0,GL_COVERAGE_COMPONENT_NV)
-GL_ENUM(0x8ED1,GL_COVERAGE_COMPONENT4_NV)
-GL_ENUM(0x8ED2,GL_COVERAGE_ATTACHMENT_NV)
-GL_ENUM(0x8ED3,GL_COVERAGE_BUFFERS_NV)
-GL_ENUM(0x8ED4,GL_COVERAGE_SAMPLES_NV)
-GL_ENUM(0x8ED5,GL_COVERAGE_ALL_FRAGMENTS_NV)
-GL_ENUM(0x8ED6,GL_COVERAGE_EDGE_FRAGMENTS_NV)
-GL_ENUM(0x8ED7,GL_COVERAGE_AUTOMATIC_NV)
-GL_ENUM(0x8F60,GL_MALI_SHADER_BINARY_ARM)
-GL_ENUM(0x8FA0,GL_PERFMON_GLOBAL_MODE_QCOM)
-GL_ENUM(0x8FC4,GL_SHADER_BINARY_VIV)
-GL_ENUM(0x90F3,GL_CONTEXT_ROBUST_ACCESS_EXT)
-GL_ENUM(0x912F,GL_TEXTURE_IMMUTABLE_FORMAT_EXT)
-GL_ENUM(0x9130,GL_SGX_PROGRAM_BINARY_IMG)
-GL_ENUM(0x9133,GL_RENDERBUFFER_SAMPLES_EXT)
-GL_ENUM(0x9134,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT)
-GL_ENUM(0x9135,GL_MAX_SAMPLES_EXT)
-GL_ENUM(0x9136,GL_TEXTURE_SAMPLES_IMG)
-GL_ENUM(0x9151,GL_BUFFER_OBJECT_EXT)
-GL_ENUM(0x9153,GL_QUERY_OBJECT_EXT)
-GL_ENUM(0x9154,GL_VERTEX_ARRAY_OBJECT_EXT)
-GL_ENUM(0x9250,GL_SHADER_BINARY_DMP)
-GL_ENUM(0x93A1,GL_BGRA8_EXT)
-GL_ENUM(0xFFFFFFFF,GL_ALL_SHADER_BITS_EXT)
diff --git a/opengl/libs/glestrace.h b/opengl/libs/glestrace.h
deleted file mode 100644
index a08f97b..0000000
--- a/opengl/libs/glestrace.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2011, 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.
- *
- * This file declares the API provided by the glestrace library.
- */
-
-#ifndef _GLES_TRACE_H_
-#define _GLES_TRACE_H_
-
-#include "hooks.h"
-
-namespace android {
-
-/* Hooks to be called by "interesting" EGL functions. */
-void GLTrace_eglCreateContext(int version, EGLContext c);
-void GLTrace_eglMakeCurrent(unsigned version, gl_hooks_t *hooks, EGLContext c);
-void GLTrace_eglReleaseThread();
-void GLTrace_eglSwapBuffers(void*, void*);
-
-/* Start and stop GL Tracing. */
-void GLTrace_start();
-void GLTrace_stop();
-
-/* Obtain the gl_hooks structure filled with the trace implementation for all GL functions. */
-gl_hooks_t *GLTrace_getGLHooks();
-
-};
-
-#endif
diff --git a/opengl/libs/hooks.h b/opengl/libs/hooks.h
deleted file mode 100644
index 8b1b389..0000000
--- a/opengl/libs/hooks.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- ** Copyright 2007, 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.
- */
-
-#ifndef ANDROID_GLES_CM_HOOKS_H
-#define ANDROID_GLES_CM_HOOKS_H
-
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-
-#include <pthread.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#if !defined(__arm__)
-#define USE_SLOW_BINDING 1
-#else
-#define USE_SLOW_BINDING 0
-#endif
-#undef NELEM
-#define NELEM(x) (sizeof(x)/sizeof(*(x)))
-
-// maximum number of GL extensions that can be used simultaneously in
-// a given process. this limitation exists because we need to have
-// a static function for each extension and currently these static functions
-// are generated at compile time.
-#define MAX_NUMBER_OF_GL_EXTENSIONS 256
-
-
-#if defined(HAVE_ANDROID_OS) && !USE_SLOW_BINDING && __OPTIMIZE__
-#define USE_FAST_TLS_KEY 1
-#else
-#define USE_FAST_TLS_KEY 0
-#endif
-
-#if USE_FAST_TLS_KEY
-# include <bionic_tls.h> /* special private C library header */
-#endif
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-// GL / EGL hooks
-
-#undef GL_ENTRY
-#undef EGL_ENTRY
-#define GL_ENTRY(_r, _api, ...) _r (*_api)(__VA_ARGS__);
-#define EGL_ENTRY(_r, _api, ...) _r (*_api)(__VA_ARGS__);
-
-struct egl_t {
- #include "EGL/egl_entries.in"
-};
-
-struct gl_hooks_t {
- struct gl_t {
- #include "entries.in"
- } gl;
- struct gl_ext_t {
- __eglMustCastToProperFunctionPointerType extensions[MAX_NUMBER_OF_GL_EXTENSIONS];
- } ext;
-};
-#undef GL_ENTRY
-#undef EGL_ENTRY
-
-EGLAPI void setGlThreadSpecific(gl_hooks_t const *value);
-EGLAPI gl_hooks_t const* getGlThreadSpecific();
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif /* ANDROID_GLES_CM_HOOKS_H */
diff --git a/opengl/libs/tools/genfiles b/opengl/libs/tools/genfiles
deleted file mode 100755
index 50bbf08..0000000
--- a/opengl/libs/tools/genfiles
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /bin/sh
-#
-# Copyright (C) 2008 Google Inc.
-#
-# 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.
-
-./glapigen ../../include/GLES/gl.h > ../GLES_CM/gl_api.in
-./glapigen ../../include/GLES/glext.h > ../GLES_CM/glext_api.in
-./glapigen ../../include/GLES2/gl2.h > ../GLES2/gl2_api.in
-./glapigen ../../include/GLES2/gl2ext.h > ../GLES2/gl2ext_api.in
-
-./glentrygen ../../include/GLES/gl.h > /tmp/gl_entries.in
-./glentrygen ../../include/GLES/glext.h > /tmp/glext_entries.in
-./glentrygen ../../include/GLES2/gl2.h > /tmp/gl2_entries.in
-./glentrygen ../../include/GLES2/gl2ext.h > /tmp/gl2ext_entries.in
-
-cat /tmp/gl_entries.in \
- /tmp/glext_entries.in \
- /tmp/gl2_entries.in \
- /tmp/gl2ext_entries.in \
- | sort -t, -k2 \
- | awk -F, '!_[$2]++' \
- > ../entries.in
-
-./gltracegen ../entries.in >../trace.in
-
-cat ../../include/GLES/gl.h \
- ../../include/GLES/glext.h \
- ../../include/GLES2/gl2.h \
- ../../include/GLES2/gl2ext.h \
- | ./glenumsgen \
- | sort \
- > ../enums.in
-
diff --git a/opengl/libs/tools/glapigen b/opengl/libs/tools/glapigen
deleted file mode 100755
index 4d8334f..0000000
--- a/opengl/libs/tools/glapigen
+++ /dev/null
@@ -1,76 +0,0 @@
-#! /usr/bin/perl
-#
-# Copyright (C) 2008 Google Inc.
-#
-# 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.
-
-use strict;
-
-sub rtrim($)
-{
- my $string = shift;
- $string =~ s/\s+$//;
- return $string;
-}
-
-while (my $line = <>) {
- next if $line =~ /^\//;
- next if $line =~ /^#/;
- next if $line =~ /^\s*$/;
- if ($line !~ /^GL_API(CALL)?\s+(.+)\s+GL_APIENTRY\s+([\w]+)\s*\(([^\)]+)\);/) {
- next;
- }
- my $type = rtrim($2);
- my $name = $3;
- my $args = $4;
-
- #printf("%s", $line);
-
- my $prefix = "";
- if ($name eq "glGetString") {
- $prefix = "__";
- }
-
- printf("%s API_ENTRY(%s%s)(%s)", $type, $prefix, $name, $args);
-
- printf(" {\n");
- if ($type eq "void") {
- printf(" CALL_GL_API(%s", $name);
- } else {
- printf(" CALL_GL_API_RETURN(%s", $name);
- }
- my @args = split ',', $args;
- my $len = scalar(@args);
- for (my $num = 0; $num < $len; $num++) {
- if ($args[$num] ne "void") {
- print ", ";
- #
- # extract the name from the parameter
- # type name
- # const type *name
- # type *name
- # type name[4]
- #
- if ($args[$num] =~ /(\S+\s)+\**\s*([\w]+)/) {
- printf("%s", $2);
- }
- }
- }
- printf(");\n");
- printf("}\n");
-}
-
-
-
-
-
diff --git a/opengl/libs/tools/glentrygen b/opengl/libs/tools/glentrygen
deleted file mode 100755
index 170f041..0000000
--- a/opengl/libs/tools/glentrygen
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /usr/bin/perl
-#
-# Copyright (C) 2008 Google Inc.
-#
-# 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.
-
-use strict;
-
-sub rtrim($)
-{
- my $string = shift;
- $string =~ s/\s+$//;
- return $string;
-}
-
-while (my $line = <>) {
- next if $line =~ /^\//;
- next if $line =~ /^#/;
- next if $line =~ /^\s*$/;
- if ($line !~ /^GL_API(CALL)?\s+(.+)\s+GL_APIENTRY\s+([\w]+)\s*\(([^\)]+)\);/) {
- next;
- }
- my $type = rtrim($2);
- my $name = $3;
- my $args = $4;
-
- printf("GL_ENTRY(%s, %s, %s)\n", $type, $name, $args);
-}
diff --git a/opengl/libs/tools/glenumsgen b/opengl/libs/tools/glenumsgen
deleted file mode 100755
index 2ae5fbf..0000000
--- a/opengl/libs/tools/glenumsgen
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /usr/bin/perl
-#
-# Copyright (C) 2010 Google Inc.
-#
-# 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.
-
-use strict;
-
-my %enumHash = ();
-
-while (my $line = <STDIN>) {
- next if $line =~ /^\//;
- # Skip bitfield definitions.
- next if $line =~ /_BIT(\d+_|\s+)/;
- if ($line !~ /^#define\s+(\S+)\s+(0x\S+)/) {
- next;
- }
- my $enumName = $1;
- my $enumValue = $2;
- next if exists($enumHash { $enumValue });
- $enumHash { $enumValue } = $enumName;
- printf("GL_ENUM(%s,%s)\n", $enumValue, $enumName);
-}
-
-
-
-
-
diff --git a/opengl/libs/tools/gltracegen b/opengl/libs/tools/gltracegen
deleted file mode 100755
index da42653..0000000
--- a/opengl/libs/tools/gltracegen
+++ /dev/null
@@ -1,95 +0,0 @@
-#! /usr/bin/perl
-#
-# Copyright (C) 2010 Google Inc.
-#
-# 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.
-
-use strict;
-
-sub rtrim($)
-{
- my $string = shift;
- $string =~ s/\s+$//;
- return $string;
-}
-
-while (my $line = <>) {
- next if $line =~ /^\//;
- next if $line =~ /^#/;
- next if $line =~ /^\s*$/;
- if ($line !~ /^GL_ENTRY\(([^,]+), ([^,]+), ([^\)]+)\)/) {
- next;
- }
- my $type = $1;
- my $name = $2;
- my $args = $3;
-
- my @args = split ',', $args;
- my $len = scalar(@args);
- my $nonVoidArgLen = 0;
- for (my $num = 0; $num < $len; $num++) {
- if ($args[$num] ne "void") {
- $nonVoidArgLen++;
- }
- }
- if ($type eq "void") {
- printf("TRACE_GL_VOID(");
- } else {
- printf("TRACE_GL(%s, ", $type);
- }
-
- printf("%s, (%s), (", $name, $args);
- for (my $num = 0; $num < $len; $num++) {
- if ($args[$num] ne "void") {
- if ($num > 0) {
- print ", ";
- }
- #
- # extract the name from the parameter
- # type name
- # const type *name
- # type *name
- # type name[4]
- #
- if ($args[$num] =~ /(\S+\s)+\**\s*([\w]+)/) {
- printf("%s", $2);
- }
- }
- }
- printf("), %d", $nonVoidArgLen);
- for (my $num = 0; $num < $len; $num++) {
- if ($args[$num] ne "void") {
- #
- # extract the name from the parameter
- # type name
- # const type *name
- # type *name
- # type name[4]
- #
- my $arg = $args[$num];
- if ($arg =~ /(\S+\s)+\**\s*([\w]+)/) {
- my $name = $2;
- if ($arg =~ /((const )*(\S+\s)+\**)\s*([\w]+)/) {
- my $type = rtrim($1);
- printf(", \"%s\", %s", $type, $name);
- }
- }
- }
- }
- printf(")\n");
-}
-
-
-
-
-
diff --git a/opengl/libs/trace.in b/opengl/libs/trace.in
deleted file mode 100644
index a5c5c84..0000000
--- a/opengl/libs/trace.in
+++ /dev/null
@@ -1,437 +0,0 @@
-TRACE_GL_VOID(glActiveShaderProgramEXT, (GLuint pipeline, GLuint program), (pipeline, program), 2, "GLuint", pipeline, "GLuint", program)
-TRACE_GL_VOID(glActiveTexture, (GLenum texture), (texture), 1, "GLenum", texture)
-TRACE_GL_VOID(glAlphaFunc, (GLenum func, GLclampf ref), (func, ref), 2, "GLenum", func, "GLclampf", ref)
-TRACE_GL_VOID(glAlphaFuncQCOM, (GLenum func, GLclampf ref), (func, ref), 2, "GLenum", func, "GLclampf", ref)
-TRACE_GL_VOID(glAlphaFuncx, (GLenum func, GLclampx ref), (func, ref), 2, "GLenum", func, "GLclampx", ref)
-TRACE_GL_VOID(glAlphaFuncxOES, (GLenum func, GLclampx ref), (func, ref), 2, "GLenum", func, "GLclampx", ref)
-TRACE_GL_VOID(glAttachShader, (GLuint program, GLuint shader), (program, shader), 2, "GLuint", program, "GLuint", shader)
-TRACE_GL_VOID(glBeginPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
-TRACE_GL_VOID(glBeginQueryEXT, (GLenum target, GLuint id), (target, id), 2, "GLenum", target, "GLuint", id)
-TRACE_GL_VOID(glBindAttribLocation, (GLuint program, GLuint index, const GLchar* name), (program, index, name), 3, "GLuint", program, "GLuint", index, "const GLchar*", name)
-TRACE_GL_VOID(glBindBuffer, (GLenum target, GLuint buffer), (target, buffer), 2, "GLenum", target, "GLuint", buffer)
-TRACE_GL_VOID(glBindFramebuffer, (GLenum target, GLuint framebuffer), (target, framebuffer), 2, "GLenum", target, "GLuint", framebuffer)
-TRACE_GL_VOID(glBindFramebufferOES, (GLenum target, GLuint framebuffer), (target, framebuffer), 2, "GLenum", target, "GLuint", framebuffer)
-TRACE_GL_VOID(glBindProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
-TRACE_GL_VOID(glBindRenderbuffer, (GLenum target, GLuint renderbuffer), (target, renderbuffer), 2, "GLenum", target, "GLuint", renderbuffer)
-TRACE_GL_VOID(glBindRenderbufferOES, (GLenum target, GLuint renderbuffer), (target, renderbuffer), 2, "GLenum", target, "GLuint", renderbuffer)
-TRACE_GL_VOID(glBindTexture, (GLenum target, GLuint texture), (target, texture), 2, "GLenum", target, "GLuint", texture)
-TRACE_GL_VOID(glBindVertexArrayOES, (GLuint array), (array), 1, "GLuint", array)
-TRACE_GL_VOID(glBlendColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), (red, green, blue, alpha), 4, "GLclampf", red, "GLclampf", green, "GLclampf", blue, "GLclampf", alpha)
-TRACE_GL_VOID(glBlendEquation, ( GLenum mode ), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glBlendEquationOES, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glBlendEquationSeparate, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha), 2, "GLenum", modeRGB, "GLenum", modeAlpha)
-TRACE_GL_VOID(glBlendEquationSeparateOES, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha), 2, "GLenum", modeRGB, "GLenum", modeAlpha)
-TRACE_GL_VOID(glBlendFunc, (GLenum sfactor, GLenum dfactor), (sfactor, dfactor), 2, "GLenum", sfactor, "GLenum", dfactor)
-TRACE_GL_VOID(glBlendFuncSeparate, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha), 4, "GLenum", srcRGB, "GLenum", dstRGB, "GLenum", srcAlpha, "GLenum", dstAlpha)
-TRACE_GL_VOID(glBlendFuncSeparateOES, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha), 4, "GLenum", srcRGB, "GLenum", dstRGB, "GLenum", srcAlpha, "GLenum", dstAlpha)
-TRACE_GL_VOID(glBlitFramebufferANGLE, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter), (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), 10, "GLint", srcX0, "GLint", srcY0, "GLint", srcX1, "GLint", srcY1, "GLint", dstX0, "GLint", dstY0, "GLint", dstX1, "GLint", dstY1, "GLbitfield", mask, "GLenum", filter)
-TRACE_GL_VOID(glBufferData, (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage), (target, size, data, usage), 4, "GLenum", target, "GLsizeiptr", size, "const GLvoid *", data, "GLenum", usage)
-TRACE_GL_VOID(glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data), (target, offset, size, data), 4, "GLenum", target, "GLintptr", offset, "GLsizeiptr", size, "const GLvoid *", data)
-TRACE_GL(GLenum, glCheckFramebufferStatus, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL(GLenum, glCheckFramebufferStatusOES, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glClear, (GLbitfield mask), (mask), 1, "GLbitfield", mask)
-TRACE_GL_VOID(glClearColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), (red, green, blue, alpha), 4, "GLclampf", red, "GLclampf", green, "GLclampf", blue, "GLclampf", alpha)
-TRACE_GL_VOID(glClearColorx, (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha), (red, green, blue, alpha), 4, "GLclampx", red, "GLclampx", green, "GLclampx", blue, "GLclampx", alpha)
-TRACE_GL_VOID(glClearColorxOES, (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha), (red, green, blue, alpha), 4, "GLclampx", red, "GLclampx", green, "GLclampx", blue, "GLclampx", alpha)
-TRACE_GL_VOID(glClearDepthf, (GLclampf depth), (depth), 1, "GLclampf", depth)
-TRACE_GL_VOID(glClearDepthfOES, (GLclampf depth), (depth), 1, "GLclampf", depth)
-TRACE_GL_VOID(glClearDepthx, (GLclampx depth), (depth), 1, "GLclampx", depth)
-TRACE_GL_VOID(glClearDepthxOES, (GLclampx depth), (depth), 1, "GLclampx", depth)
-TRACE_GL_VOID(glClearStencil, (GLint s), (s), 1, "GLint", s)
-TRACE_GL_VOID(glClientActiveTexture, (GLenum texture), (texture), 1, "GLenum", texture)
-TRACE_GL_VOID(glClipPlanef, (GLenum plane, const GLfloat *equation), (plane, equation), 2, "GLenum", plane, "const GLfloat *", equation)
-TRACE_GL_VOID(glClipPlanefIMG, (GLenum p, const GLfloat *eqn), (p, eqn), 2, "GLenum", p, "const GLfloat *", eqn)
-TRACE_GL_VOID(glClipPlanefOES, (GLenum plane, const GLfloat *equation), (plane, equation), 2, "GLenum", plane, "const GLfloat *", equation)
-TRACE_GL_VOID(glClipPlanex, (GLenum plane, const GLfixed *equation), (plane, equation), 2, "GLenum", plane, "const GLfixed *", equation)
-TRACE_GL_VOID(glClipPlanexIMG, (GLenum p, const GLfixed *eqn), (p, eqn), 2, "GLenum", p, "const GLfixed *", eqn)
-TRACE_GL_VOID(glClipPlanexOES, (GLenum plane, const GLfixed *equation), (plane, equation), 2, "GLenum", plane, "const GLfixed *", equation)
-TRACE_GL_VOID(glColor4f, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red, green, blue, alpha), 4, "GLfloat", red, "GLfloat", green, "GLfloat", blue, "GLfloat", alpha)
-TRACE_GL_VOID(glColor4ub, (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha), (red, green, blue, alpha), 4, "GLubyte", red, "GLubyte", green, "GLubyte", blue, "GLubyte", alpha)
-TRACE_GL_VOID(glColor4x, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha), 4, "GLfixed", red, "GLfixed", green, "GLfixed", blue, "GLfixed", alpha)
-TRACE_GL_VOID(glColor4xOES, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha), 4, "GLfixed", red, "GLfixed", green, "GLfixed", blue, "GLfixed", alpha)
-TRACE_GL_VOID(glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha), (red, green, blue, alpha), 4, "GLboolean", red, "GLboolean", green, "GLboolean", blue, "GLboolean", alpha)
-TRACE_GL_VOID(glColorPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glCompileShader, (GLuint shader), (shader), 1, "GLuint", shader)
-TRACE_GL_VOID(glCompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data), (target, level, internalformat, width, height, border, imageSize, data), 8, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLint", border, "GLsizei", imageSize, "const GLvoid *", data)
-TRACE_GL_VOID(glCompressedTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data), (target, level, internalformat, width, height, depth, border, imageSize, data), 9, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLint", border, "GLsizei", imageSize, "const GLvoid*", data)
-TRACE_GL_VOID(glCompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data), (target, level, xoffset, yoffset, width, height, format, imageSize, data), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLsizei", imageSize, "const GLvoid *", data)
-TRACE_GL_VOID(glCompressedTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLsizei", imageSize, "const GLvoid*", data)
-TRACE_GL_VOID(glCopyTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border), (target, level, internalformat, x, y, width, height, border), 8, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLint", border)
-TRACE_GL_VOID(glCopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, x, y, width, height), 8, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glCopyTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, zoffset, x, y, width, height), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glCoverageMaskNV, (GLboolean mask), (mask), 1, "GLboolean", mask)
-TRACE_GL_VOID(glCoverageOperationNV, (GLenum operation), (operation), 1, "GLenum", operation)
-TRACE_GL(GLuint, glCreateProgram, (void), (), 0)
-TRACE_GL(GLuint, glCreateShader, (GLenum type), (type), 1, "GLenum", type)
-TRACE_GL(GLuint, glCreateShaderProgramvEXT, (GLenum type, GLsizei count, const GLchar **strings), (type, count, strings), 3, "GLenum", type, "GLsizei", count, "const GLchar **", strings)
-TRACE_GL_VOID(glCullFace, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glCurrentPaletteMatrixOES, (GLuint matrixpaletteindex), (matrixpaletteindex), 1, "GLuint", matrixpaletteindex)
-TRACE_GL_VOID(glDeleteBuffers, (GLsizei n, const GLuint *buffers), (n, buffers), 2, "GLsizei", n, "const GLuint *", buffers)
-TRACE_GL_VOID(glDeleteFencesNV, (GLsizei n, const GLuint *fences), (n, fences), 2, "GLsizei", n, "const GLuint *", fences)
-TRACE_GL_VOID(glDeleteFramebuffers, (GLsizei n, const GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "const GLuint*", framebuffers)
-TRACE_GL_VOID(glDeleteFramebuffersOES, (GLsizei n, const GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "const GLuint*", framebuffers)
-TRACE_GL_VOID(glDeletePerfMonitorsAMD, (GLsizei n, GLuint *monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
-TRACE_GL_VOID(glDeleteProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glDeleteProgramPipelinesEXT, (GLsizei n, const GLuint *pipelines), (n, pipelines), 2, "GLsizei", n, "const GLuint *", pipelines)
-TRACE_GL_VOID(glDeleteQueriesEXT, (GLsizei n, const GLuint *ids), (n, ids), 2, "GLsizei", n, "const GLuint *", ids)
-TRACE_GL_VOID(glDeleteRenderbuffers, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "const GLuint*", renderbuffers)
-TRACE_GL_VOID(glDeleteRenderbuffersOES, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "const GLuint*", renderbuffers)
-TRACE_GL_VOID(glDeleteShader, (GLuint shader), (shader), 1, "GLuint", shader)
-TRACE_GL_VOID(glDeleteTextures, (GLsizei n, const GLuint *textures), (n, textures), 2, "GLsizei", n, "const GLuint *", textures)
-TRACE_GL_VOID(glDeleteVertexArraysOES, (GLsizei n, const GLuint *arrays), (n, arrays), 2, "GLsizei", n, "const GLuint *", arrays)
-TRACE_GL_VOID(glDepthFunc, (GLenum func), (func), 1, "GLenum", func)
-TRACE_GL_VOID(glDepthMask, (GLboolean flag), (flag), 1, "GLboolean", flag)
-TRACE_GL_VOID(glDepthRangef, (GLclampf zNear, GLclampf zFar), (zNear, zFar), 2, "GLclampf", zNear, "GLclampf", zFar)
-TRACE_GL_VOID(glDepthRangefOES, (GLclampf zNear, GLclampf zFar), (zNear, zFar), 2, "GLclampf", zNear, "GLclampf", zFar)
-TRACE_GL_VOID(glDepthRangex, (GLclampx zNear, GLclampx zFar), (zNear, zFar), 2, "GLclampx", zNear, "GLclampx", zFar)
-TRACE_GL_VOID(glDepthRangexOES, (GLclampx zNear, GLclampx zFar), (zNear, zFar), 2, "GLclampx", zNear, "GLclampx", zFar)
-TRACE_GL_VOID(glDetachShader, (GLuint program, GLuint shader), (program, shader), 2, "GLuint", program, "GLuint", shader)
-TRACE_GL_VOID(glDisable, (GLenum cap), (cap), 1, "GLenum", cap)
-TRACE_GL_VOID(glDisableClientState, (GLenum array), (array), 1, "GLenum", array)
-TRACE_GL_VOID(glDisableDriverControlQCOM, (GLuint driverControl), (driverControl), 1, "GLuint", driverControl)
-TRACE_GL_VOID(glDisableVertexAttribArray, (GLuint index), (index), 1, "GLuint", index)
-TRACE_GL_VOID(glDiscardFramebufferEXT, (GLenum target, GLsizei numAttachments, const GLenum *attachments), (target, numAttachments, attachments), 3, "GLenum", target, "GLsizei", numAttachments, "const GLenum *", attachments)
-TRACE_GL_VOID(glDrawArrays, (GLenum mode, GLint first, GLsizei count), (mode, first, count), 3, "GLenum", mode, "GLint", first, "GLsizei", count)
-TRACE_GL_VOID(glDrawBuffersNV, (GLsizei n, const GLenum *bufs), (n, bufs), 2, "GLsizei", n, "const GLenum *", bufs)
-TRACE_GL_VOID(glDrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices), (mode, count, type, indices), 4, "GLenum", mode, "GLsizei", count, "GLenum", type, "const GLvoid *", indices)
-TRACE_GL_VOID(glDrawTexfOES, (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height), (x, y, z, width, height), 5, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", width, "GLfloat", height)
-TRACE_GL_VOID(glDrawTexfvOES, (const GLfloat *coords), (coords), 1, "const GLfloat *", coords)
-TRACE_GL_VOID(glDrawTexiOES, (GLint x, GLint y, GLint z, GLint width, GLint height), (x, y, z, width, height), 5, "GLint", x, "GLint", y, "GLint", z, "GLint", width, "GLint", height)
-TRACE_GL_VOID(glDrawTexivOES, (const GLint *coords), (coords), 1, "const GLint *", coords)
-TRACE_GL_VOID(glDrawTexsOES, (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height), (x, y, z, width, height), 5, "GLshort", x, "GLshort", y, "GLshort", z, "GLshort", width, "GLshort", height)
-TRACE_GL_VOID(glDrawTexsvOES, (const GLshort *coords), (coords), 1, "const GLshort *", coords)
-TRACE_GL_VOID(glDrawTexxOES, (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height), (x, y, z, width, height), 5, "GLfixed", x, "GLfixed", y, "GLfixed", z, "GLfixed", width, "GLfixed", height)
-TRACE_GL_VOID(glDrawTexxvOES, (const GLfixed *coords), (coords), 1, "const GLfixed *", coords)
-TRACE_GL_VOID(glEGLImageTargetRenderbufferStorageOES, (GLenum target, GLeglImageOES image), (target, image), 2, "GLenum", target, "GLeglImageOES", image)
-TRACE_GL_VOID(glEGLImageTargetTexture2DOES, (GLenum target, GLeglImageOES image), (target, image), 2, "GLenum", target, "GLeglImageOES", image)
-TRACE_GL_VOID(glEnable, (GLenum cap), (cap), 1, "GLenum", cap)
-TRACE_GL_VOID(glEnableClientState, (GLenum array), (array), 1, "GLenum", array)
-TRACE_GL_VOID(glEnableDriverControlQCOM, (GLuint driverControl), (driverControl), 1, "GLuint", driverControl)
-TRACE_GL_VOID(glEnableVertexAttribArray, (GLuint index), (index), 1, "GLuint", index)
-TRACE_GL_VOID(glEndPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
-TRACE_GL_VOID(glEndQueryEXT, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glEndTilingQCOM, (GLbitfield preserveMask), (preserveMask), 1, "GLbitfield", preserveMask)
-TRACE_GL_VOID(glExtGetBufferPointervQCOM, (GLenum target, GLvoid **params), (target, params), 2, "GLenum", target, "GLvoid **", params)
-TRACE_GL_VOID(glExtGetBuffersQCOM, (GLuint *buffers, GLint maxBuffers, GLint *numBuffers), (buffers, maxBuffers, numBuffers), 3, "GLuint *", buffers, "GLint", maxBuffers, "GLint *", numBuffers)
-TRACE_GL_VOID(glExtGetFramebuffersQCOM, (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers), (framebuffers, maxFramebuffers, numFramebuffers), 3, "GLuint *", framebuffers, "GLint", maxFramebuffers, "GLint *", numFramebuffers)
-TRACE_GL_VOID(glExtGetProgramBinarySourceQCOM, (GLuint program, GLenum shadertype, GLchar *source, GLint *length), (program, shadertype, source, length), 4, "GLuint", program, "GLenum", shadertype, "GLchar *", source, "GLint *", length)
-TRACE_GL_VOID(glExtGetProgramsQCOM, (GLuint *programs, GLint maxPrograms, GLint *numPrograms), (programs, maxPrograms, numPrograms), 3, "GLuint *", programs, "GLint", maxPrograms, "GLint *", numPrograms)
-TRACE_GL_VOID(glExtGetRenderbuffersQCOM, (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers), (renderbuffers, maxRenderbuffers, numRenderbuffers), 3, "GLuint *", renderbuffers, "GLint", maxRenderbuffers, "GLint *", numRenderbuffers)
-TRACE_GL_VOID(glExtGetShadersQCOM, (GLuint *shaders, GLint maxShaders, GLint *numShaders), (shaders, maxShaders, numShaders), 3, "GLuint *", shaders, "GLint", maxShaders, "GLint *", numShaders)
-TRACE_GL_VOID(glExtGetTexLevelParameterivQCOM, (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params), (texture, face, level, pname, params), 5, "GLuint", texture, "GLenum", face, "GLint", level, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glExtGetTexSubImageQCOM, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLenum", type, "GLvoid *", texels)
-TRACE_GL_VOID(glExtGetTexturesQCOM, (GLuint *textures, GLint maxTextures, GLint *numTextures), (textures, maxTextures, numTextures), 3, "GLuint *", textures, "GLint", maxTextures, "GLint *", numTextures)
-TRACE_GL(GLboolean, glExtIsProgramBinaryQCOM, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glExtTexObjectStateOverrideiQCOM, (GLenum target, GLenum pname, GLint param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glFinish, (void), (), 0)
-TRACE_GL_VOID(glFinishFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
-TRACE_GL_VOID(glFlush, (void), (), 0)
-TRACE_GL_VOID(glFogf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glFogfv, (GLenum pname, const GLfloat *params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glFogx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glFogxOES, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glFogxv, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glFogxvOES, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glFramebufferRenderbuffer, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer), 4, "GLenum", target, "GLenum", attachment, "GLenum", renderbuffertarget, "GLuint", renderbuffer)
-TRACE_GL_VOID(glFramebufferRenderbufferOES, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer), 4, "GLenum", target, "GLenum", attachment, "GLenum", renderbuffertarget, "GLuint", renderbuffer)
-TRACE_GL_VOID(glFramebufferTexture2D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level), 5, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level)
-TRACE_GL_VOID(glFramebufferTexture2DMultisampleEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples), (target, attachment, textarget, texture, level, samples), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLsizei", samples)
-TRACE_GL_VOID(glFramebufferTexture2DMultisampleIMG, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples), (target, attachment, textarget, texture, level, samples), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLsizei", samples)
-TRACE_GL_VOID(glFramebufferTexture2DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level), 5, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level)
-TRACE_GL_VOID(glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset), (target, attachment, textarget, texture, level, zoffset), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLint", zoffset)
-TRACE_GL_VOID(glFrontFace, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glFrustumf, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfloat", left, "GLfloat", right, "GLfloat", bottom, "GLfloat", top, "GLfloat", zNear, "GLfloat", zFar)
-TRACE_GL_VOID(glFrustumfOES, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfloat", left, "GLfloat", right, "GLfloat", bottom, "GLfloat", top, "GLfloat", zNear, "GLfloat", zFar)
-TRACE_GL_VOID(glFrustumx, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfixed", left, "GLfixed", right, "GLfixed", bottom, "GLfixed", top, "GLfixed", zNear, "GLfixed", zFar)
-TRACE_GL_VOID(glFrustumxOES, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfixed", left, "GLfixed", right, "GLfixed", bottom, "GLfixed", top, "GLfixed", zNear, "GLfixed", zFar)
-TRACE_GL_VOID(glGenBuffers, (GLsizei n, GLuint *buffers), (n, buffers), 2, "GLsizei", n, "GLuint *", buffers)
-TRACE_GL_VOID(glGenFencesNV, (GLsizei n, GLuint *fences), (n, fences), 2, "GLsizei", n, "GLuint *", fences)
-TRACE_GL_VOID(glGenFramebuffers, (GLsizei n, GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "GLuint*", framebuffers)
-TRACE_GL_VOID(glGenFramebuffersOES, (GLsizei n, GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "GLuint*", framebuffers)
-TRACE_GL_VOID(glGenPerfMonitorsAMD, (GLsizei n, GLuint *monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
-TRACE_GL_VOID(glGenProgramPipelinesEXT, (GLsizei n, GLuint *pipelines), (n, pipelines), 2, "GLsizei", n, "GLuint *", pipelines)
-TRACE_GL_VOID(glGenQueriesEXT, (GLsizei n, GLuint *ids), (n, ids), 2, "GLsizei", n, "GLuint *", ids)
-TRACE_GL_VOID(glGenRenderbuffers, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "GLuint*", renderbuffers)
-TRACE_GL_VOID(glGenRenderbuffersOES, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "GLuint*", renderbuffers)
-TRACE_GL_VOID(glGenTextures, (GLsizei n, GLuint *textures), (n, textures), 2, "GLsizei", n, "GLuint *", textures)
-TRACE_GL_VOID(glGenVertexArraysOES, (GLsizei n, GLuint *arrays), (n, arrays), 2, "GLsizei", n, "GLuint *", arrays)
-TRACE_GL_VOID(glGenerateMipmap, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glGenerateMipmapOES, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glGetActiveAttrib, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name), (program, index, bufsize, length, size, type, name), 7, "GLuint", program, "GLuint", index, "GLsizei", bufsize, "GLsizei*", length, "GLint*", size, "GLenum*", type, "GLchar*", name)
-TRACE_GL_VOID(glGetActiveUniform, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name), (program, index, bufsize, length, size, type, name), 7, "GLuint", program, "GLuint", index, "GLsizei", bufsize, "GLsizei*", length, "GLint*", size, "GLenum*", type, "GLchar*", name)
-TRACE_GL_VOID(glGetAttachedShaders, (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders), (program, maxcount, count, shaders), 4, "GLuint", program, "GLsizei", maxcount, "GLsizei*", count, "GLuint*", shaders)
-TRACE_GL(int, glGetAttribLocation, (GLuint program, const GLchar* name), (program, name), 2, "GLuint", program, "const GLchar*", name)
-TRACE_GL_VOID(glGetBooleanv, (GLenum pname, GLboolean *params), (pname, params), 2, "GLenum", pname, "GLboolean *", params)
-TRACE_GL_VOID(glGetBufferParameteriv, (GLenum target, GLenum pname, GLint *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetBufferPointervOES, (GLenum target, GLenum pname, GLvoid ** params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLvoid **", params)
-TRACE_GL_VOID(glGetClipPlanef, (GLenum pname, GLfloat eqn[4]), (pname, eqn), 2, "GLenum", pname, "GLfloat", eqn)
-TRACE_GL_VOID(glGetClipPlanefOES, (GLenum pname, GLfloat eqn[4]), (pname, eqn), 2, "GLenum", pname, "GLfloat", eqn)
-TRACE_GL_VOID(glGetClipPlanex, (GLenum pname, GLfixed eqn[4]), (pname, eqn), 2, "GLenum", pname, "GLfixed", eqn)
-TRACE_GL_VOID(glGetClipPlanexOES, (GLenum pname, GLfixed eqn[4]), (pname, eqn), 2, "GLenum", pname, "GLfixed", eqn)
-TRACE_GL_VOID(glGetDriverControlStringQCOM, (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString), (driverControl, bufSize, length, driverControlString), 4, "GLuint", driverControl, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", driverControlString)
-TRACE_GL_VOID(glGetDriverControlsQCOM, (GLint *num, GLsizei size, GLuint *driverControls), (num, size, driverControls), 3, "GLint *", num, "GLsizei", size, "GLuint *", driverControls)
-TRACE_GL(GLenum, glGetError, (void), (), 0)
-TRACE_GL_VOID(glGetFenceivNV, (GLuint fence, GLenum pname, GLint *params), (fence, pname, params), 3, "GLuint", fence, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetFixedv, (GLenum pname, GLfixed *params), (pname, params), 2, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetFixedvOES, (GLenum pname, GLfixed *params), (pname, params), 2, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetFloatv, (GLenum pname, GLfloat *params), (pname, params), 2, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetFramebufferAttachmentParameteriv, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params), 4, "GLenum", target, "GLenum", attachment, "GLenum", pname, "GLint*", params)
-TRACE_GL_VOID(glGetFramebufferAttachmentParameterivOES, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params), 4, "GLenum", target, "GLenum", attachment, "GLenum", pname, "GLint*", params)
-TRACE_GL(GLenum, glGetGraphicsResetStatusEXT, (void), (), 0)
-TRACE_GL_VOID(glGetIntegerv, (GLenum pname, GLint *params), (pname, params), 2, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetLightfv, (GLenum light, GLenum pname, GLfloat *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetLightxv, (GLenum light, GLenum pname, GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetLightxvOES, (GLenum light, GLenum pname, GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetMaterialfv, (GLenum face, GLenum pname, GLfloat *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetMaterialxv, (GLenum face, GLenum pname, GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetMaterialxvOES, (GLenum face, GLenum pname, GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetObjectLabelEXT, (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label), (type, object, bufSize, length, label), 5, "GLenum", type, "GLuint", object, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", label)
-TRACE_GL_VOID(glGetPerfMonitorCounterDataAMD, (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten), (monitor, pname, dataSize, data, bytesWritten), 5, "GLuint", monitor, "GLenum", pname, "GLsizei", dataSize, "GLuint *", data, "GLint *", bytesWritten)
-TRACE_GL_VOID(glGetPerfMonitorCounterInfoAMD, (GLuint group, GLuint counter, GLenum pname, GLvoid *data), (group, counter, pname, data), 4, "GLuint", group, "GLuint", counter, "GLenum", pname, "GLvoid *", data)
-TRACE_GL_VOID(glGetPerfMonitorCounterStringAMD, (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString), (group, counter, bufSize, length, counterString), 5, "GLuint", group, "GLuint", counter, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", counterString)
-TRACE_GL_VOID(glGetPerfMonitorCountersAMD, (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters), (group, numCounters, maxActiveCounters, counterSize, counters), 5, "GLuint", group, "GLint *", numCounters, "GLint *", maxActiveCounters, "GLsizei", counterSize, "GLuint *", counters)
-TRACE_GL_VOID(glGetPerfMonitorGroupStringAMD, (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString), (group, bufSize, length, groupString), 4, "GLuint", group, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", groupString)
-TRACE_GL_VOID(glGetPerfMonitorGroupsAMD, (GLint *numGroups, GLsizei groupsSize, GLuint *groups), (numGroups, groupsSize, groups), 3, "GLint *", numGroups, "GLsizei", groupsSize, "GLuint *", groups)
-TRACE_GL_VOID(glGetPointerv, (GLenum pname, GLvoid **params), (pname, params), 2, "GLenum", pname, "GLvoid **", params)
-TRACE_GL_VOID(glGetProgramBinaryOES, (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary), (program, bufSize, length, binaryFormat, binary), 5, "GLuint", program, "GLsizei", bufSize, "GLsizei *", length, "GLenum *", binaryFormat, "GLvoid *", binary)
-TRACE_GL_VOID(glGetProgramInfoLog, (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog), (program, bufsize, length, infolog), 4, "GLuint", program, "GLsizei", bufsize, "GLsizei*", length, "GLchar*", infolog)
-TRACE_GL_VOID(glGetProgramPipelineInfoLogEXT, (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog), (pipeline, bufSize, length, infoLog), 4, "GLuint", pipeline, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", infoLog)
-TRACE_GL_VOID(glGetProgramPipelineivEXT, (GLuint pipeline, GLenum pname, GLint *params), (pipeline, pname, params), 3, "GLuint", pipeline, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetProgramiv, (GLuint program, GLenum pname, GLint* params), (program, pname, params), 3, "GLuint", program, "GLenum", pname, "GLint*", params)
-TRACE_GL_VOID(glGetQueryObjectuivEXT, (GLuint id, GLenum pname, GLuint *params), (id, pname, params), 3, "GLuint", id, "GLenum", pname, "GLuint *", params)
-TRACE_GL_VOID(glGetQueryivEXT, (GLenum target, GLenum pname, GLint *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetRenderbufferParameteriv, (GLenum target, GLenum pname, GLint* params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint*", params)
-TRACE_GL_VOID(glGetRenderbufferParameterivOES, (GLenum target, GLenum pname, GLint* params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint*", params)
-TRACE_GL_VOID(glGetShaderInfoLog, (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog), (shader, bufsize, length, infolog), 4, "GLuint", shader, "GLsizei", bufsize, "GLsizei*", length, "GLchar*", infolog)
-TRACE_GL_VOID(glGetShaderPrecisionFormat, (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision), (shadertype, precisiontype, range, precision), 4, "GLenum", shadertype, "GLenum", precisiontype, "GLint*", range, "GLint*", precision)
-TRACE_GL_VOID(glGetShaderSource, (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source), (shader, bufsize, length, source), 4, "GLuint", shader, "GLsizei", bufsize, "GLsizei*", length, "GLchar*", source)
-TRACE_GL_VOID(glGetShaderiv, (GLuint shader, GLenum pname, GLint* params), (shader, pname, params), 3, "GLuint", shader, "GLenum", pname, "GLint*", params)
-TRACE_GL(const GLubyte *, glGetString, (GLenum name), (name), 1, "GLenum", name)
-TRACE_GL_VOID(glGetTexEnvfv, (GLenum env, GLenum pname, GLfloat *params), (env, pname, params), 3, "GLenum", env, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetTexEnviv, (GLenum env, GLenum pname, GLint *params), (env, pname, params), 3, "GLenum", env, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexEnvxv, (GLenum env, GLenum pname, GLfixed *params), (env, pname, params), 3, "GLenum", env, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexEnvxvOES, (GLenum env, GLenum pname, GLfixed *params), (env, pname, params), 3, "GLenum", env, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexGenfvOES, (GLenum coord, GLenum pname, GLfloat *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetTexGenivOES, (GLenum coord, GLenum pname, GLint *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexGenxvOES, (GLenum coord, GLenum pname, GLfixed *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexParameterfv, (GLenum target, GLenum pname, GLfloat *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetTexParameteriv, (GLenum target, GLenum pname, GLint *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexParameterxv, (GLenum target, GLenum pname, GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexParameterxvOES, (GLenum target, GLenum pname, GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfixed *", params)
-TRACE_GL(int, glGetUniformLocation, (GLuint program, const GLchar* name), (program, name), 2, "GLuint", program, "const GLchar*", name)
-TRACE_GL_VOID(glGetUniformfv, (GLuint program, GLint location, GLfloat* params), (program, location, params), 3, "GLuint", program, "GLint", location, "GLfloat*", params)
-TRACE_GL_VOID(glGetUniformiv, (GLuint program, GLint location, GLint* params), (program, location, params), 3, "GLuint", program, "GLint", location, "GLint*", params)
-TRACE_GL_VOID(glGetVertexAttribPointerv, (GLuint index, GLenum pname, GLvoid** pointer), (index, pname, pointer), 3, "GLuint", index, "GLenum", pname, "GLvoid**", pointer)
-TRACE_GL_VOID(glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat* params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLfloat*", params)
-TRACE_GL_VOID(glGetVertexAttribiv, (GLuint index, GLenum pname, GLint* params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLint*", params)
-TRACE_GL_VOID(glGetnUniformfvEXT, (GLuint program, GLint location, GLsizei bufSize, float *params), (program, location, bufSize, params), 4, "GLuint", program, "GLint", location, "GLsizei", bufSize, "float *", params)
-TRACE_GL_VOID(glGetnUniformivEXT, (GLuint program, GLint location, GLsizei bufSize, GLint *params), (program, location, bufSize, params), 4, "GLuint", program, "GLint", location, "GLsizei", bufSize, "GLint *", params)
-TRACE_GL_VOID(glHint, (GLenum target, GLenum mode), (target, mode), 2, "GLenum", target, "GLenum", mode)
-TRACE_GL_VOID(glInsertEventMarkerEXT, (GLsizei length, const GLchar *marker), (length, marker), 2, "GLsizei", length, "const GLchar *", marker)
-TRACE_GL(GLboolean, glIsBuffer, (GLuint buffer), (buffer), 1, "GLuint", buffer)
-TRACE_GL(GLboolean, glIsEnabled, (GLenum cap), (cap), 1, "GLenum", cap)
-TRACE_GL(GLboolean, glIsFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
-TRACE_GL(GLboolean, glIsFramebuffer, (GLuint framebuffer), (framebuffer), 1, "GLuint", framebuffer)
-TRACE_GL(GLboolean, glIsFramebufferOES, (GLuint framebuffer), (framebuffer), 1, "GLuint", framebuffer)
-TRACE_GL(GLboolean, glIsProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL(GLboolean, glIsProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
-TRACE_GL(GLboolean, glIsQueryEXT, (GLuint id), (id), 1, "GLuint", id)
-TRACE_GL(GLboolean, glIsRenderbuffer, (GLuint renderbuffer), (renderbuffer), 1, "GLuint", renderbuffer)
-TRACE_GL(GLboolean, glIsRenderbufferOES, (GLuint renderbuffer), (renderbuffer), 1, "GLuint", renderbuffer)
-TRACE_GL(GLboolean, glIsShader, (GLuint shader), (shader), 1, "GLuint", shader)
-TRACE_GL(GLboolean, glIsTexture, (GLuint texture), (texture), 1, "GLuint", texture)
-TRACE_GL(GLboolean, glIsVertexArrayOES, (GLuint array), (array), 1, "GLuint", array)
-TRACE_GL_VOID(glLabelObjectEXT, (GLenum type, GLuint object, GLsizei length, const GLchar *label), (type, object, length, label), 4, "GLenum", type, "GLuint", object, "GLsizei", length, "const GLchar *", label)
-TRACE_GL_VOID(glLightModelf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glLightModelfv, (GLenum pname, const GLfloat *params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glLightModelx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightModelxOES, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightModelxv, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLightModelxvOES, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLightf, (GLenum light, GLenum pname, GLfloat param), (light, pname, param), 3, "GLenum", light, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glLightfv, (GLenum light, GLenum pname, const GLfloat *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glLightx, (GLenum light, GLenum pname, GLfixed param), (light, pname, param), 3, "GLenum", light, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightxOES, (GLenum light, GLenum pname, GLfixed param), (light, pname, param), 3, "GLenum", light, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightxv, (GLenum light, GLenum pname, const GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLightxvOES, (GLenum light, GLenum pname, const GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLineWidth, (GLfloat width), (width), 1, "GLfloat", width)
-TRACE_GL_VOID(glLineWidthx, (GLfixed width), (width), 1, "GLfixed", width)
-TRACE_GL_VOID(glLineWidthxOES, (GLfixed width), (width), 1, "GLfixed", width)
-TRACE_GL_VOID(glLinkProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glLoadIdentity, (void), (), 0)
-TRACE_GL_VOID(glLoadMatrixf, (const GLfloat *m), (m), 1, "const GLfloat *", m)
-TRACE_GL_VOID(glLoadMatrixx, (const GLfixed *m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glLoadMatrixxOES, (const GLfixed *m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glLoadPaletteFromModelViewMatrixOES, (void), (), 0)
-TRACE_GL_VOID(glLogicOp, (GLenum opcode), (opcode), 1, "GLenum", opcode)
-TRACE_GL(void*, glMapBufferOES, (GLenum target, GLenum access), (target, access), 2, "GLenum", target, "GLenum", access)
-TRACE_GL_VOID(glMaterialf, (GLenum face, GLenum pname, GLfloat param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glMaterialfv, (GLenum face, GLenum pname, const GLfloat *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glMaterialx, (GLenum face, GLenum pname, GLfixed param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glMaterialxOES, (GLenum face, GLenum pname, GLfixed param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glMaterialxv, (GLenum face, GLenum pname, const GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glMaterialxvOES, (GLenum face, GLenum pname, const GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glMatrixIndexPointerOES, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glMatrixMode, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glMultMatrixf, (const GLfloat *m), (m), 1, "const GLfloat *", m)
-TRACE_GL_VOID(glMultMatrixx, (const GLfixed *m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glMultMatrixxOES, (const GLfixed *m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glMultiDrawArraysEXT, (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount), (mode, first, count, primcount), 4, "GLenum", mode, "GLint *", first, "GLsizei *", count, "GLsizei", primcount)
-TRACE_GL_VOID(glMultiDrawElementsEXT, (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount), (mode, count, type, indices, primcount), 5, "GLenum", mode, "const GLsizei *", count, "GLenum", type, "const GLvoid* *", indices, "GLsizei", primcount)
-TRACE_GL_VOID(glMultiTexCoord4f, (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q), (target, s, t, r, q), 5, "GLenum", target, "GLfloat", s, "GLfloat", t, "GLfloat", r, "GLfloat", q)
-TRACE_GL_VOID(glMultiTexCoord4x, (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q), (target, s, t, r, q), 5, "GLenum", target, "GLfixed", s, "GLfixed", t, "GLfixed", r, "GLfixed", q)
-TRACE_GL_VOID(glMultiTexCoord4xOES, (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q), (target, s, t, r, q), 5, "GLenum", target, "GLfixed", s, "GLfixed", t, "GLfixed", r, "GLfixed", q)
-TRACE_GL_VOID(glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz), (nx, ny, nz), 3, "GLfloat", nx, "GLfloat", ny, "GLfloat", nz)
-TRACE_GL_VOID(glNormal3x, (GLfixed nx, GLfixed ny, GLfixed nz), (nx, ny, nz), 3, "GLfixed", nx, "GLfixed", ny, "GLfixed", nz)
-TRACE_GL_VOID(glNormal3xOES, (GLfixed nx, GLfixed ny, GLfixed nz), (nx, ny, nz), 3, "GLfixed", nx, "GLfixed", ny, "GLfixed", nz)
-TRACE_GL_VOID(glNormalPointer, (GLenum type, GLsizei stride, const GLvoid *pointer), (type, stride, pointer), 3, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glOrthof, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfloat", left, "GLfloat", right, "GLfloat", bottom, "GLfloat", top, "GLfloat", zNear, "GLfloat", zFar)
-TRACE_GL_VOID(glOrthofOES, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfloat", left, "GLfloat", right, "GLfloat", bottom, "GLfloat", top, "GLfloat", zNear, "GLfloat", zFar)
-TRACE_GL_VOID(glOrthox, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfixed", left, "GLfixed", right, "GLfixed", bottom, "GLfixed", top, "GLfixed", zNear, "GLfixed", zFar)
-TRACE_GL_VOID(glOrthoxOES, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar), 6, "GLfixed", left, "GLfixed", right, "GLfixed", bottom, "GLfixed", top, "GLfixed", zNear, "GLfixed", zFar)
-TRACE_GL_VOID(glPixelStorei, (GLenum pname, GLint param), (pname, param), 2, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glPointParameterf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glPointParameterfv, (GLenum pname, const GLfloat *params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glPointParameterx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glPointParameterxOES, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glPointParameterxv, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glPointParameterxvOES, (GLenum pname, const GLfixed *params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glPointSize, (GLfloat size), (size), 1, "GLfloat", size)
-TRACE_GL_VOID(glPointSizePointerOES, (GLenum type, GLsizei stride, const GLvoid *pointer), (type, stride, pointer), 3, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glPointSizex, (GLfixed size), (size), 1, "GLfixed", size)
-TRACE_GL_VOID(glPointSizexOES, (GLfixed size), (size), 1, "GLfixed", size)
-TRACE_GL_VOID(glPolygonOffset, (GLfloat factor, GLfloat units), (factor, units), 2, "GLfloat", factor, "GLfloat", units)
-TRACE_GL_VOID(glPolygonOffsetx, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
-TRACE_GL_VOID(glPolygonOffsetxOES, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
-TRACE_GL_VOID(glPopGroupMarkerEXT, (void), (), 0)
-TRACE_GL_VOID(glPopMatrix, (void), (), 0)
-TRACE_GL_VOID(glProgramBinaryOES, (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length), (program, binaryFormat, binary, length), 4, "GLuint", program, "GLenum", binaryFormat, "const GLvoid *", binary, "GLint", length)
-TRACE_GL_VOID(glProgramParameteriEXT, (GLuint program, GLenum pname, GLint value), (program, pname, value), 3, "GLuint", program, "GLenum", pname, "GLint", value)
-TRACE_GL_VOID(glProgramUniform1fEXT, (GLuint program, GLint location, GLfloat x), (program, location, x), 3, "GLuint", program, "GLint", location, "GLfloat", x)
-TRACE_GL_VOID(glProgramUniform1fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform1iEXT, (GLuint program, GLint location, GLint x), (program, location, x), 3, "GLuint", program, "GLint", location, "GLint", x)
-TRACE_GL_VOID(glProgramUniform1ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform2fEXT, (GLuint program, GLint location, GLfloat x, GLfloat y), (program, location, x, y), 4, "GLuint", program, "GLint", location, "GLfloat", x, "GLfloat", y)
-TRACE_GL_VOID(glProgramUniform2fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform2iEXT, (GLuint program, GLint location, GLint x, GLint y), (program, location, x, y), 4, "GLuint", program, "GLint", location, "GLint", x, "GLint", y)
-TRACE_GL_VOID(glProgramUniform2ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform3fEXT, (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z), (program, location, x, y, z), 5, "GLuint", program, "GLint", location, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glProgramUniform3fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform3iEXT, (GLuint program, GLint location, GLint x, GLint y, GLint z), (program, location, x, y, z), 5, "GLuint", program, "GLint", location, "GLint", x, "GLint", y, "GLint", z)
-TRACE_GL_VOID(glProgramUniform3ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform4fEXT, (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (program, location, x, y, z, w), 6, "GLuint", program, "GLint", location, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", w)
-TRACE_GL_VOID(glProgramUniform4fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform4iEXT, (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w), (program, location, x, y, z, w), 6, "GLuint", program, "GLint", location, "GLint", x, "GLint", y, "GLint", z, "GLint", w)
-TRACE_GL_VOID(glProgramUniform4ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniformMatrix2fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix3fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix4fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glPushGroupMarkerEXT, (GLsizei length, const GLchar *marker), (length, marker), 2, "GLsizei", length, "const GLchar *", marker)
-TRACE_GL_VOID(glPushMatrix, (void), (), 0)
-TRACE_GL(GLbitfield, glQueryMatrixxOES, (GLfixed mantissa[16], GLint exponent[16]), (mantissa, exponent), 2, "GLfixed", mantissa, "GLint", exponent)
-TRACE_GL_VOID(glReadBufferNV, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels), (x, y, width, height, format, type, pixels), 7, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "GLvoid *", pixels)
-TRACE_GL_VOID(glReadnPixelsEXT, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data), (x, y, width, height, format, type, bufSize, data), 8, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "GLsizei", bufSize, "void *", data)
-TRACE_GL_VOID(glReleaseShaderCompiler, (void), (), 0)
-TRACE_GL_VOID(glRenderbufferStorage, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height), 4, "GLenum", target, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleANGLE, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleAPPLE, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleEXT, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleIMG, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageOES, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height), 4, "GLenum", target, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glResolveMultisampleFramebufferAPPLE, (void), (), 0)
-TRACE_GL_VOID(glRotatef, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z), (angle, x, y, z), 4, "GLfloat", angle, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glRotatex, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glRotatexOES, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glSampleCoverage, (GLclampf value, GLboolean invert), (value, invert), 2, "GLclampf", value, "GLboolean", invert)
-TRACE_GL_VOID(glSampleCoveragex, (GLclampx value, GLboolean invert), (value, invert), 2, "GLclampx", value, "GLboolean", invert)
-TRACE_GL_VOID(glSampleCoveragexOES, (GLclampx value, GLboolean invert), (value, invert), 2, "GLclampx", value, "GLboolean", invert)
-TRACE_GL_VOID(glScalef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z), 3, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glScalex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glScalexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glScissor, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height), 4, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glSelectPerfMonitorCountersAMD, (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList), (monitor, enable, group, numCounters, countersList), 5, "GLuint", monitor, "GLboolean", enable, "GLuint", group, "GLint", numCounters, "GLuint *", countersList)
-TRACE_GL_VOID(glSetFenceNV, (GLuint fence, GLenum condition), (fence, condition), 2, "GLuint", fence, "GLenum", condition)
-TRACE_GL_VOID(glShadeModel, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glShaderBinary, (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length), (n, shaders, binaryformat, binary, length), 5, "GLsizei", n, "const GLuint*", shaders, "GLenum", binaryformat, "const GLvoid*", binary, "GLsizei", length)
-TRACE_GL_VOID(glShaderSource, (GLuint shader, GLsizei count, const GLchar** string, const GLint* length), (shader, count, string, length), 4, "GLuint", shader, "GLsizei", count, "const GLchar**", string, "const GLint*", length)
-TRACE_GL_VOID(glStartTilingQCOM, (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask), (x, y, width, height, preserveMask), 5, "GLuint", x, "GLuint", y, "GLuint", width, "GLuint", height, "GLbitfield", preserveMask)
-TRACE_GL_VOID(glStencilFunc, (GLenum func, GLint ref, GLuint mask), (func, ref, mask), 3, "GLenum", func, "GLint", ref, "GLuint", mask)
-TRACE_GL_VOID(glStencilFuncSeparate, (GLenum face, GLenum func, GLint ref, GLuint mask), (face, func, ref, mask), 4, "GLenum", face, "GLenum", func, "GLint", ref, "GLuint", mask)
-TRACE_GL_VOID(glStencilMask, (GLuint mask), (mask), 1, "GLuint", mask)
-TRACE_GL_VOID(glStencilMaskSeparate, (GLenum face, GLuint mask), (face, mask), 2, "GLenum", face, "GLuint", mask)
-TRACE_GL_VOID(glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass), (fail, zfail, zpass), 3, "GLenum", fail, "GLenum", zfail, "GLenum", zpass)
-TRACE_GL_VOID(glStencilOpSeparate, (GLenum face, GLenum fail, GLenum zfail, GLenum zpass), (face, fail, zfail, zpass), 4, "GLenum", face, "GLenum", fail, "GLenum", zfail, "GLenum", zpass)
-TRACE_GL(GLboolean, glTestFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
-TRACE_GL_VOID(glTexCoordPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glTexEnvf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glTexEnvfv, (GLenum target, GLenum pname, const GLfloat *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glTexEnvi, (GLenum target, GLenum pname, GLint param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glTexEnviv, (GLenum target, GLenum pname, const GLint *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLint *", params)
-TRACE_GL_VOID(glTexEnvx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexEnvxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexEnvxv, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexEnvxvOES, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexGenfOES, (GLenum coord, GLenum pname, GLfloat param), (coord, pname, param), 3, "GLenum", coord, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glTexGenfvOES, (GLenum coord, GLenum pname, const GLfloat *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glTexGeniOES, (GLenum coord, GLenum pname, GLint param), (coord, pname, param), 3, "GLenum", coord, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glTexGenivOES, (GLenum coord, GLenum pname, const GLint *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "const GLint *", params)
-TRACE_GL_VOID(glTexGenxOES, (GLenum coord, GLenum pname, GLfixed param), (coord, pname, param), 3, "GLenum", coord, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexGenxvOES, (GLenum coord, GLenum pname, const GLfixed *params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels), (target, level, internalformat, width, height, border, format, type, pixels), 9, "GLenum", target, "GLint", level, "GLint", internalformat, "GLsizei", width, "GLsizei", height, "GLint", border, "GLenum", format, "GLenum", type, "const GLvoid *", pixels)
-TRACE_GL_VOID(glTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels), (target, level, internalformat, width, height, depth, border, format, type, pixels), 10, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLint", border, "GLenum", format, "GLenum", type, "const GLvoid*", pixels)
-TRACE_GL_VOID(glTexParameterf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glTexParameterfv, (GLenum target, GLenum pname, const GLfloat *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glTexParameteri, (GLenum target, GLenum pname, GLint param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glTexParameteriv, (GLenum target, GLenum pname, const GLint *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLint *", params)
-TRACE_GL_VOID(glTexParameterx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexParameterxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexParameterxv, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexParameterxvOES, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexStorage1DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width), (target, levels, internalformat, width), 4, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width)
-TRACE_GL_VOID(glTexStorage2DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (target, levels, internalformat, width, height), 5, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glTexStorage3DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (target, levels, internalformat, width, height, depth), 6, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth)
-TRACE_GL_VOID(glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels), (target, level, xoffset, yoffset, width, height, format, type, pixels), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "const GLvoid *", pixels)
-TRACE_GL_VOID(glTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLenum", type, "const GLvoid*", pixels)
-TRACE_GL_VOID(glTextureStorage1DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width), (texture, target, levels, internalformat, width), 5, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width)
-TRACE_GL_VOID(glTextureStorage2DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (texture, target, levels, internalformat, width, height), 6, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glTextureStorage3DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (texture, target, levels, internalformat, width, height, depth), 7, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth)
-TRACE_GL_VOID(glTranslatef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z), 3, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glTranslatex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glTranslatexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glUniform1f, (GLint location, GLfloat x), (location, x), 2, "GLint", location, "GLfloat", x)
-TRACE_GL_VOID(glUniform1fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v), 3, "GLint", location, "GLsizei", count, "const GLfloat*", v)
-TRACE_GL_VOID(glUniform1i, (GLint location, GLint x), (location, x), 2, "GLint", location, "GLint", x)
-TRACE_GL_VOID(glUniform1iv, (GLint location, GLsizei count, const GLint* v), (location, count, v), 3, "GLint", location, "GLsizei", count, "const GLint*", v)
-TRACE_GL_VOID(glUniform2f, (GLint location, GLfloat x, GLfloat y), (location, x, y), 3, "GLint", location, "GLfloat", x, "GLfloat", y)
-TRACE_GL_VOID(glUniform2fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v), 3, "GLint", location, "GLsizei", count, "const GLfloat*", v)
-TRACE_GL_VOID(glUniform2i, (GLint location, GLint x, GLint y), (location, x, y), 3, "GLint", location, "GLint", x, "GLint", y)
-TRACE_GL_VOID(glUniform2iv, (GLint location, GLsizei count, const GLint* v), (location, count, v), 3, "GLint", location, "GLsizei", count, "const GLint*", v)
-TRACE_GL_VOID(glUniform3f, (GLint location, GLfloat x, GLfloat y, GLfloat z), (location, x, y, z), 4, "GLint", location, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glUniform3fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v), 3, "GLint", location, "GLsizei", count, "const GLfloat*", v)
-TRACE_GL_VOID(glUniform3i, (GLint location, GLint x, GLint y, GLint z), (location, x, y, z), 4, "GLint", location, "GLint", x, "GLint", y, "GLint", z)
-TRACE_GL_VOID(glUniform3iv, (GLint location, GLsizei count, const GLint* v), (location, count, v), 3, "GLint", location, "GLsizei", count, "const GLint*", v)
-TRACE_GL_VOID(glUniform4f, (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (location, x, y, z, w), 5, "GLint", location, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", w)
-TRACE_GL_VOID(glUniform4fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v), 3, "GLint", location, "GLsizei", count, "const GLfloat*", v)
-TRACE_GL_VOID(glUniform4i, (GLint location, GLint x, GLint y, GLint z, GLint w), (location, x, y, z, w), 5, "GLint", location, "GLint", x, "GLint", y, "GLint", z, "GLint", w)
-TRACE_GL_VOID(glUniform4iv, (GLint location, GLsizei count, const GLint* v), (location, count, v), 3, "GLint", location, "GLsizei", count, "const GLint*", v)
-TRACE_GL_VOID(glUniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat*", value)
-TRACE_GL_VOID(glUniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat*", value)
-TRACE_GL_VOID(glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat*", value)
-TRACE_GL(GLboolean, glUnmapBufferOES, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glUseProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glUseProgramStagesEXT, (GLuint pipeline, GLbitfield stages, GLuint program), (pipeline, stages, program), 3, "GLuint", pipeline, "GLbitfield", stages, "GLuint", program)
-TRACE_GL_VOID(glValidateProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glValidateProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
-TRACE_GL_VOID(glVertexAttrib1f, (GLuint indx, GLfloat x), (indx, x), 2, "GLuint", indx, "GLfloat", x)
-TRACE_GL_VOID(glVertexAttrib1fv, (GLuint indx, const GLfloat* values), (indx, values), 2, "GLuint", indx, "const GLfloat*", values)
-TRACE_GL_VOID(glVertexAttrib2f, (GLuint indx, GLfloat x, GLfloat y), (indx, x, y), 3, "GLuint", indx, "GLfloat", x, "GLfloat", y)
-TRACE_GL_VOID(glVertexAttrib2fv, (GLuint indx, const GLfloat* values), (indx, values), 2, "GLuint", indx, "const GLfloat*", values)
-TRACE_GL_VOID(glVertexAttrib3f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z), (indx, x, y, z), 4, "GLuint", indx, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glVertexAttrib3fv, (GLuint indx, const GLfloat* values), (indx, values), 2, "GLuint", indx, "const GLfloat*", values)
-TRACE_GL_VOID(glVertexAttrib4f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (indx, x, y, z, w), 5, "GLuint", indx, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", w)
-TRACE_GL_VOID(glVertexAttrib4fv, (GLuint indx, const GLfloat* values), (indx, values), 2, "GLuint", indx, "const GLfloat*", values)
-TRACE_GL_VOID(glVertexAttribPointer, (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr), (indx, size, type, normalized, stride, ptr), 6, "GLuint", indx, "GLint", size, "GLenum", type, "GLboolean", normalized, "GLsizei", stride, "const GLvoid*", ptr)
-TRACE_GL_VOID(glVertexPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
-TRACE_GL_VOID(glViewport, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height), 4, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glWeightPointerOES, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const GLvoid *", pointer)
diff --git a/opengl/specs/EGL_ANDROID_blob_cache.txt b/opengl/specs/EGL_ANDROID_blob_cache.txt
deleted file mode 100644
index 61f45d3..0000000
--- a/opengl/specs/EGL_ANDROID_blob_cache.txt
+++ /dev/null
@@ -1,208 +0,0 @@
-Name
-
- ANDROID_blob_cache
-
-Name Strings
-
- EGL_ANDROID_blob_cache
-
-Contributors
-
- Jamie Gennis
-
-Contact
-
- Jamie Gennis, Google Inc. (jgennis 'at' google.com)
-
-Status
-
- Draft.
-
-Version
-
- Version 1, April 22, 2011
-
-Number
-
- EGL Extension #XXX
-
-Dependencies
-
- Requires EGL 1.0
-
- This extension is written against the wording of the EGL 1.4 Specification
-
-Overview
-
- Shader compilation and optimization has been a troublesome aspect of OpenGL
- programming for a long time. It can consume seconds of CPU cycles during
- application start-up. Additionally, state-based re-compiles done
- internally by the drivers add an unpredictable element to application
- performance tuning, often leading to occasional pauses in otherwise smooth
- animations.
-
- This extension provides a mechanism through which client API
- implementations may cache shader binaries after they are compiled. It may
- then retrieve those cached shaders during subsequent executions of the same
- program. The management of the cache is handled by the application (or
- middleware), allowing it to be tuned to a particular platform or
- environment.
-
- While the focus of this extension is on providing a persistent cache for
- shader binaries, it may also be useful for caching other data. This is
- perfectly acceptable, but the guarantees provided (or lack thereof) were
- designed around the shader use case.
-
- Note that although this extension is written as if the application
- implements the caching functionality, on the Android OS it is implemented
- as part of the Android EGL module. This extension is not exposed to
- applications on Android, but will be used automatically in every
- application that uses EGL if it is supported by the underlying
- device-specific EGL implementation.
-
-New Types
-
- /*
- * EGLsizeiANDROID is a signed integer type for representing the size of a
- * memory buffer.
- */
- #include <khrplatform.h>
- typedef khronos_ssize_t EGLsizeiANDROID;
-
- /*
- * EGLSetBlobFunc is a pointer to an application-provided function that a
- * client API implementation may use to insert a key/value pair into the
- * cache.
- */
- typedef void (*EGLSetBlobFuncANDROID) (const void* key,
- EGLsizeiANDROID keySize, const void* value, EGLsizeiANDROID valueSize)
-
- /*
- * EGLGetBlobFunc is a pointer to an application-provided function that a
- * client API implementation may use to retrieve a cached value from the
- * cache.
- */
- typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void* key,
- EGLsizeiANDROID keySize, void* value, EGLsizeiANDROID valueSize)
-
-New Procedures and Functions
-
- void eglSetBlobCacheFuncsANDROID(EGLDisplay dpy,
- EGLSetBlobFunc set,
- EGLGetBlobFunc get);
-
-New Tokens
-
- None.
-
-Changes to Chapter 3 of the EGL 1.4 Specification (EGL Functions and Errors)
-
- Add a new subsection after Section 3.8, page 50
- (Synchronization Primitives)
-
- "3.9 Persistent Caching
-
- In order to facilitate persistent caching of internal client API state that
- is slow to compute or collect, the application may specify callback
- function pointers through which the client APIs can request data be cached
- and retrieved. The command
-
- void eglSetBlobCacheFuncsANDROID(EGLDisplay dpy,
- EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
-
- sets the callback function pointers that client APIs associated with
- display <dpy> can use to interact with caching functionality provided by
- the application. <set> points to a function that inserts a new value into
- the cache and associates it with the given key. <get> points to a function
- that retrieves from the cache the value associated with a given key. The
- semantics of these callback functions are described in Section 3.9.1 (Cache
- Operations).
-
- Cache functions may only be specified once during the lifetime of an
- EGLDisplay. The <set> and <get> functions may be called at any time and
- from any thread from the time at which eglSetBlobCacheFuncsANDROID is
- called until the time that the last resource associated with <dpy> is
- deleted and <dpy> itself is terminated. Concurrent calls to these
- functions from different threads is also allowed.
-
- If eglSetBlobCacheFuncsANDROID generates an error then all client APIs must
- behave as though eglSetBlobCacheFuncsANDROID was not called for the display
- <dpy>. If <set> or <get> is NULL then an EGL_BAD_PARAMETER error is
- generated. If a successful eglSetBlobCacheFuncsANDROID call was already
- made for <dpy> and the display has not since been terminated then an
- EGL_BAD_PARAMETER error is generated.
-
- 3.9.1 Cache Operations
-
- To insert a new binary value into the cache and associate it with a given
- key, a client API implementation can call the application-provided callback
- function
-
- void (*set) (const void* key, EGLsizeiANDROID keySize,
- const void* value, EGLsizeiANDROID valueSize)
-
- <key> and <value> are pointers to the beginning of the key and value,
- respectively, that are to be inserted. <keySize> and <valueSize> specify
- the size in bytes of the data pointed to by <key> and <value>,
- respectively.
-
- No guarantees are made as to whether a given key/value pair is present in
- the cache after the set call. If a different value has been associated
- with the given key in the past then it is undefined which value, if any, is
- associated with the key after the set call. Note that while there are no
- guarantees, the cache implementation should attempt to cache the most
- recently set value for a given key.
-
- To retrieve the binary value associated with a given key from the cache, a
- client API implementation can call the application-provided callback
- function
-
- EGLsizeiANDROID (*get) (const void* key, EGLsizeiANDROID keySize,
- void* value, EGLsizeiANDROID valueSize)
-
- <key> is a pointer to the beginning of the key. <keySize> specifies the
- size in bytes of the binary key pointed to by <key>. If the cache contains
- a value associated with the given key then the size of that binary value in
- bytes is returned. Otherwise 0 is returned.
-
- If the cache contains a value for the given key and its size in bytes is
- less than or equal to <valueSize> then the value is written to the memory
- pointed to by <value>. Otherwise nothing is written to the memory pointed
- to by <value>.
-
-Issues
-
- 1. How should errors be handled in the callback functions?
-
- RESOLVED: No guarantees are made about the presence of values in the cache,
- so there should not be a need to return error information to the client API
- implementation. The cache implementation can simply drop a value if it
- encounters an error during the 'set' callback. Similarly, it can simply
- return 0 if it encouters an error in a 'get' callback.
-
- 2. When a client API driver gets updated, that may need to invalidate
- previously cached entries. How can the driver handle this situation?
-
- RESPONSE: There are a number of ways the driver can handle this situation.
- The recommended way is to include the driver version in all cache keys.
- That way each driver version will use a set of cache keys that are unique
- to that version, and conflicts should never occur. Updating the driver
- could then leave a number of values in the cache that will never be
- requested again. If needed, the cache implementation can handle those
- values in some way, but the driver does not need to take any special
- action.
-
- 3. How much data can be stored in the cache?
-
- RESPONSE: This is entirely dependent upon the cache implementation.
- Presumably it will be tuned to store enough data to be useful, but not
- enough to become problematic. :)
-
-Revision History
-
-#2 (Jamie Gennis, April 25, 2011)
- - Swapped the order of the size and pointer arguments to the get and set
- functions.
-
-#1 (Jamie Gennis, April 22, 2011)
- - Initial draft.
diff --git a/opengl/specs/EGL_ANDROID_recordable.txt b/opengl/specs/EGL_ANDROID_recordable.txt
deleted file mode 100644
index 8dbd26f..0000000
--- a/opengl/specs/EGL_ANDROID_recordable.txt
+++ /dev/null
@@ -1,140 +0,0 @@
-Name
-
- ANDROID_recordable
-
-Name Strings
-
- EGL_ANDROID_recordable
-
-Contributors
-
- Jamie Gennis
-
-Contact
-
- Jamie Gennis, Google Inc. (jgennis 'at' google.com)
-
-Status
-
- Draft.
-
-Version
-
- Version 1, July 8, 2011
-
-Number
-
- EGL Extension #XXX
-
-Dependencies
-
- Requires EGL 1.0
-
- This extension is written against the wording of the EGL 1.4 Specification
-
-Overview
-
- Android supports a number of different ANativeWindow implementations that
- can be used to create an EGLSurface. One implementation, which records the
- rendered image as a video each time eglSwapBuffers gets called, may have
- some device-specific restrictions. Because of this, some EGLConfigs may be
- incompatible with these ANativeWindows. This extension introduces a new
- boolean EGLConfig attribute that indicates whether the EGLConfig supports
- rendering to an ANativeWindow that records images to a video.
-
-New Types
-
- None.
-
-New Procedures and Functions
-
- None.
-
-New Tokens
-
- Accepted by the <attribute> parameter of eglGetConfigAttrib and
- the <attrib_list> parameter of eglChooseConfig:
-
- EGL_RECORDABLE_ANDROID 0x3142
-
-Changes to Chapter 3 of the EGL 1.4 Specification (EGL Functions and Errors)
-
- Section 3.4, Configuration Management, add a row to Table 3.1.
-
- Attribute Type Notes
- ---------------------- ------- --------------------------
- EGL_RECORDABLE_ANDROID boolean whether video recording is
- supported
-
- Section 3.4, Configuration Management, add a row to Table 3.4.
-
- Attribute Default Selection Sort Sort
- Criteria Order Priority
- ---------------------- ------------- --------- ----- --------
- EGL_RECORDABLE_ANDROID EGL_DONT_CARE Exact None
-
- Section 3.4, Configuration Management, add a paragraph at the end of the
- subsection titled Other EGLConfig Attribute Descriptions.
-
- EGL_RECORDABLE_ANDROID is a boolean indicating whether the config may
- be used to create an EGLSurface from an ANativeWindow that is a video
- recorder as indicated by the NATIVE_WINDOW_IS_VIDEO_RECORDER query on
- the ANativeWindow.
-
- Section 3.4.1, Querying Configurations, change the last paragraph as follow
-
- EGLConfigs are not sorted with respect to the parameters
- EGL_BIND_TO_TEXTURE_RGB, EGL_BIND_TO_TEXTURE_RGBA, EGL_CONFORMANT,
- EGL_LEVEL, EGL_NATIVE_RENDERABLE, EGL_MAX_SWAP_INTERVAL,
- EGL_MIN_SWAP_INTERVAL, EGL_RENDERABLE_TYPE, EGL_SURFACE_TYPE,
- EGL_TRANSPARENT_TYPE, EGL_TRANSPARENT_RED_VALUE,
- EGL_TRANSPARENT_GREEN_VALUE, EGL_TRANSPARENT_BLUE_VALUE, and
- EGL_RECORDABLE_ANDROID.
-
-Issues
-
- 1. Should this functionality be exposed as a new attribute or as a bit in
- the EGL_SURFACE_TYPE bitfield?
-
- RESOLVED: It should be a new attribute. It does not make sense to use up a
- bit in the limit-size bitfield for a platform-specific extension.
-
- 2. How should the new attribute affect the sorting of EGLConfigs?
-
- RESOLVED: It should not affect sorting. Some implementations may not have
- any drawback associated with using a recordable EGLConfig. Such
- implementations should not have to double-up some of their configs to one
- sort earlier than . Implementations that do have drawbacks can use the
- existing caveat mechanism to report this drawback to the client.
-
- 3. How is this extension expected to be implemented?
-
- RESPONSE: There are two basic approaches to implementing this extension
- that were considered during its design. In both cases it is assumed that a
- color space conversion must be performed at some point because most video
- encoding formats use a YUV color space. The two approaches are
- distinguished by the point at which this color space conversion is
- performed.
-
- One approach involves performing the color space conversion as part of the
- eglSwapBuffers call before queuing the rendered image to the ANativeWindow.
- In this case, the VisualID of the EGLConfig would correspond to a YUV
- Android HAL pixel format from which the video encoder can read. The
- EGLConfig would likely have the EGL_SLOW_CONFIG caveat because using that
- config to render normal window contents would result in an RGB -> YUV color
- space conversion when rendering the frame as well as a YUV -> RGB
- conversion when compositing the window.
-
- The other approach involves performing the color space conversion in the
- video encoder. In this case, the VisualID of the EGLConfig would
- correspond to an RGB HAL pixel format from which the video encoder can
- read. The EGLConfig would likely not need to have any caveat set, as using
- this config for normal window rendering would not have any added cost.
-
-Revision History
-
-#2 (Jamie Gennis, July 15, 2011)
- - Added issue 3.
-
-#1 (Jamie Gennis, July 8, 2011)
- - Initial draft.
diff --git a/opengl/specs/README b/opengl/specs/README
deleted file mode 100644
index 16b278f..0000000
--- a/opengl/specs/README
+++ /dev/null
@@ -1,13 +0,0 @@
-This directory contains OpenGL ES and EGL extension specifications that have
-been or are being defined for Android.
-
-The table below tracks usage of EGL enumerant values that have been reserved
-for use by Android extensions.
-
- Value Extension
----------------- ----------------------------------
-0x3140 EGL_ANDROID_image_native_buffer
-0x3141 (unused)
-0x3142 EGL_ANDROID_recordable
-0x3143 EGL_VERSION_HW_ANDROID (internal use)
-0x3144 - 0x314F (unused)
diff --git a/opengl/tests/Android.mk b/opengl/tests/Android.mk
deleted file mode 100644
index 5053e7d..0000000
--- a/opengl/tests/Android.mk
+++ /dev/null
@@ -1 +0,0 @@
-include $(call all-subdir-makefiles)
diff --git a/opengl/tests/EGLTest/Android.mk b/opengl/tests/EGLTest/Android.mk
deleted file mode 100644
index 14104d1..0000000
--- a/opengl/tests/EGLTest/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Build the unit tests.
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := EGL_test
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
- egl_cache_test.cpp \
- EGL_test.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libEGL \
- libcutils \
- libstlport \
- libutils \
-
-LOCAL_STATIC_LIBRARIES := \
- libgtest \
- libgtest_main \
-
-LOCAL_C_INCLUDES := \
- bionic \
- bionic/libc/private \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport \
- frameworks/base/opengl/libs \
- frameworks/base/opengl/libs/EGL \
-
-include $(BUILD_EXECUTABLE)
-
-# Include subdirectory makefiles
-# ============================================================
-
-# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
-# team really wants is to build the stuff defined by this makefile.
-ifeq (,$(ONE_SHOT_MAKEFILE))
-include $(call first-makefiles-under,$(LOCAL_PATH))
-endif
diff --git a/opengl/tests/EGLTest/EGL_test.cpp b/opengl/tests/EGLTest/EGL_test.cpp
deleted file mode 100644
index 337ad33..0000000
--- a/opengl/tests/EGLTest/EGL_test.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <gtest/gtest.h>
-
-#include <utils/String8.h>
-
-#include <EGL/egl.h>
-
-namespace android {
-
-class EGLTest : public ::testing::Test {
-protected:
- EGLDisplay mEglDisplay;
-
-protected:
- EGLTest() :
- mEglDisplay(EGL_NO_DISPLAY) {
- }
-
- virtual void SetUp() {
- mEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- ASSERT_NE(EGL_NO_DISPLAY, mEglDisplay);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EGLint majorVersion;
- EGLint minorVersion;
- EXPECT_TRUE(eglInitialize(mEglDisplay, &majorVersion, &minorVersion));
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- RecordProperty("EglVersionMajor", majorVersion);
- RecordProperty("EglVersionMajor", minorVersion);
- }
-
- virtual void TearDown() {
- EGLBoolean success = eglTerminate(mEglDisplay);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- }
-};
-
-TEST_F(EGLTest, DISABLED_EGLConfigEightBitFirst) {
-
- EGLint numConfigs;
- EGLConfig config;
- EGLBoolean success;
- EGLint attrs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_NONE
- };
-
- success = eglChooseConfig(mEglDisplay, attrs, &config, 1, &numConfigs);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_GE(numConfigs, 1);
-
- EGLint components[3];
-
- success = eglGetConfigAttrib(mEglDisplay, config, EGL_RED_SIZE, &components[0]);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- success = eglGetConfigAttrib(mEglDisplay, config, EGL_GREEN_SIZE, &components[1]);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- success = eglGetConfigAttrib(mEglDisplay, config, EGL_BLUE_SIZE, &components[2]);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EXPECT_GE(components[0], 8);
- EXPECT_GE(components[1], 8);
- EXPECT_GE(components[2], 8);
-}
-
-TEST_F(EGLTest, EGLConfigRGBA8888First) {
-
- EGLint numConfigs;
- EGLConfig config;
- EGLBoolean success;
- EGLint attrs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_RED_SIZE, 8,
- EGL_GREEN_SIZE, 8,
- EGL_BLUE_SIZE, 8,
- EGL_ALPHA_SIZE, 8,
- EGL_NONE
- };
-
- success = eglChooseConfig(mEglDisplay, attrs, &config, 1, &numConfigs);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- ASSERT_GE(numConfigs, 1);
-
- EGLint components[4];
-
- success = eglGetConfigAttrib(mEglDisplay, config, EGL_RED_SIZE, &components[0]);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- success = eglGetConfigAttrib(mEglDisplay, config, EGL_GREEN_SIZE, &components[1]);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- success = eglGetConfigAttrib(mEglDisplay, config, EGL_BLUE_SIZE, &components[2]);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
- success = eglGetConfigAttrib(mEglDisplay, config, EGL_ALPHA_SIZE, &components[3]);
- ASSERT_EQ(EGL_TRUE, success);
- ASSERT_EQ(EGL_SUCCESS, eglGetError());
-
- EXPECT_GE(components[0], 8);
- EXPECT_GE(components[1], 8);
- EXPECT_GE(components[2], 8);
- EXPECT_GE(components[3], 8);
-}
-
-
-}
diff --git a/opengl/tests/EGLTest/egl_cache_test.cpp b/opengl/tests/EGLTest/egl_cache_test.cpp
deleted file mode 100644
index c7d9e3e..0000000
--- a/opengl/tests/EGLTest/egl_cache_test.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#define LOG_TAG "EGL_test"
-//#define LOG_NDEBUG 0
-
-#include <gtest/gtest.h>
-
-#include <utils/Log.h>
-
-#include "egl_cache.h"
-#include "egl_display.h"
-
-namespace android {
-
-class EGLCacheTest : public ::testing::Test {
-protected:
- virtual void SetUp() {
- mCache = egl_cache_t::get();
- }
-
- virtual void TearDown() {
- mCache->setCacheFilename("");
- mCache->terminate();
- }
-
- egl_cache_t* mCache;
-};
-
-TEST_F(EGLCacheTest, UninitializedCacheAlwaysMisses) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mCache->setBlob("abcd", 4, "efgh", 4);
- ASSERT_EQ(0, mCache->getBlob("abcd", 4, buf, 4));
- ASSERT_EQ(0xee, buf[0]);
- ASSERT_EQ(0xee, buf[1]);
- ASSERT_EQ(0xee, buf[2]);
- ASSERT_EQ(0xee, buf[3]);
-}
-
-TEST_F(EGLCacheTest, InitializedCacheAlwaysHits) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
- mCache->setBlob("abcd", 4, "efgh", 4);
- ASSERT_EQ(4, mCache->getBlob("abcd", 4, buf, 4));
- ASSERT_EQ('e', buf[0]);
- ASSERT_EQ('f', buf[1]);
- ASSERT_EQ('g', buf[2]);
- ASSERT_EQ('h', buf[3]);
-}
-
-TEST_F(EGLCacheTest, TerminatedCacheAlwaysMisses) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
- mCache->setBlob("abcd", 4, "efgh", 4);
- mCache->terminate();
- ASSERT_EQ(0, mCache->getBlob("abcd", 4, buf, 4));
- ASSERT_EQ(0xee, buf[0]);
- ASSERT_EQ(0xee, buf[1]);
- ASSERT_EQ(0xee, buf[2]);
- ASSERT_EQ(0xee, buf[3]);
-}
-
-class EGLCacheSerializationTest : public EGLCacheTest {
-
-protected:
-
- virtual void SetUp() {
- EGLCacheTest::SetUp();
-
- char* tn = tempnam("/sdcard", "EGL_test-cache-");
- mFilename = tn;
- free(tn);
- }
-
- virtual void TearDown() {
- unlink(mFilename.string());
- EGLCacheTest::TearDown();
- }
-
- String8 mFilename;
-};
-
-TEST_F(EGLCacheSerializationTest, ReinitializedCacheContainsValues) {
- char buf[4] = { 0xee, 0xee, 0xee, 0xee };
- mCache->setCacheFilename(mFilename);
- mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
- mCache->setBlob("abcd", 4, "efgh", 4);
- mCache->terminate();
- mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
- ASSERT_EQ(4, mCache->getBlob("abcd", 4, buf, 4));
- ASSERT_EQ('e', buf[0]);
- ASSERT_EQ('f', buf[1]);
- ASSERT_EQ('g', buf[2]);
- ASSERT_EQ('h', buf[3]);
-}
-
-}
diff --git a/opengl/tests/angeles/Android.mk b/opengl/tests/angeles/Android.mk
deleted file mode 100644
index ae4f76d..0000000
--- a/opengl/tests/angeles/Android.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2006 The Android Open Source Project
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES:= app-linux.cpp demo.c.arm
-LOCAL_SHARED_LIBRARIES := libEGL libGLESv1_CM libui
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-LOCAL_MODULE:= angeles
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/angeles/MODULE_LICENSE_BSD_OR_LGPL b/opengl/tests/angeles/MODULE_LICENSE_BSD_OR_LGPL
deleted file mode 100644
index e69de29..0000000
--- a/opengl/tests/angeles/MODULE_LICENSE_BSD_OR_LGPL
+++ /dev/null
diff --git a/opengl/tests/angeles/README.txt b/opengl/tests/angeles/README.txt
deleted file mode 100644
index 38b8a4a..0000000
--- a/opengl/tests/angeles/README.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-------------------------------------------------------------------------
-San Angeles Observation OpenGL ES version example
-Copyright 2004-2005 Jetro Lauha
-Web: http://iki.fi/jetro/
-See file license.txt for licensing information.
-------------------------------------------------------------------------
-
-This is an OpenGL ES port of the small self-running demonstration
-called "San Angeles Observation", which was first presented in the
-Assembly'2004 event. It won the first place in the 4 KB intro
-competition category.
-
-The demonstration features a sightseeing of a futuristic city
-having many different kind of buildings and items. Everything is
-flat shaded with three different lights.
-
-The original version was made for desktop with OpenGL. It was
-naturally heavily size optimized in order to fit it in the size
-limit. For this OpenGL ES version example much of the code is
-cleaned up and the sound is removed. Also detail level is lowered,
-although it still contains over 60000 faces.
-
-The Win32 (2000/XP) binary package of original version is
-available from this address: http://jet.ro/files/angeles.zip
-
-First version of this OpenGL ES port was submitted to the Khronos
-OpenGL ES Coding Challenge held in 2004-2005.
-
-As a code example, this source shows the following:
- * How to create a minimal and portable ad hoc framework
- for small testing/demonstration programs. This framework
- compiles for both desktop and PocketPC Win32 environment,
- and a separate source is included for Linux with X11.
- * How to dynamically find and use the OpenGL ES DLL or
- shared object, so that the library is not needed at
- the compile/link stage.
- * How to use the basic features of OpenGL ES 1.0/1.1
- Common Lite, such as vertex arrays, color arrays and
- lighting.
- * How to create a self contained small demonstration
- application with objects generated using procedural
- algorithms.
-
-As the original version was optimized for size instead of
-performance, that holds true for this OpenGL ES version as
-well. Thus the performance could be significantly increased,
-for example by changing the code to use glDrawElements
-instead of glDrawArrays. The code uses only OpenGL ES 1.0
-Common Lite -level function calls without any extensions.
-
-The reference OpenGL ES implementations used for this application:
- * Hybrid's OpenGL ES API Implementation (Gerbera) version 2.0.4
- Prebuilt Win32 PC executable: SanOGLES-Gerbera.exe
- * PowerVR MBX SDK, OpenGL ES Windows PC Emulation version 1.04.14.0170
- Prebuilt Win32 PC executable: SanOGLES-PVRSDK.exe
-
-Note that DISABLE_IMPORTGL preprocessor macro can be used
-to specify not to use dynamic runtime binding of the library.
-You also need to define preprocessor macro PVRSDK to compile
-the source with PowerVR OpenGL ES SDK.
-
-The demo application is briefly tested with a few other OpenGL ES
-implementations as well (e.g. Vincent, GLESonGL on Linux, Dell
-Axim X50v). Most of these other implementations rendered the demo
-erroneously in some aspect. This may indicate that the demo source
-could still have some work to do with compatibility and correct
-API usage, although the non-conforming implementations are most
-probably unfinished as well.
-
-Thanks and Acknowledgements:
-
-* Toni Lönnberg (!Cube) created the music for original version, which
- is not featured in this OpenGL ES port.
-* Sara Kapli (st Rana) for additional camera work.
-* Paul Bourke for information about the supershapes.
-
-------------------------------------------------------------------------
diff --git a/opengl/tests/angeles/app-linux.cpp b/opengl/tests/angeles/app-linux.cpp
deleted file mode 100644
index 6ac68a2..0000000
--- a/opengl/tests/angeles/app-linux.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
-/* San Angeles Observation OpenGL ES version example
- * Copyright 2004-2005 Jetro Lauha
- * All rights reserved.
- * Web: http://iki.fi/jetro/
- *
- * This source is free software; you can redistribute it and/or
- * modify it under the terms of EITHER:
- * (1) The GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version. The text of the GNU Lesser
- * General Public License is included with this source in the
- * file LICENSE-LGPL.txt.
- * (2) The BSD-style license that is included with this source in
- * the file LICENSE-BSD.txt.
- *
- * This source is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
- *
- * $Id: app-linux.c,v 1.4 2005/02/08 18:42:48 tonic Exp $
- * $Revision: 1.4 $
- *
- * Parts of this source file is based on test/example code from
- * GLESonGL implementation by David Blythe. Here is copy of the
- * license notice from that source:
- *
- * Copyright (C) 2003 David Blythe All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * DAVID BLYTHE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/time.h>
-
-#include <EGL/egl.h>
-#include <GLES/gl.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-#include "app.h"
-
-
-int gAppAlive = 1;
-
-static const char sAppName[] =
- "San Angeles Observation OpenGL ES version example (Linux)";
-
-static int sWindowWidth = WINDOW_DEFAULT_WIDTH;
-static int sWindowHeight = WINDOW_DEFAULT_HEIGHT;
-static EGLDisplay sEglDisplay = EGL_NO_DISPLAY;
-static EGLContext sEglContext = EGL_NO_CONTEXT;
-static EGLSurface sEglSurface = EGL_NO_SURFACE;
-
-const char *egl_strerror(unsigned err)
-{
- switch(err){
- case EGL_SUCCESS: return "SUCCESS";
- case EGL_NOT_INITIALIZED: return "NOT INITIALIZED";
- case EGL_BAD_ACCESS: return "BAD ACCESS";
- case EGL_BAD_ALLOC: return "BAD ALLOC";
- case EGL_BAD_ATTRIBUTE: return "BAD_ATTRIBUTE";
- case EGL_BAD_CONFIG: return "BAD CONFIG";
- case EGL_BAD_CONTEXT: return "BAD CONTEXT";
- case EGL_BAD_CURRENT_SURFACE: return "BAD CURRENT SURFACE";
- case EGL_BAD_DISPLAY: return "BAD DISPLAY";
- case EGL_BAD_MATCH: return "BAD MATCH";
- case EGL_BAD_NATIVE_PIXMAP: return "BAD NATIVE PIXMAP";
- case EGL_BAD_NATIVE_WINDOW: return "BAD NATIVE WINDOW";
- case EGL_BAD_PARAMETER: return "BAD PARAMETER";
- case EGL_BAD_SURFACE: return "BAD_SURFACE";
- // case EGL_CONTEXT_LOST: return "CONTEXT LOST";
- default: return "UNKNOWN";
- }
-}
-
-void egl_error(const char *name)
-{
- unsigned err = eglGetError();
- if(err != EGL_SUCCESS) {
- fprintf(stderr,"%s(): egl error 0x%x (%s)\n",
- name, err, egl_strerror(err));
- }
-}
-
-static void checkGLErrors()
-{
- GLenum error = glGetError();
- if (error != GL_NO_ERROR)
- fprintf(stderr, "GL Error: 0x%04x\n", (int)error);
-}
-
-
-static void checkEGLErrors()
-{
- EGLint error = eglGetError();
- // GLESonGL seems to be returning 0 when there is no errors?
- if (error && error != EGL_SUCCESS)
- fprintf(stderr, "EGL Error: 0x%04x\n", (int)error);
-}
-
-static int initGraphics(unsigned samples)
-{
- EGLint configAttribs[] = {
- EGL_DEPTH_SIZE, 16,
- EGL_SAMPLE_BUFFERS, samples ? 1 : 0,
- EGL_SAMPLES, samples,
- EGL_NONE
- };
-
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLConfig config;
- EGLSurface surface;
- EGLint w, h;
- EGLDisplay dpy;
-
- EGLNativeWindowType window = android_createDisplaySurface();
-
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglInitialize(dpy, &majorVersion, &minorVersion);
-
- status_t err = EGLUtils::selectConfigForNativeWindow(
- dpy, configAttribs, window, &config);
- if (err) {
- fprintf(stderr, "couldn't find an EGLConfig matching the screen format\n");
- return 0;
- }
-
- surface = eglCreateWindowSurface(dpy, config, window, NULL);
- egl_error("eglCreateWindowSurface");
-
- fprintf(stderr,"surface = %p\n", surface);
-
- context = eglCreateContext(dpy, config, NULL, NULL);
- egl_error("eglCreateContext");
- fprintf(stderr,"context = %p\n", context);
-
- eglMakeCurrent(dpy, surface, surface, context);
- egl_error("eglMakeCurrent");
-
- eglQuerySurface(dpy, surface, EGL_WIDTH, &sWindowWidth);
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &sWindowHeight);
-
- sEglDisplay = dpy;
- sEglSurface = surface;
- sEglContext = context;
-
- if (samples == 0) {
- // GL_MULTISAMPLE is enabled by default
- glDisable(GL_MULTISAMPLE);
- }
-
- return EGL_TRUE;
-}
-
-
-static void deinitGraphics()
-{
- eglMakeCurrent(sEglDisplay, NULL, NULL, NULL);
- eglDestroyContext(sEglDisplay, sEglContext);
- eglDestroySurface(sEglDisplay, sEglSurface);
- eglTerminate(sEglDisplay);
-}
-
-
-int main(int argc, char *argv[])
-{
- unsigned samples = 0;
- printf("usage: %s [samples]\n", argv[0]);
- if (argc == 2) {
- samples = atoi( argv[1] );
- printf("Multisample enabled: GL_SAMPLES = %u\n", samples);
- }
-
- if (!initGraphics(samples))
- {
- fprintf(stderr, "Graphics initialization failed.\n");
- return EXIT_FAILURE;
- }
-
- appInit();
-
- struct timeval timeTemp;
- int frameCount = 0;
- gettimeofday(&timeTemp, NULL);
- double totalTime = timeTemp.tv_usec/1000000.0 + timeTemp.tv_sec;
-
- while (gAppAlive)
- {
- struct timeval timeNow;
-
- gettimeofday(&timeNow, NULL);
- appRender(timeNow.tv_sec * 1000 + timeNow.tv_usec / 1000,
- sWindowWidth, sWindowHeight);
- checkGLErrors();
- eglSwapBuffers(sEglDisplay, sEglSurface);
- checkEGLErrors();
- frameCount++;
- }
-
- gettimeofday(&timeTemp, NULL);
-
- appDeinit();
- deinitGraphics();
-
- totalTime = (timeTemp.tv_usec/1000000.0 + timeTemp.tv_sec) - totalTime;
- printf("totalTime=%f s, frameCount=%d, %.2f fps\n",
- totalTime, frameCount, frameCount/totalTime);
-
- return EXIT_SUCCESS;
-}
diff --git a/opengl/tests/angeles/app.h b/opengl/tests/angeles/app.h
deleted file mode 100644
index 70ebd35..0000000
--- a/opengl/tests/angeles/app.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* San Angeles Observation OpenGL ES version example
- * Copyright 2004-2005 Jetro Lauha
- * All rights reserved.
- * Web: http://iki.fi/jetro/
- *
- * This source is free software; you can redistribute it and/or
- * modify it under the terms of EITHER:
- * (1) The GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version. The text of the GNU Lesser
- * General Public License is included with this source in the
- * file LICENSE-LGPL.txt.
- * (2) The BSD-style license that is included with this source in
- * the file LICENSE-BSD.txt.
- *
- * This source is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
- *
- * $Id: app.h,v 1.14 2005/02/06 21:13:54 tonic Exp $
- * $Revision: 1.14 $
- */
-
-#ifndef APP_H_INCLUDED
-#define APP_H_INCLUDED
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define WINDOW_DEFAULT_WIDTH 640
-#define WINDOW_DEFAULT_HEIGHT 480
-
-#define WINDOW_BPP 16
-
-
-// The simple framework expects the application code to define these functions.
-extern void appInit();
-extern void appDeinit();
-extern void appRender(long tick, int width, int height);
-
-/* Value is non-zero when application is alive, and 0 when it is closing.
- * Defined by the application framework.
- */
-extern int gAppAlive;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // !APP_H_INCLUDED
diff --git a/opengl/tests/angeles/cams.h b/opengl/tests/angeles/cams.h
deleted file mode 100644
index 2b1acb3..0000000
--- a/opengl/tests/angeles/cams.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* San Angeles Observation OpenGL ES version example
- * Copyright 2004-2005 Jetro Lauha
- * All rights reserved.
- * Web: http://iki.fi/jetro/
- *
- * This source is free software; you can redistribute it and/or
- * modify it under the terms of EITHER:
- * (1) The GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version. The text of the GNU Lesser
- * General Public License is included with this source in the
- * file LICENSE-LGPL.txt.
- * (2) The BSD-style license that is included with this source in
- * the file LICENSE-BSD.txt.
- *
- * This source is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
- *
- * $Id: cams.h,v 1.7 2005/01/31 22:15:15 tonic Exp $
- * $Revision: 1.7 $
- */
-
-#ifndef CAMS_H_INCLUDED
-#define CAMS_H_INCLUDED
-
-
-/* Length in milliseconds of one camera track base unit.
- * The value originates from the music synchronization.
- */
-#define CAMTRACK_LEN 5442
-
-
-// Camera track definition for one camera trucking shot.
-typedef struct
-{
- /* Five parameters of src[5] and dest[5]:
- * eyeX, eyeY, eyeZ, viewAngle, viewHeightOffs
- */
- short src[5], dest[5];
- unsigned char dist; // if >0, cam rotates around eye xy on dist * 0.1
- unsigned char len; // length multiplier
-} CAMTRACK;
-
-static CAMTRACK sCamTracks[] =
-{
- { { 4500, 2700, 100, 70, -30 }, { 50, 50, -90, -100, 0 }, 20, 1 },
- { { -1448, 4294, 25, 363, 0 }, { -136, 202, 125, -98, 100 }, 0, 1 },
- { { 1437, 4930, 200, -275, -20 }, { 1684, 0, 0, 9, 0 }, 0, 1 },
- { { 1800, 3609, 200, 0, 675 }, { 0, 0, 0, 300, 0 }, 0, 1 },
- { { 923, 996, 50, 2336, -80 }, { 0, -20, -50, 0, 170 }, 0, 1 },
- { { -1663, -43, 600, 2170, 0 }, { 20, 0, -600, 0, 100 }, 0, 1 },
- { { 1049, -1420, 175, 2111, -17 }, { 0, 0, 0, -334, 0 }, 0, 2 },
- { { 0, 0, 50, 300, 25 }, { 0, 0, 0, 300, 0 }, 70, 2 },
- { { -473, -953, 3500, -353, -350 }, { 0, 0, -2800, 0, 0 }, 0, 2 },
- { { 191, 1938, 35, 1139, -17 }, { 1205, -2909, 0, 0, 0 }, 0, 2 },
- { { -1449, -2700, 150, 0, 0 }, { 0, 2000, 0, 0, 0 }, 0, 2 },
- { { 5273, 4992, 650, 373, -50 }, { -4598, -3072, 0, 0, 0 }, 0, 2 },
- { { 3223, -3282, 1075, -393, -25 }, { 1649, -1649, 0, 0, 0 }, 0, 2 }
-};
-#define CAMTRACK_COUNT (sizeof(camTracks) / sizeof(camTracks[0]))
-
-
-#endif // !CAMS_H_INCLUDED
diff --git a/opengl/tests/angeles/demo.c b/opengl/tests/angeles/demo.c
deleted file mode 100644
index 802f398..0000000
--- a/opengl/tests/angeles/demo.c
+++ /dev/null
@@ -1,792 +0,0 @@
-/* San Angeles Observation OpenGL ES version example
- * Copyright 2004-2005 Jetro Lauha
- * All rights reserved.
- * Web: http://iki.fi/jetro/
- *
- * This source is free software; you can redistribute it and/or
- * modify it under the terms of EITHER:
- * (1) The GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version. The text of the GNU Lesser
- * General Public License is included with this source in the
- * file LICENSE-LGPL.txt.
- * (2) The BSD-style license that is included with this source in
- * the file LICENSE-BSD.txt.
- *
- * This source is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
- *
- * $Id: demo.c,v 1.10 2005/02/08 20:54:39 tonic Exp $
- * $Revision: 1.10 $
- */
-
-#include <stdlib.h>
-#include <math.h>
-#include <float.h>
-#include <assert.h>
-
-#include <GLES/gl.h>
-
-#include "app.h"
-#include "shapes.h"
-#include "cams.h"
-
-
-// Total run length is 20 * camera track base unit length (see cams.h).
-#define RUN_LENGTH (20 * CAMTRACK_LEN)
-#undef PI
-#define PI 3.1415926535897932f
-#define RANDOM_UINT_MAX 65535
-
-
-static unsigned long sRandomSeed = 0;
-
-static void seedRandom(unsigned long seed)
-{
- sRandomSeed = seed;
-}
-
-static unsigned long randomUInt()
-{
- sRandomSeed = sRandomSeed * 0x343fd + 0x269ec3;
- return sRandomSeed >> 16;
-}
-
-
-// Capped conversion from float to fixed.
-static long floatToFixed(float value)
-{
- if (value < -32768) value = -32768;
- if (value > 32767) value = 32767;
- return (long)(value * 65536);
-}
-
-#define FIXED(value) floatToFixed(value)
-
-
-// Definition of one GL object in this demo.
-typedef struct {
- /* Vertex array and color array are enabled for all objects, so their
- * pointers must always be valid and non-NULL. Normal array is not
- * used by the ground plane, so when its pointer is NULL then normal
- * array usage is disabled.
- *
- * Vertex array is supposed to use GL_FIXED datatype and stride 0
- * (i.e. tightly packed array). Color array is supposed to have 4
- * components per color with GL_UNSIGNED_BYTE datatype and stride 0.
- * Normal array is supposed to use GL_FIXED datatype and stride 0.
- */
- GLfixed *vertexArray;
- GLubyte *colorArray;
- GLfixed *normalArray;
- GLint vertexComponents;
- GLsizei count;
-} GLOBJECT;
-
-
-static long sStartTick = 0;
-static long sTick = 0;
-
-static int sCurrentCamTrack = 0;
-static long sCurrentCamTrackStartTick = 0;
-static long sNextCamTrackStartTick = 0x7fffffff;
-
-static GLOBJECT *sSuperShapeObjects[SUPERSHAPE_COUNT] = { NULL };
-static GLOBJECT *sGroundPlane = NULL;
-
-
-typedef struct {
- float x, y, z;
-} VECTOR3;
-
-
-static void freeGLObject(GLOBJECT *object)
-{
- if (object == NULL)
- return;
- free(object->normalArray);
- free(object->colorArray);
- free(object->vertexArray);
- free(object);
-}
-
-
-static GLOBJECT * newGLObject(long vertices, int vertexComponents,
- int useNormalArray)
-{
- GLOBJECT *result;
- result = (GLOBJECT *)malloc(sizeof(GLOBJECT));
- if (result == NULL)
- return NULL;
- result->count = vertices;
- result->vertexComponents = vertexComponents;
- result->vertexArray = (GLfixed *)malloc(vertices * vertexComponents *
- sizeof(GLfixed));
- result->colorArray = (GLubyte *)malloc(vertices * 4 * sizeof(GLubyte));
- if (useNormalArray)
- {
- result->normalArray = (GLfixed *)malloc(vertices * 3 *
- sizeof(GLfixed));
- }
- else
- result->normalArray = NULL;
- if (result->vertexArray == NULL ||
- result->colorArray == NULL ||
- (useNormalArray && result->normalArray == NULL))
- {
- freeGLObject(result);
- return NULL;
- }
- return result;
-}
-
-
-static void drawGLObject(GLOBJECT *object)
-{
- assert(object != NULL);
-
- glVertexPointer(object->vertexComponents, GL_FIXED,
- 0, object->vertexArray);
- glColorPointer(4, GL_UNSIGNED_BYTE, 0, object->colorArray);
-
- // Already done in initialization:
- //glEnableClientState(GL_VERTEX_ARRAY);
- //glEnableClientState(GL_COLOR_ARRAY);
-
- if (object->normalArray)
- {
- glNormalPointer(GL_FIXED, 0, object->normalArray);
- glEnableClientState(GL_NORMAL_ARRAY);
- }
- else
- glDisableClientState(GL_NORMAL_ARRAY);
- glDrawArrays(GL_TRIANGLES, 0, object->count);
-}
-
-
-static void vector3Sub(VECTOR3 *dest, VECTOR3 *v1, VECTOR3 *v2)
-{
- dest->x = v1->x - v2->x;
- dest->y = v1->y - v2->y;
- dest->z = v1->z - v2->z;
-}
-
-
-static void superShapeMap(VECTOR3 *point, float r1, float r2, float t, float p)
-{
- // sphere-mapping of supershape parameters
- point->x = (float)(cos(t) * cos(p) / r1 / r2);
- point->y = (float)(sin(t) * cos(p) / r1 / r2);
- point->z = (float)(sin(p) / r2);
-}
-
-
-static float ssFunc(const float t, const float *p)
-{
- return (float)(pow(pow(fabs(cos(p[0] * t / 4)) / p[1], p[4]) +
- pow(fabs(sin(p[0] * t / 4)) / p[2], p[5]), 1 / p[3]));
-}
-
-
-// Creates and returns a supershape object.
-// Based on Paul Bourke's POV-Ray implementation.
-// http://astronomy.swin.edu.au/~pbourke/povray/supershape/
-static GLOBJECT * createSuperShape(const float *params)
-{
- const int resol1 = (int)params[SUPERSHAPE_PARAMS - 3];
- const int resol2 = (int)params[SUPERSHAPE_PARAMS - 2];
- // latitude 0 to pi/2 for no mirrored bottom
- // (latitudeBegin==0 for -pi/2 to pi/2 originally)
- const int latitudeBegin = resol2 / 4;
- const int latitudeEnd = resol2 / 2; // non-inclusive
- const int longitudeCount = resol1;
- const int latitudeCount = latitudeEnd - latitudeBegin;
- const long triangleCount = longitudeCount * latitudeCount * 2;
- const long vertices = triangleCount * 3;
- GLOBJECT *result;
- float baseColor[3];
- int a, longitude, latitude;
- long currentVertex, currentQuad;
-
- result = newGLObject(vertices, 3, 1);
- if (result == NULL)
- return NULL;
-
- for (a = 0; a < 3; ++a)
- baseColor[a] = ((randomUInt() % 155) + 100) / 255.f;
-
- currentQuad = 0;
- currentVertex = 0;
-
- // longitude -pi to pi
- for (longitude = 0; longitude < longitudeCount; ++longitude)
- {
-
- // latitude 0 to pi/2
- for (latitude = latitudeBegin; latitude < latitudeEnd; ++latitude)
- {
- float t1 = -PI + longitude * 2 * PI / resol1;
- float t2 = -PI + (longitude + 1) * 2 * PI / resol1;
- float p1 = -PI / 2 + latitude * 2 * PI / resol2;
- float p2 = -PI / 2 + (latitude + 1) * 2 * PI / resol2;
- float r0, r1, r2, r3;
-
- r0 = ssFunc(t1, params);
- r1 = ssFunc(p1, ¶ms[6]);
- r2 = ssFunc(t2, params);
- r3 = ssFunc(p2, ¶ms[6]);
-
- if (r0 != 0 && r1 != 0 && r2 != 0 && r3 != 0)
- {
- VECTOR3 pa, pb, pc, pd;
- VECTOR3 v1, v2, n;
- float ca;
- int i;
- //float lenSq, invLenSq;
-
- superShapeMap(&pa, r0, r1, t1, p1);
- superShapeMap(&pb, r2, r1, t2, p1);
- superShapeMap(&pc, r2, r3, t2, p2);
- superShapeMap(&pd, r0, r3, t1, p2);
-
- // kludge to set lower edge of the object to fixed level
- if (latitude == latitudeBegin + 1)
- pa.z = pb.z = 0;
-
- vector3Sub(&v1, &pb, &pa);
- vector3Sub(&v2, &pd, &pa);
-
- // Calculate normal with cross product.
- /* i j k i j
- * v1.x v1.y v1.z | v1.x v1.y
- * v2.x v2.y v2.z | v2.x v2.y
- */
-
- n.x = v1.y * v2.z - v1.z * v2.y;
- n.y = v1.z * v2.x - v1.x * v2.z;
- n.z = v1.x * v2.y - v1.y * v2.x;
-
- /* Pre-normalization of the normals is disabled here because
- * they will be normalized anyway later due to automatic
- * normalization (GL_NORMALIZE). It is enabled because the
- * objects are scaled with glScale.
- */
- /*
- lenSq = n.x * n.x + n.y * n.y + n.z * n.z;
- invLenSq = (float)(1 / sqrt(lenSq));
- n.x *= invLenSq;
- n.y *= invLenSq;
- n.z *= invLenSq;
- */
-
- ca = pa.z + 0.5f;
-
- for (i = currentVertex * 3;
- i < (currentVertex + 6) * 3;
- i += 3)
- {
- result->normalArray[i] = FIXED(n.x);
- result->normalArray[i + 1] = FIXED(n.y);
- result->normalArray[i + 2] = FIXED(n.z);
- }
- for (i = currentVertex * 4;
- i < (currentVertex + 6) * 4;
- i += 4)
- {
- int a, color[3];
- for (a = 0; a < 3; ++a)
- {
- color[a] = (int)(ca * baseColor[a] * 255);
- if (color[a] > 255) color[a] = 255;
- }
- result->colorArray[i] = (GLubyte)color[0];
- result->colorArray[i + 1] = (GLubyte)color[1];
- result->colorArray[i + 2] = (GLubyte)color[2];
- result->colorArray[i + 3] = 0;
- }
- result->vertexArray[currentVertex * 3] = FIXED(pa.x);
- result->vertexArray[currentVertex * 3 + 1] = FIXED(pa.y);
- result->vertexArray[currentVertex * 3 + 2] = FIXED(pa.z);
- ++currentVertex;
- result->vertexArray[currentVertex * 3] = FIXED(pb.x);
- result->vertexArray[currentVertex * 3 + 1] = FIXED(pb.y);
- result->vertexArray[currentVertex * 3 + 2] = FIXED(pb.z);
- ++currentVertex;
- result->vertexArray[currentVertex * 3] = FIXED(pd.x);
- result->vertexArray[currentVertex * 3 + 1] = FIXED(pd.y);
- result->vertexArray[currentVertex * 3 + 2] = FIXED(pd.z);
- ++currentVertex;
- result->vertexArray[currentVertex * 3] = FIXED(pb.x);
- result->vertexArray[currentVertex * 3 + 1] = FIXED(pb.y);
- result->vertexArray[currentVertex * 3 + 2] = FIXED(pb.z);
- ++currentVertex;
- result->vertexArray[currentVertex * 3] = FIXED(pc.x);
- result->vertexArray[currentVertex * 3 + 1] = FIXED(pc.y);
- result->vertexArray[currentVertex * 3 + 2] = FIXED(pc.z);
- ++currentVertex;
- result->vertexArray[currentVertex * 3] = FIXED(pd.x);
- result->vertexArray[currentVertex * 3 + 1] = FIXED(pd.y);
- result->vertexArray[currentVertex * 3 + 2] = FIXED(pd.z);
- ++currentVertex;
- } // r0 && r1 && r2 && r3
- ++currentQuad;
- } // latitude
- } // longitude
-
- // Set number of vertices in object to the actual amount created.
- result->count = currentVertex;
-
- return result;
-}
-
-
-static GLOBJECT * createGroundPlane()
-{
- const int scale = 4;
- const int yBegin = -15, yEnd = 15; // ends are non-inclusive
- const int xBegin = -15, xEnd = 15;
- const long triangleCount = (yEnd - yBegin) * (xEnd - xBegin) * 2;
- const long vertices = triangleCount * 3;
- GLOBJECT *result;
- int x, y;
- long currentVertex, currentQuad;
-
- result = newGLObject(vertices, 2, 0);
- if (result == NULL)
- return NULL;
-
- currentQuad = 0;
- currentVertex = 0;
-
- for (y = yBegin; y < yEnd; ++y)
- {
- for (x = xBegin; x < xEnd; ++x)
- {
- GLubyte color;
- int i, a;
- color = (GLubyte)((randomUInt() & 0x5f) + 81); // 101 1111
- for (i = currentVertex * 4; i < (currentVertex + 6) * 4; i += 4)
- {
- result->colorArray[i] = color;
- result->colorArray[i + 1] = color;
- result->colorArray[i + 2] = color;
- result->colorArray[i + 3] = 0;
- }
-
- // Axis bits for quad triangles:
- // x: 011100 (0x1c), y: 110001 (0x31) (clockwise)
- // x: 001110 (0x0e), y: 100011 (0x23) (counter-clockwise)
- for (a = 0; a < 6; ++a)
- {
- const int xm = x + ((0x1c >> a) & 1);
- const int ym = y + ((0x31 >> a) & 1);
- const float m = (float)(cos(xm * 2) * sin(ym * 4) * 0.75f);
- result->vertexArray[currentVertex * 2] =
- FIXED(xm * scale + m);
- result->vertexArray[currentVertex * 2 + 1] =
- FIXED(ym * scale + m);
- ++currentVertex;
- }
- ++currentQuad;
- }
- }
- return result;
-}
-
-
-static void drawGroundPlane()
-{
- glDisable(GL_CULL_FACE);
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
- glBlendFunc(GL_ZERO, GL_SRC_COLOR);
- glDisable(GL_LIGHTING);
-
- drawGLObject(sGroundPlane);
-
- glEnable(GL_LIGHTING);
- glDisable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
-}
-
-
-static void drawFadeQuad()
-{
- static const GLfixed quadVertices[] = {
- -0x10000, -0x10000,
- 0x10000, -0x10000,
- -0x10000, 0x10000,
- 0x10000, -0x10000,
- 0x10000, 0x10000,
- -0x10000, 0x10000
- };
-
- const int beginFade = sTick - sCurrentCamTrackStartTick;
- const int endFade = sNextCamTrackStartTick - sTick;
- const int minFade = beginFade < endFade ? beginFade : endFade;
-
- if (minFade < 1024)
- {
- const GLfixed fadeColor = minFade << 6;
- glColor4x(fadeColor, fadeColor, fadeColor, 0);
-
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
- glBlendFunc(GL_ZERO, GL_SRC_COLOR);
- glDisable(GL_LIGHTING);
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-
- glDisableClientState(GL_COLOR_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
- glVertexPointer(2, GL_FIXED, 0, quadVertices);
- glDrawArrays(GL_TRIANGLES, 0, 6);
-
- glEnableClientState(GL_COLOR_ARRAY);
-
- glMatrixMode(GL_MODELVIEW);
-
- glEnable(GL_LIGHTING);
- glDisable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
- }
-}
-
-
-// Called from the app framework.
-void appInit()
-{
- int a;
-
- glEnable(GL_NORMALIZE);
- glEnable(GL_DEPTH_TEST);
- glDisable(GL_CULL_FACE);
- glShadeModel(GL_FLAT);
-
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_LIGHT1);
- glEnable(GL_LIGHT2);
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
-
- seedRandom(15);
-
- for (a = 0; a < SUPERSHAPE_COUNT; ++a)
- {
- sSuperShapeObjects[a] = createSuperShape(sSuperShapeParams[a]);
- assert(sSuperShapeObjects[a] != NULL);
- }
- sGroundPlane = createGroundPlane();
- assert(sGroundPlane != NULL);
-}
-
-
-// Called from the app framework.
-void appDeinit()
-{
- int a;
- for (a = 0; a < SUPERSHAPE_COUNT; ++a)
- freeGLObject(sSuperShapeObjects[a]);
- freeGLObject(sGroundPlane);
-}
-
-
-static void gluPerspective(GLfloat fovy, GLfloat aspect,
- GLfloat zNear, GLfloat zFar)
-{
- GLfloat xmin, xmax, ymin, ymax;
-
- ymax = zNear * (GLfloat)tan(fovy * PI / 360);
- ymin = -ymax;
- xmin = ymin * aspect;
- xmax = ymax * aspect;
-
- glFrustumx((GLfixed)(xmin * 65536), (GLfixed)(xmax * 65536),
- (GLfixed)(ymin * 65536), (GLfixed)(ymax * 65536),
- (GLfixed)(zNear * 65536), (GLfixed)(zFar * 65536));
-}
-
-
-static void prepareFrame(int width, int height)
-{
- glViewport(0, 0, width, height);
-
- glClearColorx((GLfixed)(0.1f * 65536),
- (GLfixed)(0.2f * 65536),
- (GLfixed)(0.3f * 65536), 0x10000);
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(45, (float)width / height, 0.5f, 150);
-
- glMatrixMode(GL_MODELVIEW);
-
- glLoadIdentity();
-}
-
-
-static void configureLightAndMaterial()
-{
- static GLfixed light0Position[] = { -0x40000, 0x10000, 0x10000, 0 };
- static GLfixed light0Diffuse[] = { 0x10000, 0x6666, 0, 0x10000 };
- static GLfixed light1Position[] = { 0x10000, -0x20000, -0x10000, 0 };
- static GLfixed light1Diffuse[] = { 0x11eb, 0x23d7, 0x5999, 0x10000 };
- static GLfixed light2Position[] = { -0x10000, 0, -0x40000, 0 };
- static GLfixed light2Diffuse[] = { 0x11eb, 0x2b85, 0x23d7, 0x10000 };
- static GLfixed materialSpecular[] = { 0x10000, 0x10000, 0x10000, 0x10000 };
-
- glLightxv(GL_LIGHT0, GL_POSITION, light0Position);
- glLightxv(GL_LIGHT0, GL_DIFFUSE, light0Diffuse);
- glLightxv(GL_LIGHT1, GL_POSITION, light1Position);
- glLightxv(GL_LIGHT1, GL_DIFFUSE, light1Diffuse);
- glLightxv(GL_LIGHT2, GL_POSITION, light2Position);
- glLightxv(GL_LIGHT2, GL_DIFFUSE, light2Diffuse);
- glMaterialxv(GL_FRONT_AND_BACK, GL_SPECULAR, materialSpecular);
-
- glMaterialx(GL_FRONT_AND_BACK, GL_SHININESS, 60 << 16);
- glEnable(GL_COLOR_MATERIAL);
-}
-
-
-static void drawModels(float zScale)
-{
- const int translationScale = 9;
- int x, y;
-
- seedRandom(9);
-
- glScalex(1 << 16, 1 << 16, (GLfixed)(zScale * 65536));
-
- for (y = -5; y <= 5; ++y)
- {
- for (x = -5; x <= 5; ++x)
- {
- float buildingScale;
- GLfixed fixedScale;
-
- int curShape = randomUInt() % SUPERSHAPE_COUNT;
- buildingScale = sSuperShapeParams[curShape][SUPERSHAPE_PARAMS - 1];
- fixedScale = (GLfixed)(buildingScale * 65536);
-
- glPushMatrix();
- glTranslatex((x * translationScale) * 65536,
- (y * translationScale) * 65536,
- 0);
- glRotatex((GLfixed)((randomUInt() % 360) << 16), 0, 0, 1 << 16);
- glScalex(fixedScale, fixedScale, fixedScale);
-
- drawGLObject(sSuperShapeObjects[curShape]);
- glPopMatrix();
- }
- }
-
- for (x = -2; x <= 2; ++x)
- {
- const int shipScale100 = translationScale * 500;
- const int offs100 = x * shipScale100 + (sTick % shipScale100);
- float offs = offs100 * 0.01f;
- GLfixed fixedOffs = (GLfixed)(offs * 65536);
- glPushMatrix();
- glTranslatex(fixedOffs, -4 * 65536, 2 << 16);
- drawGLObject(sSuperShapeObjects[SUPERSHAPE_COUNT - 1]);
- glPopMatrix();
- glPushMatrix();
- glTranslatex(-4 * 65536, fixedOffs, 4 << 16);
- glRotatex(90 << 16, 0, 0, 1 << 16);
- drawGLObject(sSuperShapeObjects[SUPERSHAPE_COUNT - 1]);
- glPopMatrix();
- }
-}
-
-
-/* Following gluLookAt implementation is adapted from the
- * Mesa 3D Graphics library. http://www.mesa3d.org
- */
-static void gluLookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez,
- GLfloat centerx, GLfloat centery, GLfloat centerz,
- GLfloat upx, GLfloat upy, GLfloat upz)
-{
- GLfloat m[16];
- GLfloat x[3], y[3], z[3];
- GLfloat mag;
-
- /* Make rotation matrix */
-
- /* Z vector */
- z[0] = eyex - centerx;
- z[1] = eyey - centery;
- z[2] = eyez - centerz;
- mag = (float)sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]);
- if (mag) { /* mpichler, 19950515 */
- z[0] /= mag;
- z[1] /= mag;
- z[2] /= mag;
- }
-
- /* Y vector */
- y[0] = upx;
- y[1] = upy;
- y[2] = upz;
-
- /* X vector = Y cross Z */
- x[0] = y[1] * z[2] - y[2] * z[1];
- x[1] = -y[0] * z[2] + y[2] * z[0];
- x[2] = y[0] * z[1] - y[1] * z[0];
-
- /* Recompute Y = Z cross X */
- y[0] = z[1] * x[2] - z[2] * x[1];
- y[1] = -z[0] * x[2] + z[2] * x[0];
- y[2] = z[0] * x[1] - z[1] * x[0];
-
- /* mpichler, 19950515 */
- /* cross product gives area of parallelogram, which is < 1.0 for
- * non-perpendicular unit-length vectors; so normalize x, y here
- */
-
- mag = (float)sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);
- if (mag) {
- x[0] /= mag;
- x[1] /= mag;
- x[2] /= mag;
- }
-
- mag = (float)sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]);
- if (mag) {
- y[0] /= mag;
- y[1] /= mag;
- y[2] /= mag;
- }
-
-#define M(row,col) m[col*4+row]
- M(0, 0) = x[0];
- M(0, 1) = x[1];
- M(0, 2) = x[2];
- M(0, 3) = 0.0;
- M(1, 0) = y[0];
- M(1, 1) = y[1];
- M(1, 2) = y[2];
- M(1, 3) = 0.0;
- M(2, 0) = z[0];
- M(2, 1) = z[1];
- M(2, 2) = z[2];
- M(2, 3) = 0.0;
- M(3, 0) = 0.0;
- M(3, 1) = 0.0;
- M(3, 2) = 0.0;
- M(3, 3) = 1.0;
-#undef M
- {
- int a;
- GLfixed fixedM[16];
- for (a = 0; a < 16; ++a)
- fixedM[a] = (GLfixed)(m[a] * 65536);
- glMultMatrixx(fixedM);
- }
-
- /* Translate Eye to Origin */
- glTranslatex((GLfixed)(-eyex * 65536),
- (GLfixed)(-eyey * 65536),
- (GLfixed)(-eyez * 65536));
-}
-
-
-static void camTrack()
-{
- float lerp[5];
- float eX, eY, eZ, cX, cY, cZ;
- float trackPos;
- CAMTRACK *cam;
- long currentCamTick;
- int a;
-
- if (sNextCamTrackStartTick <= sTick)
- {
- ++sCurrentCamTrack;
- sCurrentCamTrackStartTick = sNextCamTrackStartTick;
- }
- sNextCamTrackStartTick = sCurrentCamTrackStartTick +
- sCamTracks[sCurrentCamTrack].len * CAMTRACK_LEN;
-
- cam = &sCamTracks[sCurrentCamTrack];
- currentCamTick = sTick - sCurrentCamTrackStartTick;
- trackPos = (float)currentCamTick / (CAMTRACK_LEN * cam->len);
-
- for (a = 0; a < 5; ++a)
- lerp[a] = (cam->src[a] + cam->dest[a] * trackPos) * 0.01f;
-
- if (cam->dist)
- {
- float dist = cam->dist * 0.1f;
- cX = lerp[0];
- cY = lerp[1];
- cZ = lerp[2];
- eX = cX - (float)cos(lerp[3]) * dist;
- eY = cY - (float)sin(lerp[3]) * dist;
- eZ = cZ - lerp[4];
- }
- else
- {
- eX = lerp[0];
- eY = lerp[1];
- eZ = lerp[2];
- cX = eX + (float)cos(lerp[3]);
- cY = eY + (float)sin(lerp[3]);
- cZ = eZ + lerp[4];
- }
- gluLookAt(eX, eY, eZ, cX, cY, cZ, 0, 0, 1);
-}
-
-
-// Called from the app framework.
-/* The tick is current time in milliseconds, width and height
- * are the image dimensions to be rendered.
- */
-void appRender(long tick, int width, int height)
-{
- if (sStartTick == 0)
- sStartTick = tick;
- if (!gAppAlive)
- return;
-
- // Actual tick value is "blurred" a little bit.
- sTick = (sTick + tick - sStartTick) >> 1;
-
- // Terminate application after running through the demonstration once.
- if (sTick >= RUN_LENGTH)
- {
- gAppAlive = 0;
- return;
- }
-
- // Prepare OpenGL ES for rendering of the frame.
- prepareFrame(width, height);
-
- // Update the camera position and set the lookat.
- camTrack();
-
- // Configure environment.
- configureLightAndMaterial();
-
- // Draw the reflection by drawing models with negated Z-axis.
- glPushMatrix();
- drawModels(-1);
- glPopMatrix();
-
- // Blend the ground plane to the window.
- drawGroundPlane();
-
- // Draw all the models normally.
- drawModels(1);
-
- // Draw fade quad over whole window (when changing cameras).
- drawFadeQuad();
-}
diff --git a/opengl/tests/angeles/include/GLES/egl.h b/opengl/tests/angeles/include/GLES/egl.h
deleted file mode 100644
index cdf8410..0000000
--- a/opengl/tests/angeles/include/GLES/egl.h
+++ /dev/null
@@ -1,229 +0,0 @@
-#ifndef __egl_h_
-#define __egl_h_
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-#include <GLES/gl.h>
-#include <GLES/egltypes.h>
-
-/*
-** egltypes.h is platform dependent. It defines:
-**
-** - EGL types and resources
-** - Native types
-** - EGL and native handle values
-**
-** EGL types and resources are to be typedef'ed with appropriate platform
-** dependent resource handle types. EGLint must be an integer of at least
-** 32-bit.
-**
-** NativeDisplayType, NativeWindowType and NativePixmapType are to be
-** replaced with corresponding types of the native window system in egl.h.
-**
-** EGL and native handle values must match their types.
-**
-** Example egltypes.h:
-*/
-
-#if 0
-
-#include <sys/types.h>
-#include <native_window_system.h>
-
-/*
-** Types and resources
-*/
-typedef int EGLBoolean;
-typedef int32_t EGLint;
-typedef void *EGLDisplay;
-typedef void *EGLConfig;
-typedef void *EGLSurface;
-typedef void *EGLContext;
-
-/*
-** EGL and native handle values
-*/
-#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0)
-#define EGL_NO_CONTEXT ((EGLContext)0)
-#define EGL_NO_DISPLAY ((EGLDisplay)0)
-#define EGL_NO_SURFACE ((EGLSurface)0)
-
-#endif
-
-/*
-** Versioning and extensions
-*/
-#define EGL_VERSION_1_0 1
-
-/*
-** Boolean
-*/
-#define EGL_FALSE 0
-#define EGL_TRUE 1
-
-/*
-** Errors
-*/
-#define EGL_SUCCESS 0x3000
-#define EGL_NOT_INITIALIZED 0x3001
-#define EGL_BAD_ACCESS 0x3002
-#define EGL_BAD_ALLOC 0x3003
-#define EGL_BAD_ATTRIBUTE 0x3004
-#define EGL_BAD_CONFIG 0x3005
-#define EGL_BAD_CONTEXT 0x3006
-#define EGL_BAD_CURRENT_SURFACE 0x3007
-#define EGL_BAD_DISPLAY 0x3008
-#define EGL_BAD_MATCH 0x3009
-#define EGL_BAD_NATIVE_PIXMAP 0x300A
-#define EGL_BAD_NATIVE_WINDOW 0x300B
-#define EGL_BAD_PARAMETER 0x300C
-#define EGL_BAD_SURFACE 0x300D
-/* 0x300E - 0x301F reserved for additional errors. */
-
-/*
-** Config attributes
-*/
-#define EGL_BUFFER_SIZE 0x3020
-#define EGL_ALPHA_SIZE 0x3021
-#define EGL_BLUE_SIZE 0x3022
-#define EGL_GREEN_SIZE 0x3023
-#define EGL_RED_SIZE 0x3024
-#define EGL_DEPTH_SIZE 0x3025
-#define EGL_STENCIL_SIZE 0x3026
-#define EGL_CONFIG_CAVEAT 0x3027
-#define EGL_CONFIG_ID 0x3028
-#define EGL_LEVEL 0x3029
-#define EGL_MAX_PBUFFER_HEIGHT 0x302A
-#define EGL_MAX_PBUFFER_PIXELS 0x302B
-#define EGL_MAX_PBUFFER_WIDTH 0x302C
-#define EGL_NATIVE_RENDERABLE 0x302D
-#define EGL_NATIVE_VISUAL_ID 0x302E
-#define EGL_NATIVE_VISUAL_TYPE 0x302F
-/*#define EGL_PRESERVED_RESOURCES 0x3030*/
-#define EGL_SAMPLES 0x3031
-#define EGL_SAMPLE_BUFFERS 0x3032
-#define EGL_SURFACE_TYPE 0x3033
-#define EGL_TRANSPARENT_TYPE 0x3034
-#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
-#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
-#define EGL_TRANSPARENT_RED_VALUE 0x3037
-
-/*
-** Config attribute and value
-*/
-#define EGL_NONE 0x3038
-/* 0x3039 - 0x304F reserved for additional config attributes. */
-
-/*
-** Config values
-*/
-#define EGL_DONT_CARE ((EGLint) -1)
-#define EGL_PBUFFER_BIT 0x01
-#define EGL_PIXMAP_BIT 0x02
-#define EGL_WINDOW_BIT 0x04
-#define EGL_SLOW_CONFIG 0x3050
-#define EGL_NON_CONFORMANT_CONFIG 0x3051
-#define EGL_TRANSPARENT_RGB 0x3052
-
-/*
-** String names
-*/
-#define EGL_VENDOR 0x3053
-#define EGL_VERSION 0x3054
-#define EGL_EXTENSIONS 0x3055
-
-/*
-** Surface attributes
-*/
-#define EGL_HEIGHT 0x3056
-#define EGL_WIDTH 0x3057
-#define EGL_LARGEST_PBUFFER 0x3058
-
-/*
-** Current surfaces
-*/
-#define EGL_DRAW 0x3059
-#define EGL_READ 0x305A
-
-/*
-** Engines
-*/
-#define EGL_CORE_NATIVE_ENGINE 0x305B
-
-/* 0x305C-0x3FFFF reserved for future use */
-
-/*
-** Functions
-*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-GLAPI EGLint APIENTRY eglGetError (void);
-
-GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display);
-GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
-GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy);
-GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
-GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))();
-
-GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-GLAPI EGLBoolean APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
-
-GLAPI EGLSurface APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
-GLAPI EGLSurface APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
-GLAPI EGLSurface APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
-GLAPI EGLBoolean APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
-GLAPI EGLBoolean APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
-
-GLAPI EGLContext APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
-GLAPI EGLBoolean APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
-GLAPI EGLBoolean APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
-GLAPI EGLContext APIENTRY eglGetCurrentContext (void);
-GLAPI EGLSurface APIENTRY eglGetCurrentSurface (EGLint readdraw);
-GLAPI EGLDisplay APIENTRY eglGetCurrentDisplay (void);
-GLAPI EGLBoolean APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
-
-GLAPI EGLBoolean APIENTRY eglWaitGL (void);
-GLAPI EGLBoolean APIENTRY eglWaitNative (EGLint engine);
-GLAPI EGLBoolean APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw);
-GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ___egl_h_ */
diff --git a/opengl/tests/angeles/include/GLES/egltypes.h b/opengl/tests/angeles/include/GLES/egltypes.h
deleted file mode 100644
index 9db36c9..0000000
--- a/opengl/tests/angeles/include/GLES/egltypes.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-** Types and resources
-*/
-typedef int EGLBoolean;
-typedef long EGLint;
-typedef void *EGLDisplay;
-typedef void *EGLConfig;
-typedef void *EGLSurface;
-typedef void *EGLContext;
-typedef void *NativeDisplayType;
-typedef void *NativeWindowType;
-typedef void *NativePixmapType;
-
-/*
-** EGL and native handle values
-*/
-#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0)
-#define EGL_NO_CONTEXT ((EGLContext)0)
-#define EGL_NO_DISPLAY ((EGLDisplay)0)
-#define EGL_NO_SURFACE ((EGLSurface)0)
diff --git a/opengl/tests/angeles/include/GLES/gl.h b/opengl/tests/angeles/include/GLES/gl.h
deleted file mode 100644
index 4154822..0000000
--- a/opengl/tests/angeles/include/GLES/gl.h
+++ /dev/null
@@ -1,584 +0,0 @@
-#ifndef __gl_h_
-#define __gl_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-typedef unsigned int GLenum;
-typedef unsigned char GLboolean;
-typedef unsigned int GLbitfield;
-typedef signed char GLbyte;
-typedef short GLshort;
-typedef int GLint;
-typedef int GLsizei;
-typedef unsigned char GLubyte;
-typedef unsigned short GLushort;
-typedef unsigned int GLuint;
-typedef float GLfloat;
-typedef float GLclampf;
-typedef void GLvoid;
-typedef int GLintptrARB;
-typedef int GLsizeiptrARB;
-typedef int GLfixed;
-typedef int GLclampx;
-/* Internal convenience typedefs */
-typedef void (*_GLfuncptr)();
-
-/*************************************************************/
-
-/* Extensions */
-#define GL_OES_VERSION_1_0 1
-#define GL_OES_read_format 1
-#define GL_OES_compressed_paletted_texture 1
-
-/* ClearBufferMask */
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_COLOR_BUFFER_BIT 0x00004000
-
-/* Boolean */
-#define GL_FALSE 0
-#define GL_TRUE 1
-
-/* BeginMode */
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-
-/* AlphaFunction */
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-
-/* BlendingFactorDest */
-#define GL_ZERO 0
-#define GL_ONE 1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-
-/* BlendingFactorSrc */
-/* GL_ZERO */
-/* GL_ONE */
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-/* GL_SRC_ALPHA */
-/* GL_ONE_MINUS_SRC_ALPHA */
-/* GL_DST_ALPHA */
-/* GL_ONE_MINUS_DST_ALPHA */
-
-/* ColorMaterialFace */
-/* GL_FRONT_AND_BACK */
-
-/* ColorMaterialParameter */
-/* GL_AMBIENT_AND_DIFFUSE */
-
-/* ColorPointerType */
-/* GL_UNSIGNED_BYTE */
-/* GL_FLOAT */
-/* GL_FIXED */
-
-/* CullFaceMode */
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_FRONT_AND_BACK 0x0408
-
-/* DepthFunction */
-/* GL_NEVER */
-/* GL_LESS */
-/* GL_EQUAL */
-/* GL_LEQUAL */
-/* GL_GREATER */
-/* GL_NOTEQUAL */
-/* GL_GEQUAL */
-/* GL_ALWAYS */
-
-/* EnableCap */
-#define GL_FOG 0x0B60
-#define GL_LIGHTING 0x0B50
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_CULL_FACE 0x0B44
-#define GL_ALPHA_TEST 0x0BC0
-#define GL_BLEND 0x0BE2
-#define GL_COLOR_LOGIC_OP 0x0BF2
-#define GL_DITHER 0x0BD0
-#define GL_STENCIL_TEST 0x0B90
-#define GL_DEPTH_TEST 0x0B71
-/* GL_LIGHT0 */
-/* GL_LIGHT1 */
-/* GL_LIGHT2 */
-/* GL_LIGHT3 */
-/* GL_LIGHT4 */
-/* GL_LIGHT5 */
-/* GL_LIGHT6 */
-/* GL_LIGHT7 */
-#define GL_POINT_SMOOTH 0x0B10
-#define GL_LINE_SMOOTH 0x0B20
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_COLOR_MATERIAL 0x0B57
-#define GL_NORMALIZE 0x0BA1
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_NORMAL_ARRAY 0x8075
-#define GL_COLOR_ARRAY 0x8076
-#define GL_TEXTURE_COORD_ARRAY 0x8078
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-
-/* ErrorCode */
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_OUT_OF_MEMORY 0x0505
-
-/* FogMode */
-/* GL_LINEAR */
-#define GL_EXP 0x0800
-#define GL_EXP2 0x0801
-
-/* FogParameter */
-#define GL_FOG_DENSITY 0x0B62
-#define GL_FOG_START 0x0B63
-#define GL_FOG_END 0x0B64
-#define GL_FOG_MODE 0x0B65
-#define GL_FOG_COLOR 0x0B66
-
-/* FrontFaceDirection */
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-
-/* GetPName */
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-#define GL_MAX_LIGHTS 0x0D31
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
-#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
-#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-
-/* HintMode */
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-
-/* HintTarget */
-#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
-#define GL_POINT_SMOOTH_HINT 0x0C51
-#define GL_LINE_SMOOTH_HINT 0x0C52
-#define GL_POLYGON_SMOOTH_HINT 0x0C53
-#define GL_FOG_HINT 0x0C54
-
-/* LightModelParameter */
-#define GL_LIGHT_MODEL_AMBIENT 0x0B53
-#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
-
-/* LightParameter */
-#define GL_AMBIENT 0x1200
-#define GL_DIFFUSE 0x1201
-#define GL_SPECULAR 0x1202
-#define GL_POSITION 0x1203
-#define GL_SPOT_DIRECTION 0x1204
-#define GL_SPOT_EXPONENT 0x1205
-#define GL_SPOT_CUTOFF 0x1206
-#define GL_CONSTANT_ATTENUATION 0x1207
-#define GL_LINEAR_ATTENUATION 0x1208
-#define GL_QUADRATIC_ATTENUATION 0x1209
-
-/* DataType */
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_FLOAT 0x1406
-#define GL_FIXED 0x140C
-
-/* LogicOp */
-#define GL_CLEAR 0x1500
-#define GL_AND 0x1501
-#define GL_AND_REVERSE 0x1502
-#define GL_COPY 0x1503
-#define GL_AND_INVERTED 0x1504
-#define GL_NOOP 0x1505
-#define GL_XOR 0x1506
-#define GL_OR 0x1507
-#define GL_NOR 0x1508
-#define GL_EQUIV 0x1509
-#define GL_INVERT 0x150A
-#define GL_OR_REVERSE 0x150B
-#define GL_COPY_INVERTED 0x150C
-#define GL_OR_INVERTED 0x150D
-#define GL_NAND 0x150E
-#define GL_SET 0x150F
-
-/* MaterialFace */
-/* GL_FRONT_AND_BACK */
-
-/* MaterialParameter */
-#define GL_EMISSION 0x1600
-#define GL_SHININESS 0x1601
-#define GL_AMBIENT_AND_DIFFUSE 0x1602
-/* GL_AMBIENT */
-/* GL_DIFFUSE */
-/* GL_SPECULAR */
-
-/* MatrixMode */
-#define GL_MODELVIEW 0x1700
-#define GL_PROJECTION 0x1701
-#define GL_TEXTURE 0x1702
-
-/* NormalPointerType */
-/* GL_BYTE */
-/* GL_SHORT */
-/* GL_FLOAT */
-/* GL_FIXED */
-
-/* PixelFormat */
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-
-/* PixelStoreParameter */
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_ALIGNMENT 0x0D05
-
-/* PixelType */
-/* GL_UNSIGNED_BYTE */
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-
-/* ShadingModel */
-#define GL_FLAT 0x1D00
-#define GL_SMOOTH 0x1D01
-
-/* StencilFunction */
-/* GL_NEVER */
-/* GL_LESS */
-/* GL_EQUAL */
-/* GL_LEQUAL */
-/* GL_GREATER */
-/* GL_NOTEQUAL */
-/* GL_GEQUAL */
-/* GL_ALWAYS */
-
-/* StencilOp */
-/* GL_ZERO */
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-/* GL_INVERT */
-
-/* StringName */
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-
-/* TexCoordPointerType */
-/* GL_SHORT */
-/* GL_FLOAT */
-/* GL_FIXED */
-/* GL_BYTE */
-
-/* TextureEnvMode */
-#define GL_MODULATE 0x2100
-#define GL_DECAL 0x2101
-/* GL_BLEND */
-#define GL_ADD 0x0104
-/* GL_REPLACE */
-
-/* TextureEnvParameter */
-#define GL_TEXTURE_ENV_MODE 0x2200
-#define GL_TEXTURE_ENV_COLOR 0x2201
-
-/* TextureEnvTarget */
-#define GL_TEXTURE_ENV 0x2300
-
-/* TextureMagFilter */
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-
-/* TextureMinFilter */
-/* GL_NEAREST */
-/* GL_LINEAR */
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-
-/* TextureParameterName */
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-
-/* TextureTarget */
-/* GL_TEXTURE_2D */
-
-/* TextureUnit */
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-
-/* TextureWrapMode */
-#define GL_REPEAT 0x2901
-#define GL_CLAMP_TO_EDGE 0x812F
-
-/* PixelInternalFormat */
-#define GL_PALETTE4_RGB8_OES 0x8B90
-#define GL_PALETTE4_RGBA8_OES 0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
-#define GL_PALETTE4_RGBA4_OES 0x8B93
-#define GL_PALETTE4_RGB5_A1_OES 0x8B94
-#define GL_PALETTE8_RGB8_OES 0x8B95
-#define GL_PALETTE8_RGBA8_OES 0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
-#define GL_PALETTE8_RGBA4_OES 0x8B98
-#define GL_PALETTE8_RGB5_A1_OES 0x8B99
-
-/* VertexPointerType */
-/* GL_SHORT */
-/* GL_FLOAT */
-/* GL_FIXED */
-/* GL_BYTE */
-
-/* LightName */
-#define GL_LIGHT0 0x4000
-#define GL_LIGHT1 0x4001
-#define GL_LIGHT2 0x4002
-#define GL_LIGHT3 0x4003
-#define GL_LIGHT4 0x4004
-#define GL_LIGHT5 0x4005
-#define GL_LIGHT6 0x4006
-#define GL_LIGHT7 0x4007
-
-
-/*************************************************************/
-
-GLAPI void APIENTRY glActiveTexture (GLenum texture);
-GLAPI void APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
-GLAPI void APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
-GLAPI void APIENTRY glBindTexture (GLenum target, GLuint texture);
-GLAPI void APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GLAPI void APIENTRY glClear (GLbitfield mask);
-GLAPI void APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GLAPI void APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
-GLAPI void APIENTRY glClearDepthf (GLclampf depth);
-GLAPI void APIENTRY glClearDepthx (GLclampx depth);
-GLAPI void APIENTRY glClearStencil (GLint s);
-GLAPI void APIENTRY glClientActiveTexture (GLenum texture);
-GLAPI void APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-GLAPI void APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GLAPI void APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glCullFace (GLenum mode);
-GLAPI void APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-GLAPI void APIENTRY glDepthFunc (GLenum func);
-GLAPI void APIENTRY glDepthMask (GLboolean flag);
-GLAPI void APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
-GLAPI void APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
-GLAPI void APIENTRY glDisable (GLenum cap);
-GLAPI void APIENTRY glDisableClientState (GLenum array);
-GLAPI void APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void APIENTRY glEnable (GLenum cap);
-GLAPI void APIENTRY glEnableClientState (GLenum array);
-GLAPI void APIENTRY glFinish (void);
-GLAPI void APIENTRY glFlush (void);
-GLAPI void APIENTRY glFogf (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFogfv (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFogx (GLenum pname, GLfixed param);
-GLAPI void APIENTRY glFogxv (GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glFrontFace (GLenum mode);
-GLAPI void APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-GLAPI void APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-GLAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures);
-GLAPI GLenum APIENTRY glGetError (void);
-GLAPI void APIENTRY glGetIntegerv (GLenum pname, GLint *params);
-GLAPI const GLubyte * APIENTRY glGetString (GLenum name);
-GLAPI void APIENTRY glHint (GLenum target, GLenum mode);
-GLAPI void APIENTRY glLightModelf (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glLightModelx (GLenum pname, GLfixed param);
-GLAPI void APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glLineWidth (GLfloat width);
-GLAPI void APIENTRY glLineWidthx (GLfixed width);
-GLAPI void APIENTRY glLoadIdentity (void);
-GLAPI void APIENTRY glLoadMatrixf (const GLfloat *m);
-GLAPI void APIENTRY glLoadMatrixx (const GLfixed *m);
-GLAPI void APIENTRY glLogicOp (GLenum opcode);
-GLAPI void APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glMatrixMode (GLenum mode);
-GLAPI void APIENTRY glMultMatrixf (const GLfloat *m);
-GLAPI void APIENTRY glMultMatrixx (const GLfixed *m);
-GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-GLAPI void APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
-GLAPI void APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
-GLAPI void APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-GLAPI void APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-GLAPI void APIENTRY glPixelStorei (GLenum pname, GLint param);
-GLAPI void APIENTRY glPointSize (GLfloat size);
-GLAPI void APIENTRY glPointSizex (GLfixed size);
-GLAPI void APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GLAPI void APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
-GLAPI void APIENTRY glPopMatrix (void);
-GLAPI void APIENTRY glPushMatrix (void);
-GLAPI void APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-GLAPI void APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
-GLAPI void APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
-GLAPI void APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glShadeModel (GLenum mode);
-GLAPI void APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GLAPI void APIENTRY glStencilMask (GLuint mask);
-GLAPI void APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GLAPI void APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
-GLAPI void APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gl_h_ */
diff --git a/opengl/tests/angeles/license-BSD.txt b/opengl/tests/angeles/license-BSD.txt
deleted file mode 100644
index 8924e3c..0000000
--- a/opengl/tests/angeles/license-BSD.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-This is the BSD-style license for the "San Angeles Observation"
-OpenGL ES version example source code
----------------------------------------------------------------
-
-San Angeles Observation OpenGL ES version example
-Copyright (c) 2004-2005, Jetro Lauha
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
- * Neither the name of the software product's copyright owner nor
- the names of its contributors may be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/opengl/tests/angeles/license-LGPL.txt b/opengl/tests/angeles/license-LGPL.txt
deleted file mode 100644
index b1e3f5a..0000000
--- a/opengl/tests/angeles/license-LGPL.txt
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/opengl/tests/angeles/license.txt b/opengl/tests/angeles/license.txt
deleted file mode 100644
index 620841e..0000000
--- a/opengl/tests/angeles/license.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-San Angeles Observation OpenGL ES version example
-Copyright 2004-2005 Jetro Lauha
-All rights reserved.
-Web: http://iki.fi/jetro/
-
-This source is free software; you can redistribute it and/or
-modify it under the terms of EITHER:
- (1) The GNU Lesser General Public License as published by the Free
- Software Foundation; either version 2.1 of the License, or (at
- your option) any later version. The text of the GNU Lesser
- General Public License is included with this source in the
- file LICENSE-LGPL.txt.
- (2) The BSD-style license that is included with this source in
- the file LICENSE-BSD.txt.
-
-This source is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
-LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
diff --git a/opengl/tests/angeles/shapes.h b/opengl/tests/angeles/shapes.h
deleted file mode 100644
index 25ffae8..0000000
--- a/opengl/tests/angeles/shapes.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* San Angeles Observation OpenGL ES version example
- * Copyright 2004-2005 Jetro Lauha
- * All rights reserved.
- * Web: http://iki.fi/jetro/
- *
- * This source is free software; you can redistribute it and/or
- * modify it under the terms of EITHER:
- * (1) The GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version. The text of the GNU Lesser
- * General Public License is included with this source in the
- * file LICENSE-LGPL.txt.
- * (2) The BSD-style license that is included with this source in
- * the file LICENSE-BSD.txt.
- *
- * This source is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
- *
- * $Id: shapes.h,v 1.6 2005/01/31 22:15:30 tonic Exp $
- * $Revision: 1.6 $
- */
-
-#ifndef SHAPES_H_INCLUDED
-#define SHAPES_H_INCLUDED
-
-
-#define SUPERSHAPE_PARAMS 15
-
-static const float sSuperShapeParams[][SUPERSHAPE_PARAMS] =
-{
- // m a b n1 n2 n3 m a b n1 n2 n3 res1 res2 scale (org.res1,res2)
- { 10, 1, 2, 90, 1, -45, 8, 1, 1, -1, 1, -0.4f, 20, 30, 2 }, // 40, 60
- { 10, 1, 2, 90, 1, -45, 4, 1, 1, 10, 1, -0.4f, 20, 20, 4 }, // 40, 40
- { 10, 1, 2, 60, 1, -10, 4, 1, 1, -1, -2, -0.4f, 41, 41, 1 }, // 82, 82
- { 6, 1, 1, 60, 1, -70, 8, 1, 1, 0.4f, 3, 0.25f, 20, 20, 1 }, // 40, 40
- { 4, 1, 1, 30, 1, 20, 12, 1, 1, 0.4f, 3, 0.25f, 10, 30, 1 }, // 20, 60
- { 8, 1, 1, 30, 1, -4, 8, 2, 1, -1, 5, 0.5f, 25, 26, 1 }, // 60, 60
- { 13, 1, 1, 30, 1, -4, 13, 1, 1, 1, 5, 1, 30, 30, 6 }, // 60, 60
- { 10, 1, 1.1f, -0.5f, 0.1f, 70, 60, 1, 1, -90, 0, -0.25f, 20, 60, 8 }, // 60, 180
- { 7, 1, 1, 20, -0.3f, -3.5f, 6, 1, 1, -1, 4.5f, 0.5f, 10, 20, 4 }, // 60, 80
- { 4, 1, 1, 10, 10, 10, 4, 1, 1, 10, 10, 10, 10, 20, 1 }, // 20, 40
- { 4, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 10, 10, 2 }, // 10, 10
- { 1, 1, 1, 38, -0.25f, 19, 4, 1, 1, 10, 10, 10, 10, 15, 2 }, // 20, 40
- { 2, 1, 1, 0.7f, 0.3f, 0.2f, 3, 1, 1, 100, 100, 100, 10, 25, 2 }, // 20, 50
- { 6, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 30, 30, 2 }, // 60, 60
- { 3, 1, 1, 1, 1, 1, 6, 1, 1, 2, 1, 1, 10, 20, 2 }, // 20, 40
- { 6, 1, 1, 6, 5.5f, 100, 6, 1, 1, 25, 10, 10, 30, 20, 2 }, // 60, 40
- { 3, 1, 1, 0.5f, 1.7f, 1.7f, 2, 1, 1, 10, 10, 10, 20, 20, 2 }, // 40, 40
- { 5, 1, 1, 0.1f, 1.7f, 1.7f, 1, 1, 1, 0.3f, 0.5f, 0.5f, 20, 20, 4 }, // 40, 40
- { 2, 1, 1, 6, 5.5f, 100, 6, 1, 1, 4, 10, 10, 10, 22, 1 }, // 40, 40
- { 6, 1, 1, -1, 70, 0.1f, 9, 1, 0.5f, -98, 0.05f, -45, 20, 30, 4 }, // 60, 91
- { 6, 1, 1, -1, 90, -0.1f, 7, 1, 1, 90, 1.3f, 34, 13, 16, 1 }, // 32, 60
-};
-#define SUPERSHAPE_COUNT (sizeof(sSuperShapeParams) / sizeof(sSuperShapeParams[0]))
-
-
-#endif // !SHAPES_H_INCLUDED
diff --git a/opengl/tests/configdump/Android.mk b/opengl/tests/configdump/Android.mk
deleted file mode 100644
index 3f7c915..0000000
--- a/opengl/tests/configdump/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- configdump.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv1_CM
-
-LOCAL_MODULE:= test-opengl-configdump
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/configdump/configdump.cpp b/opengl/tests/configdump/configdump.cpp
deleted file mode 100644
index 69b9eb6..0000000
--- a/opengl/tests/configdump/configdump.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-** Copyright 2010, 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.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <EGL/egl.h>
-
-#define ATTRIBUTE(_attr) { _attr, #_attr }
-
-struct Attribute {
- EGLint attribute;
- char const* name;
-};
-
-Attribute attributes[] = {
- ATTRIBUTE( EGL_BUFFER_SIZE ),
- ATTRIBUTE( EGL_ALPHA_SIZE ),
- ATTRIBUTE( EGL_BLUE_SIZE ),
- ATTRIBUTE( EGL_GREEN_SIZE ),
- ATTRIBUTE( EGL_RED_SIZE ),
- ATTRIBUTE( EGL_DEPTH_SIZE ),
- ATTRIBUTE( EGL_STENCIL_SIZE ),
- ATTRIBUTE( EGL_CONFIG_CAVEAT ),
- ATTRIBUTE( EGL_CONFIG_ID ),
- ATTRIBUTE( EGL_LEVEL ),
- ATTRIBUTE( EGL_MAX_PBUFFER_HEIGHT ),
- ATTRIBUTE( EGL_MAX_PBUFFER_WIDTH ),
- ATTRIBUTE( EGL_MAX_PBUFFER_PIXELS ),
- ATTRIBUTE( EGL_NATIVE_RENDERABLE ),
- ATTRIBUTE( EGL_NATIVE_VISUAL_ID ),
- ATTRIBUTE( EGL_NATIVE_VISUAL_TYPE ),
- ATTRIBUTE( EGL_SAMPLES ),
- ATTRIBUTE( EGL_SAMPLE_BUFFERS ),
- ATTRIBUTE( EGL_SURFACE_TYPE ),
- ATTRIBUTE( EGL_TRANSPARENT_TYPE ),
- ATTRIBUTE( EGL_TRANSPARENT_BLUE_VALUE ),
- ATTRIBUTE( EGL_TRANSPARENT_GREEN_VALUE ),
- ATTRIBUTE( EGL_TRANSPARENT_RED_VALUE ),
- ATTRIBUTE( EGL_BIND_TO_TEXTURE_RGB ),
- ATTRIBUTE( EGL_BIND_TO_TEXTURE_RGBA ),
- ATTRIBUTE( EGL_MIN_SWAP_INTERVAL ),
- ATTRIBUTE( EGL_MAX_SWAP_INTERVAL ),
- ATTRIBUTE( EGL_LUMINANCE_SIZE ),
- ATTRIBUTE( EGL_ALPHA_MASK_SIZE ),
- ATTRIBUTE( EGL_COLOR_BUFFER_TYPE ),
- ATTRIBUTE( EGL_RENDERABLE_TYPE ),
- ATTRIBUTE( EGL_MATCH_NATIVE_PIXMAP ),
- ATTRIBUTE( EGL_CONFORMANT ),
-};
-
-
-int main(int argc, char** argv)
-{
- EGLConfig* configs;
- EGLint n;
-
- EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglInitialize(dpy, 0, 0);
- eglGetConfigs(dpy, NULL, 0, &n);
- configs = new EGLConfig[n];
- eglGetConfigs(dpy, configs, n, &n);
-
- for (EGLint i=0 ; i<n ; i++) {
- printf("EGLConfig[%d]\n", i);
- for (int attr = 0 ; attr<sizeof(attributes)/sizeof(Attribute) ; attr++) {
- EGLint value;
- eglGetConfigAttrib(dpy, configs[i], attributes[attr].attribute, &value);
- printf("\t%-32s: %10d (0x%08x)\n", attributes[attr].name, value, value);
- }
- }
-
- delete [] configs;
- eglTerminate(dpy);
- return 0;
-}
diff --git a/opengl/tests/fillrate/Android.mk b/opengl/tests/fillrate/Android.mk
deleted file mode 100644
index 4dade21..0000000
--- a/opengl/tests/fillrate/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- fillrate.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libEGL \
- libGLESv1_CM \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-fillrate
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/fillrate/fillrate.cpp b/opengl/tests/fillrate/fillrate.cpp
deleted file mode 100644
index a708647..0000000
--- a/opengl/tests/fillrate/fillrate.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-**
-** Copyright 2006, 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.
-*/
-
-#define LOG_TAG "fillrate"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <EGL/egl.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <utils/StopWatch.h>
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-int main(int argc, char** argv)
-{
- EGLint configAttribs[] = {
- EGL_DEPTH_SIZE, 0,
- EGL_NONE
- };
-
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLConfig config;
- EGLSurface surface;
- EGLint w, h;
- EGLDisplay dpy;
-
- EGLNativeWindowType window = android_createDisplaySurface();
-
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglInitialize(dpy, &majorVersion, &minorVersion);
-
- status_t err = EGLUtils::selectConfigForNativeWindow(
- dpy, configAttribs, window, &config);
- if (err) {
- fprintf(stderr, "couldn't find an EGLConfig matching the screen format\n");
- return 0;
- }
-
- surface = eglCreateWindowSurface(dpy, config, window, NULL);
- context = eglCreateContext(dpy, config, NULL, NULL);
- eglMakeCurrent(dpy, surface, surface, context);
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
-
- printf("w=%d, h=%d\n", w, h);
-
- glBindTexture(GL_TEXTURE_2D, 0);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glDisable(GL_DITHER);
- glEnable(GL_BLEND);
- glEnable(GL_TEXTURE_2D);
- glColor4f(1,1,1,1);
-
- uint32_t* t32 = (uint32_t*)malloc(512*512*4);
- for (int y=0 ; y<512 ; y++) {
- for (int x=0 ; x<512 ; x++) {
- int u = x-256;
- int v = y-256;
- if (u*u+v*v < 256*256) {
- t32[x+y*512] = 0x10FFFFFF;
- } else {
- t32[x+y*512] = 0x20FF0000;
- }
- }
- }
-
- const GLfloat vertices[4][2] = {
- { 0, 0 },
- { 0, h },
- { w, h },
- { w, 0 }
- };
-
- const GLfloat texCoords[4][2] = {
- { 0, 0 },
- { 0, 1 },
- { 1, 1 },
- { 1, 0 }
- };
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, t32);
-
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrthof(0, w, 0, h, 0, 1);
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glVertexPointer(2, GL_FLOAT, 0, vertices);
- glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
-
- eglSwapInterval(dpy, 1);
-
- glClearColor(1,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- eglSwapBuffers(dpy, surface);
-
-
- nsecs_t times[32];
-
- for (int c=1 ; c<32 ; c++) {
- glClear(GL_COLOR_BUFFER_BIT);
- for (int i=0 ; i<c ; i++) {
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
- eglSwapBuffers(dpy, surface);
- }
-
-
- // for (int c=31 ; c>=1 ; c--) {
- int j=0;
- for (int c=1 ; c<32 ; c++) {
- glClear(GL_COLOR_BUFFER_BIT);
- nsecs_t now = systemTime();
- for (int i=0 ; i<c ; i++) {
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
- eglSwapBuffers(dpy, surface);
- nsecs_t t = systemTime() - now;
- times[j++] = t;
- }
-
- for (int c=1, j=0 ; c<32 ; c++, j++) {
- nsecs_t t = times[j];
- printf("%lld\t%d\t%f\n", t, c, (double(t)/c)/1000000.0);
- }
-
-
-
- eglTerminate(dpy);
-
- return 0;
-}
diff --git a/opengl/tests/filter/Android.mk b/opengl/tests/filter/Android.mk
deleted file mode 100644
index d3e4d38..0000000
--- a/opengl/tests/filter/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- filter.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv1_CM \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-filter
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/filter/filter.cpp b/opengl/tests/filter/filter.cpp
deleted file mode 100644
index 0067327..0000000
--- a/opengl/tests/filter/filter.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <EGL/egl.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-#define USE_DRAW_TEXTURE 1
-
-int main(int argc, char** argv)
-{
- if (argc!=2 && argc!=3) {
- printf("usage: %s <0-6> [pbuffer]\n", argv[0]);
- return 0;
- }
-
- const int test = atoi(argv[1]);
- int usePbuffer = argc==3 && !strcmp(argv[2], "pbuffer");
- EGLint s_configAttribs[] = {
- EGL_SURFACE_TYPE, EGL_PBUFFER_BIT|EGL_WINDOW_BIT,
- EGL_RED_SIZE, 5,
- EGL_GREEN_SIZE, 6,
- EGL_BLUE_SIZE, 5,
- EGL_NONE
- };
-
- EGLint numConfigs = -1;
- EGLint majorVersion;
- EGLint minorVersion;
- EGLConfig config;
- EGLContext context;
- EGLSurface surface;
- EGLint w, h;
-
- EGLDisplay dpy;
-
- EGLNativeWindowType window = 0;
- if (!usePbuffer) {
- window = android_createDisplaySurface();
- }
-
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglInitialize(dpy, &majorVersion, &minorVersion);
- if (!usePbuffer) {
- EGLUtils::selectConfigForNativeWindow(
- dpy, s_configAttribs, window, &config);
- surface = eglCreateWindowSurface(dpy, config, window, NULL);
- } else {
- printf("using pbuffer\n");
- eglChooseConfig(dpy, s_configAttribs, &config, 1, &numConfigs);
- EGLint attribs[] = { EGL_WIDTH, 320, EGL_HEIGHT, 480, EGL_NONE };
- surface = eglCreatePbufferSurface(dpy, config, attribs);
- if (surface == EGL_NO_SURFACE) {
- printf("eglCreatePbufferSurface error %x\n", eglGetError());
- }
- }
- context = eglCreateContext(dpy, config, NULL, NULL);
- eglMakeCurrent(dpy, surface, surface, context);
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
- GLint dim = w<h ? w : h;
-
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrthof(0, w, 0, h, 0, 1);
-
- glClearColor(0,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- GLint crop[4] = { 0, 4, 4, -4 };
- glBindTexture(GL_TEXTURE_2D, 0);
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glEnable(GL_TEXTURE_2D);
- glColor4f(1,1,1,1);
-
- // packing is always 4
- uint8_t t8[] = {
- 0x00, 0x55, 0x00, 0x55,
- 0xAA, 0xFF, 0xAA, 0xFF,
- 0x00, 0x55, 0x00, 0x55,
- 0xAA, 0xFF, 0xAA, 0xFF };
-
- uint16_t t16[] = {
- 0x0000, 0x5555, 0x0000, 0x5555,
- 0xAAAA, 0xFFFF, 0xAAAA, 0xFFFF,
- 0x0000, 0x5555, 0x0000, 0x5555,
- 0xAAAA, 0xFFFF, 0xAAAA, 0xFFFF };
-
- uint16_t t5551[] = {
- 0x0000, 0xFFFF, 0x0000, 0xFFFF,
- 0xFFFF, 0x0000, 0xFFFF, 0x0000,
- 0x0000, 0xFFFF, 0x0000, 0xFFFF,
- 0xFFFF, 0x0000, 0xFFFF, 0x0000 };
-
- uint32_t t32[] = {
- 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000,
- 0xFF00FF00, 0xFFFF0000, 0xFF000000, 0xFF0000FF,
- 0xFF00FFFF, 0xFF00FF00, 0x00FF00FF, 0xFFFFFF00,
- 0xFF000000, 0xFFFF00FF, 0xFF00FFFF, 0xFFFFFFFF
- };
-
- switch(test)
- {
- case 1:
- glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
- 4, 4, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, t8);
- break;
- case 2:
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
- 4, 4, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, t16);
- break;
- case 3:
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
- 4, 4, 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, t16);
- break;
- case 4:
- glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA,
- 4, 4, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, t16);
- break;
- case 5:
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
- 4, 4, 0, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, t5551);
- break;
- case 6:
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
- 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, t32);
- break;
- }
-
- //glDrawTexiOES(0, 0, 0, dim, dim);
-
- const GLfloat vertices[4][2] = {
- { 0, 0 },
- { 0, dim },
- { dim, dim },
- { dim, 0 }
- };
-
- const GLfloat texCoords[4][2] = {
- { 0, 0 },
- { 0, 1 },
- { 1, 1 },
- { 1, 0 }
- };
-
- if (!usePbuffer) {
- eglSwapBuffers(dpy, surface);
- }
-
- glMatrixMode(GL_MODELVIEW);
- glScissor(0,dim,dim,h-dim);
- glDisable(GL_SCISSOR_TEST);
-
- for (int y=0 ; y<dim ; y++) {
- //glDisable(GL_SCISSOR_TEST);
- glClear(GL_COLOR_BUFFER_BIT);
-
- //glEnable(GL_SCISSOR_TEST);
-
-#if USE_DRAW_TEXTURE && GL_OES_draw_texture
- glDrawTexiOES(0, y, 1, dim, dim);
-#else
- glLoadIdentity();
- glTranslatef(0, y, 0);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glVertexPointer(2, GL_FLOAT, 0, vertices);
- glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-#endif
-
- if (!usePbuffer) {
- eglSwapBuffers(dpy, surface);
- } else {
- glFinish();
- }
- }
-
- eglTerminate(dpy);
- return 0;
-}
diff --git a/opengl/tests/finish/Android.mk b/opengl/tests/finish/Android.mk
deleted file mode 100644
index aa8adca..0000000
--- a/opengl/tests/finish/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- finish.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libEGL \
- libGLESv1_CM \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-finish
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/finish/finish.cpp b/opengl/tests/finish/finish.cpp
deleted file mode 100644
index 11f0c22..0000000
--- a/opengl/tests/finish/finish.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <sched.h>
-#include <sys/resource.h>
-
-#include <EGL/egl.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <utils/Timers.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-int main(int argc, char** argv)
-{
- EGLint configAttribs[] = {
- EGL_DEPTH_SIZE, 0,
- EGL_NONE
- };
-
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLConfig config;
- EGLSurface surface;
- EGLint w, h;
- EGLDisplay dpy;
-
- EGLNativeWindowType window = android_createDisplaySurface();
-
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglInitialize(dpy, &majorVersion, &minorVersion);
-
- status_t err = EGLUtils::selectConfigForNativeWindow(
- dpy, configAttribs, window, &config);
- if (err) {
- fprintf(stderr, "couldn't find an EGLConfig matching the screen format\n");
- return 0;
- }
-
- surface = eglCreateWindowSurface(dpy, config, window, NULL);
- context = eglCreateContext(dpy, config, NULL, NULL);
- eglMakeCurrent(dpy, surface, surface, context);
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
- GLint dim = w<h ? w : h;
-
- glBindTexture(GL_TEXTURE_2D, 0);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glEnable(GL_TEXTURE_2D);
- glColor4f(1,1,1,1);
- glDisable(GL_DITHER);
- glShadeModel(GL_FLAT);
-
- long long now, t;
- int i;
-
- char* texels = (char*)malloc(512*512*2);
- memset(texels,0xFF,512*512*2);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
- 512, 512, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, texels);
-
- char* dst = (char*)malloc(320*480*2);
- memset(dst, 0, 320*480*2);
- printf("307200 bytes memcpy\n");
- for (i=0 ; i<4 ; i++) {
- now = systemTime();
- memcpy(dst, texels, 320*480*2);
- t = systemTime();
- printf("memcpy() time = %llu us\n", (t-now)/1000);
- fflush(stdout);
- }
- free(dst);
-
- free(texels);
-
- setpriority(PRIO_PROCESS, 0, -20);
-
- printf("512x512 unmodified texture, 512x512 blit:\n");
- glClear(GL_COLOR_BUFFER_BIT);
- for (i=0 ; i<4 ; i++) {
- GLint crop[4] = { 0, 512, 512, -512 };
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- now = systemTime();
- glDrawTexiOES(0, 0, 0, 512, 512);
- glFinish();
- t = systemTime();
- printf("glFinish() time = %llu us\n", (t-now)/1000);
- fflush(stdout);
- eglSwapBuffers(dpy, surface);
- }
-
- printf("512x512 unmodified texture, 1x1 blit:\n");
- glClear(GL_COLOR_BUFFER_BIT);
- for (i=0 ; i<4 ; i++) {
- GLint crop[4] = { 0, 1, 1, -1 };
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- now = systemTime();
- glDrawTexiOES(0, 0, 0, 1, 1);
- glFinish();
- t = systemTime();
- printf("glFinish() time = %llu us\n", (t-now)/1000);
- fflush(stdout);
- eglSwapBuffers(dpy, surface);
- }
-
- printf("512x512 unmodified texture, 512x512 blit (x2):\n");
- glClear(GL_COLOR_BUFFER_BIT);
- for (i=0 ; i<4 ; i++) {
- GLint crop[4] = { 0, 512, 512, -512 };
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- now = systemTime();
- glDrawTexiOES(0, 0, 0, 512, 512);
- glDrawTexiOES(0, 0, 0, 512, 512);
- glFinish();
- t = systemTime();
- printf("glFinish() time = %llu us\n", (t-now)/1000);
- fflush(stdout);
- eglSwapBuffers(dpy, surface);
- }
-
- printf("512x512 unmodified texture, 1x1 blit (x2):\n");
- glClear(GL_COLOR_BUFFER_BIT);
- for (i=0 ; i<4 ; i++) {
- GLint crop[4] = { 0, 1, 1, -1 };
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- now = systemTime();
- glDrawTexiOES(0, 0, 0, 1, 1);
- glDrawTexiOES(0, 0, 0, 1, 1);
- glFinish();
- t = systemTime();
- printf("glFinish() time = %llu us\n", (t-now)/1000);
- fflush(stdout);
- eglSwapBuffers(dpy, surface);
- }
-
-
- printf("512x512 (1x1 texel MODIFIED texture), 512x512 blit:\n");
- glClear(GL_COLOR_BUFFER_BIT);
- for (i=0 ; i<4 ; i++) {
- uint16_t green = 0x7E0;
- GLint crop[4] = { 0, 512, 512, -512 };
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 1, 1, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, &green);
- now = systemTime();
- glDrawTexiOES(0, 0, 0, 512, 512);
- glFinish();
- t = systemTime();
- printf("glFinish() time = %llu us\n", (t-now)/1000);
- fflush(stdout);
- eglSwapBuffers(dpy, surface);
- }
-
-
- int16_t texel = 0xF800;
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
- 1, 1, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, &texel);
-
- printf("1x1 unmodified texture, 1x1 blit:\n");
- glClear(GL_COLOR_BUFFER_BIT);
- for (i=0 ; i<4 ; i++) {
- GLint crop[4] = { 0, 1, 1, -1 };
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- now = systemTime();
- glDrawTexiOES(0, 0, 0, 1, 1);
- glFinish();
- t = systemTime();
- printf("glFinish() time = %llu us\n", (t-now)/1000);
- eglSwapBuffers(dpy, surface);
- }
-
- printf("1x1 unmodified texture, 512x512 blit:\n");
- glClear(GL_COLOR_BUFFER_BIT);
- for (i=0 ; i<4 ; i++) {
- GLint crop[4] = { 0, 1, 1, -1 };
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- now = systemTime();
- glDrawTexiOES(0, 0, 0, 512, 512);
- glFinish();
- t = systemTime();
- printf("glFinish() time = %llu us\n", (t-now)/1000);
- fflush(stdout);
- eglSwapBuffers(dpy, surface);
- }
-
- printf("1x1 (1x1 texel MODIFIED texture), 512x512 blit:\n");
- glClear(GL_COLOR_BUFFER_BIT);
- for (i=0 ; i<4 ; i++) {
- uint16_t green = 0x7E0;
- GLint crop[4] = { 0, 1, 1, -1 };
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 1, 1, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, &green);
- now = systemTime();
- glDrawTexiOES(0, 0, 0, 1, 1);
- glFinish();
- t = systemTime();
- printf("glFinish() time = %llu us\n", (t-now)/1000);
- fflush(stdout);
- eglSwapBuffers(dpy, surface);
- }
-
- return 0;
-}
diff --git a/opengl/tests/gl2_basic/Android.mk b/opengl/tests/gl2_basic/Android.mk
deleted file mode 100644
index d7819a1..0000000
--- a/opengl/tests/gl2_basic/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- gl2_basic.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv2 \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-gl2_basic
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/gl2_basic/gl2_basic.cpp b/opengl/tests/gl2_basic/gl2_basic.cpp
deleted file mode 100644
index 7007871..0000000
--- a/opengl/tests/gl2_basic/gl2_basic.cpp
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <sched.h>
-#include <sys/resource.h>
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <utils/Timers.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-static void printGLString(const char *name, GLenum s) {
- // fprintf(stderr, "printGLString %s, %d\n", name, s);
- const char *v = (const char *) glGetString(s);
- // int error = glGetError();
- // fprintf(stderr, "glGetError() = %d, result of glGetString = %x\n", error,
- // (unsigned int) v);
- // if ((v < (const char*) 0) || (v > (const char*) 0x10000))
- // fprintf(stderr, "GL %s = %s\n", name, v);
- // else
- // fprintf(stderr, "GL %s = (null) 0x%08x\n", name, (unsigned int) v);
- fprintf(stderr, "GL %s = %s\n", name, v);
-}
-
-static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE) {
- if (returnVal != EGL_TRUE) {
- fprintf(stderr, "%s() returned %d\n", op, returnVal);
- }
-
- for (EGLint error = eglGetError(); error != EGL_SUCCESS; error
- = eglGetError()) {
- fprintf(stderr, "after %s() eglError %s (0x%x)\n", op, EGLUtils::strerror(error),
- error);
- }
-}
-
-static void checkGlError(const char* op) {
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- fprintf(stderr, "after %s() glError (0x%x)\n", op, error);
- }
-}
-
-static const char gVertexShader[] = "attribute vec4 vPosition;\n"
- "void main() {\n"
- " gl_Position = vPosition;\n"
- "}\n";
-
-static const char gFragmentShader[] = "precision mediump float;\n"
- "void main() {\n"
- " gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n"
- "}\n";
-
-GLuint loadShader(GLenum shaderType, const char* pSource) {
- GLuint shader = glCreateShader(shaderType);
- if (shader) {
- glShaderSource(shader, 1, &pSource, NULL);
- glCompileShader(shader);
- GLint compiled = 0;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
- if (!compiled) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf) {
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- fprintf(stderr, "Could not compile shader %d:\n%s\n",
- shaderType, buf);
- free(buf);
- }
- glDeleteShader(shader);
- shader = 0;
- }
- }
- }
- return shader;
-}
-
-GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
- GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
- if (!vertexShader) {
- return 0;
- }
-
- GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
- if (!pixelShader) {
- return 0;
- }
-
- GLuint program = glCreateProgram();
- if (program) {
- glAttachShader(program, vertexShader);
- checkGlError("glAttachShader");
- glAttachShader(program, pixelShader);
- checkGlError("glAttachShader");
- glLinkProgram(program);
- GLint linkStatus = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
- if (linkStatus != GL_TRUE) {
- GLint bufLength = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
- if (bufLength) {
- char* buf = (char*) malloc(bufLength);
- if (buf) {
- glGetProgramInfoLog(program, bufLength, NULL, buf);
- fprintf(stderr, "Could not link program:\n%s\n", buf);
- free(buf);
- }
- }
- glDeleteProgram(program);
- program = 0;
- }
- }
- return program;
-}
-
-GLuint gProgram;
-GLuint gvPositionHandle;
-
-bool setupGraphics(int w, int h) {
- gProgram = createProgram(gVertexShader, gFragmentShader);
- if (!gProgram) {
- return false;
- }
- gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
- checkGlError("glGetAttribLocation");
- fprintf(stderr, "glGetAttribLocation(\"vPosition\") = %d\n",
- gvPositionHandle);
-
- glViewport(0, 0, w, h);
- checkGlError("glViewport");
- return true;
-}
-
-const GLfloat gTriangleVertices[] = { 0.0f, 0.5f, -0.5f, -0.5f,
- 0.5f, -0.5f };
-
-void renderFrame() {
- glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
- checkGlError("glClearColor");
- glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- checkGlError("glClear");
-
- glUseProgram(gProgram);
- checkGlError("glUseProgram");
-
- glVertexAttribPointer(gvPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, gTriangleVertices);
- checkGlError("glVertexAttribPointer");
- glEnableVertexAttribArray(gvPositionHandle);
- checkGlError("glEnableVertexAttribArray");
- glDrawArrays(GL_TRIANGLES, 0, 3);
- checkGlError("glDrawArrays");
-}
-
-void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) {
-
-#define X(VAL) {VAL, #VAL}
- struct {EGLint attribute; const char* name;} names[] = {
- X(EGL_BUFFER_SIZE),
- X(EGL_ALPHA_SIZE),
- X(EGL_BLUE_SIZE),
- X(EGL_GREEN_SIZE),
- X(EGL_RED_SIZE),
- X(EGL_DEPTH_SIZE),
- X(EGL_STENCIL_SIZE),
- X(EGL_CONFIG_CAVEAT),
- X(EGL_CONFIG_ID),
- X(EGL_LEVEL),
- X(EGL_MAX_PBUFFER_HEIGHT),
- X(EGL_MAX_PBUFFER_PIXELS),
- X(EGL_MAX_PBUFFER_WIDTH),
- X(EGL_NATIVE_RENDERABLE),
- X(EGL_NATIVE_VISUAL_ID),
- X(EGL_NATIVE_VISUAL_TYPE),
- X(EGL_SAMPLES),
- X(EGL_SAMPLE_BUFFERS),
- X(EGL_SURFACE_TYPE),
- X(EGL_TRANSPARENT_TYPE),
- X(EGL_TRANSPARENT_RED_VALUE),
- X(EGL_TRANSPARENT_GREEN_VALUE),
- X(EGL_TRANSPARENT_BLUE_VALUE),
- X(EGL_BIND_TO_TEXTURE_RGB),
- X(EGL_BIND_TO_TEXTURE_RGBA),
- X(EGL_MIN_SWAP_INTERVAL),
- X(EGL_MAX_SWAP_INTERVAL),
- X(EGL_LUMINANCE_SIZE),
- X(EGL_ALPHA_MASK_SIZE),
- X(EGL_COLOR_BUFFER_TYPE),
- X(EGL_RENDERABLE_TYPE),
- X(EGL_CONFORMANT),
- };
-#undef X
-
- for (size_t j = 0; j < sizeof(names) / sizeof(names[0]); j++) {
- EGLint value = -1;
- EGLint returnVal = eglGetConfigAttrib(dpy, config, names[j].attribute, &value);
- EGLint error = eglGetError();
- if (returnVal && error == EGL_SUCCESS) {
- printf(" %s: ", names[j].name);
- printf("%d (0x%x)", value, value);
- }
- }
- printf("\n");
-}
-
-int printEGLConfigurations(EGLDisplay dpy) {
- EGLint numConfig = 0;
- EGLint returnVal = eglGetConfigs(dpy, NULL, 0, &numConfig);
- checkEglError("eglGetConfigs", returnVal);
- if (!returnVal) {
- return false;
- }
-
- printf("Number of EGL configuration: %d\n", numConfig);
-
- EGLConfig* configs = (EGLConfig*) malloc(sizeof(EGLConfig) * numConfig);
- if (! configs) {
- printf("Could not allocate configs.\n");
- return false;
- }
-
- returnVal = eglGetConfigs(dpy, configs, numConfig, &numConfig);
- checkEglError("eglGetConfigs", returnVal);
- if (!returnVal) {
- free(configs);
- return false;
- }
-
- for(int i = 0; i < numConfig; i++) {
- printf("Configuration %d\n", i);
- printEGLConfiguration(dpy, configs[i]);
- }
-
- free(configs);
- return true;
-}
-
-int main(int argc, char** argv) {
- EGLBoolean returnValue;
- EGLConfig myConfig = {0};
-
- EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
- EGLint s_configAttribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_NONE };
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLSurface surface;
- EGLint w, h;
-
- EGLDisplay dpy;
-
- checkEglError("<init>");
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- checkEglError("eglGetDisplay");
- if (dpy == EGL_NO_DISPLAY) {
- printf("eglGetDisplay returned EGL_NO_DISPLAY.\n");
- return 0;
- }
-
- returnValue = eglInitialize(dpy, &majorVersion, &minorVersion);
- checkEglError("eglInitialize", returnValue);
- fprintf(stderr, "EGL version %d.%d\n", majorVersion, minorVersion);
- if (returnValue != EGL_TRUE) {
- printf("eglInitialize failed\n");
- return 0;
- }
-
- if (!printEGLConfigurations(dpy)) {
- printf("printEGLConfigurations failed\n");
- return 0;
- }
-
- checkEglError("printEGLConfigurations");
-
- EGLNativeWindowType window = android_createDisplaySurface();
- returnValue = EGLUtils::selectConfigForNativeWindow(dpy, s_configAttribs, window, &myConfig);
- if (returnValue) {
- printf("EGLUtils::selectConfigForNativeWindow() returned %d", returnValue);
- return 0;
- }
-
- checkEglError("EGLUtils::selectConfigForNativeWindow");
-
- printf("Chose this configuration:\n");
- printEGLConfiguration(dpy, myConfig);
-
- surface = eglCreateWindowSurface(dpy, myConfig, window, NULL);
- checkEglError("eglCreateWindowSurface");
- if (surface == EGL_NO_SURFACE) {
- printf("gelCreateWindowSurface failed.\n");
- return 0;
- }
-
- context = eglCreateContext(dpy, myConfig, EGL_NO_CONTEXT, context_attribs);
- checkEglError("eglCreateContext");
- if (context == EGL_NO_CONTEXT) {
- printf("eglCreateContext failed\n");
- return 0;
- }
- returnValue = eglMakeCurrent(dpy, surface, surface, context);
- checkEglError("eglMakeCurrent", returnValue);
- if (returnValue != EGL_TRUE) {
- return 0;
- }
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- checkEglError("eglQuerySurface");
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
- checkEglError("eglQuerySurface");
- GLint dim = w < h ? w : h;
-
- fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
-
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- printGLString("Extensions", GL_EXTENSIONS);
-
- if(!setupGraphics(w, h)) {
- fprintf(stderr, "Could not set up graphics.\n");
- return 0;
- }
-
- for (;;) {
- renderFrame();
- eglSwapBuffers(dpy, surface);
- checkEglError("eglSwapBuffers");
- }
-
- return 0;
-}
diff --git a/opengl/tests/gl2_cameraeye/Android.mk b/opengl/tests/gl2_cameraeye/Android.mk
deleted file mode 100644
index 4a43a9e..0000000
--- a/opengl/tests/gl2_cameraeye/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := GL2CameraEye
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
-
-# Use the following include to make our test apk.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/opengl/tests/gl2_cameraeye/AndroidManifest.xml b/opengl/tests/gl2_cameraeye/AndroidManifest.xml
deleted file mode 100644
index c53f7be..0000000
--- a/opengl/tests/gl2_cameraeye/AndroidManifest.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 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.
--->
-
-<!-- Declare the contents of this Android application. The namespace
- attribute brings in the Android platform namespace, and the package
- supplies a unique name for the application. When writing your
- own application, the package name must be changed from "com.example.*"
- to come from a domain that you own or have control over. -->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.gl2cameraeye">
- <uses-permission android:name="android.permission.CAMERA" />
- <uses-feature android:name="android.hardware.camera" />
- <uses-feature android:name="android.hardware.camera.autofocus" />
- <uses-feature android:glEsVersion="0x00020000" />
- <application android:label="@string/gl2cameraeye_name">
- <activity android:name="GL2CameraEye">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/gl2_cameraeye/res/values/strings.xml b/opengl/tests/gl2_cameraeye/res/values/strings.xml
deleted file mode 100644
index 386b930..0000000
--- a/opengl/tests/gl2_cameraeye/res/values/strings.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 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.
--->
-
-<resources>
-
- <string name="gl2cameraeye_name">GL2CameraEye</string>
-
-</resources>
diff --git a/opengl/tests/gl2_cameraeye/src/com/android/gl2cameraeye/GL2CameraEye.java b/opengl/tests/gl2_cameraeye/src/com/android/gl2cameraeye/GL2CameraEye.java
deleted file mode 100644
index 561e4c5..0000000
--- a/opengl/tests/gl2_cameraeye/src/com/android/gl2cameraeye/GL2CameraEye.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (C) 2011 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.gl2cameraeye;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.app.Activity;
-import android.content.pm.ActivityInfo;
-import android.os.Bundle;
-import android.view.MotionEvent;
-import android.content.Context;
-import android.util.Log;
-
-import android.opengl.GLES20;
-import android.opengl.GLSurfaceView;
-import android.opengl.GLUtils;
-import android.opengl.Matrix;
-
-import android.graphics.SurfaceTexture;
-
-import android.hardware.Camera;
-import android.hardware.SensorManager;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.Sensor;
-
-public class GL2CameraEye extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mGLView = new CamGLSurfaceView(this);
- setContentView(mGLView);
- setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- mGLView.onPause();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- mGLView.onResume();
- }
-
- private GLSurfaceView mGLView;
-}
-
-class CamGLSurfaceView extends GLSurfaceView implements SensorEventListener {
- public CamGLSurfaceView(Context context) {
- super(context);
- setEGLContextClientVersion(2);
- mRenderer = new CamRenderer(context);
- setRenderer(mRenderer);
-
- mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
- mAcceleration = mSensorManager.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION);
- }
-
- public boolean onTouchEvent(final MotionEvent event) {
- queueEvent(new Runnable(){
- public void run() {
- mRenderer.setPosition(event.getX() / getWidth(),
- event.getY() / getHeight());
- }});
- return true;
- }
-
- @Override
- public void onPause() {
- super.onPause();
- mCamera.stopPreview();
- mCamera.release();
-
- mSensorManager.unregisterListener(this);
- }
-
- @Override
- public void onResume() {
- mCamera = Camera.open();
- Camera.Parameters p = mCamera.getParameters();
- // No changes to default camera parameters
- mCamera.setParameters(p);
-
- queueEvent(new Runnable(){
- public void run() {
- mRenderer.setCamera(mCamera);
- }});
-
- mSensorManager.registerListener(this, mAcceleration, SensorManager.SENSOR_DELAY_GAME);
- super.onResume();
- }
-
- public void onSensorChanged(SensorEvent event) {
- if (event.sensor.getType() == Sensor.TYPE_LINEAR_ACCELERATION) {
- final float[] accelerationVector = event.values;
- queueEvent(new Runnable(){
- public void run() {
- mRenderer.setAcceleration(accelerationVector);
- }});
- }
- }
-
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
- // Ignoring sensor accuracy changes.
- }
-
- CamRenderer mRenderer;
- Camera mCamera;
-
- SensorManager mSensorManager;
- Sensor mAcceleration;
-}
-
-class CamRenderer implements GLSurfaceView.Renderer, SurfaceTexture.OnFrameAvailableListener {
-
- public CamRenderer(Context context) {
- mContext = context;
-
- mTriangleVertices = ByteBuffer.allocateDirect(mTriangleVerticesData.length
- * FLOAT_SIZE_BYTES).order(ByteOrder.nativeOrder()).asFloatBuffer();
- mTriangleVertices.put(mTriangleVerticesData).position(0);
-
- Matrix.setIdentityM(mSTMatrix, 0);
- Matrix.setIdentityM(mMMatrix, 0);
-
- float[] defaultAcceleration = {0.f,0.f,0.f};
- setAcceleration(defaultAcceleration);
- mPos[0] = 0.f;
- mPos[1] = 0.f;
- mPos[2] = 0.f;
- mVel[0] = 0.f;
- mVel[1] = 0.f;
- mVel[2] = 0.f;
-
- }
-
- /* The following set methods are not synchronized, so should only
- * be called within the rendering thread context. Use GLSurfaceView.queueEvent for safe access.
- */
- public void setPosition(float x, float y) {
- /* Map from screen (0,0)-(1,1) to scene coordinates */
- mPos[0] = (x*2-1)*mRatio;
- mPos[1] = (-y)*2+1;
- mPos[2] = 0.f;
- mVel[0] = 0;
- mVel[1] = 0;
- mVel[2] = 0;
- }
-
- public void setCamera(Camera camera) {
- mCamera = camera;
- Camera.Size previewSize = camera.getParameters().getPreviewSize();
- mCameraRatio = (float)previewSize.width/previewSize.height;
- }
-
- public void setAcceleration(float[] accelerationVector) {
- mGForce[0] = accelerationVector[0];
- mGForce[1] = accelerationVector[1];
- mGForce[2] = accelerationVector[2];
- }
-
- public void onDrawFrame(GL10 glUnused) {
- synchronized(this) {
- if (updateSurface) {
- mSurface.updateTexImage();
-
- mSurface.getTransformMatrix(mSTMatrix);
- long timestamp = mSurface.getTimestamp();
- doPhysics(timestamp);
-
- updateSurface = false;
- }
- }
-
- // Ignore the passed-in GL10 interface, and use the GLES20
- // class's static methods instead.
- GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
- GLES20.glUseProgram(mProgram);
- checkGlError("glUseProgram");
-
- GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
- GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureID);
-
- mTriangleVertices.position(TRIANGLE_VERTICES_DATA_POS_OFFSET);
- GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false,
- TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
- checkGlError("glVertexAttribPointer maPosition");
- GLES20.glEnableVertexAttribArray(maPositionHandle);
- checkGlError("glEnableVertexAttribArray maPositionHandle");
-
- mTriangleVertices.position(TRIANGLE_VERTICES_DATA_UV_OFFSET);
- GLES20.glVertexAttribPointer(maTextureHandle, 3, GLES20.GL_FLOAT, false,
- TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
- checkGlError("glVertexAttribPointer maTextureHandle");
- GLES20.glEnableVertexAttribArray(maTextureHandle);
- checkGlError("glEnableVertexAttribArray maTextureHandle");
-
- Matrix.multiplyMM(mMVPMatrix, 0, mVMatrix, 0, mMMatrix, 0);
- Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mMVPMatrix, 0);
-
- GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
- GLES20.glUniformMatrix4fv(muSTMatrixHandle, 1, false, mSTMatrix, 0);
- GLES20.glUniform1f(muCRatioHandle, mCameraRatio);
-
- GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
- checkGlError("glDrawArrays");
- }
-
- public void onSurfaceChanged(GL10 glUnused, int width, int height) {
- // Ignore the passed-in GL10 interface, and use the GLES20
- // class's static methods instead.
- GLES20.glViewport(0, 0, width, height);
- mRatio = (float) width / height;
- Matrix.frustumM(mProjMatrix, 0, -mRatio, mRatio, -1, 1, 3, 7);
- }
-
- public void onSurfaceCreated(GL10 glUnused, EGLConfig config) {
- // Ignore the passed-in GL10 interface, and use the GLES20
- // class's static methods instead.
-
- /* Set up alpha blending and an Android background color */
- GLES20.glEnable(GLES20.GL_BLEND);
- GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
- GLES20.glClearColor(0.643f, 0.776f, 0.223f, 1.0f);
-
- /* Set up shaders and handles to their variables */
- mProgram = createProgram(mVertexShader, mFragmentShader);
- if (mProgram == 0) {
- return;
- }
- maPositionHandle = GLES20.glGetAttribLocation(mProgram, "aPosition");
- checkGlError("glGetAttribLocation aPosition");
- if (maPositionHandle == -1) {
- throw new RuntimeException("Could not get attrib location for aPosition");
- }
- maTextureHandle = GLES20.glGetAttribLocation(mProgram, "aTextureCoord");
- checkGlError("glGetAttribLocation aTextureCoord");
- if (maTextureHandle == -1) {
- throw new RuntimeException("Could not get attrib location for aTextureCoord");
- }
-
- muMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
- checkGlError("glGetUniformLocation uMVPMatrix");
- if (muMVPMatrixHandle == -1) {
- throw new RuntimeException("Could not get attrib location for uMVPMatrix");
- }
-
- muSTMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uSTMatrix");
- checkGlError("glGetUniformLocation uSTMatrix");
- if (muMVPMatrixHandle == -1) {
- throw new RuntimeException("Could not get attrib location for uSTMatrix");
- }
-
- muCRatioHandle = GLES20.glGetUniformLocation(mProgram, "uCRatio");
- checkGlError("glGetUniformLocation uCRatio");
- if (muMVPMatrixHandle == -1) {
- throw new RuntimeException("Could not get attrib location for uCRatio");
- }
-
- /*
- * Create our texture. This has to be done each time the
- * surface is created.
- */
-
- int[] textures = new int[1];
- GLES20.glGenTextures(1, textures, 0);
-
- mTextureID = textures[0];
- GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureID);
- checkGlError("glBindTexture mTextureID");
-
- // Can't do mipmapping with camera source
- GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER,
- GLES20.GL_NEAREST);
- GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER,
- GLES20.GL_LINEAR);
- // Clamp to edge is the only option
- GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S,
- GLES20.GL_CLAMP_TO_EDGE);
- GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T,
- GLES20.GL_CLAMP_TO_EDGE);
- checkGlError("glTexParameteri mTextureID");
-
- /*
- * Create the SurfaceTexture that will feed this textureID, and pass it to the camera
- */
-
- mSurface = new SurfaceTexture(mTextureID);
- mSurface.setOnFrameAvailableListener(this);
- try {
- mCamera.setPreviewTexture(mSurface);
- } catch (IOException t) {
- Log.e(TAG, "Cannot set preview texture target!");
- }
-
- /* Start the camera */
- mCamera.startPreview();
-
- Matrix.setLookAtM(mVMatrix, 0, 0, 0, 5f, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
-
- mLastTime = 0;
-
- synchronized(this) {
- updateSurface = false;
- }
- }
-
- synchronized public void onFrameAvailable(SurfaceTexture surface) {
- /* For simplicity, SurfaceTexture calls here when it has new
- * data available. Call may come in from some random thread,
- * so let's be safe and use synchronize. No OpenGL calls can be done here.
- */
- updateSurface = true;
- }
-
- private void doPhysics(long timestamp) {
- /*
- * Move the camera surface around based on some simple spring physics with drag
- */
-
- if (mLastTime == 0)
- mLastTime = timestamp;
-
- float deltaT = (timestamp - mLastTime)/1000000000.f; // To seconds
-
- float springStrength = 20.f;
- float frictionCoeff = 10.f;
- float mass = 10.f;
- float gMultiplier = 4.f;
- /* Only update physics every 30 ms */
- if (deltaT > 0.030f) {
- mLastTime = timestamp;
-
- float[] totalForce = new float[3];
- totalForce[0] = -mPos[0] * springStrength - mVel[0]*frictionCoeff + gMultiplier*mGForce[0]*mass;
- totalForce[1] = -mPos[1] * springStrength - mVel[1]*frictionCoeff + gMultiplier*mGForce[1]*mass;
- totalForce[2] = -mPos[2] * springStrength - mVel[2]*frictionCoeff + gMultiplier*mGForce[2]*mass;
-
- float[] accel = new float[3];
- accel[0] = totalForce[0]/mass;
- accel[1] = totalForce[1]/mass;
- accel[2] = totalForce[2]/mass;
-
- /* Not a very accurate integrator */
- mVel[0] = mVel[0] + accel[0]*deltaT;
- mVel[1] = mVel[1] + accel[1]*deltaT;
- mVel[2] = mVel[2] + accel[2]*deltaT;
-
- mPos[0] = mPos[0] + mVel[0]*deltaT;
- mPos[1] = mPos[1] + mVel[1]*deltaT;
- mPos[2] = mPos[2] + mVel[2]*deltaT;
-
- Matrix.setIdentityM(mMMatrix, 0);
- Matrix.translateM(mMMatrix, 0, mPos[0], mPos[1], mPos[2]);
- }
-
- }
-
- private int loadShader(int shaderType, String source) {
- int shader = GLES20.glCreateShader(shaderType);
- if (shader != 0) {
- GLES20.glShaderSource(shader, source);
- GLES20.glCompileShader(shader);
- int[] compiled = new int[1];
- GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
- if (compiled[0] == 0) {
- Log.e(TAG, "Could not compile shader " + shaderType + ":");
- Log.e(TAG, GLES20.glGetShaderInfoLog(shader));
- GLES20.glDeleteShader(shader);
- shader = 0;
- }
- }
- return shader;
- }
-
- private int createProgram(String vertexSource, String fragmentSource) {
- int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
- if (vertexShader == 0) {
- return 0;
- }
- int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
- if (pixelShader == 0) {
- return 0;
- }
-
- int program = GLES20.glCreateProgram();
- if (program != 0) {
- GLES20.glAttachShader(program, vertexShader);
- checkGlError("glAttachShader");
- GLES20.glAttachShader(program, pixelShader);
- checkGlError("glAttachShader");
- GLES20.glLinkProgram(program);
- int[] linkStatus = new int[1];
- GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
- if (linkStatus[0] != GLES20.GL_TRUE) {
- Log.e(TAG, "Could not link program: ");
- Log.e(TAG, GLES20.glGetProgramInfoLog(program));
- GLES20.glDeleteProgram(program);
- program = 0;
- }
- }
- return program;
- }
-
- private void checkGlError(String op) {
- int error;
- while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
- Log.e(TAG, op + ": glError " + error);
- throw new RuntimeException(op + ": glError " + error);
- }
- }
-
- private static final int FLOAT_SIZE_BYTES = 4;
- private static final int TRIANGLE_VERTICES_DATA_STRIDE_BYTES = 5 * FLOAT_SIZE_BYTES;
- private static final int TRIANGLE_VERTICES_DATA_POS_OFFSET = 0;
- private static final int TRIANGLE_VERTICES_DATA_UV_OFFSET = 3;
- private final float[] mTriangleVerticesData = {
- // X, Y, Z, U, V
- -1.0f, -1.0f, 0, 0.f, 0.f,
- 1.0f, -1.0f, 0, 1.f, 0.f,
- -1.0f, 1.0f, 0, 0.f, 1.f,
- 1.0f, 1.0f, 0, 1.f, 1.f,
- };
-
- private FloatBuffer mTriangleVertices;
-
- private final String mVertexShader =
- "uniform mat4 uMVPMatrix;\n" +
- "uniform mat4 uSTMatrix;\n" +
- "uniform float uCRatio;\n" +
- "attribute vec4 aPosition;\n" +
- "attribute vec4 aTextureCoord;\n" +
- "varying vec2 vTextureCoord;\n" +
- "varying vec2 vTextureNormCoord;\n" +
- "void main() {\n" +
- " vec4 scaledPos = aPosition;\n" +
- " scaledPos.x = scaledPos.x * uCRatio;\n" +
- " gl_Position = uMVPMatrix * scaledPos;\n" +
- " vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n" +
- " vTextureNormCoord = aTextureCoord.xy;\n" +
- "}\n";
-
- private final String mFragmentShader =
- "#extension GL_OES_EGL_image_external : require\n" +
- "precision mediump float;\n" +
- "varying vec2 vTextureCoord;\n" +
- "varying vec2 vTextureNormCoord;\n" +
- "uniform samplerExternalOES sTexture;\n" +
- "void main() {\n" +
- " gl_FragColor = texture2D(sTexture, vTextureCoord);\n" +
- " gl_FragColor.a = 1.0-min(length(vTextureNormCoord-0.5)*2.0,1.0);\n" +
- "}\n";
-
- private float[] mMVPMatrix = new float[16];
- private float[] mProjMatrix = new float[16];
- private float[] mMMatrix = new float[16];
- private float[] mVMatrix = new float[16];
- private float[] mSTMatrix = new float[16];
-
- private int mProgram;
- private int mTextureID;
- private int muMVPMatrixHandle;
- private int muSTMatrixHandle;
- private int muCRatioHandle;
- private int maPositionHandle;
- private int maTextureHandle;
-
- private float mRatio = 1.0f;
- private float mCameraRatio = 1.0f;
- private float[] mVel = new float[3];
- private float[] mPos = new float[3];
- private float[] mGForce = new float[3];
-
- private long mLastTime;
-
- private SurfaceTexture mSurface;
- private Camera mCamera;
- private boolean updateSurface = false;
-
- private Context mContext;
- private static String TAG = "CamRenderer";
-
- // Magic key
- private static int GL_TEXTURE_EXTERNAL_OES = 0x8D65;
-}
diff --git a/opengl/tests/gl2_copyTexImage/Android.mk b/opengl/tests/gl2_copyTexImage/Android.mk
deleted file mode 100644
index 005c383..0000000
--- a/opengl/tests/gl2_copyTexImage/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- gl2_copyTexImage.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv2 \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-gl2_copyTexImage
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp b/opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp
deleted file mode 100644
index 988d7ac..0000000
--- a/opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <sched.h>
-#include <sys/resource.h>
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <utils/Timers.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-static void printGLString(const char *name, GLenum s) {
- // fprintf(stderr, "printGLString %s, %d\n", name, s);
- const char *v = (const char *) glGetString(s);
- // int error = glGetError();
- // fprintf(stderr, "glGetError() = %d, result of glGetString = %x\n", error,
- // (unsigned int) v);
- // if ((v < (const char*) 0) || (v > (const char*) 0x10000))
- // fprintf(stderr, "GL %s = %s\n", name, v);
- // else
- // fprintf(stderr, "GL %s = (null) 0x%08x\n", name, (unsigned int) v);
- fprintf(stderr, "GL %s = %s\n", name, v);
-}
-
-static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE) {
- if (returnVal != EGL_TRUE) {
- fprintf(stderr, "%s() returned %d\n", op, returnVal);
- }
-
- for (EGLint error = eglGetError(); error != EGL_SUCCESS; error
- = eglGetError()) {
- fprintf(stderr, "after %s() eglError %s (0x%x)\n", op, EGLUtils::strerror(error),
- error);
- }
-}
-
-static void checkGlError(const char* op) {
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- fprintf(stderr, "after %s() glError (0x%x)\n", op, error);
- }
-}
-
-static const char gVertexShader[] = "attribute vec4 vPosition;\n"
- "void main() {\n"
- " gl_Position = vPosition;\n"
- "}\n";
-
-static const char gFragmentShader[] = "precision mediump float;\n"
- "void main() {\n"
- " gl_FragColor = vec4(0.0, 1.0, 0.0, 0.5);\n"
- "}\n";
-
-GLuint loadShader(GLenum shaderType, const char* pSource) {
- GLuint shader = glCreateShader(shaderType);
- if (shader) {
- glShaderSource(shader, 1, &pSource, NULL);
- glCompileShader(shader);
- GLint compiled = 0;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
- if (!compiled) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf) {
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- fprintf(stderr, "Could not compile shader %d:\n%s\n",
- shaderType, buf);
- free(buf);
- }
- glDeleteShader(shader);
- shader = 0;
- }
- }
- }
- return shader;
-}
-
-GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
- GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
- if (!vertexShader) {
- return 0;
- }
-
- GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
- if (!pixelShader) {
- return 0;
- }
-
- GLuint program = glCreateProgram();
- if (program) {
- glAttachShader(program, vertexShader);
- checkGlError("glAttachShader");
- glAttachShader(program, pixelShader);
- checkGlError("glAttachShader");
- glLinkProgram(program);
- GLint linkStatus = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
- if (linkStatus != GL_TRUE) {
- GLint bufLength = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
- if (bufLength) {
- char* buf = (char*) malloc(bufLength);
- if (buf) {
- glGetProgramInfoLog(program, bufLength, NULL, buf);
- fprintf(stderr, "Could not link program:\n%s\n", buf);
- free(buf);
- }
- }
- glDeleteProgram(program);
- program = 0;
- }
- }
- return program;
-}
-
-GLuint gProgram;
-GLuint gTextureProgram;
-GLuint gvPositionHandle;
-GLuint gvTexturePositionHandle;
-GLuint gvTextureTexCoordsHandle;
-GLuint gvTextureSamplerHandle;
-GLuint gFbo;
-GLuint gTexture;
-GLuint gBufferTexture;
-
-static const char gSimpleVS[] =
- "attribute vec4 position;\n"
- "attribute vec2 texCoords;\n"
- "varying vec2 outTexCoords;\n"
- "\nvoid main(void) {\n"
- " outTexCoords = texCoords;\n"
- " gl_Position = position;\n"
- "}\n\n";
-static const char gSimpleFS[] =
- "precision mediump float;\n\n"
- "varying vec2 outTexCoords;\n"
- "uniform sampler2D texture;\n"
- "\nvoid main(void) {\n"
- " gl_FragColor = texture2D(texture, outTexCoords);\n"
- "}\n\n";
-
-bool setupGraphics(int w, int h) {
- gProgram = createProgram(gVertexShader, gFragmentShader);
- if (!gProgram) {
- return false;
- }
- gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
- checkGlError("glGetAttribLocation");
- fprintf(stderr, "glGetAttribLocation(\"vPosition\") = %d\n", gvPositionHandle);
-
- gTextureProgram = createProgram(gSimpleVS, gSimpleFS);
- if (!gTextureProgram) {
- return false;
- }
- gvTexturePositionHandle = glGetAttribLocation(gTextureProgram, "position");
- checkGlError("glGetAttribLocation");
- gvTextureTexCoordsHandle = glGetAttribLocation(gTextureProgram, "texCoords");
- checkGlError("glGetAttribLocation");
- gvTextureSamplerHandle = glGetUniformLocation(gTextureProgram, "texture");
- checkGlError("glGetAttribLocation");
-
- glActiveTexture(GL_TEXTURE0);
-
- glGenTextures(1, &gTexture);
- glBindTexture(GL_TEXTURE_2D, gTexture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- glGenTextures(1, &gBufferTexture);
- glBindTexture(GL_TEXTURE_2D, gBufferTexture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- glGenFramebuffers(1, &gFbo);
- glBindFramebuffer(GL_FRAMEBUFFER, gFbo);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, gTexture, 0);
-
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
-
- glViewport(0, 0, w, h);
- checkGlError("glViewport");
- return true;
-}
-
-const GLfloat gTriangleVertices[] = { 0.0f, 0.5f, -0.5f, -0.5f,
- 0.5f, -0.5f };
-
-const GLint FLOAT_SIZE_BYTES = 4;
-const GLint TRIANGLE_VERTICES_DATA_STRIDE_BYTES = 5 * FLOAT_SIZE_BYTES;
-const GLfloat gTriangleVerticesData[] = {
- // X, Y, Z, U, V
- -1.0f, -1.0f, 0, 0.f, 0.f,
- 1.0f, -1.0f, 0, 1.f, 0.f,
- -1.0f, 1.0f, 0, 0.f, 1.f,
- 1.0f, 1.0f, 0, 1.f, 1.f,
-};
-
-void renderFrame(GLint w, GLint h) {
- glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
- checkGlError("glClearColor");
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- checkGlError("glClear");
-
- // Bind FBO and draw into it
- glBindFramebuffer(GL_FRAMEBUFFER, gFbo);
- checkGlError("glBindFramebuffer");
-
- glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- checkGlError("glClearColor");
- glClear(GL_COLOR_BUFFER_BIT);
- checkGlError("glClear");
-
- glUseProgram(gProgram);
- checkGlError("glUseProgram");
-
- glVertexAttribPointer(gvPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, gTriangleVertices);
- checkGlError("glVertexAttribPointer");
- glEnableVertexAttribArray(gvPositionHandle);
- checkGlError("glEnableVertexAttribArray");
- glDrawArrays(GL_TRIANGLES, 0, 3);
- checkGlError("glDrawArrays");
-
- // Copy content of FBO into a texture
- glBindTexture(GL_TEXTURE_2D, gBufferTexture);
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, w / 2, h / 2);
- checkGlError("glCopyTexSubImage2D");
-
- // Back to the display
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
- checkGlError("glBindFramebuffer");
-
- // Draw copied content on the screen
- glUseProgram(gTextureProgram);
- checkGlError("glUseProgram");
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-
- glVertexAttribPointer(gvTexturePositionHandle, 3, GL_FLOAT, GL_FALSE,
- TRIANGLE_VERTICES_DATA_STRIDE_BYTES, gTriangleVerticesData);
- checkGlError("glVertexAttribPointer");
- glVertexAttribPointer(gvTextureTexCoordsHandle, 2, GL_FLOAT, GL_FALSE,
- TRIANGLE_VERTICES_DATA_STRIDE_BYTES, &gTriangleVerticesData[3]);
- checkGlError("glVertexAttribPointer");
- glEnableVertexAttribArray(gvTexturePositionHandle);
- glEnableVertexAttribArray(gvTextureTexCoordsHandle);
- checkGlError("glEnableVertexAttribArray");
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- checkGlError("glDrawArrays");
-}
-
-void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) {
-
-#define X(VAL) {VAL, #VAL}
- struct {EGLint attribute; const char* name;} names[] = {
- X(EGL_BUFFER_SIZE),
- X(EGL_ALPHA_SIZE),
- X(EGL_BLUE_SIZE),
- X(EGL_GREEN_SIZE),
- X(EGL_RED_SIZE),
- X(EGL_DEPTH_SIZE),
- X(EGL_STENCIL_SIZE),
- X(EGL_CONFIG_CAVEAT),
- X(EGL_CONFIG_ID),
- X(EGL_LEVEL),
- X(EGL_MAX_PBUFFER_HEIGHT),
- X(EGL_MAX_PBUFFER_PIXELS),
- X(EGL_MAX_PBUFFER_WIDTH),
- X(EGL_NATIVE_RENDERABLE),
- X(EGL_NATIVE_VISUAL_ID),
- X(EGL_NATIVE_VISUAL_TYPE),
- X(EGL_SAMPLES),
- X(EGL_SAMPLE_BUFFERS),
- X(EGL_SURFACE_TYPE),
- X(EGL_TRANSPARENT_TYPE),
- X(EGL_TRANSPARENT_RED_VALUE),
- X(EGL_TRANSPARENT_GREEN_VALUE),
- X(EGL_TRANSPARENT_BLUE_VALUE),
- X(EGL_BIND_TO_TEXTURE_RGB),
- X(EGL_BIND_TO_TEXTURE_RGBA),
- X(EGL_MIN_SWAP_INTERVAL),
- X(EGL_MAX_SWAP_INTERVAL),
- X(EGL_LUMINANCE_SIZE),
- X(EGL_ALPHA_MASK_SIZE),
- X(EGL_COLOR_BUFFER_TYPE),
- X(EGL_RENDERABLE_TYPE),
- X(EGL_CONFORMANT),
- };
-#undef X
-
- for (size_t j = 0; j < sizeof(names) / sizeof(names[0]); j++) {
- EGLint value = -1;
- EGLint returnVal = eglGetConfigAttrib(dpy, config, names[j].attribute, &value);
- EGLint error = eglGetError();
- if (returnVal && error == EGL_SUCCESS) {
- printf(" %s: ", names[j].name);
- printf("%d (0x%x)", value, value);
- }
- }
- printf("\n");
-}
-
-int printEGLConfigurations(EGLDisplay dpy) {
- EGLint numConfig = 0;
- EGLint returnVal = eglGetConfigs(dpy, NULL, 0, &numConfig);
- checkEglError("eglGetConfigs", returnVal);
- if (!returnVal) {
- return false;
- }
-
- printf("Number of EGL configuration: %d\n", numConfig);
-
- EGLConfig* configs = (EGLConfig*) malloc(sizeof(EGLConfig) * numConfig);
- if (! configs) {
- printf("Could not allocate configs.\n");
- return false;
- }
-
- returnVal = eglGetConfigs(dpy, configs, numConfig, &numConfig);
- checkEglError("eglGetConfigs", returnVal);
- if (!returnVal) {
- free(configs);
- return false;
- }
-
- for(int i = 0; i < numConfig; i++) {
- printf("Configuration %d\n", i);
- printEGLConfiguration(dpy, configs[i]);
- }
-
- free(configs);
- return true;
-}
-
-int main(int argc, char** argv) {
- EGLBoolean returnValue;
- EGLConfig myConfig = {0};
-
- EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
- EGLint s_configAttribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_RED_SIZE, 8,
- EGL_GREEN_SIZE, 8,
- EGL_BLUE_SIZE, 8,
- EGL_ALPHA_SIZE, 8,
- EGL_NONE };
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLSurface surface;
- EGLint w, h;
-
- EGLDisplay dpy;
-
- checkEglError("<init>");
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- checkEglError("eglGetDisplay");
- if (dpy == EGL_NO_DISPLAY) {
- printf("eglGetDisplay returned EGL_NO_DISPLAY.\n");
- return 0;
- }
-
- returnValue = eglInitialize(dpy, &majorVersion, &minorVersion);
- checkEglError("eglInitialize", returnValue);
- fprintf(stderr, "EGL version %d.%d\n", majorVersion, minorVersion);
- if (returnValue != EGL_TRUE) {
- printf("eglInitialize failed\n");
- return 0;
- }
-
- if (!printEGLConfigurations(dpy)) {
- printf("printEGLConfigurations failed\n");
- return 0;
- }
-
- checkEglError("printEGLConfigurations");
-
- EGLNativeWindowType window = android_createDisplaySurface();
- EGLint numConfigs = -1, n = 0;
- eglChooseConfig(dpy, s_configAttribs, 0, 0, &numConfigs);
- if (numConfigs) {
- EGLConfig* const configs = new EGLConfig[numConfigs];
- eglChooseConfig(dpy, s_configAttribs, configs, numConfigs, &n);
- myConfig = configs[0];
- delete[] configs;
- }
-
- checkEglError("EGLUtils::selectConfigForNativeWindow");
-
- printf("Chose this configuration:\n");
- printEGLConfiguration(dpy, myConfig);
-
- surface = eglCreateWindowSurface(dpy, myConfig, window, NULL);
- checkEglError("eglCreateWindowSurface");
- if (surface == EGL_NO_SURFACE) {
- printf("gelCreateWindowSurface failed.\n");
- return 0;
- }
-
- context = eglCreateContext(dpy, myConfig, EGL_NO_CONTEXT, context_attribs);
- checkEglError("eglCreateContext");
- if (context == EGL_NO_CONTEXT) {
- printf("eglCreateContext failed\n");
- return 0;
- }
- returnValue = eglMakeCurrent(dpy, surface, surface, context);
- checkEglError("eglMakeCurrent", returnValue);
- if (returnValue != EGL_TRUE) {
- return 0;
- }
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- checkEglError("eglQuerySurface");
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
- checkEglError("eglQuerySurface");
- GLint dim = w < h ? w : h;
-
- fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
-
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- printGLString("Extensions", GL_EXTENSIONS);
-
- if(!setupGraphics(w, h)) {
- fprintf(stderr, "Could not set up graphics.\n");
- return 0;
- }
-
- for (;;) {
- renderFrame(w, h);
- eglSwapBuffers(dpy, surface);
- checkEglError("eglSwapBuffers");
- }
-
- return 0;
-}
diff --git a/opengl/tests/gl2_java/Android.mk b/opengl/tests/gl2_java/Android.mk
deleted file mode 100644
index 34f4aee..0000000
--- a/opengl/tests/gl2_java/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#########################################################################
-# OpenGL ES 2.0 Java sample
-#########################################################################
-
-TOP_LOCAL_PATH:= $(call my-dir)
-
-# Build activity
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := GL2Java
-
-include $(BUILD_PACKAGE)
diff --git a/opengl/tests/gl2_java/AndroidManifest.xml b/opengl/tests/gl2_java/AndroidManifest.xml
deleted file mode 100644
index 8bb6840..0000000
--- a/opengl/tests/gl2_java/AndroidManifest.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.gl2java">
- <uses-feature android:glEsVersion="0x00020000" />
- <application
- android:label="@string/gl2java_activity">
- <activity android:name="GL2JavaActivity"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:launchMode="singleTask"
- android:configChanges="orientation|keyboardHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/gl2_java/res/values/strings.xml b/opengl/tests/gl2_java/res/values/strings.xml
deleted file mode 100644
index 06bd23c..0000000
--- a/opengl/tests/gl2_java/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2006 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.
--->
-
-<!-- This file contains resource definitions for displayed strings, allowing
- them to be changed based on the locale and options. -->
-
-<resources>
- <!-- Simple strings. -->
- <string name="gl2java_activity">GL2Java</string>
-
-</resources>
-
diff --git a/opengl/tests/gl2_java/src/com/android/gl2java/GL2JavaActivity.java b/opengl/tests/gl2_java/src/com/android/gl2java/GL2JavaActivity.java
deleted file mode 100644
index 37654fb..0000000
--- a/opengl/tests/gl2_java/src/com/android/gl2java/GL2JavaActivity.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2007 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.gl2java;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.WindowManager;
-
-import java.io.File;
-
-
-public class GL2JavaActivity extends Activity {
-
- GL2JavaView mView;
-
- @Override protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- mView = new GL2JavaView(getApplication());
- setContentView(mView);
- }
-
- @Override protected void onPause() {
- super.onPause();
- mView.onPause();
- }
-
- @Override protected void onResume() {
- super.onResume();
- mView.onResume();
- }
-}
diff --git a/opengl/tests/gl2_java/src/com/android/gl2java/GL2JavaView.java b/opengl/tests/gl2_java/src/com/android/gl2java/GL2JavaView.java
deleted file mode 100644
index 7f2bfd3..0000000
--- a/opengl/tests/gl2_java/src/com/android/gl2java/GL2JavaView.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2009 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.gl2java;
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.opengl.GLES20;
-
-/**
- * An implementation of SurfaceView that uses the dedicated surface for
- * displaying an OpenGL animation. This allows the animation to run in a
- * separate thread, without requiring that it be driven by the update mechanism
- * of the view hierarchy.
- *
- * The application-specific rendering code is delegated to a GLView.Renderer
- * instance.
- */
-class GL2JavaView extends GLSurfaceView {
- private static String TAG = "GL2JavaView";
-
- public GL2JavaView(Context context) {
- super(context);
- setEGLContextClientVersion(2);
- setRenderer(new Renderer());
- }
-
- private static class Renderer implements GLSurfaceView.Renderer {
-
- public Renderer() {
- mTriangleVertices = ByteBuffer.allocateDirect(mTriangleVerticesData.length * 4)
- .order(ByteOrder.nativeOrder()).asFloatBuffer();
- mTriangleVertices.put(mTriangleVerticesData).position(0);
- }
-
- public void onDrawFrame(GL10 gl) {
- GLES20.glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
- GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
- GLES20.glUseProgram(mProgram);
- checkGlError("glUseProgram");
-
- GLES20.glVertexAttribPointer(mvPositionHandle, 2, GLES20.GL_FLOAT, false, 0, mTriangleVertices);
- checkGlError("glVertexAttribPointer");
- GLES20.glEnableVertexAttribArray(mvPositionHandle);
- checkGlError("glEnableVertexAttribArray");
- GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3);
- checkGlError("glDrawArrays");
-
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- GLES20.glViewport(0, 0, width, height);
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- mProgram = createProgram(mVertexShader, mFragmentShader);
- if (mProgram == 0) {
- return;
- }
- mvPositionHandle = GLES20.glGetAttribLocation(mProgram, "vPosition");
- checkGlError("glGetAttribLocation");
- if (mvPositionHandle == -1) {
- throw new RuntimeException("Could not get attrib location for vPosition");
- }
- }
-
- private int loadShader(int shaderType, String source) {
- int shader = GLES20.glCreateShader(shaderType);
- if (shader != 0) {
- GLES20.glShaderSource(shader, source);
- GLES20.glCompileShader(shader);
- int[] compiled = new int[1];
- GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
- if (compiled[0] == 0) {
- Log.e(TAG, "Could not compile shader " + shaderType + ":");
- Log.e(TAG, GLES20.glGetShaderInfoLog(shader));
- GLES20.glDeleteShader(shader);
- shader = 0;
- }
- }
- return shader;
- }
-
- private int createProgram(String vertexSource, String fragmentSource) {
- int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
- if (vertexShader == 0) {
- return 0;
- }
-
- int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
- if (pixelShader == 0) {
- return 0;
- }
-
- int program = GLES20.glCreateProgram();
- if (program != 0) {
- GLES20.glAttachShader(program, vertexShader);
- checkGlError("glAttachShader");
- GLES20.glAttachShader(program, pixelShader);
- checkGlError("glAttachShader");
- GLES20.glLinkProgram(program);
- int[] linkStatus = new int[1];
- GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
- if (linkStatus[0] != GLES20.GL_TRUE) {
- Log.e(TAG, "Could not link program: ");
- Log.e(TAG, GLES20.glGetProgramInfoLog(program));
- GLES20.glDeleteProgram(program);
- program = 0;
- }
- }
- return program;
- }
-
- private void checkGlError(String op) {
- int error;
- while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
- Log.e(TAG, op + ": glError " + error);
- throw new RuntimeException(op + ": glError " + error);
- }
- }
-
- private final float[] mTriangleVerticesData = { 0.0f, 0.5f, -0.5f, -0.5f,
- 0.5f, -0.5f };
-
- private FloatBuffer mTriangleVertices;
-
- private final String mVertexShader = "attribute vec4 vPosition;\n"
- + "void main() {\n"
- + " gl_Position = vPosition;\n"
- + "}\n";
-
- private final String mFragmentShader = "precision mediump float;\n"
- + "void main() {\n"
- + " gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n"
- + "}\n";
-
- private int mProgram;
- private int mvPositionHandle;
-
- }
-}
-
diff --git a/opengl/tests/gl2_jni/Android.mk b/opengl/tests/gl2_jni/Android.mk
deleted file mode 100644
index 5d90ff6..0000000
--- a/opengl/tests/gl2_jni/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#########################################################################
-# OpenGL ES JNI sample
-# This makefile builds both an activity and a shared library.
-#########################################################################
-TOP_LOCAL_PATH:= $(call my-dir)
-
-# Build activity
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := GL2JNI
-
-LOCAL_JNI_SHARED_LIBRARIES := libgl2jni
-
-include $(BUILD_PACKAGE)
-
-#########################################################################
-# Build JNI Shared Library
-#########################################################################
-
-LOCAL_PATH:= $(LOCAL_PATH)/jni
-
-include $(CLEAR_VARS)
-
-# Optional tag would mean it doesn't get installed by default
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -Werror
-
-LOCAL_SRC_FILES:= \
- gl_code.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- libEGL \
- libGLESv2
-
-LOCAL_MODULE := libgl2jni
-
-
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/opengl/tests/gl2_jni/AndroidManifest.xml b/opengl/tests/gl2_jni/AndroidManifest.xml
deleted file mode 100644
index 1827e5f..0000000
--- a/opengl/tests/gl2_jni/AndroidManifest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.gl2jni">
- <application
- android:label="@string/gl2jni_activity">
- <activity android:name="GL2JNIActivity"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:launchMode="singleTask"
- android:configChanges="orientation|keyboardHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/gl2_jni/jni/gl_code.cpp b/opengl/tests/gl2_jni/jni/gl_code.cpp
deleted file mode 100644
index fa6bd93..0000000
--- a/opengl/tests/gl2_jni/jni/gl_code.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-// OpenGL ES 2.0 code
-
-#include <nativehelper/jni.h>
-#define LOG_TAG "GL2JNI gl_code.cpp"
-#include <utils/Log.h>
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-static void printGLString(const char *name, GLenum s) {
- const char *v = (const char *) glGetString(s);
- ALOGI("GL %s = %s\n", name, v);
-}
-
-static void checkGlError(const char* op) {
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- ALOGI("after %s() glError (0x%x)\n", op, error);
- }
-}
-
-static const char gVertexShader[] = "attribute vec4 vPosition;\n"
- "void main() {\n"
- " gl_Position = vPosition;\n"
- "}\n";
-
-static const char gFragmentShader[] = "precision mediump float;\n"
- "void main() {\n"
- " gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n"
- "}\n";
-
-GLuint loadShader(GLenum shaderType, const char* pSource) {
- GLuint shader = glCreateShader(shaderType);
- if (shader) {
- glShaderSource(shader, 1, &pSource, NULL);
- glCompileShader(shader);
- GLint compiled = 0;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
- if (!compiled) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf) {
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- ALOGE("Could not compile shader %d:\n%s\n",
- shaderType, buf);
- free(buf);
- }
- glDeleteShader(shader);
- shader = 0;
- }
- }
- }
- return shader;
-}
-
-GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
- GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
- if (!vertexShader) {
- return 0;
- }
-
- GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
- if (!pixelShader) {
- return 0;
- }
-
- GLuint program = glCreateProgram();
- if (program) {
- glAttachShader(program, vertexShader);
- checkGlError("glAttachShader");
- glAttachShader(program, pixelShader);
- checkGlError("glAttachShader");
- glLinkProgram(program);
- GLint linkStatus = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
- if (linkStatus != GL_TRUE) {
- GLint bufLength = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
- if (bufLength) {
- char* buf = (char*) malloc(bufLength);
- if (buf) {
- glGetProgramInfoLog(program, bufLength, NULL, buf);
- ALOGE("Could not link program:\n%s\n", buf);
- free(buf);
- }
- }
- glDeleteProgram(program);
- program = 0;
- }
- }
- return program;
-}
-
-GLuint gProgram;
-GLuint gvPositionHandle;
-
-bool setupGraphics(int w, int h) {
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- printGLString("Extensions", GL_EXTENSIONS);
-
- ALOGI("setupGraphics(%d, %d)", w, h);
- gProgram = createProgram(gVertexShader, gFragmentShader);
- if (!gProgram) {
- ALOGE("Could not create program.");
- return false;
- }
- gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
- checkGlError("glGetAttribLocation");
- ALOGI("glGetAttribLocation(\"vPosition\") = %d\n",
- gvPositionHandle);
-
- glViewport(0, 0, w, h);
- checkGlError("glViewport");
- return true;
-}
-
-const GLfloat gTriangleVertices[] = { 0.0f, 0.5f, -0.5f, -0.5f,
- 0.5f, -0.5f };
-
-void renderFrame() {
- static float grey;
- grey += 0.01f;
- if (grey > 1.0f) {
- grey = 0.0f;
- }
- glClearColor(grey, grey, grey, 1.0f);
- checkGlError("glClearColor");
- glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- checkGlError("glClear");
-
- glUseProgram(gProgram);
- checkGlError("glUseProgram");
-
- glVertexAttribPointer(gvPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, gTriangleVertices);
- checkGlError("glVertexAttribPointer");
- glEnableVertexAttribArray(gvPositionHandle);
- checkGlError("glEnableVertexAttribArray");
- glDrawArrays(GL_TRIANGLES, 0, 3);
- checkGlError("glDrawArrays");
-}
-
-extern "C" {
- JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_init(JNIEnv * env, jobject obj, jint width, jint height);
- JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_step(JNIEnv * env, jobject obj);
-};
-
-JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_init(JNIEnv * env, jobject obj, jint width, jint height)
-{
- setupGraphics(width, height);
-}
-
-JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_step(JNIEnv * env, jobject obj)
-{
- renderFrame();
-}
-
diff --git a/opengl/tests/gl2_jni/res/values/strings.xml b/opengl/tests/gl2_jni/res/values/strings.xml
deleted file mode 100644
index a29c74b..0000000
--- a/opengl/tests/gl2_jni/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2006 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.
--->
-
-<!-- This file contains resource definitions for displayed strings, allowing
- them to be changed based on the locale and options. -->
-
-<resources>
- <!-- Simple strings. -->
- <string name="gl2jni_activity">GL2JNI</string>
-
-</resources>
-
diff --git a/opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNIActivity.java b/opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNIActivity.java
deleted file mode 100644
index c366a2c..0000000
--- a/opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNIActivity.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2007 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.gl2jni;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.WindowManager;
-
-import java.io.File;
-
-
-public class GL2JNIActivity extends Activity {
-
- GL2JNIView mView;
-
- @Override protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- mView = new GL2JNIView(getApplication());
- setContentView(mView);
- }
-
- @Override protected void onPause() {
- super.onPause();
- mView.onPause();
- }
-
- @Override protected void onResume() {
- super.onResume();
- mView.onResume();
- }
-}
diff --git a/opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNILib.java b/opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNILib.java
deleted file mode 100644
index 040a984..0000000
--- a/opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNILib.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2007 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.gl2jni;
-
-// Wrapper for native library
-
-public class GL2JNILib {
-
- static {
- System.loadLibrary("gl2jni");
- }
-
- /**
- * @param width the current view width
- * @param height the current view height
- */
- public static native void init(int width, int height);
- public static native void step();
-}
diff --git a/opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNIView.java b/opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNIView.java
deleted file mode 100644
index 72b1dfb..0000000
--- a/opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNIView.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (C) 2009 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.gl2jni;
-/*
- * Copyright (C) 2008 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.
- */
-
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.GL10;
-
-/**
- * An implementation of SurfaceView that uses the dedicated surface for
- * displaying an OpenGL animation. This allows the animation to run in a
- * separate thread, without requiring that it be driven by the update mechanism
- * of the view hierarchy.
- *
- * The application-specific rendering code is delegated to a GLView.Renderer
- * instance.
- */
-class GL2JNIView extends GLSurfaceView {
- private static String TAG = "GL2JNIView";
-
- public GL2JNIView(Context context) {
- super(context);
- init(false, 0, 0);
- }
-
- public GL2JNIView(Context context, boolean translucent, int depth, int stencil) {
- super(context);
- init(translucent, depth, stencil);
- }
-
- private void init(boolean translucent, int depth, int stencil) {
- setEGLContextFactory(new ContextFactory());
- setEGLConfigChooser( translucent ?
- new ConfigChooser(8,8,8,8, depth, stencil) :
- new ConfigChooser(5,6,5,0, depth, stencil));
- setRenderer(new Renderer());
- }
-
- private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
- private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
- public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
- Log.w(TAG, "creating OpenGL ES 2.0 context");
- checkEglError("Before eglCreateContext", egl);
- int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
- EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
- checkEglError("After eglCreateContext", egl);
- return context;
- }
-
- public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) {
- egl.eglDestroyContext(display, context);
- }
- }
-
- private static void checkEglError(String prompt, EGL10 egl) {
- int error;
- while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
- Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));
- }
- }
-
- private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser {
- private static int EGL_OPENGL_ES2_BIT = 4;
- private static int[] s_configAttribs2 =
- {
- EGL10.EGL_RED_SIZE, 4,
- EGL10.EGL_GREEN_SIZE, 4,
- EGL10.EGL_BLUE_SIZE, 4,
- EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL10.EGL_NONE
- };
-
- public ConfigChooser(int r, int g, int b, int a, int depth, int stencil) {
- mRedSize = r;
- mGreenSize = g;
- mBlueSize = b;
- mAlphaSize = a;
- mDepthSize = depth;
- mStencilSize = stencil;
- }
-
- public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
-
- int[] num_config = new int[1];
- egl.eglChooseConfig(display, s_configAttribs2, null, 0, num_config);
-
- int numConfigs = num_config[0];
-
- if (numConfigs <= 0) {
- throw new IllegalArgumentException("No configs match configSpec");
- }
- EGLConfig[] configs = new EGLConfig[numConfigs];
- egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config);
- // printConfigs(egl, display, configs);
- return chooseConfig(egl, display, configs);
- }
-
- public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display,
- EGLConfig[] configs) {
- EGLConfig closestConfig = null;
- int closestDistance = 1000;
- for(EGLConfig config : configs) {
- int d = findConfigAttrib(egl, display, config,
- EGL10.EGL_DEPTH_SIZE, 0);
- int s = findConfigAttrib(egl, display, config,
- EGL10.EGL_STENCIL_SIZE, 0);
- if (d >= mDepthSize && s>= mStencilSize) {
- int r = findConfigAttrib(egl, display, config,
- EGL10.EGL_RED_SIZE, 0);
- int g = findConfigAttrib(egl, display, config,
- EGL10.EGL_GREEN_SIZE, 0);
- int b = findConfigAttrib(egl, display, config,
- EGL10.EGL_BLUE_SIZE, 0);
- int a = findConfigAttrib(egl, display, config,
- EGL10.EGL_ALPHA_SIZE, 0);
- int distance = Math.abs(r - mRedSize)
- + Math.abs(g - mGreenSize)
- + Math.abs(b - mBlueSize)
- + Math.abs(a - mAlphaSize);
- if (distance < closestDistance) {
- closestDistance = distance;
- closestConfig = config;
- }
- }
- }
- return closestConfig;
- }
-
- private int findConfigAttrib(EGL10 egl, EGLDisplay display,
- EGLConfig config, int attribute, int defaultValue) {
-
- if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
- return mValue[0];
- }
- return defaultValue;
- }
-
- private void printConfigs(EGL10 egl, EGLDisplay display,
- EGLConfig[] configs) {
- int numConfigs = configs.length;
- Log.w(TAG, String.format("%d configurations", numConfigs));
- for (int i = 0; i < numConfigs; i++) {
- Log.w(TAG, String.format("Configuration %d:\n", i));
- printConfig(egl, display, configs[i]);
- }
- }
-
- private void printConfig(EGL10 egl, EGLDisplay display,
- EGLConfig config) {
- int[] attributes = {
- EGL10.EGL_BUFFER_SIZE,
- EGL10.EGL_ALPHA_SIZE,
- EGL10.EGL_BLUE_SIZE,
- EGL10.EGL_GREEN_SIZE,
- EGL10.EGL_RED_SIZE,
- EGL10.EGL_DEPTH_SIZE,
- EGL10.EGL_STENCIL_SIZE,
- EGL10.EGL_CONFIG_CAVEAT,
- EGL10.EGL_CONFIG_ID,
- EGL10.EGL_LEVEL,
- EGL10.EGL_MAX_PBUFFER_HEIGHT,
- EGL10.EGL_MAX_PBUFFER_PIXELS,
- EGL10.EGL_MAX_PBUFFER_WIDTH,
- EGL10.EGL_NATIVE_RENDERABLE,
- EGL10.EGL_NATIVE_VISUAL_ID,
- EGL10.EGL_NATIVE_VISUAL_TYPE,
- 0x3030, // EGL10.EGL_PRESERVED_RESOURCES,
- EGL10.EGL_SAMPLES,
- EGL10.EGL_SAMPLE_BUFFERS,
- EGL10.EGL_SURFACE_TYPE,
- EGL10.EGL_TRANSPARENT_TYPE,
- EGL10.EGL_TRANSPARENT_RED_VALUE,
- EGL10.EGL_TRANSPARENT_GREEN_VALUE,
- EGL10.EGL_TRANSPARENT_BLUE_VALUE,
- 0x3039, // EGL10.EGL_BIND_TO_TEXTURE_RGB,
- 0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGBA,
- 0x303B, // EGL10.EGL_MIN_SWAP_INTERVAL,
- 0x303C, // EGL10.EGL_MAX_SWAP_INTERVAL,
- EGL10.EGL_LUMINANCE_SIZE,
- EGL10.EGL_ALPHA_MASK_SIZE,
- EGL10.EGL_COLOR_BUFFER_TYPE,
- EGL10.EGL_RENDERABLE_TYPE,
- 0x3042 // EGL10.EGL_CONFORMANT
- };
- String[] names = {
- "EGL_BUFFER_SIZE",
- "EGL_ALPHA_SIZE",
- "EGL_BLUE_SIZE",
- "EGL_GREEN_SIZE",
- "EGL_RED_SIZE",
- "EGL_DEPTH_SIZE",
- "EGL_STENCIL_SIZE",
- "EGL_CONFIG_CAVEAT",
- "EGL_CONFIG_ID",
- "EGL_LEVEL",
- "EGL_MAX_PBUFFER_HEIGHT",
- "EGL_MAX_PBUFFER_PIXELS",
- "EGL_MAX_PBUFFER_WIDTH",
- "EGL_NATIVE_RENDERABLE",
- "EGL_NATIVE_VISUAL_ID",
- "EGL_NATIVE_VISUAL_TYPE",
- "EGL_PRESERVED_RESOURCES",
- "EGL_SAMPLES",
- "EGL_SAMPLE_BUFFERS",
- "EGL_SURFACE_TYPE",
- "EGL_TRANSPARENT_TYPE",
- "EGL_TRANSPARENT_RED_VALUE",
- "EGL_TRANSPARENT_GREEN_VALUE",
- "EGL_TRANSPARENT_BLUE_VALUE",
- "EGL_BIND_TO_TEXTURE_RGB",
- "EGL_BIND_TO_TEXTURE_RGBA",
- "EGL_MIN_SWAP_INTERVAL",
- "EGL_MAX_SWAP_INTERVAL",
- "EGL_LUMINANCE_SIZE",
- "EGL_ALPHA_MASK_SIZE",
- "EGL_COLOR_BUFFER_TYPE",
- "EGL_RENDERABLE_TYPE",
- "EGL_CONFORMANT"
- };
- int[] value = new int[1];
- for (int i = 0; i < attributes.length; i++) {
- int attribute = attributes[i];
- String name = names[i];
- if ( egl.eglGetConfigAttrib(display, config, attribute, value)) {
- Log.w(TAG, String.format(" %s: %d\n", name, value[0]));
- } else {
- // Log.w(TAG, String.format(" %s: failed\n", name));
- while (egl.eglGetError() != EGL10.EGL_SUCCESS);
- }
- }
- }
-
- // Subclasses can adjust these values:
- protected int mRedSize;
- protected int mGreenSize;
- protected int mBlueSize;
- protected int mAlphaSize;
- protected int mDepthSize;
- protected int mStencilSize;
- private int[] mValue = new int[1];
- }
-
- private static class Renderer implements GLSurfaceView.Renderer {
- public void onDrawFrame(GL10 gl) {
- GL2JNILib.step();
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- GL2JNILib.init(width, height);
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- // Do nothing.
- }
- }
-}
-
diff --git a/opengl/tests/gl2_yuvtex/Android.mk b/opengl/tests/gl2_yuvtex/Android.mk
deleted file mode 100644
index 7d43759..0000000
--- a/opengl/tests/gl2_yuvtex/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- gl2_yuvtex.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv2 \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-gl2_yuvtex
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp b/opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp
deleted file mode 100644
index d3e4932..0000000
--- a/opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <sched.h>
-#include <sys/resource.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <utils/Timers.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include <ui/GraphicBuffer.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-static void printGLString(const char *name, GLenum s) {
- // fprintf(stderr, "printGLString %s, %d\n", name, s);
- const char *v = (const char *) glGetString(s);
- // int error = glGetError();
- // fprintf(stderr, "glGetError() = %d, result of glGetString = %x\n", error,
- // (unsigned int) v);
- // if ((v < (const char*) 0) || (v > (const char*) 0x10000))
- // fprintf(stderr, "GL %s = %s\n", name, v);
- // else
- // fprintf(stderr, "GL %s = (null) 0x%08x\n", name, (unsigned int) v);
- fprintf(stderr, "GL %s = %s\n", name, v);
-}
-
-static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE) {
- if (returnVal != EGL_TRUE) {
- fprintf(stderr, "%s() returned %d\n", op, returnVal);
- }
-
- for (EGLint error = eglGetError(); error != EGL_SUCCESS; error
- = eglGetError()) {
- fprintf(stderr, "after %s() eglError %s (0x%x)\n", op, EGLUtils::strerror(error),
- error);
- }
-}
-
-static void checkGlError(const char* op) {
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- fprintf(stderr, "after %s() glError (0x%x)\n", op, error);
- }
-}
-
-static const char gVertexShader[] = "attribute vec4 vPosition;\n"
- "varying vec2 yuvTexCoords;\n"
- "void main() {\n"
- " yuvTexCoords = vPosition.xy + vec2(0.5, 0.5);\n"
- " gl_Position = vPosition;\n"
- "}\n";
-
-static const char gFragmentShader[] = "#extension GL_OES_EGL_image_external : require\n"
- "precision mediump float;\n"
- "uniform samplerExternalOES yuvTexSampler;\n"
- "varying vec2 yuvTexCoords;\n"
- "void main() {\n"
- " gl_FragColor = texture2D(yuvTexSampler, yuvTexCoords);\n"
- "}\n";
-
-GLuint loadShader(GLenum shaderType, const char* pSource) {
- GLuint shader = glCreateShader(shaderType);
- if (shader) {
- glShaderSource(shader, 1, &pSource, NULL);
- glCompileShader(shader);
- GLint compiled = 0;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
- if (!compiled) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf) {
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- fprintf(stderr, "Could not compile shader %d:\n%s\n",
- shaderType, buf);
- free(buf);
- }
- } else {
- fprintf(stderr, "Guessing at GL_INFO_LOG_LENGTH size\n");
- char* buf = (char*) malloc(0x1000);
- if (buf) {
- glGetShaderInfoLog(shader, 0x1000, NULL, buf);
- fprintf(stderr, "Could not compile shader %d:\n%s\n",
- shaderType, buf);
- free(buf);
- }
- }
- glDeleteShader(shader);
- shader = 0;
- }
- }
- return shader;
-}
-
-GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
- GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
- if (!vertexShader) {
- return 0;
- }
-
- GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
- if (!pixelShader) {
- return 0;
- }
-
- GLuint program = glCreateProgram();
- if (program) {
- glAttachShader(program, vertexShader);
- checkGlError("glAttachShader");
- glAttachShader(program, pixelShader);
- checkGlError("glAttachShader");
- glLinkProgram(program);
- GLint linkStatus = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
- if (linkStatus != GL_TRUE) {
- GLint bufLength = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
- if (bufLength) {
- char* buf = (char*) malloc(bufLength);
- if (buf) {
- glGetProgramInfoLog(program, bufLength, NULL, buf);
- fprintf(stderr, "Could not link program:\n%s\n", buf);
- free(buf);
- }
- }
- glDeleteProgram(program);
- program = 0;
- }
- }
- return program;
-}
-
-GLuint gProgram;
-GLint gvPositionHandle;
-GLint gYuvTexSamplerHandle;
-
-bool setupGraphics(int w, int h) {
- gProgram = createProgram(gVertexShader, gFragmentShader);
- if (!gProgram) {
- return false;
- }
- gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
- checkGlError("glGetAttribLocation");
- fprintf(stderr, "glGetAttribLocation(\"vPosition\") = %d\n",
- gvPositionHandle);
- gYuvTexSamplerHandle = glGetUniformLocation(gProgram, "yuvTexSampler");
- checkGlError("glGetUniformLocation");
- fprintf(stderr, "glGetUniformLocation(\"yuvTexSampler\") = %d\n",
- gYuvTexSamplerHandle);
-
- glViewport(0, 0, w, h);
- checkGlError("glViewport");
- return true;
-}
-
-int align(int x, int a) {
- return (x + (a-1)) & (~(a-1));
-}
-
-const int yuvTexWidth = 608;
-const int yuvTexHeight = 480;
-const int yuvTexUsage = GraphicBuffer::USAGE_HW_TEXTURE |
- GraphicBuffer::USAGE_SW_WRITE_RARELY;
-const int yuvTexFormat = HAL_PIXEL_FORMAT_YV12;
-const int yuvTexOffsetY = 0;
-const bool yuvTexSameUV = false;
-static sp<GraphicBuffer> yuvTexBuffer;
-static GLuint yuvTex;
-
-bool setupYuvTexSurface(EGLDisplay dpy, EGLContext context) {
- int blockWidth = yuvTexWidth > 16 ? yuvTexWidth / 16 : 1;
- int blockHeight = yuvTexHeight > 16 ? yuvTexHeight / 16 : 1;
- yuvTexBuffer = new GraphicBuffer(yuvTexWidth, yuvTexHeight, yuvTexFormat,
- yuvTexUsage);
- int yuvTexStrideY = yuvTexBuffer->getStride();
- int yuvTexOffsetV = yuvTexStrideY * yuvTexHeight;
- int yuvTexStrideV = (yuvTexStrideY/2 + 0xf) & ~0xf;
- int yuvTexOffsetU = yuvTexOffsetV + yuvTexStrideV * yuvTexHeight/2;
- int yuvTexStrideU = yuvTexStrideV;
- char* buf = NULL;
- status_t err = yuvTexBuffer->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&buf));
- if (err != 0) {
- fprintf(stderr, "yuvTexBuffer->lock(...) failed: %d\n", err);
- return false;
- }
- for (int x = 0; x < yuvTexWidth; x++) {
- for (int y = 0; y < yuvTexHeight; y++) {
- int parityX = (x / blockWidth) & 1;
- int parityY = (y / blockHeight) & 1;
- unsigned char intensity = (parityX ^ parityY) ? 63 : 191;
- buf[yuvTexOffsetY + (y * yuvTexStrideY) + x] = intensity;
- if (x < yuvTexWidth / 2 && y < yuvTexHeight / 2) {
- buf[yuvTexOffsetU + (y * yuvTexStrideU) + x] = intensity;
- if (yuvTexSameUV) {
- buf[yuvTexOffsetV + (y * yuvTexStrideV) + x] = intensity;
- } else if (x < yuvTexWidth / 4 && y < yuvTexHeight / 4) {
- buf[yuvTexOffsetV + (y*2 * yuvTexStrideV) + x*2 + 0] =
- buf[yuvTexOffsetV + (y*2 * yuvTexStrideV) + x*2 + 1] =
- buf[yuvTexOffsetV + ((y*2+1) * yuvTexStrideV) + x*2 + 0] =
- buf[yuvTexOffsetV + ((y*2+1) * yuvTexStrideV) + x*2 + 1] = intensity;
- }
- }
- }
- }
-
- err = yuvTexBuffer->unlock();
- if (err != 0) {
- fprintf(stderr, "yuvTexBuffer->unlock() failed: %d\n", err);
- return false;
- }
-
- EGLClientBuffer clientBuffer = (EGLClientBuffer)yuvTexBuffer->getNativeBuffer();
- EGLImageKHR img = eglCreateImageKHR(dpy, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID,
- clientBuffer, 0);
- checkEglError("eglCreateImageKHR");
- if (img == EGL_NO_IMAGE_KHR) {
- return false;
- }
-
- glGenTextures(1, &yuvTex);
- checkGlError("glGenTextures");
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, yuvTex);
- checkGlError("glBindTexture");
- glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)img);
- checkGlError("glEGLImageTargetTexture2DOES");
-
- return true;
-}
-
-const GLfloat gTriangleVertices[] = {
- -0.5f, 0.5f,
- -0.5f, -0.5f,
- 0.5f, -0.5f,
- 0.5f, 0.5f,
-};
-
-void renderFrame() {
- glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
- checkGlError("glClearColor");
- glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- checkGlError("glClear");
-
- glUseProgram(gProgram);
- checkGlError("glUseProgram");
-
- glVertexAttribPointer(gvPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, gTriangleVertices);
- checkGlError("glVertexAttribPointer");
- glEnableVertexAttribArray(gvPositionHandle);
- checkGlError("glEnableVertexAttribArray");
-
- glUniform1i(gYuvTexSamplerHandle, 0);
- checkGlError("glUniform1i");
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, yuvTex);
- checkGlError("glBindTexture");
-
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- checkGlError("glDrawArrays");
-}
-
-void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) {
-
-#define X(VAL) {VAL, #VAL}
- struct {EGLint attribute; const char* name;} names[] = {
- X(EGL_BUFFER_SIZE),
- X(EGL_ALPHA_SIZE),
- X(EGL_BLUE_SIZE),
- X(EGL_GREEN_SIZE),
- X(EGL_RED_SIZE),
- X(EGL_DEPTH_SIZE),
- X(EGL_STENCIL_SIZE),
- X(EGL_CONFIG_CAVEAT),
- X(EGL_CONFIG_ID),
- X(EGL_LEVEL),
- X(EGL_MAX_PBUFFER_HEIGHT),
- X(EGL_MAX_PBUFFER_PIXELS),
- X(EGL_MAX_PBUFFER_WIDTH),
- X(EGL_NATIVE_RENDERABLE),
- X(EGL_NATIVE_VISUAL_ID),
- X(EGL_NATIVE_VISUAL_TYPE),
- X(EGL_SAMPLES),
- X(EGL_SAMPLE_BUFFERS),
- X(EGL_SURFACE_TYPE),
- X(EGL_TRANSPARENT_TYPE),
- X(EGL_TRANSPARENT_RED_VALUE),
- X(EGL_TRANSPARENT_GREEN_VALUE),
- X(EGL_TRANSPARENT_BLUE_VALUE),
- X(EGL_BIND_TO_TEXTURE_RGB),
- X(EGL_BIND_TO_TEXTURE_RGBA),
- X(EGL_MIN_SWAP_INTERVAL),
- X(EGL_MAX_SWAP_INTERVAL),
- X(EGL_LUMINANCE_SIZE),
- X(EGL_ALPHA_MASK_SIZE),
- X(EGL_COLOR_BUFFER_TYPE),
- X(EGL_RENDERABLE_TYPE),
- X(EGL_CONFORMANT),
- };
-#undef X
-
- for (size_t j = 0; j < sizeof(names) / sizeof(names[0]); j++) {
- EGLint value = -1;
- EGLint returnVal = eglGetConfigAttrib(dpy, config, names[j].attribute, &value);
- EGLint error = eglGetError();
- if (returnVal && error == EGL_SUCCESS) {
- printf(" %s: ", names[j].name);
- printf("%d (0x%x)", value, value);
- }
- }
- printf("\n");
-}
-
-int main(int argc, char** argv) {
- EGLBoolean returnValue;
- EGLConfig myConfig = {0};
-
- EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
- EGLint s_configAttribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_NONE };
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLSurface surface;
- EGLint w, h;
-
- EGLDisplay dpy;
-
- checkEglError("<init>");
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- checkEglError("eglGetDisplay");
- if (dpy == EGL_NO_DISPLAY) {
- printf("eglGetDisplay returned EGL_NO_DISPLAY.\n");
- return 0;
- }
-
- returnValue = eglInitialize(dpy, &majorVersion, &minorVersion);
- checkEglError("eglInitialize", returnValue);
- fprintf(stderr, "EGL version %d.%d\n", majorVersion, minorVersion);
- if (returnValue != EGL_TRUE) {
- printf("eglInitialize failed\n");
- return 0;
- }
-
- EGLNativeWindowType window = android_createDisplaySurface();
- returnValue = EGLUtils::selectConfigForNativeWindow(dpy, s_configAttribs, window, &myConfig);
- if (returnValue) {
- printf("EGLUtils::selectConfigForNativeWindow() returned %d", returnValue);
- return 1;
- }
-
- checkEglError("EGLUtils::selectConfigForNativeWindow");
-
- printf("Chose this configuration:\n");
- printEGLConfiguration(dpy, myConfig);
-
- surface = eglCreateWindowSurface(dpy, myConfig, window, NULL);
- checkEglError("eglCreateWindowSurface");
- if (surface == EGL_NO_SURFACE) {
- printf("gelCreateWindowSurface failed.\n");
- return 1;
- }
-
- context = eglCreateContext(dpy, myConfig, EGL_NO_CONTEXT, context_attribs);
- checkEglError("eglCreateContext");
- if (context == EGL_NO_CONTEXT) {
- printf("eglCreateContext failed\n");
- return 1;
- }
- returnValue = eglMakeCurrent(dpy, surface, surface, context);
- checkEglError("eglMakeCurrent", returnValue);
- if (returnValue != EGL_TRUE) {
- return 1;
- }
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- checkEglError("eglQuerySurface");
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
- checkEglError("eglQuerySurface");
- GLint dim = w < h ? w : h;
-
- fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
-
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- printGLString("Extensions", GL_EXTENSIONS);
-
- if(!setupYuvTexSurface(dpy, context)) {
- fprintf(stderr, "Could not set up texture surface.\n");
- return 1;
- }
-
- if(!setupGraphics(w, h)) {
- fprintf(stderr, "Could not set up graphics.\n");
- return 1;
- }
-
- for (;;) {
- renderFrame();
- eglSwapBuffers(dpy, surface);
- checkEglError("eglSwapBuffers");
- }
-
- return 0;
-}
diff --git a/opengl/tests/gl_basic/Android.mk b/opengl/tests/gl_basic/Android.mk
deleted file mode 100644
index 46bcc60..0000000
--- a/opengl/tests/gl_basic/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- gl_basic.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv1_CM \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-gl_basic
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/gl_basic/gl_basic.cpp b/opengl/tests/gl_basic/gl_basic.cpp
deleted file mode 100644
index 23ce934..0000000
--- a/opengl/tests/gl_basic/gl_basic.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-// Simple OpenGL ES 1.x application showing how to initialize and draw something.
-
-#include <EGL/egl.h>
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-#include <stdio.h>
-
-#include <stdlib.h>
-#include <math.h>
-
-using namespace android;
-
-EGLDisplay eglDisplay;
-EGLSurface eglSurface;
-EGLContext eglContext;
-GLuint texture;
-
-#define FIXED_ONE 0x10000
-#define ITERATIONS 50
-
-int init_gl_surface(void);
-void free_gl_surface(void);
-void init_scene(void);
-void render();
-void create_texture(void);
-int readTimer(void);
-
-static void printGLString(const char *name, GLenum s) {
- const char *v = (const char *) glGetString(s);
- fprintf(stderr, "GL %s = %s\n", name, v);
-}
-
-static void gluLookAt(float eyeX, float eyeY, float eyeZ,
- float centerX, float centerY, float centerZ, float upX, float upY,
- float upZ)
-{
- // See the OpenGL GLUT documentation for gluLookAt for a description
- // of the algorithm. We implement it in a straightforward way:
-
- float fx = centerX - eyeX;
- float fy = centerY - eyeY;
- float fz = centerZ - eyeZ;
-
- // Normalize f
- float rlf = 1.0f / sqrtf(fx*fx + fy*fy + fz*fz);
- fx *= rlf;
- fy *= rlf;
- fz *= rlf;
-
- // Normalize up
- float rlup = 1.0f / sqrtf(upX*upX + upY*upY + upZ*upZ);
- upX *= rlup;
- upY *= rlup;
- upZ *= rlup;
-
- // compute s = f x up (x means "cross product")
-
- float sx = fy * upZ - fz * upY;
- float sy = fz * upX - fx * upZ;
- float sz = fx * upY - fy * upX;
-
- // compute u = s x f
- float ux = sy * fz - sz * fy;
- float uy = sz * fx - sx * fz;
- float uz = sx * fy - sy * fx;
-
- float m[16] ;
- m[0] = sx;
- m[1] = ux;
- m[2] = -fx;
- m[3] = 0.0f;
-
- m[4] = sy;
- m[5] = uy;
- m[6] = -fy;
- m[7] = 0.0f;
-
- m[8] = sz;
- m[9] = uz;
- m[10] = -fz;
- m[11] = 0.0f;
-
- m[12] = 0.0f;
- m[13] = 0.0f;
- m[14] = 0.0f;
- m[15] = 1.0f;
-
- glMultMatrixf(m);
- glTranslatef(-eyeX, -eyeY, -eyeZ);
-}
-
-void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) {
-
-#define X(VAL) {VAL, #VAL}
- struct {EGLint attribute; const char* name;} names[] = {
- X(EGL_BUFFER_SIZE),
- X(EGL_ALPHA_SIZE),
- X(EGL_BLUE_SIZE),
- X(EGL_GREEN_SIZE),
- X(EGL_RED_SIZE),
- X(EGL_DEPTH_SIZE),
- X(EGL_STENCIL_SIZE),
- X(EGL_CONFIG_CAVEAT),
- X(EGL_CONFIG_ID),
- X(EGL_LEVEL),
- X(EGL_MAX_PBUFFER_HEIGHT),
- X(EGL_MAX_PBUFFER_PIXELS),
- X(EGL_MAX_PBUFFER_WIDTH),
- X(EGL_NATIVE_RENDERABLE),
- X(EGL_NATIVE_VISUAL_ID),
- X(EGL_NATIVE_VISUAL_TYPE),
- X(EGL_SAMPLES),
- X(EGL_SAMPLE_BUFFERS),
- X(EGL_SURFACE_TYPE),
- X(EGL_TRANSPARENT_TYPE),
- X(EGL_TRANSPARENT_RED_VALUE),
- X(EGL_TRANSPARENT_GREEN_VALUE),
- X(EGL_TRANSPARENT_BLUE_VALUE),
- X(EGL_BIND_TO_TEXTURE_RGB),
- X(EGL_BIND_TO_TEXTURE_RGBA),
- X(EGL_MIN_SWAP_INTERVAL),
- X(EGL_MAX_SWAP_INTERVAL),
- X(EGL_LUMINANCE_SIZE),
- X(EGL_ALPHA_MASK_SIZE),
- X(EGL_COLOR_BUFFER_TYPE),
- X(EGL_RENDERABLE_TYPE),
- X(EGL_CONFORMANT),
- };
-#undef X
-
- for (size_t j = 0; j < sizeof(names) / sizeof(names[0]); j++) {
- EGLint value = -1;
- EGLint returnVal = eglGetConfigAttrib(dpy, config, names[j].attribute, &value);
- EGLint error = eglGetError();
- if (returnVal && error == EGL_SUCCESS) {
- printf(" %s: ", names[j].name);
- printf("%d (0x%x)", value, value);
- }
- }
- printf("\n");
-}
-
-static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE) {
- if (returnVal != EGL_TRUE) {
- fprintf(stderr, "%s() returned %d\n", op, returnVal);
- }
-
- for (EGLint error = eglGetError(); error != EGL_SUCCESS; error
- = eglGetError()) {
- fprintf(stderr, "after %s() eglError %s (0x%x)\n", op, EGLUtils::strerror(error),
- error);
- }
-}
-
-int printEGLConfigurations(EGLDisplay dpy) {
- EGLint numConfig = 0;
- EGLint returnVal = eglGetConfigs(dpy, NULL, 0, &numConfig);
- checkEglError("eglGetConfigs", returnVal);
- if (!returnVal) {
- return false;
- }
-
- printf("Number of EGL configurations: %d\n", numConfig);
-
- EGLConfig* configs = (EGLConfig*) malloc(sizeof(EGLConfig) * numConfig);
- if (! configs) {
- printf("Could not allocate configs.\n");
- return false;
- }
-
- returnVal = eglGetConfigs(dpy, configs, numConfig, &numConfig);
- checkEglError("eglGetConfigs", returnVal);
- if (!returnVal) {
- free(configs);
- return false;
- }
-
- for(int i = 0; i < numConfig; i++) {
- printf("Configuration %d\n", i);
- printEGLConfiguration(dpy, configs[i]);
- }
-
- free(configs);
- return true;
-}
-
-int main(int argc, char **argv)
-{
- int q;
- int start, end;
- printf("Initializing EGL...\n");
- if(!init_gl_surface())
- {
- printf("GL initialisation failed - exiting\n");
- return 0;
- }
- init_scene();
- create_texture();
- printf("Running...\n");
- while(true) {
- render();
- }
- free_gl_surface();
- return 0;
-}
-
-int init_gl_surface(void)
-{
- EGLint numConfigs = 1;
- EGLConfig myConfig = {0};
- EGLint attrib[] =
- {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_NONE
- };
-
- if ( (eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY)) == EGL_NO_DISPLAY )
- {
- printf("eglGetDisplay failed\n");
- return 0;
- }
-
- if ( eglInitialize(eglDisplay, NULL, NULL) != EGL_TRUE )
- {
- printf("eglInitialize failed\n");
- return 0;
- }
-
- if (! printEGLConfigurations(eglDisplay)) {
- printf("printEGLConfigurations failed.\n");
- return 0;
- }
-
- EGLNativeWindowType window = android_createDisplaySurface();
- EGLUtils::selectConfigForNativeWindow(eglDisplay, attrib, window, &myConfig);
-
- if ( (eglSurface = eglCreateWindowSurface(eglDisplay, myConfig,
- window, 0)) == EGL_NO_SURFACE )
- {
- printf("eglCreateWindowSurface failed\n");
- return 0;
- }
-
- if ( (eglContext = eglCreateContext(eglDisplay, myConfig, 0, 0)) == EGL_NO_CONTEXT )
- {
- printf("eglCreateContext failed\n");
- return 0;
- }
-
- if ( eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext) != EGL_TRUE )
- {
- printf("eglMakeCurrent failed\n");
- return 0;
- }
-
- int w, h;
-
- eglQuerySurface(eglDisplay, eglSurface, EGL_WIDTH, &w);
- checkEglError("eglQuerySurface");
- eglQuerySurface(eglDisplay, eglSurface, EGL_HEIGHT, &h);
- checkEglError("eglQuerySurface");
- GLint dim = w < h ? w : h;
-
- fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
-
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- printGLString("Extensions", GL_EXTENSIONS);
-
- return 1;
-}
-
-void free_gl_surface(void)
-{
- if (eglDisplay != EGL_NO_DISPLAY)
- {
- eglMakeCurrent( EGL_NO_DISPLAY, EGL_NO_SURFACE,
- EGL_NO_SURFACE, EGL_NO_CONTEXT );
- eglDestroyContext( eglDisplay, eglContext );
- eglDestroySurface( eglDisplay, eglSurface );
- eglTerminate( eglDisplay );
- eglDisplay = EGL_NO_DISPLAY;
- }
-}
-
-void init_scene(void)
-{
- glDisable(GL_DITHER);
- glEnable(GL_CULL_FACE);
- float ratio = 320.0f / 480.0f;
- glViewport(0, 0, 320, 480);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustumf(-ratio, ratio, -1, 1, 1, 10);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- gluLookAt(
- 0, 0, 3, // eye
- 0, 0, 0, // center
- 0, 1, 0); // up
- glEnable(GL_TEXTURE_2D);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-}
-
-void create_texture(void)
-{
- const unsigned int on = 0xff0000ff;
- const unsigned int off = 0xffffffff;
- const unsigned int pixels[] =
- {
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- };
-
- glGenTextures(1, &texture);
- glBindTexture(GL_TEXTURE_2D, texture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-}
-
-void render()
-{
- int i, j;
- int quads = 1;
-
- const GLfloat vertices[] = {
- -1, -1, 0,
- 1, -1, 0,
- 1, 1, 0,
- -1, 1, 0
- };
-
- const GLfixed texCoords[] = {
- 0, 0,
- FIXED_ONE, 0,
- FIXED_ONE, FIXED_ONE,
- 0, FIXED_ONE
- };
-
- const GLushort indices[] = { 0, 1, 2, 0, 2, 3 };
-
- glVertexPointer(3, GL_FLOAT, 0, vertices);
- glTexCoordPointer(2, GL_FIXED, 0, texCoords);
- glClearColor(1.0, 1.0, 1.0, 1.0);
- int nelem = sizeof(indices)/sizeof(indices[0]);
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- glDrawElements(GL_TRIANGLES, nelem, GL_UNSIGNED_SHORT, indices);
- eglSwapBuffers(eglDisplay, eglSurface);
-}
diff --git a/opengl/tests/gl_jni/Android.mk b/opengl/tests/gl_jni/Android.mk
deleted file mode 100644
index 3d20e72..0000000
--- a/opengl/tests/gl_jni/Android.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-#########################################################################
-# OpenGL ES JNI sample
-# This makefile builds both an activity and a shared library.
-#########################################################################
-TOP_LOCAL_PATH:= $(call my-dir)
-
-# Build activity
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := GLJNI
-
-LOCAL_JNI_SHARED_LIBRARIES := libgljni
-
-include $(BUILD_PACKAGE)
-
-#########################################################################
-# Build JNI Shared Library
-#########################################################################
-
-LOCAL_PATH:= $(LOCAL_PATH)/jni
-
-include $(CLEAR_VARS)
-
-# Optional tag would mean it doesn't get installed by default
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -Werror
-
-LOCAL_SRC_FILES:= \
- gl_code.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- libEGL \
- libGLESv1_CM
-
-LOCAL_MODULE := libgljni
-
-LOCAL_ARM_MODE := arm
-
-
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/opengl/tests/gl_jni/AndroidManifest.xml b/opengl/tests/gl_jni/AndroidManifest.xml
deleted file mode 100644
index 5d0ec96..0000000
--- a/opengl/tests/gl_jni/AndroidManifest.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.gljni">
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <application
- android:label="@string/gljni_activity">
- <activity android:name="GLJNIActivity"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:launchMode="singleTask"
- android:screenOrientation="landscape"
- android:configChanges="orientation|keyboardHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/gl_jni/jni/gl_code.cpp b/opengl/tests/gl_jni/jni/gl_code.cpp
deleted file mode 100644
index cf86020..0000000
--- a/opengl/tests/gl_jni/jni/gl_code.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-// OpenGL ES 1.0 code
-
-#include <nativehelper/jni.h>
-#define LOG_TAG "GLJNI gl_code.cpp"
-#include <utils/Log.h>
-
-#include <GLES/gl.h>
-
-#include <stdio.h>
-
-#include <stdlib.h>
-#include <math.h>
-
-GLuint texture;
-GLfloat background;
-
-#define FIXED_ONE 0x10000
-
-static void printGLString(const char *name, GLenum s) {
- const char *v = (const char *) glGetString(s);
- ALOGI("GL %s = %s\n", name, v);
-}
-
-static void gluLookAt(float eyeX, float eyeY, float eyeZ,
- float centerX, float centerY, float centerZ, float upX, float upY,
- float upZ)
-{
- // See the OpenGL GLUT documentation for gluLookAt for a description
- // of the algorithm. We implement it in a straightforward way:
-
- float fx = centerX - eyeX;
- float fy = centerY - eyeY;
- float fz = centerZ - eyeZ;
-
- // Normalize f
- float rlf = 1.0f / sqrtf(fx*fx + fy*fy + fz*fz);
- fx *= rlf;
- fy *= rlf;
- fz *= rlf;
-
- // Normalize up
- float rlup = 1.0f / sqrtf(upX*upX + upY*upY + upZ*upZ);
- upX *= rlup;
- upY *= rlup;
- upZ *= rlup;
-
- // compute s = f x up (x means "cross product")
-
- float sx = fy * upZ - fz * upY;
- float sy = fz * upX - fx * upZ;
- float sz = fx * upY - fy * upX;
-
- // compute u = s x f
- float ux = sy * fz - sz * fy;
- float uy = sz * fx - sx * fz;
- float uz = sx * fy - sy * fx;
-
- float m[16] ;
- m[0] = sx;
- m[1] = ux;
- m[2] = -fx;
- m[3] = 0.0f;
-
- m[4] = sy;
- m[5] = uy;
- m[6] = -fy;
- m[7] = 0.0f;
-
- m[8] = sz;
- m[9] = uz;
- m[10] = -fz;
- m[11] = 0.0f;
-
- m[12] = 0.0f;
- m[13] = 0.0f;
- m[14] = 0.0f;
- m[15] = 1.0f;
-
- glMultMatrixf(m);
- glTranslatef(-eyeX, -eyeY, -eyeZ);
-}
-
-void init_scene(int width, int height)
-{
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- printGLString("Extensions", GL_EXTENSIONS);
-
- glDisable(GL_DITHER);
- glEnable(GL_CULL_FACE);
-
- float ratio = width / height;
- glViewport(0, 0, width, height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustumf(-ratio, ratio, -1, 1, 1, 10);
-
- glMatrixMode(GL_MODELVIEW);
-
- glLoadIdentity();
- gluLookAt(
- 0, 0, 3, // eye
- 0, 0, 0, // center
- 0, 1, 0); // up
-
- glEnable(GL_TEXTURE_2D);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-}
-
-void create_texture()
-{
- const unsigned int on = 0xff0000ff;
- const unsigned int off = 0xffffffff;
- const unsigned int pixels[] =
- {
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- };
-
- glGenTextures(1, &texture);
- glBindTexture(GL_TEXTURE_2D, texture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-}
-
-extern "C" {
- JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_init(JNIEnv * env, jobject obj, jint width, jint height);
- JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_step(JNIEnv * env, jobject obj);
- JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_changeBackground(JNIEnv * env, jobject obj);
-};
-
-JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_init(JNIEnv * env, jobject obj, jint width, jint height)
-{
- init_scene(width, height);
- create_texture();
-}
-
-JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_step(JNIEnv * env, jobject obj)
-{
- const GLfloat vertices[] = {
- -1, -1, 0,
- 1, -1, 0,
- 1, 1, 0,
- -1, 1, 0
- };
-
- const GLfixed texCoords[] = {
- 0, 0,
- FIXED_ONE, 0,
- FIXED_ONE, FIXED_ONE,
- 0, FIXED_ONE
- };
-
- const GLushort quadIndices[] = { 0, 1, 2, 0, 2, 3 };
- glVertexPointer(3, GL_FLOAT, 0, vertices);
- glTexCoordPointer(2, GL_FIXED, 0, texCoords);
-
- int nelem = sizeof(quadIndices)/sizeof(quadIndices[0]);
- static float grey;
- grey += 0.01f;
- if (grey > 1.0f) {
- grey = 0.0f;
- }
- glClearColor(background, grey, grey, 1.0f);
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- glDrawElements(GL_TRIANGLES, nelem, GL_UNSIGNED_SHORT, quadIndices);
-}
-
-JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_changeBackground(JNIEnv * env, jobject obj)
-{
- background = 1.0f - background;
-}
diff --git a/opengl/tests/gl_jni/res/values/strings.xml b/opengl/tests/gl_jni/res/values/strings.xml
deleted file mode 100644
index aee9fa0..0000000
--- a/opengl/tests/gl_jni/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2006 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.
--->
-
-<!-- This file contains resource definitions for displayed strings, allowing
- them to be changed based on the locale and options. -->
-
-<resources>
- <!-- Simple strings. -->
- <string name="gljni_activity">GLJNI</string>
-
-</resources>
-
diff --git a/opengl/tests/gl_jni/src/com/android/gljni/GLJNIActivity.java b/opengl/tests/gl_jni/src/com/android/gljni/GLJNIActivity.java
deleted file mode 100644
index c6f5313..0000000
--- a/opengl/tests/gl_jni/src/com/android/gljni/GLJNIActivity.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2007 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.gljni;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class GLJNIActivity extends Activity {
-
- GLJNIView mView;
-
- @Override
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- mView = new GLJNIView(getApplication());
- mView.setFocusableInTouchMode(true);
- setContentView(mView);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- mView.onPause();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- mView.onResume();
- }
-}
diff --git a/opengl/tests/gl_jni/src/com/android/gljni/GLJNILib.java b/opengl/tests/gl_jni/src/com/android/gljni/GLJNILib.java
deleted file mode 100644
index f56d2af..0000000
--- a/opengl/tests/gl_jni/src/com/android/gljni/GLJNILib.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2007 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.gljni;
-
-// Wrapper for native library
-
-public class GLJNILib {
-
- static {
- System.loadLibrary("gljni");
- }
-
- /**
- * @param width the current view width
- * @param height the current view height
- */
- public static native void init(int width, int height);
- public static native void step();
- public static native void changeBackground();
-}
diff --git a/opengl/tests/gl_jni/src/com/android/gljni/GLJNIView.java b/opengl/tests/gl_jni/src/com/android/gljni/GLJNIView.java
deleted file mode 100644
index 9a2c8c4..0000000
--- a/opengl/tests/gl_jni/src/com/android/gljni/GLJNIView.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2009 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.gljni;
-/*
- * Copyright (C) 2008 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.
- */
-
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-/**
- * An implementation of SurfaceView that uses the dedicated surface for
- * displaying an OpenGL animation. This allows the animation to run in a
- * separate thread, without requiring that it be driven by the update mechanism
- * of the view hierarchy.
- *
- * The application-specific rendering code is delegated to a GLView.Renderer
- * instance.
- */
-class GLJNIView extends GLSurfaceView {
- GLJNIView(Context context) {
- super(context);
- init();
- }
-
- public GLJNIView(Context context, AttributeSet attrs) {
- super(context, attrs);
- init();
- }
-
- private void init() {
- setRenderer(new Renderer());
- }
-
- private class Renderer implements GLSurfaceView.Renderer {
- private static final String TAG = "Renderer";
- public void onDrawFrame(GL10 gl) {
- GLJNILib.step();
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- GLJNILib.init(width, height);
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- // Do nothing.
- }
- }
-
- @Override
- public boolean onKeyDown(int keyCode, KeyEvent event) {
- GLJNILib.changeBackground();
- return true;
- }
-}
-
diff --git a/opengl/tests/gl_perf/Android.mk b/opengl/tests/gl_perf/Android.mk
deleted file mode 100644
index cfca089..0000000
--- a/opengl/tests/gl_perf/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- gl2_perf.cpp \
- filltest.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv2 \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-gl2_perf
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/gl_perf/fill_common.cpp b/opengl/tests/gl_perf/fill_common.cpp
deleted file mode 100644
index 389381f..0000000
--- a/opengl/tests/gl_perf/fill_common.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include "fragment_shaders.cpp"
-
-FILE * fOut = NULL;
-void ptSwap();
-
-static char gCurrentTestName[1024];
-static uint32_t gWidth = 0;
-static uint32_t gHeight = 0;
-
-static void checkGlError(const char* op) {
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- ALOGE("after %s() glError (0x%x)\n", op, error);
- }
-}
-
-GLuint loadShader(GLenum shaderType, const char* pSource) {
- GLuint shader = glCreateShader(shaderType);
- if (shader) {
- glShaderSource(shader, 1, &pSource, NULL);
- glCompileShader(shader);
- GLint compiled = 0;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
- if (!compiled) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf) {
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- ALOGE("Could not compile shader %d:\n%s\n", shaderType, buf);
- free(buf);
- }
- glDeleteShader(shader);
- shader = 0;
- }
- }
- }
- return shader;
-}
-
-enum {
- A_POS,
- A_COLOR,
- A_TEX0,
- A_TEX1
-};
-
-GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
- GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
- if (!vertexShader) {
- return 0;
- }
-
- GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
- if (!pixelShader) {
- return 0;
- }
-
- GLuint program = glCreateProgram();
- if (program) {
- glAttachShader(program, vertexShader);
- checkGlError("glAttachShader v");
- glAttachShader(program, pixelShader);
- checkGlError("glAttachShader p");
-
- glBindAttribLocation(program, A_POS, "a_pos");
- glBindAttribLocation(program, A_COLOR, "a_color");
- glBindAttribLocation(program, A_TEX0, "a_tex0");
- glBindAttribLocation(program, A_TEX1, "a_tex1");
- glLinkProgram(program);
- GLint linkStatus = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
- if (linkStatus != GL_TRUE) {
- GLint bufLength = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
- if (bufLength) {
- char* buf = (char*) malloc(bufLength);
- if (buf) {
- glGetProgramInfoLog(program, bufLength, NULL, buf);
- ALOGE("Could not link program:\n%s\n", buf);
- free(buf);
- }
- }
- glDeleteProgram(program);
- program = 0;
- }
- }
- checkGlError("createProgram");
- glUseProgram(program);
- return program;
-}
-
-uint64_t getTime() {
- struct timespec t;
- clock_gettime(CLOCK_MONOTONIC, &t);
- return t.tv_nsec + ((uint64_t)t.tv_sec * 1000 * 1000 * 1000);
-}
-
-uint64_t gTime;
-void startTimer() {
- gTime = getTime();
-}
-
-
-static void endTimer(int count) {
- uint64_t t2 = getTime();
- double delta = ((double)(t2 - gTime)) / 1000000000;
- double pixels = (gWidth * gHeight) * count;
- double mpps = pixels / delta / 1000000;
- double dc60 = ((double)count) / delta / 60;
-
- if (fOut) {
- fprintf(fOut, "%s, %f, %f\r\n", gCurrentTestName, mpps, dc60);
- fflush(fOut);
- } else {
- printf("%s, %f, %f\n", gCurrentTestName, mpps, dc60);
- }
- ALOGI("%s, %f, %f\r\n", gCurrentTestName, mpps, dc60);
-}
-
-
-static const char gVertexShader[] =
- "attribute vec4 a_pos;\n"
- "attribute vec4 a_color;\n"
- "attribute vec2 a_tex0;\n"
- "attribute vec2 a_tex1;\n"
- "varying vec4 v_color;\n"
- "varying vec2 v_tex0;\n"
- "varying vec2 v_tex1;\n"
- "uniform vec2 u_texOff;\n"
-
- "void main() {\n"
- " v_color = a_color;\n"
- " v_tex0 = a_tex0;\n"
- " v_tex1 = a_tex1;\n"
- " v_tex0.x += u_texOff.x;\n"
- " v_tex1.y += u_texOff.y;\n"
- " gl_Position = a_pos;\n"
- "}\n";
-
-static void setupVA() {
- static const float vtx[] = {
- -1.0f,-1.0f,
- 1.0f,-1.0f,
- -1.0f, 1.0f,
- 1.0f, 1.0f };
- static const float color[] = {
- 1.0f,0.0f,1.0f,1.0f,
- 0.0f,0.0f,1.0f,1.0f,
- 1.0f,1.0f,0.0f,1.0f,
- 1.0f,1.0f,1.0f,1.0f };
- static const float tex0[] = {
- 0.0f,0.0f,
- 1.0f,0.0f,
- 0.0f,1.0f,
- 1.0f,1.0f };
- static const float tex1[] = {
- 1.0f,0.0f,
- 1.0f,1.0f,
- 0.0f,1.0f,
- 0.0f,0.0f };
-
- glEnableVertexAttribArray(A_POS);
- glEnableVertexAttribArray(A_COLOR);
- glEnableVertexAttribArray(A_TEX0);
- glEnableVertexAttribArray(A_TEX1);
-
- glVertexAttribPointer(A_POS, 2, GL_FLOAT, false, 8, vtx);
- glVertexAttribPointer(A_COLOR, 4, GL_FLOAT, false, 16, color);
- glVertexAttribPointer(A_TEX0, 2, GL_FLOAT, false, 8, tex0);
- glVertexAttribPointer(A_TEX1, 2, GL_FLOAT, false, 8, tex1);
-}
-
-static void randUniform(int pgm, const char *var) {
- int loc = glGetUniformLocation(pgm, var);
- if (loc >= 0) {
- float x = ((float)rand()) / RAND_MAX;
- float y = ((float)rand()) / RAND_MAX;
- float z = ((float)rand()) / RAND_MAX;
- float w = ((float)rand()) / RAND_MAX;
- glUniform4f(loc, x, y, z, w);
- }
-}
-
-static void doLoop(bool warmup, int pgm, uint32_t passCount) {
- if (warmup) {
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- ptSwap();
- glFinish();
- return;
- }
-
- startTimer();
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- for (uint32_t ct=0; ct < passCount; ct++) {
- int loc = glGetUniformLocation(pgm, "u_texOff");
- glUniform2f(loc, ((float)ct) / passCount, ((float)ct) / 2.f / passCount);
-
- randUniform(pgm, "u_color");
- randUniform(pgm, "u_0");
- randUniform(pgm, "u_1");
- randUniform(pgm, "u_2");
- randUniform(pgm, "u_3");
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- }
- ptSwap();
- glFinish();
- endTimer(passCount);
-}
-
-
-static uint32_t rgb(uint32_t r, uint32_t g, uint32_t b)
-{
- uint32_t ret = 0xff000000;
- ret |= r & 0xff;
- ret |= (g & 0xff) << 8;
- ret |= (b & 0xff) << 16;
- return ret;
-}
-
-void genTextures() {
- uint32_t *m = (uint32_t *)malloc(1024*1024*4);
- for (int y=0; y < 1024; y++){
- for (int x=0; x < 1024; x++){
- m[y*1024 + x] = rgb(x, (((x+y) & 0xff) == 0x7f) * 0xff, y);
- }
- }
- glBindTexture(GL_TEXTURE_2D, 1);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1024, 1024, 0, GL_RGBA, GL_UNSIGNED_BYTE, m);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
-
- for (int y=0; y < 16; y++){
- for (int x=0; x < 16; x++){
- m[y*16 + x] = rgb(x << 4, (((x+y) & 0xf) == 0x7) * 0xff, y << 4);
- }
- }
- glBindTexture(GL_TEXTURE_2D, 2);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, m);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- free(m);
-}
-
-static void doSingleTest(uint32_t pgmNum, int tex) {
- const char *pgmTxt = gFragmentTests[pgmNum]->txt;
- int pgm = createProgram(gVertexShader, pgmTxt);
- if (!pgm) {
- printf("error running test\n");
- return;
- }
- int loc = glGetUniformLocation(pgm, "u_tex0");
- if (loc >= 0) glUniform1i(loc, 0);
- loc = glGetUniformLocation(pgm, "u_tex1");
- if (loc >= 0) glUniform1i(loc, 1);
-
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, tex);
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, tex);
- glActiveTexture(GL_TEXTURE0);
-
- glBlendFunc(GL_ONE, GL_ONE);
- glDisable(GL_BLEND);
- //sprintf(str2, "%i, %i, %i, %i, %i, 0",
- //useVarColor, texCount, modulateFirstTex, extraMath, tex0);
- //doLoop(true, pgm, w, h, str2);
- //doLoop(false, pgm, w, h, str2);
-
- glEnable(GL_BLEND);
- sprintf(gCurrentTestName, "%s, %i, %i, 1", gFragmentTests[pgmNum]->name, pgmNum, tex);
- doLoop(true, pgm, 100);
- doLoop(false, pgm, 100);
-}
-
diff --git a/opengl/tests/gl_perf/filltest.cpp b/opengl/tests/gl_perf/filltest.cpp
deleted file mode 100644
index 3f8faca..0000000
--- a/opengl/tests/gl_perf/filltest.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <sched.h>
-#include <sys/resource.h>
-#include <string.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#include <utils/Timers.h>
-#include <EGL/egl.h>
-#include <utils/Log.h>
-
-
-using namespace android;
-
-
-#include "fill_common.cpp"
-
-
-bool doTest(uint32_t w, uint32_t h) {
- gWidth = w;
- gHeight = h;
- setupVA();
- genTextures();
-
- printf("\nvarColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\n");
-
- for (uint32_t num = 0; num < gFragmentTestCount; num++) {
- doSingleTest(num, 2);
- if (gFragmentTests[num]->texCount) {
- doSingleTest(num, 1);
- }
- }
-
- exit(0);
- return true;
-}
diff --git a/opengl/tests/gl_perf/fragment_shaders.cpp b/opengl/tests/gl_perf/fragment_shaders.cpp
deleted file mode 100644
index 79d5ead..0000000
--- a/opengl/tests/gl_perf/fragment_shaders.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-
-typedef struct FragmentTestRec {
- const char * name;
- uint32_t texCount;
- const char * txt;
-} FragmentTest;
-
-static FragmentTest fpFill = {
- "Solid color", 0,
-
- "precision mediump float;\n"
- "uniform vec4 u_color;\n"
- "void main() {\n"
- " gl_FragColor = u_color;\n"
- "}\n"
-};
-
-static FragmentTest fpGradient = {
- "Solid gradient", 0,
-
- "precision mediump float;\n"
- "varying lowp vec4 v_color;\n"
- "void main() {\n"
- " gl_FragColor = v_color;\n"
- "}\n"
-};
-
-static FragmentTest fpCopyTex = {
- "Texture copy", 1,
-
- "precision mediump float;\n"
- "varying vec2 v_tex0;\n"
- "uniform sampler2D u_tex0;\n"
- "void main() {\n"
- " gl_FragColor = texture2D(u_tex0, v_tex0);\n"
- "}\n"
-};
-
-static FragmentTest fpCopyTexGamma = {
- "Texture copy with gamma", 1,
-
- "precision mediump float;\n"
- "varying vec2 v_tex0;\n"
- "uniform sampler2D u_tex0;\n"
- "void main() {\n"
- " vec4 t = texture2D(u_tex0, v_tex0);\n"
- " t.rgb = pow(t.rgb, vec3(1.4, 1.4, 1.4));\n"
- " gl_FragColor = t;\n"
- "}\n"
-};
-
-static FragmentTest fpTexSpec = {
- "Texture spec", 1,
-
- "precision mediump float;\n"
- "varying vec2 v_tex0;\n"
- "uniform sampler2D u_tex0;\n"
- "void main() {\n"
- " vec4 t = texture2D(u_tex0, v_tex0);\n"
- " float simSpec = dot(gl_FragCoord.xyz, gl_FragCoord.xyz);\n"
- " simSpec = pow(clamp(simSpec, 0.1, 1.0), 40.0);\n"
- " gl_FragColor = t + vec4(simSpec, simSpec, simSpec, simSpec);\n"
- "}\n"
-};
-
-static FragmentTest fpDepTex = {
- "Dependent Lookup", 1,
-
- "precision mediump float;\n"
- "varying vec2 v_tex0;\n"
- "uniform sampler2D u_tex0;\n"
- "void main() {\n"
- " vec4 t = texture2D(u_tex0, v_tex0);\n"
- " t += texture2D(u_tex0, t.xy);\n"
- " gl_FragColor = t;\n"
- "}\n"
-};
-
-static FragmentTest fpModulateConstantTex = {
- "Texture modulate constant", 1,
-
- "precision mediump float;\n"
- "varying vec2 v_tex0;\n"
- "uniform sampler2D u_tex0;\n"
- "uniform vec4 u_color;\n"
-
- "void main() {\n"
- " lowp vec4 c = texture2D(u_tex0, v_tex0);\n"
- " c *= u_color;\n"
- " gl_FragColor = c;\n"
- "}\n"
-};
-
-static FragmentTest fpModulateVaryingTex = {
- "Texture modulate gradient", 1,
-
- "precision mediump float;\n"
- "varying vec2 v_tex0;\n"
- "varying lowp vec4 v_color;\n"
- "uniform sampler2D u_tex0;\n"
-
- "void main() {\n"
- " lowp vec4 c = texture2D(u_tex0, v_tex0);\n"
- " c *= v_color;\n"
- " gl_FragColor = c;\n"
- "}\n"
-};
-
-static FragmentTest fpModulateVaryingConstantTex = {
- "Texture modulate gradient constant", 1,
-
- "precision mediump float;\n"
- "varying vec2 v_tex0;\n"
- "varying lowp vec4 v_color;\n"
- "uniform sampler2D u_tex0;\n"
- "uniform vec4 u_color;\n"
-
- "void main() {\n"
- " lowp vec4 c = texture2D(u_tex0, v_tex0);\n"
- " c *= v_color;\n"
- " c *= u_color;\n"
- " gl_FragColor = c;\n"
- "}\n"
-};
-
-static FragmentTest *gFragmentTests[] = {
- &fpFill,
- &fpGradient,
- &fpCopyTex,
- &fpCopyTexGamma,
- &fpTexSpec,
- &fpDepTex,
- &fpModulateConstantTex,
- &fpModulateVaryingTex,
- &fpModulateVaryingConstantTex,
-
-};
-
-static const size_t gFragmentTestCount = sizeof(gFragmentTests) / sizeof(gFragmentTests[0]);
diff --git a/opengl/tests/gl_perf/gl2_perf.cpp b/opengl/tests/gl_perf/gl2_perf.cpp
deleted file mode 100644
index 224acaf..0000000
--- a/opengl/tests/gl_perf/gl2_perf.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <sched.h>
-#include <sys/resource.h>
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <utils/Timers.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-
-static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE) {
- if (returnVal != EGL_TRUE) {
- fprintf(stderr, "%s() returned %d\n", op, returnVal);
- }
-
- for (EGLint error = eglGetError(); error != EGL_SUCCESS; error
- = eglGetError()) {
- fprintf(stderr, "after %s() eglError %s (0x%x)\n", op, EGLUtils::strerror(error),
- error);
- }
-}
-
-static void checkGlError(const char* op) {
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- fprintf(stderr, "after %s() glError (0x%x)\n", op, error);
- }
-}
-
-bool doTest(uint32_t w, uint32_t h);
-
-static EGLDisplay dpy;
-static EGLSurface surface;
-
-int main(int argc, char** argv) {
- EGLBoolean returnValue;
- EGLConfig myConfig = {0};
-
- EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
- EGLint s_configAttribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_NONE };
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLint w, h;
-
-
- checkEglError("<init>");
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- checkEglError("eglGetDisplay");
- if (dpy == EGL_NO_DISPLAY) {
- printf("eglGetDisplay returned EGL_NO_DISPLAY.\n");
- return 0;
- }
-
- returnValue = eglInitialize(dpy, &majorVersion, &minorVersion);
- checkEglError("eglInitialize", returnValue);
- if (returnValue != EGL_TRUE) {
- printf("eglInitialize failed\n");
- return 0;
- }
-
- EGLNativeWindowType window = android_createDisplaySurface();
- returnValue = EGLUtils::selectConfigForNativeWindow(dpy, s_configAttribs, window, &myConfig);
- if (returnValue) {
- printf("EGLUtils::selectConfigForNativeWindow() returned %d", returnValue);
- return 0;
- }
-
- checkEglError("EGLUtils::selectConfigForNativeWindow");
-
- surface = eglCreateWindowSurface(dpy, myConfig, window, NULL);
- checkEglError("eglCreateWindowSurface");
- if (surface == EGL_NO_SURFACE) {
- printf("gelCreateWindowSurface failed.\n");
- return 0;
- }
-
- context = eglCreateContext(dpy, myConfig, EGL_NO_CONTEXT, context_attribs);
- checkEglError("eglCreateContext");
- if (context == EGL_NO_CONTEXT) {
- printf("eglCreateContext failed\n");
- return 0;
- }
- returnValue = eglMakeCurrent(dpy, surface, surface, context);
- checkEglError("eglMakeCurrent", returnValue);
- if (returnValue != EGL_TRUE) {
- return 0;
- }
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- checkEglError("eglQuerySurface");
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
- checkEglError("eglQuerySurface");
- GLint dim = w < h ? w : h;
-
- glViewport(0, 0, w, h);
-
- for (;;) {
- doTest(w, h);
- eglSwapBuffers(dpy, surface);
- checkEglError("eglSwapBuffers");
- }
-
- return 0;
-}
-
-void ptSwap() {
- eglSwapBuffers(dpy, surface);
-}
-
diff --git a/opengl/tests/gl_perfapp/Android.mk b/opengl/tests/gl_perfapp/Android.mk
deleted file mode 100644
index 65e50e9..0000000
--- a/opengl/tests/gl_perfapp/Android.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#########################################################################
-# OpenGL ES Perf App
-# This makefile builds both an activity and a shared library.
-#########################################################################
-TOP_LOCAL_PATH:= $(call my-dir)
-
-# Build activity
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := GLPerf
-
-LOCAL_JNI_SHARED_LIBRARIES := libglperf
-
-# Run on Eclair
-LOCAL_SDK_VERSION := 7
-
-include $(BUILD_PACKAGE)
-
-#########################################################################
-# Build JNI Shared Library
-#########################################################################
-
-LOCAL_PATH:= $(LOCAL_PATH)/jni
-
-include $(CLEAR_VARS)
-
-# Optional tag would mean it doesn't get installed by default
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -Werror
-
-LOCAL_SRC_FILES:= \
- gl_code.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- libEGL \
- libGLESv2
-
-LOCAL_MODULE := libglperf
-
-
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/opengl/tests/gl_perfapp/AndroidManifest.xml b/opengl/tests/gl_perfapp/AndroidManifest.xml
deleted file mode 100644
index ee4bd98..0000000
--- a/opengl/tests/gl_perfapp/AndroidManifest.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.glperf"
- android:versionName="1.0.0" android:versionCode="10000" >
- <uses-sdk android:targetSdkVersion="7" android:minSdkVersion="7" />
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <application
- android:label="@string/glperf_activity">
- <activity android:name="GLPerfActivity"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:launchMode="singleTask"
- android:configChanges="orientation|keyboardHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/gl_perfapp/jni/gl_code.cpp b/opengl/tests/gl_perfapp/jni/gl_code.cpp
deleted file mode 100644
index 2f04183..0000000
--- a/opengl/tests/gl_perfapp/jni/gl_code.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-// OpenGL ES 2.0 code
-
-#include <nativehelper/jni.h>
-#define LOG_TAG "GLPerf gl_code.cpp"
-#include <utils/Log.h>
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#include <utils/Timers.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include "../../gl_perf/fill_common.cpp"
-
-
-//////////////////////////
-
-// Width and height of the screen
-
-uint32_t w;
-uint32_t h;
-
-// The stateClock starts at zero and increments by 1 every time we draw a frame. It is used to control which phase of the test we are in.
-
-int stateClock;
-const int doLoopStates = 2;
-const int doSingleTestStates = 2;
-bool done;
-
-// Saves the parameters of the test (so we can print them out when we finish the timing.)
-
-
-int pgm;
-
-void ptSwap() {
-}
-
-void doTest() {
- uint32_t testNum = stateClock >> 2;
- int texSize = ((stateClock >> 1) & 0x1) + 1;
-
- if (testNum >= gFragmentTestCount) {
- ALOGI("done\n");
- if (fOut) {
- fclose(fOut);
- fOut = NULL;
- }
- done = true;
- return;
- }
-
- // ALOGI("doTest %d %d %d\n", texCount, extraMath, testSubState);
-
-// for (uint32_t num = 0; num < gFragmentTestCount; num++) {
- doSingleTest(testNum, texSize);
-}
-
-extern "C" {
- JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_init(JNIEnv * env, jobject obj, jint width, jint height);
- JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_step(JNIEnv * env, jobject obj);
-};
-
-JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_init(JNIEnv * env, jobject obj, jint width, jint height)
-{
- gWidth = width;
- gHeight = height;
- if (!done) {
- stateClock = 0;
- done = false;
- setupVA();
- genTextures();
- const char* fileName = "/sdcard/glperf.csv";
- if (fOut != NULL) {
- ALOGI("Closing partially written output.n");
- fclose(fOut);
- fOut = NULL;
- }
- ALOGI("Writing to: %s\n",fileName);
- fOut = fopen(fileName, "w");
- if (fOut == NULL) {
- ALOGE("Could not open: %s\n", fileName);
- }
-
- ALOGI("\nvarColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\n");
- if (fOut) fprintf(fOut,"varColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\r\n");
- }
-}
-
-JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_step(JNIEnv * env, jobject obj)
-{
- if (! done) {
- if (stateClock > 0 && ((stateClock & 1) == 0)) {
- //endTimer(100);
- }
- doTest();
- stateClock++;
- } else {
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- }
-}
diff --git a/opengl/tests/gl_perfapp/res/values/strings.xml b/opengl/tests/gl_perfapp/res/values/strings.xml
deleted file mode 100644
index 52cd961..0000000
--- a/opengl/tests/gl_perfapp/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2006 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.
--->
-
-<!-- This file contains resource definitions for displayed strings, allowing
- them to be changed based on the locale and options. -->
-
-<resources>
- <!-- Simple strings. -->
- <string name="glperf_activity">GLPerf</string>
-
-</resources>
-
diff --git a/opengl/tests/gl_perfapp/src/com/android/glperf/GLPerfActivity.java b/opengl/tests/gl_perfapp/src/com/android/glperf/GLPerfActivity.java
deleted file mode 100644
index e3f3abf..0000000
--- a/opengl/tests/gl_perfapp/src/com/android/glperf/GLPerfActivity.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007 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.glperf;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.WindowManager;
-
-import java.io.File;
-
-
-public class GLPerfActivity extends Activity {
-
- GLPerfView mView;
-
- @Override protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- mView = new GLPerfView(getApplication());
- setContentView(mView);
- }
-
- @Override protected void onPause() {
- super.onPause();
- mView.onPause();
- }
-
- @Override protected void onResume() {
- super.onResume();
- mView.onResume();
- }
-}
diff --git a/opengl/tests/gl_perfapp/src/com/android/glperf/GLPerfLib.java b/opengl/tests/gl_perfapp/src/com/android/glperf/GLPerfLib.java
deleted file mode 100644
index 89a0e54..0000000
--- a/opengl/tests/gl_perfapp/src/com/android/glperf/GLPerfLib.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2007 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.glperf;
-
-// Wrapper for native library
-
-public class GLPerfLib {
-
- static {
- System.loadLibrary("glperf");
- }
-
- /**
- * @param width the current view width
- * @param height the current view height
- */
- public static native void init(int width, int height);
- public static native void step();
-}
diff --git a/opengl/tests/gl_perfapp/src/com/android/glperf/GLPerfView.java b/opengl/tests/gl_perfapp/src/com/android/glperf/GLPerfView.java
deleted file mode 100644
index 4ce4a4d..0000000
--- a/opengl/tests/gl_perfapp/src/com/android/glperf/GLPerfView.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (C) 2009 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.glperf;
-/*
- * Copyright (C) 2008 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.
- */
-
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.GL10;
-
-/**
- * An implementation of SurfaceView that uses the dedicated surface for
- * displaying an OpenGL animation. This allows the animation to run in a
- * separate thread, without requiring that it be driven by the update mechanism
- * of the view hierarchy.
- *
- * The application-specific rendering code is delegated to a GLView.Renderer
- * instance.
- */
-class GLPerfView extends GLSurfaceView {
- private static String TAG = "GLPerfView";
-
- public GLPerfView(Context context) {
- super(context);
- init(false, 0, 0);
- }
-
- public GLPerfView(Context context, boolean translucent, int depth, int stencil) {
- super(context);
- init(translucent, depth, stencil);
- }
-
- private void init(boolean translucent, int depth, int stencil) {
- setEGLContextFactory(new ContextFactory());
- setEGLConfigChooser( translucent ?
- new ConfigChooser(8,8,8,8, depth, stencil) :
- new ConfigChooser(5,6,5,0, depth, stencil));
- setRenderer(new Renderer());
- }
-
- private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
- private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
- public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
- Log.w(TAG, "creating OpenGL ES 2.0 context");
- checkEglError("Before eglCreateContext", egl);
- int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
- EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
- checkEglError("After eglCreateContext", egl);
- return context;
- }
-
- public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) {
- egl.eglDestroyContext(display, context);
- }
- }
-
- private static void checkEglError(String prompt, EGL10 egl) {
- int error;
- while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
- Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));
- }
- }
-
- private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser {
- private static int EGL_OPENGL_ES2_BIT = 4;
- private static int[] s_configAttribs2 =
- {
- EGL10.EGL_RED_SIZE, 4,
- EGL10.EGL_GREEN_SIZE, 4,
- EGL10.EGL_BLUE_SIZE, 4,
- EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL10.EGL_NONE
- };
-
- public ConfigChooser(int r, int g, int b, int a, int depth, int stencil) {
- mRedSize = r;
- mGreenSize = g;
- mBlueSize = b;
- mAlphaSize = a;
- mDepthSize = depth;
- mStencilSize = stencil;
- }
-
- public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
-
- int[] num_config = new int[1];
- egl.eglChooseConfig(display, s_configAttribs2, null, 0, num_config);
-
- int numConfigs = num_config[0];
-
- if (numConfigs <= 0) {
- throw new IllegalArgumentException("No configs match configSpec");
- }
- EGLConfig[] configs = new EGLConfig[numConfigs];
- egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config);
- // printConfigs(egl, display, configs);
- return chooseConfig(egl, display, configs);
- }
-
- public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display,
- EGLConfig[] configs) {
- EGLConfig closestConfig = null;
- int closestDistance = 1000;
- for(EGLConfig config : configs) {
- int d = findConfigAttrib(egl, display, config,
- EGL10.EGL_DEPTH_SIZE, 0);
- int s = findConfigAttrib(egl, display, config,
- EGL10.EGL_STENCIL_SIZE, 0);
- if (d >= mDepthSize && s>= mStencilSize) {
- int r = findConfigAttrib(egl, display, config,
- EGL10.EGL_RED_SIZE, 0);
- int g = findConfigAttrib(egl, display, config,
- EGL10.EGL_GREEN_SIZE, 0);
- int b = findConfigAttrib(egl, display, config,
- EGL10.EGL_BLUE_SIZE, 0);
- int a = findConfigAttrib(egl, display, config,
- EGL10.EGL_ALPHA_SIZE, 0);
- int distance = Math.abs(r - mRedSize)
- + Math.abs(g - mGreenSize)
- + Math.abs(b - mBlueSize)
- + Math.abs(a - mAlphaSize);
- if (distance < closestDistance) {
- closestDistance = distance;
- closestConfig = config;
- }
- }
- }
- return closestConfig;
- }
-
- private int findConfigAttrib(EGL10 egl, EGLDisplay display,
- EGLConfig config, int attribute, int defaultValue) {
-
- if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
- return mValue[0];
- }
- return defaultValue;
- }
-
- private void printConfigs(EGL10 egl, EGLDisplay display,
- EGLConfig[] configs) {
- int numConfigs = configs.length;
- Log.w(TAG, String.format("%d configurations", numConfigs));
- for (int i = 0; i < numConfigs; i++) {
- Log.w(TAG, String.format("Configuration %d:\n", i));
- printConfig(egl, display, configs[i]);
- }
- }
-
- private void printConfig(EGL10 egl, EGLDisplay display,
- EGLConfig config) {
- int[] attributes = {
- EGL10.EGL_BUFFER_SIZE,
- EGL10.EGL_ALPHA_SIZE,
- EGL10.EGL_BLUE_SIZE,
- EGL10.EGL_GREEN_SIZE,
- EGL10.EGL_RED_SIZE,
- EGL10.EGL_DEPTH_SIZE,
- EGL10.EGL_STENCIL_SIZE,
- EGL10.EGL_CONFIG_CAVEAT,
- EGL10.EGL_CONFIG_ID,
- EGL10.EGL_LEVEL,
- EGL10.EGL_MAX_PBUFFER_HEIGHT,
- EGL10.EGL_MAX_PBUFFER_PIXELS,
- EGL10.EGL_MAX_PBUFFER_WIDTH,
- EGL10.EGL_NATIVE_RENDERABLE,
- EGL10.EGL_NATIVE_VISUAL_ID,
- EGL10.EGL_NATIVE_VISUAL_TYPE,
- 0x3030, // EGL10.EGL_PRESERVED_RESOURCES,
- EGL10.EGL_SAMPLES,
- EGL10.EGL_SAMPLE_BUFFERS,
- EGL10.EGL_SURFACE_TYPE,
- EGL10.EGL_TRANSPARENT_TYPE,
- EGL10.EGL_TRANSPARENT_RED_VALUE,
- EGL10.EGL_TRANSPARENT_GREEN_VALUE,
- EGL10.EGL_TRANSPARENT_BLUE_VALUE,
- 0x3039, // EGL10.EGL_BIND_TO_TEXTURE_RGB,
- 0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGBA,
- 0x303B, // EGL10.EGL_MIN_SWAP_INTERVAL,
- 0x303C, // EGL10.EGL_MAX_SWAP_INTERVAL,
- EGL10.EGL_LUMINANCE_SIZE,
- EGL10.EGL_ALPHA_MASK_SIZE,
- EGL10.EGL_COLOR_BUFFER_TYPE,
- EGL10.EGL_RENDERABLE_TYPE,
- 0x3042 // EGL10.EGL_CONFORMANT
- };
- String[] names = {
- "EGL_BUFFER_SIZE",
- "EGL_ALPHA_SIZE",
- "EGL_BLUE_SIZE",
- "EGL_GREEN_SIZE",
- "EGL_RED_SIZE",
- "EGL_DEPTH_SIZE",
- "EGL_STENCIL_SIZE",
- "EGL_CONFIG_CAVEAT",
- "EGL_CONFIG_ID",
- "EGL_LEVEL",
- "EGL_MAX_PBUFFER_HEIGHT",
- "EGL_MAX_PBUFFER_PIXELS",
- "EGL_MAX_PBUFFER_WIDTH",
- "EGL_NATIVE_RENDERABLE",
- "EGL_NATIVE_VISUAL_ID",
- "EGL_NATIVE_VISUAL_TYPE",
- "EGL_PRESERVED_RESOURCES",
- "EGL_SAMPLES",
- "EGL_SAMPLE_BUFFERS",
- "EGL_SURFACE_TYPE",
- "EGL_TRANSPARENT_TYPE",
- "EGL_TRANSPARENT_RED_VALUE",
- "EGL_TRANSPARENT_GREEN_VALUE",
- "EGL_TRANSPARENT_BLUE_VALUE",
- "EGL_BIND_TO_TEXTURE_RGB",
- "EGL_BIND_TO_TEXTURE_RGBA",
- "EGL_MIN_SWAP_INTERVAL",
- "EGL_MAX_SWAP_INTERVAL",
- "EGL_LUMINANCE_SIZE",
- "EGL_ALPHA_MASK_SIZE",
- "EGL_COLOR_BUFFER_TYPE",
- "EGL_RENDERABLE_TYPE",
- "EGL_CONFORMANT"
- };
- int[] value = new int[1];
- for (int i = 0; i < attributes.length; i++) {
- int attribute = attributes[i];
- String name = names[i];
- if ( egl.eglGetConfigAttrib(display, config, attribute, value)) {
- Log.w(TAG, String.format(" %s: %d\n", name, value[0]));
- } else {
- // Log.w(TAG, String.format(" %s: failed\n", name));
- while (egl.eglGetError() != EGL10.EGL_SUCCESS);
- }
- }
- }
-
- // Subclasses can adjust these values:
- protected int mRedSize;
- protected int mGreenSize;
- protected int mBlueSize;
- protected int mAlphaSize;
- protected int mDepthSize;
- protected int mStencilSize;
- private int[] mValue = new int[1];
- }
-
- private static class Renderer implements GLSurfaceView.Renderer {
- public void onDrawFrame(GL10 gl) {
- GLPerfLib.step();
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- GLPerfLib.init(width, height);
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- // Do nothing.
- }
- }
-}
-
diff --git a/opengl/tests/gl_yuvtex/Android.mk b/opengl/tests/gl_yuvtex/Android.mk
deleted file mode 100644
index 9e5dba0..0000000
--- a/opengl/tests/gl_yuvtex/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- gl_yuvtex.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv1_CM \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-gl_yuvtex
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/gl_yuvtex/gl_yuvtex.cpp b/opengl/tests/gl_yuvtex/gl_yuvtex.cpp
deleted file mode 100644
index 7a00f76..0000000
--- a/opengl/tests/gl_yuvtex/gl_yuvtex.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <sched.h>
-#include <sys/resource.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <utils/Timers.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include <ui/GraphicBuffer.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-static void printGLString(const char *name, GLenum s) {
- // fprintf(stderr, "printGLString %s, %d\n", name, s);
- const char *v = (const char *) glGetString(s);
- // int error = glGetError();
- // fprintf(stderr, "glGetError() = %d, result of glGetString = %x\n", error,
- // (unsigned int) v);
- // if ((v < (const char*) 0) || (v > (const char*) 0x10000))
- // fprintf(stderr, "GL %s = %s\n", name, v);
- // else
- // fprintf(stderr, "GL %s = (null) 0x%08x\n", name, (unsigned int) v);
- fprintf(stderr, "GL %s = %s\n", name, v);
-}
-
-static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE) {
- if (returnVal != EGL_TRUE) {
- fprintf(stderr, "%s() returned %d\n", op, returnVal);
- }
-
- for (EGLint error = eglGetError(); error != EGL_SUCCESS; error
- = eglGetError()) {
- fprintf(stderr, "after %s() eglError %s (0x%x)\n", op, EGLUtils::strerror(error),
- error);
- }
-}
-
-static void checkGlError(const char* op) {
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- fprintf(stderr, "after %s() glError (0x%x)\n", op, error);
- }
-}
-
-bool setupGraphics(int w, int h) {
- glViewport(0, 0, w, h);
- checkGlError("glViewport");
- return true;
-}
-
-int align(int x, int a) {
- return (x + (a-1)) & (~(a-1));
-}
-
-const int yuvTexWidth = 600;
-const int yuvTexHeight = 480;
-const int yuvTexUsage = GraphicBuffer::USAGE_HW_TEXTURE |
- GraphicBuffer::USAGE_SW_WRITE_RARELY;
-const int yuvTexFormat = HAL_PIXEL_FORMAT_YV12;
-const int yuvTexOffsetY = 0;
-const int yuvTexStrideY = (yuvTexWidth + 0xf) & ~0xf;
-const int yuvTexOffsetV = yuvTexStrideY * yuvTexHeight;
-const int yuvTexStrideV = (yuvTexStrideY/2 + 0xf) & ~0xf;
-const int yuvTexOffsetU = yuvTexOffsetV + yuvTexStrideV * yuvTexHeight/2;
-const int yuvTexStrideU = yuvTexStrideV;
-const bool yuvTexSameUV = false;
-static sp<GraphicBuffer> yuvTexBuffer;
-static GLuint yuvTex;
-
-bool setupYuvTexSurface(EGLDisplay dpy, EGLContext context) {
- int blockWidth = yuvTexWidth > 16 ? yuvTexWidth / 16 : 1;
- int blockHeight = yuvTexHeight > 16 ? yuvTexHeight / 16 : 1;
- yuvTexBuffer = new GraphicBuffer(yuvTexWidth, yuvTexHeight, yuvTexFormat,
- yuvTexUsage);
- char* buf = NULL;
- status_t err = yuvTexBuffer->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&buf));
- if (err != 0) {
- fprintf(stderr, "yuvTexBuffer->lock(...) failed: %d\n", err);
- return false;
- }
- for (int x = 0; x < yuvTexWidth; x++) {
- for (int y = 0; y < yuvTexHeight; y++) {
- int parityX = (x / blockWidth) & 1;
- int parityY = (y / blockHeight) & 1;
- unsigned char intensity = (parityX ^ parityY) ? 63 : 191;
- buf[yuvTexOffsetY + (y * yuvTexStrideY) + x] = intensity;
- if (x < yuvTexWidth / 2 && y < yuvTexHeight / 2) {
- buf[yuvTexOffsetU + (y * yuvTexStrideU) + x] = intensity;
- if (yuvTexSameUV) {
- buf[yuvTexOffsetV + (y * yuvTexStrideV) + x] = intensity;
- } else if (x < yuvTexWidth / 4 && y < yuvTexHeight / 4) {
- buf[yuvTexOffsetV + (y*2 * yuvTexStrideV) + x*2 + 0] =
- buf[yuvTexOffsetV + (y*2 * yuvTexStrideV) + x*2 + 1] =
- buf[yuvTexOffsetV + ((y*2+1) * yuvTexStrideV) + x*2 + 0] =
- buf[yuvTexOffsetV + ((y*2+1) * yuvTexStrideV) + x*2 + 1] = intensity;
- }
- }
- }
- }
-
- err = yuvTexBuffer->unlock();
- if (err != 0) {
- fprintf(stderr, "yuvTexBuffer->unlock() failed: %d\n", err);
- return false;
- }
-
- EGLClientBuffer clientBuffer = (EGLClientBuffer)yuvTexBuffer->getNativeBuffer();
- EGLImageKHR img = eglCreateImageKHR(dpy, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID,
- clientBuffer, 0);
- checkEglError("eglCreateImageKHR");
- if (img == EGL_NO_IMAGE_KHR) {
- return false;
- }
-
- glGenTextures(1, &yuvTex);
- checkGlError("glGenTextures");
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, yuvTex);
- checkGlError("glBindTexture");
- glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)img);
- checkGlError("glEGLImageTargetTexture2DOES");
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- checkGlError("glTexParameteri");
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- checkGlError("glTexParameteri");
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- checkGlError("glTexEnvx");
-
- GLint crop[4] = { 0, 0, yuvTexWidth, yuvTexHeight };
- glTexParameteriv(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_CROP_RECT_OES, crop);
- checkGlError("glTexParameteriv");
-
- return true;
-}
-
-void renderFrame(int w, int h) {
- glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
- checkGlError("glClearColor");
- glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- checkGlError("glClear");
-
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, yuvTex);
- checkGlError("glBindTexture");
- glEnable(GL_TEXTURE_EXTERNAL_OES);
- checkGlError("glEnable");
-
- glDrawTexiOES(0, 0, 0, w, h);
- checkGlError("glDrawTexiOES");
-}
-
-void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) {
-
-#define X(VAL) {VAL, #VAL}
- struct {EGLint attribute; const char* name;} names[] = {
- X(EGL_BUFFER_SIZE),
- X(EGL_ALPHA_SIZE),
- X(EGL_BLUE_SIZE),
- X(EGL_GREEN_SIZE),
- X(EGL_RED_SIZE),
- X(EGL_DEPTH_SIZE),
- X(EGL_STENCIL_SIZE),
- X(EGL_CONFIG_CAVEAT),
- X(EGL_CONFIG_ID),
- X(EGL_LEVEL),
- X(EGL_MAX_PBUFFER_HEIGHT),
- X(EGL_MAX_PBUFFER_PIXELS),
- X(EGL_MAX_PBUFFER_WIDTH),
- X(EGL_NATIVE_RENDERABLE),
- X(EGL_NATIVE_VISUAL_ID),
- X(EGL_NATIVE_VISUAL_TYPE),
- X(EGL_SAMPLES),
- X(EGL_SAMPLE_BUFFERS),
- X(EGL_SURFACE_TYPE),
- X(EGL_TRANSPARENT_TYPE),
- X(EGL_TRANSPARENT_RED_VALUE),
- X(EGL_TRANSPARENT_GREEN_VALUE),
- X(EGL_TRANSPARENT_BLUE_VALUE),
- X(EGL_BIND_TO_TEXTURE_RGB),
- X(EGL_BIND_TO_TEXTURE_RGBA),
- X(EGL_MIN_SWAP_INTERVAL),
- X(EGL_MAX_SWAP_INTERVAL),
- X(EGL_LUMINANCE_SIZE),
- X(EGL_ALPHA_MASK_SIZE),
- X(EGL_COLOR_BUFFER_TYPE),
- X(EGL_RENDERABLE_TYPE),
- X(EGL_CONFORMANT),
- };
-#undef X
-
- for (size_t j = 0; j < sizeof(names) / sizeof(names[0]); j++) {
- EGLint value = -1;
- EGLint returnVal = eglGetConfigAttrib(dpy, config, names[j].attribute, &value);
- EGLint error = eglGetError();
- if (returnVal && error == EGL_SUCCESS) {
- printf(" %s: ", names[j].name);
- printf("%d (0x%x)", value, value);
- }
- }
- printf("\n");
-}
-
-int main(int argc, char** argv) {
- EGLBoolean returnValue;
- EGLConfig myConfig = {0};
-
- EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 1, EGL_NONE };
- EGLint s_configAttribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
- EGL_NONE };
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLSurface surface;
- EGLint w, h;
-
- EGLDisplay dpy;
-
- checkEglError("<init>");
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- checkEglError("eglGetDisplay");
- if (dpy == EGL_NO_DISPLAY) {
- printf("eglGetDisplay returned EGL_NO_DISPLAY.\n");
- return 0;
- }
-
- returnValue = eglInitialize(dpy, &majorVersion, &minorVersion);
- checkEglError("eglInitialize", returnValue);
- fprintf(stderr, "EGL version %d.%d\n", majorVersion, minorVersion);
- if (returnValue != EGL_TRUE) {
- printf("eglInitialize failed\n");
- return 0;
- }
-
- EGLNativeWindowType window = android_createDisplaySurface();
- returnValue = EGLUtils::selectConfigForNativeWindow(dpy, s_configAttribs, window, &myConfig);
- if (returnValue) {
- printf("EGLUtils::selectConfigForNativeWindow() returned %d", returnValue);
- return 1;
- }
-
- checkEglError("EGLUtils::selectConfigForNativeWindow");
-
- printf("Chose this configuration:\n");
- printEGLConfiguration(dpy, myConfig);
-
- surface = eglCreateWindowSurface(dpy, myConfig, window, NULL);
- checkEglError("eglCreateWindowSurface");
- if (surface == EGL_NO_SURFACE) {
- printf("gelCreateWindowSurface failed.\n");
- return 1;
- }
-
- context = eglCreateContext(dpy, myConfig, EGL_NO_CONTEXT, context_attribs);
- checkEglError("eglCreateContext");
- if (context == EGL_NO_CONTEXT) {
- printf("eglCreateContext failed\n");
- return 1;
- }
- returnValue = eglMakeCurrent(dpy, surface, surface, context);
- checkEglError("eglMakeCurrent", returnValue);
- if (returnValue != EGL_TRUE) {
- return 1;
- }
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- checkEglError("eglQuerySurface");
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
- checkEglError("eglQuerySurface");
- GLint dim = w < h ? w : h;
-
- fprintf(stderr, "Window dimensions: %d x %d\n", w, h);
-
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- printGLString("Extensions", GL_EXTENSIONS);
-
- if(!setupYuvTexSurface(dpy, context)) {
- fprintf(stderr, "Could not set up texture surface.\n");
- return 1;
- }
-
- if(!setupGraphics(w, h)) {
- fprintf(stderr, "Could not set up graphics.\n");
- return 1;
- }
-
- for (;;) {
- static int dir = -1;
-
- renderFrame(w, h);
- eglSwapBuffers(dpy, surface);
- checkEglError("eglSwapBuffers");
-
- if (w <= 10 || h <= 10)
- {
- dir = -dir;
- }
-
- if (w >= 1300 || h >= 900)
- {
- dir = -dir;
- }
-
-
- w += dir;
- h += dir;
- }
-
- return 0;
-}
diff --git a/opengl/tests/gldual/Android.mk b/opengl/tests/gldual/Android.mk
deleted file mode 100644
index b4b378e..0000000
--- a/opengl/tests/gldual/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#########################################################################
-# OpenGL ES JNI sample
-# This makefile builds both an activity and a shared library.
-#########################################################################
-TOP_LOCAL_PATH:= $(call my-dir)
-
-# Build activity
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := GLDual
-
-LOCAL_JNI_SHARED_LIBRARIES := libgldualjni
-
-include $(BUILD_PACKAGE)
-
-#########################################################################
-# Build JNI Shared Library
-#########################################################################
-
-LOCAL_PATH:= $(LOCAL_PATH)/jni
-
-include $(CLEAR_VARS)
-
-# Optional tag would mean it doesn't get installed by default
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -Werror
-
-LOCAL_SRC_FILES:= \
- gl_code.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- libEGL \
- libGLESv2
-
-LOCAL_MODULE := libgldualjni
-
-
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/opengl/tests/gldual/AndroidManifest.xml b/opengl/tests/gldual/AndroidManifest.xml
deleted file mode 100644
index a36f4f7..0000000
--- a/opengl/tests/gldual/AndroidManifest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.gldual">
- <application
- android:label="@string/gldual_activity">
- <activity android:name="GLDualActivity"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:launchMode="singleTask"
- android:configChanges="orientation|keyboardHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/gldual/jni/gl_code.cpp b/opengl/tests/gldual/jni/gl_code.cpp
deleted file mode 100644
index 22867ed..0000000
--- a/opengl/tests/gldual/jni/gl_code.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-// OpenGL ES 2.0 code
-
-#include <nativehelper/jni.h>
-#define LOG_TAG "GL2JNI gl_code.cpp"
-#include <utils/Log.h>
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-static void printGLString(const char *name, GLenum s) {
- const char *v = (const char *) glGetString(s);
- ALOGI("GL %s = %s\n", name, v);
-}
-
-static void checkGlError(const char* op) {
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- ALOGI("after %s() glError (0x%x)\n", op, error);
- }
-}
-
-static const char gVertexShader[] = "attribute vec4 vPosition;\n"
- "void main() {\n"
- " gl_Position = vPosition;\n"
- "}\n";
-
-static const char gFragmentShader[] = "precision mediump float;\n"
- "void main() {\n"
- " gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n"
- "}\n";
-
-GLuint loadShader(GLenum shaderType, const char* pSource) {
- GLuint shader = glCreateShader(shaderType);
- if (shader) {
- glShaderSource(shader, 1, &pSource, NULL);
- glCompileShader(shader);
- GLint compiled = 0;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
- if (!compiled) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf) {
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- ALOGE("Could not compile shader %d:\n%s\n",
- shaderType, buf);
- free(buf);
- }
- glDeleteShader(shader);
- shader = 0;
- }
- }
- }
- return shader;
-}
-
-GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
- GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
- if (!vertexShader) {
- return 0;
- }
-
- GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
- if (!pixelShader) {
- return 0;
- }
-
- GLuint program = glCreateProgram();
- if (program) {
- glAttachShader(program, vertexShader);
- checkGlError("glAttachShader");
- glAttachShader(program, pixelShader);
- checkGlError("glAttachShader");
- glLinkProgram(program);
- GLint linkStatus = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
- if (linkStatus != GL_TRUE) {
- GLint bufLength = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
- if (bufLength) {
- char* buf = (char*) malloc(bufLength);
- if (buf) {
- glGetProgramInfoLog(program, bufLength, NULL, buf);
- ALOGE("Could not link program:\n%s\n", buf);
- free(buf);
- }
- }
- glDeleteProgram(program);
- program = 0;
- }
- }
- return program;
-}
-
-GLuint gProgram;
-GLuint gvPositionHandle;
-
-bool setupGraphics(int w, int h) {
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- printGLString("Extensions", GL_EXTENSIONS);
-
- ALOGI("setupGraphics(%d, %d)", w, h);
- gProgram = createProgram(gVertexShader, gFragmentShader);
- if (!gProgram) {
- ALOGE("Could not create program.");
- return false;
- }
- gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
- checkGlError("glGetAttribLocation");
- ALOGI("glGetAttribLocation(\"vPosition\") = %d\n",
- gvPositionHandle);
-
- glViewport(0, 0, w, h);
- checkGlError("glViewport");
- return true;
-}
-
-const GLfloat gTriangleVertices[] = { 0.0f, 0.5f, -0.5f, -0.5f,
- 0.5f, -0.5f };
-
-void renderFrame() {
- static float grey;
- grey += 0.01f;
- if (grey > 1.0f) {
- grey = 0.0f;
- }
- glClearColor(grey, grey, grey, 1.0f);
- checkGlError("glClearColor");
- glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- checkGlError("glClear");
-
- glUseProgram(gProgram);
- checkGlError("glUseProgram");
-
- glVertexAttribPointer(gvPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, gTriangleVertices);
- checkGlError("glVertexAttribPointer");
- glEnableVertexAttribArray(gvPositionHandle);
- checkGlError("glEnableVertexAttribArray");
- glDrawArrays(GL_TRIANGLES, 0, 3);
- checkGlError("glDrawArrays");
-}
-
-extern "C" {
- JNIEXPORT void JNICALL Java_com_android_gldual_GLDualLib_init(JNIEnv * env, jobject obj, jint width, jint height);
- JNIEXPORT void JNICALL Java_com_android_gldual_GLDualLib_step(JNIEnv * env, jobject obj);
-};
-
-JNIEXPORT void JNICALL Java_com_android_gldual_GLDualLib_init(JNIEnv * env, jobject obj, jint width, jint height)
-{
- setupGraphics(width, height);
-}
-
-JNIEXPORT void JNICALL Java_com_android_gldual_GLDualLib_step(JNIEnv * env, jobject obj)
-{
- renderFrame();
-}
-
diff --git a/opengl/tests/gldual/res/layout/gldual_activity.xml b/opengl/tests/gldual/res/layout/gldual_activity.xml
deleted file mode 100644
index d75acbc..0000000
--- a/opengl/tests/gldual/res/layout/gldual_activity.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text"
-
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <android.opengl.GLSurfaceView android:id="@+id/gl1"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1" />
- <com.android.gldual.GLDualGL2View android:id="@+id/gl2"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1" />
-</LinearLayout>
diff --git a/opengl/tests/gldual/res/values/strings.xml b/opengl/tests/gldual/res/values/strings.xml
deleted file mode 100644
index b1f535d..0000000
--- a/opengl/tests/gldual/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2006 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.
--->
-
-<!-- This file contains resource definitions for displayed strings, allowing
- them to be changed based on the locale and options. -->
-
-<resources>
- <!-- Simple strings. -->
- <string name="gldual_activity">GLDual</string>
-
-</resources>
-
diff --git a/opengl/tests/gldual/src/com/android/gldual/GLDualActivity.java b/opengl/tests/gldual/src/com/android/gldual/GLDualActivity.java
deleted file mode 100644
index 9d88f64..0000000
--- a/opengl/tests/gldual/src/com/android/gldual/GLDualActivity.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2007 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.gldual;
-
-import android.app.Activity;
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.LinearLayout;
-
-
-public class GLDualActivity extends Activity {
-
- GLSurfaceView mGLView;
- GLDualGL2View mGL2View;
-
- @Override protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- View root = getLayoutInflater().inflate(R.layout.gldual_activity, null);
- mGLView = (GLSurfaceView) root.findViewById(R.id.gl1);
- mGLView.setEGLConfigChooser(5,6,5,0,0,0);
- mGLView.setRenderer(new TriangleRenderer());
- mGL2View = (GLDualGL2View) root.findViewById(R.id.gl2);
- setContentView(root);
- }
-
- @Override protected void onPause() {
- super.onPause();
- mGLView.onPause();
- mGL2View.onPause();
- }
-
- @Override protected void onResume() {
- super.onResume();
- mGLView.onResume();
- mGL2View.onResume();
- }
-}
diff --git a/opengl/tests/gldual/src/com/android/gldual/GLDualGL2View.java b/opengl/tests/gldual/src/com/android/gldual/GLDualGL2View.java
deleted file mode 100644
index 8f5e347..0000000
--- a/opengl/tests/gldual/src/com/android/gldual/GLDualGL2View.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (C) 2009 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.gldual;
-/*
- * Copyright (C) 2008 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.
- */
-
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.util.Log;
-
-/**
- * An implementation of SurfaceView that uses the dedicated surface for
- * displaying an OpenGL animation. This allows the animation to run in a
- * separate thread, without requiring that it be driven by the update mechanism
- * of the view hierarchy.
- *
- * The application-specific rendering code is delegated to a GLView.Renderer
- * instance.
- */
-class GLDualGL2View extends GLSurfaceView {
- private static String TAG = "GLDualGL2View";
-
- public GLDualGL2View(Context context) {
- super(context);
- init(false, 0, 0);
- }
-
- public GLDualGL2View(Context context, AttributeSet set) {
- super(context, set);
- init(false, 0, 0);
- }
-
- public GLDualGL2View(Context context, boolean translucent, int depth, int stencil) {
- super(context);
- init(translucent, depth, stencil);
- }
-
- private void init(boolean translucent, int depth, int stencil) {
- setEGLContextFactory(new ContextFactory());
- setEGLConfigChooser( translucent ?
- new ConfigChooser(8,8,8,8, depth, stencil) :
- new ConfigChooser(5,6,5,0, depth, stencil));
- setRenderer(new Renderer());
- }
-
- private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
- private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
- public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
- Log.w(TAG, "creating OpenGL ES 2.0 context");
- checkEglError("Before eglCreateContext", egl);
- int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
- EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
- checkEglError("After eglCreateContext", egl);
- return context;
- }
-
- public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) {
- egl.eglDestroyContext(display, context);
- }
- }
-
- private static void checkEglError(String prompt, EGL10 egl) {
- int error;
- while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
- Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));
- }
- }
-
- private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser {
- private static int EGL_OPENGL_ES2_BIT = 4;
- private static int[] s_configAttribs2 =
- {
- EGL10.EGL_RED_SIZE, 4,
- EGL10.EGL_GREEN_SIZE, 4,
- EGL10.EGL_BLUE_SIZE, 4,
- EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL10.EGL_NONE
- };
-
- public ConfigChooser(int r, int g, int b, int a, int depth, int stencil) {
- mRedSize = r;
- mGreenSize = g;
- mBlueSize = b;
- mAlphaSize = a;
- mDepthSize = depth;
- mStencilSize = stencil;
- }
-
- public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
-
- int[] num_config = new int[1];
- egl.eglChooseConfig(display, s_configAttribs2, null, 0, num_config);
-
- int numConfigs = num_config[0];
-
- if (numConfigs <= 0) {
- throw new IllegalArgumentException("No configs match configSpec");
- }
- EGLConfig[] configs = new EGLConfig[numConfigs];
- egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config);
- // printConfigs(egl, display, configs);
- return chooseConfig(egl, display, configs);
- }
-
- public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display,
- EGLConfig[] configs) {
- EGLConfig closestConfig = null;
- int closestDistance = 1000;
- for(EGLConfig config : configs) {
- int d = findConfigAttrib(egl, display, config,
- EGL10.EGL_DEPTH_SIZE, 0);
- int s = findConfigAttrib(egl, display, config,
- EGL10.EGL_STENCIL_SIZE, 0);
- if (d >= mDepthSize && s>= mStencilSize) {
- int r = findConfigAttrib(egl, display, config,
- EGL10.EGL_RED_SIZE, 0);
- int g = findConfigAttrib(egl, display, config,
- EGL10.EGL_GREEN_SIZE, 0);
- int b = findConfigAttrib(egl, display, config,
- EGL10.EGL_BLUE_SIZE, 0);
- int a = findConfigAttrib(egl, display, config,
- EGL10.EGL_ALPHA_SIZE, 0);
- int distance = Math.abs(r - mRedSize)
- + Math.abs(g - mGreenSize)
- + Math.abs(b - mBlueSize)
- + Math.abs(a - mAlphaSize);
- if (distance < closestDistance) {
- closestDistance = distance;
- closestConfig = config;
- }
- }
- }
- return closestConfig;
- }
-
- private int findConfigAttrib(EGL10 egl, EGLDisplay display,
- EGLConfig config, int attribute, int defaultValue) {
-
- if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
- return mValue[0];
- }
- return defaultValue;
- }
-
- private void printConfigs(EGL10 egl, EGLDisplay display,
- EGLConfig[] configs) {
- int numConfigs = configs.length;
- Log.w(TAG, String.format("%d configurations", numConfigs));
- for (int i = 0; i < numConfigs; i++) {
- Log.w(TAG, String.format("Configuration %d:\n", i));
- printConfig(egl, display, configs[i]);
- }
- }
-
- private void printConfig(EGL10 egl, EGLDisplay display,
- EGLConfig config) {
- int[] attributes = {
- EGL10.EGL_BUFFER_SIZE,
- EGL10.EGL_ALPHA_SIZE,
- EGL10.EGL_BLUE_SIZE,
- EGL10.EGL_GREEN_SIZE,
- EGL10.EGL_RED_SIZE,
- EGL10.EGL_DEPTH_SIZE,
- EGL10.EGL_STENCIL_SIZE,
- EGL10.EGL_CONFIG_CAVEAT,
- EGL10.EGL_CONFIG_ID,
- EGL10.EGL_LEVEL,
- EGL10.EGL_MAX_PBUFFER_HEIGHT,
- EGL10.EGL_MAX_PBUFFER_PIXELS,
- EGL10.EGL_MAX_PBUFFER_WIDTH,
- EGL10.EGL_NATIVE_RENDERABLE,
- EGL10.EGL_NATIVE_VISUAL_ID,
- EGL10.EGL_NATIVE_VISUAL_TYPE,
- 0x3030, // EGL10.EGL_PRESERVED_RESOURCES,
- EGL10.EGL_SAMPLES,
- EGL10.EGL_SAMPLE_BUFFERS,
- EGL10.EGL_SURFACE_TYPE,
- EGL10.EGL_TRANSPARENT_TYPE,
- EGL10.EGL_TRANSPARENT_RED_VALUE,
- EGL10.EGL_TRANSPARENT_GREEN_VALUE,
- EGL10.EGL_TRANSPARENT_BLUE_VALUE,
- 0x3039, // EGL10.EGL_BIND_TO_TEXTURE_RGB,
- 0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGBA,
- 0x303B, // EGL10.EGL_MIN_SWAP_INTERVAL,
- 0x303C, // EGL10.EGL_MAX_SWAP_INTERVAL,
- EGL10.EGL_LUMINANCE_SIZE,
- EGL10.EGL_ALPHA_MASK_SIZE,
- EGL10.EGL_COLOR_BUFFER_TYPE,
- EGL10.EGL_RENDERABLE_TYPE,
- 0x3042 // EGL10.EGL_CONFORMANT
- };
- String[] names = {
- "EGL_BUFFER_SIZE",
- "EGL_ALPHA_SIZE",
- "EGL_BLUE_SIZE",
- "EGL_GREEN_SIZE",
- "EGL_RED_SIZE",
- "EGL_DEPTH_SIZE",
- "EGL_STENCIL_SIZE",
- "EGL_CONFIG_CAVEAT",
- "EGL_CONFIG_ID",
- "EGL_LEVEL",
- "EGL_MAX_PBUFFER_HEIGHT",
- "EGL_MAX_PBUFFER_PIXELS",
- "EGL_MAX_PBUFFER_WIDTH",
- "EGL_NATIVE_RENDERABLE",
- "EGL_NATIVE_VISUAL_ID",
- "EGL_NATIVE_VISUAL_TYPE",
- "EGL_PRESERVED_RESOURCES",
- "EGL_SAMPLES",
- "EGL_SAMPLE_BUFFERS",
- "EGL_SURFACE_TYPE",
- "EGL_TRANSPARENT_TYPE",
- "EGL_TRANSPARENT_RED_VALUE",
- "EGL_TRANSPARENT_GREEN_VALUE",
- "EGL_TRANSPARENT_BLUE_VALUE",
- "EGL_BIND_TO_TEXTURE_RGB",
- "EGL_BIND_TO_TEXTURE_RGBA",
- "EGL_MIN_SWAP_INTERVAL",
- "EGL_MAX_SWAP_INTERVAL",
- "EGL_LUMINANCE_SIZE",
- "EGL_ALPHA_MASK_SIZE",
- "EGL_COLOR_BUFFER_TYPE",
- "EGL_RENDERABLE_TYPE",
- "EGL_CONFORMANT"
- };
- int[] value = new int[1];
- for (int i = 0; i < attributes.length; i++) {
- int attribute = attributes[i];
- String name = names[i];
- if ( egl.eglGetConfigAttrib(display, config, attribute, value)) {
- Log.w(TAG, String.format(" %s: %d\n", name, value[0]));
- } else {
- // Log.w(TAG, String.format(" %s: failed\n", name));
- while (egl.eglGetError() != EGL10.EGL_SUCCESS);
- }
- }
- }
-
- // Subclasses can adjust these values:
- protected int mRedSize;
- protected int mGreenSize;
- protected int mBlueSize;
- protected int mAlphaSize;
- protected int mDepthSize;
- protected int mStencilSize;
- private int[] mValue = new int[1];
- }
-
- private static class Renderer implements GLSurfaceView.Renderer {
- public void onDrawFrame(GL10 gl) {
- GLDualLib.step();
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- GLDualLib.init(width, height);
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- // Do nothing.
- }
- }
-}
-
diff --git a/opengl/tests/gldual/src/com/android/gldual/GLDualLib.java b/opengl/tests/gldual/src/com/android/gldual/GLDualLib.java
deleted file mode 100644
index d8f765e..0000000
--- a/opengl/tests/gldual/src/com/android/gldual/GLDualLib.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2007 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.gldual;
-
-// Wrapper for native library
-
-public class GLDualLib {
-
- static {
- System.loadLibrary("gldualjni");
- }
-
- /**
- * @param width the current view width
- * @param height the current view height
- */
- public static native void init(int width, int height);
- public static native void step();
-}
diff --git a/opengl/tests/gldual/src/com/android/gldual/TriangleRenderer.java b/opengl/tests/gldual/src/com/android/gldual/TriangleRenderer.java
deleted file mode 100644
index a082d47..0000000
--- a/opengl/tests/gldual/src/com/android/gldual/TriangleRenderer.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2009 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.gldual;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-import java.nio.ShortBuffer;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.opengl.GLSurfaceView;
-import android.opengl.GLU;
-import android.os.SystemClock;
-
-public class TriangleRenderer implements GLSurfaceView.Renderer{
-
- public TriangleRenderer() {
- mTriangle = new Triangle();
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- /*
- * By default, OpenGL enables features that improve quality
- * but reduce performance. One might want to tweak that
- * especially on software renderer.
- */
- gl.glDisable(GL10.GL_DITHER);
-
- /*
- * Some one-time OpenGL initialization can be made here
- * probably based on features of this particular context
- */
- gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT,
- GL10.GL_FASTEST);
-
- gl.glClearColor(.5f, .5f, .5f, 1);
- gl.glShadeModel(GL10.GL_SMOOTH);
- }
-
- public void onDrawFrame(GL10 gl) {
- /*
- * By default, OpenGL enables features that improve quality
- * but reduce performance. One might want to tweak that
- * especially on software renderer.
- */
- gl.glDisable(GL10.GL_DITHER);
-
- /*
- * Usually, the first thing one might want to do is to clear
- * the screen. The most efficient way of doing this is to use
- * glClear().
- */
-
- gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
-
- /*
- * Now we're ready to draw some 3D objects
- */
-
- gl.glMatrixMode(GL10.GL_MODELVIEW);
- gl.glLoadIdentity();
-
- GLU.gluLookAt(gl, 0, 0, -5, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
-
- gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
-
- long time = SystemClock.uptimeMillis() % 4000L;
- float angle = 0.090f * ((int) time);
-
- gl.glRotatef(angle, 0, 0, 1.0f);
-
- mTriangle.draw(gl);
- }
-
- public void onSurfaceChanged(GL10 gl, int w, int h) {
- gl.glViewport(0, 0, w, h);
-
- /*
- * Set our projection matrix. This doesn't have to be done
- * each time we draw, but usually a new projection needs to
- * be set when the viewport is resized.
- */
-
- float ratio = (float) w / h;
- gl.glMatrixMode(GL10.GL_PROJECTION);
- gl.glLoadIdentity();
- gl.glFrustumf(-ratio, ratio, -1, 1, 3, 7);
-
- }
-
- private Triangle mTriangle;
-}
-
-class Triangle {
- public Triangle() {
-
- // Buffers to be passed to gl*Pointer() functions
- // must be direct, i.e., they must be placed on the
- // native heap where the garbage collector cannot
- // move them.
- //
- // Buffers with multi-byte datatypes (e.g., short, int, float)
- // must have their byte order set to native order
-
- ByteBuffer vbb = ByteBuffer.allocateDirect(VERTS * 3 * 4);
- vbb.order(ByteOrder.nativeOrder());
- mFVertexBuffer = vbb.asFloatBuffer();
-
- ByteBuffer tbb = ByteBuffer.allocateDirect(VERTS * 2 * 4);
- tbb.order(ByteOrder.nativeOrder());
-
- ByteBuffer ibb = ByteBuffer.allocateDirect(VERTS * 2);
- ibb.order(ByteOrder.nativeOrder());
- mIndexBuffer = ibb.asShortBuffer();
-
- // A unit-sided equalateral triangle centered on the origin.
- float[] coords = {
- // X, Y, Z
- -0.5f, -0.25f, 0,
- 0.5f, -0.25f, 0,
- 0.0f, 0.559016994f, 0
- };
-
- for (int i = 0; i < VERTS; i++) {
- for(int j = 0; j < 3; j++) {
- mFVertexBuffer.put(coords[i*3+j] * 2.0f);
- }
- }
-
- for(int i = 0; i < VERTS; i++) {
- mIndexBuffer.put((short) i);
- }
-
- mFVertexBuffer.position(0);
- mIndexBuffer.position(0);
- }
-
- public void draw(GL10 gl) {
- gl.glFrontFace(GL10.GL_CCW);
- gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mFVertexBuffer);
- gl.glDrawElements(GL10.GL_TRIANGLE_STRIP, VERTS,
- GL10.GL_UNSIGNED_SHORT, mIndexBuffer);
- }
-
- private final static int VERTS = 3;
-
- private FloatBuffer mFVertexBuffer;
- private ShortBuffer mIndexBuffer;
-}
diff --git a/opengl/tests/gralloc/Android.mk b/opengl/tests/gralloc/Android.mk
deleted file mode 100644
index d43c39a..0000000
--- a/opengl/tests/gralloc/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- gralloc.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libui
-
-LOCAL_MODULE:= test-opengl-gralloc
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/gralloc/gralloc.cpp b/opengl/tests/gralloc/gralloc.cpp
deleted file mode 100644
index 8987040..0000000
--- a/opengl/tests/gralloc/gralloc.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- **
- ** Copyright 2009, 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.
- */
-
-#define LOG_TAG "StopWatch"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <utils/StopWatch.h>
-#include <utils/Log.h>
-
-#include <ui/GraphicBuffer.h>
-#include <ui/GraphicBufferMapper.h>
-
-using namespace android;
-
-void* lamecpy(void* d, void const* s, size_t size) {
- char* dst = (char*)d;
- char const* src = (char const*)s;
- while (size) {
- *dst++ = *src++;
- size--;
- }
- return d;
-}
-
-int main(int argc, char** argv)
-{
- size_t size = 128*256*4;
- void* temp = malloc(size);
- void* temp2 = malloc(size);
- memset(temp, 0, size);
- memset(temp2, 0, size);
-
-
- sp<GraphicBuffer> buffer = new GraphicBuffer(128, 256, HAL_PIXEL_FORMAT_RGBA_8888,
- GRALLOC_USAGE_SW_READ_OFTEN |
- GRALLOC_USAGE_SW_WRITE_OFTEN);
-
- status_t err = buffer->initCheck();
- if (err != NO_ERROR) {
- printf("%s\n", strerror(-err));
- return 0;
- }
-
- void* vaddr;
- buffer->lock(
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
- &vaddr);
-
- {
- StopWatch watch("memset");
- for (int i=0 ; i<10 ; i++)
- memset(vaddr, 0, size);
- }
-
- {
- StopWatch watch("memcpy baseline");
- for (int i=0 ; i<10 ; i++)
- memcpy(temp, temp2, size);
- }
-
- {
- StopWatch watch("memcpy from gralloc");
- for (int i=0 ; i<10 ; i++)
- memcpy(temp, vaddr, size);
- }
-
- {
- StopWatch watch("memcpy into gralloc");
- for (int i=0 ; i<10 ; i++)
- memcpy(vaddr, temp, size);
- }
-
-
- {
- StopWatch watch("lamecpy baseline");
- for (int i=0 ; i<10 ; i++)
- lamecpy(temp, temp2, size);
- }
-
- {
- StopWatch watch("lamecpy from gralloc");
- for (int i=0 ; i<10 ; i++)
- lamecpy(temp, vaddr, size);
- }
-
- {
- StopWatch watch("lamecpy into gralloc");
- for (int i=0 ; i<10 ; i++)
- lamecpy(vaddr, temp, size);
- }
-
- buffer->unlock();
-
- return 0;
-}
diff --git a/opengl/tests/hwc/Android.mk b/opengl/tests/hwc/Android.mk
deleted file mode 100644
index 9eb58b1..0000000
--- a/opengl/tests/hwc/Android.mk
+++ /dev/null
@@ -1,151 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE:= libhwcTest
-LOCAL_SRC_FILES:= hwcTestLib.cpp
-LOCAL_C_INCLUDES += system/extras/tests/include \
- bionic \
- bionic/libstdc++/include \
- external/stlport/stlport \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport
-LOCAL_STATIC_LIBRARIES += libglTest
-
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES:= hwcStress.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv2 \
- libui \
- libhardware \
-
-LOCAL_STATIC_LIBRARIES := \
- libtestUtil \
- libglTest \
- libhwcTest \
-
-LOCAL_C_INCLUDES += \
- system/extras/tests/include \
- hardware/libhardware/include \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-LOCAL_MODULE:= hwcStress
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativestresstest
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-include $(BUILD_NATIVE_TEST)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES:= hwcRects.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv2 \
- libui \
- libhardware \
-
-LOCAL_STATIC_LIBRARIES := \
- libtestUtil \
- libglTest \
- libhwcTest \
-
-LOCAL_C_INCLUDES += \
- system/extras/tests/include \
- hardware/libhardware/include \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= hwcRects
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativeutil
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-include $(BUILD_NATIVE_TEST)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES:= hwcColorEquiv.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv2 \
- libui \
- libhardware \
-
-LOCAL_STATIC_LIBRARIES := \
- libtestUtil \
- libglTest \
- libhwcTest \
-
-LOCAL_C_INCLUDES += \
- system/extras/tests/include \
- hardware/libhardware/include \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= hwcColorEquiv
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativeutil
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-include $(BUILD_NATIVE_TEST)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES:= hwcCommit.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv2 \
- libui \
- libhardware \
-
-LOCAL_STATIC_LIBRARIES := \
- libtestUtil \
- libglTest \
- libhwcTest \
-
-LOCAL_C_INCLUDES += \
- system/extras/tests/include \
- hardware/libhardware/include \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= hwcCommit
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativebenchmark
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-include $(BUILD_NATIVE_TEST)
diff --git a/opengl/tests/hwc/hwcColorEquiv.cpp b/opengl/tests/hwc/hwcColorEquiv.cpp
deleted file mode 100644
index bb305dc..0000000
--- a/opengl/tests/hwc/hwcColorEquiv.cpp
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- *
- */
-
-/*
- * Hardware Composer Color Equivalence
- *
- * Synopsis
- * hwc_colorequiv [options] eFmt
- *
- * options:
- -v - verbose
- * -s <0.##, 0.##, 0.##> - Start color (default: <0.0, 0.0, 0.0>
- * -e <0.##, 0.##, 0.##> - Ending color (default: <1.0, 1.0, 1.0>
- * -r fmt - reference graphic format
- * -D #.## - End of test delay
- *
- * graphic formats:
- * RGBA8888 (reference frame default)
- * RGBX8888
- * RGB888
- * RGB565
- * BGRA8888
- * RGBA5551
- * RGBA4444
- * YV12
- *
- * Description
- * Renders a horizontal blend in two frames. The first frame is rendered
- * in the upper third of the display and is called the reference frame.
- * The second frame is displayed in the middle third and is called the
- * equivalence frame. The primary purpose of this utility is to verify
- * that the colors produced in the reference and equivalence frames are
- * the same. The colors are the same when the colors are the same
- * vertically between the reference and equivalence frames.
- *
- * By default the reference frame is rendered through the use of the
- * RGBA8888 graphic format. The -r option can be used to specify a
- * non-default reference frame graphic format. The graphic format of
- * the equivalence frame is determined by a single required positional
- * parameter. Intentionally there is no default for the graphic format
- * of the equivalence frame.
- *
- * The horizontal blend in the reference frame is produced from a linear
- * interpolation from a start color (default: <0.0, 0.0, 0.0> on the left
- * side to an end color (default <1.0, 1.0, 1.0> on the right side. Where
- * possible the equivalence frame is rendered with the equivalent color
- * from the reference frame. A color of black is used in the equivalence
- * frame for cases where an equivalent color does not exist.
- */
-
-#include <algorithm>
-#include <assert.h>
-#include <cerrno>
-#include <cmath>
-#include <cstdlib>
-#include <ctime>
-#include <libgen.h>
-#include <sched.h>
-#include <sstream>
-#include <stdint.h>
-#include <string.h>
-#include <unistd.h>
-#include <vector>
-
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include <ui/GraphicBuffer.h>
-
-#define LOG_TAG "hwcColorEquivTest"
-#include <utils/Log.h>
-#include <testUtil.h>
-
-#include <hardware/hwcomposer.h>
-
-#include "hwcTestLib.h"
-
-using namespace std;
-using namespace android;
-
-// Defaults for command-line options
-const bool defaultVerbose = false;
-const ColorFract defaultStartColor(0.0, 0.0, 0.0);
-const ColorFract defaultEndColor(1.0, 1.0, 1.0);
-const char *defaultRefFormat = "RGBA8888";
-const float defaultEndDelay = 2.0; // Default delay after rendering graphics
-
-// Defines
-#define MAXSTR 100
-#define MAXCMD 200
-#define BITSPERBYTE 8 // TODO: Obtain from <values.h>, once
- // it has been added
-
-#define CMD_STOP_FRAMEWORK "stop 2>&1"
-#define CMD_START_FRAMEWORK "start 2>&1"
-
-// Macros
-#define NUMA(a) (sizeof(a) / sizeof(a [0])) // Num elements in an array
-#define MEMCLR(addr, size) do { \
- memset((addr), 0, (size)); \
- } while (0)
-
-// Globals
-static const int texUsage = GraphicBuffer::USAGE_HW_TEXTURE |
- GraphicBuffer::USAGE_SW_WRITE_RARELY;
-static hwc_composer_device_t *hwcDevice;
-static EGLDisplay dpy;
-static EGLSurface surface;
-static EGLint width, height;
-
-// Functions prototypes
-void init(void);
-void printSyntax(const char *cmd);
-
-// Command-line option settings
-static bool verbose = defaultVerbose;
-static ColorFract startRefColor = defaultStartColor;
-static ColorFract endRefColor = defaultEndColor;
-static float endDelay = defaultEndDelay;
-static const struct hwcTestGraphicFormat *refFormat
- = hwcTestGraphicFormatLookup(defaultRefFormat);
-static const struct hwcTestGraphicFormat *equivFormat;
-
-/*
- * Main
- *
- * Performs the following high-level sequence of operations:
- *
- * 1. Command-line parsing
- *
- * 2. Stop framework
- *
- * 3. Initialization
- *
- * 4. Create Hardware Composer description of reference and equivalence frames
- *
- * 5. Have Hardware Composer render the reference and equivalence frames
- *
- * 6. Delay for amount of time given by endDelay
- *
- * 7. Start framework
- */
-int
-main(int argc, char *argv[])
-{
- int rv, opt;
- bool error;
- char *chptr;
- unsigned int pass;
- char cmd[MAXCMD];
- string str;
-
- testSetLogCatTag(LOG_TAG);
-
- assert(refFormat != NULL);
-
- testSetLogCatTag(LOG_TAG);
-
- // Parse command line arguments
- while ((opt = getopt(argc, argv, "vs:e:r:D:?h")) != -1) {
- switch (opt) {
- case 'D': // End of test delay
- // Delay between completion of final pass and restart
- // of framework
- endDelay = strtod(optarg, &chptr);
- if ((*chptr != '\0') || (endDelay < 0.0)) {
- testPrintE("Invalid command-line specified end of test delay "
- "of: %s", optarg);
- exit(1);
- }
- break;
-
- case 's': // Starting reference color
- str = optarg;
- while (optind < argc) {
- if (*argv[optind] == '-') { break; }
- char endChar = (str.length() > 1) ? str[str.length() - 1] : 0;
- if ((endChar == '>') || (endChar == ']')) { break; }
- str += " " + string(argv[optind++]);
- }
- {
- istringstream in(str);
- startRefColor = hwcTestParseColor(in, error);
- // Any parse error or characters not used by parser
- if (error
- || (((unsigned int) in.tellg() != in.str().length())
- && (in.tellg() != (streampos) -1))) {
- testPrintE("Invalid command-line specified start "
- "reference color of: %s", str.c_str());
- exit(2);
- }
- }
- break;
-
- case 'e': // Ending reference color
- str = optarg;
- while (optind < argc) {
- if (*argv[optind] == '-') { break; }
- char endChar = (str.length() > 1) ? str[str.length() - 1] : 0;
- if ((endChar == '>') || (endChar == ']')) { break; }
- str += " " + string(argv[optind++]);
- }
- {
- istringstream in(str);
- endRefColor = hwcTestParseColor(in, error);
- // Any parse error or characters not used by parser
- if (error
- || (((unsigned int) in.tellg() != in.str().length())
- && (in.tellg() != (streampos) -1))) {
- testPrintE("Invalid command-line specified end "
- "reference color of: %s", str.c_str());
- exit(3);
- }
- }
- break;
-
- case 'r': // Reference graphic format
- refFormat = hwcTestGraphicFormatLookup(optarg);
- if (refFormat == NULL) {
- testPrintE("Unkown command-line specified reference graphic "
- "format of: %s", optarg);
- printSyntax(basename(argv[0]));
- exit(4);
- }
- break;
-
- case 'v': // Verbose
- verbose = true;
- break;
-
- case 'h': // Help
- case '?':
- default:
- printSyntax(basename(argv[0]));
- exit(((optopt == 0) || (optopt == '?')) ? 0 : 5);
- }
- }
-
- // Expect a single positional parameter, which specifies the
- // equivalence graphic format.
- if (argc != (optind + 1)) {
- testPrintE("Expected a single command-line postional parameter");
- printSyntax(basename(argv[0]));
- exit(6);
- }
- equivFormat = hwcTestGraphicFormatLookup(argv[optind]);
- if (equivFormat == NULL) {
- testPrintE("Unkown command-line specified equivalence graphic "
- "format of: %s", argv[optind]);
- printSyntax(basename(argv[0]));
- exit(7);
- }
-
- testPrintI("refFormat: %u %s", refFormat->format, refFormat->desc);
- testPrintI("equivFormat: %u %s", equivFormat->format, equivFormat->desc);
- testPrintI("startRefColor: %s", ((string) startRefColor).c_str());
- testPrintI("endRefColor: %s", ((string) endRefColor).c_str());
- testPrintI("endDelay: %f", endDelay);
-
- // Stop framework
- rv = snprintf(cmd, sizeof(cmd), "%s", CMD_STOP_FRAMEWORK);
- if (rv >= (signed) sizeof(cmd) - 1) {
- testPrintE("Command too long for: %s", CMD_STOP_FRAMEWORK);
- exit(8);
- }
- testExecCmd(cmd);
- testDelay(1.0); // TODO - needs means to query whether asynchronous stop
- // framework operation has completed. For now, just wait
- // a long time.
-
- init();
-
- // Use the upper third of the display for the reference frame and
- // the middle third for the equivalence frame.
- unsigned int refHeight = height / 3;
- unsigned int refPosY = 0; // Reference frame Y position
- unsigned int refPosX = 0; // Reference frame X position
- unsigned int refWidth = width - refPosX;
- if ((refWidth & refFormat->wMod) != 0) {
- refWidth += refFormat->wMod - (refWidth % refFormat->wMod);
- }
- unsigned int equivHeight = height / 3;
- unsigned int equivPosY = refHeight; // Equivalence frame Y position
- unsigned int equivPosX = 0; // Equivalence frame X position
- unsigned int equivWidth = width - equivPosX;
- if ((equivWidth & equivFormat->wMod) != 0) {
- equivWidth += equivFormat->wMod - (equivWidth % equivFormat->wMod);
- }
-
- // Create reference and equivalence graphic buffers
- const unsigned int numFrames = 2;
- sp<GraphicBuffer> refFrame;
- refFrame = new GraphicBuffer(refWidth, refHeight,
- refFormat->format, texUsage);
- if ((rv = refFrame->initCheck()) != NO_ERROR) {
- testPrintE("refFrame initCheck failed, rv: %i", rv);
- testPrintE(" width %u height: %u format: %u %s", refWidth, refHeight,
- refFormat->format,
- hwcTestGraphicFormat2str(refFormat->format));
- exit(9);
- }
- testPrintI("refFrame width: %u height: %u format: %u %s",
- refWidth, refHeight, refFormat->format,
- hwcTestGraphicFormat2str(refFormat->format));
-
- sp<GraphicBuffer> equivFrame;
- equivFrame = new GraphicBuffer(equivWidth, equivHeight,
- equivFormat->format, texUsage);
- if ((rv = refFrame->initCheck()) != NO_ERROR) {
- testPrintE("refFrame initCheck failed, rv: %i", rv);
- testPrintE(" width %u height: %u format: %u %s", refWidth, refHeight,
- refFormat->format,
- hwcTestGraphicFormat2str(refFormat->format));
- exit(10);
- }
- testPrintI("equivFrame width: %u height: %u format: %u %s",
- equivWidth, equivHeight, equivFormat->format,
- hwcTestGraphicFormat2str(equivFormat->format));
-
- // Fill the frames with a horizontal blend
- hwcTestFillColorHBlend(refFrame.get(), refFormat->format,
- startRefColor, endRefColor);
- hwcTestFillColorHBlend(equivFrame.get(), refFormat->format,
- startRefColor, endRefColor);
-
- hwc_layer_list_t *list;
- size_t size = sizeof(hwc_layer_list) + numFrames * sizeof(hwc_layer_t);
- if ((list = (hwc_layer_list_t *) calloc(1, size)) == NULL) {
- testPrintE("Allocate list failed");
- exit(11);
- }
- list->flags = HWC_GEOMETRY_CHANGED;
- list->numHwLayers = numFrames;
-
- hwc_layer_t *layer = &list->hwLayers[0];
- layer->handle = refFrame->handle;
- layer->blending = HWC_BLENDING_NONE;
- layer->sourceCrop.left = 0;
- layer->sourceCrop.top = 0;
- layer->sourceCrop.right = width;
- layer->sourceCrop.bottom = refHeight;
- layer->displayFrame.left = 0;
- layer->displayFrame.top = 0;
- layer->displayFrame.right = width;
- layer->displayFrame.bottom = refHeight;
- layer->visibleRegionScreen.numRects = 1;
- layer->visibleRegionScreen.rects = &layer->displayFrame;
-
- layer++;
- layer->handle = equivFrame->handle;
- layer->blending = HWC_BLENDING_NONE;
- layer->sourceCrop.left = 0;
- layer->sourceCrop.top = 0;
- layer->sourceCrop.right = width;
- layer->sourceCrop.bottom = equivHeight;
- layer->displayFrame.left = 0;
- layer->displayFrame.top = refHeight;
- layer->displayFrame.right = width;
- layer->displayFrame.bottom = layer->displayFrame.top + equivHeight;
- layer->visibleRegionScreen.numRects = 1;
- layer->visibleRegionScreen.rects = &layer->displayFrame;
-
- // Perform prepare operation
- if (verbose) { testPrintI("Prepare:"); hwcTestDisplayList(list); }
- hwcDevice->prepare(hwcDevice, list);
- if (verbose) {
- testPrintI("Post Prepare:");
- hwcTestDisplayListPrepareModifiable(list);
- }
-
- // Turn off the geometry changed flag
- list->flags &= ~HWC_GEOMETRY_CHANGED;
-
- if (verbose) {hwcTestDisplayListHandles(list); }
- hwcDevice->set(hwcDevice, dpy, surface, list);
-
- testDelay(endDelay);
-
- // Start framework
- rv = snprintf(cmd, sizeof(cmd), "%s", CMD_START_FRAMEWORK);
- if (rv >= (signed) sizeof(cmd) - 1) {
- testPrintE("Command too long for: %s", CMD_START_FRAMEWORK);
- exit(12);
- }
- testExecCmd(cmd);
-
- return 0;
-}
-
-void init(void)
-{
- // Seed pseudo random number generator
- // Seeding causes fill horizontal blend to fill the pad area with
- // a deterministic set of values.
- srand48(0);
-
- hwcTestInitDisplay(verbose, &dpy, &surface, &width, &height);
-
- hwcTestOpenHwc(&hwcDevice);
-}
-
-void printSyntax(const char *cmd)
-{
- testPrintE(" %s [options] graphicFormat", cmd);
- testPrintE(" options:");
- testPrintE(" -s <0.##, 0.##, 0.##> - Starting reference color");
- testPrintE(" -e <0.##, 0.##, 0.##> - Ending reference color");
- testPrintE(" -r format - Reference graphic format");
- testPrintE(" -D #.## - End of test delay");
- testPrintE(" -v Verbose");
- testPrintE("");
- testPrintE(" graphic formats:");
- for (unsigned int n1 = 0; n1 < NUMA(hwcTestGraphicFormat); n1++) {
- testPrintE(" %s", hwcTestGraphicFormat[n1].desc);
- }
-}
diff --git a/opengl/tests/hwc/hwcCommit.cpp b/opengl/tests/hwc/hwcCommit.cpp
deleted file mode 100644
index efa646c..0000000
--- a/opengl/tests/hwc/hwcCommit.cpp
+++ /dev/null
@@ -1,1561 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- *
- */
-
-/*
- * Hardware Composer Commit Points
- *
- * Synopsis
- * hwcCommit [options] graphicFormat ...
- * options:
- * -s [width, height] - Starting dimension
- * -v - Verbose
- *
- * graphic formats:
- * RGBA8888 (reference frame default)
- * RGBX8888
- * RGB888
- * RGB565
- * BGRA8888
- * RGBA5551
- * RGBA4444
- * YV12
- *
- * Description
- * The Hardware Composer (HWC) Commit test is a benchmark that
- * discovers the points at which the HWC will commit to rendering an
- * overlay(s). Before rendering a set of overlays, the HWC is shown
- * the list through a prepare call. During the prepare call the HWC
- * is able to examine the list and specify which overlays it is able
- * to handle. The overlays that it can't handle are typically composited
- * by a higher level (e.g. Surface Flinger) and then the original list
- * plus a composit of what HWC passed on are provided back to the HWC
- * for rendering.
- *
- * Once an implementation of the HWC has been shipped, a regression would
- * likely occur if a latter implementation started passing on conditions
- * that it used to commit to. The primary purpose of this benchmark
- * is the automated discovery of the commit points, where an implementation
- * is on the edge between committing and not committing. These are commonly
- * referred to as commit points. Between implementations changes to the
- * commit points are allowed, as long as they improve what the HWC commits
- * to. Once an implementation of the HWC is shipped, the commit points are
- * not allowed to regress in future implementations.
- *
- * This benchmark takes a sampling and then adjusts until it finds a
- * commit point. It doesn't exhaustively check all possible conditions,
- * which do to the number of combinations would be impossible. Instead
- * it starts its search from a starting dimension, that can be changed
- * via the -s option. The search is also bounded by a set of search
- * limits, that are hard-coded into a structure of constants named
- * searchLimits. Results that happen to reach a searchLimit are prefixed
- * with >=, so that it is known that the value could possibly be larger.
- *
- * Measurements are made for each of the graphic formats specified as
- * positional parameters on the command-line. If no graphic formats
- * are specified on the command line, then by default measurements are
- * made and reported for each of the known graphic format.
- */
-
-#include <algorithm>
-#include <assert.h>
-#include <cerrno>
-#include <cmath>
-#include <cstdlib>
-#include <ctime>
-#include <iomanip>
-#include <istream>
-#include <libgen.h>
-#include <list>
-#include <sched.h>
-#include <sstream>
-#include <stdint.h>
-#include <string.h>
-#include <unistd.h>
-#include <vector>
-
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include <ui/GraphicBuffer.h>
-
-#define LOG_TAG "hwcCommitTest"
-#include <utils/Log.h>
-#include <testUtil.h>
-
-#include <hardware/hwcomposer.h>
-
-#include <glTestLib.h>
-#include "hwcTestLib.h"
-
-using namespace std;
-using namespace android;
-
-// Defaults
-const HwcTestDim defaultStartDim = HwcTestDim(100, 100);
-const bool defaultVerbose = false;
-
-const uint32_t defaultFormat = HAL_PIXEL_FORMAT_RGBA_8888;
-const int32_t defaultTransform = 0;
-const uint32_t defaultBlend = HWC_BLENDING_NONE;
-const ColorFract defaultColor(0.5, 0.5, 0.5);
-const float defaultAlpha = 1.0; // Opaque
-const HwcTestDim defaultSourceDim(1, 1);
-const struct hwc_rect defaultSourceCrop = {0, 0, 1, 1};
-const struct hwc_rect defaultDisplayFrame = {0, 0, 100, 100};
-
-// Global Constants
-const uint32_t printFieldWidth = 2;
-const struct searchLimits {
- uint32_t numOverlays;
- HwcTestDim sourceCrop;
-} searchLimits = {
- 10,
- HwcTestDim(3000, 2000),
-};
-const struct transformType {
- const char *desc;
- uint32_t id;
-} transformType[] = {
- {"fliph", HWC_TRANSFORM_FLIP_H},
- {"flipv", HWC_TRANSFORM_FLIP_V},
- {"rot90", HWC_TRANSFORM_ROT_90},
- {"rot180", HWC_TRANSFORM_ROT_180},
- {"rot270", HWC_TRANSFORM_ROT_270},
-};
-const struct blendType {
- const char *desc;
- uint32_t id;
-} blendType[] = {
- {"none", HWC_BLENDING_NONE},
- {"premult", HWC_BLENDING_PREMULT},
- {"coverage", HWC_BLENDING_COVERAGE},
-};
-
-// Defines
-#define MAXCMD 200
-#define CMD_STOP_FRAMEWORK "stop 2>&1"
-#define CMD_START_FRAMEWORK "start 2>&1"
-
-// Macros
-#define NUMA(a) (sizeof(a) / sizeof(a [0])) // Num elements in an array
-
-// Local types
-class Rectangle {
-public:
- Rectangle(uint32_t graphicFormat = defaultFormat,
- HwcTestDim dfDim = HwcTestDim(1, 1),
- HwcTestDim sDim = HwcTestDim(1, 1));
- void setSourceDim(HwcTestDim dim);
-
- uint32_t format;
- uint32_t transform;
- int32_t blend;
- ColorFract color;
- float alpha;
- HwcTestDim sourceDim;
- struct hwc_rect sourceCrop;
- struct hwc_rect displayFrame;
-};
-
-class Range {
-public:
- Range(void) : _l(0), _u(0) {}
- Range(uint32_t lower, uint32_t upper) : _l(lower), _u(upper) {}
- uint32_t lower(void) { return _l; }
- uint32_t upper(void) { return _u; }
-
- operator string();
-
-private:
- uint32_t _l; // lower
- uint32_t _u; // upper
-};
-
-Range::operator string()
-{
- ostringstream out;
-
- out << '[' << _l << ", " << _u << ']';
-
- return out.str();
-}
-
-class Rational {
-public:
- Rational(void) : _n(0), _d(1) {}
- Rational(uint32_t n, uint32_t d) : _n(n), _d(d) {}
- uint32_t numerator(void) { return _n; }
- uint32_t denominator(void) { return _d; }
- void setNumerator(uint32_t numerator) { _n = numerator; }
-
- bool operator==(const Rational& other) const;
- bool operator!=(const Rational& other) const { return !(*this == other); }
- bool operator<(const Rational& other) const;
- bool operator>(const Rational& other) const {
- return (!(*this == other) && !(*this < other));
- }
- static void double2Rational(double f, Range nRange, Range dRange,
- Rational& lower, Rational& upper);
-
- operator string() const;
- operator double() const { return (double) _n / (double) _d; }
-
-
-private:
- uint32_t _n;
- uint32_t _d;
-};
-
-// Globals
-static const int texUsage = GraphicBuffer::USAGE_HW_TEXTURE |
- GraphicBuffer::USAGE_SW_WRITE_RARELY;
-static hwc_composer_device_t *hwcDevice;
-static EGLDisplay dpy;
-static EGLSurface surface;
-static EGLint width, height;
-static size_t maxHeadingLen;
-static vector<string> formats;
-
-// Measurements
-struct meas {
- uint32_t format;
- uint32_t startDimOverlays;
- uint32_t maxNonOverlapping;
- uint32_t maxOverlapping;
- list<uint32_t> transforms;
- list<uint32_t> blends;
- struct displayFrame {
- uint32_t minWidth;
- uint32_t minHeight;
- HwcTestDim minDim;
- uint32_t maxWidth;
- uint32_t maxHeight;
- HwcTestDim maxDim;
- } df;
- struct sourceCrop {
- uint32_t minWidth;
- uint32_t minHeight;
- HwcTestDim minDim;
- uint32_t maxWidth;
- uint32_t maxHeight;
- HwcTestDim maxDim;
- Rational hScale;
- HwcTestDim hScaleBestDf;
- HwcTestDim hScaleBestSc;
- Rational vScale;
- HwcTestDim vScaleBestDf;
- HwcTestDim vScaleBestSc;
- } sc;
- vector<uint32_t> overlapBlendNone;
- vector<uint32_t> overlapBlendPremult;
- vector<uint32_t> overlapBlendCoverage;
-};
-vector<meas> measurements;
-
-// Function prototypes
-uint32_t numOverlays(list<Rectangle>& rectList);
-uint32_t maxOverlays(uint32_t format, bool allowOverlap);
-list<uint32_t> supportedTransforms(uint32_t format);
-list<uint32_t> supportedBlends(uint32_t format);
-uint32_t dfMinWidth(uint32_t format);
-uint32_t dfMinHeight(uint32_t format);
-uint32_t dfMaxWidth(uint32_t format);
-uint32_t dfMaxHeight(uint32_t format);
-HwcTestDim dfMinDim(uint32_t format);
-HwcTestDim dfMaxDim(uint32_t format);
-uint32_t scMinWidth(uint32_t format, const HwcTestDim& dfDim);
-uint32_t scMinHeight(uint32_t format, const HwcTestDim& dfDim);
-uint32_t scMaxWidth(uint32_t format, const HwcTestDim& dfDim);
-uint32_t scMaxHeight(uint32_t format, const HwcTestDim& dfDim);
-HwcTestDim scMinDim(uint32_t format, const HwcTestDim& dfDim);
-HwcTestDim scMaxDim(uint32_t format, const HwcTestDim& dfDim);
-Rational scHScale(uint32_t format,
- const HwcTestDim& dfMin, const HwcTestDim& dfMax,
- const HwcTestDim& scMin, const HwcTestDim& scMax,
- HwcTestDim& outBestDf, HwcTestDim& outBestSc);
-Rational scVScale(uint32_t format,
- const HwcTestDim& dfMin, const HwcTestDim& dfMax,
- const HwcTestDim& scMin, const HwcTestDim& scMax,
- HwcTestDim& outBestDf, HwcTestDim& outBestSc);
-uint32_t numOverlapping(uint32_t backgroundFormat, uint32_t foregroundFormat,
- uint32_t backgroundBlend, uint32_t foregroundBlend);
-string transformList2str(const list<uint32_t>& transformList);
-string blendList2str(const list<uint32_t>& blendList);
-void init(void);
-void printFormatHeadings(size_t indent);
-void printOverlapLine(size_t indent, const string formatStr,
- const vector<uint32_t>& results);
-void printSyntax(const char *cmd);
-
-// Command-line option settings
-static bool verbose = defaultVerbose;
-static HwcTestDim startDim = defaultStartDim;
-
-/*
- * Main
- *
- * Performs the following high-level sequence of operations:
- *
- * 1. Command-line parsing
- *
- * 2. Form a list of command-line specified graphic formats. If
- * no formats are specified, then form a list of all known formats.
- *
- * 3. Stop framework
- * Only one user at a time is allowed to use the HWC. Surface
- * Flinger uses the HWC and is part of the framework. Need to
- * stop the framework so that Surface Flinger will stop using
- * the HWC.
- *
- * 4. Initialization
- *
- * 5. For each graphic format in the previously formed list perform
- * measurements on that format and report the results.
- *
- * 6. Start framework
- */
-int
-main(int argc, char *argv[])
-{
- int rv, opt;
- char *chptr;
- bool error;
- string str;
- char cmd[MAXCMD];
- list<Rectangle> rectList;
-
- testSetLogCatTag(LOG_TAG);
-
- // Parse command line arguments
- while ((opt = getopt(argc, argv, "s:v?h")) != -1) {
- switch (opt) {
-
- case 's': // Start Dimension
- // Use arguments until next starts with a dash
- // or current ends with a > or ]
- str = optarg;
- while (optind < argc) {
- if (*argv[optind] == '-') { break; }
- char endChar = (str.length() > 1) ? str[str.length() - 1] : 0;
- if ((endChar == '>') || (endChar == ']')) { break; }
- str += " " + string(argv[optind++]);
- }
- {
- istringstream in(str);
- startDim = hwcTestParseDim(in, error);
- // Any parse error or characters not used by parser
- if (error
- || (((unsigned int) in.tellg() != in.str().length())
- && (in.tellg() != (streampos) -1))) {
- testPrintE("Invalid command-line specified start "
- "dimension of: %s", str.c_str());
- exit(8);
- }
- }
- break;
-
- case 'v': // Verbose
- verbose = true;
- break;
-
- case 'h': // Help
- case '?':
- default:
- printSyntax(basename(argv[0]));
- exit(((optopt == 0) || (optopt == '?')) ? 0 : 11);
- }
- }
-
- // Positional parameters
- // Positional parameters provide the names of graphic formats that
- // measurements are to be made on. Measurements are made on all
- // known graphic formats when no positional parameters are provided.
- if (optind == argc) {
- // No command-line specified graphic formats
- // Add all graphic formats to the list of formats to be measured
- for (unsigned int n1 = 0; n1 < NUMA(hwcTestGraphicFormat); n1++) {
- formats.push_back(hwcTestGraphicFormat[n1].desc);
- }
- } else {
- // Add names of command-line specified graphic formats to the
- // list of formats to be tested
- for (; argv[optind] != NULL; optind++) {
- formats.push_back(argv[optind]);
- }
- }
-
- // Determine length of longest specified graphic format.
- // This value is used for output formating
- for (vector<string>::iterator it = formats.begin();
- it != formats.end(); ++it) {
- maxHeadingLen = max(maxHeadingLen, it->length());
- }
-
- // Stop framework
- rv = snprintf(cmd, sizeof(cmd), "%s", CMD_STOP_FRAMEWORK);
- if (rv >= (signed) sizeof(cmd) - 1) {
- testPrintE("Command too long for: %s", CMD_STOP_FRAMEWORK);
- exit(14);
- }
- testExecCmd(cmd);
- testDelay(1.0); // TODO - needs means to query whether asynchronous stop
- // framework operation has completed. For now, just wait
- // a long time.
-
- testPrintI("startDim: %s", ((string) startDim).c_str());
-
- init();
-
- // For each of the graphic formats
- for (vector<string>::iterator itFormat = formats.begin();
- itFormat != formats.end(); ++itFormat) {
-
- // Locate hwcTestLib structure that describes this format
- const struct hwcTestGraphicFormat *format;
- format = hwcTestGraphicFormatLookup((*itFormat).c_str());
- if (format == NULL) {
- testPrintE("Unknown graphic format of: %s", (*itFormat).c_str());
- exit(1);
- }
-
- // Display format header
- testPrintI("format: %s", format->desc);
-
- // Create area to hold the measurements
- struct meas meas;
- struct meas *measPtr;
- meas.format = format->format;
- measurements.push_back(meas);
- measPtr = &measurements[measurements.size() - 1];
-
- // Start dimension num overlays
- Rectangle rect(format->format, startDim);
- rectList.clear();
- rectList.push_back(rect);
- measPtr->startDimOverlays = numOverlays(rectList);
- testPrintI(" startDimOverlays: %u", measPtr->startDimOverlays);
-
- // Skip the rest of the measurements, when the start dimension
- // doesn't produce an overlay
- if (measPtr->startDimOverlays == 0) { continue; }
-
- // Max Overlays
- measPtr->maxNonOverlapping = maxOverlays(format->format, false);
- testPrintI(" max nonOverlapping overlays: %s%u",
- (measPtr->maxNonOverlapping == searchLimits.numOverlays)
- ? ">= " : "",
- measPtr->maxNonOverlapping);
- measPtr->maxOverlapping = maxOverlays(format->format, true);
- testPrintI(" max Overlapping overlays: %s%u",
- (measPtr->maxOverlapping == searchLimits.numOverlays)
- ? ">= " : "",
- measPtr->maxOverlapping);
-
- // Transforms and blends
- measPtr->transforms = supportedTransforms(format->format);
- testPrintI(" transforms: %s",
- transformList2str(measPtr->transforms).c_str());
- measPtr->blends = supportedBlends(format->format);
- testPrintI(" blends: %s",
- blendList2str(measPtr->blends).c_str());
-
- // Display frame measurements
- measPtr->df.minWidth = dfMinWidth(format->format);
- testPrintI(" dfMinWidth: %u", measPtr->df.minWidth);
-
- measPtr->df.minHeight = dfMinHeight(format->format);
- testPrintI(" dfMinHeight: %u", measPtr->df.minHeight);
-
- measPtr->df.maxWidth = dfMaxWidth(format->format);
- testPrintI(" dfMaxWidth: %u", measPtr->df.maxWidth);
-
- measPtr->df.maxHeight = dfMaxHeight(format->format);
- testPrintI(" dfMaxHeight: %u", measPtr->df.maxHeight);
-
- measPtr->df.minDim = dfMinDim(format->format);
- testPrintI(" dfMinDim: %s", ((string) measPtr->df.minDim).c_str());
-
- measPtr->df.maxDim = dfMaxDim(format->format);
- testPrintI(" dfMaxDim: %s", ((string) measPtr->df.maxDim).c_str());
-
- // Source crop measurements
- measPtr->sc.minWidth = scMinWidth(format->format, measPtr->df.minDim);
- testPrintI(" scMinWidth: %u", measPtr->sc.minWidth);
-
- measPtr->sc.minHeight = scMinHeight(format->format, measPtr->df.minDim);
- testPrintI(" scMinHeight: %u", measPtr->sc.minHeight);
-
- measPtr->sc.maxWidth = scMaxWidth(format->format, measPtr->df.maxDim);
- testPrintI(" scMaxWidth: %s%u", (measPtr->sc.maxWidth
- == searchLimits.sourceCrop.width()) ? ">= " : "",
- measPtr->sc.maxWidth);
-
- measPtr->sc.maxHeight = scMaxHeight(format->format, measPtr->df.maxDim);
- testPrintI(" scMaxHeight: %s%u", (measPtr->sc.maxHeight
- == searchLimits.sourceCrop.height()) ? ">= " : "",
- measPtr->sc.maxHeight);
-
- measPtr->sc.minDim = scMinDim(format->format, measPtr->df.minDim);
- testPrintI(" scMinDim: %s", ((string) measPtr->sc.minDim).c_str());
-
- measPtr->sc.maxDim = scMaxDim(format->format, measPtr->df.maxDim);
- testPrintI(" scMaxDim: %s%s", ((measPtr->sc.maxDim.width()
- >= searchLimits.sourceCrop.width())
- || (measPtr->sc.maxDim.width() >=
- searchLimits.sourceCrop.height())) ? ">= " : "",
- ((string) measPtr->sc.maxDim).c_str());
-
- measPtr->sc.hScale = scHScale(format->format,
- measPtr->df.minDim, measPtr->df.maxDim,
- measPtr->sc.minDim, measPtr->sc.maxDim,
- measPtr->sc.hScaleBestDf,
- measPtr->sc.hScaleBestSc);
- testPrintI(" scHScale: %s%f",
- (measPtr->sc.hScale
- >= Rational(searchLimits.sourceCrop.width(),
- measPtr->df.minDim.width())) ? ">= " : "",
- (double) measPtr->sc.hScale);
- testPrintI(" HScale Best Display Frame: %s",
- ((string) measPtr->sc.hScaleBestDf).c_str());
- testPrintI(" HScale Best Source Crop: %s",
- ((string) measPtr->sc.hScaleBestSc).c_str());
-
- measPtr->sc.vScale = scVScale(format->format,
- measPtr->df.minDim, measPtr->df.maxDim,
- measPtr->sc.minDim, measPtr->sc.maxDim,
- measPtr->sc.vScaleBestDf,
- measPtr->sc.vScaleBestSc);
- testPrintI(" scVScale: %s%f",
- (measPtr->sc.vScale
- >= Rational(searchLimits.sourceCrop.height(),
- measPtr->df.minDim.height())) ? ">= " : "",
- (double) measPtr->sc.vScale);
- testPrintI(" VScale Best Display Frame: %s",
- ((string) measPtr->sc.vScaleBestDf).c_str());
- testPrintI(" VScale Best Source Crop: %s",
- ((string) measPtr->sc.vScaleBestSc).c_str());
-
- // Overlap two graphic formats and different blends
- // Results displayed after all overlap measurments with
- // current format in the foreground
- // TODO: make measurments with background blend other than
- // none. All of these measurements are done with a
- // background blend of HWC_BLENDING_NONE, with the
- // blend type of the foregound being varied.
- uint32_t foregroundFormat = format->format;
- for (vector<string>::iterator it = formats.begin();
- it != formats.end(); ++it) {
- uint32_t num;
-
- const struct hwcTestGraphicFormat *backgroundFormatPtr
- = hwcTestGraphicFormatLookup((*it).c_str());
- uint32_t backgroundFormat = backgroundFormatPtr->format;
-
- num = numOverlapping(backgroundFormat, foregroundFormat,
- HWC_BLENDING_NONE, HWC_BLENDING_NONE);
- measPtr->overlapBlendNone.push_back(num);
-
- num = numOverlapping(backgroundFormat, foregroundFormat,
- HWC_BLENDING_NONE, HWC_BLENDING_PREMULT);
- measPtr->overlapBlendPremult.push_back(num);
-
- num = numOverlapping(backgroundFormat, foregroundFormat,
- HWC_BLENDING_NONE, HWC_BLENDING_COVERAGE);
- measPtr->overlapBlendCoverage.push_back(num);
- }
-
- }
-
- // Display overlap results
- size_t indent = 2;
- testPrintI("overlapping blend: none");
- printFormatHeadings(indent);
- for (vector<string>::iterator it = formats.begin();
- it != formats.end(); ++it) {
- printOverlapLine(indent, *it, measurements[it
- - formats.begin()].overlapBlendNone);
- }
- testPrintI("");
-
- testPrintI("overlapping blend: premult");
- printFormatHeadings(indent);
- for (vector<string>::iterator it = formats.begin();
- it != formats.end(); ++it) {
- printOverlapLine(indent, *it, measurements[it
- - formats.begin()].overlapBlendPremult);
- }
- testPrintI("");
-
- testPrintI("overlapping blend: coverage");
- printFormatHeadings(indent);
- for (vector<string>::iterator it = formats.begin();
- it != formats.end(); ++it) {
- printOverlapLine(indent, *it, measurements[it
- - formats.begin()].overlapBlendCoverage);
- }
- testPrintI("");
-
- // Start framework
- rv = snprintf(cmd, sizeof(cmd), "%s", CMD_START_FRAMEWORK);
- if (rv >= (signed) sizeof(cmd) - 1) {
- testPrintE("Command too long for: %s", CMD_START_FRAMEWORK);
- exit(21);
- }
- testExecCmd(cmd);
-
- return 0;
-}
-
-// Determine the maximum number of overlays that are all of the same format
-// that the HWC will commit to. If allowOverlap is true, then the rectangles
-// are laid out on a diagonal starting from the upper left corner. With
-// each rectangle adjust one pixel to the right and one pixel down.
-// When allowOverlap is false, the rectangles are tiled in column major
-// order. Note, column major ordering is used so that the initial rectangles
-// are all on different horizontal scan rows. It is common that hardware
-// has limits on the number of objects it can handle on any single row.
-uint32_t maxOverlays(uint32_t format, bool allowOverlap)
-{
- unsigned int max = 0;
-
- for (unsigned int numRects = 1; numRects <= searchLimits.numOverlays;
- numRects++) {
- list<Rectangle> rectList;
-
- for (unsigned int x = 0;
- (x + startDim.width()) < (unsigned int) width;
- x += (allowOverlap) ? 1 : startDim.width()) {
- for (unsigned int y = 0;
- (y + startDim.height()) < (unsigned int) height;
- y += (allowOverlap) ? 1 : startDim.height()) {
- Rectangle rect(format, startDim, startDim);
- rect.displayFrame.left = x;
- rect.displayFrame.top = y;
- rect.displayFrame.right = x + startDim.width();
- rect.displayFrame.bottom = y + startDim.height();
-
- rectList.push_back(rect);
-
- if (rectList.size() >= numRects) { break; }
- }
- if (rectList.size() >= numRects) { break; }
- }
-
- uint32_t num = numOverlays(rectList);
- if (num > max) { max = num; }
- }
-
- return max;
-}
-
-// Measures what transforms (i.e. flip horizontal, rotate 180) are
-// supported by the specified format
-list<uint32_t> supportedTransforms(uint32_t format)
-{
- list<uint32_t> rv;
- list<Rectangle> rectList;
- Rectangle rect(format, startDim);
-
- // For each of the transform types
- for (unsigned int idx = 0; idx < NUMA(transformType); idx++) {
- unsigned int id = transformType[idx].id;
-
- rect.transform = id;
- rectList.clear();
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
-
- if (num == 1) {
- rv.push_back(id);
- }
- }
-
- return rv;
-}
-
-// Determines which types of blends (i.e. none, premult, coverage) are
-// supported by the specified format
-list<uint32_t> supportedBlends(uint32_t format)
-{
- list<uint32_t> rv;
- list<Rectangle> rectList;
- Rectangle rect(format, startDim);
-
- // For each of the blend types
- for (unsigned int idx = 0; idx < NUMA(blendType); idx++) {
- unsigned int id = blendType[idx].id;
-
- rect.blend = id;
- rectList.clear();
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
-
- if (num == 1) {
- rv.push_back(id);
- }
- }
-
- return rv;
-}
-
-// Determines the minimum width of any display frame of the given format
-// that the HWC will commit to.
-uint32_t dfMinWidth(uint32_t format)
-{
- uint32_t w;
- list<Rectangle> rectList;
-
- for (w = 1; w <= startDim.width(); w++) {
- HwcTestDim dim(w, startDim.height());
- Rectangle rect(format, dim);
- rectList.clear();
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- return w;
- }
- }
- if (w > startDim.width()) {
- testPrintE("Failed to locate display frame min width");
- exit(33);
- }
-
- return w;
-}
-
-// Display frame minimum height
-uint32_t dfMinHeight(uint32_t format)
-{
- uint32_t h;
- list<Rectangle> rectList;
-
- for (h = 1; h <= startDim.height(); h++) {
- HwcTestDim dim(startDim.width(), h);
- Rectangle rect(format, dim);
- rectList.clear();
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- return h;
- }
- }
- if (h > startDim.height()) {
- testPrintE("Failed to locate display frame min height");
- exit(34);
- }
-
- return h;
-}
-
-// Display frame maximum width
-uint32_t dfMaxWidth(uint32_t format)
-{
- uint32_t w;
- list<Rectangle> rectList;
-
- for (w = width; w >= startDim.width(); w--) {
- HwcTestDim dim(w, startDim.height());
- Rectangle rect(format, dim);
- rectList.clear();
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- return w;
- }
- }
- if (w < startDim.width()) {
- testPrintE("Failed to locate display frame max width");
- exit(35);
- }
-
- return w;
-}
-
-// Display frame maximum height
-uint32_t dfMaxHeight(uint32_t format)
-{
- uint32_t h;
-
- for (h = height; h >= startDim.height(); h--) {
- HwcTestDim dim(startDim.width(), h);
- Rectangle rect(format, dim);
- list<Rectangle> rectList;
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- return h;
- }
- }
- if (h < startDim.height()) {
- testPrintE("Failed to locate display frame max height");
- exit(36);
- }
-
- return h;
-}
-
-// Determine the minimum number of pixels that the HWC will ever commit to.
-// Note, this might be different that dfMinWidth * dfMinHeight, in that this
-// function adjusts both the width and height from the starting dimension.
-HwcTestDim dfMinDim(uint32_t format)
-{
- uint64_t bestMinPixels = 0;
- HwcTestDim bestDim;
- bool bestSet = false; // True when value has been assigned to
- // bestMinPixels and bestDim
-
- bool origVerbose = verbose; // Temporarily turn off verbose
- verbose = false;
- for (uint32_t w = 1; w <= startDim.width(); w++) {
- for (uint32_t h = 1; h <= startDim.height(); h++) {
- if (bestSet && ((w > bestMinPixels) || (h > bestMinPixels))) {
- break;
- }
-
- HwcTestDim dim(w, h);
- Rectangle rect(format, dim);
- list<Rectangle> rectList;
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- uint64_t pixels = dim.width() * dim.height();
- if (!bestSet || (pixels < bestMinPixels)) {
- bestMinPixels = pixels;
- bestDim = dim;
- bestSet = true;
- }
- }
- }
- }
- verbose = origVerbose;
-
- if (!bestSet) {
- testPrintE("Unable to locate display frame min dimension");
- exit(20);
- }
-
- return bestDim;
-}
-
-// Display frame maximum dimension
-HwcTestDim dfMaxDim(uint32_t format)
-{
- uint64_t bestMaxPixels = 0;
- HwcTestDim bestDim;
- bool bestSet = false; // True when value has been assigned to
- // bestMaxPixels and bestDim;
-
- // Potentially increase benchmark performance by first checking
- // for the common case of supporting a full display frame.
- HwcTestDim dim(width, height);
- Rectangle rect(format, dim);
- list<Rectangle> rectList;
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num == 1) { return dim; }
-
- // TODO: Use a binary search
- bool origVerbose = verbose; // Temporarily turn off verbose
- verbose = false;
- for (uint32_t w = startDim.width(); w <= (uint32_t) width; w++) {
- for (uint32_t h = startDim.height(); h <= (uint32_t) height; h++) {
- if (bestSet && ((w * h) <= bestMaxPixels)) { continue; }
-
- HwcTestDim dim(w, h);
- Rectangle rect(format, dim);
- list<Rectangle> rectList;
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- uint64_t pixels = dim.width() * dim.height();
- if (!bestSet || (pixels > bestMaxPixels)) {
- bestMaxPixels = pixels;
- bestDim = dim;
- bestSet = true;
- }
- }
- }
- }
- verbose = origVerbose;
-
- if (!bestSet) {
- testPrintE("Unable to locate display frame max dimension");
- exit(21);
- }
-
- return bestDim;
-}
-
-// Source crop minimum width
-uint32_t scMinWidth(uint32_t format, const HwcTestDim& dfDim)
-{
- uint32_t w;
- list<Rectangle> rectList;
-
- // Source crop frame min width
- for (w = 1; w <= dfDim.width(); w++) {
- Rectangle rect(format, dfDim, HwcTestDim(w, dfDim.height()));
- rectList.clear();
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- return w;
- }
- }
- testPrintE("Failed to locate source crop min width");
- exit(35);
-}
-
-// Source crop minimum height
-uint32_t scMinHeight(uint32_t format, const HwcTestDim& dfDim)
-{
- uint32_t h;
- list<Rectangle> rectList;
-
- for (h = 1; h <= dfDim.height(); h++) {
- Rectangle rect(format, dfDim, HwcTestDim(dfDim.width(), h));
- rectList.clear();
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- return h;
- }
- }
- testPrintE("Failed to locate source crop min height");
- exit(36);
-}
-
-// Source crop maximum width
-uint32_t scMaxWidth(uint32_t format, const HwcTestDim& dfDim)
-{
- uint32_t w;
- list<Rectangle> rectList;
-
- for (w = searchLimits.sourceCrop.width(); w >= dfDim.width(); w--) {
- Rectangle rect(format, dfDim, HwcTestDim(w, dfDim.height()));
- rectList.clear();
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- return w;
- }
- }
- testPrintE("Failed to locate source crop max width");
- exit(35);
-}
-
-// Source crop maximum height
-uint32_t scMaxHeight(uint32_t format, const HwcTestDim& dfDim)
-{
- uint32_t h;
- list<Rectangle> rectList;
-
- for (h = searchLimits.sourceCrop.height(); h >= dfDim.height(); h--) {
- Rectangle rect(format, dfDim, HwcTestDim(dfDim.width(), h));
- rectList.clear();
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- return h;
- }
- }
- testPrintE("Failed to locate source crop max height");
- exit(36);
-}
-
-// Source crop minimum dimension
-// Discovers the source crop with the least number of pixels that the
-// HWC will commit to. Note, this may be different from scMinWidth
-// * scMinHeight, in that this function searches for a combination of
-// width and height. While the other routines always keep one of the
-// dimensions equal to the corresponding start dimension.
-HwcTestDim scMinDim(uint32_t format, const HwcTestDim& dfDim)
-{
- uint64_t bestMinPixels = 0;
- HwcTestDim bestDim;
- bool bestSet = false; // True when value has been assigned to
- // bestMinPixels and bestDim
-
- bool origVerbose = verbose; // Temporarily turn off verbose
- verbose = false;
- for (uint32_t w = 1; w <= dfDim.width(); w++) {
- for (uint32_t h = 1; h <= dfDim.height(); h++) {
- if (bestSet && ((w > bestMinPixels) || (h > bestMinPixels))) {
- break;
- }
-
- HwcTestDim dim(w, h);
- Rectangle rect(format, dfDim, HwcTestDim(w, h));
- list<Rectangle> rectList;
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- uint64_t pixels = dim.width() * dim.height();
- if (!bestSet || (pixels < bestMinPixels)) {
- bestMinPixels = pixels;
- bestDim = dim;
- bestSet = true;
- }
- }
- }
- }
- verbose = origVerbose;
-
- if (!bestSet) {
- testPrintE("Unable to locate source crop min dimension");
- exit(20);
- }
-
- return bestDim;
-}
-
-// Source crop maximum dimension
-HwcTestDim scMaxDim(uint32_t format, const HwcTestDim& dfDim)
-{
- uint64_t bestMaxPixels = 0;
- HwcTestDim bestDim;
- bool bestSet = false; // True when value has been assigned to
- // bestMaxPixels and bestDim;
-
- // Potentially increase benchmark performance by first checking
- // for the common case of supporting the maximum checked source size
- HwcTestDim dim = searchLimits.sourceCrop;
- Rectangle rect(format, dfDim, searchLimits.sourceCrop);
- list<Rectangle> rectList;
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num == 1) { return dim; }
-
- // TODO: Use a binary search
- bool origVerbose = verbose; // Temporarily turn off verbose
- verbose = false;
- for (uint32_t w = dfDim.width();
- w <= searchLimits.sourceCrop.width(); w++) {
- for (uint32_t h = dfDim.height();
- h <= searchLimits.sourceCrop.height(); h++) {
- if (bestSet && ((w * h) <= bestMaxPixels)) { continue; }
-
- HwcTestDim dim(w, h);
- Rectangle rect(format, dfDim, dim);
- list<Rectangle> rectList;
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
- if (num > 0) {
- uint64_t pixels = dim.width() * dim.height();
- if (!bestSet || (pixels > bestMaxPixels)) {
- bestMaxPixels = pixels;
- bestDim = dim;
- bestSet = true;
- }
- }
- }
- }
- verbose = origVerbose;
-
- if (!bestSet) {
- testPrintE("Unable to locate source crop max dimension");
- exit(21);
- }
-
- return bestDim;
-}
-
-// Source crop horizontal scale
-// Determines the maximum factor by which the source crop can be larger
-// that the display frame. The commit point is discovered through a
-// binary search of rational numbers. The numerator in each of the
-// rational numbers contains the dimension for the source crop, while
-// the denominator specifies the dimension for the display frame. On
-// each pass of the binary search the mid-point between the greatest
-// point committed to (best) and the smallest point in which a commit
-// has failed is calculated. This mid-point is then passed to a function
-// named double2Rational, which determines the closest rational numbers
-// just below and above the mid-point. By default the lower rational
-// number is used for the scale factor on the next pass of the binary
-// search. The upper value is only used when best is already equal
-// to the lower value. This only occurs when the lower value has already
-// been tried.
-Rational scHScale(uint32_t format,
- const HwcTestDim& dfMin, const HwcTestDim& dfMax,
- const HwcTestDim& scMin, const HwcTestDim& scMax,
- HwcTestDim& outBestDf, HwcTestDim& outBestSc)
-{
- HwcTestDim scDim, dfDim; // Source crop and display frame dimension
- Rational best(0, 1), minBad; // Current bounds for a binary search
- // MinGood is set below the lowest
- // possible scale. The value of minBad,
- // will be set by the first pass
- // of the binary search.
-
- // Perform the passes of the binary search
- bool firstPass = true;
- do {
- // On first pass try the maximum scale within the search limits
- if (firstPass) {
- // Try the maximum possible scale, within the search limits
- scDim = HwcTestDim(searchLimits.sourceCrop.width(), scMin.height());
- dfDim = dfMin;
- } else {
- // Subsequent pass
- // Halve the difference between best and minBad.
- Rational lower, upper, selected;
-
- // Try the closest ratio halfway between minBood and minBad;
- // TODO: Avoid rounding issue by using Rational type for
- // midpoint. For now will use double, which should
- // have more than sufficient resolution.
- double mid = (double) best
- + ((double) minBad - (double) best) / 2.0;
- Rational::double2Rational(mid,
- Range(scMin.width(), scMax.width()),
- Range(dfMin.width(), dfMax.width()),
- lower, upper);
- if (((lower == best) && (upper == minBad))) {
- return best;
- }
-
- // Use lower value unless its already been tried
- selected = (lower != best) ? lower : upper;
-
- // Assign the size of the source crop and display frame
- // from the selected ratio of source crop to display frame.
- scDim = HwcTestDim(selected.numerator(), scMin.height());
- dfDim = HwcTestDim(selected.denominator(), dfMin.height());
- }
-
- // See if the HWC will commit to this combination
- Rectangle rect(format, dfDim, scDim);
- list<Rectangle> rectList;
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
-
- if (verbose) {
- testPrintI(" scHscale num: %u scale: %f dfDim: %s scDim: %s",
- num, (float) Rational(scDim.width(), dfDim.width()),
- ((string) dfDim).c_str(), ((string) scDim).c_str());
- }
- if (num == 1) {
- // HWC committed to the combination
- // This is the best scale factor seen so far. Report the
- // dimensions to the caller, in case nothing better is seen.
- outBestDf = dfDim;
- outBestSc = scDim;
-
- // Success on the first pass means the largest possible scale
- // is supported, in which case no need to search any further.
- if (firstPass) { return Rational(scDim.width(), dfDim.width()); }
-
- // Update the lower bound of the binary search
- best = Rational(scDim.width(), dfDim.width());
- } else {
- // HWC didn't commit to this combination, so update the
- // upper bound of the binary search.
- minBad = Rational(scDim.width(), dfDim.width());
- }
-
- firstPass = false;
- } while (best != minBad);
-
- return best;
-}
-
-// Source crop vertical scale
-// Determines the maximum factor by which the source crop can be larger
-// that the display frame. The commit point is discovered through a
-// binary search of rational numbers. The numerator in each of the
-// rational numbers contains the dimension for the source crop, while
-// the denominator specifies the dimension for the display frame. On
-// each pass of the binary search the mid-point between the greatest
-// point committed to (best) and the smallest point in which a commit
-// has failed is calculated. This mid-point is then passed to a function
-// named double2Rational, which determines the closest rational numbers
-// just below and above the mid-point. By default the lower rational
-// number is used for the scale factor on the next pass of the binary
-// search. The upper value is only used when best is already equal
-// to the lower value. This only occurs when the lower value has already
-// been tried.
-Rational scVScale(uint32_t format,
- const HwcTestDim& dfMin, const HwcTestDim& dfMax,
- const HwcTestDim& scMin, const HwcTestDim& scMax,
- HwcTestDim& outBestDf, HwcTestDim& outBestSc)
-{
- HwcTestDim scDim, dfDim; // Source crop and display frame dimension
- Rational best(0, 1), minBad; // Current bounds for a binary search
- // MinGood is set below the lowest
- // possible scale. The value of minBad,
- // will be set by the first pass
- // of the binary search.
-
- // Perform the passes of the binary search
- bool firstPass = true;
- do {
- // On first pass try the maximum scale within the search limits
- if (firstPass) {
- // Try the maximum possible scale, within the search limits
- scDim = HwcTestDim(scMin.width(), searchLimits.sourceCrop.height());
- dfDim = dfMin;
- } else {
- // Subsequent pass
- // Halve the difference between best and minBad.
- Rational lower, upper, selected;
-
- // Try the closest ratio halfway between minBood and minBad;
- // TODO: Avoid rounding issue by using Rational type for
- // midpoint. For now will use double, which should
- // have more than sufficient resolution.
- double mid = (double) best
- + ((double) minBad - (double) best) / 2.0;
- Rational::double2Rational(mid,
- Range(scMin.height(), scMax.height()),
- Range(dfMin.height(), dfMax.height()),
- lower, upper);
- if (((lower == best) && (upper == minBad))) {
- return best;
- }
-
- // Use lower value unless its already been tried
- selected = (lower != best) ? lower : upper;
-
- // Assign the size of the source crop and display frame
- // from the selected ratio of source crop to display frame.
- scDim = HwcTestDim(scMin.width(), selected.numerator());
- dfDim = HwcTestDim(dfMin.width(), selected.denominator());
- }
-
- // See if the HWC will commit to this combination
- Rectangle rect(format, dfDim, scDim);
- list<Rectangle> rectList;
- rectList.push_back(rect);
- uint32_t num = numOverlays(rectList);
-
- if (verbose) {
- testPrintI(" scHscale num: %u scale: %f dfDim: %s scDim: %s",
- num, (float) Rational(scDim.height(), dfDim.height()),
- ((string) dfDim).c_str(), ((string) scDim).c_str());
- }
- if (num == 1) {
- // HWC committed to the combination
- // This is the best scale factor seen so far. Report the
- // dimensions to the caller, in case nothing better is seen.
- outBestDf = dfDim;
- outBestSc = scDim;
-
- // Success on the first pass means the largest possible scale
- // is supported, in which case no need to search any further.
- if (firstPass) { return Rational(scDim.height(), dfDim.height()); }
-
- // Update the lower bound of the binary search
- best = Rational(scDim.height(), dfDim.height());
- } else {
- // HWC didn't commit to this combination, so update the
- // upper bound of the binary search.
- minBad = Rational(scDim.height(), dfDim.height());
- }
-
- firstPass = false;
- } while (best != minBad);
-
- return best;
-}
-
-uint32_t numOverlapping(uint32_t backgroundFormat, uint32_t foregroundFormat,
- uint32_t backgroundBlend, uint32_t foregroundBlend)
-{
- list<Rectangle> rectList;
-
- Rectangle background(backgroundFormat, startDim, startDim);
- background.blend = backgroundBlend;
- rectList.push_back(background);
-
- // TODO: Handle cases where startDim is so small that adding 5
- // causes frames not to overlap.
- // TODO: Handle cases where startDim is so large that adding 5
- // cause a portion or all of the foreground displayFrame
- // to be off the display.
- Rectangle foreground(foregroundFormat, startDim, startDim);
- foreground.displayFrame.left += 5;
- foreground.displayFrame.top += 5;
- foreground.displayFrame.right += 5;
- foreground.displayFrame.bottom += 5;
- background.blend = foregroundBlend;
- rectList.push_back(foreground);
-
- uint32_t num = numOverlays(rectList);
-
- return num;
-}
-
-Rectangle::Rectangle(uint32_t graphicFormat, HwcTestDim dfDim,
- HwcTestDim sDim) :
- format(graphicFormat), transform(defaultTransform),
- blend(defaultBlend), color(defaultColor), alpha(defaultAlpha),
- sourceCrop(sDim), displayFrame(dfDim)
-{
- // Set source dimension
- // Can't use a base initializer, because the setting of format
- // must be done before setting the sourceDimension.
- setSourceDim(sDim);
-}
-
-void Rectangle::setSourceDim(HwcTestDim dim)
-{
- this->sourceDim = dim;
-
- const struct hwcTestGraphicFormat *attrib;
- attrib = hwcTestGraphicFormatLookup(this->format);
- if (attrib != NULL) {
- if (sourceDim.width() % attrib->wMod) {
- sourceDim.setWidth(sourceDim.width() + attrib->wMod
- - (sourceDim.width() % attrib->wMod));
- }
- if (sourceDim.height() % attrib->hMod) {
- sourceDim.setHeight(sourceDim.height() + attrib->hMod
- - (sourceDim.height() % attrib->hMod));
- }
- }
-}
-
-// Rational member functions
-bool Rational::operator==(const Rational& other) const
-{
- if (((uint64_t) _n * other._d)
- == ((uint64_t) _d * other._n)) { return true; }
-
- return false;
-}
-
-bool Rational::operator<(const Rational& other) const
-{
- if (((uint64_t) _n * other._d)
- < ((uint64_t) _d * other._n)) { return true; }
-
- return false;
-}
-
-Rational::operator string() const
-{
- ostringstream out;
-
- out << _n << '/' << _d;
-
- return out.str();
-}
-
-void Rational::double2Rational(double f, Range nRange, Range dRange,
- Rational& lower, Rational& upper)
-{
- Rational bestLower(nRange.lower(), dRange.upper());
- Rational bestUpper(nRange.upper(), dRange.lower());
-
- // Search for a better solution
- for (uint32_t d = dRange.lower(); d <= dRange.upper(); d++) {
- Rational val(d * f, d); // Lower, because double to int cast truncates
-
- if ((val.numerator() < nRange.lower())
- || (val.numerator() > nRange.upper())) { continue; }
-
- if (((double) val > (double) bestLower) && ((double) val <= f)) {
- bestLower = val;
- }
-
- val.setNumerator(val.numerator() + 1);
- if (val.numerator() > nRange.upper()) { continue; }
-
- if (((double) val < (double) bestUpper) && ((double) val >= f)) {
- bestUpper = val;
- }
- }
-
- lower = bestLower;
- upper = bestUpper;
-}
-
-// Local functions
-
-// Num Overlays
-// Given a list of rectangles, determine how many HWC will commit to render
-uint32_t numOverlays(list<Rectangle>& rectList)
-{
- hwc_layer_list_t *hwcList;
- list<sp<GraphicBuffer> > buffers;
-
- hwcList = hwcTestCreateLayerList(rectList.size());
- if (hwcList == NULL) {
- testPrintE("numOverlays create hwcList failed");
- exit(30);
- }
-
- hwc_layer_t *layer = &hwcList->hwLayers[0];
- for (std::list<Rectangle>::iterator it = rectList.begin();
- it != rectList.end(); ++it, ++layer) {
- // Allocate the texture for the source frame
- // and push it onto the buffers list, so that it
- // stays in scope until a return from this function.
- sp<GraphicBuffer> texture;
- texture = new GraphicBuffer(it->sourceDim.width(),
- it->sourceDim.height(),
- it->format, texUsage);
- buffers.push_back(texture);
-
- layer->handle = texture->handle;
- layer->blending = it->blend;
- layer->transform = it->transform;
- layer->sourceCrop = it->sourceCrop;
- layer->displayFrame = it->displayFrame;
-
- layer->visibleRegionScreen.numRects = 1;
- layer->visibleRegionScreen.rects = &layer->displayFrame;
- }
-
- // Perform prepare operation
- if (verbose) { testPrintI("Prepare:"); hwcTestDisplayList(hwcList); }
- hwcDevice->prepare(hwcDevice, hwcList);
- if (verbose) {
- testPrintI("Post Prepare:");
- hwcTestDisplayListPrepareModifiable(hwcList);
- }
-
- // Count the number of overlays
- uint32_t total = 0;
- for (unsigned int n1 = 0; n1 < hwcList->numHwLayers; n1++) {
- if (hwcList->hwLayers[n1].compositionType == HWC_OVERLAY) {
- total++;
- }
- }
-
- // Free the layer list and graphic buffers
- hwcTestFreeLayerList(hwcList);
-
- return total;
-}
-
-string transformList2str(const list<uint32_t>& transformList)
-{
- ostringstream out;
-
- for (list<uint32_t>::const_iterator it = transformList.begin();
- it != transformList.end(); ++it) {
- uint32_t id = *it;
-
- if (it != transformList.begin()) {
- out << ", ";
- }
- out << id;
-
- for (unsigned int idx = 0; idx < NUMA(transformType); idx++) {
- if (id == transformType[idx].id) {
- out << " (" << transformType[idx].desc << ')';
- break;
- }
- }
- }
-
- return out.str();
-}
-
-string blendList2str(const list<uint32_t>& blendList)
-{
- ostringstream out;
-
- for (list<uint32_t>::const_iterator it = blendList.begin();
- it != blendList.end(); ++it) {
- uint32_t id = *it;
-
- if (it != blendList.begin()) {
- out << ", ";
- }
- out << id;
-
- for (unsigned int idx = 0; idx < NUMA(blendType); idx++) {
- if (id == blendType[idx].id) {
- out << " (" << blendType[idx].desc << ')';
- break;
- }
- }
- }
-
- return out.str();
-}
-
-void init(void)
-{
- srand48(0);
-
- hwcTestInitDisplay(verbose, &dpy, &surface, &width, &height);
-
- hwcTestOpenHwc(&hwcDevice);
-}
-
-void printFormatHeadings(size_t indent)
-{
- for (size_t row = 0; row <= maxHeadingLen; row++) {
- ostringstream line;
- for(vector<string>::iterator it = formats.begin();
- it != formats.end(); ++it) {
- if ((maxHeadingLen - row) <= it->length()) {
- if (row != maxHeadingLen) {
- char ch = (*it)[it->length() - (maxHeadingLen - row)];
- line << ' ' << setw(printFieldWidth) << ch;
- } else {
- line << ' ' << string(printFieldWidth, '-');
- }
- } else {
- line << ' ' << setw(printFieldWidth) << "";
- }
- }
- testPrintI("%*s%s", indent + maxHeadingLen, "",
- line.str().c_str());
- }
-}
-
-void printOverlapLine(size_t indent, const string formatStr,
- const vector<uint32_t>& results)
-{
- ostringstream line;
-
- line << setw(indent + maxHeadingLen - formatStr.length()) << "";
-
- line << formatStr;
-
- for (vector<uint32_t>::const_iterator it = results.begin();
- it != results.end(); ++it) {
- line << ' ' << setw(printFieldWidth) << *it;
- }
-
- testPrintI("%s", line.str().c_str());
-}
-
-void printSyntax(const char *cmd)
-{
- testPrintE(" %s [options] [graphicFormat] ...",
- cmd);
- testPrintE(" options:");
- testPrintE(" -s [width, height] - start dimension");
- testPrintE(" -v - Verbose");
- testPrintE("");
- testPrintE(" graphic formats:");
- for (unsigned int n1 = 0; n1 < NUMA(hwcTestGraphicFormat); n1++) {
- testPrintE(" %s", hwcTestGraphicFormat[n1].desc);
- }
-}
diff --git a/opengl/tests/hwc/hwcRects.cpp b/opengl/tests/hwc/hwcRects.cpp
deleted file mode 100644
index 906c169..0000000
--- a/opengl/tests/hwc/hwcRects.cpp
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-/*
- * Hardware Composer Rectangles
- *
- * Synopsis
- * hwcRects [options] (graphicFormat displayFrame [attributes],)...
- * options:
- * -D #.## - End of test delay
- * -v - Verbose
- *
- * graphic formats:
- * RGBA8888 (reference frame default)
- * RGBX8888
- * RGB888
- * RGB565
- * BGRA8888
- * RGBA5551
- * RGBA4444
- * YV12
- *
- * displayFrame
- * [left, top, right, bottom]
- *
- * attributes:
- * transform: none | fliph | flipv | rot90 | rot180 | rot270
- * blend: none | premult | coverage
- * color: [0.##, 0.##, 0.##]
- * alpha: 0.##
- * sourceDim: [width, height]
- * sourceCrop: [left, top, right, bottom]
- *
- * Example:
- * # White YV12 rectangle, with overlapping turquoise
- * # RGBA8888 rectangle at 30%% (alpha: 0.7) transparency
- * hwcRects -v -D 30.0 \
- * YV12 [50, 80, 200, 300] transform: none \
- * color: [1.0, 0.5, 0.5], \
- * RGBA8888 [100, 150, 300, 400] blend: coverage \
- * color: [0.251, 0.878, 0.816] alpha: 0.7 \
- * sourceDim: [50, 60] sourceCrop: [5, 8, 12, 15]
- *
- * Description
- * Constructs a Hardware Composer (HWC) list of frames from
- * command-line specified parameters. Then sends it to the HWC
- * be rendered. The intended purpose of this tool is as a means to
- * reproduce and succinctly specify an observed HWC operation, with
- * no need to modify/compile a program.
- *
- * The command-line syntax consists of a few standard command-line
- * options and then a description of one or more frames. The frame
- * descriptions are separated from one another via a comma. The
- * beginning of a frame description requires the specification
- * of the graphic format and then the display frame rectangle where
- * the frame will be displayed. The display frame rectangle is
- * specified as follows, with the right and bottom coordinates being
- * exclusive values:
- *
- * [left, top, right, bottom]
- *
- * After these two required parameters each frame description can
- * specify 1 or more optional attributes. The name of each optional
- * attribute is preceded by a colon. The current implementation
- * then requires white space after the colon and then the value of
- * the attribute is specified. See the synopsis section above for
- * a list of attributes and the format of their expected value.
- */
-
-#include <algorithm>
-#include <assert.h>
-#include <cerrno>
-#include <cmath>
-#include <cstdlib>
-#include <ctime>
-#include <istream>
-#include <libgen.h>
-#include <list>
-#include <sched.h>
-#include <sstream>
-#include <stdint.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include <ui/GraphicBuffer.h>
-
-#define LOG_TAG "hwcRectsTest"
-#include <utils/Log.h>
-#include <testUtil.h>
-
-#include <hardware/hwcomposer.h>
-
-#include <glTestLib.h>
-#include "hwcTestLib.h"
-
-using namespace std;
-using namespace android;
-
-// Defaults
-const bool defaultVerbose = false;
-const float defaultEndDelay = 2.0; // Default delay after rendering graphics
-
-const uint32_t defaultFormat = HAL_PIXEL_FORMAT_RGBA_8888;
-const int32_t defaultTransform = 0;
-const uint32_t defaultBlend = HWC_BLENDING_NONE;
-const ColorFract defaultColor(0.5, 0.5, 0.5);
-const float defaultAlpha = 1.0; // Opaque
-const HwcTestDim defaultSourceDim(1, 1);
-const struct hwc_rect defaultSourceCrop = {0, 0, 1, 1};
-const struct hwc_rect defaultDisplayFrame = {0, 0, 100, 100};
-
-// Defines
-#define MAXCMD 200
-#define CMD_STOP_FRAMEWORK "stop 2>&1"
-#define CMD_START_FRAMEWORK "start 2>&1"
-
-// Macros
-#define NUMA(a) (sizeof(a) / sizeof(a [0])) // Num elements in an array
-
-// Local types
-class Rectangle {
-public:
- Rectangle() : format(defaultFormat), transform(defaultTransform),
- blend(defaultBlend), color(defaultColor),
- alpha(defaultAlpha), sourceDim(defaultSourceDim),
- sourceCrop(defaultSourceCrop),
- displayFrame(defaultDisplayFrame) {};
-
- uint32_t format;
- uint32_t transform;
- int32_t blend;
- ColorFract color;
- float alpha;
- HwcTestDim sourceDim;
- struct hwc_rect sourceCrop;
- struct hwc_rect displayFrame;
-
- sp<GraphicBuffer> texture;
-};
-
-// Globals
-list<Rectangle> rectangle;
-static const int texUsage = GraphicBuffer::USAGE_HW_TEXTURE |
- GraphicBuffer::USAGE_SW_WRITE_RARELY;
-static hwc_composer_device_t *hwcDevice;
-static EGLDisplay dpy;
-static EGLSurface surface;
-static EGLint width, height;
-
-// Function prototypes
-static Rectangle parseRect(string rectStr);
-void init(void);
-void printSyntax(const char *cmd);
-
-// Command-line option settings
-static bool verbose = defaultVerbose;
-static float endDelay = defaultEndDelay;
-
-/*
- * Main
- *
- * Performs the following high-level sequence of operations:
- *
- * 1. Parse command-line options
- *
- * 2. Stop framework
- *
- * 3. Initialization
- *
- * 4. Parse frame descriptions
- *
- * 5. Create HWC list from frame descriptions
- *
- * 6. Have HWC render the list description of the frames
- *
- * 7. Delay for amount of time given by endDelay
- *
- * 8. Start framework
- */
-int
-main(int argc, char *argv[])
-{
- int rv, opt;
- char *chptr;
- bool error;
- string str;
- char cmd[MAXCMD];
-
- testSetLogCatTag(LOG_TAG);
-
- // Parse command line arguments
- while ((opt = getopt(argc, argv, "D:v?h")) != -1) {
- switch (opt) {
- case 'D': // End of test delay
- endDelay = strtod(optarg, &chptr);
- if ((*chptr != '\0') || (endDelay < 0.0)) {
- testPrintE("Invalid command-line specified end of test delay "
- "of: %s", optarg);
- exit(1);
- }
- break;
-
- case 'v': // Verbose
- verbose = true;
- break;
-
- case 'h': // Help
- case '?':
- default:
- printSyntax(basename(argv[0]));
- exit(((optopt == 0) || (optopt == '?')) ? 0 : 2);
- }
- }
-
- // Stop framework
- rv = snprintf(cmd, sizeof(cmd), "%s", CMD_STOP_FRAMEWORK);
- if (rv >= (signed) sizeof(cmd) - 1) {
- testPrintE("Command too long for: %s", CMD_STOP_FRAMEWORK);
- exit(3);
- }
- testExecCmd(cmd);
- testDelay(1.0); // TODO - needs means to query whether asyncronous stop
- // framework operation has completed. For now, just wait
- // a long time.
-
- init();
-
- // Parse rectangle descriptions
- int numOpen = 0; // Current number of unmatched <[
- string rectDesc(""); // String description of a single rectangle
- while (optind < argc) {
- string argNext = string(argv[optind++]);
-
- if (rectDesc.length()) { rectDesc += ' '; }
- rectDesc += argNext;
-
- // Count number of opening <[ and matching >]
- // At this point not worried about an opening character being
- // matched by it's corresponding closing character. For example,
- // "<1.0, 2.0]" is incorrect because the opening < should be matched
- // with a closing >, instead of the closing ]. Such errors are
- // detected when the actual value is parsed.
- for (unsigned int n1 = 0; n1 < argNext.length(); n1++) {
- switch(argNext[n1]) {
- case '[':
- case '<':
- numOpen++;
- break;
-
- case ']':
- case '>':
- numOpen--;
- break;
- }
-
- // Error anytime there is more closing then opening characters
- if (numOpen < 0) {
- testPrintI("Mismatched number of opening <[ with "
- "closing >] in: %s", rectDesc.c_str());
- exit(4);
- }
- }
-
- // Description of a rectangle is complete when all opening
- // <[ are closed with >] and the string ends with a comma or
- // there are no more args.
- if ((numOpen == 0) && rectDesc.length()
- && ((rectDesc[rectDesc.length() - 1] == ',')
- || (optind == argc))) {
- // Remove trailing comma if it is present
- if (rectDesc[rectDesc.length() - 1] == ',') {
- rectDesc.erase(rectDesc.length() - 1);
- }
-
- // Parse string description of rectangle
- Rectangle rect = parseRect(rectDesc);
-
- // Add to the list of rectangles
- rectangle.push_back(rect);
-
- // Prepare for description of another rectangle
- rectDesc = string("");
- }
- }
-
- // Create list of frames
- hwc_layer_list_t *list;
- list = hwcTestCreateLayerList(rectangle.size());
- if (list == NULL) {
- testPrintE("hwcTestCreateLayerList failed");
- exit(5);
- }
-
- hwc_layer_t *layer = &list->hwLayers[0];
- for (std::list<Rectangle>::iterator it = rectangle.begin();
- it != rectangle.end(); ++it, ++layer) {
- layer->handle = it->texture->handle;
- layer->blending = it->blend;
- layer->transform = it->transform;
- layer->sourceCrop = it->sourceCrop;
- layer->displayFrame = it->displayFrame;
-
- layer->visibleRegionScreen.numRects = 1;
- layer->visibleRegionScreen.rects = &layer->displayFrame;
- }
-
- // Perform prepare operation
- if (verbose) { testPrintI("Prepare:"); hwcTestDisplayList(list); }
- hwcDevice->prepare(hwcDevice, list);
- if (verbose) {
- testPrintI("Post Prepare:");
- hwcTestDisplayListPrepareModifiable(list);
- }
-
- // Turn off the geometry changed flag
- list->flags &= ~HWC_GEOMETRY_CHANGED;
-
- // Perform the set operation(s)
- if (verbose) {testPrintI("Set:"); }
- if (verbose) { hwcTestDisplayListHandles(list); }
- hwcDevice->set(hwcDevice, dpy, surface, list);
-
- testDelay(endDelay);
-
- // Start framework
- rv = snprintf(cmd, sizeof(cmd), "%s", CMD_START_FRAMEWORK);
- if (rv >= (signed) sizeof(cmd) - 1) {
- testPrintE("Command too long for: %s", CMD_START_FRAMEWORK);
- exit(6);
- }
- testExecCmd(cmd);
-
- return 0;
-}
-
-// Parse string description of rectangle and add it to list of rectangles
-// to be rendered.
-static Rectangle parseRect(string rectStr)
-{
- int rv;
- string str;
- bool error;
- istringstream in(rectStr);
- const struct hwcTestGraphicFormat *format;
- Rectangle rect;
- struct hwc_rect hwcRect;
-
- // Graphic Format
- in >> str;
- if (!in) {
- testPrintE("Error parsing format from: %s", rectStr.c_str());
- exit(20);
- }
- format = hwcTestGraphicFormatLookup(str.c_str());
- if (format == NULL) {
- testPrintE("Unknown graphic format in: %s", rectStr.c_str());
- exit(21);
- }
- rect.format = format->format;
-
- // Display Frame
- rect.displayFrame = hwcTestParseHwcRect(in, error);
- if (error) {
- testPrintE("Invalid display frame in: %s", rectStr.c_str());
- exit(22);
- }
-
- // Set default sourceDim and sourceCrop based on size of display frame.
- // Default is source size equal to the size of the display frame, with
- // the source crop being the entire size of the source frame.
- rect.sourceDim = HwcTestDim(rect.displayFrame.right
- - rect.displayFrame.left,
- rect.displayFrame.bottom
- - rect.displayFrame.top);
- rect.sourceCrop.left = 0;
- rect.sourceCrop.top = 0;
- rect.sourceCrop.right = rect.sourceDim.width();
- rect.sourceCrop.bottom = rect.sourceDim.height();
-
- // Optional settings
- while ((in.tellg() < (streampos) in.str().length())
- && (in.tellg() != (streampos) -1)) {
- string attrName;
-
- in >> attrName;
- if (in.eof()) { break; }
- if (!in) {
- testPrintE("Error reading attribute name in: %s",
- rectStr.c_str());
- exit(23);
- }
-
- // Transform
- if (attrName == "transform:") { // Transform
- string str;
-
- in >> str;
- if (str == "none") {
- rect.transform = 0;
- } else if (str == "fliph") {
- rect.transform = HWC_TRANSFORM_FLIP_H;
- } else if (str == "flipv") {
- rect.transform = HWC_TRANSFORM_FLIP_V;
- } else if (str == "rot90") {
- rect.transform = HWC_TRANSFORM_ROT_90;
- } else if (str == "rot180") {
- rect.transform = HWC_TRANSFORM_ROT_180;
- } else if (str == "rot270") {
- rect.transform = HWC_TRANSFORM_ROT_270;
- } else {
- testPrintE("Unknown transform of \"%s\" in: %s", str.c_str(),
- rectStr.c_str());
- exit(24);
- }
- } else if (attrName == "blend:") { // Blend
- string str;
-
- in >> str;
- if (str == string("none")) {
- rect.blend = HWC_BLENDING_NONE;
- } else if (str == "premult") {
- rect.blend = HWC_BLENDING_PREMULT;
- } else if (str == "coverage") {
- rect.blend = HWC_BLENDING_COVERAGE;
- } else {
- testPrintE("Unknown blend of \"%s\" in: %s", str.c_str(),
- rectStr.c_str());
- exit(25);
- }
- } else if (attrName == "color:") { // Color
- rect.color = hwcTestParseColor(in, error);
- if (error) {
- testPrintE("Error parsing color in: %s", rectStr.c_str());
- exit(26);
- }
- } else if (attrName == "alpha:") { // Alpha
- in >> rect.alpha;
- if (!in) {
- testPrintE("Error parsing value for alpha attribute in: %s",
- rectStr.c_str());
- exit(27);
- }
- } else if (attrName == "sourceDim:") { // Source Dimension
- rect.sourceDim = hwcTestParseDim(in, error);
- if (error) {
- testPrintE("Error parsing source dimenision in: %s",
- rectStr.c_str());
- exit(28);
- }
- } else if (attrName == "sourceCrop:") { // Source Crop
- rect.sourceCrop = hwcTestParseHwcRect(in, error);
- if (error) {
- testPrintE("Error parsing source crop in: %s",
- rectStr.c_str());
- exit(29);
- }
- } else { // Unknown attribute
- testPrintE("Unknown attribute of \"%s\" in: %s", attrName.c_str(),
- rectStr.c_str());
- exit(30);
- }
- }
-
- // Validate
- if (((uint32_t) rect.sourceCrop.left >= rect.sourceDim.width())
- || ((uint32_t) rect.sourceCrop.right > rect.sourceDim.width())
- || ((uint32_t) rect.sourceCrop.top >= rect.sourceDim.height())
- || ((uint32_t) rect.sourceCrop.bottom > rect.sourceDim.height())) {
- testPrintE("Invalid source crop in: %s", rectStr.c_str());
- exit(31);
- }
- if ((rect.displayFrame.left >= width)
- || (rect.displayFrame.right > width)
- || (rect.displayFrame.top >= height)
- || (rect.displayFrame.bottom > height)) {
- testPrintE("Invalid display frame in: %s", rectStr.c_str());
- exit(32);
- }
- if ((rect.alpha < 0.0) || (rect.alpha > 1.0)) {
- testPrintE("Invalid alpha in: %s", rectStr.c_str());
- exit(33);
- }
-
- // Create source texture
- rect.texture = new GraphicBuffer(rect.sourceDim.width(),
- rect.sourceDim.height(),
- rect.format, texUsage);
- if ((rv = rect.texture->initCheck()) != NO_ERROR) {
- testPrintE("source texture initCheck failed, rv: %i", rv);
- testPrintE(" %s", rectStr.c_str());
-
- }
-
- // Fill with uniform color
- hwcTestFillColor(rect.texture.get(), rect.color, rect.alpha);
- if (verbose) {
- testPrintI(" buf: %p handle: %p format: %s width: %u height: %u "
- "color: %s alpha: %f",
- rect.texture.get(), rect.texture->handle, format->desc,
- rect.sourceDim.width(), rect.sourceDim.height(),
- string(rect.color).c_str(), rect.alpha);
- }
-
- return rect;
-}
-
-void init(void)
-{
- // Seed pseudo random number generator
- // Needed so that the pad areas of frames are filled with a deterministic
- // pseudo random value.
- srand48(0);
-
- hwcTestInitDisplay(verbose, &dpy, &surface, &width, &height);
-
- hwcTestOpenHwc(&hwcDevice);
-}
-
-void printSyntax(const char *cmd)
-{
- testPrintE(" %s [options] (graphicFormat displayFrame [attributes],)...",
- cmd);
- testPrintE(" options:");
- testPrintE(" -D End of test delay");
- testPrintE(" -v Verbose");
- testPrintE("");
- testPrintE(" graphic formats:");
- for (unsigned int n1 = 0; n1 < NUMA(hwcTestGraphicFormat); n1++) {
- testPrintE(" %s", hwcTestGraphicFormat[n1].desc);
- }
- testPrintE("");
- testPrintE(" displayFrame");
- testPrintE(" [left, top, right, bottom]");
- testPrintE("");
- testPrintE(" attributes:");
- testPrintE(" transform: none | fliph | flipv | rot90 | rot180 "
- " | rot270");
- testPrintE(" blend: none | premult | coverage");
- testPrintE(" color: [0.##, 0.##, 0.##]");
- testPrintE(" alpha: 0.##");
- testPrintE(" sourceDim: [width, height]");
- testPrintE(" sourceCrop: [left, top, right, bottom]");
- testPrintE("");
- testPrintE(" Example:");
- testPrintE(" # White YV12 rectangle, with overlapping turquoise ");
- testPrintE(" # RGBA8888 rectangle at 30%% (alpha: 0.7) transparency");
- testPrintE(" %s -v -D 30.0 \\", cmd);
- testPrintE(" YV12 [50, 80, 200, 300] transform: none \\");
- testPrintE(" color: [1.0, 0.5, 0.5], \\");
- testPrintE(" RGBA8888 [100, 150, 300, 400] blend: coverage \\");
- testPrintE(" color: [0.251, 0.878, 0.816] alpha: 0.7 \\");
- testPrintE(" sourceDim: [50, 60] sourceCrop: [5, 8, 12, 15]");
-}
diff --git a/opengl/tests/hwc/hwcStress.cpp b/opengl/tests/hwc/hwcStress.cpp
deleted file mode 100644
index b02a424..0000000
--- a/opengl/tests/hwc/hwcStress.cpp
+++ /dev/null
@@ -1,644 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- *
- */
-
-/*
- * Hardware Composer stress test
- *
- * Performs a pseudo-random (prandom) sequence of operations to the
- * Hardware Composer (HWC), for a specified number of passes or for
- * a specified period of time. By default the period of time is FLT_MAX,
- * so that the number of passes will take precedence.
- *
- * The passes are grouped together, where (pass / passesPerGroup) specifies
- * which group a particular pass is in. This causes every passesPerGroup
- * worth of sequential passes to be within the same group. Computationally
- * intensive operations are performed just once at the beginning of a group
- * of passes and then used by all the passes in that group. This is done
- * so as to increase both the average and peak rate of graphic operations,
- * by moving computationally intensive operations to the beginning of a group.
- * In particular, at the start of each group of passes a set of
- * graphic buffers are created, then used by the first and remaining
- * passes of that group of passes.
- *
- * The per-group initialization of the graphic buffers is performed
- * by a function called initFrames. This function creates an array
- * of smart pointers to the graphic buffers, in the form of a vector
- * of vectors. The array is accessed in row major order, so each
- * row is a vector of smart pointers. All the pointers of a single
- * row point to graphic buffers which use the same pixel format and
- * have the same dimension, although it is likely that each one is
- * filled with a different color. This is done so that after doing
- * the first HWC prepare then set call, subsequent set calls can
- * be made with each of the layer handles changed to a different
- * graphic buffer within the same row. Since the graphic buffers
- * in a particular row have the same pixel format and dimension,
- * additional HWC set calls can be made, without having to perform
- * an HWC prepare call.
- *
- * This test supports the following command-line options:
- *
- * -v Verbose
- * -s num Starting pass
- * -e num Ending pass
- * -p num Execute the single pass specified by num
- * -n num Number of set operations to perform after each prepare operation
- * -t float Maximum time in seconds to execute the test
- * -d float Delay in seconds performed after each set operation
- * -D float Delay in seconds performed after the last pass is executed
- *
- * Typically the test is executed for a large range of passes. By default
- * passes 0 through 99999 (100,000 passes) are executed. Although this test
- * does not validate the generated image, at times it is useful to reexecute
- * a particular pass and leave the displayed image on the screen for an
- * extended period of time. This can be done either by setting the -s
- * and -e options to the desired pass, along with a large value for -D.
- * This can also be done via the -p option, again with a large value for
- * the -D options.
- *
- * So far this test only contains code to create graphic buffers with
- * a continuous solid color. Although this test is unable to validate the
- * image produced, any image that contains other than rectangles of a solid
- * color are incorrect. Note that the rectangles may use a transparent
- * color and have a blending operation that causes the color in overlapping
- * rectangles to be mixed. In such cases the overlapping portions may have
- * a different color from the rest of the rectangle.
- */
-
-#include <algorithm>
-#include <assert.h>
-#include <cerrno>
-#include <cmath>
-#include <cstdlib>
-#include <ctime>
-#include <libgen.h>
-#include <sched.h>
-#include <sstream>
-#include <stdint.h>
-#include <string.h>
-#include <unistd.h>
-#include <vector>
-
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include <ui/GraphicBuffer.h>
-
-#define LOG_TAG "hwcStressTest"
-#include <utils/Log.h>
-#include <testUtil.h>
-
-#include <hardware/hwcomposer.h>
-
-#include <glTestLib.h>
-#include "hwcTestLib.h"
-
-using namespace std;
-using namespace android;
-
-const float maxSizeRatio = 1.3; // Graphic buffers can be upto this munch
- // larger than the default screen size
-const unsigned int passesPerGroup = 10; // A group of passes all use the same
- // graphic buffers
-
-// Ratios at which rare and frequent conditions should be produced
-const float rareRatio = 0.1;
-const float freqRatio = 0.9;
-
-// Defaults for command-line options
-const bool defaultVerbose = false;
-const unsigned int defaultStartPass = 0;
-const unsigned int defaultEndPass = 99999;
-const unsigned int defaultPerPassNumSet = 10;
-const float defaultPerSetDelay = 0.0; // Default delay after each set
- // operation. Default delay of
- // zero used so as to perform the
- // the set operations as quickly
- // as possible.
-const float defaultEndDelay = 2.0; // Default delay between completion of
- // final pass and restart of framework
-const float defaultDuration = FLT_MAX; // A fairly long time, so that
- // range of passes will have
- // precedence
-
-// Command-line option settings
-static bool verbose = defaultVerbose;
-static unsigned int startPass = defaultStartPass;
-static unsigned int endPass = defaultEndPass;
-static unsigned int numSet = defaultPerPassNumSet;
-static float perSetDelay = defaultPerSetDelay;
-static float endDelay = defaultEndDelay;
-static float duration = defaultDuration;
-
-// Command-line mutual exclusion detection flags.
-// Corresponding flag set true once an option is used.
-bool eFlag, sFlag, pFlag;
-
-#define MAXSTR 100
-#define MAXCMD 200
-#define BITSPERBYTE 8 // TODO: Obtain from <values.h>, once
- // it has been added
-
-#define CMD_STOP_FRAMEWORK "stop 2>&1"
-#define CMD_START_FRAMEWORK "start 2>&1"
-
-#define NUMA(a) (sizeof(a) / sizeof(a [0]))
-#define MEMCLR(addr, size) do { \
- memset((addr), 0, (size)); \
- } while (0)
-
-// File scope constants
-const unsigned int blendingOps[] = {
- HWC_BLENDING_NONE,
- HWC_BLENDING_PREMULT,
- HWC_BLENDING_COVERAGE,
-};
-const unsigned int layerFlags[] = {
- HWC_SKIP_LAYER,
-};
-const vector<unsigned int> vecLayerFlags(layerFlags,
- layerFlags + NUMA(layerFlags));
-
-const unsigned int transformFlags[] = {
- HWC_TRANSFORM_FLIP_H,
- HWC_TRANSFORM_FLIP_V,
- HWC_TRANSFORM_ROT_90,
- // ROT_180 & ROT_270 intentionally not listed, because they
- // they are formed from combinations of the flags already listed.
-};
-const vector<unsigned int> vecTransformFlags(transformFlags,
- transformFlags + NUMA(transformFlags));
-
-// File scope globals
-static const int texUsage = GraphicBuffer::USAGE_HW_TEXTURE |
- GraphicBuffer::USAGE_SW_WRITE_RARELY;
-static hwc_composer_device_t *hwcDevice;
-static EGLDisplay dpy;
-static EGLSurface surface;
-static EGLint width, height;
-static vector <vector <sp<GraphicBuffer> > > frames;
-
-// File scope prototypes
-void init(void);
-void initFrames(unsigned int seed);
-template <class T> vector<T> vectorRandSelect(const vector<T>& vec, size_t num);
-template <class T> T vectorOr(const vector<T>& vec);
-
-/*
- * Main
- *
- * Performs the following high-level sequence of operations:
- *
- * 1. Command-line parsing
- *
- * 2. Initialization
- *
- * 3. For each pass:
- *
- * a. If pass is first pass or in a different group from the
- * previous pass, initialize the array of graphic buffers.
- *
- * b. Create a HWC list with room to specify a prandomly
- * selected number of layers.
- *
- * c. Select a subset of the rows from the graphic buffer array,
- * such that there is a unique row to be used for each
- * of the layers in the HWC list.
- *
- * d. Prandomly fill in the HWC list with handles
- * selected from any of the columns of the selected row.
- *
- * e. Pass the populated list to the HWC prepare call.
- *
- * f. Pass the populated list to the HWC set call.
- *
- * g. If additional set calls are to be made, then for each
- * additional set call, select a new set of handles and
- * perform the set call.
- */
-int
-main(int argc, char *argv[])
-{
- int rv, opt;
- char *chptr;
- unsigned int pass;
- char cmd[MAXCMD];
- struct timeval startTime, currentTime, delta;
-
- testSetLogCatTag(LOG_TAG);
-
- // Parse command line arguments
- while ((opt = getopt(argc, argv, "vp:d:D:n:s:e:t:?h")) != -1) {
- switch (opt) {
- case 'd': // Delay after each set operation
- perSetDelay = strtod(optarg, &chptr);
- if ((*chptr != '\0') || (perSetDelay < 0.0)) {
- testPrintE("Invalid command-line specified per pass delay of: "
- "%s", optarg);
- exit(1);
- }
- break;
-
- case 'D': // End of test delay
- // Delay between completion of final pass and restart
- // of framework
- endDelay = strtod(optarg, &chptr);
- if ((*chptr != '\0') || (endDelay < 0.0)) {
- testPrintE("Invalid command-line specified end of test delay "
- "of: %s", optarg);
- exit(2);
- }
- break;
-
- case 't': // Duration
- duration = strtod(optarg, &chptr);
- if ((*chptr != '\0') || (duration < 0.0)) {
- testPrintE("Invalid command-line specified duration of: %s",
- optarg);
- exit(3);
- }
- break;
-
- case 'n': // Num set operations per pass
- numSet = strtoul(optarg, &chptr, 10);
- if (*chptr != '\0') {
- testPrintE("Invalid command-line specified num set per pass "
- "of: %s", optarg);
- exit(4);
- }
- break;
-
- case 's': // Starting Pass
- sFlag = true;
- if (pFlag) {
- testPrintE("Invalid combination of command-line options.");
- testPrintE(" The -p option is mutually exclusive from the");
- testPrintE(" -s and -e options.");
- exit(5);
- }
- startPass = strtoul(optarg, &chptr, 10);
- if (*chptr != '\0') {
- testPrintE("Invalid command-line specified starting pass "
- "of: %s", optarg);
- exit(6);
- }
- break;
-
- case 'e': // Ending Pass
- eFlag = true;
- if (pFlag) {
- testPrintE("Invalid combination of command-line options.");
- testPrintE(" The -p option is mutually exclusive from the");
- testPrintE(" -s and -e options.");
- exit(7);
- }
- endPass = strtoul(optarg, &chptr, 10);
- if (*chptr != '\0') {
- testPrintE("Invalid command-line specified ending pass "
- "of: %s", optarg);
- exit(8);
- }
- break;
-
- case 'p': // Run a single specified pass
- pFlag = true;
- if (sFlag || eFlag) {
- testPrintE("Invalid combination of command-line options.");
- testPrintE(" The -p option is mutually exclusive from the");
- testPrintE(" -s and -e options.");
- exit(9);
- }
- startPass = endPass = strtoul(optarg, &chptr, 10);
- if (*chptr != '\0') {
- testPrintE("Invalid command-line specified pass of: %s",
- optarg);
- exit(10);
- }
- break;
-
- case 'v': // Verbose
- verbose = true;
- break;
-
- case 'h': // Help
- case '?':
- default:
- testPrintE(" %s [options]", basename(argv[0]));
- testPrintE(" options:");
- testPrintE(" -p Execute specified pass");
- testPrintE(" -s Starting pass");
- testPrintE(" -e Ending pass");
- testPrintE(" -t Duration");
- testPrintE(" -d Delay after each set operation");
- testPrintE(" -D End of test delay");
- testPrintE(" -n Num set operations per pass");
- testPrintE(" -v Verbose");
- exit(((optopt == 0) || (optopt == '?')) ? 0 : 11);
- }
- }
- if (endPass < startPass) {
- testPrintE("Unexpected ending pass before starting pass");
- testPrintE(" startPass: %u endPass: %u", startPass, endPass);
- exit(12);
- }
- if (argc != optind) {
- testPrintE("Unexpected command-line postional argument");
- testPrintE(" %s [-s start_pass] [-e end_pass] [-t duration]",
- basename(argv[0]));
- exit(13);
- }
- testPrintI("duration: %g", duration);
- testPrintI("startPass: %u", startPass);
- testPrintI("endPass: %u", endPass);
- testPrintI("numSet: %u", numSet);
-
- // Stop framework
- rv = snprintf(cmd, sizeof(cmd), "%s", CMD_STOP_FRAMEWORK);
- if (rv >= (signed) sizeof(cmd) - 1) {
- testPrintE("Command too long for: %s", CMD_STOP_FRAMEWORK);
- exit(14);
- }
- testExecCmd(cmd);
- testDelay(1.0); // TODO - need means to query whether asyncronous stop
- // framework operation has completed. For now, just wait
- // a long time.
-
- init();
-
- // For each pass
- gettimeofday(&startTime, NULL);
- for (pass = startPass; pass <= endPass; pass++) {
- // Stop if duration of work has already been performed
- gettimeofday(¤tTime, NULL);
- delta = tvDelta(&startTime, ¤tTime);
- if (tv2double(&delta) > duration) { break; }
-
- // Regenerate a new set of test frames when this pass is
- // either the first pass or is in a different group then
- // the previous pass. A group of passes are passes that
- // all have the same quotient when their pass number is
- // divided by passesPerGroup.
- if ((pass == startPass)
- || ((pass / passesPerGroup) != ((pass - 1) / passesPerGroup))) {
- initFrames(pass / passesPerGroup);
- }
-
- testPrintI("==== Starting pass: %u", pass);
-
- // Cause deterministic sequence of prandom numbers to be
- // generated for this pass.
- srand48(pass);
-
- hwc_layer_list_t *list;
- list = hwcTestCreateLayerList(testRandMod(frames.size()) + 1);
- if (list == NULL) {
- testPrintE("hwcTestCreateLayerList failed");
- exit(20);
- }
-
- // Prandomly select a subset of frames to be used by this pass.
- vector <vector <sp<GraphicBuffer> > > selectedFrames;
- selectedFrames = vectorRandSelect(frames, list->numHwLayers);
-
- // Any transform tends to create a layer that the hardware
- // composer is unable to support and thus has to leave for
- // SurfaceFlinger. Place heavy bias on specifying no transforms.
- bool noTransform = testRandFract() > rareRatio;
-
- for (unsigned int n1 = 0; n1 < list->numHwLayers; n1++) {
- unsigned int idx = testRandMod(selectedFrames[n1].size());
- sp<GraphicBuffer> gBuf = selectedFrames[n1][idx];
- hwc_layer_t *layer = &list->hwLayers[n1];
- layer->handle = gBuf->handle;
-
- layer->blending = blendingOps[testRandMod(NUMA(blendingOps))];
- layer->flags = (testRandFract() > rareRatio) ? 0
- : vectorOr(vectorRandSelect(vecLayerFlags,
- testRandMod(vecLayerFlags.size() + 1)));
- layer->transform = (noTransform || testRandFract() > rareRatio) ? 0
- : vectorOr(vectorRandSelect(vecTransformFlags,
- testRandMod(vecTransformFlags.size() + 1)));
- layer->sourceCrop.left = testRandMod(gBuf->getWidth());
- layer->sourceCrop.top = testRandMod(gBuf->getHeight());
- layer->sourceCrop.right = layer->sourceCrop.left
- + testRandMod(gBuf->getWidth() - layer->sourceCrop.left) + 1;
- layer->sourceCrop.bottom = layer->sourceCrop.top
- + testRandMod(gBuf->getHeight() - layer->sourceCrop.top) + 1;
- layer->displayFrame.left = testRandMod(width);
- layer->displayFrame.top = testRandMod(height);
- layer->displayFrame.right = layer->displayFrame.left
- + testRandMod(width - layer->displayFrame.left) + 1;
- layer->displayFrame.bottom = layer->displayFrame.top
- + testRandMod(height - layer->displayFrame.top) + 1;
-
- // Increase the frequency that a scale factor of 1.0 from
- // the sourceCrop to displayFrame occurs. This is the
- // most common scale factor used by applications and would
- // be rarely produced by this stress test without this
- // logic.
- if (testRandFract() <= freqRatio) {
- // Only change to scale factor to 1.0 if both the
- // width and height will fit.
- int sourceWidth = layer->sourceCrop.right
- - layer->sourceCrop.left;
- int sourceHeight = layer->sourceCrop.bottom
- - layer->sourceCrop.top;
- if (((layer->displayFrame.left + sourceWidth) <= width)
- && ((layer->displayFrame.top + sourceHeight) <= height)) {
- layer->displayFrame.right = layer->displayFrame.left
- + sourceWidth;
- layer->displayFrame.bottom = layer->displayFrame.top
- + sourceHeight;
- }
- }
-
- layer->visibleRegionScreen.numRects = 1;
- layer->visibleRegionScreen.rects = &layer->displayFrame;
- }
-
- // Perform prepare operation
- if (verbose) { testPrintI("Prepare:"); hwcTestDisplayList(list); }
- hwcDevice->prepare(hwcDevice, list);
- if (verbose) {
- testPrintI("Post Prepare:");
- hwcTestDisplayListPrepareModifiable(list);
- }
-
- // Turn off the geometry changed flag
- list->flags &= ~HWC_GEOMETRY_CHANGED;
-
- // Perform the set operation(s)
- if (verbose) {testPrintI("Set:"); }
- for (unsigned int n1 = 0; n1 < numSet; n1++) {
- if (verbose) { hwcTestDisplayListHandles(list); }
- hwcDevice->set(hwcDevice, dpy, surface, list);
-
- // Prandomly select a new set of handles
- for (unsigned int n1 = 0; n1 < list->numHwLayers; n1++) {
- unsigned int idx = testRandMod(selectedFrames[n1].size());
- sp<GraphicBuffer> gBuf = selectedFrames[n1][idx];
- hwc_layer_t *layer = &list->hwLayers[n1];
- layer->handle = (native_handle_t *) gBuf->handle;
- }
-
- testDelay(perSetDelay);
- }
-
- hwcTestFreeLayerList(list);
- testPrintI("==== Completed pass: %u", pass);
- }
-
- testDelay(endDelay);
-
- // Start framework
- rv = snprintf(cmd, sizeof(cmd), "%s", CMD_START_FRAMEWORK);
- if (rv >= (signed) sizeof(cmd) - 1) {
- testPrintE("Command too long for: %s", CMD_START_FRAMEWORK);
- exit(21);
- }
- testExecCmd(cmd);
-
- testPrintI("Successfully completed %u passes", pass - startPass);
-
- return 0;
-}
-
-void init(void)
-{
- srand48(0); // Defensively set pseudo random number generator.
- // Should not need to set this, because a stress test
- // sets the seed on each pass. Defensively set it here
- // so that future code that uses pseudo random numbers
- // before the first pass will be deterministic.
-
- hwcTestInitDisplay(verbose, &dpy, &surface, &width, &height);
-
- hwcTestOpenHwc(&hwcDevice);
-}
-
-/*
- * Initialize Frames
- *
- * Creates an array of graphic buffers, within the global variable
- * named frames. The graphic buffers are contained within a vector of
- * vectors. All the graphic buffers in a particular row are of the same
- * format and dimension. Each graphic buffer is uniformly filled with a
- * prandomly selected color. It is likely that each buffer, even
- * in the same row, will be filled with a unique color.
- */
-void initFrames(unsigned int seed)
-{
- int rv;
- const size_t maxRows = 5;
- const size_t minCols = 2; // Need at least double buffering
- const size_t maxCols = 4; // One more than triple buffering
-
- if (verbose) { testPrintI("initFrames seed: %u", seed); }
- srand48(seed);
- size_t rows = testRandMod(maxRows) + 1;
-
- frames.clear();
- frames.resize(rows);
-
- for (unsigned int row = 0; row < rows; row++) {
- // All frames within a row have to have the same format and
- // dimensions. Width and height need to be >= 1.
- unsigned int formatIdx = testRandMod(NUMA(hwcTestGraphicFormat));
- const struct hwcTestGraphicFormat *formatPtr
- = &hwcTestGraphicFormat[formatIdx];
- int format = formatPtr->format;
-
- // Pick width and height, which must be >= 1 and the size
- // mod the wMod/hMod value must be equal to 0.
- size_t w = (width * maxSizeRatio) * testRandFract();
- size_t h = (height * maxSizeRatio) * testRandFract();
- w = max(1u, w);
- h = max(1u, h);
- if ((w % formatPtr->wMod) != 0) {
- w += formatPtr->wMod - (w % formatPtr->wMod);
- }
- if ((h % formatPtr->hMod) != 0) {
- h += formatPtr->hMod - (h % formatPtr->hMod);
- }
- if (verbose) {
- testPrintI(" frame %u width: %u height: %u format: %u %s",
- row, w, h, format, hwcTestGraphicFormat2str(format));
- }
-
- size_t cols = testRandMod((maxCols + 1) - minCols) + minCols;
- frames[row].resize(cols);
- for (unsigned int col = 0; col < cols; col++) {
- ColorFract color(testRandFract(), testRandFract(), testRandFract());
- float alpha = testRandFract();
-
- frames[row][col] = new GraphicBuffer(w, h, format, texUsage);
- if ((rv = frames[row][col]->initCheck()) != NO_ERROR) {
- testPrintE("GraphicBuffer initCheck failed, rv: %i", rv);
- testPrintE(" frame %u width: %u height: %u format: %u %s",
- row, w, h, format, hwcTestGraphicFormat2str(format));
- exit(80);
- }
-
- hwcTestFillColor(frames[row][col].get(), color, alpha);
- if (verbose) {
- testPrintI(" buf: %p handle: %p color: %s alpha: %f",
- frames[row][col].get(), frames[row][col]->handle,
- string(color).c_str(), alpha);
- }
- }
- }
-}
-
-/*
- * Vector Random Select
- *
- * Prandomly selects and returns num elements from vec.
- */
-template <class T>
-vector<T> vectorRandSelect(const vector<T>& vec, size_t num)
-{
- vector<T> rv = vec;
-
- while (rv.size() > num) {
- rv.erase(rv.begin() + testRandMod(rv.size()));
- }
-
- return rv;
-}
-
-/*
- * Vector Or
- *
- * Or's togethen the values of each element of vec and returns the result.
- */
-template <class T>
-T vectorOr(const vector<T>& vec)
-{
- T rv = 0;
-
- for (size_t n1 = 0; n1 < vec.size(); n1++) {
- rv |= vec[n1];
- }
-
- return rv;
-}
diff --git a/opengl/tests/hwc/hwcTestLib.cpp b/opengl/tests/hwc/hwcTestLib.cpp
deleted file mode 100644
index 28e0c3f..0000000
--- a/opengl/tests/hwc/hwcTestLib.cpp
+++ /dev/null
@@ -1,1030 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- *
- */
-
-/*
- * Hardware Composer Test Library
- * Utility library functions for use by the Hardware Composer test cases
- */
-
-#include <sstream>
-#include <string>
-
-#include <arpa/inet.h> // For ntohl() and htonl()
-
-#include "hwcTestLib.h"
-
-#include "EGLUtils.h"
-
-// Defines
-#define NUMA(a) (sizeof(a) / sizeof(a [0]))
-
-// Function Prototypes
-static void printGLString(const char *name, GLenum s);
-static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE);
-static void checkGlError(const char* op);
-static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config);
-
-using namespace std;
-using namespace android;
-
-
-#define BITSPERBYTE 8 // TODO: Obtain from <values.h>, once
- // it has been added
-
-// Initialize Display
-void hwcTestInitDisplay(bool verbose, EGLDisplay *dpy, EGLSurface *surface,
- EGLint *width, EGLint *height)
-{
- static EGLContext context;
-
- int rv;
-
- EGLBoolean returnValue;
- EGLConfig myConfig = {0};
- EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
- EGLint sConfigAttribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_NONE };
- EGLint majorVersion, minorVersion;
-
- checkEglError("<init>");
- *dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- checkEglError("eglGetDisplay");
- if (*dpy == EGL_NO_DISPLAY) {
- testPrintE("eglGetDisplay returned EGL_NO_DISPLAY");
- exit(70);
- }
-
- returnValue = eglInitialize(*dpy, &majorVersion, &minorVersion);
- checkEglError("eglInitialize", returnValue);
- if (verbose) {
- testPrintI("EGL version %d.%d", majorVersion, minorVersion);
- }
- if (returnValue != EGL_TRUE) {
- testPrintE("eglInitialize failed");
- exit(71);
- }
-
- EGLNativeWindowType window = android_createDisplaySurface();
- if (window == NULL) {
- testPrintE("android_createDisplaySurface failed");
- exit(72);
- }
- returnValue = EGLUtils::selectConfigForNativeWindow(*dpy,
- sConfigAttribs, window, &myConfig);
- if (returnValue) {
- testPrintE("EGLUtils::selectConfigForNativeWindow() returned %d",
- returnValue);
- exit(73);
- }
- checkEglError("EGLUtils::selectConfigForNativeWindow");
-
- if (verbose) {
- testPrintI("Chose this configuration:");
- printEGLConfiguration(*dpy, myConfig);
- }
-
- *surface = eglCreateWindowSurface(*dpy, myConfig, window, NULL);
- checkEglError("eglCreateWindowSurface");
- if (*surface == EGL_NO_SURFACE) {
- testPrintE("gelCreateWindowSurface failed.");
- exit(74);
- }
-
- context = eglCreateContext(*dpy, myConfig, EGL_NO_CONTEXT, contextAttribs);
- checkEglError("eglCreateContext");
- if (context == EGL_NO_CONTEXT) {
- testPrintE("eglCreateContext failed");
- exit(75);
- }
- returnValue = eglMakeCurrent(*dpy, *surface, *surface, context);
- checkEglError("eglMakeCurrent", returnValue);
- if (returnValue != EGL_TRUE) {
- testPrintE("eglMakeCurrent failed");
- exit(76);
- }
- eglQuerySurface(*dpy, *surface, EGL_WIDTH, width);
- checkEglError("eglQuerySurface");
- eglQuerySurface(*dpy, *surface, EGL_HEIGHT, height);
- checkEglError("eglQuerySurface");
-
- if (verbose) {
- testPrintI("Window dimensions: %d x %d", *width, *height);
-
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- printGLString("Extensions", GL_EXTENSIONS);
- }
-}
-
-// Open Hardware Composer Device
-void hwcTestOpenHwc(hwc_composer_device_t **hwcDevicePtr)
-{
- int rv;
- hw_module_t const *hwcModule;
-
- if ((rv = hw_get_module(HWC_HARDWARE_MODULE_ID, &hwcModule)) != 0) {
- testPrintE("hw_get_module failed, rv: %i", rv);
- errno = -rv;
- perror(NULL);
- exit(77);
- }
- if ((rv = hwc_open(hwcModule, hwcDevicePtr)) != 0) {
- testPrintE("hwc_open failed, rv: %i", rv);
- errno = -rv;
- perror(NULL);
- exit(78);
- }
-}
-
-// Color fraction class to string conversion
-ColorFract::operator string()
-{
- ostringstream out;
-
- out << '[' << this->c1() << ", "
- << this->c2() << ", "
- << this->c3() << ']';
-
- return out.str();
-}
-
-// Dimension class to string conversion
-HwcTestDim::operator string()
-{
- ostringstream out;
-
- out << '[' << this->width() << ", "
- << this->height() << ']';
-
- return out.str();
-}
-
-// Dimension class to hwc_rect conversion
-HwcTestDim::operator hwc_rect() const
-{
- hwc_rect rect;
-
- rect.left = rect.top = 0;
-
- rect.right = this->_w;
- rect.bottom = this->_h;
-
- return rect;
-}
-
-// Hardware Composer rectangle to string conversion
-string hwcTestRect2str(const struct hwc_rect& rect)
-{
- ostringstream out;
-
- out << '[';
- out << rect.left << ", ";
- out << rect.top << ", ";
- out << rect.right << ", ";
- out << rect.bottom;
- out << ']';
-
- return out.str();
-}
-
-// Parse HWC rectangle description of form [left, top, right, bottom]
-struct hwc_rect hwcTestParseHwcRect(istringstream& in, bool& error)
-{
- struct hwc_rect rect;
- char chStart, ch;
-
- // Defensively specify that an error occurred. Will clear
- // error flag if all of parsing succeeds.
- error = true;
-
- // First character should be a [ or <
- in >> chStart;
- if (!in || ((chStart != '<') && (chStart != '['))) { return rect; }
-
- // Left
- in >> rect.left;
- if (!in) { return rect; }
- in >> ch;
- if (!in || (ch != ',')) { return rect; }
-
- // Top
- in >> rect.top;
- if (!in) { return rect; }
- in >> ch;
- if (!in || (ch != ',')) { return rect; }
-
- // Right
- in >> rect.right;
- if (!in) { return rect; }
- in >> ch;
- if (!in || (ch != ',')) { return rect; }
-
- // Bottom
- in >> rect.bottom;
- if (!in) { return rect; }
-
- // Closing > or ]
- in >> ch;
- if (!in) { return rect; }
- if (((chStart == '<') && (ch != '>'))
- || ((chStart == '[') && (ch != ']'))) { return rect; }
-
- // Validate right and bottom are greater than left and top
- if ((rect.right <= rect.left) || (rect.bottom <= rect.top)) { return rect; }
-
- // Made It, clear error indicator
- error = false;
-
- return rect;
-}
-
-// Parse dimension of form [width, height]
-HwcTestDim hwcTestParseDim(istringstream& in, bool& error)
-{
- HwcTestDim dim;
- char chStart, ch;
- uint32_t val;
-
- // Defensively specify that an error occurred. Will clear
- // error flag if all of parsing succeeds.
- error = true;
-
- // First character should be a [ or <
- in >> chStart;
- if (!in || ((chStart != '<') && (chStart != '['))) { return dim; }
-
- // Width
- in >> val;
- if (!in) { return dim; }
- dim.setWidth(val);
- in >> ch;
- if (!in || (ch != ',')) { return dim; }
-
- // Height
- in >> val;
- if (!in) { return dim; }
- dim.setHeight(val);
-
- // Closing > or ]
- in >> ch;
- if (!in) { return dim; }
- if (((chStart == '<') && (ch != '>'))
- || ((chStart == '[') && (ch != ']'))) { return dim; }
-
- // Validate width and height greater than 0
- if ((dim.width() <= 0) || (dim.height() <= 0)) { return dim; }
-
- // Made It, clear error indicator
- error = false;
- return dim;
-}
-
-// Parse fractional color of form [0.##, 0.##, 0.##]
-// Fractional values can be from 0.0 to 1.0 inclusive. Note, integer
-// values of 0.0 and 1.0, which are non-fractional, are considered valid.
-// They are an exception, all other valid inputs are fractions.
-ColorFract hwcTestParseColor(istringstream& in, bool& error)
-{
- ColorFract color;
- char chStart, ch;
- float c1, c2, c3;
-
- // Defensively specify that an error occurred. Will clear
- // error flag if all of parsing succeeds.
- error = true;
-
- // First character should be a [ or <
- in >> chStart;
- if (!in || ((chStart != '<') && (chStart != '['))) { return color; }
-
- // 1st Component
- in >> c1;
- if (!in) { return color; }
- if ((c1 < 0.0) || (c1 > 1.0)) { return color; }
- in >> ch;
- if (!in || (ch != ',')) { return color; }
-
- // 2nd Component
- in >> c2;
- if (!in) { return color; }
- if ((c2 < 0.0) || (c2 > 1.0)) { return color; }
- in >> ch;
- if (!in || (ch != ',')) { return color; }
-
- // 3rd Component
- in >> c3;
- if (!in) { return color; }
- if ((c3 < 0.0) || (c3 > 1.0)) { return color; }
-
- // Closing > or ]
- in >> ch;
- if (!in) { return color; }
- if (((chStart == '<') && (ch != '>'))
- || ((chStart == '[') && (ch != ']'))) { return color; }
-
- // Are all the components fractional
- if ((c1 < 0.0) || (c1 > 1.0)
- || (c2 < 0.0) || (c2 > 1.0)
- || (c3 < 0.0) || (c3 > 1.0)) { return color; }
-
- // Made It, clear error indicator
- error = false;
-
- return ColorFract(c1, c2, c3);
-}
-
-// Look up and return pointer to structure with the characteristics
-// of the graphic format named by the desc parameter. Search failure
-// indicated by the return of NULL.
-const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(const char *desc)
-{
- for (unsigned int n1 = 0; n1 < NUMA(hwcTestGraphicFormat); n1++) {
- if (string(desc) == string(hwcTestGraphicFormat[n1].desc)) {
- return &hwcTestGraphicFormat[n1];
- }
- }
-
- return NULL;
-}
-
-// Look up and return pointer to structure with the characteristics
-// of the graphic format specified by the id parameter. Search failure
-// indicated by the return of NULL.
-const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(uint32_t id)
-{
- for (unsigned int n1 = 0; n1 < NUMA(hwcTestGraphicFormat); n1++) {
- if (id == hwcTestGraphicFormat[n1].format) {
- return &hwcTestGraphicFormat[n1];
- }
- }
-
- return NULL;
-}
-
-
-// Given the integer ID of a graphic format, return a pointer to
-// a string that describes the format.
-const char *hwcTestGraphicFormat2str(uint32_t format)
-{
- const static char *unknown = "unknown";
-
- for (unsigned int n1 = 0; n1 < NUMA(hwcTestGraphicFormat); n1++) {
- if (format == hwcTestGraphicFormat[n1].format) {
- return hwcTestGraphicFormat[n1].desc;
- }
- }
-
- return unknown;
-}
-
-/*
- * hwcTestCreateLayerList
- * Dynamically creates layer list with numLayers worth
- * of hwLayers entries.
- */
-hwc_layer_list_t *hwcTestCreateLayerList(size_t numLayers)
-{
- hwc_layer_list_t *list;
-
- size_t size = sizeof(hwc_layer_list) + numLayers * sizeof(hwc_layer_t);
- if ((list = (hwc_layer_list_t *) calloc(1, size)) == NULL) {
- return NULL;
- }
- list->flags = HWC_GEOMETRY_CHANGED;
- list->numHwLayers = numLayers;
-
- return list;
-}
-
-/*
- * hwcTestFreeLayerList
- * Frees memory previous allocated via hwcTestCreateLayerList().
- */
-void hwcTestFreeLayerList(hwc_layer_list_t *list)
-{
- free(list);
-}
-
-// Display the settings of the layer list pointed to by list
-void hwcTestDisplayList(hwc_layer_list_t *list)
-{
- testPrintI(" flags: %#x%s", list->flags,
- (list->flags & HWC_GEOMETRY_CHANGED) ? " GEOMETRY_CHANGED" : "");
- testPrintI(" numHwLayers: %u", list->numHwLayers);
-
- for (unsigned int layer = 0; layer < list->numHwLayers; layer++) {
- testPrintI(" layer %u compositionType: %#x%s%s", layer,
- list->hwLayers[layer].compositionType,
- (list->hwLayers[layer].compositionType == HWC_FRAMEBUFFER)
- ? " FRAMEBUFFER" : "",
- (list->hwLayers[layer].compositionType == HWC_OVERLAY)
- ? " OVERLAY" : "");
-
- testPrintI(" hints: %#x",
- list->hwLayers[layer].hints,
- (list->hwLayers[layer].hints & HWC_HINT_TRIPLE_BUFFER)
- ? " TRIPLE_BUFFER" : "",
- (list->hwLayers[layer].hints & HWC_HINT_CLEAR_FB)
- ? " CLEAR_FB" : "");
-
- testPrintI(" flags: %#x%s",
- list->hwLayers[layer].flags,
- (list->hwLayers[layer].flags & HWC_SKIP_LAYER)
- ? " SKIP_LAYER" : "");
-
- testPrintI(" handle: %p",
- list->hwLayers[layer].handle);
-
- // Intentionally skipped display of ROT_180 & ROT_270,
- // which are formed from combinations of the other flags.
- testPrintI(" transform: %#x%s%s%s",
- list->hwLayers[layer].transform,
- (list->hwLayers[layer].transform & HWC_TRANSFORM_FLIP_H)
- ? " FLIP_H" : "",
- (list->hwLayers[layer].transform & HWC_TRANSFORM_FLIP_V)
- ? " FLIP_V" : "",
- (list->hwLayers[layer].transform & HWC_TRANSFORM_ROT_90)
- ? " ROT_90" : "");
-
- testPrintI(" blending: %#x%s%s%s",
- list->hwLayers[layer].blending,
- (list->hwLayers[layer].blending == HWC_BLENDING_NONE)
- ? " NONE" : "",
- (list->hwLayers[layer].blending == HWC_BLENDING_PREMULT)
- ? " PREMULT" : "",
- (list->hwLayers[layer].blending == HWC_BLENDING_COVERAGE)
- ? " COVERAGE" : "");
-
- testPrintI(" sourceCrop: %s",
- hwcTestRect2str(list->hwLayers[layer].sourceCrop).c_str());
- testPrintI(" displayFrame: %s",
- hwcTestRect2str(list->hwLayers[layer].displayFrame).c_str());
- testPrintI(" scaleFactor: [%f, %f]",
- (float) (list->hwLayers[layer].sourceCrop.right
- - list->hwLayers[layer].sourceCrop.left)
- / (float) (list->hwLayers[layer].displayFrame.right
- - list->hwLayers[layer].displayFrame.left),
- (float) (list->hwLayers[layer].sourceCrop.bottom
- - list->hwLayers[layer].sourceCrop.top)
- / (float) (list->hwLayers[layer].displayFrame.bottom
- - list->hwLayers[layer].displayFrame.top));
- }
-}
-
-/*
- * Display List Prepare Modifiable
- *
- * Displays the portions of a list that are meant to be modified by
- * a prepare call.
- */
-void hwcTestDisplayListPrepareModifiable(hwc_layer_list_t *list)
-{
- uint32_t numOverlays = 0;
- for (unsigned int layer = 0; layer < list->numHwLayers; layer++) {
- if (list->hwLayers[layer].compositionType == HWC_OVERLAY) {
- numOverlays++;
- }
- testPrintI(" layer %u compositionType: %#x%s%s", layer,
- list->hwLayers[layer].compositionType,
- (list->hwLayers[layer].compositionType == HWC_FRAMEBUFFER)
- ? " FRAMEBUFFER" : "",
- (list->hwLayers[layer].compositionType == HWC_OVERLAY)
- ? " OVERLAY" : "");
- testPrintI(" hints: %#x%s%s",
- list->hwLayers[layer].hints,
- (list->hwLayers[layer].hints & HWC_HINT_TRIPLE_BUFFER)
- ? " TRIPLE_BUFFER" : "",
- (list->hwLayers[layer].hints & HWC_HINT_CLEAR_FB)
- ? " CLEAR_FB" : "");
- }
- testPrintI(" numOverlays: %u", numOverlays);
-}
-
-/*
- * Display List Handles
- *
- * Displays the handles of all the graphic buffers in the list.
- */
-void hwcTestDisplayListHandles(hwc_layer_list_t *list)
-{
- const unsigned int maxLayersPerLine = 6;
-
- ostringstream str(" layers:");
- for (unsigned int layer = 0; layer < list->numHwLayers; layer++) {
- str << ' ' << list->hwLayers[layer].handle;
- if (((layer % maxLayersPerLine) == (maxLayersPerLine - 1))
- && (layer != list->numHwLayers - 1)) {
- testPrintI("%s", str.str().c_str());
- str.str(" ");
- }
- }
- testPrintI("%s", str.str().c_str());
-}
-
-// Returns a uint32_t that contains a format specific representation of a
-// single pixel of the given color and alpha values.
-uint32_t hwcTestColor2Pixel(uint32_t format, ColorFract color, float alpha)
-{
- const struct attrib {
- uint32_t format;
- bool hostByteOrder;
- size_t bytes;
- size_t c1Offset;
- size_t c1Size;
- size_t c2Offset;
- size_t c2Size;
- size_t c3Offset;
- size_t c3Size;
- size_t aOffset;
- size_t aSize;
- } attributes[] = {
- {HAL_PIXEL_FORMAT_RGBA_8888, false, 4, 0, 8, 8, 8, 16, 8, 24, 8},
- {HAL_PIXEL_FORMAT_RGBX_8888, false, 4, 0, 8, 8, 8, 16, 8, 0, 0},
- {HAL_PIXEL_FORMAT_RGB_888, false, 3, 0, 8, 8, 8, 16, 8, 0, 0},
- {HAL_PIXEL_FORMAT_RGB_565, true, 2, 0, 5, 5, 6, 11, 5, 0, 0},
- {HAL_PIXEL_FORMAT_BGRA_8888, false, 4, 16, 8, 8, 8, 0, 8, 24, 8},
- {HAL_PIXEL_FORMAT_RGBA_5551, true , 2, 0, 5, 5, 5, 10, 5, 15, 1},
- {HAL_PIXEL_FORMAT_RGBA_4444, false, 2, 12, 4, 0, 4, 4, 4, 8, 4},
- {HAL_PIXEL_FORMAT_YV12, true, 3, 16, 8, 8, 8, 0, 8, 0, 0},
- };
-
- const struct attrib *attrib;
- for (attrib = attributes; attrib < attributes + NUMA(attributes);
- attrib++) {
- if (attrib->format == format) { break; }
- }
- if (attrib >= attributes + NUMA(attributes)) {
- testPrintE("colorFract2Pixel unsupported format of: %u", format);
- exit(80);
- }
-
- uint32_t pixel;
- pixel = htonl((uint32_t) round((((1 << attrib->c1Size) - 1) * color.c1()))
- << ((sizeof(pixel) * BITSPERBYTE)
- - (attrib->c1Offset + attrib->c1Size)));
- pixel |= htonl((uint32_t) round((((1 << attrib->c2Size) - 1) * color.c2()))
- << ((sizeof(pixel) * BITSPERBYTE)
- - (attrib->c2Offset + attrib->c2Size)));
- pixel |= htonl((uint32_t) round((((1 << attrib->c3Size) - 1) * color.c3()))
- << ((sizeof(pixel) * BITSPERBYTE)
- - (attrib->c3Offset + attrib->c3Size)));
- if (attrib->aSize) {
- pixel |= htonl((uint32_t) round((((1 << attrib->aSize) - 1) * alpha))
- << ((sizeof(pixel) * BITSPERBYTE)
- - (attrib->aOffset + attrib->aSize)));
- }
- if (attrib->hostByteOrder) {
- pixel = ntohl(pixel);
- pixel >>= sizeof(pixel) * BITSPERBYTE - attrib->bytes * BITSPERBYTE;
- }
-
- return pixel;
-}
-
-// Sets the pixel at the given x and y coordinates to the color and alpha
-// value given by pixel. The contents of pixel is format specific. It's
-// value should come from a call to hwcTestColor2Pixel().
-void hwcTestSetPixel(GraphicBuffer *gBuf, unsigned char *buf,
- uint32_t x, uint32_t y, uint32_t pixel)
-{
-
- const struct attrib {
- int format;
- size_t bytes;
- } attributes[] = {
- {HAL_PIXEL_FORMAT_RGBA_8888, 4},
- {HAL_PIXEL_FORMAT_RGBX_8888, 4},
- {HAL_PIXEL_FORMAT_RGB_888, 3},
- {HAL_PIXEL_FORMAT_RGB_565, 2},
- {HAL_PIXEL_FORMAT_BGRA_8888, 4},
- {HAL_PIXEL_FORMAT_RGBA_5551, 2},
- {HAL_PIXEL_FORMAT_RGBA_4444, 2},
- };
-
- if (gBuf->getPixelFormat() == HAL_PIXEL_FORMAT_YV12) {
- uint32_t yPlaneOffset, uPlaneOffset, vPlaneOffset;
- uint32_t yPlaneStride = gBuf->getStride();
- uint32_t uPlaneStride = ((gBuf->getStride() / 2) + 0xf) & ~0xf;
- uint32_t vPlaneStride = uPlaneStride;
- yPlaneOffset = 0;
- vPlaneOffset = yPlaneOffset + yPlaneStride * gBuf->getHeight();
- uPlaneOffset = vPlaneOffset
- + vPlaneStride * (gBuf->getHeight() / 2);
- *(buf + yPlaneOffset + y * yPlaneStride + x) = pixel & 0xff;
- *(buf + uPlaneOffset + (y / 2) * uPlaneStride + (x / 2))
- = (pixel & 0xff00) >> 8;
- *(buf + vPlaneOffset + (y / 2) * vPlaneStride + (x / 2))
- = (pixel & 0xff0000) >> 16;
-
- return;
- }
-
- const struct attrib *attrib;
- for (attrib = attributes; attrib < attributes + NUMA(attributes);
- attrib++) {
- if (attrib->format == gBuf->getPixelFormat()) { break; }
- }
- if (attrib >= attributes + NUMA(attributes)) {
- testPrintE("setPixel unsupported format of: %u",
- gBuf->getPixelFormat());
- exit(90);
- }
-
- memmove(buf + ((gBuf->getStride() * attrib->bytes) * y)
- + (attrib->bytes * x), &pixel, attrib->bytes);
-}
-
-// Fill a given graphic buffer with a uniform color and alpha
-void hwcTestFillColor(GraphicBuffer *gBuf, ColorFract color, float alpha)
-{
- unsigned char* buf = NULL;
- status_t err;
- uint32_t pixel;
-
- pixel = hwcTestColor2Pixel(gBuf->getPixelFormat(), color, alpha);
-
- err = gBuf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&buf));
- if (err != 0) {
- testPrintE("hwcTestFillColor lock failed: %d", err);
- exit(100);
- }
-
- for (unsigned int x = 0; x < gBuf->getStride(); x++) {
- for (unsigned int y = 0; y < gBuf->getHeight(); y++) {
- uint32_t val = pixel;
- hwcTestSetPixel(gBuf, buf, x, y, (x < gBuf->getWidth())
- ? pixel : testRand());
- }
- }
-
- err = gBuf->unlock();
- if (err != 0) {
- testPrintE("hwcTestFillColor unlock failed: %d", err);
- exit(101);
- }
-}
-
-// Fill the given buffer with a horizontal blend of colors, with the left
-// side color given by startColor and the right side color given by
-// endColor. The startColor and endColor values are specified in the format
-// given by colorFormat, which might be different from the format of the
-// graphic buffer. When different, a color conversion is done when possible
-// to the graphic format of the graphic buffer. A color of black is
-// produced for cases where the conversion is impossible (e.g. out of gamut
-// values).
-void hwcTestFillColorHBlend(GraphicBuffer *gBuf, uint32_t colorFormat,
- ColorFract startColor, ColorFract endColor)
-{
- status_t err;
- unsigned char* buf = NULL;
- const uint32_t width = gBuf->getWidth();
- const uint32_t height = gBuf->getHeight();
- const uint32_t stride = gBuf->getStride();
-
- err = gBuf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&buf));
- if (err != 0) {
- testPrintE("hwcTestFillColorHBlend lock failed: %d", err);
- exit(110);
- }
-
- for (unsigned int x = 0; x < stride; x++) {
- uint32_t pixel;
- if (x < width) {
- ColorFract color(startColor.c1() + (endColor.c1() - startColor.c1())
- * ((float) x / (float) (width - 1)),
- startColor.c2() + (endColor.c2() - startColor.c2())
- * ((float) x / (float) (width - 1)),
- startColor.c3() + (endColor.c3() - startColor.c3())
- * ((float) x / (float) (width - 1)));
-
- // When formats differ, convert colors.
- // Important to not convert when formats are the same, since
- // out of gamut colors are always converted to black.
- if (colorFormat != (uint32_t) gBuf->getPixelFormat()) {
- hwcTestColorConvert(colorFormat, gBuf->getPixelFormat(), color);
- }
- pixel = hwcTestColor2Pixel(gBuf->getPixelFormat(), color, 1.0);
- } else {
- // Fill pad with random values
- pixel = testRand();
- }
-
- for (unsigned int y = 0; y < height; y++) {
- hwcTestSetPixel(gBuf, buf, x, y, pixel);
- }
- }
-
- err = gBuf->unlock();
- if (err != 0) {
- testPrintE("hwcTestFillColorHBlend unlock failed: %d", err);
- exit(111);
- }
-}
-
-/*
- * When possible, converts color specified as a full range value in
- * the fromFormat, into an equivalent full range color in the toFormat.
- * When conversion is impossible (e.g. out of gamut color) a color
- * or black in the full range output format is produced. The input
- * color is given as a fractional color in the parameter named color.
- * The produced color is written over the same parameter used to
- * provide the input color.
- *
- * Each graphic format has 3 color components and each of these
- * components has both a full and in gamut range. This function uses
- * a table that provides the full and in gamut ranges of each of the
- * supported graphic formats. The full range is given by members named
- * c[123]Min to c[123]Max, while the in gamut range is given by members
- * named c[123]Low to c[123]High. In most cases the full and in gamut
- * ranges are equivalent. This occurs when the c[123]Min == c[123]Low and
- * c[123]High == c[123]Max.
- *
- * The input and produced colors are both specified as a fractional amount
- * of the full range. The diagram below provides an overview of the
- * conversion process. The main steps are:
- *
- * 1. Produce black if the input color is out of gamut.
- *
- * 2. Convert the in gamut color into the fraction of the fromFromat
- * in gamut range.
- *
- * 3. Convert from the fraction of the in gamut from format range to
- * the fraction of the in gamut to format range. Produce black
- * if an equivalent color does not exists.
- *
- * 4. Covert from the fraction of the in gamut to format to the
- * fraction of the full range to format.
- *
- * From Format To Format
- * max high high max
- * ----+ +-----------+
- * high \ / \ high
- * ------\-------------+ +-------->
- * \
- * \ +--- black --+
- * \ / \
- * \ / +-->
- * low \ / low
- * -------- ---+-- black --+
- * min low low min
- * ^ ^ ^ ^ ^
- * | | | | |
- * | | | | +-- fraction of full range
- * | | | +-- fraction of valid range
- * | | +-- fromFormat to toFormat color conversion
- * | +-- fraction of valid range
- * +-- fraction of full range
- */
-void hwcTestColorConvert(uint32_t fromFormat, uint32_t toFormat,
- ColorFract& color)
-{
- const struct attrib {
- uint32_t format;
- bool rgb;
- bool yuv;
- int c1Min, c1Low, c1High, c1Max;
- int c2Min, c2Low, c2High, c2Max;
- int c3Min, c3Low, c3High, c3Max;
- } attributes[] = {
- {HAL_PIXEL_FORMAT_RGBA_8888, true, false,
- 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255},
- {HAL_PIXEL_FORMAT_RGBX_8888, true, false,
- 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255},
- {HAL_PIXEL_FORMAT_RGB_888, true, false,
- 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255},
- {HAL_PIXEL_FORMAT_RGB_565, true, false,
- 0, 0, 31, 31, 0, 0, 63, 63, 0, 0, 31, 31},
- {HAL_PIXEL_FORMAT_BGRA_8888, true, false,
- 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255},
- {HAL_PIXEL_FORMAT_RGBA_5551, true, false,
- 0, 0, 31, 31, 0, 0, 31, 31, 0, 0, 31, 31},
- {HAL_PIXEL_FORMAT_RGBA_4444, true, false,
- 0, 0, 15, 15, 0, 0, 15, 15, 0, 0, 15, 15},
- {HAL_PIXEL_FORMAT_YV12, false, true,
- 0, 16, 235, 255, 0, 16, 240, 255, 0, 16, 240, 255},
- };
-
- const struct attrib *fromAttrib;
- for (fromAttrib = attributes; fromAttrib < attributes + NUMA(attributes);
- fromAttrib++) {
- if (fromAttrib->format == fromFormat) { break; }
- }
- if (fromAttrib >= attributes + NUMA(attributes)) {
- testPrintE("hwcTestColorConvert unsupported from format of: %u",
- fromFormat);
- exit(120);
- }
-
- const struct attrib *toAttrib;
- for (toAttrib = attributes; toAttrib < attributes + NUMA(attributes);
- toAttrib++) {
- if (toAttrib->format == toFormat) { break; }
- }
- if (toAttrib >= attributes + NUMA(attributes)) {
- testPrintE("hwcTestColorConvert unsupported to format of: %u",
- toFormat);
- exit(121);
- }
-
- // Produce black if any of the from components are outside the
- // valid color range
- float c1Val = fromAttrib->c1Min
- + ((float) (fromAttrib->c1Max - fromAttrib->c1Min) * color.c1());
- float c2Val = fromAttrib->c2Min
- + ((float) (fromAttrib->c2Max - fromAttrib->c2Min) * color.c2());
- float c3Val = fromAttrib->c3Min
- + ((float) (fromAttrib->c3Max - fromAttrib->c3Min) * color.c3());
- if ((c1Val < fromAttrib->c1Low) || (c1Val > fromAttrib->c1High)
- || (c2Val < fromAttrib->c2Low) || (c2Val > fromAttrib->c2High)
- || (c3Val < fromAttrib->c3Low) || (c3Val > fromAttrib->c3High)) {
-
- // Return black
- // Will use representation of black from RGBA8888 graphic format
- // and recursively convert it to the requested graphic format.
- color = ColorFract(0.0, 0.0, 0.0);
- hwcTestColorConvert(HAL_PIXEL_FORMAT_RGBA_8888, toFormat, color);
- return;
- }
-
- // Within from format, convert from fraction of full range
- // to fraction of valid range
- color = ColorFract((c1Val - fromAttrib->c1Low)
- / (fromAttrib->c1High - fromAttrib->c1Low),
- (c2Val - fromAttrib->c2Low)
- / (fromAttrib->c2High - fromAttrib->c2Low),
- (c3Val - fromAttrib->c3Low)
- / (fromAttrib->c3High - fromAttrib->c3Low));
-
- // If needed perform RGB to YUV conversion
- float wr = 0.2126, wg = 0.7152, wb = 0.0722; // ITU709 recommended constants
- if (fromAttrib->rgb && toAttrib->yuv) {
- float r = color.c1(), g = color.c2(), b = color.c3();
- float y = wr * r + wg * g + wb * b;
- float u = 0.5 * ((b - y) / (1.0 - wb)) + 0.5;
- float v = 0.5 * ((r - y) / (1.0 - wr)) + 0.5;
-
- // Produce black if color is outside the YUV gamut
- if ((y < 0.0) || (y > 1.0)
- || (u < 0.0) || (u > 1.0)
- || (v < 0.0) || (v > 1.0)) {
- y = 0.0;
- u = v = 0.5;
- }
-
- color = ColorFract(y, u, v);
- }
-
- // If needed perform YUV to RGB conversion
- // Equations determined from the ITU709 equations for RGB to YUV
- // conversion, plus the following algebra:
- //
- // u = 0.5 * ((b - y) / (1.0 - wb)) + 0.5
- // 0.5 * ((b - y) / (1.0 - wb)) = u - 0.5
- // (b - y) / (1.0 - wb) = 2 * (u - 0.5)
- // b - y = 2 * (u - 0.5) * (1.0 - wb)
- // b = 2 * (u - 0.5) * (1.0 - wb) + y
- //
- // v = 0.5 * ((r -y) / (1.0 - wr)) + 0.5
- // 0.5 * ((r - y) / (1.0 - wr)) = v - 0.5
- // (r - y) / (1.0 - wr) = 2 * (v - 0.5)
- // r - y = 2 * (v - 0.5) * (1.0 - wr)
- // r = 2 * (v - 0.5) * (1.0 - wr) + y
- //
- // y = wr * r + wg * g + wb * b
- // wr * r + wg * g + wb * b = y
- // wg * g = y - wr * r - wb * b
- // g = (y - wr * r - wb * b) / wg
- if (fromAttrib->yuv && toAttrib->rgb) {
- float y = color.c1(), u = color.c2(), v = color.c3();
- float r = 2.0 * (v - 0.5) * (1.0 - wr) + y;
- float b = 2.0 * (u - 0.5) * (1.0 - wb) + y;
- float g = (y - wr * r - wb * b) / wg;
-
- // Produce black if color is outside the RGB gamut
- if ((r < 0.0) || (r > 1.0)
- || (g < 0.0) || (g > 1.0)
- || (b < 0.0) || (b > 1.0)) {
- r = g = b = 0.0;
- }
-
- color = ColorFract(r, g, b);
- }
-
- // Within to format, convert from fraction of valid range
- // to fraction of full range
- c1Val = (toAttrib->c1Low
- + (float) (toAttrib->c1High - toAttrib->c1Low) * color.c1());
- c2Val = (toAttrib->c1Low
- + (float) (toAttrib->c2High - toAttrib->c2Low) * color.c2());
- c3Val = (toAttrib->c1Low
- + (float) (toAttrib->c3High - toAttrib->c3Low) * color.c3());
- color = ColorFract((float) (c1Val - toAttrib->c1Min)
- / (float) (toAttrib->c1Max - toAttrib->c1Min),
- (float) (c2Val - toAttrib->c2Min)
- / (float) (toAttrib->c2Max - toAttrib->c2Min),
- (float) (c3Val - toAttrib->c3Min)
- / (float) (toAttrib->c3Max - toAttrib->c3Min));
-}
-
-// TODO: Use PrintGLString, CechckGlError, and PrintEGLConfiguration
-// from libglTest
-static void printGLString(const char *name, GLenum s)
-{
- const char *v = (const char *) glGetString(s);
-
- if (v == NULL) {
- testPrintI("GL %s unknown", name);
- } else {
- testPrintI("GL %s = %s", name, v);
- }
-}
-
-static void checkEglError(const char* op, EGLBoolean returnVal)
-{
- if (returnVal != EGL_TRUE) {
- testPrintE("%s() returned %d", op, returnVal);
- }
-
- for (EGLint error = eglGetError(); error != EGL_SUCCESS; error
- = eglGetError()) {
- testPrintE("after %s() eglError %s (0x%x)",
- op, EGLUtils::strerror(error), error);
- }
-}
-
-static void checkGlError(const char* op)
-{
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- testPrintE("after %s() glError (0x%x)", op, error);
- }
-}
-
-static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config)
-{
-
-#define X(VAL) {VAL, #VAL}
- struct {EGLint attribute; const char* name;} names[] = {
- X(EGL_BUFFER_SIZE),
- X(EGL_ALPHA_SIZE),
- X(EGL_BLUE_SIZE),
- X(EGL_GREEN_SIZE),
- X(EGL_RED_SIZE),
- X(EGL_DEPTH_SIZE),
- X(EGL_STENCIL_SIZE),
- X(EGL_CONFIG_CAVEAT),
- X(EGL_CONFIG_ID),
- X(EGL_LEVEL),
- X(EGL_MAX_PBUFFER_HEIGHT),
- X(EGL_MAX_PBUFFER_PIXELS),
- X(EGL_MAX_PBUFFER_WIDTH),
- X(EGL_NATIVE_RENDERABLE),
- X(EGL_NATIVE_VISUAL_ID),
- X(EGL_NATIVE_VISUAL_TYPE),
- X(EGL_SAMPLES),
- X(EGL_SAMPLE_BUFFERS),
- X(EGL_SURFACE_TYPE),
- X(EGL_TRANSPARENT_TYPE),
- X(EGL_TRANSPARENT_RED_VALUE),
- X(EGL_TRANSPARENT_GREEN_VALUE),
- X(EGL_TRANSPARENT_BLUE_VALUE),
- X(EGL_BIND_TO_TEXTURE_RGB),
- X(EGL_BIND_TO_TEXTURE_RGBA),
- X(EGL_MIN_SWAP_INTERVAL),
- X(EGL_MAX_SWAP_INTERVAL),
- X(EGL_LUMINANCE_SIZE),
- X(EGL_ALPHA_MASK_SIZE),
- X(EGL_COLOR_BUFFER_TYPE),
- X(EGL_RENDERABLE_TYPE),
- X(EGL_CONFORMANT),
- };
-#undef X
-
- for (size_t j = 0; j < sizeof(names) / sizeof(names[0]); j++) {
- EGLint value = -1;
- EGLint returnVal = eglGetConfigAttrib(dpy, config, names[j].attribute,
- &value);
- EGLint error = eglGetError();
- if (returnVal && error == EGL_SUCCESS) {
- testPrintI(" %s: %d (%#x)", names[j].name, value, value);
- }
- }
- testPrintI("");
-}
diff --git a/opengl/tests/hwc/hwcTestLib.h b/opengl/tests/hwc/hwcTestLib.h
deleted file mode 100644
index b0c3012..0000000
--- a/opengl/tests/hwc/hwcTestLib.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- *
- */
-
-/*
- * Hardware Composer Test Library Header
- */
-
-#include <sstream>
-#include <string>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include <ui/GraphicBuffer.h>
-
-#include <utils/Log.h>
-#include <testUtil.h>
-
-#include <hardware/hwcomposer.h>
-
-// Characteristics of known graphic formats
-const struct hwcTestGraphicFormat {
- uint32_t format;
- const char *desc;
- uint32_t wMod, hMod; // Width/height mod this value must equal zero
-} hwcTestGraphicFormat[] = {
- {HAL_PIXEL_FORMAT_RGBA_8888, "RGBA8888", 1, 1},
- {HAL_PIXEL_FORMAT_RGBX_8888, "RGBX8888", 1, 1},
- {HAL_PIXEL_FORMAT_RGB_888, "RGB888", 1, 1},
- {HAL_PIXEL_FORMAT_RGB_565, "RGB565", 1, 1},
- {HAL_PIXEL_FORMAT_BGRA_8888, "BGRA8888", 1, 1},
- {HAL_PIXEL_FORMAT_RGBA_5551, "RGBA5551", 1, 1},
- {HAL_PIXEL_FORMAT_RGBA_4444, "RGBA4444", 1, 1},
- {HAL_PIXEL_FORMAT_YV12, "YV12", 2, 2},
-};
-
-// Represent RGB color as fraction of color components.
-// Each of the color components are expected in the range [0.0, 1.0]
-class ColorFract {
- public:
- ColorFract(): _c1(0.0), _c2(0.0), _c3(0.0) {};
- ColorFract(float c1, float c2, float c3): _c1(c1), _c2(c2), _c3(c3) {};
- float c1(void) const { return _c1; }
- float c2(void) const { return _c2; }
- float c3(void) const { return _c3; }
-
- operator std::string();
-
- private:
- float _c1;
- float _c2;
- float _c3;
-};
-
-// Represent RGB color as fraction of color components.
-// Each of the color components are expected in the range [0.0, 1.0]
-class ColorRGB {
- public:
- ColorRGB(): _r(0.0), _g(0.0), _b(0.0) {};
- ColorRGB(float f): _r(f), _g(f), _b(f) {}; // Gray
- ColorRGB(float r, float g, float b): _r(r), _g(g), _b(b) {};
- float r(void) const { return _r; }
- float g(void) const { return _g; }
- float b(void) const { return _b; }
-
- private:
- float _r;
- float _g;
- float _b;
-};
-
-// Dimension - width and height of a rectanguler area
-class HwcTestDim {
- public:
- HwcTestDim(): _w(0), _h(0) {};
- HwcTestDim(uint32_t w, uint32_t h) : _w(w), _h(h) {}
- uint32_t width(void) const { return _w; }
- uint32_t height(void) const { return _h; }
- void setWidth(uint32_t w) { _w = w; }
- void setHeight(uint32_t h) { _h = h; }
-
- operator std::string();
- operator hwc_rect() const;
-
- private:
- uint32_t _w;
- uint32_t _h;
-};
-
-// Function Prototypes
-void hwcTestInitDisplay(bool verbose, EGLDisplay *dpy, EGLSurface *surface,
- EGLint *width, EGLint *height);
-void hwcTestOpenHwc(hwc_composer_device_t **hwcDevicePtr);
-const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(const char *desc);
-const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(uint32_t id);
-const char *hwcTestGraphicFormat2str(uint32_t format);
-std::string hwcTestRect2str(const struct hwc_rect& rect);
-
-hwc_layer_list_t *hwcTestCreateLayerList(size_t numLayers);
-void hwcTestFreeLayerList(hwc_layer_list_t *list);
-void hwcTestDisplayList(hwc_layer_list_t *list);
-void hwcTestDisplayListPrepareModifiable(hwc_layer_list_t *list);
-void hwcTestDisplayListHandles(hwc_layer_list_t *list);
-
-uint32_t hwcTestColor2Pixel(uint32_t format, ColorFract color, float alpha);
-void hwcTestColorConvert(uint32_t fromFormat, uint32_t toFormat,
- ColorFract& color);
-void hwcTestSetPixel(android::GraphicBuffer *gBuf, unsigned char *buf,
- uint32_t x, uint32_t y, uint32_t pixel);
-void hwcTestFillColor(android::GraphicBuffer *gBuf, ColorFract color,
- float alpha);
-void hwcTestFillColorHBlend(android::GraphicBuffer *gBuf,
- uint32_t colorFormat,
- ColorFract startColor, ColorFract endColor);
-ColorFract hwcTestParseColor(std::istringstream& in, bool& error);
-struct hwc_rect hwcTestParseHwcRect(std::istringstream& in, bool& error);
-HwcTestDim hwcTestParseDim(std::istringstream& in, bool& error);
diff --git a/opengl/tests/include/EGLUtils.h b/opengl/tests/include/EGLUtils.h
deleted file mode 100644
index 014c261..0000000
--- a/opengl/tests/include/EGLUtils.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-
-#ifndef ANDROID_UI_EGLUTILS_H
-#define ANDROID_UI_EGLUTILS_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#include <system/window.h>
-#include <utils/Errors.h>
-#include <EGL/egl.h>
-
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-class EGLUtils
-{
-public:
-
- static inline const char *strerror(EGLint err);
-
- static inline status_t selectConfigForPixelFormat(
- EGLDisplay dpy,
- EGLint const* attrs,
- int32_t format,
- EGLConfig* outConfig);
-
- static inline status_t selectConfigForNativeWindow(
- EGLDisplay dpy,
- EGLint const* attrs,
- EGLNativeWindowType window,
- EGLConfig* outConfig);
-};
-
-// ----------------------------------------------------------------------------
-
-const char *EGLUtils::strerror(EGLint err)
-{
- switch (err){
- case EGL_SUCCESS: return "EGL_SUCCESS";
- case EGL_NOT_INITIALIZED: return "EGL_NOT_INITIALIZED";
- case EGL_BAD_ACCESS: return "EGL_BAD_ACCESS";
- case EGL_BAD_ALLOC: return "EGL_BAD_ALLOC";
- case EGL_BAD_ATTRIBUTE: return "EGL_BAD_ATTRIBUTE";
- case EGL_BAD_CONFIG: return "EGL_BAD_CONFIG";
- case EGL_BAD_CONTEXT: return "EGL_BAD_CONTEXT";
- case EGL_BAD_CURRENT_SURFACE: return "EGL_BAD_CURRENT_SURFACE";
- case EGL_BAD_DISPLAY: return "EGL_BAD_DISPLAY";
- case EGL_BAD_MATCH: return "EGL_BAD_MATCH";
- case EGL_BAD_NATIVE_PIXMAP: return "EGL_BAD_NATIVE_PIXMAP";
- case EGL_BAD_NATIVE_WINDOW: return "EGL_BAD_NATIVE_WINDOW";
- case EGL_BAD_PARAMETER: return "EGL_BAD_PARAMETER";
- case EGL_BAD_SURFACE: return "EGL_BAD_SURFACE";
- case EGL_CONTEXT_LOST: return "EGL_CONTEXT_LOST";
- default: return "UNKNOWN";
- }
-}
-
-status_t EGLUtils::selectConfigForPixelFormat(
- EGLDisplay dpy,
- EGLint const* attrs,
- int32_t format,
- EGLConfig* outConfig)
-{
- EGLint numConfigs = -1, n=0;
-
- if (!attrs)
- return BAD_VALUE;
-
- if (outConfig == NULL)
- return BAD_VALUE;
-
- // Get all the "potential match" configs...
- if (eglGetConfigs(dpy, NULL, 0, &numConfigs) == EGL_FALSE)
- return BAD_VALUE;
-
- EGLConfig* const configs = (EGLConfig*)malloc(sizeof(EGLConfig)*numConfigs);
- if (eglChooseConfig(dpy, attrs, configs, numConfigs, &n) == EGL_FALSE) {
- free(configs);
- return BAD_VALUE;
- }
-
- int i;
- EGLConfig config = NULL;
- for (i=0 ; i<n ; i++) {
- EGLint nativeVisualId = 0;
- eglGetConfigAttrib(dpy, configs[i], EGL_NATIVE_VISUAL_ID, &nativeVisualId);
- if (nativeVisualId>0 && format == nativeVisualId) {
- config = configs[i];
- break;
- }
- }
-
- free(configs);
-
- if (i<n) {
- *outConfig = config;
- return NO_ERROR;
- }
-
- return NAME_NOT_FOUND;
-}
-
-status_t EGLUtils::selectConfigForNativeWindow(
- EGLDisplay dpy,
- EGLint const* attrs,
- EGLNativeWindowType window,
- EGLConfig* outConfig)
-{
- int err;
- int format;
-
- if (!window)
- return BAD_VALUE;
-
- if ((err = window->query(window, NATIVE_WINDOW_FORMAT, &format)) < 0) {
- return err;
- }
-
- return selectConfigForPixelFormat(dpy, attrs, format, outConfig);
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif /* ANDROID_UI_EGLUTILS_H */
diff --git a/opengl/tests/include/glTestLib.h b/opengl/tests/include/glTestLib.h
deleted file mode 100644
index c91c594..0000000
--- a/opengl/tests/include/glTestLib.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- *
- */
-
-/*
- * Graphics Test Library Header
- */
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include "EGLUtils.h"
-
-void glTestPrintGLString(const char *name, GLenum s);
-void glTestCheckEglError(const char* op, EGLBoolean returnVal = EGL_TRUE);
-void glTestCheckGlError(const char* op);
-void glTestPrintEGLConfiguration(EGLDisplay dpy, EGLConfig config);
diff --git a/opengl/tests/lib/Android.mk b/opengl/tests/lib/Android.mk
deleted file mode 100644
index 0352a37..0000000
--- a/opengl/tests/lib/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE:= libglTest
-LOCAL_SRC_FILES:= glTestLib.cpp
-LOCAL_C_INCLUDES += system/extras/tests/include \
- bionic \
- bionic/libstdc++/include \
- external/stlport/stlport \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport
-
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/opengl/tests/lib/glTestLib.cpp b/opengl/tests/lib/glTestLib.cpp
deleted file mode 100644
index b434fc7..0000000
--- a/opengl/tests/lib/glTestLib.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- *
- */
-
-/*
- * Graphics Test Library
- */
-
-#include <glTestLib.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include "EGLUtils.h"
-
-#include <utils/Log.h>
-#include <testUtil.h>
-
-using namespace std;
-using namespace android;
-
-void glTestPrintGLString(const char *name, GLenum s)
-{
- const char *v = (const char *) glGetString(s);
-
- if (v == NULL) {
- testPrintI("GL %s unknown", name);
- } else {
- testPrintI("GL %s = %s", name, v);
- }
-}
-
-void glTestCheckEglError(const char* op, EGLBoolean returnVal)
-{
- if (returnVal != EGL_TRUE) {
- testPrintE("%s() returned %d", op, returnVal);
- }
-
- for (EGLint error = eglGetError(); error != EGL_SUCCESS; error
- = eglGetError()) {
- testPrintE("after %s() eglError %s (0x%x)",
- op, EGLUtils::strerror(error), error);
- }
-}
-
-void glTestCheckGlError(const char* op)
-{
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- testPrintE("after %s() glError (0x%x)", op, error);
- }
-}
-
-void glTestPrintEGLConfiguration(EGLDisplay dpy, EGLConfig config)
-{
-
-#define X(VAL) {VAL, #VAL}
- struct {EGLint attribute; const char* name;} names[] = {
- X(EGL_BUFFER_SIZE),
- X(EGL_ALPHA_SIZE),
- X(EGL_BLUE_SIZE),
- X(EGL_GREEN_SIZE),
- X(EGL_RED_SIZE),
- X(EGL_DEPTH_SIZE),
- X(EGL_STENCIL_SIZE),
- X(EGL_CONFIG_CAVEAT),
- X(EGL_CONFIG_ID),
- X(EGL_LEVEL),
- X(EGL_MAX_PBUFFER_HEIGHT),
- X(EGL_MAX_PBUFFER_PIXELS),
- X(EGL_MAX_PBUFFER_WIDTH),
- X(EGL_NATIVE_RENDERABLE),
- X(EGL_NATIVE_VISUAL_ID),
- X(EGL_NATIVE_VISUAL_TYPE),
- X(EGL_SAMPLES),
- X(EGL_SAMPLE_BUFFERS),
- X(EGL_SURFACE_TYPE),
- X(EGL_TRANSPARENT_TYPE),
- X(EGL_TRANSPARENT_RED_VALUE),
- X(EGL_TRANSPARENT_GREEN_VALUE),
- X(EGL_TRANSPARENT_BLUE_VALUE),
- X(EGL_BIND_TO_TEXTURE_RGB),
- X(EGL_BIND_TO_TEXTURE_RGBA),
- X(EGL_MIN_SWAP_INTERVAL),
- X(EGL_MAX_SWAP_INTERVAL),
- X(EGL_LUMINANCE_SIZE),
- X(EGL_ALPHA_MASK_SIZE),
- X(EGL_COLOR_BUFFER_TYPE),
- X(EGL_RENDERABLE_TYPE),
- X(EGL_CONFORMANT),
- };
-#undef X
-
- for (size_t j = 0; j < sizeof(names) / sizeof(names[0]); j++) {
- EGLint value = -1;
- EGLint returnVal = eglGetConfigAttrib(dpy, config, names[j].attribute,
- &value);
- EGLint error = eglGetError();
- if (returnVal && error == EGL_SUCCESS) {
- testPrintI(" %s: %d (%#x)", names[j].name, value, value);
- }
- }
- testPrintI("");
-}
diff --git a/opengl/tests/lighting1709/Android.mk b/opengl/tests/lighting1709/Android.mk
deleted file mode 100644
index 9563e61..0000000
--- a/opengl/tests/lighting1709/Android.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := LightingTest
-LOCAL_CERTIFICATE := platform
-
-include $(BUILD_PACKAGE)
diff --git a/opengl/tests/lighting1709/AndroidManifest.xml b/opengl/tests/lighting1709/AndroidManifest.xml
deleted file mode 100644
index 6c23d42..0000000
--- a/opengl/tests/lighting1709/AndroidManifest.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.lightingtest">
-
- <application>
- <activity android:name="ClearActivity" android:label="LightingTest">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.DEFAULT" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/lighting1709/src/com/android/lightingtest/ClearActivity.java b/opengl/tests/lighting1709/src/com/android/lightingtest/ClearActivity.java
deleted file mode 100644
index 3ae8c5c..0000000
--- a/opengl/tests/lighting1709/src/com/android/lightingtest/ClearActivity.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2007 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.lightingtest;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.app.Activity;
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.MotionEvent;
-
-public class ClearActivity extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mGLView = new ClearGLSurfaceView(this);
- setContentView(mGLView);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- mGLView.onPause();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- mGLView.onResume();
- }
- private GLSurfaceView mGLView;
-}
-
-class ClearGLSurfaceView extends GLSurfaceView {
- public ClearGLSurfaceView(Context context) {
- super(context);
- mRenderer = new ClearRenderer();
- setRenderer(mRenderer);
- }
-
- ClearRenderer mRenderer;
-}
-
-class ClearRenderer implements GLSurfaceView.Renderer {
- public ClearRenderer() {
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- // Do nothing special.
- }
-
- public void onSurfaceChanged(GL10 gl, int w, int h) {
- // Compute the projection matrix
- gl.glMatrixMode(GL10.GL_PROJECTION);
- gl.glLoadIdentity();
-
- // Compute the boundaries of the frustum
- float fl = (float) (-(w / 2)) / 288;
- float fr = (float) (w / 2) / 288;
- float ft = (float) (h / 2) / 288;
- float fb = (float) (-(h / 2)) / 288;
-
- // Set the view frustum
- gl.glFrustumf(fl, fr, fb, ft, 1.0f, 2000.0f);
-
- // Set the viewport dimensions
- gl.glMatrixMode(GL10.GL_MODELVIEW);
- gl.glLoadIdentity();
- gl.glViewport(0, 0, w, h);
- }
-
- public void onDrawFrame(GL10 gl) {
- gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
-
- final float lightOff[] = {0.0f, 0.0f, 0.0f, 1.0f};
- final float lightAmbient[] = {5.0f, 0.0f, 0.0f, 1.0f};
- final float lightDiffuse[] = {0.0f, 2.0f, 0.0f, 0.0f};
- final float lightPosSpot[] = {0.0f, 0.0f, -8.0f, 1.0f};
-
- final float pos[] = {
- -5.0f, -1.5f, 0.0f,
- 0.0f, -1.5f, 0.0f,
- 5.0f, -1.5f, 0.0f,
- };
-
- final float v[] = new float[9];
- ByteBuffer vbb = ByteBuffer.allocateDirect(v.length*4);
- vbb.order(ByteOrder.nativeOrder());
- FloatBuffer vb = vbb.asFloatBuffer();
-
- gl.glDisable(GL10.GL_DITHER);
-
- gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbient, 0);
- gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuse, 0);
- gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_SPECULAR, lightOff, 0);
- gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPosSpot, 0);
- gl.glEnable(GL10.GL_LIGHT0);
-
- gl.glEnable(GL10.GL_LIGHTING);
-
-
- gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
- gl.glNormal3f(0, 0, 1);
-
-
- // draw first 3 triangles, without using transforms
- for (int i=0 ; i<3 ; i++) {
- v[0] = -1; v[1] =-1; v[2] = -10;
- v[3] = 0; v[4] = 1; v[5] = -10;
- v[6] = 1; v[7] =-1; v[8] = -10;
- for (int j=0 ; j<3 ; j++) {
- v[j*3+0] -= pos[i*3+0];
- v[j*3+1] -= pos[i*3+1];
- v[j*3+2] -= pos[i*3+2];
- }
- vb.put(v).position(0);
- gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vb);
- gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 3);
- }
-
- // draw the 2nd batch this time with transforms
- v[0] = -1; v[1] =-1; v[2] = -10;
- v[3] = 0; v[4] = 1; v[5] = -10;
- v[6] = 1; v[7] =-1; v[8] = -10;
- vb.put(v).position(0);
- gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vb);
-
- // draw lower left triangle
- gl.glPushMatrix();
- gl.glTranslatef(pos[0], pos[1], pos[2]);
- gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 3);
- gl.glPopMatrix();
-
- // draw lower middle triangle
- gl.glPushMatrix();
- gl.glTranslatef(pos[3], pos[4], pos[5]);
- gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 3);
- gl.glPopMatrix();
-
- // draw lower right triangle
- gl.glPushMatrix();
- gl.glTranslatef(pos[6], pos[7], pos[8]);
- gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 3);
- gl.glPopMatrix();
- }
-
- public int[] getConfigSpec() {
- int[] configSpec = { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
- return configSpec;
- }
-}
-
diff --git a/opengl/tests/linetex/Android.mk b/opengl/tests/linetex/Android.mk
deleted file mode 100644
index 5b6384e..0000000
--- a/opengl/tests/linetex/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- linetex.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv1_CM \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-linetex
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/linetex/linetex.cpp b/opengl/tests/linetex/linetex.cpp
deleted file mode 100644
index 8669492..0000000
--- a/opengl/tests/linetex/linetex.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-**
-** Copyright 2006, 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.
-*/
-
-#define LOG_TAG "fillrate"
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <EGL/egl.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <utils/StopWatch.h>
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-int main(int argc, char** argv)
-{
- EGLint configAttribs[] = {
- EGL_DEPTH_SIZE, 0,
- EGL_NONE
- };
-
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLConfig config;
- EGLSurface surface;
- EGLint w, h;
- EGLDisplay dpy;
-
- EGLNativeWindowType window = android_createDisplaySurface();
-
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglInitialize(dpy, &majorVersion, &minorVersion);
-
- status_t err = EGLUtils::selectConfigForNativeWindow(
- dpy, configAttribs, window, &config);
- if (err) {
- fprintf(stderr, "couldn't find an EGLConfig matching the screen format\n");
- return 0;
- }
-
- surface = eglCreateWindowSurface(dpy, config, window, NULL);
- context = eglCreateContext(dpy, config, NULL, NULL);
- eglMakeCurrent(dpy, surface, surface, context);
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
-
- printf("w=%d, h=%d\n", w, h);
-
- glBindTexture(GL_TEXTURE_2D, 0);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glDisable(GL_DITHER);
- glDisable(GL_BLEND);
- glEnable(GL_TEXTURE_2D);
- glColor4f(1,1,1,1);
-
-
- // default pack-alignment is 4
- const uint16_t t16[64] = { 0xFFFF, 0, 0xF800, 0, 0x07E0, 0, 0x001F, 0 };
-
- const GLfloat vertices[4][2] = {
- { w/2, 0 },
- { w/2, h }
- };
-
- const GLfloat texCoords[4][2] = {
- { 0, 0 },
- { 1, 1 }
- };
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 4, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, t16);
-
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrthof(0, w, 0, h, 0, 1);
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glVertexPointer(2, GL_FLOAT, 0, vertices);
- glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
-
- glClearColor(0,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
- glDrawArrays(GL_LINES, 0, 2);
- eglSwapBuffers(dpy, surface);
-
- usleep(5*1000000);
-
- eglTerminate(dpy);
-
- return 0;
-}
diff --git a/opengl/tests/swapinterval/Android.mk b/opengl/tests/swapinterval/Android.mk
deleted file mode 100644
index 5517f60..0000000
--- a/opengl/tests/swapinterval/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- swapinterval.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libEGL \
- libGLESv1_CM \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-swapinterval
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/swapinterval/swapinterval.cpp b/opengl/tests/swapinterval/swapinterval.cpp
deleted file mode 100644
index a0f4bc4..0000000
--- a/opengl/tests/swapinterval/swapinterval.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- **
- ** Copyright 2006, 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <EGL/egl.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <utils/StopWatch.h>
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-int main(int argc, char** argv)
-{
- EGLint configAttribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_NONE
- };
-
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLConfig config;
- EGLint numConfigs=0;
- EGLSurface surface;
- EGLint w, h;
- EGLDisplay dpy;
-
-
- EGLNativeWindowType window = android_createDisplaySurface();
-
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglInitialize(dpy, &majorVersion, &minorVersion);
- eglGetConfigs(dpy, NULL, 0, &numConfigs);
- printf("# configs = %d\n", numConfigs);
-
- status_t err = EGLUtils::selectConfigForNativeWindow(
- dpy, configAttribs, window, &config);
- if (err) {
- fprintf(stderr, "error: %s", EGLUtils::strerror(eglGetError()));
- eglTerminate(dpy);
- return 0;
- }
-
- EGLint r,g,b,a, vid;
- eglGetConfigAttrib(dpy, config, EGL_RED_SIZE, &r);
- eglGetConfigAttrib(dpy, config, EGL_GREEN_SIZE, &g);
- eglGetConfigAttrib(dpy, config, EGL_BLUE_SIZE, &b);
- eglGetConfigAttrib(dpy, config, EGL_ALPHA_SIZE, &a);
- eglGetConfigAttrib(dpy, config, EGL_NATIVE_VISUAL_ID, &vid);
-
- surface = eglCreateWindowSurface(dpy, config, window, NULL);
- if (surface == EGL_NO_SURFACE) {
- EGLint err = eglGetError();
- fprintf(stderr, "error: %s, config=%p, format = %d-%d-%d-%d, visual-id = %d\n",
- EGLUtils::strerror(err), config, r,g,b,a, vid);
- eglTerminate(dpy);
- return 0;
- } else {
- printf("config=%p, format = %d-%d-%d-%d, visual-id = %d\n",
- config, r,g,b,a, vid);
- }
-
- context = eglCreateContext(dpy, config, NULL, NULL);
- eglMakeCurrent(dpy, surface, surface, context);
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
-
- printf("w=%d, h=%d\n", w, h);
-
- glDisable(GL_DITHER);
- glEnable(GL_BLEND);
-
- glViewport(0, 0, w, h);
- glOrthof(0, w, 0, h, 0, 1);
-
- eglSwapInterval(dpy, 1);
-
- glClearColor(1,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
- eglSwapBuffers(dpy, surface);
-
-
- int time = 10;
- printf("screen should flash red/green quickly for %d s...\n", time);
-
- int c = 0;
- nsecs_t start = systemTime();
- nsecs_t t;
- do {
- glClearColor(1,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
- eglSwapBuffers(dpy, surface);
- glClearColor(0,1,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
- eglSwapBuffers(dpy, surface);
- t = systemTime() - start;
- c += 2;
- } while (int(ns2s(t))<=time);
-
- double p = (double(t) / c) / 1000000000.0;
- printf("refresh-rate is %f fps (%f ms)\n", 1.0f/p, p*1000.0);
-
- eglTerminate(dpy);
-
- return 0;
-}
diff --git a/opengl/tests/testFramerate/Android.mk b/opengl/tests/testFramerate/Android.mk
deleted file mode 100644
index 500abf3..0000000
--- a/opengl/tests/testFramerate/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#########################################################################
-# Test framerate and look for hiccups
-#########################################################################
-
-TOP_LOCAL_PATH:= $(call my-dir)
-
-# Build activity
-
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := TestFramerate
-
-include $(BUILD_PACKAGE)
diff --git a/opengl/tests/testFramerate/AndroidManifest.xml b/opengl/tests/testFramerate/AndroidManifest.xml
deleted file mode 100644
index 85617f4..0000000
--- a/opengl/tests/testFramerate/AndroidManifest.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.testframerate">
- <uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8" />
-
- <application
- android:label="@string/testFramerate_activity">
- <activity android:name="TestFramerateActivity"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:launchMode="singleTask"
- android:configChanges="orientation|keyboardHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/testFramerate/res/values/strings.xml b/opengl/tests/testFramerate/res/values/strings.xml
deleted file mode 100644
index baadf0e..0000000
--- a/opengl/tests/testFramerate/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2006 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.
--->
-
-<!-- This file contains resource definitions for displayed strings, allowing
- them to be changed based on the locale and options. -->
-
-<resources>
- <!-- Simple strings. -->
- <string name="testFramerate_activity">TestFramerate</string>
-
-</resources>
-
diff --git a/opengl/tests/testFramerate/src/com/android/testframerate/TestFramerateActivity.java b/opengl/tests/testFramerate/src/com/android/testframerate/TestFramerateActivity.java
deleted file mode 100644
index cbe279b..0000000
--- a/opengl/tests/testFramerate/src/com/android/testframerate/TestFramerateActivity.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007 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.testframerate;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.WindowManager;
-
-import java.io.File;
-
-
-public class TestFramerateActivity extends Activity {
-
- TestFramerateView mView;
-
- @Override protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- mView = new TestFramerateView(getApplication());
- setContentView(mView);
- mView.setFocusableInTouchMode(true);
- }
-
- @Override protected void onPause() {
- super.onPause();
- mView.onPause();
- }
-
- @Override protected void onResume() {
- super.onResume();
- mView.onResume();
- }
-}
diff --git a/opengl/tests/testFramerate/src/com/android/testframerate/TestFramerateView.java b/opengl/tests/testFramerate/src/com/android/testframerate/TestFramerateView.java
deleted file mode 100644
index f3fb5de..0000000
--- a/opengl/tests/testFramerate/src/com/android/testframerate/TestFramerateView.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2009 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.testframerate;
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.os.SystemProperties;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.opengl.GLES20;
-
-class TestFramerateView extends GLSurfaceView {
- private static String TAG = "TestFramerateView";
-
- public TestFramerateView(Context context) {
- super(context);
- setEGLContextClientVersion(2);
- setRenderer(new Renderer());
- }
-
- private long mLastTime_us = 0;
- private long mNumShortFramesElapsed = 0;
- private void registerTime(long now_us) {
- long longFrameTime_ms = Integer.parseInt(SystemProperties.get("debug.longframe_ms", "16"));
- long elapsedTime_us = now_us - mLastTime_us;
- float fps = 1000000.f / elapsedTime_us;
- if (mLastTime_us > 0 && elapsedTime_us > longFrameTime_ms*1000) {
- Log.v(TAG, "Long frame: " + elapsedTime_us/1000.f + " ms (" + fps + " fps)");
- if (mNumShortFramesElapsed > 0) {
- Log.v(TAG, " Short frames since last long frame: " + mNumShortFramesElapsed);
- mNumShortFramesElapsed = 0;
- }
- } else {
- ++mNumShortFramesElapsed;
- }
-
- mLastTime_us = now_us;
- }
-
- private class Renderer implements GLSurfaceView.Renderer {
- public Renderer() {
- }
-
-
- public void onDrawFrame(GL10 gl) {
- long now_us = System.nanoTime() / 1000;
- registerTime(now_us);
-
- float red = (now_us % 1000000) / 1000000.f;
- float green = (now_us % 2000000) / 2000000.f;
- float blue = (now_us % 3000000) / 3000000.f;
- GLES20.glClearColor(red, green, blue, 1.0f);
- GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- GLES20.glViewport(0, 0, width, height);
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- }
-
- }
-}
diff --git a/opengl/tests/testLatency/Android.mk b/opengl/tests/testLatency/Android.mk
deleted file mode 100644
index 96417c7..0000000
--- a/opengl/tests/testLatency/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#########################################################################
-# Test end-to-end latency.
-#########################################################################
-
-TOP_LOCAL_PATH:= $(call my-dir)
-
-# Build activity
-
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SDK_VERSION := 8
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := TestLatency
-
-include $(BUILD_PACKAGE)
diff --git a/opengl/tests/testLatency/AndroidManifest.xml b/opengl/tests/testLatency/AndroidManifest.xml
deleted file mode 100644
index 59f2643..0000000
--- a/opengl/tests/testLatency/AndroidManifest.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.testlatency">
- <uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8" />
-
- <application
- android:label="@string/testLatency_activity">
- <activity android:name="TestLatencyActivity"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:launchMode="singleTask"
- android:configChanges="orientation|keyboardHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/testLatency/res/values/strings.xml b/opengl/tests/testLatency/res/values/strings.xml
deleted file mode 100644
index d80b77c..0000000
--- a/opengl/tests/testLatency/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2006 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.
--->
-
-<!-- This file contains resource definitions for displayed strings, allowing
- them to be changed based on the locale and options. -->
-
-<resources>
- <!-- Simple strings. -->
- <string name="testLatency_activity">TestLatency</string>
-
-</resources>
-
diff --git a/opengl/tests/testLatency/src/com/android/testlatency/TestLatencyActivity.java b/opengl/tests/testLatency/src/com/android/testlatency/TestLatencyActivity.java
deleted file mode 100644
index ed993cb..0000000
--- a/opengl/tests/testLatency/src/com/android/testlatency/TestLatencyActivity.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007 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.testlatency;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.WindowManager;
-
-import java.io.File;
-
-
-public class TestLatencyActivity extends Activity {
-
- TestLatencyView mView;
-
- @Override protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- mView = new TestLatencyView(getApplication());
- setContentView(mView);
- mView.setFocusableInTouchMode(true);
- }
-
- @Override protected void onPause() {
- super.onPause();
- mView.onPause();
- }
-
- @Override protected void onResume() {
- super.onResume();
- mView.onResume();
- }
-}
diff --git a/opengl/tests/testLatency/src/com/android/testlatency/TestLatencyView.java b/opengl/tests/testLatency/src/com/android/testlatency/TestLatencyView.java
deleted file mode 100644
index d62bf17..0000000
--- a/opengl/tests/testLatency/src/com/android/testlatency/TestLatencyView.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright (C) 2009 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.testlatency;
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.opengl.GLES20;
-
-/**
- * An implementation of SurfaceView that uses the dedicated surface for
- * displaying an OpenGL animation. This allows the animation to run in a
- * separate thread, without requiring that it be driven by the update mechanism
- * of the view hierarchy.
- *
- * The application-specific rendering code is delegated to a GLView.Renderer
- * instance.
- */
-class TestLatencyView extends GLSurfaceView {
- private static String TAG = "TestLatencyiew";
- private float mX;
- private float mY;
- private float mDX;
- private float mDY;
- private long mT;
- private long mDT;
-
- public TestLatencyView(Context context) {
- super(context);
- setEGLContextClientVersion(2);
- setRenderer(new Renderer());
- }
-
- @Override
- public boolean onTouchEvent(MotionEvent event) {
- switch (event.getAction()) {
- case MotionEvent.ACTION_MOVE:
- float x = event.getX();
- float y = event.getY();
- long t = event.getEventTime();
- synchronized(this) {
- mDT = t - mT;
- mT = t;
- mDX = x - mX;
- mX = x;
- mDY = y - mY;
- mY = y;
- }
- break;
- default:
- break;
- }
- return true;
- }
-
- private class Renderer implements GLSurfaceView.Renderer {
- private float mScaleX, mScaleY, mOffsetX, mOffsetY;
- private final float MS_PER_FRAME = 1000 / 60;
- public Renderer() {
- mTriangleVertices = ByteBuffer.allocateDirect(mTriangleVerticesData.length * 4)
- .order(ByteOrder.nativeOrder()).asFloatBuffer();
- }
-
-
- public void onDrawFrame(GL10 gl) {
- GLES20.glClearColor(0.4f, 0.4f, 0.4f, 1.0f);
- GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
- GLES20.glUseProgram(mProgram);
- checkGlError("glUseProgram");
-
- float x, y, dx, dy;
- long t, dt;
- synchronized(TestLatencyView.this) {
- x = mX;
- y = mY;
- dx = mDX;
- dy = mDY;
- dt = mDT;
- }
-
- if (dt > 0) {
- dx = dx * MS_PER_FRAME / dt;
- dy = dy * MS_PER_FRAME / dt;
- }
-
- GLES20.glEnableVertexAttribArray(mvPositionHandle);
- checkGlError("glEnableVertexAttribArray");
- GLES20.glEnableVertexAttribArray(mvColorHandle);
- checkGlError("glEnableVertexAttribArray");
- for(int step = 0; step < 8; step++) {
- float sx = (x + dx * step) * mScaleX + mOffsetX;
- float sy = (y + dy * step) * mScaleY + mOffsetY;
- int cbase = step * 4;
-
- for (int i = 0; i < mTriangleVerticesData.length; i += 6) {
- mTriangleVerticesData2[i] = sx + mTriangleVerticesData[i];
- mTriangleVerticesData2[i+1] = -sy + mTriangleVerticesData[i+1];
- mTriangleVerticesData2[i+2] = mColors[cbase];
- mTriangleVerticesData2[i+3] = mColors[cbase+1];
- mTriangleVerticesData2[i+4] = mColors[cbase+2];
- mTriangleVerticesData2[i+5] = mColors[cbase+3];
- }
- mTriangleVertices.position(0);
- mTriangleVertices.put(mTriangleVerticesData2).position(0);
-
- GLES20.glVertexAttribPointer(mvPositionHandle, 2, GLES20.GL_FLOAT, false, 6*4, mTriangleVertices);
- checkGlError("glVertexAttribPointer mvPosition");
- mTriangleVertices.put(mTriangleVerticesData2).position(2);
- GLES20.glVertexAttribPointer(mvColorHandle, 4, GLES20.GL_FLOAT, false, 6*4, mTriangleVertices);
- checkGlError("glVertexAttribPointer mvColor");
- GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3);
- checkGlError("glDrawArrays");
- }
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- GLES20.glViewport(0, 0, width, height);
- mScaleX = 2.0f / width;
- mScaleY = 2.0f / height;
- mOffsetX = -1f;
- mOffsetY = -1f;
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- mProgram = createProgram(mVertexShader, mFragmentShader);
- if (mProgram == 0) {
- return;
- }
- mvPositionHandle = GLES20.glGetAttribLocation(mProgram, "aPosition");
- checkGlError("glGetAttribLocation");
- if (mvPositionHandle == -1) {
- throw new RuntimeException("Could not get attrib location for vPosition");
- }
- mvColorHandle = GLES20.glGetAttribLocation(mProgram, "aColor");
- checkGlError("glGetAttribLocation");
- if (mvColorHandle == -1) {
- throw new RuntimeException("Could not get attrib location for vColor");
- }
- }
-
- private int loadShader(int shaderType, String source) {
- int shader = GLES20.glCreateShader(shaderType);
- if (shader != 0) {
- GLES20.glShaderSource(shader, source);
- GLES20.glCompileShader(shader);
- int[] compiled = new int[1];
- GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
- if (compiled[0] == 0) {
- Log.e(TAG, "Could not compile shader " + shaderType + ":");
- Log.e(TAG, GLES20.glGetShaderInfoLog(shader));
- GLES20.glDeleteShader(shader);
- shader = 0;
- }
- }
- return shader;
- }
-
- private int createProgram(String vertexSource, String fragmentSource) {
- int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
- if (vertexShader == 0) {
- return 0;
- }
-
- int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
- if (pixelShader == 0) {
- return 0;
- }
-
- int program = GLES20.glCreateProgram();
- if (program != 0) {
- GLES20.glAttachShader(program, vertexShader);
- checkGlError("glAttachShader vertexShader");
- GLES20.glAttachShader(program, pixelShader);
- checkGlError("glAttachShader pixelShader");
- GLES20.glLinkProgram(program);
- int[] linkStatus = new int[1];
- GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
- if (linkStatus[0] != GLES20.GL_TRUE) {
- Log.e(TAG, "Could not link program: ");
- Log.e(TAG, GLES20.glGetProgramInfoLog(program));
- GLES20.glDeleteProgram(program);
- program = 0;
- }
- }
- return program;
- }
-
- private void checkGlError(String op) {
- int error;
- while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
- Log.e(TAG, op + ": glError " + error);
- throw new RuntimeException(op + ": glError " + error);
- }
- }
-
- // X, Y, R G B A
- private final float[] mTriangleVerticesData = {
- -0.025f, 0.3f, 0.0f, 1.0f, 0.0f, 1.0f,
- 0.0f , 0.0f, 0.0f, 1.0f, 0.0f, 1.0f,
- 0.025f, 0.3f, 1.0f, 1.0f, 255.0f, 1.0f
- };
-
- // Color cascade:
- private final float[] mColors = {
- 0.0f, 0.0f, 0.0f, 1.0f,
- 0.5f, 0.0f, 0.0f, 1.0f,
- 0.0f, 0.5f, 0.0f, 1.0f,
- 0.5f, 0.5f, 0.0f, 1.0f,
-
- 0.0f, 0.0f, 0.5f, 1.0f,
- 1.0f, 0.0f, 0.0f, 1.0f,
- 1.0f, 1.0f, 1.0f, 1.0f,
- 0.0f, 1.0f, 0.0f, 1.0f
- };
-
- private float[] mTriangleVerticesData2 = new float[mTriangleVerticesData.length];
- private FloatBuffer mTriangleVertices;
-
- private final String mVertexShader = "attribute vec4 aPosition;\n"
- + "attribute vec4 aColor;\n"
- + "varying vec4 vColor;\n"
- + "void main() {\n"
- + " gl_Position = aPosition;\n"
- + " vColor = aColor;\n"
- + "}\n";
-
- private final String mFragmentShader = "precision mediump float;\n"
- + "varying vec4 vColor;\n"
- + "void main() {\n"
- + " gl_FragColor = vColor;\n"
- + "}\n";
-
- private int mProgram;
- private int mvPositionHandle;
- private int mvColorHandle;
-
- }
-}
-
diff --git a/opengl/tests/testPauseResume/Android.mk b/opengl/tests/testPauseResume/Android.mk
deleted file mode 100644
index cf8bdc3..0000000
--- a/opengl/tests/testPauseResume/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#########################################################################
-# OpenGL ES JNI sample
-# This makefile builds both an activity and a shared library.
-#########################################################################
-TOP_LOCAL_PATH:= $(call my-dir)
-
-# Build activity
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := TestEGL
-
-include $(BUILD_PACKAGE)
diff --git a/opengl/tests/testPauseResume/AndroidManifest.xml b/opengl/tests/testPauseResume/AndroidManifest.xml
deleted file mode 100644
index 1879bc3..0000000
--- a/opengl/tests/testPauseResume/AndroidManifest.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.test">
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <application
- android:label="@string/test_activity">
- <activity android:name="TestActivity"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:launchMode="singleTask"
- android:screenOrientation="landscape"
- android:configChanges="orientation|keyboardHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/testPauseResume/README b/opengl/tests/testPauseResume/README
deleted file mode 100644
index 87db74a..0000000
--- a/opengl/tests/testPauseResume/README
+++ /dev/null
@@ -1,37 +0,0 @@
-Repro steps:
-
-build, install and run the attached test program TestEgl.apk
-
-The program does not draw anything to the screen, it just prints to the log, so use adb logcat to watch the output.
-
-Expected behavior:
-
-constantly increasing "step" count:
-
-
-W/TestActivity( 1885): ****** step 235 resume
-W/TestActivity( 1885): step 236 pause
-W/TestActivity( 1885): ****** step 236 resume
-
-and so on.
-
-Actual behavior:
-
-W/TestActivity( 1466): ****** step 25 resume
-W/TestActivity( 1466): step 26 pause
-W/TestActivity( 1466): ****** step 26 resume
-W/dalvikvm( 1466): threadid=8: thread exiting with uncaught exception (group=0x4001d7f0)
-E/AndroidRuntime( 1466): FATAL EXCEPTION: GLThread 9
-E/AndroidRuntime( 1466): java.lang.RuntimeException: createContext failed: EGL_BAD_ALLOC
-E/AndroidRuntime( 1466): at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1067)
-E/AndroidRuntime( 1466): at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1059)
-E/AndroidRuntime( 1466): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:925)
-E/AndroidRuntime( 1466): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1236)
-E/AndroidRuntime( 1466): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1106)
-W/TestActivity( 1466): step 27 pause
-W/TestActivity( 1466): ****** step 27 resume
-W/TestActivity( 1466): step 28 pause
-W/TestActivity( 1466): ****** step 28 resume
-
-
-See http://b/issue?id=2550745 for further details.
diff --git a/opengl/tests/testPauseResume/res/values/strings.xml b/opengl/tests/testPauseResume/res/values/strings.xml
deleted file mode 100644
index b4c98fe2..0000000
--- a/opengl/tests/testPauseResume/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2006 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.
--->
-
-<!-- This file contains resource definitions for displayed strings, allowing
- them to be changed based on the locale and options. -->
-
-<resources>
- <!-- Simple strings. -->
- <string name="test_activity">Test Egl</string>
-
-</resources>
-
diff --git a/opengl/tests/testPauseResume/src/com/android/test/TestActivity.java b/opengl/tests/testPauseResume/src/com/android/test/TestActivity.java
deleted file mode 100644
index 9dc71321..0000000
--- a/opengl/tests/testPauseResume/src/com/android/test/TestActivity.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2007 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.test;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-
-public class TestActivity extends Activity {
- private final static String TAG = "TestActivity";
- TestView mView;
- boolean mToggle;
- int mCount;
- final static int PAUSE_DELAY = 100;
- Runnable mRunnable = new Runnable() {
- public void run() {
- if (mToggle) {
- Log.w(TAG, "****** step " + mCount + " resume");
- mCount++;
- mView.onResume();
- } else {
- Log.w(TAG, "step " + mCount + " pause");
- mView.onPause();
- }
- mToggle = ! mToggle;
- mView.postDelayed(mRunnable, PAUSE_DELAY);
- }
- };
-
- @Override
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- mView = new TestView(getApplication());
- mView.setFocusableInTouchMode(true);
- setContentView(mView);
- mView.postDelayed(mRunnable, PAUSE_DELAY);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- mView.onPause();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- mView.onResume();
- }
-}
diff --git a/opengl/tests/testPauseResume/src/com/android/test/TestView.java b/opengl/tests/testPauseResume/src/com/android/test/TestView.java
deleted file mode 100644
index 8c28f13..0000000
--- a/opengl/tests/testPauseResume/src/com/android/test/TestView.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2009 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.test;
-/*
- * Copyright (C) 2008 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.
- */
-
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-/**
- * An implementation of SurfaceView that uses the dedicated surface for
- * displaying an OpenGL animation. This allows the animation to run in a
- * separate thread, without requiring that it be driven by the update mechanism
- * of the view hierarchy.
- *
- * The application-specific rendering code is delegated to a GLView.Renderer
- * instance.
- */
-class TestView extends GLSurfaceView {
- TestView(Context context) {
- super(context);
- init();
- }
-
- public TestView(Context context, AttributeSet attrs) {
- super(context, attrs);
- init();
- }
-
- private void init() {
- setRenderer(new Renderer());
- }
-
- private class Renderer implements GLSurfaceView.Renderer {
- private static final String TAG = "Renderer";
- public void onDrawFrame(GL10 gl) {
- // Do nothing.
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- // Do nothing.
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- // Do nothing.
- }
- }
-}
-
diff --git a/opengl/tests/testViewport/Android.mk b/opengl/tests/testViewport/Android.mk
deleted file mode 100644
index 9980e7d..0000000
--- a/opengl/tests/testViewport/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-#########################################################################
-# OpenGL ES JNI sample
-# This makefile builds both an activity and a shared library.
-#########################################################################
-TOP_LOCAL_PATH:= $(call my-dir)
-
-# Build activity
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := TestViewport
-
-# Set a specific SDK version so we can run on Froyo.
-
-LOCAL_SDK_VERSION := 8
-
-include $(BUILD_PACKAGE)
diff --git a/opengl/tests/testViewport/AndroidManifest.xml b/opengl/tests/testViewport/AndroidManifest.xml
deleted file mode 100644
index ba178bb..0000000
--- a/opengl/tests/testViewport/AndroidManifest.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.test">
- <uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8" />
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <application
- android:label="@string/test_activity">
- <activity android:name="TestActivity"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:configChanges="orientation|keyboardHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/opengl/tests/testViewport/README b/opengl/tests/testViewport/README
deleted file mode 100644
index c06abc9..0000000
--- a/opengl/tests/testViewport/README
+++ /dev/null
@@ -1,28 +0,0 @@
-Repro steps:
-
-build, install and run the attached test program TestViewport.apk
-
-Run on Sapphire with Froyo.
-
-The program clears the screen to blue, then draws a full screen white quad that
-is alligned to the screen.
-(Therefore the whole screen should appear to be white.)
-
-
-Note that screen is all white.
-
-Rotate screen 90 degrees.
-
-Expected: screen is still all white.
-
-Actual: screen is blue with offset white rectangle.
-
-This bug only happens on Sapphire, it works correctly on Passion.
-
-What happens:
-
-I think the bug is that the gl.glViewport() call in onSurfaceChanged() is
-being ignored by the OpenGL driver.
-
-NOTE: If a gl.glViewport call is added at the beginning of the onDrawFrame()
-call (which means it is called before every draw), the program runs correctly.
diff --git a/opengl/tests/testViewport/res/values/strings.xml b/opengl/tests/testViewport/res/values/strings.xml
deleted file mode 100644
index c037a7c..0000000
--- a/opengl/tests/testViewport/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2006 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.
--->
-
-<!-- This file contains resource definitions for displayed strings, allowing
- them to be changed based on the locale and options. -->
-
-<resources>
- <!-- Simple strings. -->
- <string name="test_activity">Test Viewport</string>
-
-</resources>
-
diff --git a/opengl/tests/testViewport/src/com/android/test/TestActivity.java b/opengl/tests/testViewport/src/com/android/test/TestActivity.java
deleted file mode 100644
index cc7e450..0000000
--- a/opengl/tests/testViewport/src/com/android/test/TestActivity.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2007 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.test;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-
-public class TestActivity extends Activity {
- private final static String TAG = "TestActivity";
- TestView mView;
-
- @Override
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- mView = new TestView(getApplication());
- mView.setFocusableInTouchMode(true);
- setContentView(mView);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- mView.onPause();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- mView.onResume();
- }
-}
diff --git a/opengl/tests/testViewport/src/com/android/test/TestView.java b/opengl/tests/testViewport/src/com/android/test/TestView.java
deleted file mode 100644
index 23cc37d..0000000
--- a/opengl/tests/testViewport/src/com/android/test/TestView.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (C) 2009 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.test;
-/*
- * Copyright (C) 2008 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.
- */
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.CharBuffer;
-import java.nio.FloatBuffer;
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL;
-import javax.microedition.khronos.opengles.GL10;
-import javax.microedition.khronos.opengles.GL11;
-/**
- * An implementation of SurfaceView that uses the dedicated surface for
- * displaying an OpenGL animation. This allows the animation to run in a
- * separate thread, without requiring that it be driven by the update mechanism
- * of the view hierarchy.
- *
- * The application-specific rendering code is delegated to a GLView.Renderer
- * instance.
- */
-class TestView extends GLSurfaceView {
- TestView(Context context) {
- super(context);
- init();
- }
-
- public TestView(Context context, AttributeSet attrs) {
- super(context, attrs);
- init();
- }
-
- private void init() {
- setRenderer(new Renderer());
- setRenderMode(RENDERMODE_WHEN_DIRTY);
- }
-
- /** A grid is a topologically rectangular array of vertices.
- *
- * The vertex and index data are held in VBO objects because on most
- * GPUs VBO objects are the fastest way of rendering static vertex
- * and index data.
- *
- */
-
- private static class Grid {
- // Size of vertex data elements in bytes:
- final static int FLOAT_SIZE = 4;
- final static int CHAR_SIZE = 2;
-
- // Vertex structure:
- // float x, y, z;
-
- final static int VERTEX_SIZE = 3 * FLOAT_SIZE;
-
- private int mVertexBufferObjectId;
- private int mElementBufferObjectId;
-
- // These buffers are used to hold the vertex and index data while
- // constructing the grid. Once createBufferObjects() is called
- // the buffers are nulled out to save memory.
-
- private ByteBuffer mVertexByteBuffer;
- private FloatBuffer mVertexBuffer;
- private CharBuffer mIndexBuffer;
-
- private int mW;
- private int mH;
- private int mIndexCount;
-
- public Grid(int w, int h) {
- if (w < 0 || w >= 65536) {
- throw new IllegalArgumentException("w");
- }
- if (h < 0 || h >= 65536) {
- throw new IllegalArgumentException("h");
- }
- if (w * h >= 65536) {
- throw new IllegalArgumentException("w * h >= 65536");
- }
-
- mW = w;
- mH = h;
- int size = w * h;
-
- mVertexByteBuffer = ByteBuffer.allocateDirect(VERTEX_SIZE * size)
- .order(ByteOrder.nativeOrder());
- mVertexBuffer = mVertexByteBuffer.asFloatBuffer();
-
- int quadW = mW - 1;
- int quadH = mH - 1;
- int quadCount = quadW * quadH;
- int indexCount = quadCount * 6;
- mIndexCount = indexCount;
- mIndexBuffer = ByteBuffer.allocateDirect(CHAR_SIZE * indexCount)
- .order(ByteOrder.nativeOrder()).asCharBuffer();
-
- /*
- * Initialize triangle list mesh.
- *
- * [0]-----[ 1] ...
- * | / |
- * | / |
- * | / |
- * [w]-----[w+1] ...
- * | |
- *
- */
-
- {
- int i = 0;
- for (int y = 0; y < quadH; y++) {
- for (int x = 0; x < quadW; x++) {
- char a = (char) (y * mW + x);
- char b = (char) (y * mW + x + 1);
- char c = (char) ((y + 1) * mW + x);
- char d = (char) ((y + 1) * mW + x + 1);
-
- mIndexBuffer.put(i++, a);
- mIndexBuffer.put(i++, c);
- mIndexBuffer.put(i++, b);
-
- mIndexBuffer.put(i++, b);
- mIndexBuffer.put(i++, c);
- mIndexBuffer.put(i++, d);
- }
- }
- }
-
- }
-
- public void set(int i, int j, float x, float y, float z) {
- if (i < 0 || i >= mW) {
- throw new IllegalArgumentException("i");
- }
- if (j < 0 || j >= mH) {
- throw new IllegalArgumentException("j");
- }
-
- int index = mW * j + i;
-
- mVertexBuffer.position(index * VERTEX_SIZE / FLOAT_SIZE);
- mVertexBuffer.put(x);
- mVertexBuffer.put(y);
- mVertexBuffer.put(z);
- }
-
- public void createBufferObjects(GL gl) {
- // Generate a the vertex and element buffer IDs
- int[] vboIds = new int[2];
- GL11 gl11 = (GL11) gl;
- gl11.glGenBuffers(2, vboIds, 0);
- mVertexBufferObjectId = vboIds[0];
- mElementBufferObjectId = vboIds[1];
-
- // Upload the vertex data
- gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertexBufferObjectId);
- mVertexByteBuffer.position(0);
- gl11.glBufferData(GL11.GL_ARRAY_BUFFER, mVertexByteBuffer.capacity(), mVertexByteBuffer, GL11.GL_STATIC_DRAW);
-
- gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mElementBufferObjectId);
- mIndexBuffer.position(0);
- gl11.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer.capacity() * CHAR_SIZE, mIndexBuffer, GL11.GL_STATIC_DRAW);
-
- // We don't need the in-memory data any more
- mVertexBuffer = null;
- mVertexByteBuffer = null;
- mIndexBuffer = null;
- }
-
- public void draw(GL10 gl) {
- GL11 gl11 = (GL11) gl;
-
- gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
-
- gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertexBufferObjectId);
- gl11.glVertexPointer(3, GL10.GL_FLOAT, VERTEX_SIZE, 0);
-
- gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mElementBufferObjectId);
- gl11.glDrawElements(GL10.GL_TRIANGLES, mIndexCount, GL10.GL_UNSIGNED_SHORT, 0);
- gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
- gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
- gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, 0);
- }
- }
-
-
- private class Renderer implements GLSurfaceView.Renderer {
- private static final String TAG = "Renderer";
- private Grid mGrid;
-
- public void onDrawFrame(GL10 gl) {
- gl.glClearColor(0,0,1,1);
- gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
- mGrid.draw(gl);
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- gl.glViewport(0, 0, width, height);
- gl.glMatrixMode(GL11.GL_PROJECTION);
- gl.glLoadIdentity();
- gl.glOrthof(0, width, height, 0, -1, 1);
- gl.glMatrixMode(GL11.GL_MODELVIEW);
- createGrid(gl, width, height);
- }
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- }
-
- private void createGrid(GL10 gl, float w, float h) {
- mGrid = new Grid(2, 2);
- for (int j = 0; j < 2; j++) {
- for (int i = 0; i < 2; i++) {
- float x = w * i;
- float y = h * j;
- float z = 0.0f;
- mGrid.set(i,j, x, y, z);
- }
- }
- mGrid.createBufferObjects(gl);
- }
- }
-}
-
diff --git a/opengl/tests/textures/Android.mk b/opengl/tests/textures/Android.mk
deleted file mode 100644
index 97697d7..0000000
--- a/opengl/tests/textures/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- textures.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv1_CM \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-textures
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/textures/textures.cpp b/opengl/tests/textures/textures.cpp
deleted file mode 100644
index 5d3d94e..0000000
--- a/opengl/tests/textures/textures.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-**
-** Copyright 2006, 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.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <EGL/egl.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-using namespace android;
-
-int main(int argc, char** argv)
-{
- EGLint configAttribs[] = {
- EGL_DEPTH_SIZE, 0,
- EGL_NONE
- };
-
- EGLint majorVersion;
- EGLint minorVersion;
- EGLContext context;
- EGLConfig config;
- EGLSurface surface;
- EGLint w, h;
- EGLDisplay dpy;
-
- EGLNativeWindowType window = android_createDisplaySurface();
-
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglInitialize(dpy, &majorVersion, &minorVersion);
-
- status_t err = EGLUtils::selectConfigForNativeWindow(
- dpy, configAttribs, window, &config);
- if (err) {
- fprintf(stderr, "couldn't find an EGLConfig matching the screen format\n");
- return 0;
- }
-
- surface = eglCreateWindowSurface(dpy, config, window, NULL);
- context = eglCreateContext(dpy, config, NULL, NULL);
- eglMakeCurrent(dpy, surface, surface, context);
- eglQuerySurface(dpy, surface, EGL_WIDTH, &w);
- eglQuerySurface(dpy, surface, EGL_HEIGHT, &h);
- GLint dim = w<h ? w : h;
-
-
- GLint crop[4] = { 0, 4, 4, -4 };
- glBindTexture(GL_TEXTURE_2D, 0);
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glEnable(GL_TEXTURE_2D);
- glColor4f(1,1,1,1);
-
- // packing is always 4
- uint8_t t8[] = {
- 0x00, 0x55, 0x00, 0x55,
- 0xAA, 0xFF, 0xAA, 0xFF,
- 0x00, 0x55, 0x00, 0x55,
- 0xAA, 0xFF, 0xAA, 0xFF };
-
- uint16_t t16[] = {
- 0x0000, 0x5555, 0x0000, 0x5555,
- 0xAAAA, 0xFFFF, 0xAAAA, 0xFFFF,
- 0x0000, 0x5555, 0x0000, 0x5555,
- 0xAAAA, 0xFFFF, 0xAAAA, 0xFFFF };
-
- uint16_t t5551[] = {
- 0x0000, 0xFFFF, 0x0000, 0xFFFF,
- 0xFFFF, 0x0000, 0xFFFF, 0x0000,
- 0x0000, 0xFFFF, 0x0000, 0xFFFF,
- 0xFFFF, 0x0000, 0xFFFF, 0x0000 };
-
- uint32_t t32[] = {
- 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFFFF0000,
- 0xFF00FF00, 0xFFFF0000, 0xFF000000, 0xFF0000FF,
- 0xFF00FFFF, 0xFF00FF00, 0x00FF00FF, 0xFFFFFF00,
- 0xFF000000, 0xFFFF00FF, 0xFF00FFFF, 0xFFFFFFFF
- };
-
-
- glClear(GL_COLOR_BUFFER_BIT);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 4, 4, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, t8);
- glDrawTexiOES(0, 0, 0, dim/2, dim/2);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, t16);
- glDrawTexiOES(dim/2, 0, 0, dim/2, dim/2);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, t16);
- glDrawTexiOES(0, dim/2, 0, dim/2, dim/2);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, t32);
- glDrawTexiOES(dim/2, dim/2, 0, dim/2, dim/2);
-
- eglSwapBuffers(dpy, surface);
- return 0;
-}
diff --git a/opengl/tests/tritex/Android.mk b/opengl/tests/tritex/Android.mk
deleted file mode 100644
index 89faa87..0000000
--- a/opengl/tests/tritex/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- tritex.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libEGL \
- libGLESv1_CM \
- libui
-
-LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= test-opengl-tritex
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
diff --git a/opengl/tests/tritex/tritex.cpp b/opengl/tests/tritex/tritex.cpp
deleted file mode 100644
index f183483..0000000
--- a/opengl/tests/tritex/tritex.cpp
+++ /dev/null
@@ -1,277 +0,0 @@
-// Calls glDrawElements() the number of times specified by
-// ITERATIONS. Should draw a checkerboard on the screen after
-// a few seconds.
-//
-// Ported from a Java version by Google.
-
-#include <EGL/egl.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <ui/FramebufferNativeWindow.h>
-#include "EGLUtils.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-using namespace android;
-
-EGLDisplay eglDisplay;
-EGLSurface eglSurface;
-EGLContext eglContext;
-GLuint texture;
-
-#define FIXED_ONE 0x10000
-#define ITERATIONS 50
-
-int init_gl_surface(void);
-void free_gl_surface(void);
-void init_scene(void);
-void render(int quads);
-void create_texture(void);
-int readTimer(void);
-
-static void gluLookAt(float eyeX, float eyeY, float eyeZ,
- float centerX, float centerY, float centerZ, float upX, float upY,
- float upZ)
-{
- // See the OpenGL GLUT documentation for gluLookAt for a description
- // of the algorithm. We implement it in a straightforward way:
-
- float fx = centerX - eyeX;
- float fy = centerY - eyeY;
- float fz = centerZ - eyeZ;
-
- // Normalize f
- float rlf = 1.0f / sqrtf(fx*fx + fy*fy + fz*fz);
- fx *= rlf;
- fy *= rlf;
- fz *= rlf;
-
- // Normalize up
- float rlup = 1.0f / sqrtf(upX*upX + upY*upY + upZ*upZ);
- upX *= rlup;
- upY *= rlup;
- upZ *= rlup;
-
- // compute s = f x up (x means "cross product")
-
- float sx = fy * upZ - fz * upY;
- float sy = fz * upX - fx * upZ;
- float sz = fx * upY - fy * upX;
-
- // compute u = s x f
- float ux = sy * fz - sz * fy;
- float uy = sz * fx - sx * fz;
- float uz = sx * fy - sy * fx;
-
- float m[16] ;
- m[0] = sx;
- m[1] = ux;
- m[2] = -fx;
- m[3] = 0.0f;
-
- m[4] = sy;
- m[5] = uy;
- m[6] = -fy;
- m[7] = 0.0f;
-
- m[8] = sz;
- m[9] = uz;
- m[10] = -fz;
- m[11] = 0.0f;
-
- m[12] = 0.0f;
- m[13] = 0.0f;
- m[14] = 0.0f;
- m[15] = 1.0f;
-
- glMultMatrixf(m);
- glTranslatef(-eyeX, -eyeY, -eyeZ);
-}
-
-int main(int argc, char **argv)
-{
- int q;
- int start, end;
-
- printf("Initializing EGL...\n");
-
- if(!init_gl_surface())
- {
- printf("GL initialisation failed - exiting\n");
- return 0;
- }
-
- init_scene();
-
- create_texture();
-
- printf("Start test...\n");
-
- render(argc==2 ? atoi(argv[1]) : ITERATIONS);
-
- free_gl_surface();
-
- return 0;
-}
-
-int init_gl_surface(void)
-{
- EGLint numConfigs = 1;
- EGLConfig myConfig = {0};
- EGLint attrib[] =
- {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_DEPTH_SIZE, 16,
- EGL_NONE
- };
-
- if ( (eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY)) == EGL_NO_DISPLAY )
- {
- printf("eglGetDisplay failed\n");
- return 0;
- }
-
- if ( eglInitialize(eglDisplay, NULL, NULL) != EGL_TRUE )
- {
- printf("eglInitialize failed\n");
- return 0;
- }
-
- EGLNativeWindowType window = android_createDisplaySurface();
- EGLUtils::selectConfigForNativeWindow(eglDisplay, attrib, window, &myConfig);
-
- if ( (eglSurface = eglCreateWindowSurface(eglDisplay, myConfig,
- window, 0)) == EGL_NO_SURFACE )
- {
- printf("eglCreateWindowSurface failed\n");
- return 0;
- }
-
- if ( (eglContext = eglCreateContext(eglDisplay, myConfig, 0, 0)) == EGL_NO_CONTEXT )
- {
- printf("eglCreateContext failed\n");
- return 0;
- }
-
- if ( eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext) != EGL_TRUE )
- {
- printf("eglMakeCurrent failed\n");
- return 0;
- }
-
- return 1;
-}
-
-void free_gl_surface(void)
-{
- if (eglDisplay != EGL_NO_DISPLAY)
- {
- eglMakeCurrent( EGL_NO_DISPLAY, EGL_NO_SURFACE,
- EGL_NO_SURFACE, EGL_NO_CONTEXT );
- eglDestroyContext( eglDisplay, eglContext );
- eglDestroySurface( eglDisplay, eglSurface );
- eglTerminate( eglDisplay );
- eglDisplay = EGL_NO_DISPLAY;
- }
-}
-
-void init_scene(void)
-{
- glDisable(GL_DITHER);
- glEnable(GL_CULL_FACE);
-
- float ratio = 320.0f / 480.0f;
- glViewport(0, 0, 320, 480);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustumf(-ratio, ratio, -1, 1, 1, 10);
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- gluLookAt(
- 0, 0, 3, // eye
- 0, 0, 0, // center
- 0, 1, 0); // up
-
- glEnable(GL_TEXTURE_2D);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-}
-
-void create_texture(void)
-{
- const unsigned int on = 0xff0000ff;
- const unsigned int off = 0xffffffff;
- const unsigned int pixels[] =
- {
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- on, off, on, off, on, off, on, off,
- off, on, off, on, off, on, off, on,
- };
- glGenTextures(1, &texture);
- glBindTexture(GL_TEXTURE_2D, texture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-}
-
-void render(int quads)
-{
- int i, j;
-
- const GLfloat vertices[] = {
- -1, -1, 0,
- 1, -1, 0,
- 1, 1, 0,
- -1, 1, 0
- };
-
- const GLfixed texCoords[] = {
- 0, 0,
- FIXED_ONE, 0,
- FIXED_ONE, FIXED_ONE,
- 0, FIXED_ONE
- };
-
- const GLushort quadIndices[] = { 0, 1, 2, 0, 2, 3 };
-
-
- GLushort* indices = (GLushort*)malloc(quads*sizeof(quadIndices));
- for (i=0 ; i<quads ; i++)
- memcpy(indices+(sizeof(quadIndices)/sizeof(indices[0]))*i, quadIndices, sizeof(quadIndices));
-
- glVertexPointer(3, GL_FLOAT, 0, vertices);
- glTexCoordPointer(2, GL_FIXED, 0, texCoords);
-
- // make sure to do a couple eglSwapBuffers to make sure there are
- // no problems with the very first ones (who knows)
- glClearColor(0.4, 0.4, 0.4, 0.4);
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- eglSwapBuffers(eglDisplay, eglSurface);
- glClearColor(0.6, 0.6, 0.6, 0.6);
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- eglSwapBuffers(eglDisplay, eglSurface);
- glClearColor(1.0, 1.0, 1.0, 1.0);
-
- for (j=0 ; j<10 ; j++) {
- printf("loop %d / 10 (%d quads / loop)\n", j, quads);
-
- int nelem = sizeof(quadIndices)/sizeof(quadIndices[0]);
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- glDrawElements(GL_TRIANGLES, nelem*quads, GL_UNSIGNED_SHORT, indices);
- eglSwapBuffers(eglDisplay, eglSurface);
- }
-
- free(indices);
-}
-
diff --git a/opengl/tools/glgen/.gitignore b/opengl/tools/glgen/.gitignore
deleted file mode 100644
index 007ec65..0000000
--- a/opengl/tools/glgen/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-generated
-out
diff --git a/opengl/tools/glgen/gen b/opengl/tools/glgen/gen
deleted file mode 100755
index 31f4190..0000000
--- a/opengl/tools/glgen/gen
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/bin/bash
-set -u
-set -e
-rm -rf out generated
-
-mkdir out
-
-# Create dummy Java files for Android APIs that are used by the code we generate.
-# This allows us to test the generated code without building the rest of Android.
-
-mkdir -p out/javax/microedition/khronos/opengles
-mkdir -p out/com/google/android/gles_jni
-mkdir -p out/android/app
-mkdir -p out/android/graphics
-mkdir -p out/android/opengl
-mkdir -p out/android/content
-mkdir -p out/android/content/pm
-mkdir -p out/android/os
-mkdir -p out/android/util
-
-echo "package android.graphics;" > out/android/graphics/Canvas.java
-echo "public interface Canvas {}" >> out/android/graphics/Canvas.java
-
-echo "package android.app; import android.content.pm.IPackageManager; public class AppGlobals { public static IPackageManager getPackageManager() { return null;} }" > out/android/app/AppGlobals.java
-# echo "package android.content; import android.content.pm.PackageManager; public interface Context { public PackageManager getPackageManager(); }" > out/android/content/Context.java
-echo "package android.content.pm; public class ApplicationInfo {public int targetSdkVersion;}" > out/android/content/pm/ApplicationInfo.java
-echo "package android.content.pm; public interface IPackageManager {ApplicationInfo getApplicationInfo(java.lang.String packageName, int flags) throws android.os.RemoteException;}" > out/android/content/pm/IPackageManager.java
-echo "package android.os; public class Build {public static class VERSION_CODES { public static final int CUPCAKE = 3;}; }" > out/android/os/Build.java
-echo "package android.os; public class RemoteException extends Exception {}" > out/android/os/RemoteException.java
-echo "package android.util; public class Log {public static void w(String a, String b) {} public static void e(String a, String b) {}}" > out/android/util/Log.java
-
-GLFILE=out/javax/microedition/khronos/opengles/GL.java
-cp stubs/jsr239/GLHeader.java-if $GLFILE
-
-GLGEN_FILES="CFunc.java CType.java CodeEmitter.java GenerateGL.java GenerateGLES.java GLESCodeEmitter.java JFunc.java JniCodeEmitter.java JType.java Jsr239CodeEmitter.java ParameterChecker.java"
-
-pushd src > /dev/null
-javac ${GLGEN_FILES}
-JAVAC_RESULT=$?
-if [ $JAVAC_RESULT -ne 0 ]; then
- echo "Could not compile glgen."
- exit $JAVAC_RESULT
-fi
-popd > /dev/null
-
-echo "Generating JSR239-like APIs"
-java -classpath src GenerateGL -c specs/jsr239/glspec-1.0 specs/jsr239/glspec-1.0ext specs/jsr239/glspec-1.1 specs/jsr239/glspec-1.1ext specs/jsr239/glspec-1.1extpack specs/jsr239/glspec-checks
-JAVA_RESULT=$?
-if [ $JAVA_RESULT -ne 0 ]; then
- echo "Could not run GenerateGL."
- exit $JAVA_RESULT
-fi
-
-echo "Generating static OpenGLES 1.1 bindings"
-java -classpath src GenerateGLES
-JAVA_RESULT=$?
-if [ $JAVA_RESULT -ne 0 ]; then
- echo "Could not run GenerateGLES."
- exit $JAVA_RESULT
-fi
-
-rm src/*.class
-
-pushd out > /dev/null
-mkdir classes
-javac -d classes com/google/android/gles_jni/GLImpl.java javax/microedition/khronos/opengles/GL10.java javax/microedition/khronos/opengles/GL10Ext.java javax/microedition/khronos/opengles/GL11.java javax/microedition/khronos/opengles/GL11Ext.java javax/microedition/khronos/opengles/GL11ExtensionPack.java android/opengl/GLES10.java android/opengl/GLES10Ext.java android/opengl/GLES11.java android/opengl/GLES11Ext.java android/opengl/GLES20.java
-popd > /dev/null
-JAVA_RESULT=$?
-if [ $JAVA_RESULT -ne 0 ]; then
- echo "Could not compile generated classes."
- exit $JAVA_RESULT
-fi
-
-rm -rf generated
-mkdir -p generated/C
-cp out/com_google_android_gles_jni_GLImpl.cpp generated/C
-cp -r out/com generated
-cp -r out/javax generated
-
-cp out/android_opengl_*.cpp generated/C
-mkdir -p generated/android/opengl
-cp -r out/android/opengl generated/android
-
-rm -rf out
-KEEP_GENERATED=0
-SAID_PLEASE=0
-
-# compareGenerated destDir generatedDir file
-compareGenerated() {
- if cmp -s $1/$3 $2/$3 ; then
- echo "# " $3 unchanged
- else
- if [ $SAID_PLEASE == "0" ] ; then
- echo Please evaluate the following commands:
- echo
- SAID_PLEASE=1
- fi
- echo " " cp $2/$3 $1
- echo " " git add $1/$3
- KEEP_GENERATED=1
- fi
-}
-
-compareGenerated ../../../core/jni generated/C com_google_android_gles_jni_GLImpl.cpp
-compareGenerated ../../java/com/google/android/gles_jni generated/com/google/android/gles_jni GLImpl.java
-
-for x in GL.java GL10.java GL10Ext.java GL11.java GL11Ext.java GL11ExtensionPack.java
-do
- compareGenerated ../../java/javax/microedition/khronos/opengles generated/javax/microedition/khronos/opengles $x
-done
-
-for x in GLES10 GLES10Ext GLES11 GLES11Ext GLES20
-do
- compareGenerated ../../java/android/opengl generated/android/opengl ${x}.java
- compareGenerated ../../../core/jni generated/C android_opengl_${x}.cpp
-done
-
-if [ $KEEP_GENERATED == "0" ] ; then
- rm -rf generated
-fi
diff --git a/opengl/tools/glgen/specs/gles11/GLES10.spec b/opengl/tools/glgen/specs/gles11/GLES10.spec
deleted file mode 100644
index 8e1152d..0000000
--- a/opengl/tools/glgen/specs/gles11/GLES10.spec
+++ /dev/null
@@ -1,106 +0,0 @@
-void glActiveTexture ( GLenum texture )
-void glAlphaFunc ( GLenum func, GLclampf ref )
-void glAlphaFuncx ( GLenum func, GLclampx ref )
-void glBindTexture ( GLenum target, GLuint texture )
-void glBlendFunc ( GLenum sfactor, GLenum dfactor )
-void glClear ( GLbitfield mask )
-void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
-void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha )
-void glClearDepthf ( GLclampf depth )
-void glClearDepthx ( GLclampx depth )
-void glClearStencil ( GLint s )
-void glClientActiveTexture ( GLenum texture )
-void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
-void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha )
-void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
-void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data )
-void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data )
-void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
-void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
-void glCullFace ( GLenum mode )
-void glDeleteTextures ( GLsizei n, const GLuint *textures )
-void glDepthFunc ( GLenum func )
-void glDepthMask ( GLboolean flag )
-void glDepthRangef ( GLclampf zNear, GLclampf zFar )
-void glDepthRangex ( GLclampx zNear, GLclampx zFar )
-void glDisable ( GLenum cap )
-void glDisableClientState ( GLenum array )
-void glDrawArrays ( GLenum mode, GLint first, GLsizei count )
-void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
-void glEnable ( GLenum cap )
-void glEnableClientState ( GLenum array )
-void glFinish ( void )
-void glFlush ( void )
-void glFogf ( GLenum pname, GLfloat param )
-void glFogfv ( GLenum pname, const GLfloat *params )
-void glFogx ( GLenum pname, GLfixed param )
-void glFogxv ( GLenum pname, const GLfixed *params )
-void glFrontFace ( GLenum mode )
-void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
-void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
-void glGenTextures ( GLsizei n, GLuint *textures )
-GLenum glGetError ( void )
-void glGetIntegerv ( GLenum pname, GLint *params )
-const GLubyte * glGetString ( GLenum name )
-void glHint ( GLenum target, GLenum mode )
-void glLightModelf ( GLenum pname, GLfloat param )
-void glLightModelfv ( GLenum pname, const GLfloat *params )
-void glLightModelx ( GLenum pname, GLfixed param )
-void glLightModelxv ( GLenum pname, const GLfixed *params )
-void glLightf ( GLenum light, GLenum pname, GLfloat param )
-void glLightfv ( GLenum light, GLenum pname, const GLfloat *params )
-void glLightx ( GLenum light, GLenum pname, GLfixed param )
-void glLightxv ( GLenum light, GLenum pname, const GLfixed *params )
-void glLineWidth ( GLfloat width )
-void glLineWidthx ( GLfixed width )
-void glLoadIdentity ( void )
-void glLoadMatrixf ( const GLfloat *m )
-void glLoadMatrixx ( const GLfixed *m )
-void glLogicOp ( GLenum opcode )
-void glMaterialf ( GLenum face, GLenum pname, GLfloat param )
-void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params )
-void glMaterialx ( GLenum face, GLenum pname, GLfixed param )
-void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params )
-void glMatrixMode ( GLenum mode )
-void glMultMatrixf ( const GLfloat *m )
-void glMultMatrixx ( const GLfixed *m )
-void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q )
-void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q )
-void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz )
-void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz )
-void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer )
-void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
-void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
-void glPixelStorei ( GLenum pname, GLint param )
-void glPointSize ( GLfloat size )
-void glPointSizex ( GLfixed size )
-void glPolygonOffset ( GLfloat factor, GLfloat units )
-void glPolygonOffsetx ( GLfixed factor, GLfixed units )
-void glPopMatrix ( void )
-void glPushMatrix ( void )
-void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels )
-void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
-void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z )
-void glSampleCoverage ( GLclampf value, GLboolean invert )
-void glSampleCoveragex ( GLclampx value, GLboolean invert )
-void glScalef ( GLfloat x, GLfloat y, GLfloat z )
-void glScalex ( GLfixed x, GLfixed y, GLfixed z )
-void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height )
-void glShadeModel ( GLenum mode )
-void glStencilFunc ( GLenum func, GLint ref, GLuint mask )
-void glStencilMask ( GLuint mask )
-void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass )
-void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glTexEnvf ( GLenum target, GLenum pname, GLfloat param )
-void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params )
-void glTexEnvx ( GLenum target, GLenum pname, GLfixed param )
-void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params )
-void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
-void glTexParameterf ( GLenum target, GLenum pname, GLfloat param )
-void glTexParameterx ( GLenum target, GLenum pname, GLfixed param )
-void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
-void glTranslatef ( GLfloat x, GLfloat y, GLfloat z )
-void glTranslatex ( GLfixed x, GLfixed y, GLfixed z )
-void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
diff --git a/opengl/tools/glgen/specs/gles11/GLES10Ext.spec b/opengl/tools/glgen/specs/gles11/GLES10Ext.spec
deleted file mode 100644
index 53f6c65..0000000
--- a/opengl/tools/glgen/specs/gles11/GLES10Ext.spec
+++ /dev/null
@@ -1 +0,0 @@
-GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent )
diff --git a/opengl/tools/glgen/specs/gles11/GLES11.spec b/opengl/tools/glgen/specs/gles11/GLES11.spec
deleted file mode 100644
index 5527c18..0000000
--- a/opengl/tools/glgen/specs/gles11/GLES11.spec
+++ /dev/null
@@ -1,44 +0,0 @@
-void glBindBuffer ( GLenum target, GLuint buffer )
-void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage )
-void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data )
-void glClipPlanef ( GLenum plane, const GLfloat *equation )
-void glClipPlanex ( GLenum plane, const GLfixed *equation )
-void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
-void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
-void glDeleteBuffers ( GLsizei n, const GLuint *buffers )
-void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset )
-void glGenBuffers ( GLsizei n, GLuint *buffers )
-void glGetBooleanv ( GLenum pname, GLboolean *params )
-void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params )
-void glGetClipPlanef ( GLenum pname, GLfloat *eqn )
-void glGetClipPlanex ( GLenum pname, GLfixed *eqn )
-void glGetFixedv ( GLenum pname, GLfixed *params )
-void glGetFloatv ( GLenum pname, GLfloat *params )
-void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params )
-void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params )
-void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params )
-void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params )
-// void glGetPointerv ( GLenum pname, void **params )
-void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params )
-void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params )
-void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params )
-void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params )
-void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params )
-void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params )
-GLboolean glIsBuffer ( GLuint buffer )
-GLboolean glIsEnabled ( GLenum cap )
-GLboolean glIsTexture ( GLuint texture )
-void glNormalPointer ( GLenum type, GLsizei stride, GLint offset )
-void glPointParameterf ( GLenum pname, GLfloat param )
-void glPointParameterfv ( GLenum pname, const GLfloat *params )
-void glPointParameterx ( GLenum pname, GLfixed param )
-void glPointParameterxv ( GLenum pname, const GLfixed *params )
-void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer )
-void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
-void glTexEnvi ( GLenum target, GLenum pname, GLint param )
-void glTexEnviv ( GLenum target, GLenum pname, const GLint *params )
-void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params )
-void glTexParameteri ( GLenum target, GLenum pname, GLint param )
-void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params )
-void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params )
-void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
diff --git a/opengl/tools/glgen/specs/gles11/GLES11Ext.spec b/opengl/tools/glgen/specs/gles11/GLES11Ext.spec
deleted file mode 100644
index cd7333a..0000000
--- a/opengl/tools/glgen/specs/gles11/GLES11Ext.spec
+++ /dev/null
@@ -1,90 +0,0 @@
-void glBlendEquationSeparateOES ( GLenum modeRGB, GLenum modeAlpha )
-void glBlendFuncSeparateOES ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha )
-void glBlendEquationOES ( GLenum mode )
-void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height )
-void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height )
-void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height )
-void glDrawTexsvOES ( const GLshort *coords )
-void glDrawTexivOES ( const GLint *coords )
-void glDrawTexxvOES ( const GLfixed *coords )
-void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height )
-void glDrawTexfvOES ( const GLfloat *coords )
-void glEGLImageTargetTexture2DOES ( GLenum target, GLeglImageOES image )
-void glEGLImageTargetRenderbufferStorageOES ( GLenum target, GLeglImageOES image )
-void glAlphaFuncxOES ( GLenum func, GLclampx ref )
-void glClearColorxOES ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha )
-void glClearDepthxOES ( GLclampx depth )
-void glClipPlanexOES ( GLenum plane, const GLfixed *equation )
-void glColor4xOES ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha )
-void glDepthRangexOES ( GLclampx zNear, GLclampx zFar )
-void glFogxOES ( GLenum pname, GLfixed param )
-void glFogxvOES ( GLenum pname, const GLfixed *params )
-void glFrustumxOES ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
-void glGetClipPlanexOES ( GLenum pname, GLfixed *eqn )
-void glGetFixedvOES ( GLenum pname, GLfixed *params )
-void glGetLightxvOES ( GLenum light, GLenum pname, GLfixed *params )
-void glGetMaterialxvOES ( GLenum face, GLenum pname, GLfixed *params )
-void glGetTexEnvxvOES ( GLenum env, GLenum pname, GLfixed *params )
-void glGetTexParameterxvOES ( GLenum target, GLenum pname, GLfixed *params )
-void glLightModelxOES ( GLenum pname, GLfixed param )
-void glLightModelxvOES ( GLenum pname, const GLfixed *params )
-void glLightxOES ( GLenum light, GLenum pname, GLfixed param )
-void glLightxvOES ( GLenum light, GLenum pname, const GLfixed *params )
-void glLineWidthxOES ( GLfixed width )
-void glLoadMatrixxOES ( const GLfixed *m )
-void glMaterialxOES ( GLenum face, GLenum pname, GLfixed param )
-void glMaterialxvOES ( GLenum face, GLenum pname, const GLfixed *params )
-void glMultMatrixxOES ( const GLfixed *m )
-void glMultiTexCoord4xOES ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q )
-void glNormal3xOES ( GLfixed nx, GLfixed ny, GLfixed nz )
-void glOrthoxOES ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
-void glPointParameterxOES ( GLenum pname, GLfixed param )
-void glPointParameterxvOES ( GLenum pname, const GLfixed *params )
-void glPointSizexOES ( GLfixed size )
-void glPolygonOffsetxOES ( GLfixed factor, GLfixed units )
-void glRotatexOES ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z )
-void glSampleCoveragexOES ( GLclampx value, GLboolean invert )
-void glScalexOES ( GLfixed x, GLfixed y, GLfixed z )
-void glTexEnvxOES ( GLenum target, GLenum pname, GLfixed param )
-void glTexEnvxvOES ( GLenum target, GLenum pname, const GLfixed *params )
-void glTexParameterxOES ( GLenum target, GLenum pname, GLfixed param )
-void glTexParameterxvOES ( GLenum target, GLenum pname, const GLfixed *params )
-void glTranslatexOES ( GLfixed x, GLfixed y, GLfixed z )
-GLboolean glIsRenderbufferOES ( GLuint renderbuffer )
-void glBindRenderbufferOES ( GLenum target, GLuint renderbuffer )
-void glDeleteRenderbuffersOES ( GLsizei n, const GLuint *renderbuffers )
-void glGenRenderbuffersOES ( GLsizei n, GLuint *renderbuffers )
-void glRenderbufferStorageOES ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height )
-void glGetRenderbufferParameterivOES ( GLenum target, GLenum pname, GLint *params )
-GLboolean glIsFramebufferOES ( GLuint framebuffer )
-void glBindFramebufferOES ( GLenum target, GLuint framebuffer )
-void glDeleteFramebuffersOES ( GLsizei n, const GLuint *framebuffers )
-void glGenFramebuffersOES ( GLsizei n, GLuint *framebuffers )
-GLenum glCheckFramebufferStatusOES ( GLenum target )
-void glFramebufferRenderbufferOES ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
-void glFramebufferTexture2DOES ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
-void glGetFramebufferAttachmentParameterivOES ( GLenum target, GLenum attachment, GLenum pname, GLint *params )
-void glGenerateMipmapOES ( GLenum target )
-// Hard to export to Java:
-// void *glMapBufferOES ( GLenum target, GLenum access )
-// GLboolean glUnmapBufferOES ( GLenum target )
-// void glGetBufferPointervOES ( GLenum target, GLenum pname, void **params )
-void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex )
-void glLoadPaletteFromModelViewMatrixOES ( void )
-void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glDepthRangefOES ( GLclampf zNear, GLclampf zFar )
-void glFrustumfOES ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
-void glOrthofOES ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
-void glClipPlanefOES ( GLenum plane, const GLfloat *equation )
-void glGetClipPlanefOES ( GLenum pname, GLfloat *eqn )
-void glClearDepthfOES ( GLclampf depth )
-void glTexGenfOES ( GLenum coord, GLenum pname, GLfloat param )
-void glTexGenfvOES ( GLenum coord, GLenum pname, const GLfloat *params )
-void glTexGeniOES ( GLenum coord, GLenum pname, GLint param )
-void glTexGenivOES ( GLenum coord, GLenum pname, const GLint *params )
-void glTexGenxOES ( GLenum coord, GLenum pname, GLfixed param )
-void glTexGenxvOES ( GLenum coord, GLenum pname, const GLfixed *params )
-void glGetTexGenfvOES ( GLenum coord, GLenum pname, GLfloat *params )
-void glGetTexGenivOES ( GLenum coord, GLenum pname, GLint *params )
-void glGetTexGenxvOES ( GLenum coord, GLenum pname, GLfixed *params )
diff --git a/opengl/tools/glgen/specs/gles11/GLES20.spec b/opengl/tools/glgen/specs/gles11/GLES20.spec
deleted file mode 100644
index ee88f59..0000000
--- a/opengl/tools/glgen/specs/gles11/GLES20.spec
+++ /dev/null
@@ -1,144 +0,0 @@
-void glActiveTexture ( GLenum texture )
-void glAttachShader ( GLuint program, GLuint shader )
-void glBindAttribLocation ( GLuint program, GLuint index, const char *name )
-void glBindBuffer ( GLenum target, GLuint buffer )
-void glBindFramebuffer ( GLenum target, GLuint framebuffer )
-void glBindRenderbuffer ( GLenum target, GLuint renderbuffer )
-void glBindTexture ( GLenum target, GLuint texture )
-void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
-void glBlendEquation ( GLenum mode )
-void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha )
-void glBlendFunc ( GLenum sfactor, GLenum dfactor )
-void glBlendFuncSeparate ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha )
-void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage )
-void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data )
-GLenum glCheckFramebufferStatus ( GLenum target )
-void glClear ( GLbitfield mask )
-void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
-void glClearDepthf ( GLclampf depth )
-void glClearStencil ( GLint s )
-void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
-void glCompileShader ( GLuint shader )
-void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data )
-void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data )
-void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
-void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
-GLuint glCreateProgram ( void )
-GLuint glCreateShader ( GLenum type )
-void glCullFace ( GLenum mode )
-void glDeleteBuffers ( GLsizei n, const GLuint *buffers )
-void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers )
-void glDeleteProgram ( GLuint program )
-void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers )
-void glDeleteShader ( GLuint shader )
-void glDeleteTextures ( GLsizei n, const GLuint *textures )
-void glDepthFunc ( GLenum func )
-void glDepthMask ( GLboolean flag )
-void glDepthRangef ( GLclampf zNear, GLclampf zFar )
-void glDetachShader ( GLuint program, GLuint shader )
-void glDisable ( GLenum cap )
-void glDisableVertexAttribArray ( GLuint index )
-void glDrawArrays ( GLenum mode, GLint first, GLsizei count )
-void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset )
-void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
-void glEnable ( GLenum cap )
-void glEnableVertexAttribArray ( GLuint index )
-void glFinish ( void )
-void glFlush ( void )
-void glFramebufferRenderbuffer ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
-void glFramebufferTexture2D ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
-void glFrontFace ( GLenum mode )
-void glGenBuffers ( GLsizei n, GLuint *buffers )
-void glGenerateMipmap ( GLenum target )
-void glGenFramebuffers ( GLsizei n, GLuint *framebuffers )
-void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers )
-void glGenTextures ( GLsizei n, GLuint *textures )
-void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name )
-void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name )
-void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders )
-int glGetAttribLocation ( GLuint program, const char *name )
-void glGetBooleanv ( GLenum pname, GLboolean *params )
-void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params )
-GLenum glGetError ( void )
-void glGetFloatv ( GLenum pname, GLfloat *params )
-void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params )
-void glGetIntegerv ( GLenum pname, GLint *params )
-void glGetProgramiv ( GLuint program, GLenum pname, GLint *params )
-void glGetProgramInfoLog ( GLuint program, GLsizei bufsize, GLsizei *length, char *infolog )
-void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params )
-void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params )
-void glGetShaderInfoLog ( GLuint shader, GLsizei bufsize, GLsizei *length, char *infolog )
-void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision )
-void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source )
-const GLubyte * glGetString ( GLenum name )
-void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params )
-void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params )
-void glGetUniformfv ( GLuint program, GLint location, GLfloat *params )
-void glGetUniformiv ( GLuint program, GLint location, GLint *params )
-int glGetUniformLocation ( GLuint program, const char *name )
-void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params )
-void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params )
-// void glGetVertexAttribPointerv ( GLuint index, GLenum pname, void **pointer )
-void glHint ( GLenum target, GLenum mode )
-GLboolean glIsBuffer ( GLuint buffer )
-GLboolean glIsEnabled ( GLenum cap )
-GLboolean glIsFramebuffer ( GLuint framebuffer )
-GLboolean glIsProgram ( GLuint program )
-GLboolean glIsRenderbuffer ( GLuint renderbuffer )
-GLboolean glIsShader ( GLuint shader )
-GLboolean glIsTexture ( GLuint texture )
-void glLineWidth ( GLfloat width )
-void glLinkProgram ( GLuint program )
-void glPixelStorei ( GLenum pname, GLint param )
-void glPolygonOffset ( GLfloat factor, GLfloat units )
-void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels )
-void glReleaseShaderCompiler ( void )
-void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height )
-void glSampleCoverage ( GLclampf value, GLboolean invert )
-void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height )
-void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length )
-void glShaderSource ( GLuint shader )
-void glStencilFunc ( GLenum func, GLint ref, GLuint mask )
-void glStencilFuncSeparate ( GLenum face, GLenum func, GLint ref, GLuint mask )
-void glStencilMask ( GLuint mask )
-void glStencilMaskSeparate ( GLenum face, GLuint mask )
-void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass )
-void glStencilOpSeparate ( GLenum face, GLenum fail, GLenum zfail, GLenum zpass )
-void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
-void glTexParameterf ( GLenum target, GLenum pname, GLfloat param )
-void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params )
-void glTexParameteri ( GLenum target, GLenum pname, GLint param )
-void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params )
-void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
-void glUniform1f ( GLint location, GLfloat x )
-void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v )
-void glUniform1i ( GLint location, GLint x )
-void glUniform1iv ( GLint location, GLsizei count, const GLint *v )
-void glUniform2f ( GLint location, GLfloat x, GLfloat y )
-void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v )
-void glUniform2i ( GLint location, GLint x, GLint y )
-void glUniform2iv ( GLint location, GLsizei count, const GLint *v )
-void glUniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z )
-void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v )
-void glUniform3i ( GLint location, GLint x, GLint y, GLint z )
-void glUniform3iv ( GLint location, GLsizei count, const GLint *v )
-void glUniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
-void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v )
-void glUniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w )
-void glUniform4iv ( GLint location, GLsizei count, const GLint *v )
-void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value )
-void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value )
-void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value )
-void glUseProgram ( GLuint program )
-void glValidateProgram ( GLuint program )
-void glVertexAttrib1f ( GLuint indx, GLfloat x )
-void glVertexAttrib1fv ( GLuint indx, const GLfloat *values )
-void glVertexAttrib2f ( GLuint indx, GLfloat x, GLfloat y )
-void glVertexAttrib2fv ( GLuint indx, const GLfloat *values )
-void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z )
-void glVertexAttrib3fv ( GLuint indx, const GLfloat *values )
-void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
-void glVertexAttrib4fv ( GLuint indx, const GLfloat *values )
-void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset )
-void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr )
-void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
diff --git a/opengl/tools/glgen/specs/gles11/checks.spec b/opengl/tools/glgen/specs/gles11/checks.spec
deleted file mode 100644
index f478a32..0000000
--- a/opengl/tools/glgen/specs/gles11/checks.spec
+++ /dev/null
@@ -1,42 +0,0 @@
-glClipPlanef check eqn 4
-glClipPlanex check eqn 4
-glGetClipPlanefOES check eqn 4
-glGetClipPlanexOES check eqn 4
-glDeleteBuffers check buffers n
-glDeleteTextures check textures n
-glDrawElements check_AIOOBE indices count
-glFog ifcheck params 1 pname GL_FOG_MODE,GL_FOG_DENSITY,GL_FOG_START,GL_FOG_END ifcheck params 4 pname GL_FOG_COLOR
-glGenBuffers check buffers n
-glGenTextures check textures n
-glGetClipPlane check eqn 4
-glGetIntegerv ifcheck params 1 pname GL_ALPHA_BITS,GL_ALPHA_TEST_FUNC,GL_ALPHA_TEST_REF,GL_BLEND_DST,GL_BLUE_BITS,GL_COLOR_ARRAY_BUFFER_BINDING,GL_COLOR_ARRAY_SIZE,GL_COLOR_ARRAY_STRIDE,GL_COLOR_ARRAY_TYPE,GL_CULL_FACE,GL_DEPTH_BITS,GL_DEPTH_CLEAR_VALUE,GL_DEPTH_FUNC,GL_DEPTH_WRITEMASK,GL_FOG_DENSITY,GL_FOG_END,GL_FOG_MODE,GL_FOG_START,GL_FRONT_FACE,GL_GREEN_BITS,GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES,GL_IMPLEMENTATION_COLOR_READ_TYPE_OES,GL_LIGHT_MODEL_COLOR_CONTROL,GL_LIGHT_MODEL_LOCAL_VIEWER,GL_LIGHT_MODEL_TWO_SIDE,GL_LINE_SMOOTH_HINT,GL_LINE_WIDTH,GL_LOGIC_OP_MODE,GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES,GL_MATRIX_INDEX_ARRAY_SIZE_OES,GL_MATRIX_INDEX_ARRAY_STRIDE_OES,GL_MATRIX_INDEX_ARRAY_TYPE_OES,GL_MATRIX_MODE,GL_MAX_CLIP_PLANES,GL_MAX_ELEMENTS_INDICES,GL_MAX_ELEMENTS_VERTICES,GL_MAX_LIGHTS,GL_MAX_MODELVIEW_STACK_DEPTH,GL_MAX_PALETTE_MATRICES_OES,GL_MAX_PROJECTION_STACK_DEPTH,GL_MAX_TEXTURE_SIZE,GL_MAX_TEXTURE_STACK_DEPTH,GL_MAX_TEXTURE_UNITS,GL_MAX_VERTEX_UNITS_OES,GL_MODELVIEW_STACK_DEPTH,GL_NORMAL_ARRAY_BUFFER_BINDING,GL_NORMAL_ARRAY_STRIDE,GL_NORMAL_ARRAY_TYPE,GL_NUM_COMPRESSED_TEXTURE_FORMATS,GL_PACK_ALIGNMENT,GL_PERSPECTIVE_CORRECTION_HINT,GL_POINT_SIZE,GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES,GL_POINT_SIZE_ARRAY_STRIDE_OES,GL_POINT_SIZE_ARRAY_TYPE_OES,GL_POINT_SMOOTH_HINT,GL_POLYGON_OFFSET_FACTOR,GL_POLYGON_OFFSET_UNITS,GL_PROJECTION_STACK_DEPTH,GL_RED_BITS,GL_SHADE_MODEL,GL_STENCIL_BITS,GL_STENCIL_CLEAR_VALUE,GL_STENCIL_FAIL,GL_STENCIL_FUNC,GL_STENCIL_PASS_DEPTH_FAIL,GL_STENCIL_PASS_DEPTH_PASS,GL_STENCIL_REF,GL_STENCIL_VALUE_MASK,GL_STENCIL_WRITEMASK,GL_SUBPIXEL_BITS,GL_TEXTURE_BINDING_2D,GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING,GL_TEXTURE_COORD_ARRAY_SIZE,GL_TEXTURE_COORD_ARRAY_STRIDE,GL_TEXTURE_COORD_ARRAY_TYPE,GL_TEXTURE_STACK_DEPTH,GL_UNPACK_ALIGNMENT,GL_VERTEX_ARRAY_BUFFER_BINDING,GL_VERTEX_ARRAY_SIZE,GL_VERTEX_ARRAY_STRIDE,GL_VERTEX_ARRAY_TYPE,GL_WEIGHT_ARRAY_BUFFER_BINDING_OES,GL_WEIGHT_ARRAY_SIZE_OES,GL_WEIGHT_ARRAY_STRIDE_OES,GL_WEIGHT_ARRAY_TYPE_OES ifcheck params 2 pname GL_ALIASED_POINT_SIZE_RANGE,GL_ALIASED_LINE_WIDTH_RANGE,GL_DEPTH_RANGE,GL_MAX_VIEWPORT_DIMS,GL_SMOOTH_LINE_WIDTH_RANGE,GL_SMOOTH_POINT_SIZE_RANGE ifcheck params 4 pname GL_COLOR_CLEAR_VALUE,GL_COLOR_WRITEMASK,GL_FOG_COLOR,GL_LIGHT_MODEL_AMBIENT,GL_SCISSOR_BOX,GL_VIEWPORT ifcheck params 16 pname GL_MODELVIEW_MATRIX,GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES,GL_PROJECTION_MATRIX,GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES,GL_TEXTURE_MATRIX,GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES ifcheck params getNumCompressedTextureFormats() pname GL_COMPRESSED_TEXTURE_FORMATS
-glGetLight ifcheck params 1 pname GL_SPOT_EXPONENT,GL_SPOT_CUTOFF,GL_CONSTANT_ATTENUATION,GL_LINEAR_ATTENUATION,GL_QUADRATIC_ATTENUATION ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
-glGetMaterial ifcheck params 1 pname GL_SHININESS ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
-glGetTexEnv ifcheck params 1 pname GL_TEXTURE_ENV_MODE,GL_COMBINE_RGB,GL_COMBINE_ALPHA ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
-glGetTexParameter check params 1
-glLightModel ifcheck params 1 pname GL_LIGHT_MODEL_TWO_SIDE ifcheck params 4 pname GL_LIGHT_MODEL_AMBIENT
-glLight ifcheck params 1 pname GL_SPOT_EXPONENT,GL_SPOT_CUTOFF,GL_CONSTANT_ATTENUATION,GL_LINEAR_ATTENUATION,GL_QUADRATIC_ATTENUATION ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
-glLoadMatrix check m 16
-glMaterial ifcheck params 1 pname GL_SHININESS ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
-glMultMatrix check m 16
-glPointParameter check params 1
-glTexEnv ifcheck params 1 pname GL_TEXTURE_ENV_MODE,GL_COMBINE_RGB,GL_COMBINE_ALPHA ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
-glTexImage2D nullAllowed
-glTexSubImage2D nullAllowed
-glBufferData nullAllowed check data size
-glBufferSubData check data size
-glTexParameter check params 1
-glQueryMatrixxOES check mantissa 16 check exponent 16 return -1
-glDrawTexfvOES check coords 5
-glDrawTexivOES check coords 5
-glDrawTexsvOES check coords 5
-glDrawTexxvOES check coords 5
-glDeleteFramebuffersOES check framebuffers n
-glDeleteRenderbuffersOES check renderbuffers n
-glGenFramebuffersOES check framebuffers n
-glGenRenderbuffersOES check renderbuffers n
-glGetBufferParameter check params 1
-glGetFramebufferAttachmentParameterivOES check params 1
-glGetRenderbufferParameterivOES check params 1
-glGetTexGen ifcheck params 1 pname GL_TEXTURE_GEN_MODE ifcheck params 4 pname GL_OBJECT_PLANE,GL_EYE_PLANE
-
diff --git a/opengl/tools/glgen/specs/jsr239/glspec-1.0 b/opengl/tools/glgen/specs/jsr239/glspec-1.0
deleted file mode 100644
index c442320..0000000
--- a/opengl/tools/glgen/specs/jsr239/glspec-1.0
+++ /dev/null
@@ -1,106 +0,0 @@
-void glActiveTexture ( GLenum texture )
-void glAlphaFunc ( GLenum func, GLclampf ref )
-void glAlphaFuncx ( GLenum func, GLclampx ref )
-void glBindTexture ( GLenum target, GLuint texture )
-void glBlendFunc ( GLenum sfactor, GLenum dfactor )
-void glClear ( GLbitfield mask )
-void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
-void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha )
-void glClearDepthf ( GLclampf depth )
-void glClearDepthx ( GLclampx depth )
-void glClearStencil ( GLint s )
-void glClientActiveTexture ( GLenum texture )
-void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
-void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha )
-void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
-void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data )
-void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data )
-void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
-void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
-void glCullFace ( GLenum mode )
-void glDeleteTextures ( GLsizei n, const GLuint *textures )
-void glDepthFunc ( GLenum func )
-void glDepthMask ( GLboolean flag )
-void glDepthRangef ( GLclampf zNear, GLclampf zFar )
-void glDepthRangex ( GLclampx zNear, GLclampx zFar )
-void glDisable ( GLenum cap )
-void glDisableClientState ( GLenum array )
-void glDrawArrays ( GLenum mode, GLint first, GLsizei count )
-void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
-void glEnable ( GLenum cap )
-void glEnableClientState ( GLenum array )
-void glFinish ( void )
-void glFlush ( void )
-void glFogf ( GLenum pname, GLfloat param )
-void glFogfv ( GLenum pname, const GLfloat *params )
-void glFogx ( GLenum pname, GLfixed param )
-void glFogxv ( GLenum pname, const GLfixed *params )
-void glFrontFace ( GLenum mode )
-void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
-void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
-void glGenTextures ( GLsizei n, GLuint *textures )
-GLenum glGetError ( void )
-void glGetIntegerv ( GLenum pname, GLint *params )
-const GLubyte * glGetString ( GLenum name )
-void glHint ( GLenum target, GLenum mode )
-void glLightModelf ( GLenum pname, GLfloat param )
-void glLightModelfv ( GLenum pname, const GLfloat *params )
-void glLightModelx ( GLenum pname, GLfixed param )
-void glLightModelxv ( GLenum pname, const GLfixed *params )
-void glLightf ( GLenum light, GLenum pname, GLfloat param )
-void glLightfv ( GLenum light, GLenum pname, const GLfloat *params )
-void glLightx ( GLenum light, GLenum pname, GLfixed param )
-void glLightxv ( GLenum light, GLenum pname, const GLfixed *params )
-void glLineWidth ( GLfloat width )
-void glLineWidthx ( GLfixed width )
-void glLoadIdentity ( void )
-void glLoadMatrixf ( const GLfloat *m )
-void glLoadMatrixx ( const GLfixed *m )
-void glLogicOp ( GLenum opcode )
-void glMaterialf ( GLenum face, GLenum pname, GLfloat param )
-void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params )
-void glMaterialx ( GLenum face, GLenum pname, GLfixed param )
-void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params )
-void glMatrixMode ( GLenum mode )
-void glMultMatrixf ( const GLfloat *m )
-void glMultMatrixx ( const GLfixed *m )
-void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q )
-void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q )
-void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz )
-void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz )
-void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer )
-void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar )
-void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar )
-void glPixelStorei ( GLenum pname, GLint param )
-void glPointSize ( GLfloat size )
-void glPointSizex ( GLfixed size )
-void glPolygonOffset ( GLfloat factor, GLfloat units )
-void glPolygonOffsetx ( GLfixed factor, GLfixed units )
-void glPopMatrix ( void )
-void glPushMatrix ( void )
-void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels )
-void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
-void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z )
-void glSampleCoverage ( GLclampf value, GLboolean invert )
-void glSampleCoveragex ( GLclampx value, GLboolean invert )
-void glScalef ( GLfloat x, GLfloat y, GLfloat z )
-void glScalex ( GLfixed x, GLfixed y, GLfixed z )
-void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height )
-void glShadeModel ( GLenum mode )
-void glStencilFunc ( GLenum func, GLint ref, GLuint mask )
-void glStencilMask ( GLuint mask )
-void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass )
-void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glTexEnvf ( GLenum target, GLenum pname, GLfloat param )
-void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params )
-void glTexEnvx ( GLenum target, GLenum pname, GLfixed param )
-void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params )
-void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
-void glTexParameterf ( GLenum target, GLenum pname, GLfloat param )
-void glTexParameterx ( GLenum target, GLenum pname, GLfixed param )
-void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
-void glTranslatef ( GLfloat x, GLfloat y, GLfloat z )
-void glTranslatex ( GLfixed x, GLfixed y, GLfixed z )
-void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
diff --git a/opengl/tools/glgen/specs/jsr239/glspec-1.0ext b/opengl/tools/glgen/specs/jsr239/glspec-1.0ext
deleted file mode 100644
index 7d19758..0000000
--- a/opengl/tools/glgen/specs/jsr239/glspec-1.0ext
+++ /dev/null
@@ -1 +0,0 @@
-GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent )
diff --git a/opengl/tools/glgen/specs/jsr239/glspec-1.1 b/opengl/tools/glgen/specs/jsr239/glspec-1.1
deleted file mode 100644
index 9149a7f9..0000000
--- a/opengl/tools/glgen/specs/jsr239/glspec-1.1
+++ /dev/null
@@ -1,42 +0,0 @@
-void glBindBuffer ( GLenum target, GLuint buffer )
-void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage )
-void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data )
-void glClipPlanef ( GLenum plane, const GLfloat *equation )
-void glClipPlanex ( GLenum plane, const GLfixed *equation )
-void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
-void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
-void glDeleteBuffers ( GLsizei n, const GLuint *buffers )
-void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset )
-void glGenBuffers ( GLsizei n, GLuint *buffers )
-void glGetBooleanv ( GLenum pname, GLboolean *params )
-void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params )
-void glGetClipPlanef ( GLenum pname, GLfloat *eqn )
-void glGetClipPlanex ( GLenum pname, GLfixed *eqn )
-void glGetFixedv ( GLenum pname, GLfixed *params )
-void glGetFloatv ( GLenum pname, GLfloat *params )
-void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params )
-void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params )
-void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params )
-void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params )
-void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params )
-void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params )
-void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params )
-void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params )
-void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params )
-GLboolean glIsBuffer ( GLuint buffer )
-GLboolean glIsEnabled ( GLenum cap )
-GLboolean glIsTexture ( GLuint texture )
-void glNormalPointer ( GLenum type, GLsizei stride, GLint offset )
-void glPointParameterf ( GLenum pname, GLfloat param )
-void glPointParameterfv ( GLenum pname, const GLfloat *params )
-void glPointParameterx ( GLenum pname, GLfixed param )
-void glPointParameterxv ( GLenum pname, const GLfixed *params )
-void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer )
-void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
-void glTexEnvi ( GLenum target, GLenum pname, GLint param )
-void glTexEnviv ( GLenum target, GLenum pname, const GLint *params )
-void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params )
-void glTexParameteri ( GLenum target, GLenum pname, GLint param )
-void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params )
-void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params )
-void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset )
diff --git a/opengl/tools/glgen/specs/jsr239/glspec-1.1ext b/opengl/tools/glgen/specs/jsr239/glspec-1.1ext
deleted file mode 100644
index cc08c735..0000000
--- a/opengl/tools/glgen/specs/jsr239/glspec-1.1ext
+++ /dev/null
@@ -1,16 +0,0 @@
-void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex )
-void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height )
-void glDrawTexfvOES ( const GLfloat *coords )
-void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height )
-void glDrawTexivOES ( const GLint *coords )
-void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height )
-void glDrawTexsvOES ( const GLshort *coords )
-void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height )
-void glDrawTexxvOES ( const GLfixed *coords )
-void glEnable ( GLenum cap )
-void glEnableClientState ( GLenum array )
-void glLoadPaletteFromModelViewMatrixOES ( void )
-void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset )
-void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
-void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset )
diff --git a/opengl/tools/glgen/specs/jsr239/glspec-1.1extpack b/opengl/tools/glgen/specs/jsr239/glspec-1.1extpack
deleted file mode 100644
index d6012d9..0000000
--- a/opengl/tools/glgen/specs/jsr239/glspec-1.1extpack
+++ /dev/null
@@ -1,38 +0,0 @@
-void glBindFramebufferOES ( GLint target, GLint framebuffer )
-void glBindRenderbufferOES ( GLint target, GLint renderbuffer )
-void glBindTexture ( GLint target, GLint texture )
-void glBlendEquation ( GLint mode )
-void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha )
-void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha )
-GLint glCheckFramebufferStatusOES ( GLint target )
-void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data )
-void glCopyTexImage2D ( GLint target, GLint level, GLint internalformat, GLint x, GLint y, GLint width, GLint height, GLint border )
-void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers )
-void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers )
-void glEnable ( GLint cap )
-void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer )
-void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level )
-void glGenerateMipmapOES ( GLint target )
-void glGenFramebuffersOES ( GLint n, GLuint *framebuffers )
-void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers )
-void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params )
-void glGetIntegerv ( GLint pname, GLint *params )
-void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params )
-void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params )
-void glGetTexGeniv ( GLint coord, GLint pname, GLint *params )
-void glGetTexGenxv ( GLint coord, GLint pname, GLint *params )
-GLboolean glIsFramebufferOES ( GLint framebuffer )
-GLboolean glIsRenderbufferOES ( GLint renderbuffer )
-void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height )
-void glStencilOp ( GLint fail, GLint zfail, GLint zpass )
-void glTexEnvf ( GLint target, GLint pname, GLfloat param )
-void glTexEnvfv ( GLint target, GLint pname, GLfloat *params )
-void glTexEnvx ( GLint target, GLint pname, GLint param )
-void glTexEnvxv ( GLint target, GLint pname, GLint *params )
-void glTexGenf ( GLint coord, GLint pname, GLfloat param )
-void glTexGenfv ( GLint coord, GLint pname, GLfloat *params )
-void glTexGeni ( GLint coord, GLint pname, GLint param )
-void glTexGeniv ( GLint coord, GLint pname, GLint *params )
-void glTexGenx ( GLint coord, GLint pname, GLint param )
-void glTexGenxv ( GLint coord, GLint pname, GLint *params )
-void glTexParameterf ( GLint target, GLint pname, GLfloat param )
diff --git a/opengl/tools/glgen/specs/jsr239/glspec-checks b/opengl/tools/glgen/specs/jsr239/glspec-checks
deleted file mode 100644
index 9f8a793..0000000
--- a/opengl/tools/glgen/specs/jsr239/glspec-checks
+++ /dev/null
@@ -1,56 +0,0 @@
-glClipPlanef check equation 4
-glClipPlanex check equation 4
-glDeleteBuffers check buffers n
-glDeleteTextures check textures n
-glDrawElements check_AIOOBE indices count
-glFog ifcheck params 1 pname GL_FOG_MODE,GL_FOG_DENSITY,GL_FOG_START,GL_FOG_END ifcheck params 4 pname GL_FOG_COLOR
-glGenBuffers check buffers n
-glGenTextures check textures n
-glGetClipPlane check eqn 4
-glGetIntegerv ifcheck params 1 pname GL_ALPHA_BITS,GL_ALPHA_TEST_FUNC,GL_ALPHA_TEST_REF,GL_BLEND_DST,GL_BLUE_BITS,GL_COLOR_ARRAY_BUFFER_BINDING,GL_COLOR_ARRAY_SIZE,GL_COLOR_ARRAY_STRIDE,GL_COLOR_ARRAY_TYPE,GL_CULL_FACE,GL_DEPTH_BITS,GL_DEPTH_CLEAR_VALUE,GL_DEPTH_FUNC,GL_DEPTH_WRITEMASK,GL_FOG_DENSITY,GL_FOG_END,GL_FOG_MODE,GL_FOG_START,GL_FRONT_FACE,GL_GREEN_BITS,GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES,GL_IMPLEMENTATION_COLOR_READ_TYPE_OES,GL_LIGHT_MODEL_COLOR_CONTROL,GL_LIGHT_MODEL_LOCAL_VIEWER,GL_LIGHT_MODEL_TWO_SIDE,GL_LINE_SMOOTH_HINT,GL_LINE_WIDTH,GL_LOGIC_OP_MODE,GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES,GL_MATRIX_INDEX_ARRAY_SIZE_OES,GL_MATRIX_INDEX_ARRAY_STRIDE_OES,GL_MATRIX_INDEX_ARRAY_TYPE_OES,GL_MATRIX_MODE,GL_MAX_CLIP_PLANES,GL_MAX_ELEMENTS_INDICES,GL_MAX_ELEMENTS_VERTICES,GL_MAX_LIGHTS,GL_MAX_MODELVIEW_STACK_DEPTH,GL_MAX_PALETTE_MATRICES_OES,GL_MAX_PROJECTION_STACK_DEPTH,GL_MAX_TEXTURE_SIZE,GL_MAX_TEXTURE_STACK_DEPTH,GL_MAX_TEXTURE_UNITS,GL_MAX_VERTEX_UNITS_OES,GL_MODELVIEW_STACK_DEPTH,GL_NORMAL_ARRAY_BUFFER_BINDING,GL_NORMAL_ARRAY_STRIDE,GL_NORMAL_ARRAY_TYPE,GL_NUM_COMPRESSED_TEXTURE_FORMATS,GL_PACK_ALIGNMENT,GL_PERSPECTIVE_CORRECTION_HINT,GL_POINT_SIZE,GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES,GL_POINT_SIZE_ARRAY_STRIDE_OES,GL_POINT_SIZE_ARRAY_TYPE_OES,GL_POINT_SMOOTH_HINT,GL_POLYGON_OFFSET_FACTOR,GL_POLYGON_OFFSET_UNITS,GL_PROJECTION_STACK_DEPTH,GL_RED_BITS,GL_SHADE_MODEL,GL_STENCIL_BITS,GL_STENCIL_CLEAR_VALUE,GL_STENCIL_FAIL,GL_STENCIL_FUNC,GL_STENCIL_PASS_DEPTH_FAIL,GL_STENCIL_PASS_DEPTH_PASS,GL_STENCIL_REF,GL_STENCIL_VALUE_MASK,GL_STENCIL_WRITEMASK,GL_SUBPIXEL_BITS,GL_TEXTURE_BINDING_2D,GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING,GL_TEXTURE_COORD_ARRAY_SIZE,GL_TEXTURE_COORD_ARRAY_STRIDE,GL_TEXTURE_COORD_ARRAY_TYPE,GL_TEXTURE_STACK_DEPTH,GL_UNPACK_ALIGNMENT,GL_VERTEX_ARRAY_BUFFER_BINDING,GL_VERTEX_ARRAY_SIZE,GL_VERTEX_ARRAY_STRIDE,GL_VERTEX_ARRAY_TYPE,GL_WEIGHT_ARRAY_BUFFER_BINDING_OES,GL_WEIGHT_ARRAY_SIZE_OES,GL_WEIGHT_ARRAY_STRIDE_OES,GL_WEIGHT_ARRAY_TYPE_OES ifcheck params 2 pname GL_ALIASED_POINT_SIZE_RANGE,GL_ALIASED_LINE_WIDTH_RANGE,GL_DEPTH_RANGE,GL_MAX_VIEWPORT_DIMS,GL_SMOOTH_LINE_WIDTH_RANGE,GL_SMOOTH_POINT_SIZE_RANGE ifcheck params 4 pname GL_COLOR_CLEAR_VALUE,GL_COLOR_WRITEMASK,GL_FOG_COLOR,GL_LIGHT_MODEL_AMBIENT,GL_SCISSOR_BOX,GL_VIEWPORT ifcheck params 16 pname GL_MODELVIEW_MATRIX,GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES,GL_PROJECTION_MATRIX,GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES,GL_TEXTURE_MATRIX,GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES ifcheck params getNumCompressedTextureFormats() pname GL_COMPRESSED_TEXTURE_FORMATS
-glGetLight ifcheck params 1 pname GL_SPOT_EXPONENT,GL_SPOT_CUTOFF,GL_CONSTANT_ATTENUATION,GL_LINEAR_ATTENUATION,GL_QUADRATIC_ATTENUATION ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
-glGetMaterial ifcheck params 1 pname GL_SHININESS ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
-glGetTexEnv ifcheck params 1 pname GL_TEXTURE_ENV_MODE,GL_COMBINE_RGB,GL_COMBINE_ALPHA ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
-glGetTexParameter check params 1
-glLightModel ifcheck params 1 pname GL_LIGHT_MODEL_TWO_SIDE ifcheck params 4 pname GL_LIGHT_MODEL_AMBIENT
-glLight ifcheck params 1 pname GL_SPOT_EXPONENT,GL_SPOT_CUTOFF,GL_CONSTANT_ATTENUATION,GL_LINEAR_ATTENUATION,GL_QUADRATIC_ATTENUATION ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
-glLoadMatrix check m 16
-glMaterial ifcheck params 1 pname GL_SHININESS ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
-glMultMatrix check m 16
-glPointParameter check params 1
-glTexEnv ifcheck params 1 pname GL_TEXTURE_ENV_MODE,GL_COMBINE_RGB,GL_COMBINE_ALPHA ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
-glTexImage2D nullAllowed
-glTexSubImage2D nullAllowed
-glBufferData nullAllowed check data size
-glBufferSubData check data size
-glTexParameter check params 1
-glQueryMatrixxOES check mantissa 16 check exponent 16 return -1
-glDrawTexfvOES check coords 5
-glDrawTexivOES check coords 5
-glDrawTexsvOES check coords 5
-glDrawTexxvOES check coords 5
-glBindFramebufferOES requires OES_framebuffer_object
-glBindRenderbufferOES requires OES_framebuffer_object
-glBlendEquation requires OES_blend_subtract
-glBlendEquationSeparate requires OES_blend_equation_separate
-glBlendFuncSeparate requires OES_blend_equation_separate
-glCheckFramebufferStatusOES requires OES_framebuffer_object return 0
-glDeleteFramebuffersOES requires OES_framebuffer_object check framebuffers n
-glDeleteRenderbuffersOES requires OES_framebuffer_object check renderbuffers n
-glFramebufferRenderbufferOES requires OES_framebuffer_object
-glFramebufferStorageOES requires OES_framebuffer_object
-glFramebufferTexture2DOES requires OES_framebuffer_object
-glGenFramebuffersOES requires OES_framebuffer_object check framebuffers n
-glGenRenderbuffersOES requires OES_framebuffer_object check renderbuffers n
-glGenerateMipmapOES requires OES_framebuffer_object
-glGetFramebufferAttachmentParameterivOES requires OES_framebuffer_object
-glGetRenderbufferParameterivOES requires OES_framebuffer_object
-glIsFramebufferOES requires OES_framebuffer_object return JNI_FALSE
-glIsRenderbufferOES requires OES_framebuffer_object return JNI_FALSE
-glRenderbufferStorageOES requires OES_framebuffer_object
-glGetTexGen requires OES_texture_cube_map
-glTexGen requires OES_texture_cube_map
-glTexGenf requires OES_texture_cube_map
-glTexGeni requires OES_texture_cube_map
-glTexGenx requires OES_texture_cube_map
-glGetBufferParameter unsupported
diff --git a/opengl/tools/glgen/src/.gitignore b/opengl/tools/glgen/src/.gitignore
deleted file mode 100644
index 6b468b6..0000000
--- a/opengl/tools/glgen/src/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.class
diff --git a/opengl/tools/glgen/src/CFunc.java b/opengl/tools/glgen/src/CFunc.java
deleted file mode 100644
index 4847694..0000000
--- a/opengl/tools/glgen/src/CFunc.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-import java.util.*;
-
-public class CFunc {
-
- String original;
-
- CType ftype;
- String fname;
-
- List<String> argNames = new ArrayList<String>();
- List<CType> argTypes = new ArrayList<CType>();
-
- boolean hasPointerArg = false;
- boolean hasTypedPointerArg = false;
-
- public CFunc(String original) {
- this.original = original;
- }
-
- public String getOriginal() {
- return original;
- }
-
- public void setName(String fname) {
- this.fname = fname;
- }
-
- public String getName() {
- return fname;
- }
-
- public void setType(CType ftype) {
- this.ftype = ftype;
- }
-
- public CType getType() {
- return ftype;
- }
-
- public void addArgument(String argName, CType argType) {
- argNames.add(argName);
- argTypes.add(argType);
-
- if (argType.isPointer()) {
- hasPointerArg = true;
- }
- if (argType.isTypedPointer()) {
- hasTypedPointerArg = true;
- }
- }
-
- public int getNumArgs() {
- return argNames.size();
- }
-
- public int getArgIndex(String name) {
- int len = argNames.size();
- for (int i = 0; i < len; i++) {
- if (name.equals(argNames.get(i))) {
- return i;
- }
- }
- return -1;
- }
-
- public String getArgName(int index) {
- return argNames.get(index);
- }
-
- public CType getArgType(int index) {
- return argTypes.get(index);
- }
-
- public boolean hasPointerArg() {
- return hasPointerArg;
- }
-
- public boolean hasTypedPointerArg() {
- return hasTypedPointerArg;
- }
-
- @Override
- public String toString() {
- String s = "Function " + fname + " returns " + ftype + ": ";
- for (int i = 0; i < argNames.size(); i++) {
- if (i > 0) {
- s += ", ";
- }
- s += argTypes.get(i) + " " + argNames.get(i);
- }
- return s;
- }
-
- public static CFunc parseCFunc(String s) {
- CFunc cfunc = new CFunc(s);
- String[] tokens = s.split("\\s");
-
- int i = 0;
- CType ftype = new CType();
- String ftypeName = tokens[i++];
- if (ftypeName.equals("const")) {
- ftype.setIsConst(true);
- ftypeName = tokens[i++];
- }
- ftype.setBaseType(ftypeName);
-
- String fname = tokens[i++];
- if (fname.equals("*")) {
- ftype.setIsPointer(true);
- fname = tokens[i++];
- }
-
- cfunc.setName(fname);
- cfunc.setType(ftype);
-
- while (i < tokens.length) {
- String tok = tokens[i++];
-
- if (tok.equals("(")) {
- continue;
- }
- if (tok.equals(")")) {
- break;
- }
-
- CType argType = new CType();
-
- String argTypeName = tok;
- String argName = "";
-
- if (argTypeName.equals("const")) {
- argType.setIsConst(true);
- argTypeName = tokens[i++];
- }
- argType.setBaseType(argTypeName);
-
- if (argTypeName.equals("void")) {
- break;
- }
-
- argName = tokens[i++];
- if (argName.startsWith("*")) {
- argType.setIsPointer(true);
- argName = argName.substring(1, argName.length());
- }
- if (argName.endsWith(",")) {
- argName = argName.substring(0, argName.length() - 1);
- }
-
- cfunc.addArgument(argName, argType);
- }
-
- return cfunc;
- }
-}
diff --git a/opengl/tools/glgen/src/CType.java b/opengl/tools/glgen/src/CType.java
deleted file mode 100644
index e0f0ca6..0000000
--- a/opengl/tools/glgen/src/CType.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-public class CType {
-
- String baseType;
- boolean isConst;
- boolean isPointer;
-
- public CType() {
- }
-
- public CType(String baseType) {
- setBaseType(baseType);
- }
-
- public CType(String baseType, boolean isConst, boolean isPointer) {
- setBaseType(baseType);
- setIsConst(isConst);
- setIsPointer(isPointer);
- }
-
- public String getDeclaration() {
- return baseType + (isPointer ? " *" : "");
- }
-
- public void setIsConst(boolean isConst) {
- this.isConst = isConst;
- }
-
- public boolean isConst() {
- return isConst;
- }
-
- public void setIsPointer(boolean isPointer) {
- this.isPointer = isPointer;
- }
-
- public boolean isPointer() {
- return isPointer;
- }
-
- boolean isVoid() {
- String baseType = getBaseType();
- return baseType.equals("GLvoid") ||
- baseType.equals("void");
- }
-
- public boolean isConstCharPointer() {
- return isConst && isPointer && baseType.equals("char");
- }
-
- public boolean isTypedPointer() {
- return isPointer() && !isVoid() && !isConstCharPointer();
- }
-
- public void setBaseType(String baseType) {
- this.baseType = baseType;
- }
-
- public String getBaseType() {
- return baseType;
- }
-
- @Override
- public String toString() {
- String s = "";
- if (isConst()) {
- s += "const ";
- }
- s += baseType;
- if (isPointer()) {
- s += "*";
- }
-
- return s;
- }
-
- @Override
- public int hashCode() {
- return baseType.hashCode() ^ (isPointer ? 2 : 0) ^ (isConst ? 1 : 0);
- }
-
- @Override
- public boolean equals(Object o) {
- if (o != null && o instanceof CType) {
- CType c = (CType)o;
- return baseType.equals(c.baseType) &&
- isPointer() == c.isPointer() &&
- isConst() == c.isConst();
- }
- return false;
- }
-}
diff --git a/opengl/tools/glgen/src/CodeEmitter.java b/opengl/tools/glgen/src/CodeEmitter.java
deleted file mode 100644
index 3a4834e..0000000
--- a/opengl/tools/glgen/src/CodeEmitter.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-public interface CodeEmitter {
-
- void setVersion(int version, boolean ext, boolean pack);
- void emitCode(CFunc cfunc, String original);
- void addNativeRegistration(String fname);
- void emitNativeRegistration();
-}
diff --git a/opengl/tools/glgen/src/GLESCodeEmitter.java b/opengl/tools/glgen/src/GLESCodeEmitter.java
deleted file mode 100644
index d138250..0000000
--- a/opengl/tools/glgen/src/GLESCodeEmitter.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-import java.io.PrintStream;
-
-/**
- * Emits a Java interface and Java & C implementation for a C function.
- *
- * <p> The Java interface will have Buffer and array variants for functions that
- * have a typed pointer argument. The array variant will convert a single "<type> *data"
- * argument to a pair of arguments "<type>[] data, int offset".
- */
-public class GLESCodeEmitter extends JniCodeEmitter {
-
- PrintStream mJavaImplStream;
- PrintStream mCStream;
-
- PrintStream mJavaInterfaceStream;
-
- /**
- */
- public GLESCodeEmitter(String classPathName,
- ParameterChecker checker,
- PrintStream javaImplStream,
- PrintStream cStream) {
- mClassPathName = classPathName;
- mChecker = checker;
-
- mJavaImplStream = javaImplStream;
- mCStream = cStream;
- mUseContextPointer = false;
- mUseStaticMethods = true;
- }
-
- public void emitCode(CFunc cfunc, String original) {
- emitCode(cfunc, original, null, mJavaImplStream,
- mCStream);
- }
-
- public void emitNativeRegistration(String nativeRegistrationName) {
- emitNativeRegistration(nativeRegistrationName, mCStream);
- }
-}
diff --git a/opengl/tools/glgen/src/GenerateGL.java b/opengl/tools/glgen/src/GenerateGL.java
deleted file mode 100644
index 500cf0b..0000000
--- a/opengl/tools/glgen/src/GenerateGL.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintStream;
-
-public class GenerateGL {
-
- static void copy(String filename, PrintStream out) throws IOException {
- BufferedReader br = new BufferedReader(new FileReader(filename));
- String s;
- while ((s = br.readLine()) != null) {
- out.println(s);
- }
- }
-
- private static void emit(int version, boolean ext, boolean pack,
- CodeEmitter emitter,
- BufferedReader specReader,
- PrintStream glStream,
- PrintStream glImplStream,
- PrintStream cStream) throws Exception {
- String s = null;
- while ((s = specReader.readLine()) != null) {
- if (s.trim().startsWith("//")) {
- continue;
- }
-
- CFunc cfunc = CFunc.parseCFunc(s);
-
- String fname = cfunc.getName();
- File f = new File("stubs/jsr239/" + fname +
- ".java-1" + version + "-if");
- if (f.exists()) {
- System.out.println("Special-casing function " + fname);
- copy("stubs/jsr239/" + fname +
- ".java-1" + version + "-if", glStream);
- copy("stubs/jsr239/" + fname + ".java-impl", glImplStream);
- copy("stubs/jsr239/" + fname + ".cpp", cStream);
-
- // Register native function names
- // This should be improved to require fewer discrete files
- String filename = "stubs/jsr239/" + fname + ".nativeReg";
- BufferedReader br =
- new BufferedReader(new FileReader(filename));
- String nfunc;
- while ((nfunc = br.readLine()) != null) {
- emitter.addNativeRegistration(nfunc);
- }
- } else {
- emitter.setVersion(version, ext, pack);
- emitter.emitCode(cfunc, s);
- }
- }
- }
-
- public static void main(String[] args) throws Exception {
- String classPathName = "com/google/android/gles_jni/GLImpl";
- boolean useContextPointer = true;
-
- int aidx = 0;
- while (args[aidx].charAt(0) == '-') {
- switch (args[aidx].charAt(1)) {
- case 'c':
- useContextPointer = false;
- break;
-
- default:
- System.err.println("Unknown flag: " + args[aidx]);
- System.exit(1);
- }
-
- aidx++;
- }
-
- System.out.println("useContextPointer = " + useContextPointer);
-
- BufferedReader spec10Reader =
- new BufferedReader(new FileReader(args[aidx++]));
- BufferedReader spec10ExtReader =
- new BufferedReader(new FileReader(args[aidx++]));
- BufferedReader spec11Reader =
- new BufferedReader(new FileReader(args[aidx++]));
- BufferedReader spec11ExtReader =
- new BufferedReader(new FileReader(args[aidx++]));
- BufferedReader spec11ExtPackReader =
- new BufferedReader(new FileReader(args[aidx++]));
- BufferedReader checksReader =
- new BufferedReader(new FileReader(args[aidx++]));
-
- String gl10Filename = "javax/microedition/khronos/opengles/GL10.java";
- String gl10ExtFilename =
- "javax/microedition/khronos/opengles/GL10Ext.java";
- String gl11Filename = "javax/microedition/khronos/opengles/GL11.java";
- String gl11ExtFilename =
- "javax/microedition/khronos/opengles/GL11Ext.java";
- String gl11ExtPackFilename =
- "javax/microedition/khronos/opengles/GL11ExtensionPack.java";
- String glImplFilename = "com/google/android/gles_jni/GLImpl.java";
- String cFilename = "com_google_android_gles_jni_GLImpl.cpp";
-
- PrintStream gl10Stream =
- new PrintStream(new FileOutputStream("out/" + gl10Filename));
- PrintStream gl10ExtStream =
- new PrintStream(new FileOutputStream("out/" + gl10ExtFilename));
- PrintStream gl11Stream =
- new PrintStream(new FileOutputStream("out/" + gl11Filename));
- PrintStream gl11ExtStream =
- new PrintStream(new FileOutputStream("out/" + gl11ExtFilename));
- PrintStream gl11ExtPackStream =
- new PrintStream(new FileOutputStream("out/" + gl11ExtPackFilename));
- PrintStream glImplStream =
- new PrintStream(new FileOutputStream("out/" + glImplFilename));
- PrintStream cStream =
- new PrintStream(new FileOutputStream("out/" + cFilename));
-
- ParameterChecker checker = new ParameterChecker(checksReader);
-
- CodeEmitter emitter =
- new Jsr239CodeEmitter(classPathName,
- checker,
- gl10Stream, gl10ExtStream,
- gl11Stream, gl11ExtStream, gl11ExtPackStream,
- glImplStream, cStream,
- useContextPointer);
-
- gl10Stream.println("/* //device/java/android/" + gl10Filename);
- gl10ExtStream.println("/* //device/java/android/" + gl10ExtFilename);
- gl11Stream.println("/* //device/java/android/" + gl11Filename);
- gl11ExtStream.println("/* //device/java/android/" + gl11ExtFilename);
- gl11ExtPackStream.println("/* //device/java/android/" +
- gl11ExtPackFilename);
- glImplStream.println("/* //device/java/android/" + glImplFilename);
- cStream.println("/* //device/libs/android_runtime/" + cFilename);
-
- copy("stubs/jsr239/GL10Header.java-if", gl10Stream);
- copy("stubs/jsr239/GL10ExtHeader.java-if", gl10ExtStream);
- copy("stubs/jsr239/GL11Header.java-if", gl11Stream);
- copy("stubs/jsr239/GL11ExtHeader.java-if", gl11ExtStream);
- copy("stubs/jsr239/GL11ExtensionPackHeader.java-if", gl11ExtPackStream);
- copy("stubs/jsr239/GLImplHeader.java-impl", glImplStream);
- copy("stubs/jsr239/GLCHeader.cpp", cStream);
-
- emit(0, false, false,
- emitter, spec10Reader, gl10Stream, glImplStream, cStream);
- emit(0, true, false,
- emitter, spec10ExtReader, gl10ExtStream, glImplStream, cStream);
- emit(1, false, false,
- emitter, spec11Reader, gl11Stream, glImplStream, cStream);
- emit(1, true, false,
- emitter, spec11ExtReader, gl11ExtStream, glImplStream, cStream);
- emit(1, true, true,
- emitter, spec11ExtPackReader, gl11ExtPackStream, glImplStream,
- cStream);
-
- emitter.emitNativeRegistration();
-
- gl10Stream.println("}");
- gl10ExtStream.println("}");
- gl11Stream.println("}");
- gl11ExtStream.println("}");
- gl11ExtPackStream.println("}");
- glImplStream.println("}");
- }
-}
diff --git a/opengl/tools/glgen/src/GenerateGLES.java b/opengl/tools/glgen/src/GenerateGLES.java
deleted file mode 100644
index 6468957..0000000
--- a/opengl/tools/glgen/src/GenerateGLES.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintStream;
-
-public class GenerateGLES {
-
- static void copy(String filename, PrintStream out) throws IOException {
- BufferedReader br = new BufferedReader(new FileReader(filename));
- String s;
- while ((s = br.readLine()) != null) {
- out.println(s);
- }
- }
-
- private static void emit(GLESCodeEmitter emitter,
- BufferedReader specReader,
- PrintStream glStream,
- PrintStream cStream) throws Exception {
- String s = null;
- while ((s = specReader.readLine()) != null) {
- if (s.trim().startsWith("//")) {
- continue;
- }
-
- CFunc cfunc = CFunc.parseCFunc(s);
-
- String fname = cfunc.getName();
- String stubRoot = "stubs/gles11/" + fname;
- String javaPath = stubRoot + ".java";
- File f = new File(javaPath);
- if (f.exists()) {
- System.out.println("Special-casing function " + fname);
- copy(javaPath, glStream);
- copy(stubRoot + ".cpp", cStream);
-
- // Register native function names
- // This should be improved to require fewer discrete files
- String filename = stubRoot + ".nativeReg";
- BufferedReader br =
- new BufferedReader(new FileReader(filename));
- String nfunc;
- while ((nfunc = br.readLine()) != null) {
- emitter.addNativeRegistration(nfunc);
- }
- } else {
- emitter.emitCode(cfunc, s);
- }
- }
- }
-
- public static void main(String[] args) throws Exception {
- int aidx = 0;
- while ((aidx < args.length) && (args[aidx].charAt(0) == '-')) {
- switch (args[aidx].charAt(1)) {
- default:
- System.err.println("Unknown flag: " + args[aidx]);
- System.exit(1);
- }
-
- aidx++;
- }
-
- BufferedReader checksReader =
- new BufferedReader(new FileReader("specs/gles11/checks.spec"));
- ParameterChecker checker = new ParameterChecker(checksReader);
-
- // Generate files
- for(String suffix: new String[] {"GLES10", "GLES10Ext",
- "GLES11", "GLES11Ext", "GLES20"})
- {
- BufferedReader spec11Reader =
- new BufferedReader(new FileReader("specs/gles11/"
- + suffix + ".spec"));
- String gl11Filename = "android/opengl/" + suffix + ".java";
- String gl11cFilename = "android_opengl_" + suffix + ".cpp";
- PrintStream gl11Stream =
- new PrintStream(new FileOutputStream("out/" + gl11Filename));
- PrintStream gl11cStream =
- new PrintStream(new FileOutputStream("out/" + gl11cFilename));
- gl11Stream.println("/*");
- gl11cStream.println("/*");
- copy("stubs/gles11/" + suffix + "Header.java-if", gl11Stream);
- copy("stubs/gles11/" + suffix + "cHeader.cpp", gl11cStream);
- GLESCodeEmitter emitter = new GLESCodeEmitter(
- "android/opengl/" + suffix,
- checker, gl11Stream, gl11cStream);
- emit(emitter, spec11Reader, gl11Stream, gl11cStream);
- emitter.emitNativeRegistration("register_android_opengl_jni_"
- + suffix);
- gl11Stream.println("}");
- gl11Stream.close();
- gl11cStream.close();
- }
- }
-}
diff --git a/opengl/tools/glgen/src/JFunc.java b/opengl/tools/glgen/src/JFunc.java
deleted file mode 100644
index e3d73b6..0000000
--- a/opengl/tools/glgen/src/JFunc.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class JFunc {
-
- String className = "com.google.android.gles_jni.GL11Impl";
-
- CFunc cfunc;
- JType ftype;
- String fname;
-
- List<String> argNames = new ArrayList<String>();
- List<JType> argTypes = new ArrayList<JType>();
- List<Integer> argCIndices = new ArrayList<Integer>();
-
- boolean hasBufferArg = false;
- boolean hasTypedBufferArg = false;
- ArrayList<String> bufferArgNames = new ArrayList<String>();
-
- public JFunc(CFunc cfunc) {
- this.cfunc = cfunc;
- }
-
- public CFunc getCFunc() {
- return cfunc;
- }
-
- public void setName(String fname) {
- this.fname = fname;
- }
-
- public String getName() {
- return fname;
- }
-
- public void setType(JType ftype) {
- this.ftype = ftype;
- }
-
- public JType getType() {
- return ftype;
- }
-
- public void setClassName(String className) {
- this.className = className;
- }
-
- public String getClassName() {
- return className;
- }
-
- public boolean hasBufferArg() {
- return hasBufferArg;
- }
-
- public boolean hasTypedBufferArg() {
- return hasTypedBufferArg;
- }
-
- public String getBufferArgName(int index) {
- return bufferArgNames.get(index);
- }
-
- public void addArgument(String argName, JType argType, int cindex) {
- argNames.add(argName);
- argTypes.add(argType);
- argCIndices.add(new Integer(cindex));
-
- if (argType.isBuffer()) {
- hasBufferArg = true;
- bufferArgNames.add(argName);
- }
- if (argType.isTypedBuffer()) {
- hasTypedBufferArg = true;
- bufferArgNames.add(argName);
- }
- }
-
- public int getNumArgs() {
- return argNames.size();
- }
-
- public int getArgIndex(String name) {
- int len = argNames.size();
- for (int i = 0; i < len; i++) {
- if (name.equals(argNames.get(i))) {
- return i;
- }
- }
- return -1;
- }
-
- public String getArgName(int index) {
- return argNames.get(index);
- }
-
- public JType getArgType(int index) {
- return argTypes.get(index);
- }
-
- public int getArgCIndex(int index) {
- return argCIndices.get(index).intValue();
- }
-
- public static JFunc convert(CFunc cfunc, boolean useArray) {
- try {
- JFunc jfunc = new JFunc(cfunc);
- jfunc.setName(cfunc.getName());
- jfunc.setType(JType.convert(cfunc.getType(), false));
-
- int numArgs = cfunc.getNumArgs();
- int numOffsets = 0;
- for (int i = 0; i < numArgs; i++) {
- CType cArgType = cfunc.getArgType(i);
- if (cArgType.isTypedPointer() && useArray) {
- ++numOffsets;
- }
- }
-
- for (int i = 0; i < numArgs; i++) {
- String cArgName = cfunc.getArgName(i);
- CType cArgType = cfunc.getArgType(i);
-
- jfunc.addArgument(cArgName, JType.convert(cArgType, useArray), i);
- if (cArgType.isTypedPointer() && useArray) {
- if (numOffsets > 1) {
- jfunc.addArgument(cArgName + "Offset", new JType("int"), i);
- } else {
- jfunc.addArgument("offset", new JType("int"), i);
- }
- }
- }
-
- return jfunc;
- } catch (RuntimeException e) {
- System.err.println("Failed to convert function " + cfunc);
- throw e;
- }
- }
-
- @Override
- public String toString() {
- String s = "Function " + fname + " returns " + ftype + ": ";
- for (int i = 0; i < argNames.size(); i++) {
- if (i > 0) {
- s += ", ";
- }
- s += argTypes.get(i) + " " + argNames.get(i);
- }
- return s;
- }
-
-}
diff --git a/opengl/tools/glgen/src/JType.java b/opengl/tools/glgen/src/JType.java
deleted file mode 100644
index deb2f01..0000000
--- a/opengl/tools/glgen/src/JType.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-import java.util.HashMap;
-
-public class JType {
-
- String baseType;
- boolean isArray;
- boolean isClass;
- boolean isString;
-
- static HashMap<CType,JType> typeMapping = new HashMap<CType,JType>();
- static HashMap<CType,JType> arrayTypeMapping = new HashMap<CType,JType>();
-
- static {
- // Primitive types
- typeMapping.put(new CType("GLbitfield"), new JType("int"));
- typeMapping.put(new CType("GLboolean"), new JType("boolean"));
- typeMapping.put(new CType("GLclampf"), new JType("float"));
- typeMapping.put(new CType("GLclampx"), new JType("int"));
- typeMapping.put(new CType("GLenum"), new JType("int"));
- typeMapping.put(new CType("GLfloat"), new JType("float"));
- typeMapping.put(new CType("GLfixed"), new JType("int"));
- typeMapping.put(new CType("GLint"), new JType("int"));
- typeMapping.put(new CType("GLintptr"), new JType("int"));
- typeMapping.put(new CType("GLshort"), new JType("short"));
- typeMapping.put(new CType("GLsizei"), new JType("int"));
- typeMapping.put(new CType("GLsizeiptr"), new JType("int"));
- typeMapping.put(new CType("GLubyte"), new JType("byte"));
- typeMapping.put(new CType("GLuint"), new JType("int"));
- typeMapping.put(new CType("void"), new JType("void"));
- typeMapping.put(new CType("GLubyte", true, true), new JType("String", false, false));
- typeMapping.put(new CType("char", false, true), new JType("byte"));
- typeMapping.put(new CType("char", true, true), new JType("String", false, false));
- typeMapping.put(new CType("int"), new JType("int"));
-
- // Untyped pointers map to untyped Buffers
- typeMapping.put(new CType("GLvoid", true, true),
- new JType("java.nio.Buffer", true, false));
- typeMapping.put(new CType("GLvoid", false, true),
- new JType("java.nio.Buffer", true, false));
- typeMapping.put(new CType("void", false, true),
- new JType("java.nio.Buffer", true, false));
- typeMapping.put(new CType("GLeglImageOES", false, false),
- new JType("java.nio.Buffer", true, false));
-
- // Typed pointers map to typed Buffers
- typeMapping.put(new CType("GLboolean", false, true),
- new JType("java.nio.IntBuffer", true, false));
- typeMapping.put(new CType("GLenum", false, true),
- new JType("java.nio.IntBuffer", true, false));
- typeMapping.put(new CType("GLfixed", false, true),
- new JType("java.nio.IntBuffer", true, false));
- typeMapping.put(new CType("GLfixed", true, true),
- new JType("java.nio.IntBuffer", true, false));
- typeMapping.put(new CType("GLfloat", false, true),
- new JType("java.nio.FloatBuffer", true, false));
- typeMapping.put(new CType("GLfloat", true, true),
- new JType("java.nio.FloatBuffer", true, false));
- typeMapping.put(new CType("GLint", false, true),
- new JType("java.nio.IntBuffer", true, false));
- typeMapping.put(new CType("GLint", true, true),
- new JType("java.nio.IntBuffer", true, false));
- typeMapping.put(new CType("GLsizei", false, true),
- new JType("java.nio.IntBuffer", true, false));
- typeMapping.put(new CType("GLuint", false, true),
- new JType("java.nio.IntBuffer", true, false));
- typeMapping.put(new CType("GLuint", true, true),
- new JType("java.nio.IntBuffer", true, false));
- typeMapping.put(new CType("GLshort", true, true),
- new JType("java.nio.ShortBuffer", true, false));
-
- // Typed pointers map to arrays + offsets
- arrayTypeMapping.put(new CType("char", false, true),
- new JType("byte", false, true));
- arrayTypeMapping.put(new CType("GLboolean", false, true),
- new JType("boolean", false, true));
- arrayTypeMapping.put(new CType("GLenum", false, true), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLfixed", true, true), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLfixed", false, true), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLfloat", false, true), new JType("float", false, true));
- arrayTypeMapping.put(new CType("GLfloat", true, true), new JType("float", false, true));
- arrayTypeMapping.put(new CType("GLint", false, true), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLint", true, true), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLshort", true, true), new JType("short", false, true));
- arrayTypeMapping.put(new CType("GLsizei", false, true), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLsizei", true, true), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLuint", false, true), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLuint", true, true), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLintptr"), new JType("int", false, true));
- arrayTypeMapping.put(new CType("GLsizeiptr"), new JType("int", false, true));
- }
-
- public JType() {
- }
-
- public JType(String primitiveTypeName) {
- this.baseType = primitiveTypeName;
- this.isClass = false;
- this.isArray = false;
- }
-
- public JType(String primitiveTypeName, boolean isClass, boolean isArray) {
- this.baseType = primitiveTypeName;
- this.isClass = isClass;
- this.isArray = isArray;
- }
-
- public String getBaseType() {
- return baseType;
- }
-
- @Override
- public String toString() {
- return baseType + (isArray ? "[]" : "");
- }
-
- public boolean isArray() {
- return isArray;
- }
-
- public boolean isClass() {
- return isClass;
- }
-
- public boolean isString() {
- return baseType.equals("String");
- }
-
- public boolean isPrimitive() {
- return !isClass() && !isArray();
- }
-
- public boolean isVoid() {
- return baseType.equals("void");
- }
-
- public boolean isBuffer() {
- return baseType.indexOf("Buffer") != -1;
- }
-
- public boolean isTypedBuffer() {
- return !baseType.equals("java.nio.Buffer") &&
- (baseType.indexOf("Buffer") != -1);
- }
-
- public static JType convert(CType ctype, boolean useArray) {
- JType javaType = null;
- if (useArray) {
- javaType = arrayTypeMapping.get(ctype);
- }
- if (javaType == null) {
- javaType = typeMapping.get(ctype);
- }
- if (javaType == null) {
- throw new RuntimeException("Unsupported C type: " + ctype);
- }
- return javaType;
- }
-}
diff --git a/opengl/tools/glgen/src/JniCodeEmitter.java b/opengl/tools/glgen/src/JniCodeEmitter.java
deleted file mode 100644
index 9fa2b74..0000000
--- a/opengl/tools/glgen/src/JniCodeEmitter.java
+++ /dev/null
@@ -1,1180 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-public class JniCodeEmitter {
-
- static final boolean mUseCPlusPlus = true;
- protected boolean mUseContextPointer = true;
- protected boolean mUseStaticMethods = false;
- protected String mClassPathName;
- protected ParameterChecker mChecker;
- protected List<String> nativeRegistrations = new ArrayList<String>();
- boolean needsExit;
- protected static String indent = " ";
- HashSet<String> mFunctionsEmitted = new HashSet<String>();
-
- public static String getJniName(JType jType) {
- String jniName = "";
- if (jType.isClass()) {
- return "L" + jType.getBaseType() + ";";
- } else if (jType.isArray()) {
- jniName = "[";
- }
-
- String baseType = jType.getBaseType();
- if (baseType.equals("int")) {
- jniName += "I";
- } else if (baseType.equals("float")) {
- jniName += "F";
- } else if (baseType.equals("boolean")) {
- jniName += "Z";
- } else if (baseType.equals("short")) {
- jniName += "S";
- } else if (baseType.equals("long")) {
- jniName += "L";
- } else if (baseType.equals("byte")) {
- jniName += "B";
- } else if (baseType.equals("String")) {
- jniName += "Ljava/lang/String;";
- } else if (baseType.equals("void")) {
- // nothing.
- } else {
- throw new RuntimeException("Unknown primitive basetype " + baseType);
- }
- return jniName;
- }
-
-
- public void emitCode(CFunc cfunc, String original,
- PrintStream javaInterfaceStream,
- PrintStream javaImplStream,
- PrintStream cStream) {
- JFunc jfunc;
- String signature;
- boolean duplicate;
-
- if (cfunc.hasTypedPointerArg()) {
- jfunc = JFunc.convert(cfunc, true);
-
- // Don't emit duplicate functions
- // These may appear because they are defined in multiple
- // Java interfaces (e.g., GL11/GL11ExtensionPack)
- signature = jfunc.toString();
- duplicate = false;
- if (mFunctionsEmitted.contains(signature)) {
- duplicate = true;
- } else {
- mFunctionsEmitted.add(signature);
- }
-
- if (!duplicate) {
- emitNativeDeclaration(jfunc, javaImplStream);
- emitJavaCode(jfunc, javaImplStream);
- }
- if (javaInterfaceStream != null) {
- emitJavaInterfaceCode(jfunc, javaInterfaceStream);
- }
- if (!duplicate) {
- emitJniCode(jfunc, cStream);
- }
- }
-
- jfunc = JFunc.convert(cfunc, false);
-
- signature = jfunc.toString();
- duplicate = false;
- if (mFunctionsEmitted.contains(signature)) {
- duplicate = true;
- } else {
- mFunctionsEmitted.add(signature);
- }
-
- if (!duplicate) {
- emitNativeDeclaration(jfunc, javaImplStream);
- }
- if (javaInterfaceStream != null) {
- emitJavaInterfaceCode(jfunc, javaInterfaceStream);
- }
- if (!duplicate) {
- emitJavaCode(jfunc, javaImplStream);
- emitJniCode(jfunc, cStream);
- }
- }
-
- public void emitNativeDeclaration(JFunc jfunc, PrintStream out) {
- out.println(" // C function " + jfunc.getCFunc().getOriginal());
- out.println();
-
- emitFunction(jfunc, out, true, false);
- }
-
- public void emitJavaInterfaceCode(JFunc jfunc, PrintStream out) {
- emitFunction(jfunc, out, false, true);
- }
-
- public void emitJavaCode(JFunc jfunc, PrintStream out) {
- emitFunction(jfunc, out, false, false);
- }
-
- boolean isPointerFunc(JFunc jfunc) {
- String name = jfunc.getName();
- return (name.endsWith("Pointer") || name.endsWith("PointerOES"))
- && jfunc.getCFunc().hasPointerArg();
- }
-
- void emitFunctionCall(JFunc jfunc, PrintStream out, String iii, boolean grabArray) {
- boolean isVoid = jfunc.getType().isVoid();
- boolean isPointerFunc = isPointerFunc(jfunc);
-
- if (!isVoid) {
- out.println(iii +
- jfunc.getType() + " _returnValue;");
- }
- out.println(iii +
- (isVoid ? "" : "_returnValue = ") +
- jfunc.getName() +
- (isPointerFunc ? "Bounds" : "" ) +
- "(");
-
- int numArgs = jfunc.getNumArgs();
- for (int i = 0; i < numArgs; i++) {
- String argName = jfunc.getArgName(i);
- JType argType = jfunc.getArgType(i);
-
- if (grabArray && argType.isTypedBuffer()) {
- String typeName = argType.getBaseType();
- typeName = typeName.substring(9, typeName.length() - 6);
- out.println(iii + indent + "get" + typeName + "Array(" + argName + "),");
- out.print(iii + indent + "getOffset(" + argName + ")");
- } else {
- out.print(iii + indent + argName);
- }
- if (i == numArgs - 1) {
- if (isPointerFunc) {
- out.println(",");
- out.println(iii + indent + argName + ".remaining()");
- } else {
- out.println();
- }
- } else {
- out.println(",");
- }
- }
-
- out.println(iii + ");");
- }
-
- void printIfcheckPostamble(PrintStream out, boolean isBuffer, boolean emitExceptionCheck,
- String iii) {
- printIfcheckPostamble(out, isBuffer, emitExceptionCheck,
- "offset", "_remaining", iii);
- }
-
- void printIfcheckPostamble(PrintStream out, boolean isBuffer, boolean emitExceptionCheck,
- String offset, String remaining, String iii) {
- out.println(iii + " default:");
- out.println(iii + " _needed = 0;");
- out.println(iii + " break;");
- out.println(iii + "}");
-
- out.println(iii + "if (" + remaining + " < _needed) {");
- if (emitExceptionCheck) {
- out.println(iii + indent + "_exception = 1;");
- }
- out.println(iii + indent + "jniThrowException(_env, " +
- "\"java/lang/IllegalArgumentException\", " +
- "\"" + (isBuffer ? "remaining()" : "length - " + offset) + " < needed\");");
- out.println(iii + indent + "goto exit;");
- needsExit = true;
- out.println(iii + "}");
- }
-
- boolean isNullAllowed(CFunc cfunc) {
- String[] checks = mChecker.getChecks(cfunc.getName());
- int index = 1;
- if (checks != null) {
- while (index < checks.length) {
- if (checks[index].equals("return")) {
- index += 2;
- } else if (checks[index].startsWith("check")) {
- index += 3;
- } else if (checks[index].equals("ifcheck")) {
- index += 5;
- } else if (checks[index].equals("unsupported")) {
- index += 1;
- } else if (checks[index].equals("requires")) {
- index += 2;
- } else if (checks[index].equals("nullAllowed")) {
- return true;
- } else {
- System.out.println("Error: unknown keyword \"" +
- checks[index] + "\"");
- System.exit(0);
- }
- }
- }
- return false;
- }
-
- String getErrorReturnValue(CFunc cfunc) {
- CType returnType = cfunc.getType();
- boolean isVoid = returnType.isVoid();
- if (isVoid) {
- return null;
- }
-
- String[] checks = mChecker.getChecks(cfunc.getName());
-
- int index = 1;
- if (checks != null) {
- while (index < checks.length) {
- if (checks[index].equals("return")) {
- return checks[index + 1];
- } else if (checks[index].startsWith("check")) {
- index += 3;
- } else if (checks[index].equals("ifcheck")) {
- index += 5;
- } else if (checks[index].equals("unsupported")) {
- index += 1;
- } else if (checks[index].equals("requires")) {
- index += 2;
- } else if (checks[index].equals("nullAllowed")) {
- index += 1;
- } else {
- System.out.println("Error: unknown keyword \"" +
- checks[index] + "\"");
- System.exit(0);
- }
- }
- }
-
- return null;
- }
-
- boolean isUnsupportedFunc(CFunc cfunc) {
- String[] checks = mChecker.getChecks(cfunc.getName());
- int index = 1;
- if (checks != null) {
- while (index < checks.length) {
- if (checks[index].equals("unsupported")) {
- return true;
- } else if (checks[index].equals("requires")) {
- index += 2;
- } else if (checks[index].equals("return")) {
- index += 2;
- } else if (checks[index].startsWith("check")) {
- index += 3;
- } else if (checks[index].equals("ifcheck")) {
- index += 5;
- } else if (checks[index].equals("nullAllowed")) {
- index += 1;
- } else {
- System.out.println("Error: unknown keyword \"" +
- checks[index] + "\"");
- System.exit(0);
- }
- }
- }
- return false;
- }
-
- String isRequiresFunc(CFunc cfunc) {
- String[] checks = mChecker.getChecks(cfunc.getName());
- int index = 1;
- if (checks != null) {
- while (index < checks.length) {
- if (checks[index].equals("unsupported")) {
- index += 1;
- } else if (checks[index].equals("requires")) {
- return checks[index+1];
- } else if (checks[index].equals("return")) {
- index += 2;
- } else if (checks[index].startsWith("check")) {
- index += 3;
- } else if (checks[index].equals("ifcheck")) {
- index += 5;
- } else if (checks[index].equals("nullAllowed")) {
- index += 1;
- } else {
- System.out.println("Error: unknown keyword \"" +
- checks[index] + "\"");
- System.exit(0);
- }
- }
- }
- return null;
- }
-
- void emitNativeBoundsChecks(CFunc cfunc, String cname, PrintStream out,
- boolean isBuffer, boolean emitExceptionCheck, String offset, String remaining, String iii) {
-
- String[] checks = mChecker.getChecks(cfunc.getName());
-
- boolean lastWasIfcheck = false;
-
- int index = 1;
- if (checks != null) {
- while (index < checks.length) {
- if (checks[index].startsWith("check")) {
- if (lastWasIfcheck) {
- printIfcheckPostamble(out, isBuffer, emitExceptionCheck,
- offset, remaining, iii);
- }
- lastWasIfcheck = false;
- if (cname != null && !cname.equals(checks[index + 1])) {
- index += 3;
- continue;
- }
- out.println(iii + "if (" + remaining + " < " + checks[index + 2] + ") {");
- if (emitExceptionCheck) {
- out.println(iii + indent + "_exception = 1;");
- }
- String exceptionClassName = "java/lang/IllegalArgumentException";
- // If the "check" keyword was of the form
- // "check_<class name>", use the class name in the
- // exception to be thrown
- int underscore = checks[index].indexOf('_');
- if (underscore >= 0) {
- String abbr = checks[index].substring(underscore + 1);
- if (abbr.equals("AIOOBE")) {
- exceptionClassName = "java/lang/ArrayIndexOutOfBoundsException";
- } else {
- throw new RuntimeException("unknown exception abbreviation: " + abbr);
- }
- }
- out.println(iii + indent + "jniThrowException(_env, " +
- "\"" + exceptionClassName + "\", " +
- "\"" + (isBuffer ? "remaining()" : "length - " + offset) + " < " + checks[index + 2] + "\");");
-
- out.println(iii + indent + "goto exit;");
- needsExit = true;
- out.println(iii + "}");
-
- index += 3;
- } else if (checks[index].equals("ifcheck")) {
- String[] matches = checks[index + 4].split(",");
-
- if (!lastWasIfcheck) {
- out.println(iii + "int _needed;");
- out.println(iii + "switch (" + checks[index + 3] + ") {");
- }
-
- for (int i = 0; i < matches.length; i++) {
- out.println("#if defined(" + matches[i] + ")");
- out.println(iii + " case " + matches[i] + ":");
- out.println("#endif // defined(" + matches[i] + ")");
- }
- out.println(iii + " _needed = " + checks[index + 2] + ";");
- out.println(iii + " break;");
-
- lastWasIfcheck = true;
- index += 5;
- } else if (checks[index].equals("return")) {
- // ignore
- index += 2;
- } else if (checks[index].equals("unsupported")) {
- // ignore
- index += 1;
- } else if (checks[index].equals("requires")) {
- // ignore
- index += 2;
- } else if (checks[index].equals("nullAllowed")) {
- // ignore
- index += 1;
- } else {
- System.out.println("Error: unknown keyword \"" + checks[index] + "\"");
- System.exit(0);
- }
- }
- }
-
- if (lastWasIfcheck) {
- printIfcheckPostamble(out, isBuffer, emitExceptionCheck, iii);
- }
- }
-
- boolean hasNonConstArg(JFunc jfunc, CFunc cfunc, List<Integer> nonPrimitiveArgs) {
- if (nonPrimitiveArgs.size() > 0) {
- for (int i = nonPrimitiveArgs.size() - 1; i >= 0; i--) {
- int idx = nonPrimitiveArgs.get(i).intValue();
- int cIndex = jfunc.getArgCIndex(idx);
- if (jfunc.getArgType(idx).isArray()) {
- if (!cfunc.getArgType(cIndex).isConst()) {
- return true;
- }
- } else if (jfunc.getArgType(idx).isBuffer()) {
- if (!cfunc.getArgType(cIndex).isConst()) {
- return true;
- }
- }
- }
- }
-
- return false;
- }
-
- /**
- * Emit a function in several variants:
- *
- * if nativeDecl: public native <returntype> func(args);
- *
- * if !nativeDecl:
- * if interfaceDecl: public <returntype> func(args);
- * if !interfaceDecl: public <returntype> func(args) { body }
- */
- void emitFunction(JFunc jfunc, PrintStream out, boolean nativeDecl, boolean interfaceDecl) {
- boolean isPointerFunc = isPointerFunc(jfunc);
-
- if (!nativeDecl && !interfaceDecl && !isPointerFunc) {
- // If it's not a pointer function, we've already emitted it
- // with nativeDecl == true
- return;
- }
-
- String maybeStatic = mUseStaticMethods ? "static " : "";
-
- if (isPointerFunc) {
- out.println(indent +
- (nativeDecl ? "private " + maybeStatic +"native " :
- (interfaceDecl ? "" : "public ") + maybeStatic) +
- jfunc.getType() + " " +
- jfunc.getName() +
- (nativeDecl ? "Bounds" : "") +
- "(");
- } else {
- out.println(indent +
- (nativeDecl ? "public " + maybeStatic +"native " :
- (interfaceDecl ? "" : "public ") + maybeStatic) +
- jfunc.getType() + " " +
- jfunc.getName() +
- "(");
- }
-
- int numArgs = jfunc.getNumArgs();
- for (int i = 0; i < numArgs; i++) {
- String argName = jfunc.getArgName(i);
- JType argType = jfunc.getArgType(i);
-
- out.print(indent + indent + argType + " " + argName);
- if (i == numArgs - 1) {
- if (isPointerFunc && nativeDecl) {
- out.println(",");
- out.println(indent + indent + "int remaining");
- } else {
- out.println();
- }
- } else {
- out.println(",");
- }
- }
-
- if (nativeDecl || interfaceDecl) {
- out.println(indent + ");");
- } else {
- out.println(indent + ") {");
-
- String iii = indent + indent;
-
- // emitBoundsChecks(jfunc, out, iii);
- emitFunctionCall(jfunc, out, iii, false);
-
- // Set the pointer after we call the native code, so that if
- // the native code throws an exception we don't modify the
- // pointer. We assume that the native code is written so that
- // if an exception is thrown, then the underlying glXXXPointer
- // function will not have been called.
-
- String fname = jfunc.getName();
- if (isPointerFunc) {
- // TODO - deal with VBO variants
- if (fname.equals("glColorPointer")) {
- out.println(iii + "if ((size == 4) &&");
- out.println(iii + " ((type == GL_FLOAT) ||");
- out.println(iii + " (type == GL_UNSIGNED_BYTE) ||");
- out.println(iii + " (type == GL_FIXED)) &&");
- out.println(iii + " (stride >= 0)) {");
- out.println(iii + indent + "_colorPointer = pointer;");
- out.println(iii + "}");
- } else if (fname.equals("glNormalPointer")) {
- out.println(iii + "if (((type == GL_FLOAT) ||");
- out.println(iii + " (type == GL_BYTE) ||");
- out.println(iii + " (type == GL_SHORT) ||");
- out.println(iii + " (type == GL_FIXED)) &&");
- out.println(iii + " (stride >= 0)) {");
- out.println(iii + indent + "_normalPointer = pointer;");
- out.println(iii + "}");
- } else if (fname.equals("glTexCoordPointer")) {
- out.println(iii + "if (((size == 2) ||");
- out.println(iii + " (size == 3) ||");
- out.println(iii + " (size == 4)) &&");
- out.println(iii + " ((type == GL_FLOAT) ||");
- out.println(iii + " (type == GL_BYTE) ||");
- out.println(iii + " (type == GL_SHORT) ||");
- out.println(iii + " (type == GL_FIXED)) &&");
- out.println(iii + " (stride >= 0)) {");
- out.println(iii + indent + "_texCoordPointer = pointer;");
- out.println(iii + "}");
- } else if (fname.equals("glVertexPointer")) {
- out.println(iii + "if (((size == 2) ||");
- out.println(iii + " (size == 3) ||");
- out.println(iii + " (size == 4)) &&");
- out.println(iii + " ((type == GL_FLOAT) ||");
- out.println(iii + " (type == GL_BYTE) ||");
- out.println(iii + " (type == GL_SHORT) ||");
- out.println(iii + " (type == GL_FIXED)) &&");
- out.println(iii + " (stride >= 0)) {");
- out.println(iii + indent + "_vertexPointer = pointer;");
- out.println(iii + "}");
- } else if (fname.equals("glPointSizePointerOES")) {
- out.println(iii + "if (((type == GL_FLOAT) ||");
- out.println(iii + " (type == GL_FIXED)) &&");
- out.println(iii + " (stride >= 0)) {");
- out.println(iii + indent + "_pointSizePointerOES = pointer;");
- out.println(iii + "}");
- } else if (fname.equals("glMatrixIndexPointerOES")) {
- out.println(iii + "if (((size == 2) ||");
- out.println(iii + " (size == 3) ||");
- out.println(iii + " (size == 4)) &&");
- out.println(iii + " ((type == GL_FLOAT) ||");
- out.println(iii + " (type == GL_BYTE) ||");
- out.println(iii + " (type == GL_SHORT) ||");
- out.println(iii + " (type == GL_FIXED)) &&");
- out.println(iii + " (stride >= 0)) {");
- out.println(iii + indent + "_matrixIndexPointerOES = pointer;");
- out.println(iii + "}");
- } else if (fname.equals("glWeightPointer")) {
- out.println(iii + "if (((size == 2) ||");
- out.println(iii + " (size == 3) ||");
- out.println(iii + " (size == 4)) &&");
- out.println(iii + " ((type == GL_FLOAT) ||");
- out.println(iii + " (type == GL_BYTE) ||");
- out.println(iii + " (type == GL_SHORT) ||");
- out.println(iii + " (type == GL_FIXED)) &&");
- out.println(iii + " (stride >= 0)) {");
- out.println(iii + indent + "_weightPointerOES = pointer;");
- out.println(iii + "}");
- }
- }
-
- boolean isVoid = jfunc.getType().isVoid();
-
- if (!isVoid) {
- out.println(indent + indent + "return _returnValue;");
- }
- out.println(indent + "}");
- }
- out.println();
- }
-
- public void addNativeRegistration(String s) {
- nativeRegistrations.add(s);
- }
-
- public void emitNativeRegistration(String registrationFunctionName,
- PrintStream cStream) {
- cStream.println("static const char *classPathName = \"" +
- mClassPathName +
- "\";");
- cStream.println();
-
- cStream.println("static JNINativeMethod methods[] = {");
-
- cStream.println("{\"_nativeClassInit\", \"()V\", (void*)nativeClassInit },");
-
- Iterator<String> i = nativeRegistrations.iterator();
- while (i.hasNext()) {
- cStream.println(i.next());
- }
-
- cStream.println("};");
- cStream.println();
-
-
- cStream.println("int " + registrationFunctionName + "(JNIEnv *_env)");
- cStream.println("{");
- cStream.println(indent +
- "int err;");
-
- cStream.println(indent +
- "err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));");
-
- cStream.println(indent + "return err;");
- cStream.println("}");
- }
-
- public JniCodeEmitter() {
- super();
- }
-
- String getJniType(JType jType) {
- if (jType.isVoid()) {
- return "void";
- }
-
- String baseType = jType.getBaseType();
- if (jType.isPrimitive()) {
- if (baseType.equals("String")) {
- return "jstring";
- } else {
- return "j" + baseType;
- }
- } else if (jType.isArray()) {
- return "j" + baseType + "Array";
- } else {
- return "jobject";
- }
- }
-
- String getJniMangledName(String name) {
- name = name.replaceAll("_", "_1");
- name = name.replaceAll(";", "_2");
- name = name.replaceAll("\\[", "_3");
- return name;
- }
-
- public void emitJniCode(JFunc jfunc, PrintStream out) {
- CFunc cfunc = jfunc.getCFunc();
-
- // Emit comment identifying original C function
- //
- // Example:
- //
- // /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
- //
- out.println("/* " + cfunc.getOriginal() + " */");
-
- // Emit JNI signature (name)
- //
- // Example:
- //
- // void
- // android_glClipPlanef__I_3FI
- //
-
- String outName = "android_" + jfunc.getName();
- boolean isPointerFunc = isPointerFunc(jfunc);
- boolean isVBOPointerFunc = (outName.endsWith("Pointer") ||
- outName.endsWith("PointerOES") ||
- outName.endsWith("DrawElements") || outName.endsWith("VertexAttribPointer")) &&
- !jfunc.getCFunc().hasPointerArg();
- if (isPointerFunc) {
- outName += "Bounds";
- }
-
- out.print("static ");
- out.println(getJniType(jfunc.getType()));
- out.print(outName);
-
- String rsignature = getJniName(jfunc.getType());
-
- String signature = "";
- int numArgs = jfunc.getNumArgs();
- for (int i = 0; i < numArgs; i++) {
- JType argType = jfunc.getArgType(i);
- signature += getJniName(argType);
- }
- if (isPointerFunc) {
- signature += "I";
- }
-
- // Append signature to function name
- String sig = getJniMangledName(signature).replace('.', '_').replace('/', '_');
- out.print("__" + sig);
- outName += "__" + sig;
-
- signature = signature.replace('.', '/');
- rsignature = rsignature.replace('.', '/');
-
- out.println();
- if (rsignature.length() == 0) {
- rsignature = "V";
- }
-
- String s = "{\"" +
- jfunc.getName() +
- (isPointerFunc ? "Bounds" : "") +
- "\", \"(" + signature +")" +
- rsignature +
- "\", (void *) " +
- outName +
- " },";
- nativeRegistrations.add(s);
-
- List<Integer> nonPrimitiveArgs = new ArrayList<Integer>();
- List<Integer> stringArgs = new ArrayList<Integer>();
- int numBufferArgs = 0;
- List<String> bufferArgNames = new ArrayList<String>();
-
- // Emit JNI signature (arguments)
- //
- // Example:
- //
- // (JNIEnv *_env, jobject this, jint plane, jfloatArray equation_ref, jint offset) {
- //
- out.print(" (JNIEnv *_env, jobject _this");
- for (int i = 0; i < numArgs; i++) {
- out.print(", ");
- JType argType = jfunc.getArgType(i);
- String suffix;
- if (!argType.isPrimitive()) {
- if (argType.isArray()) {
- suffix = "_ref";
- } else {
- suffix = "_buf";
- }
- nonPrimitiveArgs.add(new Integer(i));
- if (jfunc.getArgType(i).isBuffer()) {
- int cIndex = jfunc.getArgCIndex(i);
- String cname = cfunc.getArgName(cIndex);
- bufferArgNames.add(cname);
- numBufferArgs++;
- }
- } else {
- suffix = "";
- }
- if (argType.isString()) {
- stringArgs.add(new Integer(i));
- }
-
- out.print(getJniType(argType) + " " + jfunc.getArgName(i) + suffix);
- }
- if (isPointerFunc) {
- out.print(", jint remaining");
- }
- out.println(") {");
-
- int numArrays = 0;
- int numBuffers = 0;
- int numStrings = 0;
- for (int i = 0; i < nonPrimitiveArgs.size(); i++) {
- int idx = nonPrimitiveArgs.get(i).intValue();
- JType argType = jfunc.getArgType(idx);
- if (argType.isArray()) {
- ++numArrays;
- }
- if (argType.isBuffer()) {
- ++numBuffers;
- }
- if (argType.isString()) {
- ++numStrings;
- }
- }
-
- // Emit method body
-
- // Emit local variable declarations for _exception and _returnValue
- //
- // Example:
- //
- // android::gl::ogles_context_t *ctx;
- //
- // jint _exception;
- // GLenum _returnValue;
- //
- CType returnType = cfunc.getType();
- boolean isVoid = returnType.isVoid();
-
- boolean isUnsupported = isUnsupportedFunc(cfunc);
- if (isUnsupported) {
- out.println(indent +
- "jniThrowException(_env, \"java/lang/UnsupportedOperationException\",");
- out.println(indent +
- " \"" + cfunc.getName() + "\");");
- if (!isVoid) {
- String retval = getErrorReturnValue(cfunc);
- out.println(indent + "return " + retval + ";");
- }
- out.println("}");
- out.println();
- return;
- }
-
- String requiresExtension = isRequiresFunc(cfunc);
- if (requiresExtension != null) {
- out.println(indent +
- "if (! supportsExtension(_env, _this, have_" + requiresExtension + "ID)) {");
- out.println(indent + indent +
- "jniThrowException(_env, \"java/lang/UnsupportedOperationException\",");
- out.println(indent + indent +
- " \"" + cfunc.getName() + "\");");
- if (isVoid) {
- out.println(indent + indent + " return;");
- } else {
- String retval = getErrorReturnValue(cfunc);
- out.println(indent + indent + " return " + retval + ";");
- }
- out.println(indent + "}");
- }
- if (mUseContextPointer) {
- out.println(indent +
- "android::gl::ogles_context_t *ctx = getContext(_env, _this);");
- }
-
- boolean initializeReturnValue = stringArgs.size() > 0;
-
- boolean emitExceptionCheck = (numArrays > 0 || numBuffers > 0 || numStrings > 0) &&
- hasNonConstArg(jfunc, cfunc, nonPrimitiveArgs);
- // mChecker.getChecks(cfunc.getName()) != null
-
- // Emit an _exeption variable if there will be error checks
- if (emitExceptionCheck) {
- out.println(indent + "jint _exception = 0;");
- }
-
- // Emit a single _array or multiple _XXXArray variables
- if (numBufferArgs == 1) {
- out.println(indent + "jarray _array = (jarray) 0;");
- } else {
- for (int i = 0; i < numBufferArgs; i++) {
- out.println(indent + "jarray _" + bufferArgNames.get(i) +
- "Array = (jarray) 0;");
- }
- }
- if (!isVoid) {
- String retval = getErrorReturnValue(cfunc);
- if (retval != null) {
- out.println(indent + returnType.getDeclaration() +
- " _returnValue = " + retval + ";");
- } else if (initializeReturnValue) {
- out.println(indent + returnType.getDeclaration() +
- " _returnValue = 0;");
- } else {
- out.println(indent + returnType.getDeclaration() +
- " _returnValue;");
- }
- }
-
- // Emit local variable declarations for pointer arguments
- //
- // Example:
- //
- // GLfixed *eqn_base;
- // GLfixed *eqn;
- //
- String offset = "offset";
- String remaining = "_remaining";
- if (nonPrimitiveArgs.size() > 0) {
- for (int i = 0; i < nonPrimitiveArgs.size(); i++) {
- int idx = nonPrimitiveArgs.get(i).intValue();
- int cIndex = jfunc.getArgCIndex(idx);
- String cname = cfunc.getArgName(cIndex);
-
- CType type = cfunc.getArgType(jfunc.getArgCIndex(idx));
- String decl = type.getDeclaration();
- if (jfunc.getArgType(idx).isArray()) {
- out.println(indent +
- decl +
- (decl.endsWith("*") ? "" : " ") +
- jfunc.getArgName(idx) +
- "_base = (" + decl + ") 0;");
- }
- remaining = ((numArrays + numBuffers) <= 1) ? "_remaining" :
- "_" + cname + "Remaining";
- out.println(indent +
- "jint " + remaining + ";");
- out.println(indent +
- decl +
- (decl.endsWith("*") ? "" : " ") +
- jfunc.getArgName(idx) +
- " = (" + decl + ") 0;");
- }
-
- out.println();
- }
-
- // Emit local variable declaration for strings
- if (stringArgs.size() > 0) {
- for (int i = 0; i < stringArgs.size(); i++) {
- int idx = stringArgs.get(i).intValue();
- int cIndex = jfunc.getArgCIndex(idx);
- String cname = cfunc.getArgName(cIndex);
-
- out.println(indent + "const char* _native" + cname + " = 0;");
- }
-
- out.println();
- }
-
- // Null pointer checks and GetStringUTFChars
- if (stringArgs.size() > 0) {
- for (int i = 0; i < stringArgs.size(); i++) {
- int idx = stringArgs.get(i).intValue();
- int cIndex = jfunc.getArgCIndex(idx);
- String cname = cfunc.getArgName(cIndex);
-
- CType type = cfunc.getArgType(jfunc.getArgCIndex(idx));
- String decl = type.getDeclaration();
- out.println(indent + "if (!" + cname + ") {");
- out.println(indent + " jniThrowException(_env, " +
- "\"java/lang/IllegalArgumentException\", \"" + cname + " == null\");");
- out.println(indent + " goto exit;");
- needsExit = true;
- out.println(indent + "}");
-
- out.println(indent + "_native" + cname + " = _env->GetStringUTFChars(" + cname + ", 0);");
- }
-
- out.println();
- }
-
- // Emit 'GetPrimitiveArrayCritical' for arrays
- // Emit 'GetPointer' calls for Buffer pointers
- int bufArgIdx = 0;
- if (nonPrimitiveArgs.size() > 0) {
- for (int i = 0; i < nonPrimitiveArgs.size(); i++) {
- int idx = nonPrimitiveArgs.get(i).intValue();
- int cIndex = jfunc.getArgCIndex(idx);
-
- String cname = cfunc.getArgName(cIndex);
- offset = numArrays <= 1 ? "offset" :
- cname + "Offset";
- remaining = ((numArrays + numBuffers) <= 1) ? "_remaining" :
- "_" + cname + "Remaining";
-
- if (jfunc.getArgType(idx).isArray()) {
- out.println(indent +
- "if (!" +
- cname +
- "_ref) {");
- if (emitExceptionCheck) {
- out.println(indent + indent + "_exception = 1;");
- }
- out.println(indent + " jniThrowException(_env, " +
- "\"java/lang/IllegalArgumentException\", " +
- "\"" + cname + " == null\");");
- out.println(indent + " goto exit;");
- needsExit = true;
- out.println(indent + "}");
-
- out.println(indent + "if (" + offset + " < 0) {");
- if (emitExceptionCheck) {
- out.println(indent + indent + "_exception = 1;");
- }
- out.println(indent + " jniThrowException(_env, " +
- "\"java/lang/IllegalArgumentException\", \"" + offset + " < 0\");");
- out.println(indent + " goto exit;");
- needsExit = true;
- out.println(indent + "}");
-
- out.println(indent + remaining + " = " +
- (mUseCPlusPlus ? "_env" : "(*_env)") +
- "->GetArrayLength(" +
- (mUseCPlusPlus ? "" : "_env, ") +
- cname + "_ref) - " + offset + ";");
-
- emitNativeBoundsChecks(cfunc, cname, out, false,
- emitExceptionCheck,
- offset, remaining, " ");
-
- out.println(indent +
- cname +
- "_base = (" +
- cfunc.getArgType(cIndex).getDeclaration() +
- ")");
- out.println(indent + " " +
- (mUseCPlusPlus ? "_env" : "(*_env)") +
- "->GetPrimitiveArrayCritical(" +
- (mUseCPlusPlus ? "" : "_env, ") +
- jfunc.getArgName(idx) +
- "_ref, (jboolean *)0);");
- out.println(indent +
- cname + " = " + cname + "_base + " + offset +
- ";");
- out.println();
- } else {
- String array = numBufferArgs <= 1 ? "_array" :
- "_" + bufferArgNames.get(bufArgIdx++) + "Array";
-
- boolean nullAllowed = isNullAllowed(cfunc) || isPointerFunc;
- if (nullAllowed) {
- out.println(indent + "if (" + cname + "_buf) {");
- out.print(indent);
- }
-
- if (isPointerFunc) {
- out.println(indent +
- cname +
- " = (" +
- cfunc.getArgType(cIndex).getDeclaration() +
- ") getDirectBufferPointer(_env, " +
- cname + "_buf);");
- String iii = " ";
- out.println(iii + indent + "if ( ! " + cname + " ) {");
- out.println(iii + iii + indent + "return;");
- out.println(iii + indent + "}");
- } else {
- out.println(indent +
- cname +
- " = (" +
- cfunc.getArgType(cIndex).getDeclaration() +
- ")getPointer(_env, " +
- cname +
- "_buf, &" + array + ", &" + remaining +
- ");");
- }
-
- emitNativeBoundsChecks(cfunc, cname, out, true,
- emitExceptionCheck,
- offset, remaining, nullAllowed ? " " : " ");
-
- if (nullAllowed) {
- out.println(indent + "}");
- }
- }
- }
- }
-
- if (!isVoid) {
- out.print(indent + "_returnValue = ");
- } else {
- out.print(indent);
- }
- String name = cfunc.getName();
-
- if (mUseContextPointer) {
- name = name.substring(2, name.length()); // Strip off 'gl' prefix
- name = name.substring(0, 1).toLowerCase() +
- name.substring(1, name.length());
- out.print("ctx->procs.");
- }
-
- out.print(name + (isPointerFunc ? "Bounds" : "") + "(");
-
- numArgs = cfunc.getNumArgs();
- if (numArgs == 0) {
- if (mUseContextPointer) {
- out.println("ctx);");
- } else {
- out.println(");");
- }
- } else {
- if (mUseContextPointer) {
- out.println("ctx,");
- } else {
- out.println();
- }
- for (int i = 0; i < numArgs; i++) {
- String typecast;
- if (i == numArgs - 1 && isVBOPointerFunc) {
- typecast = "const GLvoid *";
- } else {
- typecast = cfunc.getArgType(i).getDeclaration();
- }
- out.print(indent + indent +
- "(" +
- typecast +
- ")");
- if (cfunc.getArgType(i).isConstCharPointer()) {
- out.print("_native");
- }
- out.print(cfunc.getArgName(i));
-
- if (i == numArgs - 1) {
- if (isPointerFunc) {
- out.println(",");
- out.println(indent + indent + "(GLsizei)remaining");
- } else {
- out.println();
- }
- } else {
- out.println(",");
- }
- }
- out.println(indent + ");");
- }
-
- if (needsExit) {
- out.println();
- out.println("exit:");
- needsExit = false;
- }
-
- bufArgIdx = 0;
- if (nonPrimitiveArgs.size() > 0) {
- for (int i = nonPrimitiveArgs.size() - 1; i >= 0; i--) {
- int idx = nonPrimitiveArgs.get(i).intValue();
-
- int cIndex = jfunc.getArgCIndex(idx);
- if (jfunc.getArgType(idx).isArray()) {
-
- // If the argument is 'const', GL will not write to it.
- // In this case, we can use the 'JNI_ABORT' flag to avoid
- // the need to write back to the Java array
- out.println(indent +
- "if (" + jfunc.getArgName(idx) + "_base) {");
- out.println(indent + indent +
- (mUseCPlusPlus ? "_env" : "(*_env)") +
- "->ReleasePrimitiveArrayCritical(" +
- (mUseCPlusPlus ? "" : "_env, ") +
- jfunc.getArgName(idx) + "_ref, " +
- cfunc.getArgName(cIndex) +
- "_base,");
- out.println(indent + indent + indent +
- (cfunc.getArgType(cIndex).isConst() ?
- "JNI_ABORT" :
- "_exception ? JNI_ABORT: 0") +
- ");");
- out.println(indent + "}");
- } else if (jfunc.getArgType(idx).isBuffer()) {
- if (! isPointerFunc) {
- String array = numBufferArgs <= 1 ? "_array" :
- "_" + bufferArgNames.get(bufArgIdx++) + "Array";
- out.println(indent + "if (" + array + ") {");
- out.println(indent + indent +
- "releasePointer(_env, " + array + ", " +
- cfunc.getArgName(cIndex) +
- ", " +
- (cfunc.getArgType(cIndex).isConst() ?
- "JNI_FALSE" : "_exception ? JNI_FALSE :" +
- " JNI_TRUE") +
- ");");
- out.println(indent + "}");
- }
- }
- }
- }
-
- // Emit local variable declaration for strings
- if (stringArgs.size() > 0) {
- for (int i = 0; i < stringArgs.size(); i++) {
- int idx = stringArgs.get(i).intValue();
- int cIndex = jfunc.getArgCIndex(idx);
- String cname = cfunc.getArgName(cIndex);
-
- out.println(indent + "if (_native" + cname + ") {");
- out.println(indent + " _env->ReleaseStringUTFChars(" + cname + ", _native" + cname + ");");
- out.println(indent + "}");
- }
-
- out.println();
- }
-
-
- if (!isVoid) {
- out.println(indent + "return _returnValue;");
- }
-
- out.println("}");
- out.println();
- }
-
-}
diff --git a/opengl/tools/glgen/src/Jsr239CodeEmitter.java b/opengl/tools/glgen/src/Jsr239CodeEmitter.java
deleted file mode 100644
index c10efe3..0000000
--- a/opengl/tools/glgen/src/Jsr239CodeEmitter.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-import java.io.PrintStream;
-
-/**
- * Emits a Java interface and Java & C implementation for a C function.
- *
- * <p> The Java interface will have Buffer and array variants for functions that
- * have a typed pointer argument. The array variant will convert a single "<type> *data"
- * argument to a pair of arguments "<type>[] data, int offset".
- */
-public class Jsr239CodeEmitter extends JniCodeEmitter implements CodeEmitter {
-
- PrintStream mJava10InterfaceStream;
- PrintStream mJava10ExtInterfaceStream;
- PrintStream mJava11InterfaceStream;
- PrintStream mJava11ExtInterfaceStream;
- PrintStream mJava11ExtPackInterfaceStream;
- PrintStream mJavaImplStream;
- PrintStream mCStream;
-
- PrintStream mJavaInterfaceStream;
-
- /**
- * @param java10InterfaceStream the PrintStream to which to emit the Java interface for GL 1.0 functions
- * @param java10ExtInterfaceStream the PrintStream to which to emit the Java interface for GL 1.0 extension functions
- * @param java11InterfaceStream the PrintStream to which to emit the Java interface for GL 1.1 functions
- * @param java11ExtInterfaceStream the PrintStream to which to emit the Java interface for GL 1.1 Extension functions
- * @param java11ExtPackInterfaceStream the PrintStream to which to emit the Java interface for GL 1.1 Extension Pack functions
- * @param javaImplStream the PrintStream to which to emit the Java implementation
- * @param cStream the PrintStream to which to emit the C implementation
- */
- public Jsr239CodeEmitter(String classPathName,
- ParameterChecker checker,
- PrintStream java10InterfaceStream,
- PrintStream java10ExtInterfaceStream,
- PrintStream java11InterfaceStream,
- PrintStream java11ExtInterfaceStream,
- PrintStream java11ExtPackInterfaceStream,
- PrintStream javaImplStream,
- PrintStream cStream,
- boolean useContextPointer) {
- mClassPathName = classPathName;
- mChecker = checker;
- mJava10InterfaceStream = java10InterfaceStream;
- mJava10ExtInterfaceStream = java10ExtInterfaceStream;
- mJava11InterfaceStream = java11InterfaceStream;
- mJava11ExtInterfaceStream = java11ExtInterfaceStream;
- mJava11ExtPackInterfaceStream = java11ExtPackInterfaceStream;
- mJavaImplStream = javaImplStream;
- mCStream = cStream;
- mUseContextPointer = useContextPointer;
- }
-
- public void setVersion(int version, boolean ext, boolean pack) {
- if (version == 0) {
- mJavaInterfaceStream = ext ? mJava10ExtInterfaceStream :
- mJava10InterfaceStream;
- } else if (version == 1) {
- mJavaInterfaceStream = ext ?
- (pack ? mJava11ExtPackInterfaceStream :
- mJava11ExtInterfaceStream) :
- mJava11InterfaceStream;
- } else {
- throw new RuntimeException("Bad version: " + version);
- }
- }
-
- public void emitCode(CFunc cfunc, String original) {
- emitCode(cfunc, original, mJavaInterfaceStream, mJavaImplStream, mCStream);
- }
-
- public void emitNativeRegistration() {
- emitNativeRegistration("register_com_google_android_gles_jni_GLImpl", mCStream);
- }
-}
diff --git a/opengl/tools/glgen/src/ParameterChecker.java b/opengl/tools/glgen/src/ParameterChecker.java
deleted file mode 100644
index bff6d86..0000000
--- a/opengl/tools/glgen/src/ParameterChecker.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2006 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.
- */
-
-import java.io.BufferedReader;
-import java.util.HashMap;
-
-public class ParameterChecker {
-
- HashMap<String,String[]> map = new HashMap<String,String[]>();
-
- public ParameterChecker(BufferedReader reader) throws Exception {
- String s;
- while ((s = reader.readLine()) != null) {
- String[] tokens = s.split("\\s");
- map.put(tokens[0], tokens);
- }
- }
-
- public String[] getChecks(String functionName) {
- String[] checks = map.get(functionName);
- if (checks == null &&
- (functionName.endsWith("fv") ||
- functionName.endsWith("xv") ||
- functionName.endsWith("iv"))) {
- functionName = functionName.substring(0, functionName.length() - 2);
- checks = map.get(functionName);
- }
- return checks;
- }
-}
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10ExtHeader.java-if b/opengl/tools/glgen/stubs/gles11/GLES10ExtHeader.java-if
deleted file mode 100644
index 42891ea..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES10ExtHeader.java-if
+++ /dev/null
@@ -1,26 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-package android.opengl;
-
-public class GLES10Ext {
- native private static void _nativeClassInit();
- static {
- _nativeClassInit();
- }
-
\ No newline at end of file
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp
deleted file mode 100644
index 5d418d7..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-#include "jni.h"
-#include "JNIHelp.h"
-#include <android_runtime/AndroidRuntime.h>
-#include <utils/misc.h>
-
-#include <assert.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-static int initialized = 0;
-
-static jclass nioAccessClass;
-static jclass bufferClass;
-static jmethodID getBasePointerID;
-static jmethodID getBaseArrayID;
-static jmethodID getBaseArrayOffsetID;
-static jfieldID positionID;
-static jfieldID limitID;
-static jfieldID elementSizeShiftID;
-
-/* Cache method IDs each time the class is loaded. */
-
-static void
-nativeClassInit(JNIEnv *_env, jclass glImplClass)
-{
- jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
- nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
-
- jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
- bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
-
- getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
- "getBasePointer", "(Ljava/nio/Buffer;)J");
- getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
- getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
-
- positionID = _env->GetFieldID(bufferClass, "position", "I");
- limitID = _env->GetFieldID(bufferClass, "limit", "I");
- elementSizeShiftID =
- _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
-}
-
-
-static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
-{
- jint position;
- jint limit;
- jint elementSizeShift;
- jlong pointer;
- jint offset;
- void *data;
-
- position = _env->GetIntField(buffer, positionID);
- limit = _env->GetIntField(buffer, limitID);
- elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- *remaining = (limit - position) << elementSizeShift;
- pointer = _env->CallStaticLongMethod(nioAccessClass,
- getBasePointerID, buffer);
- if (pointer != 0L) {
- *array = NULL;
- return (void *) (jint) pointer;
- }
-
- *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
- getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
- getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
-
- return (void *) ((char *) data + offset);
-}
-
-
-static void
-releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
-{
- _env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
-}
-
-// --------------------------------------------------------------------------
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10Header.java-if b/opengl/tools/glgen/stubs/gles11/GLES10Header.java-if
deleted file mode 100644
index 4b2a831..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES10Header.java-if
+++ /dev/null
@@ -1,271 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-package android.opengl;
-
-import java.nio.Buffer;
-
-public class GLES10 {
- public static final int GL_ADD = 0x0104;
- public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
- public static final int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
- public static final int GL_ALPHA = 0x1906;
- public static final int GL_ALPHA_BITS = 0x0D55;
- public static final int GL_ALPHA_TEST = 0x0BC0;
- public static final int GL_ALWAYS = 0x0207;
- public static final int GL_AMBIENT = 0x1200;
- public static final int GL_AMBIENT_AND_DIFFUSE = 0x1602;
- public static final int GL_AND = 0x1501;
- public static final int GL_AND_INVERTED = 0x1504;
- public static final int GL_AND_REVERSE = 0x1502;
- public static final int GL_BACK = 0x0405;
- public static final int GL_BLEND = 0x0BE2;
- public static final int GL_BLUE_BITS = 0x0D54;
- public static final int GL_BYTE = 0x1400;
- public static final int GL_CCW = 0x0901;
- public static final int GL_CLAMP_TO_EDGE = 0x812F;
- public static final int GL_CLEAR = 0x1500;
- public static final int GL_COLOR_ARRAY = 0x8076;
- public static final int GL_COLOR_BUFFER_BIT = 0x4000;
- public static final int GL_COLOR_LOGIC_OP = 0x0BF2;
- public static final int GL_COLOR_MATERIAL = 0x0B57;
- public static final int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
- public static final int GL_CONSTANT_ATTENUATION = 0x1207;
- public static final int GL_COPY = 0x1503;
- public static final int GL_COPY_INVERTED = 0x150C;
- public static final int GL_CULL_FACE = 0x0B44;
- public static final int GL_CW = 0x0900;
- public static final int GL_DECAL = 0x2101;
- public static final int GL_DECR = 0x1E03;
- public static final int GL_DEPTH_BITS = 0x0D56;
- public static final int GL_DEPTH_BUFFER_BIT = 0x0100;
- public static final int GL_DEPTH_TEST = 0x0B71;
- public static final int GL_DIFFUSE = 0x1201;
- public static final int GL_DITHER = 0x0BD0;
- public static final int GL_DONT_CARE = 0x1100;
- public static final int GL_DST_ALPHA = 0x0304;
- public static final int GL_DST_COLOR = 0x0306;
- public static final int GL_EMISSION = 0x1600;
- public static final int GL_EQUAL = 0x0202;
- public static final int GL_EQUIV = 0x1509;
- public static final int GL_EXP = 0x0800;
- public static final int GL_EXP2 = 0x0801;
- public static final int GL_EXTENSIONS = 0x1F03;
- public static final int GL_FALSE = 0;
- public static final int GL_FASTEST = 0x1101;
- public static final int GL_FIXED = 0x140C;
- public static final int GL_FLAT = 0x1D00;
- public static final int GL_FLOAT = 0x1406;
- public static final int GL_FOG = 0x0B60;
- public static final int GL_FOG_COLOR = 0x0B66;
- public static final int GL_FOG_DENSITY = 0x0B62;
- public static final int GL_FOG_END = 0x0B64;
- public static final int GL_FOG_HINT = 0x0C54;
- public static final int GL_FOG_MODE = 0x0B65;
- public static final int GL_FOG_START = 0x0B63;
- public static final int GL_FRONT = 0x0404;
- public static final int GL_FRONT_AND_BACK = 0x0408;
- public static final int GL_GEQUAL = 0x0206;
- public static final int GL_GREATER = 0x0204;
- public static final int GL_GREEN_BITS = 0x0D53;
- public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B;
- public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A;
- public static final int GL_INCR = 0x1E02;
- public static final int GL_INVALID_ENUM = 0x0500;
- public static final int GL_INVALID_OPERATION = 0x0502;
- public static final int GL_INVALID_VALUE = 0x0501;
- public static final int GL_INVERT = 0x150A;
- public static final int GL_KEEP = 0x1E00;
- public static final int GL_LEQUAL = 0x0203;
- public static final int GL_LESS = 0x0201;
- public static final int GL_LIGHT_MODEL_AMBIENT = 0x0B53;
- public static final int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52;
- public static final int GL_LIGHT0 = 0x4000;
- public static final int GL_LIGHT1 = 0x4001;
- public static final int GL_LIGHT2 = 0x4002;
- public static final int GL_LIGHT3 = 0x4003;
- public static final int GL_LIGHT4 = 0x4004;
- public static final int GL_LIGHT5 = 0x4005;
- public static final int GL_LIGHT6 = 0x4006;
- public static final int GL_LIGHT7 = 0x4007;
- public static final int GL_LIGHTING = 0x0B50;
- public static final int GL_LINE_LOOP = 0x0002;
- public static final int GL_LINE_SMOOTH = 0x0B20;
- public static final int GL_LINE_SMOOTH_HINT = 0x0C52;
- public static final int GL_LINE_STRIP = 0x0003;
- public static final int GL_LINEAR = 0x2601;
- public static final int GL_LINEAR_ATTENUATION = 0x1208;
- public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
- public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
- public static final int GL_LINES = 0x0001;
- public static final int GL_LUMINANCE = 0x1909;
- public static final int GL_LUMINANCE_ALPHA = 0x190A;
- public static final int GL_MAX_ELEMENTS_INDICES = 0x80E9;
- public static final int GL_MAX_ELEMENTS_VERTICES = 0x80E8;
- public static final int GL_MAX_LIGHTS = 0x0D31;
- public static final int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36;
- public static final int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38;
- public static final int GL_MAX_TEXTURE_SIZE = 0x0D33;
- public static final int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39;
- public static final int GL_MAX_TEXTURE_UNITS = 0x84E2;
- public static final int GL_MAX_VIEWPORT_DIMS = 0x0D3A;
- public static final int GL_MODELVIEW = 0x1700;
- public static final int GL_MODULATE = 0x2100;
- public static final int GL_MULTISAMPLE = 0x809D;
- public static final int GL_NAND = 0x150E;
- public static final int GL_NEAREST = 0x2600;
- public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
- public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
- public static final int GL_NEVER = 0x0200;
- public static final int GL_NICEST = 0x1102;
- public static final int GL_NO_ERROR = 0;
- public static final int GL_NOOP = 0x1505;
- public static final int GL_NOR = 0x1508;
- public static final int GL_NORMAL_ARRAY = 0x8075;
- public static final int GL_NORMALIZE = 0x0BA1;
- public static final int GL_NOTEQUAL = 0x0205;
- public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
- public static final int GL_ONE = 1;
- public static final int GL_ONE_MINUS_DST_ALPHA = 0x0305;
- public static final int GL_ONE_MINUS_DST_COLOR = 0x0307;
- public static final int GL_ONE_MINUS_SRC_ALPHA = 0x0303;
- public static final int GL_ONE_MINUS_SRC_COLOR = 0x0301;
- public static final int GL_OR = 0x1507;
- public static final int GL_OR_INVERTED = 0x150D;
- public static final int GL_OR_REVERSE = 0x150B;
- public static final int GL_OUT_OF_MEMORY = 0x0505;
- public static final int GL_PACK_ALIGNMENT = 0x0D05;
- public static final int GL_PALETTE4_R5_G6_B5_OES = 0x8B92;
- public static final int GL_PALETTE4_RGB5_A1_OES = 0x8B94;
- public static final int GL_PALETTE4_RGB8_OES = 0x8B90;
- public static final int GL_PALETTE4_RGBA4_OES = 0x8B93;
- public static final int GL_PALETTE4_RGBA8_OES = 0x8B91;
- public static final int GL_PALETTE8_R5_G6_B5_OES = 0x8B97;
- public static final int GL_PALETTE8_RGB5_A1_OES = 0x8B99;
- public static final int GL_PALETTE8_RGB8_OES = 0x8B95;
- public static final int GL_PALETTE8_RGBA4_OES = 0x8B98;
- public static final int GL_PALETTE8_RGBA8_OES = 0x8B96;
- public static final int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50;
- public static final int GL_POINT_SMOOTH = 0x0B10;
- public static final int GL_POINT_SMOOTH_HINT = 0x0C51;
- public static final int GL_POINTS = 0x0000;
- public static final int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
- public static final int GL_POINT_SIZE = 0x0B11;
- public static final int GL_POLYGON_OFFSET_FILL = 0x8037;
- public static final int GL_POLYGON_SMOOTH_HINT = 0x0C53;
- public static final int GL_POSITION = 0x1203;
- public static final int GL_PROJECTION = 0x1701;
- public static final int GL_QUADRATIC_ATTENUATION = 0x1209;
- public static final int GL_RED_BITS = 0x0D52;
- public static final int GL_RENDERER = 0x1F01;
- public static final int GL_REPEAT = 0x2901;
- public static final int GL_REPLACE = 0x1E01;
- public static final int GL_RESCALE_NORMAL = 0x803A;
- public static final int GL_RGB = 0x1907;
- public static final int GL_RGBA = 0x1908;
- public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
- public static final int GL_SAMPLE_ALPHA_TO_ONE = 0x809F;
- public static final int GL_SAMPLE_COVERAGE = 0x80A0;
- public static final int GL_SCISSOR_TEST = 0x0C11;
- public static final int GL_SET = 0x150F;
- public static final int GL_SHININESS = 0x1601;
- public static final int GL_SHORT = 0x1402;
- public static final int GL_SMOOTH = 0x1D01;
- public static final int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22;
- public static final int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12;
- public static final int GL_SPECULAR = 0x1202;
- public static final int GL_SPOT_CUTOFF = 0x1206;
- public static final int GL_SPOT_DIRECTION = 0x1204;
- public static final int GL_SPOT_EXPONENT = 0x1205;
- public static final int GL_SRC_ALPHA = 0x0302;
- public static final int GL_SRC_ALPHA_SATURATE = 0x0308;
- public static final int GL_SRC_COLOR = 0x0300;
- public static final int GL_STACK_OVERFLOW = 0x0503;
- public static final int GL_STACK_UNDERFLOW = 0x0504;
- public static final int GL_STENCIL_BITS = 0x0D57;
- public static final int GL_STENCIL_BUFFER_BIT = 0x0400;
- public static final int GL_STENCIL_TEST = 0x0B90;
- public static final int GL_SUBPIXEL_BITS = 0x0D50;
- public static final int GL_TEXTURE = 0x1702;
- public static final int GL_TEXTURE_2D = 0x0DE1;
- public static final int GL_TEXTURE_COORD_ARRAY = 0x8078;
- public static final int GL_TEXTURE_ENV = 0x2300;
- public static final int GL_TEXTURE_ENV_COLOR = 0x2201;
- public static final int GL_TEXTURE_ENV_MODE = 0x2200;
- public static final int GL_TEXTURE_MAG_FILTER = 0x2800;
- public static final int GL_TEXTURE_MIN_FILTER = 0x2801;
- public static final int GL_TEXTURE_WRAP_S = 0x2802;
- public static final int GL_TEXTURE_WRAP_T = 0x2803;
- public static final int GL_TEXTURE0 = 0x84C0;
- public static final int GL_TEXTURE1 = 0x84C1;
- public static final int GL_TEXTURE2 = 0x84C2;
- public static final int GL_TEXTURE3 = 0x84C3;
- public static final int GL_TEXTURE4 = 0x84C4;
- public static final int GL_TEXTURE5 = 0x84C5;
- public static final int GL_TEXTURE6 = 0x84C6;
- public static final int GL_TEXTURE7 = 0x84C7;
- public static final int GL_TEXTURE8 = 0x84C8;
- public static final int GL_TEXTURE9 = 0x84C9;
- public static final int GL_TEXTURE10 = 0x84CA;
- public static final int GL_TEXTURE11 = 0x84CB;
- public static final int GL_TEXTURE12 = 0x84CC;
- public static final int GL_TEXTURE13 = 0x84CD;
- public static final int GL_TEXTURE14 = 0x84CE;
- public static final int GL_TEXTURE15 = 0x84CF;
- public static final int GL_TEXTURE16 = 0x84D0;
- public static final int GL_TEXTURE17 = 0x84D1;
- public static final int GL_TEXTURE18 = 0x84D2;
- public static final int GL_TEXTURE19 = 0x84D3;
- public static final int GL_TEXTURE20 = 0x84D4;
- public static final int GL_TEXTURE21 = 0x84D5;
- public static final int GL_TEXTURE22 = 0x84D6;
- public static final int GL_TEXTURE23 = 0x84D7;
- public static final int GL_TEXTURE24 = 0x84D8;
- public static final int GL_TEXTURE25 = 0x84D9;
- public static final int GL_TEXTURE26 = 0x84DA;
- public static final int GL_TEXTURE27 = 0x84DB;
- public static final int GL_TEXTURE28 = 0x84DC;
- public static final int GL_TEXTURE29 = 0x84DD;
- public static final int GL_TEXTURE30 = 0x84DE;
- public static final int GL_TEXTURE31 = 0x84DF;
- public static final int GL_TRIANGLE_FAN = 0x0006;
- public static final int GL_TRIANGLE_STRIP = 0x0005;
- public static final int GL_TRIANGLES = 0x0004;
- public static final int GL_TRUE = 1;
- public static final int GL_UNPACK_ALIGNMENT = 0x0CF5;
- public static final int GL_UNSIGNED_BYTE = 0x1401;
- public static final int GL_UNSIGNED_SHORT = 0x1403;
- public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
- public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
- public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
- public static final int GL_VENDOR = 0x1F00;
- public static final int GL_VERSION = 0x1F02;
- public static final int GL_VERTEX_ARRAY = 0x8074;
- public static final int GL_XOR = 0x1506;
- public static final int GL_ZERO = 0;
-
- native private static void _nativeClassInit();
- static {
- _nativeClassInit();
- }
-
- private static Buffer _colorPointer;
- private static Buffer _normalPointer;
- private static Buffer _texCoordPointer;
- private static Buffer _vertexPointer;
-
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
deleted file mode 100644
index 35a3c33..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-#include "jni.h"
-#include "JNIHelp.h"
-#include <android_runtime/AndroidRuntime.h>
-#include <utils/misc.h>
-
-#include <assert.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-/* special calls implemented in Android's GLES wrapper used to more
- * efficiently bound-check passed arrays */
-extern "C" {
-GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
- const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-}
-
-static int initialized = 0;
-
-static jclass nioAccessClass;
-static jclass bufferClass;
-static jmethodID getBasePointerID;
-static jmethodID getBaseArrayID;
-static jmethodID getBaseArrayOffsetID;
-static jfieldID positionID;
-static jfieldID limitID;
-static jfieldID elementSizeShiftID;
-
-/* Cache method IDs each time the class is loaded. */
-
-static void
-nativeClassInit(JNIEnv *_env, jclass glImplClass)
-{
- jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
- nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
-
- jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
- bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
-
- getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
- "getBasePointer", "(Ljava/nio/Buffer;)J");
- getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
- getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
-
- positionID = _env->GetFieldID(bufferClass, "position", "I");
- limitID = _env->GetFieldID(bufferClass, "limit", "I");
- elementSizeShiftID =
- _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
-}
-
-static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
-{
- jint position;
- jint limit;
- jint elementSizeShift;
- jlong pointer;
- jint offset;
- void *data;
-
- position = _env->GetIntField(buffer, positionID);
- limit = _env->GetIntField(buffer, limitID);
- elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- *remaining = (limit - position) << elementSizeShift;
- pointer = _env->CallStaticLongMethod(nioAccessClass,
- getBasePointerID, buffer);
- if (pointer != 0L) {
- *array = NULL;
- return (void *) (jint) pointer;
- }
-
- *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
- getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
- getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
-
- return (void *) ((char *) data + offset);
-}
-
-static void
-releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
-{
- _env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
-}
-
-static void *
-getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
- char* buf = (char*) _env->GetDirectBufferAddress(buffer);
- if (buf) {
- jint position = _env->GetIntField(buffer, positionID);
- jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- buf += position << elementSizeShift;
- } else {
- jniThrowException(_env, "java/lang/IllegalArgumentException",
- "Must use a native order direct Buffer");
- }
- return (void*) buf;
-}
-
-static int
-getNumCompressedTextureFormats() {
- int numCompressedTextureFormats = 0;
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
- return numCompressedTextureFormats;
-}
-
-// --------------------------------------------------------------------------
diff --git a/opengl/tools/glgen/stubs/gles11/GLES11ExtHeader.java-if b/opengl/tools/glgen/stubs/gles11/GLES11ExtHeader.java-if
deleted file mode 100644
index 0c5fa04..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES11ExtHeader.java-if
+++ /dev/null
@@ -1,142 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-package android.opengl;
-
-import java.nio.Buffer;
-
-public class GLES11Ext {
- public static final int GL_BLEND_EQUATION_RGB_OES = 0x8009;
- public static final int GL_BLEND_EQUATION_ALPHA_OES = 0x883D;
- public static final int GL_BLEND_DST_RGB_OES = 0x80C8;
- public static final int GL_BLEND_SRC_RGB_OES = 0x80C9;
- public static final int GL_BLEND_DST_ALPHA_OES = 0x80CA;
- public static final int GL_BLEND_SRC_ALPHA_OES = 0x80CB;
- public static final int GL_BLEND_EQUATION_OES = 0x8009;
- public static final int GL_FUNC_ADD_OES = 0x8006;
- public static final int GL_FUNC_SUBTRACT_OES = 0x800A;
- public static final int GL_FUNC_REVERSE_SUBTRACT_OES = 0x800B;
- public static final int GL_ETC1_RGB8_OES = 0x8D64;
- public static final int GL_DEPTH_COMPONENT24_OES = 0x81A6;
- public static final int GL_DEPTH_COMPONENT32_OES = 0x81A7;
- public static final int GL_TEXTURE_CROP_RECT_OES = 0x8B9D;
- public static final int GL_FIXED_OES = 0x140C;
- public static final int GL_NONE_OES = 0;
- public static final int GL_FRAMEBUFFER_OES = 0x8D40;
- public static final int GL_RENDERBUFFER_OES = 0x8D41;
- public static final int GL_RGBA4_OES = 0x8056;
- public static final int GL_RGB5_A1_OES = 0x8057;
- public static final int GL_RGB565_OES = 0x8D62;
- public static final int GL_DEPTH_COMPONENT16_OES = 0x81A5;
- public static final int GL_RENDERBUFFER_WIDTH_OES = 0x8D42;
- public static final int GL_RENDERBUFFER_HEIGHT_OES = 0x8D43;
- public static final int GL_RENDERBUFFER_INTERNAL_FORMAT_OES = 0x8D44;
- public static final int GL_RENDERBUFFER_RED_SIZE_OES = 0x8D50;
- public static final int GL_RENDERBUFFER_GREEN_SIZE_OES = 0x8D51;
- public static final int GL_RENDERBUFFER_BLUE_SIZE_OES = 0x8D52;
- public static final int GL_RENDERBUFFER_ALPHA_SIZE_OES = 0x8D53;
- public static final int GL_RENDERBUFFER_DEPTH_SIZE_OES = 0x8D54;
- public static final int GL_RENDERBUFFER_STENCIL_SIZE_OES = 0x8D55;
- public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES = 0x8CD0;
- public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES = 0x8CD1;
- public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES = 0x8CD2;
- public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES = 0x8CD3;
- public static final int GL_COLOR_ATTACHMENT0_OES = 0x8CE0;
- public static final int GL_DEPTH_ATTACHMENT_OES = 0x8D00;
- public static final int GL_STENCIL_ATTACHMENT_OES = 0x8D20;
- public static final int GL_FRAMEBUFFER_COMPLETE_OES = 0x8CD5;
- public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES = 0x8CD6;
- public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES = 0x8CD7;
- public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES = 0x8CD9;
- public static final int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES = 0x8CDA;
- public static final int GL_FRAMEBUFFER_UNSUPPORTED_OES = 0x8CDD;
- public static final int GL_FRAMEBUFFER_BINDING_OES = 0x8CA6;
- public static final int GL_RENDERBUFFER_BINDING_OES = 0x8CA7;
- public static final int GL_MAX_RENDERBUFFER_SIZE_OES = 0x84E8;
- public static final int GL_INVALID_FRAMEBUFFER_OPERATION_OES = 0x0506;
- public static final int GL_WRITE_ONLY_OES = 0x88B9;
- public static final int GL_BUFFER_ACCESS_OES = 0x88BB;
- public static final int GL_BUFFER_MAPPED_OES = 0x88BC;
- public static final int GL_BUFFER_MAP_POINTER_OES = 0x88BD;
- public static final int GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898D;
- public static final int GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898E;
- public static final int GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898F;
- public static final int GL_MAX_VERTEX_UNITS_OES = 0x86A4;
- public static final int GL_MAX_PALETTE_MATRICES_OES = 0x8842;
- public static final int GL_MATRIX_PALETTE_OES = 0x8840;
- public static final int GL_MATRIX_INDEX_ARRAY_OES = 0x8844;
- public static final int GL_WEIGHT_ARRAY_OES = 0x86AD;
- public static final int GL_CURRENT_PALETTE_MATRIX_OES = 0x8843;
- public static final int GL_MATRIX_INDEX_ARRAY_SIZE_OES = 0x8846;
- public static final int GL_MATRIX_INDEX_ARRAY_TYPE_OES = 0x8847;
- public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_OES = 0x8848;
- public static final int GL_MATRIX_INDEX_ARRAY_POINTER_OES = 0x8849;
- public static final int GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES = 0x8B9E;
- public static final int GL_WEIGHT_ARRAY_SIZE_OES = 0x86AB;
- public static final int GL_WEIGHT_ARRAY_TYPE_OES = 0x86A9;
- public static final int GL_WEIGHT_ARRAY_STRIDE_OES = 0x86AA;
- public static final int GL_WEIGHT_ARRAY_POINTER_OES = 0x86AC;
- public static final int GL_WEIGHT_ARRAY_BUFFER_BINDING_OES = 0x889E;
- public static final int GL_DEPTH_STENCIL_OES = 0x84F9;
- public static final int GL_UNSIGNED_INT_24_8_OES = 0x84FA;
- public static final int GL_DEPTH24_STENCIL8_OES = 0x88F0;
- public static final int GL_RGB8_OES = 0x8051;
- public static final int GL_RGBA8_OES = 0x8058;
- public static final int GL_STENCIL_INDEX1_OES = 0x8D46;
- public static final int GL_STENCIL_INDEX4_OES = 0x8D47;
- public static final int GL_STENCIL_INDEX8_OES = 0x8D48;
- public static final int GL_INCR_WRAP_OES = 0x8507;
- public static final int GL_DECR_WRAP_OES = 0x8508;
- public static final int GL_NORMAL_MAP_OES = 0x8511;
- public static final int GL_REFLECTION_MAP_OES = 0x8512;
- public static final int GL_TEXTURE_CUBE_MAP_OES = 0x8513;
- public static final int GL_TEXTURE_BINDING_CUBE_MAP_OES = 0x8514;
- public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES = 0x8515;
- public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES = 0x8516;
- public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES = 0x8517;
- public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES = 0x8518;
- public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES = 0x8519;
- public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES = 0x851A;
- public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES = 0x851C;
- public static final int GL_TEXTURE_GEN_MODE_OES = 0x2500;
- public static final int GL_TEXTURE_GEN_STR_OES = 0x8D60;
- public static final int GL_MIRRORED_REPEAT_OES = 0x8370;
- public static final int GL_3DC_X_AMD = 0x87F9;
- public static final int GL_3DC_XY_AMD = 0x87FA;
- public static final int GL_ATC_RGB_AMD = 0x8C92;
- public static final int GL_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93;
- public static final int GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE;
- public static final int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
- public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
- public static final int GL_BGRA = 0x80E1;
- public static final int GL_TEXTURE_EXTERNAL_OES = 0x8D65;
- public static final int GL_SAMPLER_EXTERNAL_OES = 0x8D66;
- public static final int GL_TEXTURE_BINDING_EXTERNAL_OES = 0x8D67;
- public static final int GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES = 0x8D68;
-
- native private static void _nativeClassInit();
- static {
- _nativeClassInit();
- }
-
- private static final int GL_BYTE = GLES10.GL_BYTE;
- private static final int GL_FIXED = GLES10.GL_FIXED;
- private static final int GL_FLOAT = GLES10.GL_FLOAT;
- private static final int GL_SHORT = GLES10.GL_SHORT;
-
- private static Buffer _matrixIndexPointerOES;
diff --git a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp
deleted file mode 100644
index 9b29a44..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-#include "jni.h"
-#include "JNIHelp.h"
-#include <android_runtime/AndroidRuntime.h>
-#include <utils/misc.h>
-
-#include <assert.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-/* special calls implemented in Android's GLES wrapper used to more
- * efficiently bound-check passed arrays */
-extern "C" {
-GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-}
-
-static int initialized = 0;
-
-static jclass nioAccessClass;
-static jclass bufferClass;
-static jmethodID getBasePointerID;
-static jmethodID getBaseArrayID;
-static jmethodID getBaseArrayOffsetID;
-static jfieldID positionID;
-static jfieldID limitID;
-static jfieldID elementSizeShiftID;
-
-/* Cache method IDs each time the class is loaded. */
-
-static void
-nativeClassInit(JNIEnv *_env, jclass glImplClass)
-{
- jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
- nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
-
- jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
- bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
-
- getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
- "getBasePointer", "(Ljava/nio/Buffer;)J");
- getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
- getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
-
- positionID = _env->GetFieldID(bufferClass, "position", "I");
- limitID = _env->GetFieldID(bufferClass, "limit", "I");
- elementSizeShiftID =
- _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
-}
-
-
-static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
-{
- jint position;
- jint limit;
- jint elementSizeShift;
- jlong pointer;
- jint offset;
- void *data;
-
- position = _env->GetIntField(buffer, positionID);
- limit = _env->GetIntField(buffer, limitID);
- elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- *remaining = (limit - position) << elementSizeShift;
- pointer = _env->CallStaticLongMethod(nioAccessClass,
- getBasePointerID, buffer);
- if (pointer != 0L) {
- *array = NULL;
- return (void *) (jint) pointer;
- }
-
- *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
- getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
- getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
-
- return (void *) ((char *) data + offset);
-}
-
-
-static void
-releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
-{
- _env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
-}
-
-static void *
-getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
- char* buf = (char*) _env->GetDirectBufferAddress(buffer);
- if (buf) {
- jint position = _env->GetIntField(buffer, positionID);
- jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- buf += position << elementSizeShift;
- } else {
- jniThrowException(_env, "java/lang/IllegalArgumentException",
- "Must use a native order direct Buffer");
- }
- return (void*) buf;
-}
-// --------------------------------------------------------------------------
diff --git a/opengl/tools/glgen/stubs/gles11/GLES11Header.java-if b/opengl/tools/glgen/stubs/gles11/GLES11Header.java-if
deleted file mode 100644
index 81572d2..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES11Header.java-if
+++ /dev/null
@@ -1,152 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-package android.opengl;
-
-import java.nio.Buffer;
-
-public class GLES11 extends GLES10 {
- public static final int GL_ACTIVE_TEXTURE = 0x84E0;
- public static final int GL_ADD_SIGNED = 0x8574;
- public static final int GL_ALPHA_SCALE = 0x0D1C;
- public static final int GL_ALPHA_TEST_FUNC = 0x0BC1;
- public static final int GL_ALPHA_TEST_REF = 0x0BC2;
- public static final int GL_ARRAY_BUFFER = 0x8892;
- public static final int GL_ARRAY_BUFFER_BINDING = 0x8894;
- public static final int GL_BLEND_DST = 0x0BE0;
- public static final int GL_BLEND_SRC = 0x0BE1;
- public static final int GL_BUFFER_ACCESS = 0x88BB;
- public static final int GL_BUFFER_SIZE = 0x8764;
- public static final int GL_BUFFER_USAGE = 0x8765;
- public static final int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1;
- public static final int GL_CLIP_PLANE0 = 0x3000;
- public static final int GL_CLIP_PLANE1 = 0x3001;
- public static final int GL_CLIP_PLANE2 = 0x3002;
- public static final int GL_CLIP_PLANE3 = 0x3003;
- public static final int GL_CLIP_PLANE4 = 0x3004;
- public static final int GL_CLIP_PLANE5 = 0x3005;
- public static final int GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898;
- public static final int GL_COLOR_ARRAY_POINTER = 0x8090;
- public static final int GL_COLOR_ARRAY_SIZE = 0x8081;
- public static final int GL_COLOR_ARRAY_STRIDE = 0x8083;
- public static final int GL_COLOR_ARRAY_TYPE = 0x8082;
- public static final int GL_COLOR_CLEAR_VALUE = 0x0C22;
- public static final int GL_COLOR_WRITEMASK = 0x0C23;
- public static final int GL_COMBINE = 0x8570;
- public static final int GL_COMBINE_ALPHA = 0x8572;
- public static final int GL_COMBINE_RGB = 0x8571;
- public static final int GL_CONSTANT = 0x8576;
- public static final int GL_COORD_REPLACE_OES = 0x8862;
- public static final int GL_CULL_FACE_MODE = 0x0B45;
- public static final int GL_CURRENT_COLOR = 0x0B00;
- public static final int GL_CURRENT_NORMAL = 0x0B02;
- public static final int GL_CURRENT_TEXTURE_COORDS = 0x0B03;
- public static final int GL_DEPTH_CLEAR_VALUE = 0x0B73;
- public static final int GL_DEPTH_FUNC = 0x0B74;
- public static final int GL_DEPTH_RANGE = 0x0B70;
- public static final int GL_DEPTH_WRITEMASK = 0x0B72;
- public static final int GL_DOT3_RGB = 0x86AE;
- public static final int GL_DOT3_RGBA = 0x86AF;
- public static final int GL_DYNAMIC_DRAW = 0x88E8;
- public static final int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
- public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
- public static final int GL_FRONT_FACE = 0x0B46;
- public static final int GL_GENERATE_MIPMAP = 0x8191;
- public static final int GL_GENERATE_MIPMAP_HINT = 0x8192;
- public static final int GL_INTERPOLATE = 0x8575;
- public static final int GL_LINE_WIDTH = 0x0B21;
- public static final int GL_LOGIC_OP_MODE = 0x0BF0;
- public static final int GL_MATRIX_MODE = 0x0BA0;
- public static final int GL_MAX_CLIP_PLANES = 0x0D32;
- public static final int GL_MODELVIEW_MATRIX = 0x0BA6;
- public static final int GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898D;
- public static final int GL_MODELVIEW_STACK_DEPTH = 0x0BA3;
- public static final int GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897;
- public static final int GL_NORMAL_ARRAY_POINTER = 0x808F;
- public static final int GL_NORMAL_ARRAY_STRIDE = 0x807F;
- public static final int GL_NORMAL_ARRAY_TYPE = 0x807E;
- public static final int GL_OPERAND0_ALPHA = 0x8598;
- public static final int GL_OPERAND0_RGB = 0x8590;
- public static final int GL_OPERAND1_ALPHA = 0x8599;
- public static final int GL_OPERAND1_RGB = 0x8591;
- public static final int GL_OPERAND2_ALPHA = 0x859A;
- public static final int GL_OPERAND2_RGB = 0x8592;
- public static final int GL_POINT_DISTANCE_ATTENUATION = 0x8129;
- public static final int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
- public static final int GL_POINT_SIZE = 0x0B11;
- public static final int GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES = 0x8B9F;
- public static final int GL_POINT_SIZE_ARRAY_OES = 0x8B9C;
- public static final int GL_POINT_SIZE_ARRAY_POINTER_OES = 0x898C;
- public static final int GL_POINT_SIZE_ARRAY_STRIDE_OES = 0x898B;
- public static final int GL_POINT_SIZE_ARRAY_TYPE_OES = 0x898A;
- public static final int GL_POINT_SIZE_MAX = 0x8127;
- public static final int GL_POINT_SIZE_MIN = 0x8126;
- public static final int GL_POINT_SPRITE_OES = 0x8861;
- public static final int GL_POLYGON_OFFSET_FACTOR = 0x8038;
- public static final int GL_POLYGON_OFFSET_UNITS = 0x2A00;
- public static final int GL_PREVIOUS = 0x8578;
- public static final int GL_PRIMARY_COLOR = 0x8577;
- public static final int GL_PROJECTION_MATRIX = 0x0BA7;
- public static final int GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898E;
- public static final int GL_PROJECTION_STACK_DEPTH = 0x0BA4;
- public static final int GL_RGB_SCALE = 0x8573;
- public static final int GL_SAMPLE_BUFFERS = 0x80A8;
- public static final int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
- public static final int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
- public static final int GL_SAMPLES = 0x80A9;
- public static final int GL_SCISSOR_BOX = 0x0C10;
- public static final int GL_SHADE_MODEL = 0x0B54;
- public static final int GL_SRC0_ALPHA = 0x8588;
- public static final int GL_SRC0_RGB = 0x8580;
- public static final int GL_SRC1_ALPHA = 0x8589;
- public static final int GL_SRC1_RGB = 0x8581;
- public static final int GL_SRC2_ALPHA = 0x858A;
- public static final int GL_SRC2_RGB = 0x8582;
- public static final int GL_STATIC_DRAW = 0x88E4;
- public static final int GL_STENCIL_CLEAR_VALUE = 0x0B91;
- public static final int GL_STENCIL_FAIL = 0x0B94;
- public static final int GL_STENCIL_FUNC = 0x0B92;
- public static final int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
- public static final int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
- public static final int GL_STENCIL_REF = 0x0B97;
- public static final int GL_STENCIL_VALUE_MASK = 0x0B93;
- public static final int GL_STENCIL_WRITEMASK = 0x0B98;
- public static final int GL_SUBTRACT = 0x84E7;
- public static final int GL_TEXTURE_BINDING_2D = 0x8069;
- public static final int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A;
- public static final int GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092;
- public static final int GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088;
- public static final int GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A;
- public static final int GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089;
- public static final int GL_TEXTURE_MATRIX = 0x0BA8;
- public static final int GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898F;
- public static final int GL_TEXTURE_STACK_DEPTH = 0x0BA5;
- public static final int GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896;
- public static final int GL_VERTEX_ARRAY_POINTER = 0x808E;
- public static final int GL_VERTEX_ARRAY_SIZE = 0x807A;
- public static final int GL_VERTEX_ARRAY_STRIDE = 0x807C;
- public static final int GL_VERTEX_ARRAY_TYPE = 0x807B;
- public static final int GL_VIEWPORT = 0x0BA2;
- public static final int GL_WRITE_ONLY = 0x88B9;
-
- native private static void _nativeClassInit();
- static {
- _nativeClassInit();
- }
-
- private static Buffer _pointSizePointerOES;
diff --git a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp
deleted file mode 100644
index 823079f..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-#include "jni.h"
-#include "JNIHelp.h"
-#include <android_runtime/AndroidRuntime.h>
-#include <utils/misc.h>
-
-#include <assert.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-/* special calls implemented in Android's GLES wrapper used to more
- * efficiently bound-check passed arrays */
-extern "C" {
-GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-}
-
-static int initialized = 0;
-
-static jclass nioAccessClass;
-static jclass bufferClass;
-static jmethodID getBasePointerID;
-static jmethodID getBaseArrayID;
-static jmethodID getBaseArrayOffsetID;
-static jfieldID positionID;
-static jfieldID limitID;
-static jfieldID elementSizeShiftID;
-
-/* Cache method IDs each time the class is loaded. */
-
-static void
-nativeClassInit(JNIEnv *_env, jclass glImplClass)
-{
- jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
- nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
-
- jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
- bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
-
- getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
- "getBasePointer", "(Ljava/nio/Buffer;)J");
- getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
- getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
-
- positionID = _env->GetFieldID(bufferClass, "position", "I");
- limitID = _env->GetFieldID(bufferClass, "limit", "I");
- elementSizeShiftID =
- _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
-}
-
-
-static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
-{
- jint position;
- jint limit;
- jint elementSizeShift;
- jlong pointer;
- jint offset;
- void *data;
-
- position = _env->GetIntField(buffer, positionID);
- limit = _env->GetIntField(buffer, limitID);
- elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- *remaining = (limit - position) << elementSizeShift;
- pointer = _env->CallStaticLongMethod(nioAccessClass,
- getBasePointerID, buffer);
- if (pointer != 0L) {
- *array = NULL;
- return (void *) (jint) pointer;
- }
-
- *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
- getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
- getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
-
- return (void *) ((char *) data + offset);
-}
-
-
-static void
-releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
-{
- _env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
-}
-
-static void *
-getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
- char* buf = (char*) _env->GetDirectBufferAddress(buffer);
- if (buf) {
- jint position = _env->GetIntField(buffer, positionID);
- jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- buf += position << elementSizeShift;
- } else {
- jniThrowException(_env, "java/lang/IllegalArgumentException",
- "Must use a native order direct Buffer");
- }
- return (void*) buf;
-}
-
-// --------------------------------------------------------------------------
diff --git a/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if b/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if
deleted file mode 100644
index b615e0a..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if
+++ /dev/null
@@ -1,330 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-package android.opengl;
-
-/** OpenGL ES 2.0
- */
-public class GLES20 {
- public static final int GL_ACTIVE_TEXTURE = 0x84E0;
- public static final int GL_DEPTH_BUFFER_BIT = 0x00000100;
- public static final int GL_STENCIL_BUFFER_BIT = 0x00000400;
- public static final int GL_COLOR_BUFFER_BIT = 0x00004000;
- public static final int GL_FALSE = 0;
- public static final int GL_TRUE = 1;
- public static final int GL_POINTS = 0x0000;
- public static final int GL_LINES = 0x0001;
- public static final int GL_LINE_LOOP = 0x0002;
- public static final int GL_LINE_STRIP = 0x0003;
- public static final int GL_TRIANGLES = 0x0004;
- public static final int GL_TRIANGLE_STRIP = 0x0005;
- public static final int GL_TRIANGLE_FAN = 0x0006;
- public static final int GL_ZERO = 0;
- public static final int GL_ONE = 1;
- public static final int GL_SRC_COLOR = 0x0300;
- public static final int GL_ONE_MINUS_SRC_COLOR = 0x0301;
- public static final int GL_SRC_ALPHA = 0x0302;
- public static final int GL_ONE_MINUS_SRC_ALPHA = 0x0303;
- public static final int GL_DST_ALPHA = 0x0304;
- public static final int GL_ONE_MINUS_DST_ALPHA = 0x0305;
- public static final int GL_DST_COLOR = 0x0306;
- public static final int GL_ONE_MINUS_DST_COLOR = 0x0307;
- public static final int GL_SRC_ALPHA_SATURATE = 0x0308;
- public static final int GL_FUNC_ADD = 0x8006;
- public static final int GL_BLEND_EQUATION = 0x8009;
- public static final int GL_BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */
- public static final int GL_BLEND_EQUATION_ALPHA = 0x883D;
- public static final int GL_FUNC_SUBTRACT = 0x800A;
- public static final int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
- public static final int GL_BLEND_DST_RGB = 0x80C8;
- public static final int GL_BLEND_SRC_RGB = 0x80C9;
- public static final int GL_BLEND_DST_ALPHA = 0x80CA;
- public static final int GL_BLEND_SRC_ALPHA = 0x80CB;
- public static final int GL_CONSTANT_COLOR = 0x8001;
- public static final int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002;
- public static final int GL_CONSTANT_ALPHA = 0x8003;
- public static final int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004;
- public static final int GL_BLEND_COLOR = 0x8005;
- public static final int GL_ARRAY_BUFFER = 0x8892;
- public static final int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
- public static final int GL_ARRAY_BUFFER_BINDING = 0x8894;
- public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
- public static final int GL_STREAM_DRAW = 0x88E0;
- public static final int GL_STATIC_DRAW = 0x88E4;
- public static final int GL_DYNAMIC_DRAW = 0x88E8;
- public static final int GL_BUFFER_SIZE = 0x8764;
- public static final int GL_BUFFER_USAGE = 0x8765;
- public static final int GL_CURRENT_VERTEX_ATTRIB = 0x8626;
- public static final int GL_FRONT = 0x0404;
- public static final int GL_BACK = 0x0405;
- public static final int GL_FRONT_AND_BACK = 0x0408;
- public static final int GL_TEXTURE_2D = 0x0DE1;
- public static final int GL_CULL_FACE = 0x0B44;
- public static final int GL_BLEND = 0x0BE2;
- public static final int GL_DITHER = 0x0BD0;
- public static final int GL_STENCIL_TEST = 0x0B90;
- public static final int GL_DEPTH_TEST = 0x0B71;
- public static final int GL_SCISSOR_TEST = 0x0C11;
- public static final int GL_POLYGON_OFFSET_FILL = 0x8037;
- public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
- public static final int GL_SAMPLE_COVERAGE = 0x80A0;
- public static final int GL_NO_ERROR = 0;
- public static final int GL_INVALID_ENUM = 0x0500;
- public static final int GL_INVALID_VALUE = 0x0501;
- public static final int GL_INVALID_OPERATION = 0x0502;
- public static final int GL_OUT_OF_MEMORY = 0x0505;
- public static final int GL_CW = 0x0900;
- public static final int GL_CCW = 0x0901;
- public static final int GL_LINE_WIDTH = 0x0B21;
- public static final int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
- public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
- public static final int GL_CULL_FACE_MODE = 0x0B45;
- public static final int GL_FRONT_FACE = 0x0B46;
- public static final int GL_DEPTH_RANGE = 0x0B70;
- public static final int GL_DEPTH_WRITEMASK = 0x0B72;
- public static final int GL_DEPTH_CLEAR_VALUE = 0x0B73;
- public static final int GL_DEPTH_FUNC = 0x0B74;
- public static final int GL_STENCIL_CLEAR_VALUE = 0x0B91;
- public static final int GL_STENCIL_FUNC = 0x0B92;
- public static final int GL_STENCIL_FAIL = 0x0B94;
- public static final int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
- public static final int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
- public static final int GL_STENCIL_REF = 0x0B97;
- public static final int GL_STENCIL_VALUE_MASK = 0x0B93;
- public static final int GL_STENCIL_WRITEMASK = 0x0B98;
- public static final int GL_STENCIL_BACK_FUNC = 0x8800;
- public static final int GL_STENCIL_BACK_FAIL = 0x8801;
- public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
- public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
- public static final int GL_STENCIL_BACK_REF = 0x8CA3;
- public static final int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4;
- public static final int GL_STENCIL_BACK_WRITEMASK = 0x8CA5;
- public static final int GL_VIEWPORT = 0x0BA2;
- public static final int GL_SCISSOR_BOX = 0x0C10;
- public static final int GL_COLOR_CLEAR_VALUE = 0x0C22;
- public static final int GL_COLOR_WRITEMASK = 0x0C23;
- public static final int GL_UNPACK_ALIGNMENT = 0x0CF5;
- public static final int GL_PACK_ALIGNMENT = 0x0D05;
- public static final int GL_MAX_TEXTURE_SIZE = 0x0D33;
- public static final int GL_MAX_VIEWPORT_DIMS = 0x0D3A;
- public static final int GL_SUBPIXEL_BITS = 0x0D50;
- public static final int GL_RED_BITS = 0x0D52;
- public static final int GL_GREEN_BITS = 0x0D53;
- public static final int GL_BLUE_BITS = 0x0D54;
- public static final int GL_ALPHA_BITS = 0x0D55;
- public static final int GL_DEPTH_BITS = 0x0D56;
- public static final int GL_STENCIL_BITS = 0x0D57;
- public static final int GL_POLYGON_OFFSET_UNITS = 0x2A00;
- public static final int GL_POLYGON_OFFSET_FACTOR = 0x8038;
- public static final int GL_TEXTURE_BINDING_2D = 0x8069;
- public static final int GL_SAMPLE_BUFFERS = 0x80A8;
- public static final int GL_SAMPLES = 0x80A9;
- public static final int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
- public static final int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
- public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
- public static final int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
- public static final int GL_DONT_CARE = 0x1100;
- public static final int GL_FASTEST = 0x1101;
- public static final int GL_NICEST = 0x1102;
- public static final int GL_GENERATE_MIPMAP_HINT = 0x8192;
- public static final int GL_BYTE = 0x1400;
- public static final int GL_UNSIGNED_BYTE = 0x1401;
- public static final int GL_SHORT = 0x1402;
- public static final int GL_UNSIGNED_SHORT = 0x1403;
- public static final int GL_INT = 0x1404;
- public static final int GL_UNSIGNED_INT = 0x1405;
- public static final int GL_FLOAT = 0x1406;
- public static final int GL_FIXED = 0x140C;
- public static final int GL_DEPTH_COMPONENT = 0x1902;
- public static final int GL_ALPHA = 0x1906;
- public static final int GL_RGB = 0x1907;
- public static final int GL_RGBA = 0x1908;
- public static final int GL_LUMINANCE = 0x1909;
- public static final int GL_LUMINANCE_ALPHA = 0x190A;
- public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
- public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
- public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
- public static final int GL_FRAGMENT_SHADER = 0x8B30;
- public static final int GL_VERTEX_SHADER = 0x8B31;
- public static final int GL_MAX_VERTEX_ATTRIBS = 0x8869;
- public static final int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
- public static final int GL_MAX_VARYING_VECTORS = 0x8DFC;
- public static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
- public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
- public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872;
- public static final int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
- public static final int GL_SHADER_TYPE = 0x8B4F;
- public static final int GL_DELETE_STATUS = 0x8B80;
- public static final int GL_LINK_STATUS = 0x8B82;
- public static final int GL_VALIDATE_STATUS = 0x8B83;
- public static final int GL_ATTACHED_SHADERS = 0x8B85;
- public static final int GL_ACTIVE_UNIFORMS = 0x8B86;
- public static final int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87;
- public static final int GL_ACTIVE_ATTRIBUTES = 0x8B89;
- public static final int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A;
- public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C;
- public static final int GL_CURRENT_PROGRAM = 0x8B8D;
- public static final int GL_NEVER = 0x0200;
- public static final int GL_LESS = 0x0201;
- public static final int GL_EQUAL = 0x0202;
- public static final int GL_LEQUAL = 0x0203;
- public static final int GL_GREATER = 0x0204;
- public static final int GL_NOTEQUAL = 0x0205;
- public static final int GL_GEQUAL = 0x0206;
- public static final int GL_ALWAYS = 0x0207;
- public static final int GL_KEEP = 0x1E00;
- public static final int GL_REPLACE = 0x1E01;
- public static final int GL_INCR = 0x1E02;
- public static final int GL_DECR = 0x1E03;
- public static final int GL_INVERT = 0x150A;
- public static final int GL_INCR_WRAP = 0x8507;
- public static final int GL_DECR_WRAP = 0x8508;
- public static final int GL_VENDOR = 0x1F00;
- public static final int GL_RENDERER = 0x1F01;
- public static final int GL_VERSION = 0x1F02;
- public static final int GL_EXTENSIONS = 0x1F03;
- public static final int GL_NEAREST = 0x2600;
- public static final int GL_LINEAR = 0x2601;
- public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
- public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
- public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
- public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
- public static final int GL_TEXTURE_MAG_FILTER = 0x2800;
- public static final int GL_TEXTURE_MIN_FILTER = 0x2801;
- public static final int GL_TEXTURE_WRAP_S = 0x2802;
- public static final int GL_TEXTURE_WRAP_T = 0x2803;
- public static final int GL_TEXTURE = 0x1702;
- public static final int GL_TEXTURE_CUBE_MAP = 0x8513;
- public static final int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514;
- public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
- public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
- public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
- public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
- public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
- public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
- public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
- public static final int GL_TEXTURE0 = 0x84C0;
- public static final int GL_TEXTURE1 = 0x84C1;
- public static final int GL_TEXTURE2 = 0x84C2;
- public static final int GL_TEXTURE3 = 0x84C3;
- public static final int GL_TEXTURE4 = 0x84C4;
- public static final int GL_TEXTURE5 = 0x84C5;
- public static final int GL_TEXTURE6 = 0x84C6;
- public static final int GL_TEXTURE7 = 0x84C7;
- public static final int GL_TEXTURE8 = 0x84C8;
- public static final int GL_TEXTURE9 = 0x84C9;
- public static final int GL_TEXTURE10 = 0x84CA;
- public static final int GL_TEXTURE11 = 0x84CB;
- public static final int GL_TEXTURE12 = 0x84CC;
- public static final int GL_TEXTURE13 = 0x84CD;
- public static final int GL_TEXTURE14 = 0x84CE;
- public static final int GL_TEXTURE15 = 0x84CF;
- public static final int GL_TEXTURE16 = 0x84D0;
- public static final int GL_TEXTURE17 = 0x84D1;
- public static final int GL_TEXTURE18 = 0x84D2;
- public static final int GL_TEXTURE19 = 0x84D3;
- public static final int GL_TEXTURE20 = 0x84D4;
- public static final int GL_TEXTURE21 = 0x84D5;
- public static final int GL_TEXTURE22 = 0x84D6;
- public static final int GL_TEXTURE23 = 0x84D7;
- public static final int GL_TEXTURE24 = 0x84D8;
- public static final int GL_TEXTURE25 = 0x84D9;
- public static final int GL_TEXTURE26 = 0x84DA;
- public static final int GL_TEXTURE27 = 0x84DB;
- public static final int GL_TEXTURE28 = 0x84DC;
- public static final int GL_TEXTURE29 = 0x84DD;
- public static final int GL_TEXTURE30 = 0x84DE;
- public static final int GL_TEXTURE31 = 0x84DF;
- public static final int GL_REPEAT = 0x2901;
- public static final int GL_CLAMP_TO_EDGE = 0x812F;
- public static final int GL_MIRRORED_REPEAT = 0x8370;
- public static final int GL_FLOAT_VEC2 = 0x8B50;
- public static final int GL_FLOAT_VEC3 = 0x8B51;
- public static final int GL_FLOAT_VEC4 = 0x8B52;
- public static final int GL_INT_VEC2 = 0x8B53;
- public static final int GL_INT_VEC3 = 0x8B54;
- public static final int GL_INT_VEC4 = 0x8B55;
- public static final int GL_BOOL = 0x8B56;
- public static final int GL_BOOL_VEC2 = 0x8B57;
- public static final int GL_BOOL_VEC3 = 0x8B58;
- public static final int GL_BOOL_VEC4 = 0x8B59;
- public static final int GL_FLOAT_MAT2 = 0x8B5A;
- public static final int GL_FLOAT_MAT3 = 0x8B5B;
- public static final int GL_FLOAT_MAT4 = 0x8B5C;
- public static final int GL_SAMPLER_2D = 0x8B5E;
- public static final int GL_SAMPLER_CUBE = 0x8B60;
- public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
- public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
- public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
- public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
- public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
- public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
- public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
- public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A;
- public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
- public static final int GL_COMPILE_STATUS = 0x8B81;
- public static final int GL_INFO_LOG_LENGTH = 0x8B84;
- public static final int GL_SHADER_SOURCE_LENGTH = 0x8B88;
- public static final int GL_SHADER_COMPILER = 0x8DFA;
- public static final int GL_SHADER_BINARY_FORMATS = 0x8DF8;
- public static final int GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9;
- public static final int GL_LOW_FLOAT = 0x8DF0;
- public static final int GL_MEDIUM_FLOAT = 0x8DF1;
- public static final int GL_HIGH_FLOAT = 0x8DF2;
- public static final int GL_LOW_INT = 0x8DF3;
- public static final int GL_MEDIUM_INT = 0x8DF4;
- public static final int GL_HIGH_INT = 0x8DF5;
- public static final int GL_FRAMEBUFFER = 0x8D40;
- public static final int GL_RENDERBUFFER = 0x8D41;
- public static final int GL_RGBA4 = 0x8056;
- public static final int GL_RGB5_A1 = 0x8057;
- public static final int GL_RGB565 = 0x8D62;
- public static final int GL_DEPTH_COMPONENT16 = 0x81A5;
- public static final int GL_STENCIL_INDEX = 0x1901;
- public static final int GL_STENCIL_INDEX8 = 0x8D48;
- public static final int GL_RENDERBUFFER_WIDTH = 0x8D42;
- public static final int GL_RENDERBUFFER_HEIGHT = 0x8D43;
- public static final int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
- public static final int GL_RENDERBUFFER_RED_SIZE = 0x8D50;
- public static final int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51;
- public static final int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52;
- public static final int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53;
- public static final int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54;
- public static final int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55;
- public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
- public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
- public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
- public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
- public static final int GL_COLOR_ATTACHMENT0 = 0x8CE0;
- public static final int GL_DEPTH_ATTACHMENT = 0x8D00;
- public static final int GL_STENCIL_ATTACHMENT = 0x8D20;
- public static final int GL_NONE = 0;
- public static final int GL_FRAMEBUFFER_COMPLETE = 0x8CD5;
- public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
- public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
- public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
- public static final int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
- public static final int GL_FRAMEBUFFER_BINDING = 0x8CA6;
- public static final int GL_RENDERBUFFER_BINDING = 0x8CA7;
- public static final int GL_MAX_RENDERBUFFER_SIZE = 0x84E8;
- public static final int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;
-
- native private static void _nativeClassInit();
- static {
- _nativeClassInit();
- }
diff --git a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
deleted file mode 100644
index 13a2577..0000000
--- a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-**
-** Copyright 2009, 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.
-*/
-
-// This source file is automatically generated
-
-#include "jni.h"
-#include "JNIHelp.h"
-#include <android_runtime/AndroidRuntime.h>
-#include <utils/misc.h>
-
-#include <assert.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-static int initialized = 0;
-
-static jclass nioAccessClass;
-static jclass bufferClass;
-static jmethodID getBasePointerID;
-static jmethodID getBaseArrayID;
-static jmethodID getBaseArrayOffsetID;
-static jfieldID positionID;
-static jfieldID limitID;
-static jfieldID elementSizeShiftID;
-
-/* Cache method IDs each time the class is loaded. */
-
-static void
-nativeClassInit(JNIEnv *_env, jclass glImplClass)
-{
- jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
- nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
-
- jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
- bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
-
- getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
- "getBasePointer", "(Ljava/nio/Buffer;)J");
- getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
- getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
-
- positionID = _env->GetFieldID(bufferClass, "position", "I");
- limitID = _env->GetFieldID(bufferClass, "limit", "I");
- elementSizeShiftID =
- _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
-}
-
-
-static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
-{
- jint position;
- jint limit;
- jint elementSizeShift;
- jlong pointer;
- jint offset;
- void *data;
-
- position = _env->GetIntField(buffer, positionID);
- limit = _env->GetIntField(buffer, limitID);
- elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- *remaining = (limit - position) << elementSizeShift;
- pointer = _env->CallStaticLongMethod(nioAccessClass,
- getBasePointerID, buffer);
- if (pointer != 0L) {
- *array = NULL;
- return (void *) (jint) pointer;
- }
-
- *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
- getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
- getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
-
- return (void *) ((char *) data + offset);
-}
-
-
-static void
-releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
-{
- _env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
-}
-
-static void *
-getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
- char* buf = (char*) _env->GetDirectBufferAddress(buffer);
- if (buf) {
- jint position = _env->GetIntField(buffer, positionID);
- jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- buf += position << elementSizeShift;
- } else {
- jniThrowException(_env, "java/lang/IllegalArgumentException",
- "Must use a native order direct Buffer");
- }
- return (void*) buf;
-}
-
-static int
-getNumCompressedTextureFormats() {
- int numCompressedTextureFormats = 0;
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
- return numCompressedTextureFormats;
-}
-
-static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
- GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
-}
-
-// --------------------------------------------------------------------------
diff --git a/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp b/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp
deleted file mode 100644
index ce6ab24..0000000
--- a/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdlib.h>
-
-/* void glGetProgramInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */
-static jstring android_glGetProgramInfoLog(JNIEnv *_env, jobject, jint shader) {
- GLint infoLen = 0;
- glGetProgramiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (!infoLen) {
- return _env->NewStringUTF("");
- }
- char* buf = (char*) malloc(infoLen);
- if (buf == NULL) {
- jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
- return NULL;
- }
- glGetProgramInfoLog(shader, infoLen, NULL, buf);
- jstring result = _env->NewStringUTF(buf);
- free(buf);
- return result;
-}
diff --git a/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java b/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java
deleted file mode 100644
index 762df39..0000000
--- a/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
- // C function void glGetProgramInfoLog( GLuint program, GLsizei maxLength, GLsizei * length,
- // GLchar * infoLog);
-
- public static native String glGetProgramInfoLog(
- int program
- );
diff --git a/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.nativeReg b/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.nativeReg
deleted file mode 100644
index 8553f2d..0000000
--- a/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.nativeReg
+++ /dev/null
@@ -1 +0,0 @@
-{"glGetProgramInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetProgramInfoLog },
diff --git a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp b/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp
deleted file mode 100644
index dd656b6..0000000
--- a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdlib.h>
-
-/* void glGetShaderInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */
-static jstring android_glGetShaderInfoLog(JNIEnv *_env, jobject, jint shader) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (!infoLen) {
- return _env->NewStringUTF("");
- }
- char* buf = (char*) malloc(infoLen);
- if (buf == NULL) {
- jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
- return NULL;
- }
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- jstring result = _env->NewStringUTF(buf);
- free(buf);
- return result;
-}
diff --git a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java b/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java
deleted file mode 100644
index af529c0..0000000
--- a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
- // C function void glGetShaderInfoLog( GLuint shader, GLsizei maxLength, GLsizei * length,
- // GLchar * infoLog);
-
- public static native String glGetShaderInfoLog(
- int shader
- );
diff --git a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.nativeReg b/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.nativeReg
deleted file mode 100644
index 71163c3..0000000
--- a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.nativeReg
+++ /dev/null
@@ -1 +0,0 @@
-{"glGetShaderInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetShaderInfoLog },
diff --git a/opengl/tools/glgen/stubs/gles11/glGetString.cpp b/opengl/tools/glgen/stubs/gles11/glGetString.cpp
deleted file mode 100644
index 239fe4a..0000000
--- a/opengl/tools/glgen/stubs/gles11/glGetString.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* const GLubyte * glGetString ( GLenum name ) */
-static jstring android_glGetString(JNIEnv* _env, jobject, jint name) {
- const char* chars = (const char*) glGetString((GLenum) name);
- return _env->NewStringUTF(chars);
-}
diff --git a/opengl/tools/glgen/stubs/gles11/glGetString.java b/opengl/tools/glgen/stubs/gles11/glGetString.java
deleted file mode 100644
index b02a0d1..0000000
--- a/opengl/tools/glgen/stubs/gles11/glGetString.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
- // C function const GLubyte * glGetString ( GLenum name )
-
- public static native String glGetString(
- int name
- );
diff --git a/opengl/tools/glgen/stubs/gles11/glGetString.nativeReg b/opengl/tools/glgen/stubs/gles11/glGetString.nativeReg
deleted file mode 100644
index a4af31f..0000000
--- a/opengl/tools/glgen/stubs/gles11/glGetString.nativeReg
+++ /dev/null
@@ -1 +0,0 @@
-{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
diff --git a/opengl/tools/glgen/stubs/gles11/glShaderSource.cpp b/opengl/tools/glgen/stubs/gles11/glShaderSource.cpp
deleted file mode 100644
index 125fd0f..0000000
--- a/opengl/tools/glgen/stubs/gles11/glShaderSource.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-
-/* void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint * length ) */
-static
-void
-android_glShaderSource
- (JNIEnv *_env, jobject _this, jint shader, jstring string) {
-
- if (!string) {
- jniThrowException(_env, "java/lang/IllegalArgumentException", "string == null");
- return;
- }
-
- const char* nativeString = _env->GetStringUTFChars(string, 0);
- const char* strings[] = {nativeString};
- glShaderSource(shader, 1, strings, 0);
- _env->ReleaseStringUTFChars(string, nativeString);
-}
diff --git a/opengl/tools/glgen/stubs/gles11/glShaderSource.java b/opengl/tools/glgen/stubs/gles11/glShaderSource.java
deleted file mode 100644
index e9fcef3..0000000
--- a/opengl/tools/glgen/stubs/gles11/glShaderSource.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
- // C function void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint* length )
-
- public static native void glShaderSource(
- int shader,
- String string
- );
diff --git a/opengl/tools/glgen/stubs/gles11/glShaderSource.nativeReg b/opengl/tools/glgen/stubs/gles11/glShaderSource.nativeReg
deleted file mode 100644
index b17783a..0000000
--- a/opengl/tools/glgen/stubs/gles11/glShaderSource.nativeReg
+++ /dev/null
@@ -1 +0,0 @@
-{"glShaderSource", "(ILjava/lang/String;)V", (void *) android_glShaderSource },
diff --git a/opengl/tools/glgen/stubs/jsr239/GL10ExtHeader.java-if b/opengl/tools/glgen/stubs/jsr239/GL10ExtHeader.java-if
deleted file mode 100644
index b0999c2..0000000
--- a/opengl/tools/glgen/stubs/jsr239/GL10ExtHeader.java-if
+++ /dev/null
@@ -1,22 +0,0 @@
-**
-** Copyright 2007, 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.
-*/
-
-// This source file is automatically generated
-
-package javax.microedition.khronos.opengles;
-
-public interface GL10Ext extends GL {
-
diff --git a/opengl/tools/glgen/stubs/jsr239/GL10Header.java-if b/opengl/tools/glgen/stubs/jsr239/GL10Header.java-if
deleted file mode 100644
index 8392821..0000000
--- a/opengl/tools/glgen/stubs/jsr239/GL10Header.java-if
+++ /dev/null
@@ -1,259 +0,0 @@
-**
-** Copyright 2006, 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.
-*/
-
-// This source file is automatically generated
-
-package javax.microedition.khronos.opengles;
-
-public interface GL10 extends GL {
- int GL_ADD = 0x0104;
- int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
- int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
- int GL_ALPHA = 0x1906;
- int GL_ALPHA_BITS = 0x0D55;
- int GL_ALPHA_TEST = 0x0BC0;
- int GL_ALWAYS = 0x0207;
- int GL_AMBIENT = 0x1200;
- int GL_AMBIENT_AND_DIFFUSE = 0x1602;
- int GL_AND = 0x1501;
- int GL_AND_INVERTED = 0x1504;
- int GL_AND_REVERSE = 0x1502;
- int GL_BACK = 0x0405;
- int GL_BLEND = 0x0BE2;
- int GL_BLUE_BITS = 0x0D54;
- int GL_BYTE = 0x1400;
- int GL_CCW = 0x0901;
- int GL_CLAMP_TO_EDGE = 0x812F;
- int GL_CLEAR = 0x1500;
- int GL_COLOR_ARRAY = 0x8076;
- int GL_COLOR_BUFFER_BIT = 0x4000;
- int GL_COLOR_LOGIC_OP = 0x0BF2;
- int GL_COLOR_MATERIAL = 0x0B57;
- int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
- int GL_CONSTANT_ATTENUATION = 0x1207;
- int GL_COPY = 0x1503;
- int GL_COPY_INVERTED = 0x150C;
- int GL_CULL_FACE = 0x0B44;
- int GL_CW = 0x0900;
- int GL_DECAL = 0x2101;
- int GL_DECR = 0x1E03;
- int GL_DEPTH_BITS = 0x0D56;
- int GL_DEPTH_BUFFER_BIT = 0x0100;
- int GL_DEPTH_TEST = 0x0B71;
- int GL_DIFFUSE = 0x1201;
- int GL_DITHER = 0x0BD0;
- int GL_DONT_CARE = 0x1100;
- int GL_DST_ALPHA = 0x0304;
- int GL_DST_COLOR = 0x0306;
- int GL_EMISSION = 0x1600;
- int GL_EQUAL = 0x0202;
- int GL_EQUIV = 0x1509;
- int GL_EXP = 0x0800;
- int GL_EXP2 = 0x0801;
- int GL_EXTENSIONS = 0x1F03;
- int GL_FALSE = 0;
- int GL_FASTEST = 0x1101;
- int GL_FIXED = 0x140C;
- int GL_FLAT = 0x1D00;
- int GL_FLOAT = 0x1406;
- int GL_FOG = 0x0B60;
- int GL_FOG_COLOR = 0x0B66;
- int GL_FOG_DENSITY = 0x0B62;
- int GL_FOG_END = 0x0B64;
- int GL_FOG_HINT = 0x0C54;
- int GL_FOG_MODE = 0x0B65;
- int GL_FOG_START = 0x0B63;
- int GL_FRONT = 0x0404;
- int GL_FRONT_AND_BACK = 0x0408;
- int GL_GEQUAL = 0x0206;
- int GL_GREATER = 0x0204;
- int GL_GREEN_BITS = 0x0D53;
- int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B;
- int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A;
- int GL_INCR = 0x1E02;
- int GL_INVALID_ENUM = 0x0500;
- int GL_INVALID_OPERATION = 0x0502;
- int GL_INVALID_VALUE = 0x0501;
- int GL_INVERT = 0x150A;
- int GL_KEEP = 0x1E00;
- int GL_LEQUAL = 0x0203;
- int GL_LESS = 0x0201;
- int GL_LIGHT_MODEL_AMBIENT = 0x0B53;
- int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52;
- int GL_LIGHT0 = 0x4000;
- int GL_LIGHT1 = 0x4001;
- int GL_LIGHT2 = 0x4002;
- int GL_LIGHT3 = 0x4003;
- int GL_LIGHT4 = 0x4004;
- int GL_LIGHT5 = 0x4005;
- int GL_LIGHT6 = 0x4006;
- int GL_LIGHT7 = 0x4007;
- int GL_LIGHTING = 0x0B50;
- int GL_LINE_LOOP = 0x0002;
- int GL_LINE_SMOOTH = 0x0B20;
- int GL_LINE_SMOOTH_HINT = 0x0C52;
- int GL_LINE_STRIP = 0x0003;
- int GL_LINEAR = 0x2601;
- int GL_LINEAR_ATTENUATION = 0x1208;
- int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
- int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
- int GL_LINES = 0x0001;
- int GL_LUMINANCE = 0x1909;
- int GL_LUMINANCE_ALPHA = 0x190A;
- int GL_MAX_ELEMENTS_INDICES = 0x80E9;
- int GL_MAX_ELEMENTS_VERTICES = 0x80E8;
- int GL_MAX_LIGHTS = 0x0D31;
- int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36;
- int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38;
- int GL_MAX_TEXTURE_SIZE = 0x0D33;
- int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39;
- int GL_MAX_TEXTURE_UNITS = 0x84E2;
- int GL_MAX_VIEWPORT_DIMS = 0x0D3A;
- int GL_MODELVIEW = 0x1700;
- int GL_MODULATE = 0x2100;
- int GL_MULTISAMPLE = 0x809D;
- int GL_NAND = 0x150E;
- int GL_NEAREST = 0x2600;
- int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
- int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
- int GL_NEVER = 0x0200;
- int GL_NICEST = 0x1102;
- int GL_NO_ERROR = 0;
- int GL_NOOP = 0x1505;
- int GL_NOR = 0x1508;
- int GL_NORMAL_ARRAY = 0x8075;
- int GL_NORMALIZE = 0x0BA1;
- int GL_NOTEQUAL = 0x0205;
- int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
- int GL_ONE = 1;
- int GL_ONE_MINUS_DST_ALPHA = 0x0305;
- int GL_ONE_MINUS_DST_COLOR = 0x0307;
- int GL_ONE_MINUS_SRC_ALPHA = 0x0303;
- int GL_ONE_MINUS_SRC_COLOR = 0x0301;
- int GL_OR = 0x1507;
- int GL_OR_INVERTED = 0x150D;
- int GL_OR_REVERSE = 0x150B;
- int GL_OUT_OF_MEMORY = 0x0505;
- int GL_PACK_ALIGNMENT = 0x0D05;
- int GL_PALETTE4_R5_G6_B5_OES = 0x8B92;
- int GL_PALETTE4_RGB5_A1_OES = 0x8B94;
- int GL_PALETTE4_RGB8_OES = 0x8B90;
- int GL_PALETTE4_RGBA4_OES = 0x8B93;
- int GL_PALETTE4_RGBA8_OES = 0x8B91;
- int GL_PALETTE8_R5_G6_B5_OES = 0x8B97;
- int GL_PALETTE8_RGB5_A1_OES = 0x8B99;
- int GL_PALETTE8_RGB8_OES = 0x8B95;
- int GL_PALETTE8_RGBA4_OES = 0x8B98;
- int GL_PALETTE8_RGBA8_OES = 0x8B96;
- int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50;
- int GL_POINT_SMOOTH = 0x0B10;
- int GL_POINT_SMOOTH_HINT = 0x0C51;
- int GL_POINTS = 0x0000;
- int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
- int GL_POINT_SIZE = 0x0B11;
- int GL_POLYGON_OFFSET_FILL = 0x8037;
- int GL_POLYGON_SMOOTH_HINT = 0x0C53;
- int GL_POSITION = 0x1203;
- int GL_PROJECTION = 0x1701;
- int GL_QUADRATIC_ATTENUATION = 0x1209;
- int GL_RED_BITS = 0x0D52;
- int GL_RENDERER = 0x1F01;
- int GL_REPEAT = 0x2901;
- int GL_REPLACE = 0x1E01;
- int GL_RESCALE_NORMAL = 0x803A;
- int GL_RGB = 0x1907;
- int GL_RGBA = 0x1908;
- int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
- int GL_SAMPLE_ALPHA_TO_ONE = 0x809F;
- int GL_SAMPLE_COVERAGE = 0x80A0;
- int GL_SCISSOR_TEST = 0x0C11;
- int GL_SET = 0x150F;
- int GL_SHININESS = 0x1601;
- int GL_SHORT = 0x1402;
- int GL_SMOOTH = 0x1D01;
- int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22;
- int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12;
- int GL_SPECULAR = 0x1202;
- int GL_SPOT_CUTOFF = 0x1206;
- int GL_SPOT_DIRECTION = 0x1204;
- int GL_SPOT_EXPONENT = 0x1205;
- int GL_SRC_ALPHA = 0x0302;
- int GL_SRC_ALPHA_SATURATE = 0x0308;
- int GL_SRC_COLOR = 0x0300;
- int GL_STACK_OVERFLOW = 0x0503;
- int GL_STACK_UNDERFLOW = 0x0504;
- int GL_STENCIL_BITS = 0x0D57;
- int GL_STENCIL_BUFFER_BIT = 0x0400;
- int GL_STENCIL_TEST = 0x0B90;
- int GL_SUBPIXEL_BITS = 0x0D50;
- int GL_TEXTURE = 0x1702;
- int GL_TEXTURE_2D = 0x0DE1;
- int GL_TEXTURE_COORD_ARRAY = 0x8078;
- int GL_TEXTURE_ENV = 0x2300;
- int GL_TEXTURE_ENV_COLOR = 0x2201;
- int GL_TEXTURE_ENV_MODE = 0x2200;
- int GL_TEXTURE_MAG_FILTER = 0x2800;
- int GL_TEXTURE_MIN_FILTER = 0x2801;
- int GL_TEXTURE_WRAP_S = 0x2802;
- int GL_TEXTURE_WRAP_T = 0x2803;
- int GL_TEXTURE0 = 0x84C0;
- int GL_TEXTURE1 = 0x84C1;
- int GL_TEXTURE2 = 0x84C2;
- int GL_TEXTURE3 = 0x84C3;
- int GL_TEXTURE4 = 0x84C4;
- int GL_TEXTURE5 = 0x84C5;
- int GL_TEXTURE6 = 0x84C6;
- int GL_TEXTURE7 = 0x84C7;
- int GL_TEXTURE8 = 0x84C8;
- int GL_TEXTURE9 = 0x84C9;
- int GL_TEXTURE10 = 0x84CA;
- int GL_TEXTURE11 = 0x84CB;
- int GL_TEXTURE12 = 0x84CC;
- int GL_TEXTURE13 = 0x84CD;
- int GL_TEXTURE14 = 0x84CE;
- int GL_TEXTURE15 = 0x84CF;
- int GL_TEXTURE16 = 0x84D0;
- int GL_TEXTURE17 = 0x84D1;
- int GL_TEXTURE18 = 0x84D2;
- int GL_TEXTURE19 = 0x84D3;
- int GL_TEXTURE20 = 0x84D4;
- int GL_TEXTURE21 = 0x84D5;
- int GL_TEXTURE22 = 0x84D6;
- int GL_TEXTURE23 = 0x84D7;
- int GL_TEXTURE24 = 0x84D8;
- int GL_TEXTURE25 = 0x84D9;
- int GL_TEXTURE26 = 0x84DA;
- int GL_TEXTURE27 = 0x84DB;
- int GL_TEXTURE28 = 0x84DC;
- int GL_TEXTURE29 = 0x84DD;
- int GL_TEXTURE30 = 0x84DE;
- int GL_TEXTURE31 = 0x84DF;
- int GL_TRIANGLE_FAN = 0x0006;
- int GL_TRIANGLE_STRIP = 0x0005;
- int GL_TRIANGLES = 0x0004;
- int GL_TRUE = 1;
- int GL_UNPACK_ALIGNMENT = 0x0CF5;
- int GL_UNSIGNED_BYTE = 0x1401;
- int GL_UNSIGNED_SHORT = 0x1403;
- int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
- int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
- int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
- int GL_VENDOR = 0x1F00;
- int GL_VERSION = 0x1F02;
- int GL_VERTEX_ARRAY = 0x8074;
- int GL_XOR = 0x1506;
- int GL_ZERO = 0;
-
diff --git a/opengl/tools/glgen/stubs/jsr239/GL11ExtHeader.java-if b/opengl/tools/glgen/stubs/jsr239/GL11ExtHeader.java-if
deleted file mode 100644
index 7be2164..0000000
--- a/opengl/tools/glgen/stubs/jsr239/GL11ExtHeader.java-if
+++ /dev/null
@@ -1,40 +0,0 @@
-**
-** Copyright 2007, 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.
-*/
-
-// This source file is automatically generated
-
-package javax.microedition.khronos.opengles;
-
-public interface GL11Ext extends GL {
- int GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES = 0x8B9E;
- int GL_MATRIX_INDEX_ARRAY_OES = 0x8844;
- int GL_MATRIX_INDEX_ARRAY_POINTER_OES = 0x8849;
- int GL_MATRIX_INDEX_ARRAY_SIZE_OES = 0x8846;
- int GL_MATRIX_INDEX_ARRAY_STRIDE_OES = 0x8848;
- int GL_MATRIX_INDEX_ARRAY_TYPE_OES = 0x8847;
- int GL_MATRIX_PALETTE_OES = 0x8840;
- int GL_MAX_PALETTE_MATRICES_OES = 0x8842;
- int GL_MAX_VERTEX_UNITS_OES = 0x86A4;
- int GL_TEXTURE_CROP_RECT_OES = 0x8B9D;
- int GL_WEIGHT_ARRAY_BUFFER_BINDING_OES = 0x889E;
- int GL_WEIGHT_ARRAY_OES = 0x86AD;
- int GL_WEIGHT_ARRAY_POINTER_OES = 0x86AC;
- int GL_WEIGHT_ARRAY_SIZE_OES = 0x86AB;
- int GL_WEIGHT_ARRAY_STRIDE_OES = 0x86AA;
- int GL_WEIGHT_ARRAY_TYPE_OES = 0x86A9;
-
- void glTexParameterfv(int target, int pname, float[] param, int offset);
-
diff --git a/opengl/tools/glgen/stubs/jsr239/GL11ExtensionPackHeader.java-if b/opengl/tools/glgen/stubs/jsr239/GL11ExtensionPackHeader.java-if
deleted file mode 100644
index a800191..0000000
--- a/opengl/tools/glgen/stubs/jsr239/GL11ExtensionPackHeader.java-if
+++ /dev/null
@@ -1,108 +0,0 @@
-**
-** Copyright 2007, 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.
-*/
-
-// This source file is automatically generated
-
-package javax.microedition.khronos.opengles;
-
-public interface GL11ExtensionPack extends GL {
- int GL_BLEND_DST_ALPHA = 0x80CA;
- int GL_BLEND_DST_RGB = 0x80C8;
- int GL_BLEND_EQUATION = 0x8009;
- int GL_BLEND_EQUATION_ALPHA = 0x883D;
- int GL_BLEND_EQUATION_RGB = 0x8009;
- int GL_BLEND_SRC_ALPHA = 0x80CB;
- int GL_BLEND_SRC_RGB = 0x80C9;
- int GL_COLOR_ATTACHMENT0_OES = 0x8CE0;
- int GL_COLOR_ATTACHMENT1_OES = 0x8CE1;
- int GL_COLOR_ATTACHMENT2_OES = 0x8CE2;
- int GL_COLOR_ATTACHMENT3_OES = 0x8CE3;
- int GL_COLOR_ATTACHMENT4_OES = 0x8CE4;
- int GL_COLOR_ATTACHMENT5_OES = 0x8CE5;
- int GL_COLOR_ATTACHMENT6_OES = 0x8CE6;
- int GL_COLOR_ATTACHMENT7_OES = 0x8CE7;
- int GL_COLOR_ATTACHMENT8_OES = 0x8CE8;
- int GL_COLOR_ATTACHMENT9_OES = 0x8CE9;
- int GL_COLOR_ATTACHMENT10_OES = 0x8CEA;
- int GL_COLOR_ATTACHMENT11_OES = 0x8CEB;
- int GL_COLOR_ATTACHMENT12_OES = 0x8CEC;
- int GL_COLOR_ATTACHMENT13_OES = 0x8CED;
- int GL_COLOR_ATTACHMENT14_OES = 0x8CEE;
- int GL_COLOR_ATTACHMENT15_OES = 0x8CEF;
- int GL_DECR_WRAP = 0x8508;
- int GL_DEPTH_ATTACHMENT_OES = 0x8D00;
- int GL_DEPTH_COMPONENT = 0x1902;
- int GL_DEPTH_COMPONENT16 = 0x81A5;
- int GL_DEPTH_COMPONENT24 = 0x81A6;
- int GL_DEPTH_COMPONENT32 = 0x81A7;
- int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES = 0x8CD1;
- int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES = 0x8CD0;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES = 0x8CD3;
- int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES = 0x8CD2;
- int GL_FRAMEBUFFER_BINDING_OES = 0x8CA6;
- int GL_FRAMEBUFFER_COMPLETE_OES = 0x8CD5;
- int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES = 0x8CD6;
- int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES = 0x8CD9;
- int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES = 0x8CDB;
- int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES = 0x8CDA;
- int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES = 0x8CD7;
- int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES = 0x8CDC;
- int GL_FRAMEBUFFER_OES = 0x8D40;
- int GL_FRAMEBUFFER_UNSUPPORTED_OES = 0x8CDD;
- int GL_FUNC_ADD = 0x8006;
- int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
- int GL_FUNC_SUBTRACT = 0x800A;
- int GL_INCR_WRAP = 0x8507;
- int GL_INVALID_FRAMEBUFFER_OPERATION_OES = 0x0506;
- int GL_MAX_COLOR_ATTACHMENTS_OES = 0x8CDF;
- int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
- int GL_MAX_RENDERBUFFER_SIZE_OES = 0x84E8;
- int GL_MIRRORED_REPEAT = 0x8370;
- int GL_NORMAL_MAP = 0x8511;
- int GL_REFLECTION_MAP = 0x8512;
- int GL_RENDERBUFFER_ALPHA_SIZE_OES = 0x8D53;
- int GL_RENDERBUFFER_BINDING_OES = 0x8CA7;
- int GL_RENDERBUFFER_BLUE_SIZE_OES = 0x8D52;
- int GL_RENDERBUFFER_DEPTH_SIZE_OES = 0x8D54;
- int GL_RENDERBUFFER_GREEN_SIZE_OES = 0x8D51;
- int GL_RENDERBUFFER_HEIGHT_OES = 0x8D43;
- int GL_RENDERBUFFER_INTERNAL_FORMAT_OES = 0x8D44;
- int GL_RENDERBUFFER_OES = 0x8D41;
- int GL_RENDERBUFFER_RED_SIZE_OES = 0x8D50;
- int GL_RENDERBUFFER_STENCIL_SIZE_OES = 0x8D55;
- int GL_RENDERBUFFER_WIDTH_OES = 0x8D42;
- int GL_RGB5_A1 = 0x8057;
- int GL_RGB565_OES = 0x8D62;
- int GL_RGB8 = 0x8051;
- int GL_RGBA4 = 0x8056;
- int GL_RGBA8 = 0x8058;
- int GL_STENCIL_ATTACHMENT_OES = 0x8D20;
- int GL_STENCIL_INDEX = 0x1901;
- int GL_STENCIL_INDEX1_OES = 0x8D46;
- int GL_STENCIL_INDEX4_OES = 0x8D47;
- int GL_STENCIL_INDEX8_OES = 0x8D48;
- int GL_STR = -1;
- int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514;
- int GL_TEXTURE_CUBE_MAP = 0x8513;
- int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
- int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
- int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
- int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
- int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
- int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
- int GL_TEXTURE_GEN_MODE = 0x2500;
- int GL_TEXTURE_GEN_STR = 0x8D60;
-
diff --git a/opengl/tools/glgen/stubs/jsr239/GL11Header.java-if b/opengl/tools/glgen/stubs/jsr239/GL11Header.java-if
deleted file mode 100644
index b0e5a6b..0000000
--- a/opengl/tools/glgen/stubs/jsr239/GL11Header.java-if
+++ /dev/null
@@ -1,145 +0,0 @@
-**
-** Copyright 2006, 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.
-*/
-
-// This source file is automatically generated
-
-package javax.microedition.khronos.opengles;
-
-public interface GL11 extends GL10 {
- int GL_ACTIVE_TEXTURE = 0x84E0;
- int GL_ADD_SIGNED = 0x8574;
- int GL_ALPHA_SCALE = 0x0D1C;
- int GL_ALPHA_TEST_FUNC = 0x0BC1;
- int GL_ALPHA_TEST_REF = 0x0BC2;
- int GL_ARRAY_BUFFER = 0x8892;
- int GL_ARRAY_BUFFER_BINDING = 0x8894;
- int GL_BLEND_DST = 0x0BE0;
- int GL_BLEND_SRC = 0x0BE1;
- int GL_BUFFER_ACCESS = 0x88BB;
- int GL_BUFFER_SIZE = 0x8764;
- int GL_BUFFER_USAGE = 0x8765;
- int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1;
- int GL_CLIP_PLANE0 = 0x3000;
- int GL_CLIP_PLANE1 = 0x3001;
- int GL_CLIP_PLANE2 = 0x3002;
- int GL_CLIP_PLANE3 = 0x3003;
- int GL_CLIP_PLANE4 = 0x3004;
- int GL_CLIP_PLANE5 = 0x3005;
- int GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898;
- int GL_COLOR_ARRAY_POINTER = 0x8090;
- int GL_COLOR_ARRAY_SIZE = 0x8081;
- int GL_COLOR_ARRAY_STRIDE = 0x8083;
- int GL_COLOR_ARRAY_TYPE = 0x8082;
- int GL_COLOR_CLEAR_VALUE = 0x0C22;
- int GL_COLOR_WRITEMASK = 0x0C23;
- int GL_COMBINE = 0x8570;
- int GL_COMBINE_ALPHA = 0x8572;
- int GL_COMBINE_RGB = 0x8571;
- int GL_CONSTANT = 0x8576;
- int GL_COORD_REPLACE_OES = 0x8862;
- int GL_CULL_FACE_MODE = 0x0B45;
- int GL_CURRENT_COLOR = 0x0B00;
- int GL_CURRENT_NORMAL = 0x0B02;
- int GL_CURRENT_TEXTURE_COORDS = 0x0B03;
- int GL_DEPTH_CLEAR_VALUE = 0x0B73;
- int GL_DEPTH_FUNC = 0x0B74;
- int GL_DEPTH_RANGE = 0x0B70;
- int GL_DEPTH_WRITEMASK = 0x0B72;
- int GL_DOT3_RGB = 0x86AE;
- int GL_DOT3_RGBA = 0x86AF;
- int GL_DYNAMIC_DRAW = 0x88E8;
- int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
- int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
- int GL_FRONT_FACE = 0x0B46;
- int GL_GENERATE_MIPMAP = 0x8191;
- int GL_GENERATE_MIPMAP_HINT = 0x8192;
- int GL_INTERPOLATE = 0x8575;
- int GL_LINE_WIDTH = 0x0B21;
- int GL_LOGIC_OP_MODE = 0x0BF0;
- int GL_MATRIX_MODE = 0x0BA0;
- int GL_MAX_CLIP_PLANES = 0x0D32;
- int GL_MODELVIEW_MATRIX = 0x0BA6;
- int GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898D;
- int GL_MODELVIEW_STACK_DEPTH = 0x0BA3;
- int GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897;
- int GL_NORMAL_ARRAY_POINTER = 0x808F;
- int GL_NORMAL_ARRAY_STRIDE = 0x807F;
- int GL_NORMAL_ARRAY_TYPE = 0x807E;
- int GL_OPERAND0_ALPHA = 0x8598;
- int GL_OPERAND0_RGB = 0x8590;
- int GL_OPERAND1_ALPHA = 0x8599;
- int GL_OPERAND1_RGB = 0x8591;
- int GL_OPERAND2_ALPHA = 0x859A;
- int GL_OPERAND2_RGB = 0x8592;
- int GL_POINT_DISTANCE_ATTENUATION = 0x8129;
- int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
- int GL_POINT_SIZE = 0x0B11;
- int GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES = 0x8B9F;
- int GL_POINT_SIZE_ARRAY_OES = 0x8B9C;
- int GL_POINT_SIZE_ARRAY_POINTER_OES = 0x898C;
- int GL_POINT_SIZE_ARRAY_STRIDE_OES = 0x898B;
- int GL_POINT_SIZE_ARRAY_TYPE_OES = 0x898A;
- int GL_POINT_SIZE_MAX = 0x8127;
- int GL_POINT_SIZE_MIN = 0x8126;
- int GL_POINT_SPRITE_OES = 0x8861;
- int GL_POLYGON_OFFSET_FACTOR = 0x8038;
- int GL_POLYGON_OFFSET_UNITS = 0x2A00;
- int GL_PREVIOUS = 0x8578;
- int GL_PRIMARY_COLOR = 0x8577;
- int GL_PROJECTION_MATRIX = 0x0BA7;
- int GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898E;
- int GL_PROJECTION_STACK_DEPTH = 0x0BA4;
- int GL_RGB_SCALE = 0x8573;
- int GL_SAMPLE_BUFFERS = 0x80A8;
- int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
- int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
- int GL_SAMPLES = 0x80A9;
- int GL_SCISSOR_BOX = 0x0C10;
- int GL_SHADE_MODEL = 0x0B54;
- int GL_SRC0_ALPHA = 0x8588;
- int GL_SRC0_RGB = 0x8580;
- int GL_SRC1_ALPHA = 0x8589;
- int GL_SRC1_RGB = 0x8581;
- int GL_SRC2_ALPHA = 0x858A;
- int GL_SRC2_RGB = 0x8582;
- int GL_STATIC_DRAW = 0x88E4;
- int GL_STENCIL_CLEAR_VALUE = 0x0B91;
- int GL_STENCIL_FAIL = 0x0B94;
- int GL_STENCIL_FUNC = 0x0B92;
- int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
- int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
- int GL_STENCIL_REF = 0x0B97;
- int GL_STENCIL_VALUE_MASK = 0x0B93;
- int GL_STENCIL_WRITEMASK = 0x0B98;
- int GL_SUBTRACT = 0x84E7;
- int GL_TEXTURE_BINDING_2D = 0x8069;
- int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A;
- int GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092;
- int GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088;
- int GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A;
- int GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089;
- int GL_TEXTURE_MATRIX = 0x0BA8;
- int GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES = 0x898F;
- int GL_TEXTURE_STACK_DEPTH = 0x0BA5;
- int GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896;
- int GL_VERTEX_ARRAY_POINTER = 0x808E;
- int GL_VERTEX_ARRAY_SIZE = 0x807A;
- int GL_VERTEX_ARRAY_STRIDE = 0x807C;
- int GL_VERTEX_ARRAY_TYPE = 0x807B;
- int GL_VIEWPORT = 0x0BA2;
- int GL_WRITE_ONLY = 0x88B9;
-
- void glGetPointerv(int pname, java.nio.Buffer[] params);
diff --git a/opengl/tools/glgen/stubs/jsr239/GL11ImplHeader.java-impl b/opengl/tools/glgen/stubs/jsr239/GL11ImplHeader.java-impl
deleted file mode 100644
index 501be65..0000000
--- a/opengl/tools/glgen/stubs/jsr239/GL11ImplHeader.java-impl
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2006 The Android Open Source Project
-
-// All Rights Reserved.
-
-// This source file is automatically generated
-
-package com.google.android.gles_jni;
-
-import java.nio.Buffer;
-import javax.microedition.khronos.opengles.GL11;
-import android.graphics.Canvas;
-
-public class GL11Impl implements GL11 {
-
- // Private accessors for native code
-
- native private static void _nativeClassInit();
- static {
- _nativeClassInit();
- }
-
- Buffer _colorPointer = null;
- Buffer _normalPointer = null;
- Buffer _texCoordPointer = null;
- Buffer _vertexPointer = null;
-
- public GL11Impl() {
- }
-
-
diff --git a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
deleted file mode 100644
index f7315ee..0000000
--- a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-**
-** Copyright 2006, 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.
-*/
-
-// This source file is automatically generated
-
-#include "jni.h"
-#include "JNIHelp.h"
-#include <android_runtime/AndroidRuntime.h>
-#include <utils/misc.h>
-
-#include <assert.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-// Work around differences between the generated name and the actual name.
-
-#define glBlendEquation glBlendEquationOES
-#define glBlendEquationSeparate glBlendEquationSeparateOES
-#define glBlendFuncSeparate glBlendFuncSeparateOES
-#define glGetTexGenfv glGetTexGenfvOES
-#define glGetTexGeniv glGetTexGenivOES
-#define glGetTexGenxv glGetTexGenxvOES
-#define glTexGenf glTexGenfOES
-#define glTexGenfv glTexGenfvOES
-#define glTexGeni glTexGeniOES
-#define glTexGeniv glTexGenivOES
-#define glTexGenx glTexGenxOES
-#define glTexGenxv glTexGenxvOES
-
-
-
-/* special calls implemented in Android's GLES wrapper used to more
- * efficiently bound-check passed arrays */
-extern "C" {
-GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
- const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-}
-
-static int initialized = 0;
-
-static jclass nioAccessClass;
-static jclass bufferClass;
-static jclass G11ImplClass;
-static jmethodID getBasePointerID;
-static jmethodID getBaseArrayID;
-static jmethodID getBaseArrayOffsetID;
-static jmethodID allowIndirectBuffersID;
-static jfieldID positionID;
-static jfieldID limitID;
-static jfieldID elementSizeShiftID;
-static jfieldID haveCheckedExtensionsID;
-static jfieldID have_OES_blend_equation_separateID;
-static jfieldID have_OES_blend_subtractID;
-static jfieldID have_OES_framebuffer_objectID;
-static jfieldID have_OES_texture_cube_mapID;
-
-/* Cache method IDs each time the class is loaded. */
-
-static void
-nativeClassInit(JNIEnv *_env, jclass glImplClass)
-{
- jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
- nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
-
- jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
- bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
-
- jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl");
- G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal);
- haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z");
- have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z");
- have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z");
- have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z");
- have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z");
-
- getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
- "getBasePointer", "(Ljava/nio/Buffer;)J");
- getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
- getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
- allowIndirectBuffersID = _env->GetStaticMethodID(g11impClassLocal,
- "allowIndirectBuffers", "(Ljava/lang/String;)Z");
- positionID = _env->GetFieldID(bufferClass, "position", "I");
- limitID = _env->GetFieldID(bufferClass, "limit", "I");
- elementSizeShiftID =
- _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
-}
-
-static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
-{
- jint position;
- jint limit;
- jint elementSizeShift;
- jlong pointer;
- jint offset;
- void *data;
-
- position = _env->GetIntField(buffer, positionID);
- limit = _env->GetIntField(buffer, limitID);
- elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- *remaining = (limit - position) << elementSizeShift;
- pointer = _env->CallStaticLongMethod(nioAccessClass,
- getBasePointerID, buffer);
- if (pointer != 0L) {
- *array = NULL;
- return (void *) (jint) pointer;
- }
-
- *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
- getBaseArrayID, buffer);
- if (*array == NULL) {
- return (void*) NULL;
- }
- offset = _env->CallStaticIntMethod(nioAccessClass,
- getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
-
- return (void *) ((char *) data + offset);
-}
-
-static void
-releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
-{
- _env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
-}
-
-extern "C" {
-extern char* __progname;
-}
-
-static bool
-allowIndirectBuffers(JNIEnv *_env) {
- static jint sIndirectBufferCompatability;
- if (sIndirectBufferCompatability == 0) {
- jobject appName = _env->NewStringUTF(::__progname);
- sIndirectBufferCompatability = _env->CallStaticBooleanMethod(G11ImplClass, allowIndirectBuffersID, appName) ? 2 : 1;
- }
- return sIndirectBufferCompatability == 2;
-}
-
-static void *
-getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
- if (!buffer) {
- return NULL;
- }
- void* buf = _env->GetDirectBufferAddress(buffer);
- if (buf) {
- jint position = _env->GetIntField(buffer, positionID);
- jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- buf = ((char*) buf) + (position << elementSizeShift);
- } else {
- if (allowIndirectBuffers(_env)) {
- jarray array = 0;
- jint remaining;
- buf = getPointer(_env, buffer, &array, &remaining);
- if (array) {
- releasePointer(_env, array, buf, 0);
- }
- } else {
- jniThrowException(_env, "java/lang/IllegalArgumentException",
- "Must use a native order direct Buffer");
- }
- }
- return buf;
-}
-
-static int
-getNumCompressedTextureFormats() {
- int numCompressedTextureFormats = 0;
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
- return numCompressedTextureFormats;
-}
-
-// Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is
-// terminated by either 0 or space, while pExtension is terminated by 0.
-
-static bool
-extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) {
- while (true) {
- char a = *pExtensions++;
- char b = *pExtension++;
- bool aEnd = a == '\0' || a == ' ';
- bool bEnd = b == '\0';
- if ( aEnd || bEnd) {
- return aEnd == bEnd;
- }
- if ( a != b ) {
- return false;
- }
- }
-}
-
-static const GLubyte*
-nextExtension(const GLubyte* pExtensions) {
- while (true) {
- char a = *pExtensions++;
- if ( a == '\0') {
- return pExtensions-1;
- } else if ( a == ' ') {
- return pExtensions;
- }
- }
-}
-
-static bool
-checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) {
- for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) {
- if (extensionEqual(pExtensions, pExtension)) {
- return true;
- }
- }
- return false;
-}
-
-static bool
-supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) {
- if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) {
- _env->SetBooleanField(impl, haveCheckedExtensionsID, true);
- const GLubyte* sExtensions = glGetString(GL_EXTENSIONS);
- _env->SetBooleanField(impl, have_OES_blend_equation_separateID,
- checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate"));
- _env->SetBooleanField(impl, have_OES_blend_subtractID,
- checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract"));
- _env->SetBooleanField(impl, have_OES_framebuffer_objectID,
- checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object"));
- _env->SetBooleanField(impl, have_OES_texture_cube_mapID,
- checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map"));
- }
- return _env->GetBooleanField(impl, fieldId);
-}
-
-// --------------------------------------------------------------------------
diff --git a/opengl/tools/glgen/stubs/jsr239/GLHeader.java-if b/opengl/tools/glgen/stubs/jsr239/GLHeader.java-if
deleted file mode 100644
index 3b78f3d..0000000
--- a/opengl/tools/glgen/stubs/jsr239/GLHeader.java-if
+++ /dev/null
@@ -1,22 +0,0 @@
-/* //device/java/android/javax/microedition/khronos/opengles/GL.java
-**
-** Copyright 2006, 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 javax.microedition.khronos.opengles;
-
-public interface GL {
-}
-
diff --git a/opengl/tools/glgen/stubs/jsr239/GLImplHeader.java-impl b/opengl/tools/glgen/stubs/jsr239/GLImplHeader.java-impl
deleted file mode 100644
index cd730aa..0000000
--- a/opengl/tools/glgen/stubs/jsr239/GLImplHeader.java-impl
+++ /dev/null
@@ -1,84 +0,0 @@
-**
-** Copyright 2006, 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.
-*/
-
-// This source file is automatically generated
-
-package com.google.android.gles_jni;
-
-import android.app.AppGlobals;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.IPackageManager;
-import android.os.Build;
-import android.util.Log;
-
-import java.nio.Buffer;
-import javax.microedition.khronos.opengles.GL10;
-import javax.microedition.khronos.opengles.GL10Ext;
-import javax.microedition.khronos.opengles.GL11;
-import javax.microedition.khronos.opengles.GL11Ext;
-import javax.microedition.khronos.opengles.GL11ExtensionPack;
-
-public class GLImpl implements GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack {
-
- // Private accessors for native code
-
- native private static void _nativeClassInit();
- static {
- _nativeClassInit();
- }
-
- Buffer _colorPointer = null;
- Buffer _normalPointer = null;
- Buffer _texCoordPointer = null;
- Buffer _vertexPointer = null;
- Buffer _pointSizePointerOES = null;
- Buffer _matrixIndexPointerOES = null;
- Buffer _weightPointerOES = null;
-
- private boolean haveCheckedExtensions;
- private boolean have_OES_blend_equation_separate;
- private boolean have_OES_blend_subtract;
- private boolean have_OES_framebuffer_object;
- private boolean have_OES_texture_cube_map;
-
- public GLImpl() {
- }
-
- public void glGetPointerv(int pname, java.nio.Buffer[] params) {
- throw new UnsupportedOperationException("glGetPointerv");
- }
-
- private static boolean allowIndirectBuffers(String appName) {
- boolean result = false;
- int version = 0;
- IPackageManager pm = AppGlobals.getPackageManager();
- try {
- ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0);
- if (applicationInfo != null) {
- version = applicationInfo.targetSdkVersion;
- }
- } catch (android.os.RemoteException e) {
- // ignore
- }
- Log.e("OpenGLES", String.format(
- "Application %s (SDK target %d) called a GL11 Pointer method with an indirect Buffer.",
- appName, version));
- if (version <= Build.VERSION_CODES.CUPCAKE) {
- result = true;
- }
- return result;
- }
-
diff --git a/opengl/tools/glgen/stubs/jsr239/glGetString.cpp b/opengl/tools/glgen/stubs/jsr239/glGetString.cpp
deleted file mode 100644
index cd6e3f3..0000000
--- a/opengl/tools/glgen/stubs/jsr239/glGetString.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* const GLubyte * glGetString ( GLenum name ) */
-static jstring android_glGetString(JNIEnv *_env, jobject, jint name) {
- const char* chars = (const char*) glGetString((GLenum) name);
- return _env->NewStringUTF(chars);
-}
diff --git a/opengl/tools/glgen/stubs/jsr239/glGetString.java-10-if b/opengl/tools/glgen/stubs/jsr239/glGetString.java-10-if
deleted file mode 100644
index 898fabc..0000000
--- a/opengl/tools/glgen/stubs/jsr239/glGetString.java-10-if
+++ /dev/null
@@ -1,4 +0,0 @@
- public String glGetString(
- int name
- );
-
diff --git a/opengl/tools/glgen/stubs/jsr239/glGetString.java-if b/opengl/tools/glgen/stubs/jsr239/glGetString.java-if
deleted file mode 100644
index 898fabc..0000000
--- a/opengl/tools/glgen/stubs/jsr239/glGetString.java-if
+++ /dev/null
@@ -1,4 +0,0 @@
- public String glGetString(
- int name
- );
-
diff --git a/opengl/tools/glgen/stubs/jsr239/glGetString.java-impl b/opengl/tools/glgen/stubs/jsr239/glGetString.java-impl
deleted file mode 100644
index 8c7881c..0000000
--- a/opengl/tools/glgen/stubs/jsr239/glGetString.java-impl
+++ /dev/null
@@ -1,16 +0,0 @@
- // C function const GLubyte * glGetString ( GLenum name )
-
- public native String _glGetString(
- int name
- );
-
- public String glGetString(
- int name
- ) {
- String returnValue;
- returnValue = _glGetString(
- name
- );
- return returnValue;
- }
-
diff --git a/opengl/tools/glgen/stubs/jsr239/glGetString.nativeReg b/opengl/tools/glgen/stubs/jsr239/glGetString.nativeReg
deleted file mode 100644
index e64187c..0000000
--- a/opengl/tools/glgen/stubs/jsr239/glGetString.nativeReg
+++ /dev/null
@@ -1 +0,0 @@
-{"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
diff --git a/packages/SettingsProvider/res/values-in/strings.xml b/packages/SettingsProvider/res/values-in/strings.xml
index bed20eb..d5aea43 100644
--- a/packages/SettingsProvider/res/values-in/strings.xml
+++ b/packages/SettingsProvider/res/values-in/strings.xml
@@ -19,5 +19,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_label" msgid="4567566098528588863">"Setelan Penyimpanan"</string>
+ <string name="app_label" msgid="4567566098528588863">"Pengaturan Penyimpanan"</string>
</resources>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index a8b024d..1e82646 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -26,7 +26,7 @@
<string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Hapus dari daftar"</string>
<string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"Info apl"</string>
<string name="status_bar_no_recent_apps" msgid="6576392951053994640">"Tidak ada apl terbaru"</string>
- <string name="status_bar_accessibility_dismiss_recents" msgid="4576076075226540105">"Singkirkan aplikasi terbaru"</string>
+ <string name="status_bar_accessibility_dismiss_recents" msgid="4576076075226540105">"Tutup aplikasi terbaru"</string>
<plurals name="status_bar_accessibility_recent_apps">
<item quantity="one" msgid="5854176083865845541">"1 apl terbaru"</item>
<item quantity="other" msgid="1040784359794890744">"%d apl terbaru"</item>
@@ -39,7 +39,7 @@
<string name="battery_low_percent_format" msgid="1077244949318261761">"<xliff:g id="NUMBER">%d%%</xliff:g> tersisa"</string>
<string name="invalid_charger" msgid="4549105996740522523">"Pengisian daya USB tidak didukung."\n"Gunakan hanya pengisi daya yang disediakan."</string>
<string name="battery_low_why" msgid="7279169609518386372">"Penggunaan baterai"</string>
- <string name="status_bar_settings_settings_button" msgid="3023889916699270224">"Setelan"</string>
+ <string name="status_bar_settings_settings_button" msgid="3023889916699270224">"Pengaturan"</string>
<string name="status_bar_settings_wifi_button" msgid="1733928151698311923">"Wi-Fi"</string>
<string name="status_bar_settings_airplane" msgid="4879879698500955300">"Mode pesawat"</string>
<string name="status_bar_settings_auto_rotation" msgid="3790482541357798421">"Putar layar secara otomatis"</string>
@@ -69,10 +69,10 @@
<string name="screenshot_saved_text" msgid="1152839647677558815">"Sentuh untuk melihat tangkapan layar Anda."</string>
<string name="screenshot_failed_title" msgid="705781116746922771">"Tidak dapat mengambil tangkapan layar."</string>
<string name="screenshot_failed_text" msgid="8134011269572415402">"Tidak dapat menyimpan tangkapan layar. Penyimpanan mungkin sedang digunakan."</string>
- <string name="usb_preference_title" msgid="6551050377388882787">"Opsi transfer berkas USB"</string>
+ <string name="usb_preference_title" msgid="6551050377388882787">"Opsi transfer file USB"</string>
<string name="use_mtp_button_title" msgid="4333504413563023626">"Pasang sebagai pemutar media (MTP)"</string>
<string name="use_ptp_button_title" msgid="7517127540301625751">"Pasang sebagai kamera (PTP)"</string>
- <string name="installer_cd_button_title" msgid="2312667578562201583">"Pasang apl Transfer Berkas Android untuk Mac"</string>
+ <string name="installer_cd_button_title" msgid="2312667578562201583">"Pasang apl Transfer File Android untuk Mac"</string>
<string name="accessibility_back" msgid="567011538994429120">"Kembali"</string>
<string name="accessibility_home" msgid="8217216074895377641">"Utama"</string>
<string name="accessibility_menu" msgid="316839303324695949">"Menu"</string>
@@ -118,7 +118,7 @@
<string name="accessibility_bluetooth_tether" msgid="4102784498140271969">"Penambatan bluetooth."</string>
<string name="accessibility_airplane_mode" msgid="834748999790763092">"Mode pesawat."</string>
<string name="accessibility_battery_level" msgid="7451474187113371965">"Baterai <xliff:g id="NUMBER">%d</xliff:g> persen."</string>
- <string name="accessibility_settings_button" msgid="799583911231893380">"Setelan sistem."</string>
+ <string name="accessibility_settings_button" msgid="799583911231893380">"Pengaturan sistem."</string>
<string name="accessibility_notifications_button" msgid="4498000369779421892">"Pemberitahuan."</string>
<string name="accessibility_remove_notification" msgid="3603099514902182350">"Menghapus pemberitahuan."</string>
<string name="accessibility_gps_enabled" msgid="3511469499240123019">"GPS diaktifkan."</string>
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index c4a92f7..9a76c14 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -34,7 +34,7 @@
import android.graphics.Matrix;
import android.graphics.PixelFormat;
import android.graphics.PointF;
-import android.hardware.CameraSound;
+import android.media.MediaActionSound;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Environment;
@@ -256,7 +256,7 @@
private float mBgPadding;
private float mBgPaddingScale;
- private CameraSound mCameraSound;
+ private MediaActionSound mCameraSound;
/**
@@ -309,7 +309,8 @@
mBgPaddingScale = mBgPadding / mDisplayMetrics.widthPixels;
// Setup the Camera shutter sound
- mCameraSound = new CameraSound();
+ mCameraSound = new MediaActionSound();
+ mCameraSound.load(MediaActionSound.SHUTTER_CLICK);
}
/**
@@ -422,7 +423,7 @@
@Override
public void run() {
// Play the shutter sound to notify that we've taken a screenshot
- mCameraSound.playSound(CameraSound.SHUTTER_CLICK);
+ mCameraSound.play(MediaActionSound.SHUTTER_CLICK);
mScreenshotView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
mScreenshotView.buildLayer();
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index fe068af..fd7418c 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1053,7 +1053,7 @@
}
// audioConfigChanged_l() must be called with AudioFlinger::mLock held
-void AudioFlinger::audioConfigChanged_l(int event, audio_io_handle_t ioHandle, void *param2)
+void AudioFlinger::audioConfigChanged_l(int event, audio_io_handle_t ioHandle, const void *param2)
{
size_t size = mNotificationClients.size();
for (size_t i = 0; i < size; i++) {
@@ -1462,7 +1462,9 @@
// Assumes constructor is called by AudioFlinger with it's mLock held,
// but it would be safer to explicitly pass initial masterVolume as parameter
mMasterVolume(audioFlinger->masterVolumeSW_l()),
- mLastWriteTime(0), mNumWrites(0), mNumDelayedWrites(0), mInWrite(false)
+ mLastWriteTime(0), mNumWrites(0), mNumDelayedWrites(0), mInWrite(false),
+ // mMixerStatus
+ mPrevMixerStatus(MIXER_IDLE)
{
snprintf(mName, kNameLength, "AudioOut_%X", id);
@@ -1922,7 +1924,6 @@
: PlaybackThread(audioFlinger, output, id, device, type)
{
mAudioMixer = new AudioMixer(mFrameCount, mSampleRate);
- mPrevMixerStatus = MIXER_IDLE;
// FIXME - Current mixer implementation only supports stereo output
if (mChannelCount == 1) {
ALOGE("Invalid audio hardware channel count");
@@ -2043,11 +2044,7 @@
processConfigEvents();
-if (mType == DIRECT) {
- activeTrack.clear();
-}
-
- mixerStatus = MIXER_IDLE;
+ mMixerStatus = MIXER_IDLE;
{ // scope for mLock
Mutex::Autolock _l(mLock);
@@ -2074,17 +2071,7 @@
}
-if (mType == DUPLICATING) {
-#if 0 // see earlier FIXME
- // Now that this is a field instead of local variable,
- // clear it so it is empty the first time through the loop,
- // and later an assignment could combine the clear with the loop below
- outputTracks.clear();
-#endif
- for (size_t i = 0; i < mOutputTracks.size(); i++) {
- outputTracks.add(mOutputTracks[i]);
- }
-}
+ saveOutputTracks();
// put audio hardware into standby after short delay
if (CC_UNLIKELY((!mActiveTracks.size() && systemTime() > standbyTime) ||
@@ -2101,9 +2088,7 @@
// we're about to wait, flush the binder command buffer
IPCThreadState::self()->flushCommands();
-if (mType == DUPLICATING) {
- outputTracks.clear();
-}
+ clearOutputTracks();
if (exitPending()) break;
@@ -2114,9 +2099,7 @@
ALOGV("Thread %p type %d TID %d waking up", this, mType, gettid());
acquireWakeLock_l();
-if (mType == MIXER || mType == DUPLICATING) {
mPrevMixerStatus = MIXER_IDLE;
-}
checkSilentMode_l();
@@ -2138,11 +2121,11 @@
}
}
- mixerStatus = prepareTracks_l(&tracksToRemove);
- // see FIXME in AudioFlinger.h
- if (mixerStatus == MIXER_CONTINUE) {
- continue;
- }
+ mixer_state newMixerStatus = prepareTracks_l(&tracksToRemove);
+ // Shift in the new status; this could be a queue if it's
+ // useful to filter the mixer status over several cycles.
+ mPrevMixerStatus = mMixerStatus;
+ mMixerStatus = newMixerStatus;
// prevent any changes in effect chain list and in each effect chain
// during mixing and effect process as the audio buffers could be deleted
@@ -2150,11 +2133,7 @@
lockEffectChains_l(effectChains);
}
-if (mType == DIRECT) {
- // For DirectOutputThread, this test is equivalent to "activeTrack != 0"
-}
-
- if (CC_LIKELY(mixerStatus == MIXER_TRACKS_READY)) {
+ if (CC_LIKELY(mMixerStatus == MIXER_TRACKS_READY)) {
threadLoop_mix();
} else {
threadLoop_sleepTime();
@@ -2208,13 +2187,10 @@
// same lock.
tracksToRemove.clear();
-// FIXME merge these
-if (mType == DIRECT) {
- activeTrack.clear();
-}
-if (mType == DUPLICATING) {
- outputTracks.clear();
-}
+ // FIXME I don't understand the need for this here;
+ // it was in the original code but maybe the
+ // assignment in saveOutputTracks() makes this unnecessary?
+ clearOutputTracks();
// Effect chains will be actually deleted here if they were removed from
// mEffectChains list during mixing or effects processing
@@ -2294,7 +2270,7 @@
// If no tracks are ready, sleep once for the duration of an output
// buffer size, then write 0s to the output
if (sleepTime == 0) {
- if (mixerStatus == MIXER_TRACKS_ENABLED) {
+ if (mMixerStatus == MIXER_TRACKS_ENABLED) {
sleepTime = activeSleepTime >> sleepTimeShift;
if (sleepTime < kMinThreadSleepTimeUs) {
sleepTime = kMinThreadSleepTimeUs;
@@ -2310,10 +2286,10 @@
sleepTime = idleSleepTime;
}
} else if (mBytesWritten != 0 ||
- (mixerStatus == MIXER_TRACKS_ENABLED && longStandbyExit)) {
+ (mMixerStatus == MIXER_TRACKS_ENABLED && longStandbyExit)) {
memset (mMixBuffer, 0, mixBufferSize);
sleepTime = 0;
- ALOGV_IF((mBytesWritten == 0 && (mixerStatus == MIXER_TRACKS_ENABLED && longStandbyExit)), "anticipated start");
+ ALOGV_IF((mBytesWritten == 0 && (mMixerStatus == MIXER_TRACKS_ENABLED && longStandbyExit)), "anticipated start");
}
// TODO add standby time extension fct of effect tail
}
@@ -2569,7 +2545,6 @@
memset(mMixBuffer, 0, mFrameCount * mChannelCount * sizeof(int16_t));
}
- mPrevMixerStatus = mixerStatus;
return mixerStatus;
}
@@ -2836,15 +2811,13 @@
{
sp<Track> trackToRemove;
- // FIXME Temporarily renamed to avoid confusion with the member "mixerStatus"
- mixer_state mixerStatus_ = MIXER_IDLE;
+ mixer_state mixerStatus = MIXER_IDLE;
// find out which tracks need to be processed
if (mActiveTracks.size() != 0) {
sp<Track> t = mActiveTracks[0].promote();
- // see FIXME in AudioFlinger.h, return MIXER_IDLE might also work
- if (t == 0) return MIXER_CONTINUE;
- //if (t == 0) continue;
+ // The track died recently
+ if (t == 0) return MIXER_IDLE;
Track* const track = t.get();
audio_track_cblk_t* cblk = track->cblk();
@@ -2929,8 +2902,8 @@
// reset retry count
track->mRetryCount = kMaxTrackRetriesDirect;
- activeTrack = t;
- mixerStatus_ = MIXER_TRACKS_READY;
+ mActiveTrack = t;
+ mixerStatus = MIXER_TRACKS_READY;
} else {
//ALOGV("track %d u=%08x, s=%08x [NOT READY]", track->name(), cblk->user, cblk->server);
if (track->isStopped()) {
@@ -2947,7 +2920,7 @@
ALOGV("BUFFER TIMEOUT: remove(%d) from active list", track->name());
trackToRemove = track;
} else {
- mixerStatus_ = MIXER_TRACKS_ENABLED;
+ mixerStatus = MIXER_TRACKS_ENABLED;
}
}
}
@@ -2968,7 +2941,7 @@
}
}
- return mixerStatus_;
+ return mixerStatus;
}
void AudioFlinger::DirectOutputThread::threadLoop_mix()
@@ -2979,7 +2952,7 @@
// output audio to hardware
while (frameCount) {
buffer.frameCount = frameCount;
- activeTrack->getNextBuffer(&buffer);
+ mActiveTrack->getNextBuffer(&buffer);
if (CC_UNLIKELY(buffer.raw == NULL)) {
memset(curBuf, 0, frameCount * mFrameSize);
break;
@@ -2987,17 +2960,18 @@
memcpy(curBuf, buffer.raw, buffer.frameCount * mFrameSize);
frameCount -= buffer.frameCount;
curBuf += buffer.frameCount * mFrameSize;
- activeTrack->releaseBuffer(&buffer);
+ mActiveTrack->releaseBuffer(&buffer);
}
sleepTime = 0;
standbyTime = systemTime() + standbyDelay;
+ mActiveTrack.clear();
applyVolume();
}
void AudioFlinger::DirectOutputThread::threadLoop_sleepTime()
{
if (sleepTime == 0) {
- if (mixerStatus == MIXER_TRACKS_ENABLED) {
+ if (mMixerStatus == MIXER_TRACKS_ENABLED) {
sleepTime = activeSleepTime;
} else {
sleepTime = idleSleepTime;
@@ -3133,7 +3107,7 @@
void AudioFlinger::DuplicatingThread::threadLoop_sleepTime()
{
if (sleepTime == 0) {
- if (mixerStatus == MIXER_TRACKS_ENABLED) {
+ if (mMixerStatus == MIXER_TRACKS_ENABLED) {
sleepTime = activeSleepTime;
} else {
sleepTime = idleSleepTime;
@@ -3168,6 +3142,16 @@
}
}
+void AudioFlinger::DuplicatingThread::saveOutputTracks()
+{
+ outputTracks = mOutputTracks;
+}
+
+void AudioFlinger::DuplicatingThread::clearOutputTracks()
+{
+ outputTracks.clear();
+}
+
void AudioFlinger::DuplicatingThread::addOutputTrack(MixerThread *thread)
{
Mutex::Autolock _l(mLock);
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 8ca4f89..2e259c0 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -607,10 +607,6 @@
MIXER_TRACKS_READY // at least one active track, and at least one track has data
// standby mode does not have an enum value
// suspend by audio policy manager is orthogonal to mixer state
-#if 1
- // FIXME remove this hack for prepareTracks_l()
- , MIXER_CONTINUE // "continue;"
-#endif
};
// playback track
@@ -920,6 +916,10 @@
// Code snippets that are temporarily lifted up out of threadLoop() until the merge
void checkSilentMode_l();
+ // Non-trivial for DUPLICATING only
+ virtual void saveOutputTracks() { }
+ virtual void clearOutputTracks() { }
+
private:
friend class AudioFlinger;
@@ -958,23 +958,19 @@
uint32_t activeSleepTime;
uint32_t idleSleepTime;
uint32_t sleepTime;
- // mixerStatus was local to the while !exitingPending loop
- mixer_state mixerStatus;
+
+ // mixer status returned by prepareTracks_l()
+ mixer_state mMixerStatus; // current cycle
+ mixer_state mPrevMixerStatus; // previous cycle
// FIXME move these declarations into the specific sub-class that needs them
// MIXER only
bool longStandbyExit;
uint32_t sleepTimeShift;
- // MIXER and DUPLICATING only
- mixer_state mPrevMixerStatus; // previous status returned by prepareTracks_l()
// DIRECT only
nsecs_t standbyDelay;
- // activeTrack was local to the while !exitingPending loop
- sp<Track> activeTrack;
// DUPLICATING only
- SortedVector < sp<OutputTrack> > outputTracks;
uint32_t writeFrames;
- SortedVector < sp<OutputTrack> > mOutputTracks;
};
class MixerThread : public PlaybackThread {
@@ -1044,6 +1040,9 @@
private:
void applyVolume(); // FIXME inline into threadLoop_mix()
+
+ // prepareTracks_l() tells threadLoop_mix() the name of the single active track
+ sp<Track> mActiveTrack;
};
class DuplicatingThread : public MixerThread {
@@ -1070,9 +1069,13 @@
// called from threadLoop, addOutputTrack, removeOutputTrack
virtual void updateWaitTime_l();
+ virtual void saveOutputTracks();
+ virtual void clearOutputTracks();
private:
uint32_t mWaitTimeMs;
+ SortedVector < sp<OutputTrack> > outputTracks;
+ SortedVector < sp<OutputTrack> > mOutputTracks;
};
PlaybackThread *checkPlaybackThread_l(audio_io_handle_t output) const;
@@ -1084,7 +1087,7 @@
// no range check, doesn't check per-thread stream volume, AudioFlinger::mLock held
float streamVolume_l(audio_stream_type_t stream) const
{ return mStreamTypes[stream].volume; }
- void audioConfigChanged_l(int event, audio_io_handle_t ioHandle, void *param2);
+ void audioConfigChanged_l(int event, audio_io_handle_t ioHandle, const void *param2);
// allocate an audio_io_handle_t, session ID, or effect ID
uint32_t nextUniqueId();
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java
index b8c44d9..0574405 100644
--- a/services/java/com/android/server/AlarmManagerService.java
+++ b/services/java/com/android/server/AlarmManagerService.java
@@ -477,7 +477,8 @@
: bs.filterStats.entrySet()) {
pw.print(" "); pw.print(fe.getValue().count);
pw.print(" alarms: ");
- pw.println(fe.getKey().getIntent().toShortString(false, true, false));
+ pw.println(fe.getKey().getIntent().toShortString(
+ false, true, false, true));
}
}
}
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 7bb7938..720b5fe 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -117,6 +117,7 @@
public static final int InterfaceTxThrottleResult = 219;
public static final int QuotaCounterResult = 220;
public static final int TetheringStatsResult = 221;
+ public static final int DnsProxyQueryResult = 222;
public static final int InterfaceChange = 600;
public static final int BandwidthControl = 601;
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index d9d3f4e..63418db 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -2234,14 +2234,18 @@
}
if (target != currentValue) {
+ final boolean doScreenAnim = (mask & (SCREEN_BRIGHT_BIT | SCREEN_ON_BIT)) != 0;
final boolean turningOff = endValue == Power.BRIGHTNESS_OFF;
- if (turningOff && ((mask & (SCREEN_ON_BIT | SCREEN_BRIGHT_BIT)) != 0)) {
+ if (turningOff && doScreenAnim) {
// Cancel all pending animations since we're turning off
mScreenBrightnessHandler.removeCallbacksAndMessages(null);
screenOffFinishedAnimatingLocked(mScreenOffReason);
duration = 200; // TODO: how long should this be?
}
- animateInternal(mask, turningOff, 0);
+ if (doScreenAnim) {
+ animateInternal(mask, turningOff, 0);
+ }
+ // TODO: Handle keyboard light animation when we have devices that support it
}
}
}
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 4ea2f04..2538455 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -49,10 +49,10 @@
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
-import android.app.WallpaperManager;
import android.app.backup.IBackupManager;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
+import android.content.ClipData;
import android.content.ComponentCallbacks2;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -4297,7 +4297,7 @@
try {
int uid = AppGlobals.getPackageManager()
.getPackageUid(rec.key.packageName);
- if (uid != Binder.getCallingUid()) {
+ if (!UserId.isSameApp(uid, Binder.getCallingUid())) {
String msg = "Permission Denial: cancelIntentSender() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
@@ -4657,9 +4657,11 @@
* if callingUid is not allowed to do this. Returns the uid of the target
* if the URI permission grant should be performed; returns -1 if it is not
* needed (for example targetPkg already has permission to access the URI).
+ * If you already know the uid of the target, you can supply it in
+ * lastTargetUid else set that to -1.
*/
int checkGrantUriPermissionLocked(int callingUid, String targetPkg,
- Uri uri, int modeFlags) {
+ Uri uri, int modeFlags, int lastTargetUid) {
modeFlags &= (Intent.FLAG_GRANT_READ_URI_PERMISSION
| Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
if (modeFlags == 0) {
@@ -4698,8 +4700,8 @@
return -1;
}
- int targetUid;
- if (targetPkg != null) {
+ int targetUid = lastTargetUid;
+ if (targetUid < 0 && targetPkg != null) {
try {
targetUid = pm.getPackageUid(targetPkg);
if (targetUid < 0) {
@@ -4710,8 +4712,6 @@
} catch (RemoteException ex) {
return -1;
}
- } else {
- targetUid = -1;
}
if (targetUid >= 0) {
@@ -4783,7 +4783,7 @@
Uri uri, int modeFlags) {
enforceNotIsolatedCaller("checkGrantUriPermission");
synchronized(this) {
- return checkGrantUriPermissionLocked(callingUid, targetPkg, uri, modeFlags);
+ return checkGrantUriPermissionLocked(callingUid, targetPkg, uri, modeFlags, -1);
}
}
@@ -4830,13 +4830,13 @@
}
}
- void grantUriPermissionLocked(int callingUid,
- String targetPkg, Uri uri, int modeFlags, UriPermissionOwner owner) {
+ void grantUriPermissionLocked(int callingUid, String targetPkg, Uri uri,
+ int modeFlags, UriPermissionOwner owner) {
if (targetPkg == null) {
throw new NullPointerException("targetPkg");
}
- int targetUid = checkGrantUriPermissionLocked(callingUid, targetPkg, uri, modeFlags);
+ int targetUid = checkGrantUriPermissionLocked(callingUid, targetPkg, uri, modeFlags, -1);
if (targetUid < 0) {
return;
}
@@ -4844,13 +4844,26 @@
grantUriPermissionUncheckedLocked(targetUid, targetPkg, uri, modeFlags, owner);
}
+ static class NeededUriGrants extends ArrayList<Uri> {
+ final String targetPkg;
+ final int targetUid;
+ final int flags;
+
+ NeededUriGrants(String _targetPkg, int _targetUid, int _flags) {
+ targetPkg = _targetPkg;
+ targetUid = _targetUid;
+ flags = _flags;
+ }
+ }
+
/**
* Like checkGrantUriPermissionLocked, but takes an Intent.
*/
- int checkGrantUriPermissionFromIntentLocked(int callingUid,
- String targetPkg, Intent intent) {
+ NeededUriGrants checkGrantUriPermissionFromIntentLocked(int callingUid,
+ String targetPkg, Intent intent, int mode, NeededUriGrants needed) {
if (DEBUG_URI_PERMISSION) Slog.v(TAG,
- "Checking URI perm to " + (intent != null ? intent.getData() : null)
+ "Checking URI perm to data=" + (intent != null ? intent.getData() : null)
+ + " clip=" + (intent != null ? intent.getClipData() : null)
+ " from " + intent + "; flags=0x"
+ Integer.toHexString(intent != null ? intent.getFlags() : 0));
@@ -4859,33 +4872,74 @@
}
if (intent == null) {
- return -1;
+ return null;
}
Uri data = intent.getData();
- if (data == null) {
- return -1;
+ ClipData clip = intent.getClipData();
+ if (data == null && clip == null) {
+ return null;
}
- return checkGrantUriPermissionLocked(callingUid, targetPkg, data,
- intent.getFlags());
+ if (data != null) {
+ int target = checkGrantUriPermissionLocked(callingUid, targetPkg, data,
+ mode, needed != null ? needed.targetUid : -1);
+ if (target > 0) {
+ if (needed == null) {
+ needed = new NeededUriGrants(targetPkg, target, mode);
+ }
+ needed.add(data);
+ }
+ }
+ if (clip != null) {
+ for (int i=0; i<clip.getItemCount(); i++) {
+ Uri uri = clip.getItemAt(i).getUri();
+ if (uri != null) {
+ int target = -1;
+ target = checkGrantUriPermissionLocked(callingUid, targetPkg, uri,
+ mode, needed != null ? needed.targetUid : -1);
+ if (target > 0) {
+ if (needed == null) {
+ needed = new NeededUriGrants(targetPkg, target, mode);
+ }
+ needed.add(uri);
+ }
+ } else {
+ Intent clipIntent = clip.getItemAt(i).getIntent();
+ if (clipIntent != null) {
+ NeededUriGrants newNeeded = checkGrantUriPermissionFromIntentLocked(
+ callingUid, targetPkg, clipIntent, mode, needed);
+ if (newNeeded != null) {
+ needed = newNeeded;
+ }
+ }
+ }
+ }
+ }
+
+ return needed;
}
/**
* Like grantUriPermissionUncheckedLocked, but takes an Intent.
*/
- void grantUriPermissionUncheckedFromIntentLocked(int targetUid,
- String targetPkg, Intent intent, UriPermissionOwner owner) {
- grantUriPermissionUncheckedLocked(targetUid, targetPkg, intent.getData(),
- intent.getFlags(), owner);
+ void grantUriPermissionUncheckedFromIntentLocked(NeededUriGrants needed,
+ UriPermissionOwner owner) {
+ if (needed != null) {
+ for (int i=0; i<needed.size(); i++) {
+ grantUriPermissionUncheckedLocked(needed.targetUid, needed.targetPkg,
+ needed.get(i), needed.flags, owner);
+ }
+ }
}
void grantUriPermissionFromIntentLocked(int callingUid,
String targetPkg, Intent intent, UriPermissionOwner owner) {
- int targetUid = checkGrantUriPermissionFromIntentLocked(callingUid, targetPkg, intent);
- if (targetUid < 0) {
+ NeededUriGrants needed = checkGrantUriPermissionFromIntentLocked(callingUid, targetPkg,
+ intent, intent.getFlags(), null);
+ if (needed == null) {
return;
}
- grantUriPermissionUncheckedFromIntentLocked(targetUid, targetPkg, intent, owner);
+ grantUriPermissionUncheckedFromIntentLocked(needed, owner);
}
public void grantUriPermission(IApplicationThread caller, String targetPkg,
@@ -5406,7 +5460,7 @@
stopServiceLocked(sr);
} else {
sr.pendingStarts.add(new ServiceRecord.StartItem(sr, true,
- sr.makeNextStartId(), baseIntent, -1));
+ sr.makeNextStartId(), baseIntent, null));
if (sr.app != null && sr.app.thread != null) {
sendServiceArgsLocked(sr, false);
}
@@ -9044,7 +9098,7 @@
for (int i=0; i<N; i++) {
sb.setLength(0);
sb.append(" Intent: ");
- intents.get(i).toShortString(sb, false, true, false);
+ intents.get(i).toShortString(sb, false, true, false, false);
pw.println(sb.toString());
Bundle bundle = intents.get(i).getExtras();
if (bundle != null) {
@@ -9129,7 +9183,7 @@
ConnectionRecord conn = clist.get(i);
pw.print(" ");
pw.print(conn.binding.intent.intent.getIntent()
- .toShortString(false, false, false));
+ .toShortString(false, false, false, false));
pw.print(" -> ");
ProcessRecord proc = conn.binding.client;
pw.println(proc != null ? proc.toShortString() : "null");
@@ -9380,7 +9434,7 @@
// Complete + brief == give a summary. Isn't that obvious?!?
if (lastTask.intent != null) {
pw.print(prefix); pw.print(" ");
- pw.println(lastTask.intent.toInsecureString());
+ pw.println(lastTask.intent.toInsecureStringWithClip());
}
}
}
@@ -10692,9 +10746,9 @@
si.deliveredTime = SystemClock.uptimeMillis();
r.deliveredStarts.add(si);
si.deliveryCount++;
- if (si.targetPermissionUid >= 0 && si.intent != null) {
- grantUriPermissionUncheckedFromIntentLocked(si.targetPermissionUid,
- r.packageName, si.intent, si.getUriPermissionsLocked());
+ if (si.neededGrants != null) {
+ grantUriPermissionUncheckedFromIntentLocked(si.neededGrants,
+ si.getUriPermissionsLocked());
}
bumpServiceExecutingLocked(r, "start");
if (!oomAdjusted) {
@@ -10772,7 +10826,7 @@
boolean created = false;
try {
mStringBuilder.setLength(0);
- r.intent.getIntent().toShortString(mStringBuilder, true, false, true);
+ r.intent.getIntent().toShortString(mStringBuilder, true, false, true, false);
EventLog.writeEvent(EventLogTags.AM_CREATE_SERVICE,
System.identityHashCode(r), r.shortName,
mStringBuilder.toString(), r.app.pid);
@@ -10798,7 +10852,7 @@
// be called.
if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) {
r.pendingStarts.add(new ServiceRecord.StartItem(r, false, r.makeNextStartId(),
- null, -1));
+ null, null));
}
sendServiceArgsLocked(r, true);
@@ -11170,15 +11224,15 @@
? res.permission : "private to package");
}
ServiceRecord r = res.record;
- int targetPermissionUid = checkGrantUriPermissionFromIntentLocked(
- callingUid, r.packageName, service);
+ NeededUriGrants neededGrants = checkGrantUriPermissionFromIntentLocked(
+ callingUid, r.packageName, service, service.getFlags(), null);
if (unscheduleServiceRestartLocked(r)) {
if (DEBUG_SERVICE) Slog.v(TAG, "START SERVICE WHILE RESTART PENDING: " + r);
}
r.startRequested = true;
r.callStart = false;
r.pendingStarts.add(new ServiceRecord.StartItem(r, false, r.makeNextStartId(),
- service, targetPermissionUid));
+ service, neededGrants));
r.lastActivity = SystemClock.uptimeMillis();
synchronized (r.stats.getBatteryStats()) {
r.stats.startRunningLocked();
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index cdab6c6..a337b40 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -127,26 +127,27 @@
pw.print(prefix); pw.print("packageName="); pw.print(packageName);
pw.print(" processName="); pw.println(processName);
pw.print(prefix); pw.print("launchedFromUid="); pw.print(launchedFromUid);
- pw.print(prefix); pw.print("userId="); pw.print(userId);
- pw.print(" app="); pw.println(app);
- pw.print(prefix); pw.println(intent.toInsecureString());
+ pw.print(" userId="); pw.println(userId);
+ pw.print(prefix); pw.print("app="); pw.println(app);
+ pw.print(prefix); pw.println(intent.toInsecureStringWithClip());
pw.print(prefix); pw.print("frontOfTask="); pw.print(frontOfTask);
pw.print(" task="); pw.println(task);
pw.print(prefix); pw.print("taskAffinity="); pw.println(taskAffinity);
pw.print(prefix); pw.print("realActivity=");
pw.println(realActivity.flattenToShortString());
- pw.print(prefix); pw.print("base="); pw.print(baseDir);
- if (!resDir.equals(baseDir)) pw.print(" res="); pw.print(resDir);
- pw.print(" data="); pw.println(dataDir);
- pw.print(prefix); pw.print("labelRes=0x");
- pw.print(Integer.toHexString(labelRes));
- pw.print(" icon=0x"); pw.print(Integer.toHexString(icon));
- pw.print(" theme=0x"); pw.println(Integer.toHexString(theme));
+ pw.print(prefix); pw.print("baseDir="); pw.println(baseDir);
+ if (!resDir.equals(baseDir)) {
+ pw.print(prefix); pw.print("resDir="); pw.println(resDir);
+ }
+ pw.print(prefix); pw.print("dataDir="); pw.println(dataDir);
pw.print(prefix); pw.print("stateNotNeeded="); pw.print(stateNotNeeded);
pw.print(" componentSpecified="); pw.print(componentSpecified);
pw.print(" isHomeActivity="); pw.println(isHomeActivity);
+ pw.print(prefix); pw.print("compat="); pw.print(compat);
+ pw.print(" labelRes=0x"); pw.print(Integer.toHexString(labelRes));
+ pw.print(" icon=0x"); pw.print(Integer.toHexString(icon));
+ pw.print(" theme=0x"); pw.println(Integer.toHexString(theme));
pw.print(prefix); pw.print("config="); pw.println(configuration);
- pw.print(prefix); pw.print("compat="); pw.println(compat);
if (resultTo != null || resultWho != null) {
pw.print(prefix); pw.print("resultTo="); pw.print(resultTo);
pw.print(" resultWho="); pw.print(resultWho);
@@ -193,13 +194,11 @@
TimeUtils.formatDuration(launchTime, pw); pw.print(" startTime=");
TimeUtils.formatDuration(startTime, pw); pw.println("");
}
- if (lastVisibleTime != 0) {
- pw.print(prefix); pw.print("lastVisibleTime=");
- TimeUtils.formatDuration(lastVisibleTime, pw); pw.println("");
- }
- if (waitingVisible || nowVisible) {
+ if (lastVisibleTime != 0 || waitingVisible || nowVisible) {
pw.print(prefix); pw.print("waitingVisible="); pw.print(waitingVisible);
- pw.print(" nowVisible="); pw.println(nowVisible);
+ pw.print(" nowVisible="); pw.print(nowVisible);
+ pw.print("lastVisibleTime=");
+ TimeUtils.formatDuration(lastVisibleTime, pw); pw.println("");
}
if (configDestroy || configChangeFlags != 0) {
pw.print(prefix); pw.print("configDestroy="); pw.print(configDestroy);
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index f9641eb..a4e573d 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -1821,6 +1821,10 @@
if (below != null && below.finishing) {
continue;
}
+ // Don't check any lower in the stack if we're crossing a user boundary.
+ if (below != null && below.userId != taskTop.userId) {
+ break;
+ }
if (target == null) {
target = below;
targetI = i;
@@ -2290,8 +2294,8 @@
}
if (err == START_SUCCESS) {
- Slog.i(TAG, "START {" + intent.toShortString(true, true, true) + "} from pid "
- + (callerApp != null ? callerApp.pid : callingPid));
+ Slog.i(TAG, "START {" + intent.toShortString(true, true, true, false)
+ + "} from pid " + (callerApp != null ? callerApp.pid : callingPid));
}
ActivityRecord sourceRecord = null;
diff --git a/services/java/com/android/server/am/IntentBindRecord.java b/services/java/com/android/server/am/IntentBindRecord.java
index 2618c77..c94f714 100644
--- a/services/java/com/android/server/am/IntentBindRecord.java
+++ b/services/java/com/android/server/am/IntentBindRecord.java
@@ -54,7 +54,7 @@
void dumpInService(PrintWriter pw, String prefix) {
pw.print(prefix); pw.print("intent={");
- pw.print(intent.getIntent().toShortString(false, true, false));
+ pw.print(intent.getIntent().toShortString(false, true, false, false));
pw.println('}');
pw.print(prefix); pw.print("binder="); pw.println(binder);
pw.print(prefix); pw.print("requested="); pw.print(requested);
@@ -89,7 +89,7 @@
sb.append(service.shortName);
sb.append(':');
if (intent != null) {
- intent.getIntent().toShortString(sb, false, false, false);
+ intent.getIntent().toShortString(sb, false, false, false, false);
}
sb.append('}');
return stringName = sb.toString();
diff --git a/services/java/com/android/server/am/PendingIntentRecord.java b/services/java/com/android/server/am/PendingIntentRecord.java
index 3b6a97c..0043874 100644
--- a/services/java/com/android/server/am/PendingIntentRecord.java
+++ b/services/java/com/android/server/am/PendingIntentRecord.java
@@ -152,7 +152,7 @@
return "Key{" + typeName() + " pkg=" + packageName
+ " intent="
+ (requestIntent != null
- ? requestIntent.toShortString(false, true, false) : "<null>")
+ ? requestIntent.toShortString(false, true, false, false) : "<null>")
+ " flags=0x" + Integer.toHexString(flags) + "}";
}
@@ -320,7 +320,7 @@
}
if (key.requestIntent != null) {
pw.print(prefix); pw.print("requestIntent=");
- pw.println(key.requestIntent.toShortString(false, true, true));
+ pw.println(key.requestIntent.toShortString(false, true, true, true));
}
if (sent || canceled) {
pw.print(prefix); pw.print("sent="); pw.print(sent);
diff --git a/services/java/com/android/server/am/ServiceRecord.java b/services/java/com/android/server/am/ServiceRecord.java
index daa3653..828eef7 100644
--- a/services/java/com/android/server/am/ServiceRecord.java
+++ b/services/java/com/android/server/am/ServiceRecord.java
@@ -106,7 +106,7 @@
final boolean taskRemoved;
final int id;
final Intent intent;
- final int targetPermissionUid;
+ final ActivityManagerService.NeededUriGrants neededGrants;
long deliveredTime;
int deliveryCount;
int doneExecutingCount;
@@ -115,12 +115,12 @@
String stringName; // caching of toString
StartItem(ServiceRecord _sr, boolean _taskRemoved, int _id, Intent _intent,
- int _targetPermissionUid) {
+ ActivityManagerService.NeededUriGrants _neededGrants) {
sr = _sr;
taskRemoved = _taskRemoved;
id = _id;
intent = _intent;
- targetPermissionUid = _targetPermissionUid;
+ neededGrants = _neededGrants;
}
UriPermissionOwner getUriPermissionsLocked() {
@@ -177,9 +177,9 @@
pw.print(prefix); pw.print(" intent=");
if (si.intent != null) pw.println(si.intent.toString());
else pw.println("null");
- if (si.targetPermissionUid >= 0) {
- pw.print(prefix); pw.print(" targetPermissionUid=");
- pw.println(si.targetPermissionUid);
+ if (si.neededGrants != null) {
+ pw.print(prefix); pw.print(" neededGrants=");
+ pw.println(si.neededGrants);
}
if (si.uriPermissions != null) {
if (si.uriPermissions.readUriPermissions != null) {
@@ -196,7 +196,7 @@
void dump(PrintWriter pw, String prefix) {
pw.print(prefix); pw.print("intent={");
- pw.print(intent.getIntent().toShortString(false, true, false));
+ pw.print(intent.getIntent().toShortString(false, true, false, true));
pw.println('}');
pw.print(prefix); pw.print("packageName="); pw.println(packageName);
pw.print(prefix); pw.print("processName="); pw.println(processName);
diff --git a/services/java/com/android/server/am/TaskRecord.java b/services/java/com/android/server/am/TaskRecord.java
index 47ec218..67873cc 100644
--- a/services/java/com/android/server/am/TaskRecord.java
+++ b/services/java/com/android/server/am/TaskRecord.java
@@ -111,14 +111,14 @@
if (intent != null) {
StringBuilder sb = new StringBuilder(128);
sb.append(prefix); sb.append("intent={");
- intent.toShortString(sb, false, true, false);
+ intent.toShortString(sb, false, true, false, true);
sb.append('}');
pw.println(sb.toString());
}
if (affinityIntent != null) {
StringBuilder sb = new StringBuilder(128);
sb.append(prefix); sb.append("affinityIntent={");
- affinityIntent.toShortString(sb, false, true, false);
+ affinityIntent.toShortString(sb, false, true, false, true);
sb.append('}');
pw.println(sb.toString());
}
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 1c5a70f..18b51a7 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -6347,6 +6347,8 @@
synchronized (mWindowMap) {
mInputMonitor.setEventDispatchingLw(enabled);
}
+
+ sendScreenStatusToClients();
}
/**
@@ -6570,6 +6572,20 @@
mPolicy.systemReady();
}
+ private void sendScreenStatusToClients() {
+ final ArrayList<WindowState> windows = mWindows;
+ final int count = windows.size();
+ boolean on = mPowerManager.isScreenOn();
+ for (int i = count - 1; i >= 0; i--) {
+ WindowState win = mWindows.get(i);
+ try {
+ win.mClient.dispatchScreenState(on);
+ } catch (RemoteException e) {
+ // Ignored
+ }
+ }
+ }
+
// This is an animation that does nothing: it just immediately finishes
// itself every time it is called. It is used as a stub animation in cases
// where we want to synchronize multiple things that may be animating.
@@ -9157,7 +9173,7 @@
void scheduleAnimationLocked() {
if (!mAnimationScheduled) {
- mChoreographer.postAnimationCallback(mAnimationRunnable);
+ mChoreographer.postAnimationCallback(mAnimationRunnable, null);
mAnimationScheduled = true;
}
}
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
deleted file mode 100644
index aa1e426..0000000
--- a/services/surfaceflinger/Android.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- EventThread.cpp \
- Layer.cpp \
- LayerBase.cpp \
- LayerDim.cpp \
- LayerScreenshot.cpp \
- DdmConnection.cpp \
- DisplayHardware/DisplayHardware.cpp \
- DisplayHardware/DisplayHardwareBase.cpp \
- DisplayHardware/HWComposer.cpp \
- DisplayHardware/VSyncBarrier.cpp \
- DisplayEventConnection.cpp \
- GLExtensions.cpp \
- MessageQueue.cpp \
- SurfaceFlinger.cpp \
- SurfaceTextureLayer.cpp \
- Transform.cpp \
-
-
-LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-ifeq ($(TARGET_HAS_WAITFORVSYNC), true)
- LOCAL_CFLAGS += -DHAS_WAITFORVSYNC
-endif
-
-ifeq ($(TARGET_BOARD_PLATFORM), omap3)
- LOCAL_CFLAGS += -DNO_RGBX_8888
-endif
-ifeq ($(TARGET_BOARD_PLATFORM), omap4)
- LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
- LOCAL_CFLAGS += -DUSE_TRIPLE_BUFFERING
-endif
-ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
- LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY -DNEVER_DEFAULT_TO_ASYNC_MODE
-endif
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libhardware \
- libutils \
- libEGL \
- libGLESv1_CM \
- libbinder \
- libui \
- libgui
-
-# this is only needed for DDMS debugging
-LOCAL_SHARED_LIBRARIES += libdvm libandroid_runtime
-
-LOCAL_MODULE:= libsurfaceflinger
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/services/surfaceflinger/Barrier.h b/services/surfaceflinger/Barrier.h
deleted file mode 100644
index 6f8507e..0000000
--- a/services/surfaceflinger/Barrier.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_BARRIER_H
-#define ANDROID_BARRIER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <utils/threads.h>
-
-namespace android {
-
-class Barrier
-{
-public:
- inline Barrier() : state(CLOSED) { }
- inline ~Barrier() { }
- void open() {
- Mutex::Autolock _l(lock);
- state = OPENED;
- cv.broadcast();
- }
- void close() {
- Mutex::Autolock _l(lock);
- state = CLOSED;
- }
- void wait() const {
- Mutex::Autolock _l(lock);
- while (state == CLOSED) {
- cv.wait(lock);
- }
- }
-private:
- enum { OPENED, CLOSED };
- mutable Mutex lock;
- mutable Condition cv;
- volatile int state;
-};
-
-}; // namespace android
-
-#endif // ANDROID_BARRIER_H
diff --git a/services/surfaceflinger/DdmConnection.cpp b/services/surfaceflinger/DdmConnection.cpp
deleted file mode 100644
index 467a915..0000000
--- a/services/surfaceflinger/DdmConnection.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <android_runtime/AndroidRuntime.h>
-
-#include "jni.h"
-#include "DdmConnection.h"
-
-extern "C" jint Java_com_android_internal_util_WithFramework_registerNatives(
- JNIEnv* env, jclass clazz);
-
-namespace android {
-
-void DdmConnection::start(const char* name) {
- JavaVM* vm;
- JNIEnv* env;
-
- // start a VM
- JavaVMInitArgs args;
- JavaVMOption opt;
-
- opt.optionString =
- "-agentlib:jdwp=transport=dt_android_adb,suspend=n,server=y";
-
- args.version = JNI_VERSION_1_4;
- args.options = &opt;
- args.nOptions = 1;
- args.ignoreUnrecognized = JNI_FALSE;
-
- if (JNI_CreateJavaVM(&vm, &env, &args) == 0) {
- jclass startClass;
- jmethodID startMeth;
-
- // register native code
- if (Java_com_android_internal_util_WithFramework_registerNatives(env, 0) == 0) {
- // set our name by calling DdmHandleAppName.setAppName()
- startClass = env->FindClass("android/ddm/DdmHandleAppName");
- if (startClass) {
- startMeth = env->GetStaticMethodID(startClass,
- "setAppName", "(Ljava/lang/String;)V");
- if (startMeth) {
- jstring str = env->NewStringUTF(name);
- env->CallStaticVoidMethod(startClass, startMeth, str);
- env->DeleteLocalRef(str);
- }
- }
-
- // initialize DDMS communication by calling
- // DdmRegister.registerHandlers()
- startClass = env->FindClass("android/ddm/DdmRegister");
- if (startClass) {
- startMeth = env->GetStaticMethodID(startClass,
- "registerHandlers", "()V");
- if (startMeth) {
- env->CallStaticVoidMethod(startClass, startMeth);
- }
- }
- }
- }
-}
-
-}; // namespace android
diff --git a/services/surfaceflinger/DdmConnection.h b/services/surfaceflinger/DdmConnection.h
deleted file mode 100644
index 91b737c..0000000
--- a/services/surfaceflinger/DdmConnection.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_SF_DDM_CONNECTION
-#define ANDROID_SF_DDM_CONNECTION
-
-namespace android {
-
-class DdmConnection {
-public:
- static void start(const char* name);
-};
-
-}; // namespace android
-
-#endif /* ANDROID_SF_DDM_CONNECTION */
diff --git a/services/surfaceflinger/DisplayEventConnection.cpp b/services/surfaceflinger/DisplayEventConnection.cpp
deleted file mode 100644
index 77ecbd2..0000000
--- a/services/surfaceflinger/DisplayEventConnection.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <gui/IDisplayEventConnection.h>
-#include <gui/BitTube.h>
-#include <gui/DisplayEventReceiver.h>
-
-#include <utils/Errors.h>
-
-#include "SurfaceFlinger.h"
-#include "DisplayEventConnection.h"
-#include "EventThread.h"
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-DisplayEventConnection::DisplayEventConnection(
- const sp<EventThread>& eventThread)
- : mEventThread(eventThread), mChannel(new BitTube())
-{
-}
-
-DisplayEventConnection::~DisplayEventConnection() {
- mEventThread->unregisterDisplayEventConnection(this);
-}
-
-void DisplayEventConnection::onFirstRef() {
- // NOTE: mEventThread doesn't hold a strong reference on us
- mEventThread->registerDisplayEventConnection(this);
-}
-
-sp<BitTube> DisplayEventConnection::getDataChannel() const {
- return mChannel;
-}
-
-void DisplayEventConnection::setVsyncRate(uint32_t count) {
- mEventThread->setVsyncRate(count, this);
-}
-
-void DisplayEventConnection::requestNextVsync() {
- mEventThread->requestNextVsync(this);
-}
-
-status_t DisplayEventConnection::postEvent(const DisplayEventReceiver::Event& event)
-{
- ssize_t size = mChannel->write(&event, sizeof(DisplayEventReceiver::Event));
- return size < 0 ? status_t(size) : status_t(NO_ERROR);
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/services/surfaceflinger/DisplayEventConnection.h b/services/surfaceflinger/DisplayEventConnection.h
deleted file mode 100644
index cc3ee36..0000000
--- a/services/surfaceflinger/DisplayEventConnection.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_SURFACE_FLINGER_DISPLAY_EVENT_CONNECTION_H
-#define ANDROID_SURFACE_FLINGER_DISPLAY_EVENT_CONNECTION_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <gui/IDisplayEventConnection.h>
-
-#include <utils/Errors.h>
-#include <gui/DisplayEventReceiver.h>
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class BitTube;
-class EventThread;
-
-// ---------------------------------------------------------------------------
-
-class DisplayEventConnection : public BnDisplayEventConnection {
-public:
- DisplayEventConnection(const sp<EventThread>& flinger);
-
- status_t postEvent(const DisplayEventReceiver::Event& event);
-
-private:
- virtual ~DisplayEventConnection();
- virtual void onFirstRef();
- virtual sp<BitTube> getDataChannel() const;
- virtual void setVsyncRate(uint32_t count);
- virtual void requestNextVsync(); // asynchronous
-
- sp<EventThread> const mEventThread;
- sp<BitTube> const mChannel;
-};
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif /* ANDROID_SURFACE_FLINGER_DISPLAY_EVENT_CONNECTION_H */
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
deleted file mode 100644
index 9baae80..0000000
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include <cutils/properties.h>
-
-#include <utils/RefBase.h>
-#include <utils/Log.h>
-
-#include <ui/PixelFormat.h>
-#include <ui/FramebufferNativeWindow.h>
-
-#include <GLES/gl.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#include "DisplayHardware/DisplayHardware.h"
-
-#include <hardware/gralloc.h>
-
-#include "GLExtensions.h"
-#include "HWComposer.h"
-#include "SurfaceFlinger.h"
-
-using namespace android;
-
-
-static __attribute__((noinline))
-void checkGLErrors()
-{
- do {
- // there could be more than one error flag
- GLenum error = glGetError();
- if (error == GL_NO_ERROR)
- break;
- ALOGE("GL error 0x%04x", int(error));
- } while(true);
-}
-
-static __attribute__((noinline))
-void checkEGLErrors(const char* token)
-{
- struct EGLUtils {
- static const char *strerror(EGLint err) {
- switch (err){
- case EGL_SUCCESS: return "EGL_SUCCESS";
- case EGL_NOT_INITIALIZED: return "EGL_NOT_INITIALIZED";
- case EGL_BAD_ACCESS: return "EGL_BAD_ACCESS";
- case EGL_BAD_ALLOC: return "EGL_BAD_ALLOC";
- case EGL_BAD_ATTRIBUTE: return "EGL_BAD_ATTRIBUTE";
- case EGL_BAD_CONFIG: return "EGL_BAD_CONFIG";
- case EGL_BAD_CONTEXT: return "EGL_BAD_CONTEXT";
- case EGL_BAD_CURRENT_SURFACE: return "EGL_BAD_CURRENT_SURFACE";
- case EGL_BAD_DISPLAY: return "EGL_BAD_DISPLAY";
- case EGL_BAD_MATCH: return "EGL_BAD_MATCH";
- case EGL_BAD_NATIVE_PIXMAP: return "EGL_BAD_NATIVE_PIXMAP";
- case EGL_BAD_NATIVE_WINDOW: return "EGL_BAD_NATIVE_WINDOW";
- case EGL_BAD_PARAMETER: return "EGL_BAD_PARAMETER";
- case EGL_BAD_SURFACE: return "EGL_BAD_SURFACE";
- case EGL_CONTEXT_LOST: return "EGL_CONTEXT_LOST";
- default: return "UNKNOWN";
- }
- }
- };
-
- EGLint error = eglGetError();
- if (error && error != EGL_SUCCESS) {
- ALOGE("%s: EGL error 0x%04x (%s)",
- token, int(error), EGLUtils::strerror(error));
- }
-}
-
-/*
- * Initialize the display to the specified values.
- *
- */
-
-DisplayHardware::DisplayHardware(
- const sp<SurfaceFlinger>& flinger,
- uint32_t dpy)
- : DisplayHardwareBase(flinger, dpy),
- mFlinger(flinger), mFlags(0), mHwc(0)
-{
- init(dpy);
-}
-
-DisplayHardware::~DisplayHardware()
-{
- fini();
-}
-
-float DisplayHardware::getDpiX() const { return mDpiX; }
-float DisplayHardware::getDpiY() const { return mDpiY; }
-float DisplayHardware::getDensity() const { return mDensity; }
-float DisplayHardware::getRefreshRate() const { return mRefreshRate; }
-int DisplayHardware::getWidth() const { return mWidth; }
-int DisplayHardware::getHeight() const { return mHeight; }
-PixelFormat DisplayHardware::getFormat() const { return mFormat; }
-uint32_t DisplayHardware::getMaxTextureSize() const { return mMaxTextureSize; }
-
-uint32_t DisplayHardware::getMaxViewportDims() const {
- return mMaxViewportDims[0] < mMaxViewportDims[1] ?
- mMaxViewportDims[0] : mMaxViewportDims[1];
-}
-
-static status_t selectConfigForPixelFormat(
- EGLDisplay dpy,
- EGLint const* attrs,
- PixelFormat format,
- EGLConfig* outConfig)
-{
- EGLConfig config = NULL;
- EGLint numConfigs = -1, n=0;
- eglGetConfigs(dpy, NULL, 0, &numConfigs);
- EGLConfig* const configs = new EGLConfig[numConfigs];
- eglChooseConfig(dpy, attrs, configs, numConfigs, &n);
- for (int i=0 ; i<n ; i++) {
- EGLint nativeVisualId = 0;
- eglGetConfigAttrib(dpy, configs[i], EGL_NATIVE_VISUAL_ID, &nativeVisualId);
- if (nativeVisualId>0 && format == nativeVisualId) {
- *outConfig = configs[i];
- delete [] configs;
- return NO_ERROR;
- }
- }
- delete [] configs;
- return NAME_NOT_FOUND;
-}
-
-
-void DisplayHardware::init(uint32_t dpy)
-{
- mNativeWindow = new FramebufferNativeWindow();
- framebuffer_device_t const * fbDev = mNativeWindow->getDevice();
- if (!fbDev) {
- ALOGE("Display subsystem failed to initialize. check logs. exiting...");
- exit(0);
- }
-
- int format;
- ANativeWindow const * const window = mNativeWindow.get();
- window->query(window, NATIVE_WINDOW_FORMAT, &format);
- mDpiX = mNativeWindow->xdpi;
- mDpiY = mNativeWindow->ydpi;
- mRefreshRate = fbDev->fps;
- mNextFakeVSync = 0;
-
-
-/* FIXME: this is a temporary HACK until we are able to report the refresh rate
- * properly from the HAL. The WindowManagerService now relies on this value.
- */
-#ifndef REFRESH_RATE
- mRefreshRate = fbDev->fps;
-#else
- mRefreshRate = REFRESH_RATE;
-#warning "refresh rate set via makefile to REFRESH_RATE"
-#endif
-
- mRefreshPeriod = nsecs_t(1e9 / mRefreshRate);
-
- EGLint w, h, dummy;
- EGLint numConfigs=0;
- EGLSurface surface;
- EGLContext context;
- EGLBoolean result;
- status_t err;
-
- // initialize EGL
- EGLint attribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_NONE, 0,
- EGL_NONE
- };
-
- // debug: disable h/w rendering
- char property[PROPERTY_VALUE_MAX];
- if (property_get("debug.sf.hw", property, NULL) > 0) {
- if (atoi(property) == 0) {
- ALOGW("H/W composition disabled");
- attribs[2] = EGL_CONFIG_CAVEAT;
- attribs[3] = EGL_SLOW_CONFIG;
- }
- }
-
- // TODO: all the extensions below should be queried through
- // eglGetProcAddress().
-
- EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglInitialize(display, NULL, NULL);
- eglGetConfigs(display, NULL, 0, &numConfigs);
-
- EGLConfig config = NULL;
- err = selectConfigForPixelFormat(display, attribs, format, &config);
- ALOGE_IF(err, "couldn't find an EGLConfig matching the screen format");
-
- EGLint r,g,b,a;
- eglGetConfigAttrib(display, config, EGL_RED_SIZE, &r);
- eglGetConfigAttrib(display, config, EGL_GREEN_SIZE, &g);
- eglGetConfigAttrib(display, config, EGL_BLUE_SIZE, &b);
- eglGetConfigAttrib(display, config, EGL_ALPHA_SIZE, &a);
-
- if (mNativeWindow->isUpdateOnDemand()) {
- mFlags |= PARTIAL_UPDATES;
- }
-
- if (eglGetConfigAttrib(display, config, EGL_CONFIG_CAVEAT, &dummy) == EGL_TRUE) {
- if (dummy == EGL_SLOW_CONFIG)
- mFlags |= SLOW_CONFIG;
- }
-
- /*
- * Create our main surface
- */
-
- surface = eglCreateWindowSurface(display, config, mNativeWindow.get(), NULL);
- eglQuerySurface(display, surface, EGL_WIDTH, &mWidth);
- eglQuerySurface(display, surface, EGL_HEIGHT, &mHeight);
-
- if (mFlags & PARTIAL_UPDATES) {
- // if we have partial updates, we definitely don't need to
- // preserve the backbuffer, which may be costly.
- eglSurfaceAttrib(display, surface,
- EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED);
- }
-
- if (eglQuerySurface(display, surface, EGL_SWAP_BEHAVIOR, &dummy) == EGL_TRUE) {
- if (dummy == EGL_BUFFER_PRESERVED) {
- mFlags |= BUFFER_PRESERVED;
- }
- }
-
- /* Read density from build-specific ro.sf.lcd_density property
- * except if it is overridden by qemu.sf.lcd_density.
- */
- if (property_get("qemu.sf.lcd_density", property, NULL) <= 0) {
- if (property_get("ro.sf.lcd_density", property, NULL) <= 0) {
- ALOGW("ro.sf.lcd_density not defined, using 160 dpi by default.");
- strcpy(property, "160");
- }
- } else {
- /* for the emulator case, reset the dpi values too */
- mDpiX = mDpiY = atoi(property);
- }
- mDensity = atoi(property) * (1.0f/160.0f);
-
-
- /*
- * Create our OpenGL ES context
- */
-
-
- EGLint contextAttributes[] = {
-#ifdef EGL_IMG_context_priority
-#ifdef HAS_CONTEXT_PRIORITY
-#warning "using EGL_IMG_context_priority"
- EGL_CONTEXT_PRIORITY_LEVEL_IMG, EGL_CONTEXT_PRIORITY_HIGH_IMG,
-#endif
-#endif
- EGL_NONE, EGL_NONE
- };
- context = eglCreateContext(display, config, NULL, contextAttributes);
-
- mDisplay = display;
- mConfig = config;
- mSurface = surface;
- mContext = context;
- mFormat = fbDev->format;
- mPageFlipCount = 0;
-
- /*
- * Gather OpenGL ES extensions
- */
-
- result = eglMakeCurrent(display, surface, surface, context);
- if (!result) {
- ALOGE("Couldn't create a working GLES context. check logs. exiting...");
- exit(0);
- }
-
- GLExtensions& extensions(GLExtensions::getInstance());
- extensions.initWithGLStrings(
- glGetString(GL_VENDOR),
- glGetString(GL_RENDERER),
- glGetString(GL_VERSION),
- glGetString(GL_EXTENSIONS),
- eglQueryString(display, EGL_VENDOR),
- eglQueryString(display, EGL_VERSION),
- eglQueryString(display, EGL_EXTENSIONS));
-
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
- glGetIntegerv(GL_MAX_VIEWPORT_DIMS, mMaxViewportDims);
-
- ALOGI("EGL informations:");
- ALOGI("# of configs : %d", numConfigs);
- ALOGI("vendor : %s", extensions.getEglVendor());
- ALOGI("version : %s", extensions.getEglVersion());
- ALOGI("extensions: %s", extensions.getEglExtension());
- ALOGI("Client API: %s", eglQueryString(display, EGL_CLIENT_APIS)?:"Not Supported");
- ALOGI("EGLSurface: %d-%d-%d-%d, config=%p", r, g, b, a, config);
-
- ALOGI("OpenGL informations:");
- ALOGI("vendor : %s", extensions.getVendor());
- ALOGI("renderer : %s", extensions.getRenderer());
- ALOGI("version : %s", extensions.getVersion());
- ALOGI("extensions: %s", extensions.getExtension());
- ALOGI("GL_MAX_TEXTURE_SIZE = %d", mMaxTextureSize);
- ALOGI("GL_MAX_VIEWPORT_DIMS = %d x %d", mMaxViewportDims[0], mMaxViewportDims[1]);
- ALOGI("flags = %08x", mFlags);
-
- // Unbind the context from this thread
- eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-
-
- // initialize the H/W composer
- mHwc = new HWComposer(mFlinger);
- if (mHwc->initCheck() == NO_ERROR) {
- mHwc->setFrameBuffer(mDisplay, mSurface);
- }
-}
-
-HWComposer& DisplayHardware::getHwComposer() const {
- return *mHwc;
-}
-
-/*
- * Clean up. Throw out our local state.
- *
- * (It's entirely possible we'll never get here, since this is meant
- * for real hardware, which doesn't restart.)
- */
-
-void DisplayHardware::fini()
-{
- eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- eglTerminate(mDisplay);
-}
-
-void DisplayHardware::releaseScreen() const
-{
- DisplayHardwareBase::releaseScreen();
- if (mHwc->initCheck() == NO_ERROR) {
- mHwc->release();
- }
-}
-
-void DisplayHardware::acquireScreen() const
-{
- DisplayHardwareBase::acquireScreen();
-}
-
-uint32_t DisplayHardware::getPageFlipCount() const {
- return mPageFlipCount;
-}
-
-// this needs to be thread safe
-nsecs_t DisplayHardware::waitForRefresh() const {
- nsecs_t timestamp;
- if (mVSync.wait(×tamp) < 0) {
- // vsync not supported!
- usleep( getDelayToNextVSyncUs(×tamp) );
- }
- mLastHwVSync = timestamp; // FIXME: Not thread safe
- return timestamp;
-}
-
-nsecs_t DisplayHardware::getRefreshTimestamp() const {
- // this returns the last refresh timestamp.
- // if the last one is not available, we estimate it based on
- // the refresh period and whatever closest timestamp we have.
- nsecs_t now = systemTime();
- return now - ((now - mLastHwVSync) % mRefreshPeriod);
-}
-
-nsecs_t DisplayHardware::getRefreshPeriod() const {
- return mRefreshPeriod;
-}
-
-int32_t DisplayHardware::getDelayToNextVSyncUs(nsecs_t* timestamp) const {
- Mutex::Autolock _l(mFakeVSyncMutex);
- const nsecs_t period = mRefreshPeriod;
- const nsecs_t now = systemTime(CLOCK_MONOTONIC);
- nsecs_t next_vsync = mNextFakeVSync;
- nsecs_t sleep = next_vsync - now;
- if (sleep < 0) {
- // we missed, find where the next vsync should be
- sleep = (period - ((now - next_vsync) % period));
- next_vsync = now + sleep;
- }
- mNextFakeVSync = next_vsync + period;
- timestamp[0] = next_vsync;
-
- // round to next microsecond
- int32_t sleep_us = (sleep + 999LL) / 1000LL;
-
- // guaranteed to be > 0
- return sleep_us;
-}
-
-status_t DisplayHardware::compositionComplete() const {
- return mNativeWindow->compositionComplete();
-}
-
-void DisplayHardware::flip(const Region& dirty) const
-{
- checkGLErrors();
-
- EGLDisplay dpy = mDisplay;
- EGLSurface surface = mSurface;
-
-#ifdef EGL_ANDROID_swap_rectangle
- if (mFlags & SWAP_RECTANGLE) {
- const Region newDirty(dirty.intersect(bounds()));
- const Rect b(newDirty.getBounds());
- eglSetSwapRectangleANDROID(dpy, surface,
- b.left, b.top, b.width(), b.height());
- }
-#endif
-
- if (mFlags & PARTIAL_UPDATES) {
- mNativeWindow->setUpdateRectangle(dirty.getBounds());
- }
-
- mPageFlipCount++;
-
- if (mHwc->initCheck() == NO_ERROR) {
- mHwc->commit();
- } else {
- eglSwapBuffers(dpy, surface);
- }
- checkEGLErrors("eglSwapBuffers");
-
- // for debugging
- //glClearColor(1,0,0,0);
- //glClear(GL_COLOR_BUFFER_BIT);
-}
-
-uint32_t DisplayHardware::getFlags() const
-{
- return mFlags;
-}
-
-void DisplayHardware::makeCurrent() const
-{
- eglMakeCurrent(mDisplay, mSurface, mSurface, mContext);
-}
-
-void DisplayHardware::dump(String8& res) const
-{
- mNativeWindow->dump(res);
-}
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.h b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
deleted file mode 100644
index 0a828b3..0000000
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_DISPLAY_HARDWARE_H
-#define ANDROID_DISPLAY_HARDWARE_H
-
-#include <stdlib.h>
-
-#include <ui/PixelFormat.h>
-#include <ui/Region.h>
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#include "GLExtensions.h"
-
-#include "DisplayHardware/DisplayHardwareBase.h"
-#include "DisplayHardware/VSyncBarrier.h"
-
-namespace android {
-
-class FramebufferNativeWindow;
-class HWComposer;
-
-class DisplayHardware : public DisplayHardwareBase
-{
-public:
- enum {
- COPY_BITS_EXTENSION = 0x00000008,
- BUFFER_PRESERVED = 0x00010000,
- PARTIAL_UPDATES = 0x00020000, // video driver feature
- SLOW_CONFIG = 0x00040000, // software
- SWAP_RECTANGLE = 0x00080000,
- };
-
- DisplayHardware(
- const sp<SurfaceFlinger>& flinger,
- uint32_t displayIndex);
-
- ~DisplayHardware();
-
- void releaseScreen() const;
- void acquireScreen() const;
-
- // Flip the front and back buffers if the back buffer is "dirty". Might
- // be instantaneous, might involve copying the frame buffer around.
- void flip(const Region& dirty) const;
-
- float getDpiX() const;
- float getDpiY() const;
- float getRefreshRate() const;
- float getDensity() const;
- int getWidth() const;
- int getHeight() const;
- PixelFormat getFormat() const;
- uint32_t getFlags() const;
- void makeCurrent() const;
- uint32_t getMaxTextureSize() const;
- uint32_t getMaxViewportDims() const;
-
- // waits for the next vsync and returns the timestamp of when it happened
- nsecs_t waitForRefresh() const;
- nsecs_t getRefreshPeriod() const;
- nsecs_t getRefreshTimestamp() const;
-
- uint32_t getPageFlipCount() const;
- EGLDisplay getEGLDisplay() const { return mDisplay; }
-
- void dump(String8& res) const;
-
- // Hardware Composer
- HWComposer& getHwComposer() const;
-
- status_t compositionComplete() const;
-
- Rect getBounds() const {
- return Rect(mWidth, mHeight);
- }
- inline Rect bounds() const { return getBounds(); }
-
-private:
- void init(uint32_t displayIndex) __attribute__((noinline));
- void fini() __attribute__((noinline));
- int32_t getDelayToNextVSyncUs(nsecs_t* timestamp) const;
-
- sp<SurfaceFlinger> mFlinger;
- EGLDisplay mDisplay;
- EGLSurface mSurface;
- EGLContext mContext;
- EGLConfig mConfig;
- float mDpiX;
- float mDpiY;
- float mRefreshRate;
- float mDensity;
- int mWidth;
- int mHeight;
- PixelFormat mFormat;
- uint32_t mFlags;
- mutable uint32_t mPageFlipCount;
- GLint mMaxViewportDims[2];
- GLint mMaxTextureSize;
- VSyncBarrier mVSync;
-
- mutable Mutex mFakeVSyncMutex;
- mutable nsecs_t mNextFakeVSync;
- nsecs_t mRefreshPeriod;
- mutable nsecs_t mLastHwVSync;
-
- HWComposer* mHwc;
-
- sp<FramebufferNativeWindow> mNativeWindow;
-};
-
-}; // namespace android
-
-#endif // ANDROID_DISPLAY_HARDWARE_H
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
deleted file mode 100644
index 69f1aca..0000000
--- a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
+++ /dev/null
@@ -1,147 +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.
- */
-
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <utils/Log.h>
-
-#include "DisplayHardware/DisplayHardwareBase.h"
-#include "SurfaceFlinger.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-
-static char const * const kSleepFileName = "/sys/power/wait_for_fb_sleep";
-static char const * const kWakeFileName = "/sys/power/wait_for_fb_wake";
-
-// ----------------------------------------------------------------------------
-
-DisplayHardwareBase::DisplayEventThread::DisplayEventThread(
- const sp<SurfaceFlinger>& flinger)
- : Thread(false), mFlinger(flinger) {
-}
-
-DisplayHardwareBase::DisplayEventThread::~DisplayEventThread() {
-}
-
-status_t DisplayHardwareBase::DisplayEventThread::initCheck() const {
- return ((access(kSleepFileName, R_OK) == 0 &&
- access(kWakeFileName, R_OK) == 0)) ? NO_ERROR : NO_INIT;
-}
-
-bool DisplayHardwareBase::DisplayEventThread::threadLoop() {
-
- if (waitForFbSleep() == NO_ERROR) {
- sp<SurfaceFlinger> flinger = mFlinger.promote();
- ALOGD("About to give-up screen, flinger = %p", flinger.get());
- if (flinger != 0) {
- mBarrier.close();
- flinger->screenReleased(0);
- mBarrier.wait();
- }
- if (waitForFbWake() == NO_ERROR) {
- sp<SurfaceFlinger> flinger = mFlinger.promote();
- ALOGD("Screen about to return, flinger = %p", flinger.get());
- if (flinger != 0) {
- flinger->screenAcquired(0);
- }
- return true;
- }
- }
-
- // error, exit the thread
- return false;
-}
-
-status_t DisplayHardwareBase::DisplayEventThread::waitForFbSleep() {
- int err = 0;
- char buf;
- int fd = open(kSleepFileName, O_RDONLY, 0);
- // if the file doesn't exist, the error will be caught in read() below
- do {
- err = read(fd, &buf, 1);
- } while (err < 0 && errno == EINTR);
- close(fd);
- ALOGE_IF(err<0, "*** ANDROID_WAIT_FOR_FB_SLEEP failed (%s)", strerror(errno));
- return err < 0 ? -errno : int(NO_ERROR);
-}
-
-status_t DisplayHardwareBase::DisplayEventThread::waitForFbWake() {
- int err = 0;
- char buf;
- int fd = open(kWakeFileName, O_RDONLY, 0);
- // if the file doesn't exist, the error will be caught in read() below
- do {
- err = read(fd, &buf, 1);
- } while (err < 0 && errno == EINTR);
- close(fd);
- ALOGE_IF(err<0, "*** ANDROID_WAIT_FOR_FB_WAKE failed (%s)", strerror(errno));
- return err < 0 ? -errno : int(NO_ERROR);
-}
-
-status_t DisplayHardwareBase::DisplayEventThread::releaseScreen() const {
- mBarrier.open();
- return NO_ERROR;
-}
-
-// ----------------------------------------------------------------------------
-
-DisplayHardwareBase::DisplayHardwareBase(const sp<SurfaceFlinger>& flinger,
- uint32_t displayIndex)
- : mScreenAcquired(true)
-{
- mDisplayEventThread = new DisplayEventThread(flinger);
-}
-
-void DisplayHardwareBase::startSleepManagement() const {
- if (mDisplayEventThread->initCheck() == NO_ERROR) {
- mDisplayEventThread->run("DisplayEventThread", PRIORITY_URGENT_DISPLAY);
- } else {
- ALOGW("/sys/power/wait_for_fb_{wake|sleep} don't exist");
- }
-}
-
-DisplayHardwareBase::~DisplayHardwareBase() {
- // request exit
- mDisplayEventThread->requestExitAndWait();
-}
-
-bool DisplayHardwareBase::canDraw() const {
- return mScreenAcquired;
-}
-
-void DisplayHardwareBase::releaseScreen() const {
- status_t err = mDisplayEventThread->releaseScreen();
- if (err >= 0) {
- mScreenAcquired = false;
- }
-}
-
-void DisplayHardwareBase::acquireScreen() const {
- mScreenAcquired = true;
-}
-
-bool DisplayHardwareBase::isScreenAcquired() const {
- return mScreenAcquired;
-}
-
-}; // namespace android
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h
deleted file mode 100644
index fba211b..0000000
--- a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h
+++ /dev/null
@@ -1,68 +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.
- */
-
-#ifndef ANDROID_DISPLAY_HARDWARE_BASE_H
-#define ANDROID_DISPLAY_HARDWARE_BASE_H
-
-#include <stdint.h>
-#include <utils/RefBase.h>
-#include <utils/threads.h>
-#include "Barrier.h"
-
-namespace android {
-
-class SurfaceFlinger;
-
-class DisplayHardwareBase
-{
-public:
- DisplayHardwareBase(
- const sp<SurfaceFlinger>& flinger,
- uint32_t displayIndex);
-
- ~DisplayHardwareBase();
-
- void startSleepManagement() const;
-
- // console management
- void releaseScreen() const;
- void acquireScreen() const;
- bool isScreenAcquired() const;
-
- bool canDraw() const;
-
-
-private:
- class DisplayEventThread : public Thread {
- wp<SurfaceFlinger> mFlinger;
- mutable Barrier mBarrier;
- status_t waitForFbSleep();
- status_t waitForFbWake();
- public:
- DisplayEventThread(const sp<SurfaceFlinger>& flinger);
- virtual ~DisplayEventThread();
- virtual bool threadLoop();
- status_t releaseScreen() const;
- status_t initCheck() const;
- };
-
- sp<DisplayEventThread> mDisplayEventThread;
- mutable int mScreenAcquired;
-};
-
-}; // namespace android
-
-#endif // ANDROID_DISPLAY_HARDWARE_BASE_H
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
deleted file mode 100644
index f17bf43..0000000
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/String8.h>
-#include <utils/Vector.h>
-
-#include <hardware/hardware.h>
-
-#include <cutils/log.h>
-
-#include <EGL/egl.h>
-
-#include "LayerBase.h"
-#include "HWComposer.h"
-#include "SurfaceFlinger.h"
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-HWComposer::HWComposer(const sp<SurfaceFlinger>& flinger)
- : mFlinger(flinger),
- mModule(0), mHwc(0), mList(0), mCapacity(0),
- mNumOVLayers(0), mNumFBLayers(0),
- mDpy(EGL_NO_DISPLAY), mSur(EGL_NO_SURFACE)
-{
- int err = hw_get_module(HWC_HARDWARE_MODULE_ID, &mModule);
- ALOGW_IF(err, "%s module not found", HWC_HARDWARE_MODULE_ID);
- if (err == 0) {
- err = hwc_open(mModule, &mHwc);
- ALOGE_IF(err, "%s device failed to initialize (%s)",
- HWC_HARDWARE_COMPOSER, strerror(-err));
- if (err == 0) {
- if (mHwc->registerProcs) {
- mCBContext.hwc = this;
- mCBContext.procs.invalidate = &hook_invalidate;
- mHwc->registerProcs(mHwc, &mCBContext.procs);
- }
- }
- }
-}
-
-HWComposer::~HWComposer() {
- free(mList);
- if (mHwc) {
- hwc_close(mHwc);
- }
-}
-
-status_t HWComposer::initCheck() const {
- return mHwc ? NO_ERROR : NO_INIT;
-}
-
-void HWComposer::hook_invalidate(struct hwc_procs* procs) {
- reinterpret_cast<cb_context *>(procs)->hwc->invalidate();
-}
-
-void HWComposer::invalidate() {
- mFlinger->repaintEverything();
-}
-
-void HWComposer::setFrameBuffer(EGLDisplay dpy, EGLSurface sur) {
- mDpy = (hwc_display_t)dpy;
- mSur = (hwc_surface_t)sur;
-}
-
-status_t HWComposer::createWorkList(size_t numLayers) {
- if (mHwc) {
- if (!mList || mCapacity < numLayers) {
- free(mList);
- size_t size = sizeof(hwc_layer_list) + numLayers*sizeof(hwc_layer_t);
- mList = (hwc_layer_list_t*)malloc(size);
- mCapacity = numLayers;
- }
- mList->flags = HWC_GEOMETRY_CHANGED;
- mList->numHwLayers = numLayers;
- }
- return NO_ERROR;
-}
-
-status_t HWComposer::prepare() const {
- int err = mHwc->prepare(mHwc, mList);
- if (err == NO_ERROR) {
- size_t numOVLayers = 0;
- size_t numFBLayers = 0;
- size_t count = mList->numHwLayers;
- for (size_t i=0 ; i<count ; i++) {
- hwc_layer& l(mList->hwLayers[i]);
- if (l.flags & HWC_SKIP_LAYER) {
- l.compositionType = HWC_FRAMEBUFFER;
- }
- switch (l.compositionType) {
- case HWC_OVERLAY:
- numOVLayers++;
- break;
- case HWC_FRAMEBUFFER:
- numFBLayers++;
- break;
- }
- }
- mNumOVLayers = numOVLayers;
- mNumFBLayers = numFBLayers;
- }
- return (status_t)err;
-}
-
-size_t HWComposer::getLayerCount(int type) const {
- switch (type) {
- case HWC_OVERLAY:
- return mNumOVLayers;
- case HWC_FRAMEBUFFER:
- return mNumFBLayers;
- }
- return 0;
-}
-
-status_t HWComposer::commit() const {
- int err = mHwc->set(mHwc, mDpy, mSur, mList);
- if (mList) {
- mList->flags &= ~HWC_GEOMETRY_CHANGED;
- }
- return (status_t)err;
-}
-
-status_t HWComposer::release() const {
- if (mHwc) {
- int err = mHwc->set(mHwc, NULL, NULL, NULL);
- return (status_t)err;
- }
- return NO_ERROR;
-}
-
-status_t HWComposer::disable() {
- if (mHwc) {
- free(mList);
- mList = NULL;
- int err = mHwc->prepare(mHwc, NULL);
- return (status_t)err;
- }
- return NO_ERROR;
-}
-
-size_t HWComposer::getNumLayers() const {
- return mList ? mList->numHwLayers : 0;
-}
-
-hwc_layer_t* HWComposer::getLayers() const {
- return mList ? mList->hwLayers : 0;
-}
-
-void HWComposer::dump(String8& result, char* buffer, size_t SIZE,
- const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const {
- if (mHwc && mList) {
- result.append("Hardware Composer state:\n");
-
- snprintf(buffer, SIZE, " numHwLayers=%u, flags=%08x\n",
- mList->numHwLayers, mList->flags);
- result.append(buffer);
- result.append(
- " type | handle | hints | flags | tr | blend | format | source crop | frame name \n"
- "----------+----------+----------+----------+----+-------+----------+---------------------------+--------------------------------\n");
- // " ________ | ________ | ________ | ________ | __ | _____ | ________ | [_____,_____,_____,_____] | [_____,_____,_____,_____]
- for (size_t i=0 ; i<mList->numHwLayers ; i++) {
- const hwc_layer_t& l(mList->hwLayers[i]);
- const sp<LayerBase> layer(visibleLayersSortedByZ[i]);
- int32_t format = -1;
- if (layer->getLayer() != NULL) {
- const sp<GraphicBuffer>& buffer(layer->getLayer()->getActiveBuffer());
- if (buffer != NULL) {
- format = buffer->getPixelFormat();
- }
- }
- snprintf(buffer, SIZE,
- " %8s | %08x | %08x | %08x | %02x | %05x | %08x | [%5d,%5d,%5d,%5d] | [%5d,%5d,%5d,%5d] %s\n",
- l.compositionType ? "OVERLAY" : "FB",
- intptr_t(l.handle), l.hints, l.flags, l.transform, l.blending, format,
- l.sourceCrop.left, l.sourceCrop.top, l.sourceCrop.right, l.sourceCrop.bottom,
- l.displayFrame.left, l.displayFrame.top, l.displayFrame.right, l.displayFrame.bottom,
- layer->getName().string());
- result.append(buffer);
- }
- }
- if (mHwc && mHwc->common.version >= 1 && mHwc->dump) {
- mHwc->dump(mHwc, buffer, SIZE);
- result.append(buffer);
- }
-}
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h
deleted file mode 100644
index aa8ebe1..0000000
--- a/services/surfaceflinger/DisplayHardware/HWComposer.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_SF_HWCOMPOSER_H
-#define ANDROID_SF_HWCOMPOSER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <EGL/egl.h>
-
-#include <hardware/hwcomposer.h>
-
-#include <utils/StrongPointer.h>
-#include <utils/Vector.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-class String8;
-class SurfaceFlinger;
-class LayerBase;
-
-class HWComposer
-{
-public:
-
- HWComposer(const sp<SurfaceFlinger>& flinger);
- ~HWComposer();
-
- status_t initCheck() const;
-
- // tells the HAL what the framebuffer is
- void setFrameBuffer(EGLDisplay dpy, EGLSurface sur);
-
- // create a work list for numLayers layer
- status_t createWorkList(size_t numLayers);
-
- // Asks the HAL what it can do
- status_t prepare() const;
-
- // disable hwc until next createWorkList
- status_t disable();
-
- // commits the list
- status_t commit() const;
-
- // release hardware resources
- status_t release() const;
-
- size_t getNumLayers() const;
- hwc_layer_t* getLayers() const;
-
- // updated in preapre()
- size_t getLayerCount(int type) const;
-
- // for debugging
- void dump(String8& out, char* scratch, size_t SIZE,
- const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const;
-
-private:
- struct cb_context {
- hwc_procs_t procs;
- HWComposer* hwc;
- };
- static void hook_invalidate(struct hwc_procs* procs);
- void invalidate();
-
- sp<SurfaceFlinger> mFlinger;
- hw_module_t const* mModule;
- hwc_composer_device_t* mHwc;
- hwc_layer_list_t* mList;
- size_t mCapacity;
- mutable size_t mNumOVLayers;
- mutable size_t mNumFBLayers;
- hwc_display_t mDpy;
- hwc_surface_t mSur;
- cb_context mCBContext;
-};
-
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_SF_HWCOMPOSER_H
diff --git a/services/surfaceflinger/DisplayHardware/VSyncBarrier.cpp b/services/surfaceflinger/DisplayHardware/VSyncBarrier.cpp
deleted file mode 100644
index 187da20..0000000
--- a/services/surfaceflinger/DisplayHardware/VSyncBarrier.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <linux/fb.h>
-
-#include "DisplayHardware/VSyncBarrier.h"
-
-#ifndef FBIO_WAITFORVSYNC
-#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
-#endif
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-VSyncBarrier::VSyncBarrier() : mFd(-EINVAL) {
-#if HAS_WAITFORVSYNC
- mFd = open("/dev/graphics/fb0", O_RDWR);
- if (mFd < 0) {
- mFd = -errno;
- }
- // try to see if FBIO_WAITFORVSYNC is supported
- uint32_t crt = 0;
- int err = ioctl(mFd, FBIO_WAITFORVSYNC, &crt);
- if (err < 0) {
- close(mFd);
- mFd = -EINVAL;
- }
-#endif
-}
-
-VSyncBarrier::~VSyncBarrier() {
- if (mFd >= 0) {
- close(mFd);
- }
-}
-
-status_t VSyncBarrier::initCheck() const {
- return mFd < 0 ? mFd : status_t(NO_ERROR);
-}
-
-// this must be thread-safe
-status_t VSyncBarrier::wait(nsecs_t* timestamp) const {
- if (mFd < 0) {
- return mFd;
- }
-
- int err;
- uint32_t crt = 0;
- do {
- err = ioctl(mFd, FBIO_WAITFORVSYNC, &crt);
- } while (err<0 && errno==EINTR);
- if (err < 0) {
- return -errno;
- }
- // ideally this would come from the driver
- timestamp[0] = systemTime();
- return NO_ERROR;
-}
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/services/surfaceflinger/DisplayHardware/VSyncBarrier.h b/services/surfaceflinger/DisplayHardware/VSyncBarrier.h
deleted file mode 100644
index 3c32950..0000000
--- a/services/surfaceflinger/DisplayHardware/VSyncBarrier.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_SURFACE_FLINGER_VSYNCBARRIER_H_
-#define ANDROID_SURFACE_FLINGER_VSYNCBARRIER_H_
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/Timers.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-class VSyncBarrier {
- int mFd;
-public:
- VSyncBarrier();
- ~VSyncBarrier();
- status_t initCheck() const;
- status_t wait(nsecs_t* timestamp) const;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif /* ANDROID_SURFACE_FLINGER_VSYNCBARRIER_H_ */
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
deleted file mode 100644
index 3c045d7..0000000
--- a/services/surfaceflinger/EventThread.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <gui/IDisplayEventConnection.h>
-#include <gui/DisplayEventReceiver.h>
-
-#include <utils/Errors.h>
-#include <utils/Trace.h>
-
-#include "DisplayHardware/DisplayHardware.h"
-#include "DisplayEventConnection.h"
-#include "EventThread.h"
-#include "SurfaceFlinger.h"
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-EventThread::EventThread(const sp<SurfaceFlinger>& flinger)
- : mFlinger(flinger),
- mHw(flinger->graphicPlane(0).displayHardware()),
- mLastVSyncTimestamp(0),
- mDeliveredEvents(0)
-{
-}
-
-void EventThread::onFirstRef() {
- run("EventThread", PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);
-}
-
-sp<DisplayEventConnection> EventThread::createEventConnection() const {
- return new DisplayEventConnection(const_cast<EventThread*>(this));
-}
-
-nsecs_t EventThread::getLastVSyncTimestamp() const {
- Mutex::Autolock _l(mLock);
- return mLastVSyncTimestamp;
-}
-
-nsecs_t EventThread::getVSyncPeriod() const {
- return mHw.getRefreshPeriod();
-
-}
-
-status_t EventThread::registerDisplayEventConnection(
- const sp<DisplayEventConnection>& connection) {
- Mutex::Autolock _l(mLock);
- ConnectionInfo info;
- mDisplayEventConnections.add(connection, info);
- mCondition.signal();
- return NO_ERROR;
-}
-
-status_t EventThread::unregisterDisplayEventConnection(
- const wp<DisplayEventConnection>& connection) {
- Mutex::Autolock _l(mLock);
- mDisplayEventConnections.removeItem(connection);
- mCondition.signal();
- return NO_ERROR;
-}
-
-void EventThread::removeDisplayEventConnection(
- const wp<DisplayEventConnection>& connection) {
- Mutex::Autolock _l(mLock);
- mDisplayEventConnections.removeItem(connection);
-}
-
-EventThread::ConnectionInfo* EventThread::getConnectionInfoLocked(
- const wp<DisplayEventConnection>& connection) {
- ssize_t index = mDisplayEventConnections.indexOfKey(connection);
- if (index < 0) return NULL;
- return &mDisplayEventConnections.editValueAt(index);
-}
-
-void EventThread::setVsyncRate(uint32_t count,
- const wp<DisplayEventConnection>& connection) {
- if (int32_t(count) >= 0) { // server must protect against bad params
- Mutex::Autolock _l(mLock);
- ConnectionInfo* info = getConnectionInfoLocked(connection);
- if (info) {
- const int32_t new_count = (count == 0) ? -1 : count;
- if (info->count != new_count) {
- info->count = new_count;
- mCondition.signal();
- }
- }
- }
-}
-
-void EventThread::requestNextVsync(
- const wp<DisplayEventConnection>& connection) {
- Mutex::Autolock _l(mLock);
- ConnectionInfo* info = getConnectionInfoLocked(connection);
- if (info && info->count < 0) {
- info->count = 0;
- mCondition.signal();
- }
-}
-
-bool EventThread::threadLoop() {
-
- nsecs_t timestamp;
- DisplayEventReceiver::Event vsync;
- Vector< wp<DisplayEventConnection> > displayEventConnections;
-
- { // scope for the lock
- Mutex::Autolock _l(mLock);
- do {
- // see if we need to wait for the VSYNC at all
- do {
- bool waitForNextVsync = false;
- size_t count = mDisplayEventConnections.size();
- for (size_t i=0 ; i<count ; i++) {
- const ConnectionInfo& info(
- mDisplayEventConnections.valueAt(i));
- if (info.count >= 0) {
- // at least one continuous mode or active one-shot event
- waitForNextVsync = true;
- break;
- }
- }
-
- if (waitForNextVsync)
- break;
-
- mCondition.wait(mLock);
- } while(true);
-
- // at least one listener requested VSYNC
- mLock.unlock();
- timestamp = mHw.waitForRefresh();
- ATRACE_INT("VSYNC", mDeliveredEvents&1);
- mLock.lock();
- mDeliveredEvents++;
- mLastVSyncTimestamp = timestamp;
-
- // now see if we still need to report this VSYNC event
- const size_t count = mDisplayEventConnections.size();
- for (size_t i=0 ; i<count ; i++) {
- bool reportVsync = false;
- const ConnectionInfo& info(
- mDisplayEventConnections.valueAt(i));
- if (info.count >= 1) {
- if (info.count==1 || (mDeliveredEvents % info.count) == 0) {
- // continuous event, and time to report it
- reportVsync = true;
- }
- } else if (info.count >= -1) {
- ConnectionInfo& info(
- mDisplayEventConnections.editValueAt(i));
- if (info.count == 0) {
- // fired this time around
- reportVsync = true;
- }
- info.count--;
- }
- if (reportVsync) {
- displayEventConnections.add(mDisplayEventConnections.keyAt(i));
- }
- }
- } while (!displayEventConnections.size());
-
- // dispatch vsync events to listeners...
- vsync.header.type = DisplayEventReceiver::DISPLAY_EVENT_VSYNC;
- vsync.header.timestamp = timestamp;
- vsync.vsync.count = mDeliveredEvents;
- }
-
- const size_t count = displayEventConnections.size();
- for (size_t i=0 ; i<count ; i++) {
- sp<DisplayEventConnection> conn(displayEventConnections[i].promote());
- // make sure the connection didn't die
- if (conn != NULL) {
- status_t err = conn->postEvent(vsync);
- if (err == -EAGAIN || err == -EWOULDBLOCK) {
- // The destination doesn't accept events anymore, it's probably
- // full. For now, we just drop the events on the floor.
- // Note that some events cannot be dropped and would have to be
- // re-sent later. Right-now we don't have the ability to do
- // this, but it doesn't matter for VSYNC.
- } else if (err < 0) {
- // handle any other error on the pipe as fatal. the only
- // reasonable thing to do is to clean-up this connection.
- // The most common error we'll get here is -EPIPE.
- removeDisplayEventConnection(displayEventConnections[i]);
- }
- } else {
- // somehow the connection is dead, but we still have it in our list
- // just clean the list.
- removeDisplayEventConnection(displayEventConnections[i]);
- }
- }
-
- // clear all our references without holding mLock
- displayEventConnections.clear();
-
- return true;
-}
-
-status_t EventThread::readyToRun() {
- ALOGI("EventThread ready to run.");
- return NO_ERROR;
-}
-
-void EventThread::dump(String8& result, char* buffer, size_t SIZE) const {
- Mutex::Autolock _l(mLock);
- result.append("VSYNC state:\n");
- snprintf(buffer, SIZE, " numListeners=%u, events-delivered: %u\n",
- mDisplayEventConnections.size(), mDeliveredEvents);
- result.append(buffer);
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/services/surfaceflinger/EventThread.h b/services/surfaceflinger/EventThread.h
deleted file mode 100644
index 3a3071e..0000000
--- a/services/surfaceflinger/EventThread.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_SURFACE_FLINGER_EVENT_THREAD_H
-#define ANDROID_SURFACE_FLINGER_EVENT_THREAD_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <gui/IDisplayEventConnection.h>
-
-#include <utils/Errors.h>
-#include <utils/threads.h>
-#include <utils/KeyedVector.h>
-
-#include "DisplayEventConnection.h"
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class SurfaceFlinger;
-class DisplayHardware;
-class DisplayEventConnection;
-
-// ---------------------------------------------------------------------------
-
-class EventThread : public Thread {
- friend class DisplayEventConnection;
-
-public:
- EventThread(const sp<SurfaceFlinger>& flinger);
-
- sp<DisplayEventConnection> createEventConnection() const;
-
- status_t registerDisplayEventConnection(
- const sp<DisplayEventConnection>& connection);
-
- status_t unregisterDisplayEventConnection(
- const wp<DisplayEventConnection>& connection);
-
- void setVsyncRate(uint32_t count,
- const wp<DisplayEventConnection>& connection);
-
- void requestNextVsync(const wp<DisplayEventConnection>& connection);
-
- nsecs_t getLastVSyncTimestamp() const;
-
- nsecs_t getVSyncPeriod() const;
-
- void dump(String8& result, char* buffer, size_t SIZE) const;
-
-private:
- virtual bool threadLoop();
- virtual status_t readyToRun();
- virtual void onFirstRef();
-
- struct ConnectionInfo {
- ConnectionInfo() : count(-1) { }
-
- // count >= 1 : continuous event. count is the vsync rate
- // count == 0 : one-shot event that has not fired
- // count ==-1 : one-shot event that fired this round / disabled
- // count ==-2 : one-shot event that fired the round before
- int32_t count;
- };
-
- void removeDisplayEventConnection(
- const wp<DisplayEventConnection>& connection);
-
- ConnectionInfo* getConnectionInfoLocked(
- const wp<DisplayEventConnection>& connection);
-
- // constants
- sp<SurfaceFlinger> mFlinger;
- const DisplayHardware& mHw;
-
- mutable Mutex mLock;
- mutable Condition mCondition;
-
- // protected by mLock
- KeyedVector< wp<DisplayEventConnection>, ConnectionInfo > mDisplayEventConnections;
- nsecs_t mLastVSyncTimestamp;
-
- // main thread only
- size_t mDeliveredEvents;
-};
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
-
-// ---------------------------------------------------------------------------
-
-#endif /* ANDROID_SURFACE_FLINGER_EVENT_THREAD_H */
diff --git a/services/surfaceflinger/GLExtensions.cpp b/services/surfaceflinger/GLExtensions.cpp
deleted file mode 100644
index 493122d..0000000
--- a/services/surfaceflinger/GLExtensions.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
-
-#include "GLExtensions.h"
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-ANDROID_SINGLETON_STATIC_INSTANCE( GLExtensions )
-
-GLExtensions::GLExtensions()
- : mHaveTextureExternal(false),
- mHaveNpot(false),
- mHaveDirectTexture(false)
-{
-}
-
-void GLExtensions::initWithGLStrings(
- GLubyte const* vendor,
- GLubyte const* renderer,
- GLubyte const* version,
- GLubyte const* extensions,
- char const* egl_vendor,
- char const* egl_version,
- char const* egl_extensions)
-{
- mVendor = (char const*)vendor;
- mRenderer = (char const*)renderer;
- mVersion = (char const*)version;
- mExtensions = (char const*)extensions;
- mEglVendor = egl_vendor;
- mEglVersion = egl_version;
- mEglExtensions = egl_extensions;
-
- char const* curr = (char const*)extensions;
- char const* head = curr;
- do {
- head = strchr(curr, ' ');
- String8 s(curr, head ? head-curr : strlen(curr));
- if (s.length()) {
- mExtensionList.add(s);
- }
- curr = head+1;
- } while (head);
-
- curr = egl_extensions;
- head = curr;
- do {
- head = strchr(curr, ' ');
- String8 s(curr, head ? head-curr : strlen(curr));
- if (s.length()) {
- mExtensionList.add(s);
- }
- curr = head+1;
- } while (head);
-
-#ifdef EGL_ANDROID_image_native_buffer
- if (hasExtension("GL_OES_EGL_image") &&
- (hasExtension("EGL_KHR_image_base") || hasExtension("EGL_KHR_image")) &&
- hasExtension("EGL_ANDROID_image_native_buffer"))
- {
- mHaveDirectTexture = true;
- }
-#else
-#warning "EGL_ANDROID_image_native_buffer not supported"
-#endif
-
- if (hasExtension("GL_ARB_texture_non_power_of_two")) {
- mHaveNpot = true;
- }
-
- if (hasExtension("GL_OES_EGL_image_external")) {
- mHaveTextureExternal = true;
- } else if (strstr(mRenderer.string(), "Adreno")) {
- // hack for Adreno 200
- mHaveTextureExternal = true;
- }
-
- if (hasExtension("GL_OES_framebuffer_object")) {
- mHaveFramebufferObject = true;
- }
-}
-
-bool GLExtensions::hasExtension(char const* extension) const
-{
- const String8 s(extension);
- return mExtensionList.indexOf(s) >= 0;
-}
-
-char const* GLExtensions::getVendor() const {
- return mVendor.string();
-}
-
-char const* GLExtensions::getRenderer() const {
- return mRenderer.string();
-}
-
-char const* GLExtensions::getVersion() const {
- return mVersion.string();
-}
-
-char const* GLExtensions::getExtension() const {
- return mExtensions.string();
-}
-
-char const* GLExtensions::getEglVendor() const {
- return mEglVendor.string();
-}
-
-char const* GLExtensions::getEglVersion() const {
- return mEglVersion.string();
-}
-
-char const* GLExtensions::getEglExtension() const {
- return mEglExtensions.string();
-}
-
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/services/surfaceflinger/GLExtensions.h b/services/surfaceflinger/GLExtensions.h
deleted file mode 100644
index c86c66a..0000000
--- a/services/surfaceflinger/GLExtensions.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef ANDROID_SF_GLEXTENSION_H
-#define ANDROID_SF_GLEXTENSION_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/String8.h>
-#include <utils/SortedVector.h>
-#include <utils/Singleton.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-class GLExtensions : public Singleton<GLExtensions>
-{
- friend class Singleton<GLExtensions>;
-
- bool mHaveTextureExternal : 1;
- bool mHaveNpot : 1;
- bool mHaveDirectTexture : 1;
- bool mHaveFramebufferObject : 1;
-
- String8 mVendor;
- String8 mRenderer;
- String8 mVersion;
- String8 mExtensions;
- String8 mEglVendor;
- String8 mEglVersion;
- String8 mEglExtensions;
- SortedVector<String8> mExtensionList;
-
- GLExtensions(const GLExtensions&);
- GLExtensions& operator = (const GLExtensions&);
-
-protected:
- GLExtensions();
-
-public:
- inline bool haveTextureExternal() const {
- return mHaveTextureExternal;
- }
- inline bool haveNpot() const {
- return mHaveNpot;
- }
- inline bool haveDirectTexture() const {
- return mHaveDirectTexture;
- }
-
- inline bool haveFramebufferObject() const {
- return mHaveFramebufferObject;
- }
-
- void initWithGLStrings(
- GLubyte const* vendor,
- GLubyte const* renderer,
- GLubyte const* version,
- GLubyte const* extensions,
- char const* egl_vendor,
- char const* egl_version,
- char const* egl_extensions);
-
- char const* getVendor() const;
- char const* getRenderer() const;
- char const* getVersion() const;
- char const* getExtension() const;
-
- char const* getEglVendor() const;
- char const* getEglVersion() const;
- char const* getEglExtension() const;
-
- bool hasExtension(char const* extension) const;
-};
-
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_SF_GLEXTENSION_H
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
deleted file mode 100644
index df7fe5c..0000000
--- a/services/surfaceflinger/Layer.cpp
+++ /dev/null
@@ -1,657 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <math.h>
-
-#include <cutils/compiler.h>
-#include <cutils/native_handle.h>
-#include <cutils/properties.h>
-
-#include <utils/Errors.h>
-#include <utils/Log.h>
-#include <utils/StopWatch.h>
-#include <utils/Trace.h>
-
-#include <ui/GraphicBuffer.h>
-#include <ui/PixelFormat.h>
-
-#include <gui/Surface.h>
-
-#include "clz.h"
-#include "DisplayHardware/DisplayHardware.h"
-#include "DisplayHardware/HWComposer.h"
-#include "GLExtensions.h"
-#include "Layer.h"
-#include "SurfaceFlinger.h"
-#include "SurfaceTextureLayer.h"
-
-#define DEBUG_RESIZE 0
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-Layer::Layer(SurfaceFlinger* flinger,
- DisplayID display, const sp<Client>& client)
- : LayerBaseClient(flinger, display, client),
- mTextureName(-1U),
- mQueuedFrames(0),
- mCurrentTransform(0),
- mCurrentScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
- mCurrentOpacity(true),
- mRefreshPending(false),
- mFrameLatencyNeeded(false),
- mFrameLatencyOffset(0),
- mFormat(PIXEL_FORMAT_NONE),
- mGLExtensions(GLExtensions::getInstance()),
- mOpaqueLayer(true),
- mNeedsDithering(false),
- mSecure(false),
- mProtectedByApp(false)
-{
- mCurrentCrop.makeInvalid();
- glGenTextures(1, &mTextureName);
-}
-
-void Layer::onLayerDisplayed() {
- if (mFrameLatencyNeeded) {
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- mFrameStats[mFrameLatencyOffset].timestamp = mSurfaceTexture->getTimestamp();
- mFrameStats[mFrameLatencyOffset].set = systemTime();
- mFrameStats[mFrameLatencyOffset].vsync = hw.getRefreshTimestamp();
- mFrameLatencyOffset = (mFrameLatencyOffset + 1) % 128;
- mFrameLatencyNeeded = false;
- }
-}
-
-void Layer::onFirstRef()
-{
- LayerBaseClient::onFirstRef();
-
- struct FrameQueuedListener : public SurfaceTexture::FrameAvailableListener {
- FrameQueuedListener(Layer* layer) : mLayer(layer) { }
- private:
- wp<Layer> mLayer;
- virtual void onFrameAvailable() {
- sp<Layer> that(mLayer.promote());
- if (that != 0) {
- that->onFrameQueued();
- }
- }
- };
- mSurfaceTexture = new SurfaceTextureLayer(mTextureName, this);
- mSurfaceTexture->setFrameAvailableListener(new FrameQueuedListener(this));
- mSurfaceTexture->setSynchronousMode(true);
-#ifdef USE_TRIPLE_BUFFERING
-#warning "using triple buffering"
- mSurfaceTexture->setBufferCountServer(3);
-#else
- mSurfaceTexture->setBufferCountServer(2);
-#endif
-}
-
-Layer::~Layer()
-{
- mFlinger->postMessageAsync(
- new SurfaceFlinger::MessageDestroyGLTexture(mTextureName) );
-}
-
-void Layer::onFrameQueued() {
- android_atomic_inc(&mQueuedFrames);
- mFlinger->signalLayerUpdate();
-}
-
-// called with SurfaceFlinger::mStateLock as soon as the layer is entered
-// in the purgatory list
-void Layer::onRemoved()
-{
- mSurfaceTexture->abandon();
-}
-
-void Layer::setName(const String8& name) {
- LayerBase::setName(name);
- mSurfaceTexture->setName(name);
-}
-
-sp<ISurface> Layer::createSurface()
-{
- class BSurface : public BnSurface, public LayerCleaner {
- wp<const Layer> mOwner;
- virtual sp<ISurfaceTexture> getSurfaceTexture() const {
- sp<ISurfaceTexture> res;
- sp<const Layer> that( mOwner.promote() );
- if (that != NULL) {
- res = that->mSurfaceTexture;
- }
- return res;
- }
- public:
- BSurface(const sp<SurfaceFlinger>& flinger,
- const sp<Layer>& layer)
- : LayerCleaner(flinger, layer), mOwner(layer) { }
- };
- sp<ISurface> sur(new BSurface(mFlinger, this));
- return sur;
-}
-
-wp<IBinder> Layer::getSurfaceTextureBinder() const
-{
- return mSurfaceTexture->asBinder();
-}
-
-status_t Layer::setBuffers( uint32_t w, uint32_t h,
- PixelFormat format, uint32_t flags)
-{
- // this surfaces pixel format
- PixelFormatInfo info;
- status_t err = getPixelFormatInfo(format, &info);
- if (err) {
- ALOGE("unsupported pixelformat %d", format);
- return err;
- }
-
- // the display's pixel format
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- uint32_t const maxSurfaceDims = min(
- hw.getMaxTextureSize(), hw.getMaxViewportDims());
-
- // never allow a surface larger than what our underlying GL implementation
- // can handle.
- if ((uint32_t(w)>maxSurfaceDims) || (uint32_t(h)>maxSurfaceDims)) {
- ALOGE("dimensions too large %u x %u", uint32_t(w), uint32_t(h));
- return BAD_VALUE;
- }
-
- PixelFormatInfo displayInfo;
- getPixelFormatInfo(hw.getFormat(), &displayInfo);
- const uint32_t hwFlags = hw.getFlags();
-
- mFormat = format;
-
- mSecure = (flags & ISurfaceComposer::eSecure) ? true : false;
- mProtectedByApp = (flags & ISurfaceComposer::eProtectedByApp) ? true : false;
- mOpaqueLayer = (flags & ISurfaceComposer::eOpaque);
- mCurrentOpacity = getOpacityForFormat(format);
-
- mSurfaceTexture->setDefaultBufferSize(w, h);
- mSurfaceTexture->setDefaultBufferFormat(format);
-
- // we use the red index
- int displayRedSize = displayInfo.getSize(PixelFormatInfo::INDEX_RED);
- int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED);
- mNeedsDithering = layerRedsize > displayRedSize;
-
- return NO_ERROR;
-}
-
-void Layer::setGeometry(hwc_layer_t* hwcl)
-{
- LayerBaseClient::setGeometry(hwcl);
-
- hwcl->flags &= ~HWC_SKIP_LAYER;
-
- // we can't do alpha-fade with the hwc HAL
- const State& s(drawingState());
- if (s.alpha < 0xFF) {
- hwcl->flags = HWC_SKIP_LAYER;
- }
-
- /*
- * Transformations are applied in this order:
- * 1) buffer orientation/flip/mirror
- * 2) state transformation (window manager)
- * 3) layer orientation (screen orientation)
- * mTransform is already the composition of (2) and (3)
- * (NOTE: the matrices are multiplied in reverse order)
- */
-
- const Transform bufferOrientation(mCurrentTransform);
- const Transform tr(mTransform * bufferOrientation);
-
- // this gives us only the "orientation" component of the transform
- const uint32_t finalTransform = tr.getOrientation();
-
- // we can only handle simple transformation
- if (finalTransform & Transform::ROT_INVALID) {
- hwcl->flags = HWC_SKIP_LAYER;
- } else {
- hwcl->transform = finalTransform;
- }
-
- if (isCropped()) {
- hwcl->sourceCrop.left = mCurrentCrop.left;
- hwcl->sourceCrop.top = mCurrentCrop.top;
- hwcl->sourceCrop.right = mCurrentCrop.right;
- hwcl->sourceCrop.bottom = mCurrentCrop.bottom;
- } else {
- const sp<GraphicBuffer>& buffer(mActiveBuffer);
- hwcl->sourceCrop.left = 0;
- hwcl->sourceCrop.top = 0;
- if (buffer != NULL) {
- hwcl->sourceCrop.right = buffer->width;
- hwcl->sourceCrop.bottom = buffer->height;
- } else {
- hwcl->sourceCrop.right = mTransformedBounds.width();
- hwcl->sourceCrop.bottom = mTransformedBounds.height();
- }
- }
-}
-
-void Layer::setPerFrameData(hwc_layer_t* hwcl) {
- const sp<GraphicBuffer>& buffer(mActiveBuffer);
- if (buffer == NULL) {
- // this can happen if the client never drew into this layer yet,
- // or if we ran out of memory. In that case, don't let
- // HWC handle it.
- hwcl->flags |= HWC_SKIP_LAYER;
- hwcl->handle = NULL;
- } else {
- hwcl->handle = buffer->handle;
- }
-}
-
-void Layer::onDraw(const Region& clip) const
-{
- ATRACE_CALL();
-
- if (CC_UNLIKELY(mActiveBuffer == 0)) {
- // the texture has not been created yet, this Layer has
- // in fact never been drawn into. This happens frequently with
- // SurfaceView because the WindowManager can't know when the client
- // has drawn the first time.
-
- // If there is nothing under us, we paint the screen in black, otherwise
- // we just skip this update.
-
- // figure out if there is something below us
- Region under;
- const SurfaceFlinger::LayerVector& drawingLayers(
- mFlinger->mDrawingState.layersSortedByZ);
- const size_t count = drawingLayers.size();
- for (size_t i=0 ; i<count ; ++i) {
- const sp<LayerBase>& layer(drawingLayers[i]);
- if (layer.get() == static_cast<LayerBase const*>(this))
- break;
- under.orSelf(layer->visibleRegionScreen);
- }
- // if not everything below us is covered, we plug the holes!
- Region holes(clip.subtract(under));
- if (!holes.isEmpty()) {
- clearWithOpenGL(holes, 0, 0, 0, 1);
- }
- return;
- }
-
- if (!isProtected()) {
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureName);
- GLenum filter = GL_NEAREST;
- if (getFiltering() || needsFiltering() || isFixedSize() || isCropped()) {
- // TODO: we could be more subtle with isFixedSize()
- filter = GL_LINEAR;
- }
- glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, filter);
- glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, filter);
- glMatrixMode(GL_TEXTURE);
- glLoadMatrixf(mTextureMatrix);
- glMatrixMode(GL_MODELVIEW);
- glDisable(GL_TEXTURE_2D);
- glEnable(GL_TEXTURE_EXTERNAL_OES);
- } else {
- glBindTexture(GL_TEXTURE_2D, mFlinger->getProtectedTexName());
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
- glDisable(GL_TEXTURE_EXTERNAL_OES);
- glEnable(GL_TEXTURE_2D);
- }
-
- drawWithOpenGL(clip);
-
- glDisable(GL_TEXTURE_EXTERNAL_OES);
- glDisable(GL_TEXTURE_2D);
-}
-
-// As documented in libhardware header, formats in the range
-// 0x100 - 0x1FF are specific to the HAL implementation, and
-// are known to have no alpha channel
-// TODO: move definition for device-specific range into
-// hardware.h, instead of using hard-coded values here.
-#define HARDWARE_IS_DEVICE_FORMAT(f) ((f) >= 0x100 && (f) <= 0x1FF)
-
-bool Layer::getOpacityForFormat(uint32_t format)
-{
- if (HARDWARE_IS_DEVICE_FORMAT(format)) {
- return true;
- }
- PixelFormatInfo info;
- status_t err = getPixelFormatInfo(PixelFormat(format), &info);
- // in case of error (unknown format), we assume no blending
- return (err || info.h_alpha <= info.l_alpha);
-}
-
-
-bool Layer::isOpaque() const
-{
- // if we don't have a buffer yet, we're translucent regardless of the
- // layer's opaque flag.
- if (mActiveBuffer == 0) {
- return false;
- }
-
- // if the layer has the opaque flag, then we're always opaque,
- // otherwise we use the current buffer's format.
- return mOpaqueLayer || mCurrentOpacity;
-}
-
-bool Layer::isProtected() const
-{
- const sp<GraphicBuffer>& activeBuffer(mActiveBuffer);
- return (activeBuffer != 0) &&
- (activeBuffer->getUsage() & GRALLOC_USAGE_PROTECTED);
-}
-
-uint32_t Layer::doTransaction(uint32_t flags)
-{
- ATRACE_CALL();
-
- const Layer::State& front(drawingState());
- const Layer::State& temp(currentState());
-
- const bool sizeChanged = (front.requested_w != temp.requested_w) ||
- (front.requested_h != temp.requested_h);
-
- if (sizeChanged) {
- // the size changed, we need to ask our client to request a new buffer
- ALOGD_IF(DEBUG_RESIZE,
- "doTransaction: "
- "resize (layer=%p), requested (%dx%d), drawing (%d,%d), "
- "scalingMode=%d",
- this,
- int(temp.requested_w), int(temp.requested_h),
- int(front.requested_w), int(front.requested_h),
- mCurrentScalingMode);
-
- if (!isFixedSize()) {
- // this will make sure LayerBase::doTransaction doesn't update
- // the drawing state's size
- Layer::State& editDraw(mDrawingState);
- editDraw.requested_w = temp.requested_w;
- editDraw.requested_h = temp.requested_h;
- }
-
- // record the new size, form this point on, when the client request
- // a buffer, it'll get the new size.
- mSurfaceTexture->setDefaultBufferSize(temp.requested_w,
- temp.requested_h);
- }
-
- return LayerBase::doTransaction(flags);
-}
-
-bool Layer::isFixedSize() const {
- return mCurrentScalingMode != NATIVE_WINDOW_SCALING_MODE_FREEZE;
-}
-
-bool Layer::isCropped() const {
- return !mCurrentCrop.isEmpty();
-}
-
-// ----------------------------------------------------------------------------
-// pageflip handling...
-// ----------------------------------------------------------------------------
-
-bool Layer::onPreComposition() {
- mRefreshPending = false;
- return mQueuedFrames > 0;
-}
-
-void Layer::lockPageFlip(bool& recomputeVisibleRegions)
-{
- ATRACE_CALL();
-
- if (mQueuedFrames > 0) {
-
- // if we've already called updateTexImage() without going through
- // a composition step, we have to skip this layer at this point
- // because we cannot call updateTeximage() without a corresponding
- // compositionComplete() call.
- // we'll trigger an update in onPreComposition().
- if (mRefreshPending) {
- mPostedDirtyRegion.clear();
- return;
- }
- mRefreshPending = true;
-
- // Capture the old state of the layer for comparisons later
- const bool oldOpacity = isOpaque();
- sp<GraphicBuffer> oldActiveBuffer = mActiveBuffer;
-
- // signal another event if we have more frames pending
- if (android_atomic_dec(&mQueuedFrames) > 1) {
- mFlinger->signalLayerUpdate();
- }
-
- if (mSurfaceTexture->updateTexImage() < NO_ERROR) {
- // something happened!
- recomputeVisibleRegions = true;
- return;
- }
-
- // update the active buffer
- mActiveBuffer = mSurfaceTexture->getCurrentBuffer();
- mFrameLatencyNeeded = true;
-
- if (oldActiveBuffer == NULL && mActiveBuffer != NULL) {
- // the first time we receive a buffer, we need to trigger a
- // geometry invalidation.
- mFlinger->invalidateHwcGeometry();
- }
-
- const Rect crop(mSurfaceTexture->getCurrentCrop());
- const uint32_t transform(mSurfaceTexture->getCurrentTransform());
- const uint32_t scalingMode(mSurfaceTexture->getCurrentScalingMode());
- if ((crop != mCurrentCrop) ||
- (transform != mCurrentTransform) ||
- (scalingMode != mCurrentScalingMode))
- {
- mCurrentCrop = crop;
- mCurrentTransform = transform;
- mCurrentScalingMode = scalingMode;
- mFlinger->invalidateHwcGeometry();
- }
-
- GLfloat textureMatrix[16];
- mSurfaceTexture->getTransformMatrix(textureMatrix);
- if (memcmp(textureMatrix, mTextureMatrix, sizeof(textureMatrix))) {
- memcpy(mTextureMatrix, textureMatrix, sizeof(textureMatrix));
- mFlinger->invalidateHwcGeometry();
- }
-
- uint32_t bufWidth = mActiveBuffer->getWidth();
- uint32_t bufHeight = mActiveBuffer->getHeight();
- if (oldActiveBuffer != NULL) {
- if (bufWidth != uint32_t(oldActiveBuffer->width) ||
- bufHeight != uint32_t(oldActiveBuffer->height)) {
- mFlinger->invalidateHwcGeometry();
- }
- }
-
- mCurrentOpacity = getOpacityForFormat(mActiveBuffer->format);
- if (oldOpacity != isOpaque()) {
- recomputeVisibleRegions = true;
- }
-
- glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- // update the layer size if needed
- const Layer::State& front(drawingState());
-
- // FIXME: mPostedDirtyRegion = dirty & bounds
- mPostedDirtyRegion.set(front.w, front.h);
-
- if ((front.w != front.requested_w) ||
- (front.h != front.requested_h))
- {
- // check that we received a buffer of the right size
- // (Take the buffer's orientation into account)
- if (mCurrentTransform & Transform::ROT_90) {
- swap(bufWidth, bufHeight);
- }
-
- if (isFixedSize() ||
- (bufWidth == front.requested_w &&
- bufHeight == front.requested_h))
- {
- // Here we pretend the transaction happened by updating the
- // current and drawing states. Drawing state is only accessed
- // in this thread, no need to have it locked
- Layer::State& editDraw(mDrawingState);
- editDraw.w = editDraw.requested_w;
- editDraw.h = editDraw.requested_h;
-
- // We also need to update the current state so that we don't
- // end-up doing too much work during the next transaction.
- // NOTE: We actually don't need hold the transaction lock here
- // because State::w and State::h are only accessed from
- // this thread
- Layer::State& editTemp(currentState());
- editTemp.w = editDraw.w;
- editTemp.h = editDraw.h;
-
- // recompute visible region
- recomputeVisibleRegions = true;
- }
-
- ALOGD_IF(DEBUG_RESIZE,
- "lockPageFlip : "
- " (layer=%p), buffer (%ux%u, tr=%02x), "
- "requested (%dx%d)",
- this,
- bufWidth, bufHeight, mCurrentTransform,
- front.requested_w, front.requested_h);
- }
- }
-}
-
-void Layer::unlockPageFlip(
- const Transform& planeTransform, Region& outDirtyRegion)
-{
- ATRACE_CALL();
-
- Region postedRegion(mPostedDirtyRegion);
- if (!postedRegion.isEmpty()) {
- mPostedDirtyRegion.clear();
- if (!visibleRegionScreen.isEmpty()) {
- // The dirty region is given in the layer's coordinate space
- // transform the dirty region by the surface's transformation
- // and the global transformation.
- const Layer::State& s(drawingState());
- const Transform tr(planeTransform * s.transform);
- postedRegion = tr.transform(postedRegion);
-
- // At this point, the dirty region is in screen space.
- // Make sure it's constrained by the visible region (which
- // is in screen space as well).
- postedRegion.andSelf(visibleRegionScreen);
- outDirtyRegion.orSelf(postedRegion);
- }
- }
-}
-
-void Layer::dump(String8& result, char* buffer, size_t SIZE) const
-{
- LayerBaseClient::dump(result, buffer, SIZE);
-
- sp<const GraphicBuffer> buf0(mActiveBuffer);
- uint32_t w0=0, h0=0, s0=0, f0=0;
- if (buf0 != 0) {
- w0 = buf0->getWidth();
- h0 = buf0->getHeight();
- s0 = buf0->getStride();
- f0 = buf0->format;
- }
- snprintf(buffer, SIZE,
- " "
- "format=%2d, activeBuffer=[%4ux%4u:%4u,%3X],"
- " transform-hint=0x%02x, queued-frames=%d, mRefreshPending=%d\n",
- mFormat, w0, h0, s0,f0,
- getTransformHint(), mQueuedFrames, mRefreshPending);
-
- result.append(buffer);
-
- if (mSurfaceTexture != 0) {
- mSurfaceTexture->dump(result, " ", buffer, SIZE);
- }
-}
-
-void Layer::dumpStats(String8& result, char* buffer, size_t SIZE) const
-{
- LayerBaseClient::dumpStats(result, buffer, SIZE);
- const size_t o = mFrameLatencyOffset;
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const nsecs_t period = hw.getRefreshPeriod();
- result.appendFormat("%lld\n", period);
- for (size_t i=0 ; i<128 ; i++) {
- const size_t index = (o+i) % 128;
- const nsecs_t time_app = mFrameStats[index].timestamp;
- const nsecs_t time_set = mFrameStats[index].set;
- const nsecs_t time_vsync = mFrameStats[index].vsync;
- result.appendFormat("%lld\t%lld\t%lld\n",
- time_app,
- time_vsync,
- time_set);
- }
- result.append("\n");
-}
-
-void Layer::clearStats()
-{
- LayerBaseClient::clearStats();
- memset(mFrameStats, 0, sizeof(mFrameStats));
-}
-
-uint32_t Layer::getEffectiveUsage(uint32_t usage) const
-{
- // TODO: should we do something special if mSecure is set?
- if (mProtectedByApp) {
- // need a hardware-protected path to external video sink
- usage |= GraphicBuffer::USAGE_PROTECTED;
- }
- usage |= GraphicBuffer::USAGE_HW_COMPOSER;
- return usage;
-}
-
-uint32_t Layer::getTransformHint() const {
- uint32_t orientation = 0;
- if (!mFlinger->mDebugDisableTransformHint) {
- orientation = getPlaneOrientation();
- if (orientation & Transform::ROT_INVALID) {
- orientation = 0;
- }
- }
- return orientation;
-}
-
-// ---------------------------------------------------------------------------
-
-
-}; // namespace android
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
deleted file mode 100644
index 8d508c2..0000000
--- a/services/surfaceflinger/Layer.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_LAYER_H
-#define ANDROID_LAYER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <gui/SurfaceTexture.h>
-
-#include <utils/Timers.h>
-
-#include <ui/GraphicBuffer.h>
-#include <ui/PixelFormat.h>
-
-#include <gui/ISurfaceComposerClient.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include "LayerBase.h"
-#include "SurfaceTextureLayer.h"
-#include "Transform.h"
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class Client;
-class GLExtensions;
-
-// ---------------------------------------------------------------------------
-
-class Layer : public LayerBaseClient
-{
-public:
- Layer(SurfaceFlinger* flinger, DisplayID display,
- const sp<Client>& client);
-
- virtual ~Layer();
-
- virtual const char* getTypeId() const { return "Layer"; }
-
- // the this layer's size and format
- status_t setBuffers(uint32_t w, uint32_t h,
- PixelFormat format, uint32_t flags=0);
-
- bool isFixedSize() const;
-
- // LayerBase interface
- virtual void setGeometry(hwc_layer_t* hwcl);
- virtual void setPerFrameData(hwc_layer_t* hwcl);
- virtual void onDraw(const Region& clip) const;
- virtual uint32_t doTransaction(uint32_t transactionFlags);
- virtual void lockPageFlip(bool& recomputeVisibleRegions);
- virtual void unlockPageFlip(const Transform& planeTransform, Region& outDirtyRegion);
- virtual bool isOpaque() const;
- virtual bool needsDithering() const { return mNeedsDithering; }
- virtual bool isSecure() const { return mSecure; }
- virtual bool isProtected() const;
- virtual void onRemoved();
- virtual sp<Layer> getLayer() const { return const_cast<Layer*>(this); }
- virtual void setName(const String8& name);
-
- // LayerBaseClient interface
- virtual wp<IBinder> getSurfaceTextureBinder() const;
-
- virtual void onLayerDisplayed();
- virtual bool onPreComposition();
-
- // only for debugging
- inline const sp<GraphicBuffer>& getActiveBuffer() const { return mActiveBuffer; }
-
-protected:
- virtual void onFirstRef();
- virtual void dump(String8& result, char* scratch, size_t size) const;
- virtual void dumpStats(String8& result, char* buffer, size_t SIZE) const;
- virtual void clearStats();
-
-private:
- friend class SurfaceTextureLayer;
- void onFrameQueued();
- virtual sp<ISurface> createSurface();
- uint32_t getEffectiveUsage(uint32_t usage) const;
- uint32_t getTransformHint() const;
- bool isCropped() const;
- static bool getOpacityForFormat(uint32_t format);
-
- // -----------------------------------------------------------------------
-
- // constants
- sp<SurfaceTextureLayer> mSurfaceTexture;
- GLuint mTextureName;
-
- // thread-safe
- volatile int32_t mQueuedFrames;
-
- // main thread
- sp<GraphicBuffer> mActiveBuffer;
- GLfloat mTextureMatrix[16];
- Rect mCurrentCrop;
- uint32_t mCurrentTransform;
- uint32_t mCurrentScalingMode;
- bool mCurrentOpacity;
- bool mRefreshPending;
- bool mFrameLatencyNeeded;
- int mFrameLatencyOffset;
-
- struct Statistics {
- Statistics() : timestamp(0), set(0), vsync(0) { }
- nsecs_t timestamp; // buffer timestamp
- nsecs_t set; // buffer displayed timestamp
- nsecs_t vsync; // vsync immediately before set
- };
-
- // protected by mLock
- Statistics mFrameStats[128];
-
- // constants
- PixelFormat mFormat;
- const GLExtensions& mGLExtensions;
- bool mOpaqueLayer;
- bool mNeedsDithering;
-
- // page-flip thread (currently main thread)
- bool mSecure; // no screenshots
- bool mProtectedByApp; // application requires protected path to external sink
- Region mPostedDirtyRegion;
-};
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_LAYER_H
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
deleted file mode 100644
index e764001..0000000
--- a/services/surfaceflinger/LayerBase.cpp
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/Log.h>
-#include <binder/IPCThreadState.h>
-#include <binder/IServiceManager.h>
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-#include <hardware/hardware.h>
-
-#include "clz.h"
-#include "LayerBase.h"
-#include "SurfaceFlinger.h"
-#include "DisplayHardware/DisplayHardware.h"
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-int32_t LayerBase::sSequence = 1;
-
-LayerBase::LayerBase(SurfaceFlinger* flinger, DisplayID display)
- : dpy(display), contentDirty(false),
- sequence(uint32_t(android_atomic_inc(&sSequence))),
- mFlinger(flinger), mFiltering(false),
- mNeedsFiltering(false), mInOverlay(false),
- mOrientation(0),
- mPlaneOrientation(0),
- mTransactionFlags(0),
- mPremultipliedAlpha(true), mName("unnamed"), mDebug(false)
-{
- const DisplayHardware& hw(flinger->graphicPlane(0).displayHardware());
- mFlags = hw.getFlags();
-}
-
-LayerBase::~LayerBase()
-{
-}
-
-void LayerBase::setName(const String8& name) {
- mName = name;
-}
-
-String8 LayerBase::getName() const {
- return mName;
-}
-
-const GraphicPlane& LayerBase::graphicPlane(int dpy) const
-{
- return mFlinger->graphicPlane(dpy);
-}
-
-GraphicPlane& LayerBase::graphicPlane(int dpy)
-{
- return mFlinger->graphicPlane(dpy);
-}
-
-void LayerBase::initStates(uint32_t w, uint32_t h, uint32_t flags)
-{
- uint32_t layerFlags = 0;
- if (flags & ISurfaceComposer::eHidden)
- layerFlags = ISurfaceComposer::eLayerHidden;
-
- if (flags & ISurfaceComposer::eNonPremultiplied)
- mPremultipliedAlpha = false;
-
- mCurrentState.z = 0;
- mCurrentState.w = w;
- mCurrentState.h = h;
- mCurrentState.requested_w = w;
- mCurrentState.requested_h = h;
- mCurrentState.alpha = 0xFF;
- mCurrentState.flags = layerFlags;
- mCurrentState.sequence = 0;
- mCurrentState.transform.set(0, 0);
-
- // drawing state & current state are identical
- mDrawingState = mCurrentState;
-}
-
-void LayerBase::commitTransaction() {
- mDrawingState = mCurrentState;
-}
-void LayerBase::forceVisibilityTransaction() {
- // this can be called without SurfaceFlinger.mStateLock, but if we
- // can atomically increment the sequence number, it doesn't matter.
- android_atomic_inc(&mCurrentState.sequence);
- requestTransaction();
-}
-bool LayerBase::requestTransaction() {
- int32_t old = setTransactionFlags(eTransactionNeeded);
- return ((old & eTransactionNeeded) == 0);
-}
-uint32_t LayerBase::getTransactionFlags(uint32_t flags) {
- return android_atomic_and(~flags, &mTransactionFlags) & flags;
-}
-uint32_t LayerBase::setTransactionFlags(uint32_t flags) {
- return android_atomic_or(flags, &mTransactionFlags);
-}
-
-bool LayerBase::setPosition(float x, float y) {
- if (mCurrentState.transform.tx() == x && mCurrentState.transform.ty() == y)
- return false;
- mCurrentState.sequence++;
- mCurrentState.transform.set(x, y);
- requestTransaction();
- return true;
-}
-bool LayerBase::setLayer(uint32_t z) {
- if (mCurrentState.z == z)
- return false;
- mCurrentState.sequence++;
- mCurrentState.z = z;
- requestTransaction();
- return true;
-}
-bool LayerBase::setSize(uint32_t w, uint32_t h) {
- if (mCurrentState.requested_w == w && mCurrentState.requested_h == h)
- return false;
- mCurrentState.requested_w = w;
- mCurrentState.requested_h = h;
- requestTransaction();
- return true;
-}
-bool LayerBase::setAlpha(uint8_t alpha) {
- if (mCurrentState.alpha == alpha)
- return false;
- mCurrentState.sequence++;
- mCurrentState.alpha = alpha;
- requestTransaction();
- return true;
-}
-bool LayerBase::setMatrix(const layer_state_t::matrix22_t& matrix) {
- mCurrentState.sequence++;
- mCurrentState.transform.set(
- matrix.dsdx, matrix.dsdy, matrix.dtdx, matrix.dtdy);
- requestTransaction();
- return true;
-}
-bool LayerBase::setTransparentRegionHint(const Region& transparent) {
- mCurrentState.sequence++;
- mCurrentState.transparentRegion = transparent;
- requestTransaction();
- return true;
-}
-bool LayerBase::setFlags(uint8_t flags, uint8_t mask) {
- const uint32_t newFlags = (mCurrentState.flags & ~mask) | (flags & mask);
- if (mCurrentState.flags == newFlags)
- return false;
- mCurrentState.sequence++;
- mCurrentState.flags = newFlags;
- requestTransaction();
- return true;
-}
-
-Rect LayerBase::visibleBounds() const
-{
- return mTransformedBounds;
-}
-
-void LayerBase::setVisibleRegion(const Region& visibleRegion) {
- // always called from main thread
- visibleRegionScreen = visibleRegion;
-}
-
-void LayerBase::setCoveredRegion(const Region& coveredRegion) {
- // always called from main thread
- coveredRegionScreen = coveredRegion;
-}
-
-uint32_t LayerBase::doTransaction(uint32_t flags)
-{
- const Layer::State& front(drawingState());
- const Layer::State& temp(currentState());
-
- if ((front.requested_w != temp.requested_w) ||
- (front.requested_h != temp.requested_h)) {
- // resize the layer, set the physical size to the requested size
- Layer::State& editTemp(currentState());
- editTemp.w = temp.requested_w;
- editTemp.h = temp.requested_h;
- }
-
- if ((front.w != temp.w) || (front.h != temp.h)) {
- // invalidate and recompute the visible regions if needed
- flags |= Layer::eVisibleRegion;
- }
-
- if (temp.sequence != front.sequence) {
- // invalidate and recompute the visible regions if needed
- flags |= eVisibleRegion;
- this->contentDirty = true;
-
- // we may use linear filtering, if the matrix scales us
- const uint8_t type = temp.transform.getType();
- mNeedsFiltering = (!temp.transform.preserveRects() ||
- (type >= Transform::SCALE));
- }
-
- // Commit the transaction
- commitTransaction();
- return flags;
-}
-
-void LayerBase::validateVisibility(const Transform& planeTransform)
-{
- const Layer::State& s(drawingState());
- const Transform tr(planeTransform * s.transform);
- const bool transformed = tr.transformed();
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const uint32_t hw_h = hw.getHeight();
-
- uint32_t w = s.w;
- uint32_t h = s.h;
- tr.transform(mVertices[0], 0, 0);
- tr.transform(mVertices[1], 0, h);
- tr.transform(mVertices[2], w, h);
- tr.transform(mVertices[3], w, 0);
- for (size_t i=0 ; i<4 ; i++)
- mVertices[i][1] = hw_h - mVertices[i][1];
-
- if (CC_UNLIKELY(transformed)) {
- // NOTE: here we could also punt if we have too many rectangles
- // in the transparent region
- if (tr.preserveRects()) {
- // transform the transparent region
- transparentRegionScreen = tr.transform(s.transparentRegion);
- } else {
- // transformation too complex, can't do the transparent region
- // optimization.
- transparentRegionScreen.clear();
- }
- } else {
- transparentRegionScreen = s.transparentRegion;
- }
-
- // cache a few things...
- mOrientation = tr.getOrientation();
- mPlaneOrientation = planeTransform.getOrientation();
- mTransform = tr;
- mTransformedBounds = tr.makeBounds(w, h);
-}
-
-void LayerBase::lockPageFlip(bool& recomputeVisibleRegions) {
-}
-
-void LayerBase::unlockPageFlip(
- const Transform& planeTransform, Region& outDirtyRegion) {
-}
-
-void LayerBase::drawRegion(const Region& reg) const
-{
- Region::const_iterator it = reg.begin();
- Region::const_iterator const end = reg.end();
- if (it != end) {
- Rect r;
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const int32_t fbWidth = hw.getWidth();
- const int32_t fbHeight = hw.getHeight();
- const GLshort vertices[][2] = { { 0, 0 }, { fbWidth, 0 },
- { fbWidth, fbHeight }, { 0, fbHeight } };
- glVertexPointer(2, GL_SHORT, 0, vertices);
- while (it != end) {
- const Rect& r = *it++;
- const GLint sy = fbHeight - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
- }
-}
-
-void LayerBase::setGeometry(hwc_layer_t* hwcl)
-{
- hwcl->compositionType = HWC_FRAMEBUFFER;
- hwcl->hints = 0;
- hwcl->flags = HWC_SKIP_LAYER;
- hwcl->transform = 0;
- hwcl->blending = HWC_BLENDING_NONE;
-
- // this gives us only the "orientation" component of the transform
- const State& s(drawingState());
- const uint32_t finalTransform = s.transform.getOrientation();
- // we can only handle simple transformation
- if (finalTransform & Transform::ROT_INVALID) {
- hwcl->flags = HWC_SKIP_LAYER;
- } else {
- hwcl->transform = finalTransform;
- }
-
- if (!isOpaque()) {
- hwcl->blending = mPremultipliedAlpha ?
- HWC_BLENDING_PREMULT : HWC_BLENDING_COVERAGE;
- }
-
- // scaling is already applied in mTransformedBounds
- hwcl->displayFrame.left = mTransformedBounds.left;
- hwcl->displayFrame.top = mTransformedBounds.top;
- hwcl->displayFrame.right = mTransformedBounds.right;
- hwcl->displayFrame.bottom = mTransformedBounds.bottom;
- hwcl->visibleRegionScreen.rects =
- reinterpret_cast<hwc_rect_t const *>(
- visibleRegionScreen.getArray(
- &hwcl->visibleRegionScreen.numRects));
-
- hwcl->sourceCrop.left = 0;
- hwcl->sourceCrop.top = 0;
- hwcl->sourceCrop.right = mTransformedBounds.width();
- hwcl->sourceCrop.bottom = mTransformedBounds.height();
-}
-
-void LayerBase::setPerFrameData(hwc_layer_t* hwcl) {
- hwcl->compositionType = HWC_FRAMEBUFFER;
- hwcl->handle = NULL;
-}
-
-void LayerBase::setOverlay(bool inOverlay) {
- mInOverlay = inOverlay;
-}
-
-bool LayerBase::isOverlay() const {
- return mInOverlay;
-}
-
-void LayerBase::setFiltering(bool filtering)
-{
- mFiltering = filtering;
-}
-
-bool LayerBase::getFiltering() const
-{
- return mFiltering;
-}
-
-void LayerBase::draw(const Region& clip) const
-{
- // reset GL state
- glEnable(GL_SCISSOR_TEST);
-
- onDraw(clip);
-}
-
-void LayerBase::drawForSreenShot()
-{
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- setFiltering(true);
- onDraw( Region(hw.bounds()) );
- setFiltering(false);
-}
-
-void LayerBase::clearWithOpenGL(const Region& clip, GLclampf red,
- GLclampf green, GLclampf blue,
- GLclampf alpha) const
-{
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const uint32_t fbHeight = hw.getHeight();
- glColor4f(red,green,blue,alpha);
-
- glDisable(GL_TEXTURE_EXTERNAL_OES);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_BLEND);
-
- Region::const_iterator it = clip.begin();
- Region::const_iterator const end = clip.end();
- glEnable(GL_SCISSOR_TEST);
- glVertexPointer(2, GL_FLOAT, 0, mVertices);
- while (it != end) {
- const Rect& r = *it++;
- const GLint sy = fbHeight - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
-}
-
-void LayerBase::clearWithOpenGL(const Region& clip) const
-{
- clearWithOpenGL(clip,0,0,0,0);
-}
-
-void LayerBase::drawWithOpenGL(const Region& clip) const
-{
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const uint32_t fbHeight = hw.getHeight();
- const State& s(drawingState());
-
- GLenum src = mPremultipliedAlpha ? GL_ONE : GL_SRC_ALPHA;
- if (CC_UNLIKELY(s.alpha < 0xFF)) {
- const GLfloat alpha = s.alpha * (1.0f/255.0f);
- if (mPremultipliedAlpha) {
- glColor4f(alpha, alpha, alpha, alpha);
- } else {
- glColor4f(1, 1, 1, alpha);
- }
- glEnable(GL_BLEND);
- glBlendFunc(src, GL_ONE_MINUS_SRC_ALPHA);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- } else {
- glColor4f(1, 1, 1, 1);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- if (!isOpaque()) {
- glEnable(GL_BLEND);
- glBlendFunc(src, GL_ONE_MINUS_SRC_ALPHA);
- } else {
- glDisable(GL_BLEND);
- }
- }
-
- struct TexCoords {
- GLfloat u;
- GLfloat v;
- };
-
- TexCoords texCoords[4];
- texCoords[0].u = 0;
- texCoords[0].v = 1;
- texCoords[1].u = 0;
- texCoords[1].v = 0;
- texCoords[2].u = 1;
- texCoords[2].v = 0;
- texCoords[3].u = 1;
- texCoords[3].v = 1;
-
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glVertexPointer(2, GL_FLOAT, 0, mVertices);
- glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
-
- Region::const_iterator it = clip.begin();
- Region::const_iterator const end = clip.end();
- while (it != end) {
- const Rect& r = *it++;
- const GLint sy = fbHeight - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable(GL_BLEND);
-}
-
-void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const
-{
- const Layer::State& s(drawingState());
-
- snprintf(buffer, SIZE,
- "+ %s %p (%s)\n",
- getTypeId(), this, getName().string());
- result.append(buffer);
-
- s.transparentRegion.dump(result, "transparentRegion");
- transparentRegionScreen.dump(result, "transparentRegionScreen");
- visibleRegionScreen.dump(result, "visibleRegionScreen");
-
- snprintf(buffer, SIZE,
- " "
- "z=%9d, pos=(%g,%g), size=(%4d,%4d), "
- "isOpaque=%1d, needsDithering=%1d, invalidate=%1d, "
- "alpha=0x%02x, flags=0x%08x, tr=[%.2f, %.2f][%.2f, %.2f]\n",
- s.z, s.transform.tx(), s.transform.ty(), s.w, s.h,
- isOpaque(), needsDithering(), contentDirty,
- s.alpha, s.flags,
- s.transform[0][0], s.transform[0][1],
- s.transform[1][0], s.transform[1][1]);
- result.append(buffer);
-}
-
-void LayerBase::shortDump(String8& result, char* scratch, size_t size) const {
- LayerBase::dump(result, scratch, size);
-}
-
-void LayerBase::dumpStats(String8& result, char* scratch, size_t SIZE) const {
-}
-
-void LayerBase::clearStats() {
-}
-
-// ---------------------------------------------------------------------------
-
-int32_t LayerBaseClient::sIdentity = 1;
-
-LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display,
- const sp<Client>& client)
- : LayerBase(flinger, display),
- mHasSurface(false),
- mClientRef(client),
- mIdentity(uint32_t(android_atomic_inc(&sIdentity)))
-{
-}
-
-LayerBaseClient::~LayerBaseClient()
-{
- sp<Client> c(mClientRef.promote());
- if (c != 0) {
- c->detachLayer(this);
- }
-}
-
-sp<ISurface> LayerBaseClient::createSurface()
-{
- class BSurface : public BnSurface, public LayerCleaner {
- virtual sp<ISurfaceTexture> getSurfaceTexture() const { return 0; }
- public:
- BSurface(const sp<SurfaceFlinger>& flinger,
- const sp<LayerBaseClient>& layer)
- : LayerCleaner(flinger, layer) { }
- };
- sp<ISurface> sur(new BSurface(mFlinger, this));
- return sur;
-}
-
-sp<ISurface> LayerBaseClient::getSurface()
-{
- sp<ISurface> s;
- Mutex::Autolock _l(mLock);
-
- LOG_ALWAYS_FATAL_IF(mHasSurface,
- "LayerBaseClient::getSurface() has already been called");
-
- mHasSurface = true;
- s = createSurface();
- mClientSurfaceBinder = s->asBinder();
- return s;
-}
-
-wp<IBinder> LayerBaseClient::getSurfaceBinder() const {
- return mClientSurfaceBinder;
-}
-
-wp<IBinder> LayerBaseClient::getSurfaceTextureBinder() const {
- return 0;
-}
-
-void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const
-{
- LayerBase::dump(result, buffer, SIZE);
-
- sp<Client> client(mClientRef.promote());
- snprintf(buffer, SIZE,
- " client=%p, identity=%u\n",
- client.get(), getIdentity());
-
- result.append(buffer);
-}
-
-
-void LayerBaseClient::shortDump(String8& result, char* scratch, size_t size) const
-{
- LayerBaseClient::dump(result, scratch, size);
-}
-
-// ---------------------------------------------------------------------------
-
-LayerBaseClient::LayerCleaner::LayerCleaner(const sp<SurfaceFlinger>& flinger,
- const sp<LayerBaseClient>& layer)
- : mFlinger(flinger), mLayer(layer) {
-}
-
-LayerBaseClient::LayerCleaner::~LayerCleaner() {
- // destroy client resources
- mFlinger->destroySurface(mLayer);
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
deleted file mode 100644
index cd6efdd..0000000
--- a/services/surfaceflinger/LayerBase.h
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_LAYER_BASE_H
-#define ANDROID_LAYER_BASE_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES/gl.h>
-
-#include <utils/RefBase.h>
-
-#include <ui/Region.h>
-
-#include <gui/ISurfaceComposerClient.h>
-
-#include <private/gui/LayerState.h>
-
-#include <hardware/hwcomposer.h>
-
-#include "DisplayHardware/DisplayHardware.h"
-#include "Transform.h"
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class Client;
-class DisplayHardware;
-class GraphicBuffer;
-class GraphicPlane;
-class Layer;
-class LayerBaseClient;
-class SurfaceFlinger;
-
-// ---------------------------------------------------------------------------
-
-class LayerBase : public RefBase
-{
- static int32_t sSequence;
-
-public:
- LayerBase(SurfaceFlinger* flinger, DisplayID display);
-
- DisplayID dpy;
- mutable bool contentDirty;
- Region visibleRegionScreen;
- Region transparentRegionScreen;
- Region coveredRegionScreen;
- int32_t sequence;
-
- struct State {
- uint32_t w;
- uint32_t h;
- uint32_t requested_w;
- uint32_t requested_h;
- uint32_t z;
- uint8_t alpha;
- uint8_t flags;
- uint8_t reserved[2];
- int32_t sequence; // changes when visible regions can change
- uint32_t tint;
- Transform transform;
- Region transparentRegion;
- };
-
- virtual void setName(const String8& name);
- String8 getName() const;
-
- // modify current state
- bool setPosition(float x, float y);
- bool setLayer(uint32_t z);
- bool setSize(uint32_t w, uint32_t h);
- bool setAlpha(uint8_t alpha);
- bool setMatrix(const layer_state_t::matrix22_t& matrix);
- bool setTransparentRegionHint(const Region& opaque);
- bool setFlags(uint8_t flags, uint8_t mask);
-
- void commitTransaction();
- bool requestTransaction();
- void forceVisibilityTransaction();
-
- uint32_t getTransactionFlags(uint32_t flags);
- uint32_t setTransactionFlags(uint32_t flags);
-
- Rect visibleBounds() const;
- void drawRegion(const Region& reg) const;
-
- virtual sp<LayerBaseClient> getLayerBaseClient() const { return 0; }
- virtual sp<Layer> getLayer() const { return 0; }
-
- virtual const char* getTypeId() const { return "LayerBase"; }
-
- virtual void setGeometry(hwc_layer_t* hwcl);
- virtual void setPerFrameData(hwc_layer_t* hwcl);
- void setOverlay(bool inOverlay);
- bool isOverlay() const;
-
-
- /**
- * draw - performs some global clipping optimizations
- * and calls onDraw().
- * Typically this method is not overridden, instead implement onDraw()
- * to perform the actual drawing.
- */
- virtual void draw(const Region& clip) const;
- virtual void drawForSreenShot();
-
- /**
- * onDraw - draws the surface.
- */
- virtual void onDraw(const Region& clip) const = 0;
-
- /**
- * initStates - called just after construction
- */
- virtual void initStates(uint32_t w, uint32_t h, uint32_t flags);
-
- /**
- * doTransaction - process the transaction. This is a good place to figure
- * out which attributes of the surface have changed.
- */
- virtual uint32_t doTransaction(uint32_t transactionFlags);
-
- /**
- * setVisibleRegion - called to set the new visible region. This gives
- * a chance to update the new visible region or record the fact it changed.
- */
- virtual void setVisibleRegion(const Region& visibleRegion);
-
- /**
- * setCoveredRegion - called when the covered region changes. The covered
- * region corresponds to any area of the surface that is covered
- * (transparently or not) by another surface.
- */
- virtual void setCoveredRegion(const Region& coveredRegion);
-
- /**
- * validateVisibility - cache a bunch of things
- */
- virtual void validateVisibility(const Transform& globalTransform);
-
- /**
- * lockPageFlip - called each time the screen is redrawn and returns whether
- * the visible regions need to be recomputed (this is a fairly heavy
- * operation, so this should be set only if needed). Typically this is used
- * to figure out if the content or size of a surface has changed.
- */
- virtual void lockPageFlip(bool& recomputeVisibleRegions);
-
- /**
- * unlockPageFlip - called each time the screen is redrawn. updates the
- * final dirty region wrt the planeTransform.
- * At this point, all visible regions, surface position and size, etc... are
- * correct.
- */
- virtual void unlockPageFlip(const Transform& planeTransform, Region& outDirtyRegion);
-
- /**
- * isOpaque - true if this surface is opaque
- */
- virtual bool isOpaque() const { return true; }
-
- /**
- * needsDithering - true if this surface needs dithering
- */
- virtual bool needsDithering() const { return false; }
-
- /**
- * needsLinearFiltering - true if this surface's state requires filtering
- */
- virtual bool needsFiltering() const { return mNeedsFiltering; }
-
- /**
- * isSecure - true if this surface is secure, that is if it prevents
- * screenshots or VNC servers.
- */
- virtual bool isSecure() const { return false; }
-
- /**
- * isProtected - true if the layer may contain protected content in the
- * GRALLOC_USAGE_PROTECTED sense.
- */
- virtual bool isProtected() const { return false; }
-
- /** called with the state lock when the surface is removed from the
- * current list */
- virtual void onRemoved() { }
-
- /** called after page-flip
- */
- virtual void onLayerDisplayed() { }
-
- /** called before composition.
- * returns true if the layer has pending updates.
- */
- virtual bool onPreComposition() { return false; }
-
- /** always call base class first */
- virtual void dump(String8& result, char* scratch, size_t size) const;
- virtual void shortDump(String8& result, char* scratch, size_t size) const;
- virtual void dumpStats(String8& result, char* buffer, size_t SIZE) const;
- virtual void clearStats();
-
-
- enum { // flags for doTransaction()
- eVisibleRegion = 0x00000002,
- };
-
-
- inline const State& drawingState() const { return mDrawingState; }
- inline const State& currentState() const { return mCurrentState; }
- inline State& currentState() { return mCurrentState; }
-
- int32_t getOrientation() const { return mOrientation; }
- int32_t getPlaneOrientation() const { return mPlaneOrientation; }
-
-protected:
- const GraphicPlane& graphicPlane(int dpy) const;
- GraphicPlane& graphicPlane(int dpy);
-
- void clearWithOpenGL(const Region& clip, GLclampf r, GLclampf g,
- GLclampf b, GLclampf alpha) const;
- void clearWithOpenGL(const Region& clip) const;
- void drawWithOpenGL(const Region& clip) const;
-
- void setFiltering(bool filtering);
- bool getFiltering() const;
-
- sp<SurfaceFlinger> mFlinger;
- uint32_t mFlags;
-
-private:
- // accessed only in the main thread
- // Whether filtering is forced on or not
- bool mFiltering;
-
- // cached during validateVisibility()
- // Whether filtering is needed b/c of the drawingstate
- bool mNeedsFiltering;
-
- // this layer is currently handled by the hwc. this is
- // updated at composition time, always frmo the composition
- // thread.
- bool mInOverlay;
-
-protected:
- // cached during validateVisibility()
- int32_t mOrientation;
- int32_t mPlaneOrientation;
- Transform mTransform;
- GLfloat mVertices[4][2];
- Rect mTransformedBounds;
-
- // these are protected by an external lock
- State mCurrentState;
- State mDrawingState;
- volatile int32_t mTransactionFlags;
-
- // don't change, don't need a lock
- bool mPremultipliedAlpha;
- String8 mName;
- mutable bool mDebug;
-
-
-public:
- // called from class SurfaceFlinger
- virtual ~LayerBase();
-
-private:
- LayerBase(const LayerBase& rhs);
-};
-
-
-// ---------------------------------------------------------------------------
-
-class LayerBaseClient : public LayerBase
-{
-public:
- LayerBaseClient(SurfaceFlinger* flinger, DisplayID display,
- const sp<Client>& client);
-
- virtual ~LayerBaseClient();
-
- sp<ISurface> getSurface();
- wp<IBinder> getSurfaceBinder() const;
- virtual wp<IBinder> getSurfaceTextureBinder() const;
-
- virtual sp<LayerBaseClient> getLayerBaseClient() const {
- return const_cast<LayerBaseClient*>(this); }
-
- virtual const char* getTypeId() const { return "LayerBaseClient"; }
-
- uint32_t getIdentity() const { return mIdentity; }
-
-protected:
- virtual void dump(String8& result, char* scratch, size_t size) const;
- virtual void shortDump(String8& result, char* scratch, size_t size) const;
-
- class LayerCleaner {
- sp<SurfaceFlinger> mFlinger;
- wp<LayerBaseClient> mLayer;
- protected:
- ~LayerCleaner();
- public:
- LayerCleaner(const sp<SurfaceFlinger>& flinger,
- const sp<LayerBaseClient>& layer);
- };
-
-private:
- virtual sp<ISurface> createSurface();
-
- mutable Mutex mLock;
- mutable bool mHasSurface;
- wp<IBinder> mClientSurfaceBinder;
- const wp<Client> mClientRef;
- // only read
- const uint32_t mIdentity;
- static int32_t sIdentity;
-};
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_LAYER_BASE_H
diff --git a/services/surfaceflinger/LayerDim.cpp b/services/surfaceflinger/LayerDim.cpp
deleted file mode 100644
index e665d7a..0000000
--- a/services/surfaceflinger/LayerDim.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/Log.h>
-
-#include <ui/GraphicBuffer.h>
-
-#include "LayerDim.h"
-#include "SurfaceFlinger.h"
-#include "DisplayHardware/DisplayHardware.h"
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-LayerDim::LayerDim(SurfaceFlinger* flinger, DisplayID display,
- const sp<Client>& client)
- : LayerBaseClient(flinger, display, client)
-{
-}
-
-LayerDim::~LayerDim()
-{
-}
-
-void LayerDim::onDraw(const Region& clip) const
-{
- const State& s(drawingState());
- Region::const_iterator it = clip.begin();
- Region::const_iterator const end = clip.end();
- if (s.alpha>0 && (it != end)) {
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const GLfloat alpha = s.alpha/255.0f;
- const uint32_t fbHeight = hw.getHeight();
- glDisable(GL_TEXTURE_EXTERNAL_OES);
- glDisable(GL_TEXTURE_2D);
-
- if (s.alpha == 0xFF) {
- glDisable(GL_BLEND);
- } else {
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- }
-
- glColor4f(0, 0, 0, alpha);
-
- glVertexPointer(2, GL_FLOAT, 0, mVertices);
-
- while (it != end) {
- const Rect& r = *it++;
- const GLint sy = fbHeight - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
- glDisable(GL_BLEND);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- }
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/services/surfaceflinger/LayerDim.h b/services/surfaceflinger/LayerDim.h
deleted file mode 100644
index 8770e6d..0000000
--- a/services/surfaceflinger/LayerDim.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_LAYER_DIM_H
-#define ANDROID_LAYER_DIM_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#include "LayerBase.h"
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-class LayerDim : public LayerBaseClient
-{
-public:
- LayerDim(SurfaceFlinger* flinger, DisplayID display,
- const sp<Client>& client);
- virtual ~LayerDim();
-
- virtual void onDraw(const Region& clip) const;
- virtual bool isOpaque() const { return false; }
- virtual bool isSecure() const { return false; }
- virtual bool isProtectedByApp() const { return false; }
- virtual bool isProtectedByDRM() const { return false; }
- virtual const char* getTypeId() const { return "LayerDim"; }
-};
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_LAYER_DIM_H
diff --git a/services/surfaceflinger/LayerScreenshot.cpp b/services/surfaceflinger/LayerScreenshot.cpp
deleted file mode 100644
index c7cf46e..0000000
--- a/services/surfaceflinger/LayerScreenshot.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/Log.h>
-
-#include <ui/GraphicBuffer.h>
-
-#include "LayerScreenshot.h"
-#include "SurfaceFlinger.h"
-#include "DisplayHardware/DisplayHardware.h"
-
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-LayerScreenshot::LayerScreenshot(SurfaceFlinger* flinger, DisplayID display,
- const sp<Client>& client)
- : LayerBaseClient(flinger, display, client),
- mTextureName(0), mFlinger(flinger)
-{
-}
-
-LayerScreenshot::~LayerScreenshot()
-{
- if (mTextureName) {
- mFlinger->postMessageAsync(
- new SurfaceFlinger::MessageDestroyGLTexture(mTextureName) );
- }
-}
-
-status_t LayerScreenshot::captureLocked() {
- GLfloat u, v;
- status_t result = mFlinger->renderScreenToTextureLocked(0, &mTextureName, &u, &v);
- if (result != NO_ERROR) {
- return result;
- }
- initTexture(u, v);
- return NO_ERROR;
-}
-
-status_t LayerScreenshot::capture() {
- GLfloat u, v;
- status_t result = mFlinger->renderScreenToTexture(0, &mTextureName, &u, &v);
- if (result != NO_ERROR) {
- return result;
- }
- initTexture(u, v);
- return NO_ERROR;
-}
-
-void LayerScreenshot::initTexture(GLfloat u, GLfloat v) {
- glBindTexture(GL_TEXTURE_2D, mTextureName);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- mTexCoords[0] = 0; mTexCoords[1] = v;
- mTexCoords[2] = 0; mTexCoords[3] = 0;
- mTexCoords[4] = u; mTexCoords[5] = 0;
- mTexCoords[6] = u; mTexCoords[7] = v;
-}
-
-void LayerScreenshot::initStates(uint32_t w, uint32_t h, uint32_t flags) {
- LayerBaseClient::initStates(w, h, flags);
- if (!(flags & ISurfaceComposer::eHidden)) {
- capture();
- }
-}
-
-uint32_t LayerScreenshot::doTransaction(uint32_t flags)
-{
- const Layer::State& draw(drawingState());
- const Layer::State& curr(currentState());
-
- if (draw.flags & ISurfaceComposer::eLayerHidden) {
- if (!(curr.flags & ISurfaceComposer::eLayerHidden)) {
- // we're going from hidden to visible
- status_t err = captureLocked();
- if (err != NO_ERROR) {
- ALOGW("createScreenshotSurface failed (%s)", strerror(-err));
- }
- }
- } else if (curr.flags & ISurfaceComposer::eLayerHidden) {
- // we're going from visible to hidden
- if (mTextureName) {
- glDeleteTextures(1, &mTextureName);
- mTextureName = 0;
- }
- }
- return LayerBaseClient::doTransaction(flags);
-}
-
-void LayerScreenshot::onDraw(const Region& clip) const
-{
- const State& s(drawingState());
- Region::const_iterator it = clip.begin();
- Region::const_iterator const end = clip.end();
- if (s.alpha>0 && (it != end)) {
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const GLfloat alpha = s.alpha/255.0f;
- const uint32_t fbHeight = hw.getHeight();
-
- if (s.alpha == 0xFF) {
- glDisable(GL_BLEND);
- } else {
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- }
-
- glColor4f(0, 0, 0, alpha);
-
- glDisable(GL_TEXTURE_EXTERNAL_OES);
- glEnable(GL_TEXTURE_2D);
-
- glBindTexture(GL_TEXTURE_2D, mTextureName);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
-
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexCoordPointer(2, GL_FLOAT, 0, mTexCoords);
- glVertexPointer(2, GL_FLOAT, 0, mVertices);
-
- while (it != end) {
- const Rect& r = *it++;
- const GLint sy = fbHeight - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
-
- glDisable(GL_BLEND);
- glDisable(GL_TEXTURE_2D);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- }
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/services/surfaceflinger/LayerScreenshot.h b/services/surfaceflinger/LayerScreenshot.h
deleted file mode 100644
index ab90047..0000000
--- a/services/surfaceflinger/LayerScreenshot.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_LAYER_SCREENSHOT_H
-#define ANDROID_LAYER_SCREENSHOT_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#include "LayerBase.h"
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-class LayerScreenshot : public LayerBaseClient
-{
- GLuint mTextureName;
- GLfloat mTexCoords[8];
- sp<SurfaceFlinger> mFlinger;
-public:
- LayerScreenshot(SurfaceFlinger* flinger, DisplayID display,
- const sp<Client>& client);
- virtual ~LayerScreenshot();
-
- status_t capture();
-
- virtual void initStates(uint32_t w, uint32_t h, uint32_t flags);
- virtual uint32_t doTransaction(uint32_t flags);
- virtual void onDraw(const Region& clip) const;
- virtual bool isOpaque() const { return false; }
- virtual bool isSecure() const { return false; }
- virtual bool isProtectedByApp() const { return false; }
- virtual bool isProtectedByDRM() const { return false; }
- virtual const char* getTypeId() const { return "LayerScreenshot"; }
-
-private:
- status_t captureLocked();
- void initTexture(GLfloat u, GLfloat v);
-};
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif // ANDROID_LAYER_SCREENSHOT_H
diff --git a/services/surfaceflinger/MODULE_LICENSE_APACHE2 b/services/surfaceflinger/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/services/surfaceflinger/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp
deleted file mode 100644
index 290fff4..0000000
--- a/services/surfaceflinger/MessageQueue.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#include <stdint.h>
-#include <errno.h>
-#include <sys/types.h>
-
-#include <binder/IPCThreadState.h>
-
-#include <utils/threads.h>
-#include <utils/Timers.h>
-#include <utils/Log.h>
-
-#include <gui/IDisplayEventConnection.h>
-#include <gui/BitTube.h>
-
-#include "MessageQueue.h"
-#include "EventThread.h"
-#include "SurfaceFlinger.h"
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-MessageBase::MessageBase()
- : MessageHandler() {
-}
-
-MessageBase::~MessageBase() {
-}
-
-void MessageBase::handleMessage(const Message&) {
- this->handler();
- barrier.open();
-};
-
-// ---------------------------------------------------------------------------
-
-void MessageQueue::Handler::signalRefresh() {
- if ((android_atomic_or(eventMaskRefresh, &mEventMask) & eventMaskRefresh) == 0) {
- mQueue.mLooper->sendMessage(this, Message(MessageQueue::REFRESH));
- }
-}
-
-void MessageQueue::Handler::signalInvalidate() {
- if ((android_atomic_or(eventMaskInvalidate, &mEventMask) & eventMaskInvalidate) == 0) {
- mQueue.mLooper->sendMessage(this, Message(MessageQueue::INVALIDATE));
- }
-}
-
-void MessageQueue::Handler::handleMessage(const Message& message) {
- switch (message.what) {
- case INVALIDATE:
- android_atomic_and(~eventMaskInvalidate, &mEventMask);
- mQueue.mFlinger->onMessageReceived(message.what);
- break;
- case REFRESH:
- android_atomic_and(~eventMaskRefresh, &mEventMask);
- mQueue.mFlinger->onMessageReceived(message.what);
- break;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-MessageQueue::MessageQueue()
-{
-}
-
-MessageQueue::~MessageQueue() {
-}
-
-void MessageQueue::init(const sp<SurfaceFlinger>& flinger)
-{
- mFlinger = flinger;
- mLooper = new Looper(true);
- mHandler = new Handler(*this);
-}
-
-void MessageQueue::setEventThread(const sp<EventThread>& eventThread)
-{
- mEventThread = eventThread;
- mEvents = eventThread->createEventConnection();
- mEventTube = mEvents->getDataChannel();
- mLooper->addFd(mEventTube->getFd(), 0, ALOOPER_EVENT_INPUT,
- MessageQueue::cb_eventReceiver, this);
-}
-
-void MessageQueue::waitMessage() {
- do {
- IPCThreadState::self()->flushCommands();
- int32_t ret = mLooper->pollOnce(-1);
- switch (ret) {
- case ALOOPER_POLL_WAKE:
- case ALOOPER_POLL_CALLBACK:
- continue;
- case ALOOPER_POLL_ERROR:
- ALOGE("ALOOPER_POLL_ERROR");
- case ALOOPER_POLL_TIMEOUT:
- // timeout (should not happen)
- continue;
- default:
- // should not happen
- ALOGE("Looper::pollOnce() returned unknown status %d", ret);
- continue;
- }
- } while (true);
-}
-
-status_t MessageQueue::postMessage(
- const sp<MessageBase>& messageHandler, nsecs_t relTime)
-{
- const Message dummyMessage;
- if (relTime > 0) {
- mLooper->sendMessageDelayed(relTime, messageHandler, dummyMessage);
- } else {
- mLooper->sendMessage(messageHandler, dummyMessage);
- }
- return NO_ERROR;
-}
-
-void MessageQueue::invalidate() {
-// mHandler->signalInvalidate();
- mEvents->requestNextVsync();
-}
-
-void MessageQueue::refresh() {
- mEvents->requestNextVsync();
-}
-
-int MessageQueue::cb_eventReceiver(int fd, int events, void* data) {
- MessageQueue* queue = reinterpret_cast<MessageQueue *>(data);
- return queue->eventReceiver(fd, events);
-}
-
-int MessageQueue::eventReceiver(int fd, int events) {
- ssize_t n;
- DisplayEventReceiver::Event buffer[8];
- while ((n = DisplayEventReceiver::getEvents(mEventTube, buffer, 8)) > 0) {
- for (int i=0 ; i<n ; i++) {
- if (buffer[i].header.type == DisplayEventReceiver::DISPLAY_EVENT_VSYNC) {
- mHandler->signalRefresh();
- break;
- }
- }
- }
- return 1;
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/services/surfaceflinger/MessageQueue.h b/services/surfaceflinger/MessageQueue.h
deleted file mode 100644
index ea29e7e..0000000
--- a/services/surfaceflinger/MessageQueue.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#ifndef ANDROID_MESSAGE_QUEUE_H
-#define ANDROID_MESSAGE_QUEUE_H
-
-#include <stdint.h>
-#include <errno.h>
-#include <sys/types.h>
-
-#include <utils/threads.h>
-#include <utils/Timers.h>
-#include <utils/Looper.h>
-
-#include <gui/DisplayEventReceiver.h>
-
-#include "Barrier.h"
-
-namespace android {
-
-class IDisplayEventConnection;
-class EventThread;
-class SurfaceFlinger;
-
-// ---------------------------------------------------------------------------
-
-class MessageBase : public MessageHandler
-{
-public:
- MessageBase();
-
- // return true if message has a handler
- virtual bool handler() = 0;
-
- // waits for the handler to be processed
- void wait() const { barrier.wait(); }
-
-protected:
- virtual ~MessageBase();
-
-private:
- virtual void handleMessage(const Message& message);
-
- mutable Barrier barrier;
-};
-
-// ---------------------------------------------------------------------------
-
-class MessageQueue {
- class Handler : public MessageHandler {
- enum {
- eventMaskInvalidate = 0x1,
- eventMaskRefresh = 0x2
- };
- MessageQueue& mQueue;
- int32_t mEventMask;
- public:
- Handler(MessageQueue& queue) : mQueue(queue), mEventMask(0) { }
- virtual void handleMessage(const Message& message);
- void signalRefresh();
- void signalInvalidate();
- };
-
- friend class Handler;
-
- sp<SurfaceFlinger> mFlinger;
- sp<Looper> mLooper;
- sp<EventThread> mEventThread;
- sp<IDisplayEventConnection> mEvents;
- sp<BitTube> mEventTube;
- sp<Handler> mHandler;
-
-
- static int cb_eventReceiver(int fd, int events, void* data);
- int eventReceiver(int fd, int events);
-
-public:
- enum {
- INVALIDATE = 0,
- REFRESH = 1,
- };
-
- MessageQueue();
- ~MessageQueue();
- void init(const sp<SurfaceFlinger>& flinger);
- void setEventThread(const sp<EventThread>& events);
-
- void waitMessage();
- status_t postMessage(const sp<MessageBase>& message, nsecs_t reltime=0);
- void invalidate();
- void refresh();
-};
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif /* ANDROID_MESSAGE_QUEUE_H */
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
deleted file mode 100644
index 7f61fe4..0000000
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ /dev/null
@@ -1,2812 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <math.h>
-#include <limits.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-#include <binder/IPCThreadState.h>
-#include <binder/IServiceManager.h>
-#include <binder/MemoryHeapBase.h>
-#include <binder/PermissionCache.h>
-
-#include <gui/IDisplayEventConnection.h>
-
-#include <utils/String8.h>
-#include <utils/String16.h>
-#include <utils/StopWatch.h>
-#include <utils/Trace.h>
-
-#include <ui/GraphicBufferAllocator.h>
-#include <ui/PixelFormat.h>
-
-#include <GLES/gl.h>
-
-#include "clz.h"
-#include "DdmConnection.h"
-#include "DisplayEventConnection.h"
-#include "EventThread.h"
-#include "GLExtensions.h"
-#include "Layer.h"
-#include "LayerDim.h"
-#include "LayerScreenshot.h"
-#include "SurfaceFlinger.h"
-
-#include "DisplayHardware/DisplayHardware.h"
-#include "DisplayHardware/HWComposer.h"
-
-#include <private/android_filesystem_config.h>
-#include <private/gui/SharedBufferStack.h>
-
-#define EGL_VERSION_HW_ANDROID 0x3143
-
-#define DISPLAY_COUNT 1
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-const String16 sHardwareTest("android.permission.HARDWARE_TEST");
-const String16 sAccessSurfaceFlinger("android.permission.ACCESS_SURFACE_FLINGER");
-const String16 sReadFramebuffer("android.permission.READ_FRAME_BUFFER");
-const String16 sDump("android.permission.DUMP");
-
-// ---------------------------------------------------------------------------
-
-SurfaceFlinger::SurfaceFlinger()
- : BnSurfaceComposer(), Thread(false),
- mTransactionFlags(0),
- mTransationPending(false),
- mLayersRemoved(false),
- mBootTime(systemTime()),
- mVisibleRegionsDirty(false),
- mHwWorkListDirty(false),
- mElectronBeamAnimationMode(0),
- mDebugRegion(0),
- mDebugBackground(0),
- mDebugDDMS(0),
- mDebugDisableHWC(0),
- mDebugDisableTransformHint(0),
- mDebugInSwapBuffers(0),
- mLastSwapBufferTime(0),
- mDebugInTransaction(0),
- mLastTransactionTime(0),
- mBootFinished(false),
- mConsoleSignals(0),
- mSecureFrameBuffer(0)
-{
- init();
-}
-
-void SurfaceFlinger::init()
-{
- ALOGI("SurfaceFlinger is starting");
-
- // debugging stuff...
- char value[PROPERTY_VALUE_MAX];
-
- property_get("debug.sf.showupdates", value, "0");
- mDebugRegion = atoi(value);
-
- property_get("debug.sf.showbackground", value, "0");
- mDebugBackground = atoi(value);
-
- property_get("debug.sf.ddms", value, "0");
- mDebugDDMS = atoi(value);
- if (mDebugDDMS) {
- DdmConnection::start(getServiceName());
- }
-
- ALOGI_IF(mDebugRegion, "showupdates enabled");
- ALOGI_IF(mDebugBackground, "showbackground enabled");
- ALOGI_IF(mDebugDDMS, "DDMS debugging enabled");
-}
-
-void SurfaceFlinger::onFirstRef()
-{
- mEventQueue.init(this);
-
- run("SurfaceFlinger", PRIORITY_URGENT_DISPLAY);
-
- // Wait for the main thread to be done with its initialization
- mReadyToRunBarrier.wait();
-}
-
-
-SurfaceFlinger::~SurfaceFlinger()
-{
- glDeleteTextures(1, &mWormholeTexName);
-}
-
-void SurfaceFlinger::binderDied(const wp<IBinder>& who)
-{
- // the window manager died on us. prepare its eulogy.
-
- // reset screen orientation
- Vector<ComposerState> state;
- setTransactionState(state, eOrientationDefault, 0);
-
- // restart the boot-animation
- property_set("ctl.start", "bootanim");
-}
-
-sp<IMemoryHeap> SurfaceFlinger::getCblk() const
-{
- return mServerHeap;
-}
-
-sp<ISurfaceComposerClient> SurfaceFlinger::createConnection()
-{
- sp<ISurfaceComposerClient> bclient;
- sp<Client> client(new Client(this));
- status_t err = client->initCheck();
- if (err == NO_ERROR) {
- bclient = client;
- }
- return bclient;
-}
-
-sp<IGraphicBufferAlloc> SurfaceFlinger::createGraphicBufferAlloc()
-{
- sp<GraphicBufferAlloc> gba(new GraphicBufferAlloc());
- return gba;
-}
-
-const GraphicPlane& SurfaceFlinger::graphicPlane(int dpy) const
-{
- ALOGE_IF(uint32_t(dpy) >= DISPLAY_COUNT, "Invalid DisplayID %d", dpy);
- const GraphicPlane& plane(mGraphicPlanes[dpy]);
- return plane;
-}
-
-GraphicPlane& SurfaceFlinger::graphicPlane(int dpy)
-{
- return const_cast<GraphicPlane&>(
- const_cast<SurfaceFlinger const *>(this)->graphicPlane(dpy));
-}
-
-void SurfaceFlinger::bootFinished()
-{
- const nsecs_t now = systemTime();
- const nsecs_t duration = now - mBootTime;
- ALOGI("Boot is finished (%ld ms)", long(ns2ms(duration)) );
- mBootFinished = true;
-
- // wait patiently for the window manager death
- const String16 name("window");
- sp<IBinder> window(defaultServiceManager()->getService(name));
- if (window != 0) {
- window->linkToDeath(this);
- }
-
- // stop boot animation
- property_set("ctl.stop", "bootanim");
-}
-
-static inline uint16_t pack565(int r, int g, int b) {
- return (r<<11)|(g<<5)|b;
-}
-
-status_t SurfaceFlinger::readyToRun()
-{
- ALOGI( "SurfaceFlinger's main thread ready to run. "
- "Initializing graphics H/W...");
-
- // we only support one display currently
- int dpy = 0;
-
- {
- // initialize the main display
- GraphicPlane& plane(graphicPlane(dpy));
- DisplayHardware* const hw = new DisplayHardware(this, dpy);
- plane.setDisplayHardware(hw);
- }
-
- // create the shared control-block
- mServerHeap = new MemoryHeapBase(4096,
- MemoryHeapBase::READ_ONLY, "SurfaceFlinger read-only heap");
- ALOGE_IF(mServerHeap==0, "can't create shared memory dealer");
-
- mServerCblk = static_cast<surface_flinger_cblk_t*>(mServerHeap->getBase());
- ALOGE_IF(mServerCblk==0, "can't get to shared control block's address");
-
- new(mServerCblk) surface_flinger_cblk_t;
-
- // initialize primary screen
- // (other display should be initialized in the same manner, but
- // asynchronously, as they could come and go. None of this is supported
- // yet).
- const GraphicPlane& plane(graphicPlane(dpy));
- const DisplayHardware& hw = plane.displayHardware();
- const uint32_t w = hw.getWidth();
- const uint32_t h = hw.getHeight();
- const uint32_t f = hw.getFormat();
- hw.makeCurrent();
-
- // initialize the shared control block
- mServerCblk->connected |= 1<<dpy;
- display_cblk_t* dcblk = mServerCblk->displays + dpy;
- memset(dcblk, 0, sizeof(display_cblk_t));
- dcblk->w = plane.getWidth();
- dcblk->h = plane.getHeight();
- dcblk->format = f;
- dcblk->orientation = ISurfaceComposer::eOrientationDefault;
- dcblk->xdpi = hw.getDpiX();
- dcblk->ydpi = hw.getDpiY();
- dcblk->fps = hw.getRefreshRate();
- dcblk->density = hw.getDensity();
-
- // Initialize OpenGL|ES
- glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- glPixelStorei(GL_PACK_ALIGNMENT, 4);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnable(GL_SCISSOR_TEST);
- glShadeModel(GL_FLAT);
- glDisable(GL_DITHER);
- glDisable(GL_CULL_FACE);
-
- const uint16_t g0 = pack565(0x0F,0x1F,0x0F);
- const uint16_t g1 = pack565(0x17,0x2f,0x17);
- const uint16_t wormholeTexData[4] = { g0, g1, g1, g0 };
- glGenTextures(1, &mWormholeTexName);
- glBindTexture(GL_TEXTURE_2D, mWormholeTexName);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0,
- GL_RGB, GL_UNSIGNED_SHORT_5_6_5, wormholeTexData);
-
- const uint16_t protTexData[] = { pack565(0x03, 0x03, 0x03) };
- glGenTextures(1, &mProtectedTexName);
- glBindTexture(GL_TEXTURE_2D, mProtectedTexName);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0,
- GL_RGB, GL_UNSIGNED_SHORT_5_6_5, protTexData);
-
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- // put the origin in the left-bottom corner
- glOrthof(0, w, 0, h, 0, 1); // l=0, r=w ; b=0, t=h
-
-
- // start the EventThread
- mEventThread = new EventThread(this);
- mEventQueue.setEventThread(mEventThread);
- hw.startSleepManagement();
-
- /*
- * We're now ready to accept clients...
- */
-
- mReadyToRunBarrier.open();
-
- // start boot animation
- property_set("ctl.start", "bootanim");
-
- return NO_ERROR;
-}
-
-// ----------------------------------------------------------------------------
-
-bool SurfaceFlinger::authenticateSurfaceTexture(
- const sp<ISurfaceTexture>& surfaceTexture) const {
- Mutex::Autolock _l(mStateLock);
- sp<IBinder> surfaceTextureBinder(surfaceTexture->asBinder());
-
- // Check the visible layer list for the ISurface
- const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
- size_t count = currentLayers.size();
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(currentLayers[i]);
- sp<LayerBaseClient> lbc(layer->getLayerBaseClient());
- if (lbc != NULL) {
- wp<IBinder> lbcBinder = lbc->getSurfaceTextureBinder();
- if (lbcBinder == surfaceTextureBinder) {
- return true;
- }
- }
- }
-
- // Check the layers in the purgatory. This check is here so that if a
- // SurfaceTexture gets destroyed before all the clients are done using it,
- // the error will not be reported as "surface XYZ is not authenticated", but
- // will instead fail later on when the client tries to use the surface,
- // which should be reported as "surface XYZ returned an -ENODEV". The
- // purgatorized layers are no less authentic than the visible ones, so this
- // should not cause any harm.
- size_t purgatorySize = mLayerPurgatory.size();
- for (size_t i=0 ; i<purgatorySize ; i++) {
- const sp<LayerBase>& layer(mLayerPurgatory.itemAt(i));
- sp<LayerBaseClient> lbc(layer->getLayerBaseClient());
- if (lbc != NULL) {
- wp<IBinder> lbcBinder = lbc->getSurfaceTextureBinder();
- if (lbcBinder == surfaceTextureBinder) {
- return true;
- }
- }
- }
-
- return false;
-}
-
-// ----------------------------------------------------------------------------
-
-sp<IDisplayEventConnection> SurfaceFlinger::createDisplayEventConnection() {
- return mEventThread->createEventConnection();
-}
-
-// ----------------------------------------------------------------------------
-
-void SurfaceFlinger::waitForEvent() {
- mEventQueue.waitMessage();
-}
-
-void SurfaceFlinger::signalTransaction() {
- mEventQueue.invalidate();
-}
-
-void SurfaceFlinger::signalLayerUpdate() {
- mEventQueue.invalidate();
-}
-
-void SurfaceFlinger::signalRefresh() {
- mEventQueue.refresh();
-}
-
-status_t SurfaceFlinger::postMessageAsync(const sp<MessageBase>& msg,
- nsecs_t reltime, uint32_t flags) {
- return mEventQueue.postMessage(msg, reltime);
-}
-
-status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg,
- nsecs_t reltime, uint32_t flags) {
- status_t res = mEventQueue.postMessage(msg, reltime);
- if (res == NO_ERROR) {
- msg->wait();
- }
- return res;
-}
-
-bool SurfaceFlinger::threadLoop()
-{
- waitForEvent();
- return true;
-}
-
-void SurfaceFlinger::onMessageReceived(int32_t what)
-{
- ATRACE_CALL();
- switch (what) {
- case MessageQueue::REFRESH: {
-// case MessageQueue::INVALIDATE: {
- // check for transactions
- if (CC_UNLIKELY(mConsoleSignals)) {
- handleConsoleEvents();
- }
-
- // if we're in a global transaction, don't do anything.
- const uint32_t mask = eTransactionNeeded | eTraversalNeeded;
- uint32_t transactionFlags = peekTransactionFlags(mask);
- if (CC_UNLIKELY(transactionFlags)) {
- handleTransaction(transactionFlags);
- }
-
- // post surfaces (if needed)
- handlePageFlip();
-
-// signalRefresh();
-//
-// } break;
-//
-// case MessageQueue::REFRESH: {
-
- handleRefresh();
-
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
-
-// if (mDirtyRegion.isEmpty()) {
-// return;
-// }
-
- if (CC_UNLIKELY(mHwWorkListDirty)) {
- // build the h/w work list
- handleWorkList();
- }
-
- if (CC_LIKELY(hw.canDraw())) {
- // repaint the framebuffer (if needed)
- handleRepaint();
- // inform the h/w that we're done compositing
- hw.compositionComplete();
- postFramebuffer();
- } else {
- // pretend we did the post
- hw.compositionComplete();
- }
-
- } break;
- }
-}
-
-void SurfaceFlinger::postFramebuffer()
-{
- ATRACE_CALL();
- // mSwapRegion can be empty here is some cases, for instance if a hidden
- // or fully transparent window is updating.
- // in that case, we need to flip anyways to not risk a deadlock with
- // h/w composer.
-
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const nsecs_t now = systemTime();
- mDebugInSwapBuffers = now;
- hw.flip(mSwapRegion);
-
- size_t numLayers = mVisibleLayersSortedByZ.size();
- for (size_t i = 0; i < numLayers; i++) {
- mVisibleLayersSortedByZ[i]->onLayerDisplayed();
- }
-
- mLastSwapBufferTime = systemTime() - now;
- mDebugInSwapBuffers = 0;
- mSwapRegion.clear();
-}
-
-void SurfaceFlinger::handleConsoleEvents()
-{
- // something to do with the console
- const DisplayHardware& hw = graphicPlane(0).displayHardware();
-
- int what = android_atomic_and(0, &mConsoleSignals);
- if (what & eConsoleAcquired) {
- hw.acquireScreen();
- // this is a temporary work-around, eventually this should be called
- // by the power-manager
- SurfaceFlinger::turnElectronBeamOn(mElectronBeamAnimationMode);
- }
-
- if (what & eConsoleReleased) {
- if (hw.isScreenAcquired()) {
- hw.releaseScreen();
- }
- }
-
- mDirtyRegion.set(hw.bounds());
-}
-
-void SurfaceFlinger::handleTransaction(uint32_t transactionFlags)
-{
- ATRACE_CALL();
-
- Mutex::Autolock _l(mStateLock);
- const nsecs_t now = systemTime();
- mDebugInTransaction = now;
-
- // Here we're guaranteed that some transaction flags are set
- // so we can call handleTransactionLocked() unconditionally.
- // We call getTransactionFlags(), which will also clear the flags,
- // with mStateLock held to guarantee that mCurrentState won't change
- // until the transaction is committed.
-
- const uint32_t mask = eTransactionNeeded | eTraversalNeeded;
- transactionFlags = getTransactionFlags(mask);
- handleTransactionLocked(transactionFlags);
-
- mLastTransactionTime = systemTime() - now;
- mDebugInTransaction = 0;
- invalidateHwcGeometry();
- // here the transaction has been committed
-}
-
-void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
-{
- const LayerVector& currentLayers(mCurrentState.layersSortedByZ);
- const size_t count = currentLayers.size();
-
- /*
- * Traversal of the children
- * (perform the transaction for each of them if needed)
- */
-
- const bool layersNeedTransaction = transactionFlags & eTraversalNeeded;
- if (layersNeedTransaction) {
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer = currentLayers[i];
- uint32_t trFlags = layer->getTransactionFlags(eTransactionNeeded);
- if (!trFlags) continue;
-
- const uint32_t flags = layer->doTransaction(0);
- if (flags & Layer::eVisibleRegion)
- mVisibleRegionsDirty = true;
- }
- }
-
- /*
- * Perform our own transaction if needed
- */
-
- if (transactionFlags & eTransactionNeeded) {
- if (mCurrentState.orientation != mDrawingState.orientation) {
- // the orientation has changed, recompute all visible regions
- // and invalidate everything.
-
- const int dpy = 0;
- const int orientation = mCurrentState.orientation;
- // Currently unused: const uint32_t flags = mCurrentState.orientationFlags;
- GraphicPlane& plane(graphicPlane(dpy));
- plane.setOrientation(orientation);
-
- // update the shared control block
- const DisplayHardware& hw(plane.displayHardware());
- volatile display_cblk_t* dcblk = mServerCblk->displays + dpy;
- dcblk->orientation = orientation;
- dcblk->w = plane.getWidth();
- dcblk->h = plane.getHeight();
-
- mVisibleRegionsDirty = true;
- mDirtyRegion.set(hw.bounds());
- }
-
- if (currentLayers.size() > mDrawingState.layersSortedByZ.size()) {
- // layers have been added
- mVisibleRegionsDirty = true;
- }
-
- // some layers might have been removed, so
- // we need to update the regions they're exposing.
- if (mLayersRemoved) {
- mLayersRemoved = false;
- mVisibleRegionsDirty = true;
- const LayerVector& previousLayers(mDrawingState.layersSortedByZ);
- const size_t count = previousLayers.size();
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(previousLayers[i]);
- if (currentLayers.indexOf( layer ) < 0) {
- // this layer is not visible anymore
- mDirtyRegionRemovedLayer.orSelf(layer->visibleRegionScreen);
- }
- }
- }
- }
-
- commitTransaction();
-}
-
-void SurfaceFlinger::computeVisibleRegions(
- const LayerVector& currentLayers, Region& dirtyRegion, Region& opaqueRegion)
-{
- ATRACE_CALL();
-
- const GraphicPlane& plane(graphicPlane(0));
- const Transform& planeTransform(plane.transform());
- const DisplayHardware& hw(plane.displayHardware());
- const Region screenRegion(hw.bounds());
-
- Region aboveOpaqueLayers;
- Region aboveCoveredLayers;
- Region dirty;
-
- bool secureFrameBuffer = false;
-
- size_t i = currentLayers.size();
- while (i--) {
- const sp<LayerBase>& layer = currentLayers[i];
- layer->validateVisibility(planeTransform);
-
- // start with the whole surface at its current location
- const Layer::State& s(layer->drawingState());
-
- /*
- * opaqueRegion: area of a surface that is fully opaque.
- */
- Region opaqueRegion;
-
- /*
- * visibleRegion: area of a surface that is visible on screen
- * and not fully transparent. This is essentially the layer's
- * footprint minus the opaque regions above it.
- * Areas covered by a translucent surface are considered visible.
- */
- Region visibleRegion;
-
- /*
- * coveredRegion: area of a surface that is covered by all
- * visible regions above it (which includes the translucent areas).
- */
- Region coveredRegion;
-
-
- // handle hidden surfaces by setting the visible region to empty
- if (CC_LIKELY(!(s.flags & ISurfaceComposer::eLayerHidden) && s.alpha)) {
- const bool translucent = !layer->isOpaque();
- const Rect bounds(layer->visibleBounds());
- visibleRegion.set(bounds);
- visibleRegion.andSelf(screenRegion);
- if (!visibleRegion.isEmpty()) {
- // Remove the transparent area from the visible region
- if (translucent) {
- visibleRegion.subtractSelf(layer->transparentRegionScreen);
- }
-
- // compute the opaque region
- const int32_t layerOrientation = layer->getOrientation();
- if (s.alpha==255 && !translucent &&
- ((layerOrientation & Transform::ROT_INVALID) == false)) {
- // the opaque region is the layer's footprint
- opaqueRegion = visibleRegion;
- }
- }
- }
-
- // Clip the covered region to the visible region
- coveredRegion = aboveCoveredLayers.intersect(visibleRegion);
-
- // Update aboveCoveredLayers for next (lower) layer
- aboveCoveredLayers.orSelf(visibleRegion);
-
- // subtract the opaque region covered by the layers above us
- visibleRegion.subtractSelf(aboveOpaqueLayers);
-
- // compute this layer's dirty region
- if (layer->contentDirty) {
- // we need to invalidate the whole region
- dirty = visibleRegion;
- // as well, as the old visible region
- dirty.orSelf(layer->visibleRegionScreen);
- layer->contentDirty = false;
- } else {
- /* compute the exposed region:
- * the exposed region consists of two components:
- * 1) what's VISIBLE now and was COVERED before
- * 2) what's EXPOSED now less what was EXPOSED before
- *
- * note that (1) is conservative, we start with the whole
- * visible region but only keep what used to be covered by
- * something -- which mean it may have been exposed.
- *
- * (2) handles areas that were not covered by anything but got
- * exposed because of a resize.
- */
- const Region newExposed = visibleRegion - coveredRegion;
- const Region oldVisibleRegion = layer->visibleRegionScreen;
- const Region oldCoveredRegion = layer->coveredRegionScreen;
- const Region oldExposed = oldVisibleRegion - oldCoveredRegion;
- dirty = (visibleRegion&oldCoveredRegion) | (newExposed-oldExposed);
- }
- dirty.subtractSelf(aboveOpaqueLayers);
-
- // accumulate to the screen dirty region
- dirtyRegion.orSelf(dirty);
-
- // Update aboveOpaqueLayers for next (lower) layer
- aboveOpaqueLayers.orSelf(opaqueRegion);
-
- // Store the visible region is screen space
- layer->setVisibleRegion(visibleRegion);
- layer->setCoveredRegion(coveredRegion);
-
- // If a secure layer is partially visible, lock-down the screen!
- if (layer->isSecure() && !visibleRegion.isEmpty()) {
- secureFrameBuffer = true;
- }
- }
-
- // invalidate the areas where a layer was removed
- dirtyRegion.orSelf(mDirtyRegionRemovedLayer);
- mDirtyRegionRemovedLayer.clear();
-
- mSecureFrameBuffer = secureFrameBuffer;
- opaqueRegion = aboveOpaqueLayers;
-}
-
-
-void SurfaceFlinger::commitTransaction()
-{
- if (!mLayersPendingRemoval.isEmpty()) {
- // Notify removed layers now that they can't be drawn from
- for (size_t i = 0; i < mLayersPendingRemoval.size(); i++) {
- mLayersPendingRemoval[i]->onRemoved();
- }
- mLayersPendingRemoval.clear();
- }
-
- mDrawingState = mCurrentState;
- mTransationPending = false;
- mTransactionCV.broadcast();
-}
-
-void SurfaceFlinger::handlePageFlip()
-{
- ATRACE_CALL();
- const DisplayHardware& hw = graphicPlane(0).displayHardware();
- const Region screenRegion(hw.bounds());
-
- const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
- const bool visibleRegions = lockPageFlip(currentLayers);
-
- if (visibleRegions || mVisibleRegionsDirty) {
- Region opaqueRegion;
- computeVisibleRegions(currentLayers, mDirtyRegion, opaqueRegion);
-
- /*
- * rebuild the visible layer list
- */
- const size_t count = currentLayers.size();
- mVisibleLayersSortedByZ.clear();
- mVisibleLayersSortedByZ.setCapacity(count);
- for (size_t i=0 ; i<count ; i++) {
- if (!currentLayers[i]->visibleRegionScreen.isEmpty())
- mVisibleLayersSortedByZ.add(currentLayers[i]);
- }
-
- mWormholeRegion = screenRegion.subtract(opaqueRegion);
- mVisibleRegionsDirty = false;
- invalidateHwcGeometry();
- }
-
- unlockPageFlip(currentLayers);
-
- mDirtyRegion.orSelf(getAndClearInvalidateRegion());
- mDirtyRegion.andSelf(screenRegion);
-}
-
-void SurfaceFlinger::invalidateHwcGeometry()
-{
- mHwWorkListDirty = true;
-}
-
-bool SurfaceFlinger::lockPageFlip(const LayerVector& currentLayers)
-{
- bool recomputeVisibleRegions = false;
- size_t count = currentLayers.size();
- sp<LayerBase> const* layers = currentLayers.array();
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(layers[i]);
- layer->lockPageFlip(recomputeVisibleRegions);
- }
- return recomputeVisibleRegions;
-}
-
-void SurfaceFlinger::unlockPageFlip(const LayerVector& currentLayers)
-{
- const GraphicPlane& plane(graphicPlane(0));
- const Transform& planeTransform(plane.transform());
- const size_t count = currentLayers.size();
- sp<LayerBase> const* layers = currentLayers.array();
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(layers[i]);
- layer->unlockPageFlip(planeTransform, mDirtyRegion);
- }
-}
-
-void SurfaceFlinger::handleRefresh()
-{
- bool needInvalidate = false;
- const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
- const size_t count = currentLayers.size();
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(currentLayers[i]);
- if (layer->onPreComposition()) {
- needInvalidate = true;
- }
- }
- if (needInvalidate) {
- signalLayerUpdate();
- }
-}
-
-
-void SurfaceFlinger::handleWorkList()
-{
- mHwWorkListDirty = false;
- HWComposer& hwc(graphicPlane(0).displayHardware().getHwComposer());
- if (hwc.initCheck() == NO_ERROR) {
- const Vector< sp<LayerBase> >& currentLayers(mVisibleLayersSortedByZ);
- const size_t count = currentLayers.size();
- hwc.createWorkList(count);
- hwc_layer_t* const cur(hwc.getLayers());
- for (size_t i=0 ; cur && i<count ; i++) {
- currentLayers[i]->setGeometry(&cur[i]);
- if (mDebugDisableHWC || mDebugRegion) {
- cur[i].compositionType = HWC_FRAMEBUFFER;
- cur[i].flags |= HWC_SKIP_LAYER;
- }
- }
- }
-}
-
-void SurfaceFlinger::handleRepaint()
-{
- ATRACE_CALL();
-
- // compute the invalid region
- mSwapRegion.orSelf(mDirtyRegion);
-
- if (CC_UNLIKELY(mDebugRegion)) {
- debugFlashRegions();
- }
-
- // set the frame buffer
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- uint32_t flags = hw.getFlags();
- if ((flags & DisplayHardware::SWAP_RECTANGLE) ||
- (flags & DisplayHardware::BUFFER_PRESERVED))
- {
- // we can redraw only what's dirty, but since SWAP_RECTANGLE only
- // takes a rectangle, we must make sure to update that whole
- // rectangle in that case
- if (flags & DisplayHardware::SWAP_RECTANGLE) {
- // TODO: we really should be able to pass a region to
- // SWAP_RECTANGLE so that we don't have to redraw all this.
- mDirtyRegion.set(mSwapRegion.bounds());
- } else {
- // in the BUFFER_PRESERVED case, obviously, we can update only
- // what's needed and nothing more.
- // NOTE: this is NOT a common case, as preserving the backbuffer
- // is costly and usually involves copying the whole update back.
- }
- } else {
- if (flags & DisplayHardware::PARTIAL_UPDATES) {
- // We need to redraw the rectangle that will be updated
- // (pushed to the framebuffer).
- // This is needed because PARTIAL_UPDATES only takes one
- // rectangle instead of a region (see DisplayHardware::flip())
- mDirtyRegion.set(mSwapRegion.bounds());
- } else {
- // we need to redraw everything (the whole screen)
- mDirtyRegion.set(hw.bounds());
- mSwapRegion = mDirtyRegion;
- }
- }
-
- setupHardwareComposer(mDirtyRegion);
- composeSurfaces(mDirtyRegion);
-
- // update the swap region and clear the dirty region
- mSwapRegion.orSelf(mDirtyRegion);
- mDirtyRegion.clear();
-}
-
-void SurfaceFlinger::setupHardwareComposer(Region& dirtyInOut)
-{
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- HWComposer& hwc(hw.getHwComposer());
- hwc_layer_t* const cur(hwc.getLayers());
- if (!cur) {
- return;
- }
-
- const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
- size_t count = layers.size();
-
- ALOGE_IF(hwc.getNumLayers() != count,
- "HAL number of layers (%d) doesn't match surfaceflinger (%d)",
- hwc.getNumLayers(), count);
-
- // just to be extra-safe, use the smallest count
- if (hwc.initCheck() == NO_ERROR) {
- count = count < hwc.getNumLayers() ? count : hwc.getNumLayers();
- }
-
- /*
- * update the per-frame h/w composer data for each layer
- * and build the transparent region of the FB
- */
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(layers[i]);
- layer->setPerFrameData(&cur[i]);
- }
- const size_t fbLayerCount = hwc.getLayerCount(HWC_FRAMEBUFFER);
- status_t err = hwc.prepare();
- ALOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err));
-
- if (err == NO_ERROR) {
- // what's happening here is tricky.
- // we want to clear all the layers with the CLEAR_FB flags
- // that are opaque.
- // however, since some GPU are efficient at preserving
- // the backbuffer, we want to take advantage of that so we do the
- // clear only in the dirty region (other areas will be preserved
- // on those GPUs).
- // NOTE: on non backbuffer preserving GPU, the dirty region
- // has already been expanded as needed, so the code is correct
- // there too.
- //
- // However, the content of the framebuffer cannot be trusted when
- // we switch to/from FB/OVERLAY, in which case we need to
- // expand the dirty region to those areas too.
- //
- // Note also that there is a special case when switching from
- // "no layers in FB" to "some layers in FB", where we need to redraw
- // the entire FB, since some areas might contain uninitialized
- // data.
- //
- // Also we want to make sure to not clear areas that belong to
- // layers above that won't redraw (we would just be erasing them),
- // that is, we can't erase anything outside the dirty region.
-
- Region transparent;
-
- if (!fbLayerCount && hwc.getLayerCount(HWC_FRAMEBUFFER)) {
- transparent.set(hw.getBounds());
- dirtyInOut = transparent;
- } else {
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(layers[i]);
- if ((cur[i].hints & HWC_HINT_CLEAR_FB) && layer->isOpaque()) {
- transparent.orSelf(layer->visibleRegionScreen);
- }
- bool isOverlay = (cur[i].compositionType != HWC_FRAMEBUFFER);
- if (isOverlay != layer->isOverlay()) {
- // we transitioned to/from overlay, so add this layer
- // to the dirty region so the framebuffer can be either
- // cleared or redrawn.
- dirtyInOut.orSelf(layer->visibleRegionScreen);
- }
- layer->setOverlay(isOverlay);
- }
- // don't erase stuff outside the dirty region
- transparent.andSelf(dirtyInOut);
- }
-
- /*
- * clear the area of the FB that need to be transparent
- */
- if (!transparent.isEmpty()) {
- glClearColor(0,0,0,0);
- Region::const_iterator it = transparent.begin();
- Region::const_iterator const end = transparent.end();
- const int32_t height = hw.getHeight();
- while (it != end) {
- const Rect& r(*it++);
- const GLint sy = height - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glClear(GL_COLOR_BUFFER_BIT);
- }
- }
- }
-}
-
-void SurfaceFlinger::composeSurfaces(const Region& dirty)
-{
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- HWComposer& hwc(hw.getHwComposer());
-
- const size_t fbLayerCount = hwc.getLayerCount(HWC_FRAMEBUFFER);
- if (CC_UNLIKELY(fbLayerCount && !mWormholeRegion.isEmpty())) {
- // should never happen unless the window manager has a bug
- // draw something...
- drawWormhole();
- }
-
- // FIXME: workaroud for b/6020860
- glEnable(GL_SCISSOR_TEST);
- glScissor(0,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
- // end-workaround
-
- /*
- * and then, render the layers targeted at the framebuffer
- */
- hwc_layer_t* const cur(hwc.getLayers());
- const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
- size_t count = layers.size();
- for (size_t i=0 ; i<count ; i++) {
- if (cur && (cur[i].compositionType != HWC_FRAMEBUFFER)) {
- continue;
- }
- const sp<LayerBase>& layer(layers[i]);
- const Region clip(dirty.intersect(layer->visibleRegionScreen));
- if (!clip.isEmpty()) {
- layer->draw(clip);
- }
- }
-}
-
-void SurfaceFlinger::debugFlashRegions()
-{
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const uint32_t flags = hw.getFlags();
- const int32_t height = hw.getHeight();
- if (mSwapRegion.isEmpty()) {
- return;
- }
-
- if (!((flags & DisplayHardware::SWAP_RECTANGLE) ||
- (flags & DisplayHardware::BUFFER_PRESERVED))) {
- const Region repaint((flags & DisplayHardware::PARTIAL_UPDATES) ?
- mDirtyRegion.bounds() : hw.bounds());
- composeSurfaces(repaint);
- }
-
- glDisable(GL_TEXTURE_EXTERNAL_OES);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_BLEND);
- glDisable(GL_SCISSOR_TEST);
-
- static int toggle = 0;
- toggle = 1 - toggle;
- if (toggle) {
- glColor4f(1, 0, 1, 1);
- } else {
- glColor4f(1, 1, 0, 1);
- }
-
- Region::const_iterator it = mDirtyRegion.begin();
- Region::const_iterator const end = mDirtyRegion.end();
- while (it != end) {
- const Rect& r = *it++;
- GLfloat vertices[][2] = {
- { r.left, height - r.top },
- { r.left, height - r.bottom },
- { r.right, height - r.bottom },
- { r.right, height - r.top }
- };
- glVertexPointer(2, GL_FLOAT, 0, vertices);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
-
- hw.flip(mSwapRegion);
-
- if (mDebugRegion > 1)
- usleep(mDebugRegion * 1000);
-
- glEnable(GL_SCISSOR_TEST);
-}
-
-void SurfaceFlinger::drawWormhole() const
-{
- const Region region(mWormholeRegion.intersect(mDirtyRegion));
- if (region.isEmpty())
- return;
-
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const int32_t width = hw.getWidth();
- const int32_t height = hw.getHeight();
-
- if (CC_LIKELY(!mDebugBackground)) {
- glClearColor(0,0,0,0);
- Region::const_iterator it = region.begin();
- Region::const_iterator const end = region.end();
- while (it != end) {
- const Rect& r = *it++;
- const GLint sy = height - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glClear(GL_COLOR_BUFFER_BIT);
- }
- } else {
- const GLshort vertices[][2] = { { 0, 0 }, { width, 0 },
- { width, height }, { 0, height } };
- const GLshort tcoords[][2] = { { 0, 0 }, { 1, 0 }, { 1, 1 }, { 0, 1 } };
-
- glVertexPointer(2, GL_SHORT, 0, vertices);
- glTexCoordPointer(2, GL_SHORT, 0, tcoords);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
- glDisable(GL_TEXTURE_EXTERNAL_OES);
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, mWormholeTexName);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
-
- glDisable(GL_BLEND);
-
- glScalef(width*(1.0f/32.0f), height*(1.0f/32.0f), 1);
- Region::const_iterator it = region.begin();
- Region::const_iterator const end = region.end();
- while (it != end) {
- const Rect& r = *it++;
- const GLint sy = height - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable(GL_TEXTURE_2D);
- glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
- }
-}
-
-status_t SurfaceFlinger::addLayer(const sp<LayerBase>& layer)
-{
- Mutex::Autolock _l(mStateLock);
- addLayer_l(layer);
- setTransactionFlags(eTransactionNeeded|eTraversalNeeded);
- return NO_ERROR;
-}
-
-status_t SurfaceFlinger::addLayer_l(const sp<LayerBase>& layer)
-{
- ssize_t i = mCurrentState.layersSortedByZ.add(layer);
- return (i < 0) ? status_t(i) : status_t(NO_ERROR);
-}
-
-ssize_t SurfaceFlinger::addClientLayer(const sp<Client>& client,
- const sp<LayerBaseClient>& lbc)
-{
- // attach this layer to the client
- size_t name = client->attachLayer(lbc);
-
- Mutex::Autolock _l(mStateLock);
-
- // add this layer to the current state list
- addLayer_l(lbc);
-
- return ssize_t(name);
-}
-
-status_t SurfaceFlinger::removeLayer(const sp<LayerBase>& layer)
-{
- Mutex::Autolock _l(mStateLock);
- status_t err = purgatorizeLayer_l(layer);
- if (err == NO_ERROR)
- setTransactionFlags(eTransactionNeeded);
- return err;
-}
-
-status_t SurfaceFlinger::removeLayer_l(const sp<LayerBase>& layerBase)
-{
- sp<LayerBaseClient> lbc(layerBase->getLayerBaseClient());
- if (lbc != 0) {
- mLayerMap.removeItem( lbc->getSurfaceBinder() );
- }
- ssize_t index = mCurrentState.layersSortedByZ.remove(layerBase);
- if (index >= 0) {
- mLayersRemoved = true;
- return NO_ERROR;
- }
- return status_t(index);
-}
-
-status_t SurfaceFlinger::purgatorizeLayer_l(const sp<LayerBase>& layerBase)
-{
- // First add the layer to the purgatory list, which makes sure it won't
- // go away, then remove it from the main list (through a transaction).
- ssize_t err = removeLayer_l(layerBase);
- if (err >= 0) {
- mLayerPurgatory.add(layerBase);
- }
-
- mLayersPendingRemoval.push(layerBase);
-
- // it's possible that we don't find a layer, because it might
- // have been destroyed already -- this is not technically an error
- // from the user because there is a race between Client::destroySurface(),
- // ~Client() and ~ISurface().
- return (err == NAME_NOT_FOUND) ? status_t(NO_ERROR) : err;
-}
-
-status_t SurfaceFlinger::invalidateLayerVisibility(const sp<LayerBase>& layer)
-{
- layer->forceVisibilityTransaction();
- setTransactionFlags(eTraversalNeeded);
- return NO_ERROR;
-}
-
-uint32_t SurfaceFlinger::peekTransactionFlags(uint32_t flags)
-{
- return android_atomic_release_load(&mTransactionFlags);
-}
-
-uint32_t SurfaceFlinger::getTransactionFlags(uint32_t flags)
-{
- return android_atomic_and(~flags, &mTransactionFlags) & flags;
-}
-
-uint32_t SurfaceFlinger::setTransactionFlags(uint32_t flags)
-{
- uint32_t old = android_atomic_or(flags, &mTransactionFlags);
- if ((old & flags)==0) { // wake the server up
- signalTransaction();
- }
- return old;
-}
-
-
-void SurfaceFlinger::setTransactionState(const Vector<ComposerState>& state,
- int orientation, uint32_t flags) {
- Mutex::Autolock _l(mStateLock);
-
- uint32_t transactionFlags = 0;
- if (mCurrentState.orientation != orientation) {
- if (uint32_t(orientation)<=eOrientation270 || orientation==42) {
- mCurrentState.orientation = orientation;
- transactionFlags |= eTransactionNeeded;
- } else if (orientation != eOrientationUnchanged) {
- ALOGW("setTransactionState: ignoring unrecognized orientation: %d",
- orientation);
- }
- }
-
- const size_t count = state.size();
- for (size_t i=0 ; i<count ; i++) {
- const ComposerState& s(state[i]);
- sp<Client> client( static_cast<Client *>(s.client.get()) );
- transactionFlags |= setClientStateLocked(client, s.state);
- }
-
- if (transactionFlags) {
- // this triggers the transaction
- setTransactionFlags(transactionFlags);
-
- // if this is a synchronous transaction, wait for it to take effect
- // before returning.
- if (flags & eSynchronous) {
- mTransationPending = true;
- }
- while (mTransationPending) {
- status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5));
- if (CC_UNLIKELY(err != NO_ERROR)) {
- // just in case something goes wrong in SF, return to the
- // called after a few seconds.
- ALOGW_IF(err == TIMED_OUT, "closeGlobalTransaction timed out!");
- mTransationPending = false;
- break;
- }
- }
- }
-}
-
-sp<ISurface> SurfaceFlinger::createSurface(
- ISurfaceComposerClient::surface_data_t* params,
- const String8& name,
- const sp<Client>& client,
- DisplayID d, uint32_t w, uint32_t h, PixelFormat format,
- uint32_t flags)
-{
- sp<LayerBaseClient> layer;
- sp<ISurface> surfaceHandle;
-
- if (int32_t(w|h) < 0) {
- ALOGE("createSurface() failed, w or h is negative (w=%d, h=%d)",
- int(w), int(h));
- return surfaceHandle;
- }
-
- //ALOGD("createSurface for (%d x %d), name=%s", w, h, name.string());
- sp<Layer> normalLayer;
- switch (flags & eFXSurfaceMask) {
- case eFXSurfaceNormal:
- normalLayer = createNormalSurface(client, d, w, h, flags, format);
- layer = normalLayer;
- break;
- case eFXSurfaceBlur:
- // for now we treat Blur as Dim, until we can implement it
- // efficiently.
- case eFXSurfaceDim:
- layer = createDimSurface(client, d, w, h, flags);
- break;
- case eFXSurfaceScreenshot:
- layer = createScreenshotSurface(client, d, w, h, flags);
- break;
- }
-
- if (layer != 0) {
- layer->initStates(w, h, flags);
- layer->setName(name);
- ssize_t token = addClientLayer(client, layer);
-
- surfaceHandle = layer->getSurface();
- if (surfaceHandle != 0) {
- params->token = token;
- params->identity = layer->getIdentity();
- if (normalLayer != 0) {
- Mutex::Autolock _l(mStateLock);
- mLayerMap.add(layer->getSurfaceBinder(), normalLayer);
- }
- }
-
- setTransactionFlags(eTransactionNeeded);
- }
-
- return surfaceHandle;
-}
-
-sp<Layer> SurfaceFlinger::createNormalSurface(
- const sp<Client>& client, DisplayID display,
- uint32_t w, uint32_t h, uint32_t flags,
- PixelFormat& format)
-{
- // initialize the surfaces
- switch (format) { // TODO: take h/w into account
- case PIXEL_FORMAT_TRANSPARENT:
- case PIXEL_FORMAT_TRANSLUCENT:
- format = PIXEL_FORMAT_RGBA_8888;
- break;
- case PIXEL_FORMAT_OPAQUE:
-#ifdef NO_RGBX_8888
- format = PIXEL_FORMAT_RGB_565;
-#else
- format = PIXEL_FORMAT_RGBX_8888;
-#endif
- break;
- }
-
-#ifdef NO_RGBX_8888
- if (format == PIXEL_FORMAT_RGBX_8888)
- format = PIXEL_FORMAT_RGBA_8888;
-#endif
-
- sp<Layer> layer = new Layer(this, display, client);
- status_t err = layer->setBuffers(w, h, format, flags);
- if (CC_LIKELY(err != NO_ERROR)) {
- ALOGE("createNormalSurfaceLocked() failed (%s)", strerror(-err));
- layer.clear();
- }
- return layer;
-}
-
-sp<LayerDim> SurfaceFlinger::createDimSurface(
- const sp<Client>& client, DisplayID display,
- uint32_t w, uint32_t h, uint32_t flags)
-{
- sp<LayerDim> layer = new LayerDim(this, display, client);
- return layer;
-}
-
-sp<LayerScreenshot> SurfaceFlinger::createScreenshotSurface(
- const sp<Client>& client, DisplayID display,
- uint32_t w, uint32_t h, uint32_t flags)
-{
- sp<LayerScreenshot> layer = new LayerScreenshot(this, display, client);
- return layer;
-}
-
-status_t SurfaceFlinger::removeSurface(const sp<Client>& client, SurfaceID sid)
-{
- /*
- * called by the window manager, when a surface should be marked for
- * destruction.
- *
- * The surface is removed from the current and drawing lists, but placed
- * in the purgatory queue, so it's not destroyed right-away (we need
- * to wait for all client's references to go away first).
- */
-
- status_t err = NAME_NOT_FOUND;
- Mutex::Autolock _l(mStateLock);
- sp<LayerBaseClient> layer = client->getLayerUser(sid);
- if (layer != 0) {
- err = purgatorizeLayer_l(layer);
- if (err == NO_ERROR) {
- setTransactionFlags(eTransactionNeeded);
- }
- }
- return err;
-}
-
-status_t SurfaceFlinger::destroySurface(const wp<LayerBaseClient>& layer)
-{
- // called by ~ISurface() when all references are gone
- status_t err = NO_ERROR;
- sp<LayerBaseClient> l(layer.promote());
- if (l != NULL) {
- Mutex::Autolock _l(mStateLock);
- err = removeLayer_l(l);
- if (err == NAME_NOT_FOUND) {
- // The surface wasn't in the current list, which means it was
- // removed already, which means it is in the purgatory,
- // and need to be removed from there.
- ssize_t idx = mLayerPurgatory.remove(l);
- ALOGE_IF(idx < 0,
- "layer=%p is not in the purgatory list", l.get());
- }
- ALOGE_IF(err<0 && err != NAME_NOT_FOUND,
- "error removing layer=%p (%s)", l.get(), strerror(-err));
- }
- return err;
-}
-
-uint32_t SurfaceFlinger::setClientStateLocked(
- const sp<Client>& client,
- const layer_state_t& s)
-{
- uint32_t flags = 0;
- sp<LayerBaseClient> layer(client->getLayerUser(s.surface));
- if (layer != 0) {
- const uint32_t what = s.what;
- if (what & ePositionChanged) {
- if (layer->setPosition(s.x, s.y))
- flags |= eTraversalNeeded;
- }
- if (what & eLayerChanged) {
- ssize_t idx = mCurrentState.layersSortedByZ.indexOf(layer);
- if (layer->setLayer(s.z)) {
- mCurrentState.layersSortedByZ.removeAt(idx);
- mCurrentState.layersSortedByZ.add(layer);
- // we need traversal (state changed)
- // AND transaction (list changed)
- flags |= eTransactionNeeded|eTraversalNeeded;
- }
- }
- if (what & eSizeChanged) {
- if (layer->setSize(s.w, s.h)) {
- flags |= eTraversalNeeded;
- }
- }
- if (what & eAlphaChanged) {
- if (layer->setAlpha(uint8_t(255.0f*s.alpha+0.5f)))
- flags |= eTraversalNeeded;
- }
- if (what & eMatrixChanged) {
- if (layer->setMatrix(s.matrix))
- flags |= eTraversalNeeded;
- }
- if (what & eTransparentRegionChanged) {
- if (layer->setTransparentRegionHint(s.transparentRegion))
- flags |= eTraversalNeeded;
- }
- if (what & eVisibilityChanged) {
- if (layer->setFlags(s.flags, s.mask))
- flags |= eTraversalNeeded;
- }
- }
- return flags;
-}
-
-void SurfaceFlinger::screenReleased(int dpy)
-{
- // this may be called by a signal handler, we can't do too much in here
- android_atomic_or(eConsoleReleased, &mConsoleSignals);
- signalTransaction();
-}
-
-void SurfaceFlinger::screenAcquired(int dpy)
-{
- // this may be called by a signal handler, we can't do too much in here
- android_atomic_or(eConsoleAcquired, &mConsoleSignals);
- signalTransaction();
-}
-
-status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
-{
- const size_t SIZE = 4096;
- char buffer[SIZE];
- String8 result;
-
- if (!PermissionCache::checkCallingPermission(sDump)) {
- snprintf(buffer, SIZE, "Permission Denial: "
- "can't dump SurfaceFlinger from pid=%d, uid=%d\n",
- IPCThreadState::self()->getCallingPid(),
- IPCThreadState::self()->getCallingUid());
- result.append(buffer);
- } else {
- // Try to get the main lock, but don't insist if we can't
- // (this would indicate SF is stuck, but we want to be able to
- // print something in dumpsys).
- int retry = 3;
- while (mStateLock.tryLock()<0 && --retry>=0) {
- usleep(1000000);
- }
- const bool locked(retry >= 0);
- if (!locked) {
- snprintf(buffer, SIZE,
- "SurfaceFlinger appears to be unresponsive, "
- "dumping anyways (no locks held)\n");
- result.append(buffer);
- }
-
- bool dumpAll = true;
- size_t index = 0;
- size_t numArgs = args.size();
- if (numArgs) {
- dumpAll = false;
-
- if ((index < numArgs) &&
- (args[index] == String16("--list"))) {
- index++;
- listLayersLocked(args, index, result, buffer, SIZE);
- }
-
- if ((index < numArgs) &&
- (args[index] == String16("--latency"))) {
- index++;
- dumpStatsLocked(args, index, result, buffer, SIZE);
- }
-
- if ((index < numArgs) &&
- (args[index] == String16("--latency-clear"))) {
- index++;
- clearStatsLocked(args, index, result, buffer, SIZE);
- }
- }
-
- if (dumpAll) {
- dumpAllLocked(result, buffer, SIZE);
- }
-
- if (locked) {
- mStateLock.unlock();
- }
- }
- write(fd, result.string(), result.size());
- return NO_ERROR;
-}
-
-void SurfaceFlinger::listLayersLocked(const Vector<String16>& args, size_t& index,
- String8& result, char* buffer, size_t SIZE) const
-{
- const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
- const size_t count = currentLayers.size();
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(currentLayers[i]);
- snprintf(buffer, SIZE, "%s\n", layer->getName().string());
- result.append(buffer);
- }
-}
-
-void SurfaceFlinger::dumpStatsLocked(const Vector<String16>& args, size_t& index,
- String8& result, char* buffer, size_t SIZE) const
-{
- String8 name;
- if (index < args.size()) {
- name = String8(args[index]);
- index++;
- }
-
- const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
- const size_t count = currentLayers.size();
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(currentLayers[i]);
- if (name.isEmpty()) {
- snprintf(buffer, SIZE, "%s\n", layer->getName().string());
- result.append(buffer);
- }
- if (name.isEmpty() || (name == layer->getName())) {
- layer->dumpStats(result, buffer, SIZE);
- }
- }
-}
-
-void SurfaceFlinger::clearStatsLocked(const Vector<String16>& args, size_t& index,
- String8& result, char* buffer, size_t SIZE) const
-{
- String8 name;
- if (index < args.size()) {
- name = String8(args[index]);
- index++;
- }
-
- const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
- const size_t count = currentLayers.size();
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(currentLayers[i]);
- if (name.isEmpty() || (name == layer->getName())) {
- layer->clearStats();
- }
- }
-}
-
-void SurfaceFlinger::dumpAllLocked(
- String8& result, char* buffer, size_t SIZE) const
-{
- // figure out if we're stuck somewhere
- const nsecs_t now = systemTime();
- const nsecs_t inSwapBuffers(mDebugInSwapBuffers);
- const nsecs_t inTransaction(mDebugInTransaction);
- nsecs_t inSwapBuffersDuration = (inSwapBuffers) ? now-inSwapBuffers : 0;
- nsecs_t inTransactionDuration = (inTransaction) ? now-inTransaction : 0;
-
- /*
- * Dump the visible layer list
- */
- const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
- const size_t count = currentLayers.size();
- snprintf(buffer, SIZE, "Visible layers (count = %d)\n", count);
- result.append(buffer);
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(currentLayers[i]);
- layer->dump(result, buffer, SIZE);
- }
-
- /*
- * Dump the layers in the purgatory
- */
-
- const size_t purgatorySize = mLayerPurgatory.size();
- snprintf(buffer, SIZE, "Purgatory state (%d entries)\n", purgatorySize);
- result.append(buffer);
- for (size_t i=0 ; i<purgatorySize ; i++) {
- const sp<LayerBase>& layer(mLayerPurgatory.itemAt(i));
- layer->shortDump(result, buffer, SIZE);
- }
-
- /*
- * Dump SurfaceFlinger global state
- */
-
- snprintf(buffer, SIZE, "SurfaceFlinger global state:\n");
- result.append(buffer);
-
- const GLExtensions& extensions(GLExtensions::getInstance());
- snprintf(buffer, SIZE, "GLES: %s, %s, %s\n",
- extensions.getVendor(),
- extensions.getRenderer(),
- extensions.getVersion());
- result.append(buffer);
-
- snprintf(buffer, SIZE, "EGL : %s\n",
- eglQueryString(graphicPlane(0).getEGLDisplay(),
- EGL_VERSION_HW_ANDROID));
- result.append(buffer);
-
- snprintf(buffer, SIZE, "EXTS: %s\n", extensions.getExtension());
- result.append(buffer);
-
- mWormholeRegion.dump(result, "WormholeRegion");
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- snprintf(buffer, SIZE,
- " orientation=%d, canDraw=%d\n",
- mCurrentState.orientation, hw.canDraw());
- result.append(buffer);
- snprintf(buffer, SIZE,
- " last eglSwapBuffers() time: %f us\n"
- " last transaction time : %f us\n"
- " transaction-flags : %08x\n"
- " refresh-rate : %f fps\n"
- " x-dpi : %f\n"
- " y-dpi : %f\n",
- mLastSwapBufferTime/1000.0,
- mLastTransactionTime/1000.0,
- mTransactionFlags,
- hw.getRefreshRate(),
- hw.getDpiX(),
- hw.getDpiY());
- result.append(buffer);
-
- snprintf(buffer, SIZE, " eglSwapBuffers time: %f us\n",
- inSwapBuffersDuration/1000.0);
- result.append(buffer);
-
- snprintf(buffer, SIZE, " transaction time: %f us\n",
- inTransactionDuration/1000.0);
- result.append(buffer);
-
- /*
- * VSYNC state
- */
- mEventThread->dump(result, buffer, SIZE);
-
- /*
- * Dump HWComposer state
- */
- HWComposer& hwc(hw.getHwComposer());
- snprintf(buffer, SIZE, "h/w composer state:\n");
- result.append(buffer);
- snprintf(buffer, SIZE, " h/w composer %s and %s\n",
- hwc.initCheck()==NO_ERROR ? "present" : "not present",
- (mDebugDisableHWC || mDebugRegion) ? "disabled" : "enabled");
- result.append(buffer);
- hwc.dump(result, buffer, SIZE, mVisibleLayersSortedByZ);
-
- /*
- * Dump gralloc state
- */
- const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
- alloc.dump(result);
- hw.dump(result);
-}
-
-status_t SurfaceFlinger::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch (code) {
- case CREATE_CONNECTION:
- case SET_TRANSACTION_STATE:
- case SET_ORIENTATION:
- case BOOT_FINISHED:
- case TURN_ELECTRON_BEAM_OFF:
- case TURN_ELECTRON_BEAM_ON:
- {
- // codes that require permission check
- IPCThreadState* ipc = IPCThreadState::self();
- const int pid = ipc->getCallingPid();
- const int uid = ipc->getCallingUid();
- if ((uid != AID_GRAPHICS) &&
- !PermissionCache::checkPermission(sAccessSurfaceFlinger, pid, uid)) {
- ALOGE("Permission Denial: "
- "can't access SurfaceFlinger pid=%d, uid=%d", pid, uid);
- return PERMISSION_DENIED;
- }
- break;
- }
- case CAPTURE_SCREEN:
- {
- // codes that require permission check
- IPCThreadState* ipc = IPCThreadState::self();
- const int pid = ipc->getCallingPid();
- const int uid = ipc->getCallingUid();
- if ((uid != AID_GRAPHICS) &&
- !PermissionCache::checkPermission(sReadFramebuffer, pid, uid)) {
- ALOGE("Permission Denial: "
- "can't read framebuffer pid=%d, uid=%d", pid, uid);
- return PERMISSION_DENIED;
- }
- break;
- }
- }
-
- status_t err = BnSurfaceComposer::onTransact(code, data, reply, flags);
- if (err == UNKNOWN_TRANSACTION || err == PERMISSION_DENIED) {
- CHECK_INTERFACE(ISurfaceComposer, data, reply);
- if (CC_UNLIKELY(!PermissionCache::checkCallingPermission(sHardwareTest))) {
- IPCThreadState* ipc = IPCThreadState::self();
- const int pid = ipc->getCallingPid();
- const int uid = ipc->getCallingUid();
- ALOGE("Permission Denial: "
- "can't access SurfaceFlinger pid=%d, uid=%d", pid, uid);
- return PERMISSION_DENIED;
- }
- int n;
- switch (code) {
- case 1000: // SHOW_CPU, NOT SUPPORTED ANYMORE
- case 1001: // SHOW_FPS, NOT SUPPORTED ANYMORE
- return NO_ERROR;
- case 1002: // SHOW_UPDATES
- n = data.readInt32();
- mDebugRegion = n ? n : (mDebugRegion ? 0 : 1);
- invalidateHwcGeometry();
- repaintEverything();
- return NO_ERROR;
- case 1003: // SHOW_BACKGROUND
- n = data.readInt32();
- mDebugBackground = n ? 1 : 0;
- return NO_ERROR;
- case 1004:{ // repaint everything
- repaintEverything();
- return NO_ERROR;
- }
- case 1005:{ // force transaction
- setTransactionFlags(eTransactionNeeded|eTraversalNeeded);
- return NO_ERROR;
- }
- case 1006:{ // send empty update
- signalRefresh();
- return NO_ERROR;
- }
- case 1008: // toggle use of hw composer
- n = data.readInt32();
- mDebugDisableHWC = n ? 1 : 0;
- invalidateHwcGeometry();
- repaintEverything();
- return NO_ERROR;
- case 1009: // toggle use of transform hint
- n = data.readInt32();
- mDebugDisableTransformHint = n ? 1 : 0;
- invalidateHwcGeometry();
- repaintEverything();
- return NO_ERROR;
- case 1010: // interrogate.
- reply->writeInt32(0);
- reply->writeInt32(0);
- reply->writeInt32(mDebugRegion);
- reply->writeInt32(mDebugBackground);
- reply->writeInt32(mDebugDisableHWC);
- return NO_ERROR;
- case 1013: {
- Mutex::Autolock _l(mStateLock);
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- reply->writeInt32(hw.getPageFlipCount());
- }
- return NO_ERROR;
- }
- }
- return err;
-}
-
-void SurfaceFlinger::repaintEverything() {
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const Rect bounds(hw.getBounds());
- setInvalidateRegion(Region(bounds));
- signalTransaction();
-}
-
-void SurfaceFlinger::setInvalidateRegion(const Region& reg) {
- Mutex::Autolock _l(mInvalidateLock);
- mInvalidateRegion = reg;
-}
-
-Region SurfaceFlinger::getAndClearInvalidateRegion() {
- Mutex::Autolock _l(mInvalidateLock);
- Region reg(mInvalidateRegion);
- mInvalidateRegion.clear();
- return reg;
-}
-
-// ---------------------------------------------------------------------------
-
-status_t SurfaceFlinger::renderScreenToTexture(DisplayID dpy,
- GLuint* textureName, GLfloat* uOut, GLfloat* vOut)
-{
- Mutex::Autolock _l(mStateLock);
- return renderScreenToTextureLocked(dpy, textureName, uOut, vOut);
-}
-
-status_t SurfaceFlinger::renderScreenToTextureLocked(DisplayID dpy,
- GLuint* textureName, GLfloat* uOut, GLfloat* vOut)
-{
- if (!GLExtensions::getInstance().haveFramebufferObject())
- return INVALID_OPERATION;
-
- // get screen geometry
- const DisplayHardware& hw(graphicPlane(dpy).displayHardware());
- const uint32_t hw_w = hw.getWidth();
- const uint32_t hw_h = hw.getHeight();
- GLfloat u = 1;
- GLfloat v = 1;
-
- // make sure to clear all GL error flags
- while ( glGetError() != GL_NO_ERROR ) ;
-
- // create a FBO
- GLuint name, tname;
- glGenTextures(1, &tname);
- glBindTexture(GL_TEXTURE_2D, tname);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
- hw_w, hw_h, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
- if (glGetError() != GL_NO_ERROR) {
- while ( glGetError() != GL_NO_ERROR ) ;
- GLint tw = (2 << (31 - clz(hw_w)));
- GLint th = (2 << (31 - clz(hw_h)));
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
- tw, th, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
- u = GLfloat(hw_w) / tw;
- v = GLfloat(hw_h) / th;
- }
- glGenFramebuffersOES(1, &name);
- glBindFramebufferOES(GL_FRAMEBUFFER_OES, name);
- glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES,
- GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, tname, 0);
-
- // redraw the screen entirely...
- glDisable(GL_TEXTURE_EXTERNAL_OES);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_SCISSOR_TEST);
- glClearColor(0,0,0,1);
- glClear(GL_COLOR_BUFFER_BIT);
- glEnable(GL_SCISSOR_TEST);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
- const size_t count = layers.size();
- for (size_t i=0 ; i<count ; ++i) {
- const sp<LayerBase>& layer(layers[i]);
- layer->drawForSreenShot();
- }
-
- hw.compositionComplete();
-
- // back to main framebuffer
- glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0);
- glDisable(GL_SCISSOR_TEST);
- glDeleteFramebuffersOES(1, &name);
-
- *textureName = tname;
- *uOut = u;
- *vOut = v;
- return NO_ERROR;
-}
-
-// ---------------------------------------------------------------------------
-
-status_t SurfaceFlinger::electronBeamOffAnimationImplLocked()
-{
- // get screen geometry
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const uint32_t hw_w = hw.getWidth();
- const uint32_t hw_h = hw.getHeight();
- const Region screenBounds(hw.getBounds());
-
- GLfloat u, v;
- GLuint tname;
- status_t result = renderScreenToTextureLocked(0, &tname, &u, &v);
- if (result != NO_ERROR) {
- return result;
- }
-
- GLfloat vtx[8];
- const GLfloat texCoords[4][2] = { {0,0}, {0,v}, {u,v}, {u,0} };
- glBindTexture(GL_TEXTURE_2D, tname);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glVertexPointer(2, GL_FLOAT, 0, vtx);
-
- /*
- * Texture coordinate mapping
- *
- * u
- * 1 +----------+---+
- * | | | | image is inverted
- * | V | | w.r.t. the texture
- * 1-v +----------+ | coordinates
- * | |
- * | |
- * | |
- * 0 +--------------+
- * 0 1
- *
- */
-
- class s_curve_interpolator {
- const float nbFrames, s, v;
- public:
- s_curve_interpolator(int nbFrames, float s)
- : nbFrames(1.0f / (nbFrames-1)), s(s),
- v(1.0f + expf(-s + 0.5f*s)) {
- }
- float operator()(int f) {
- const float x = f * nbFrames;
- return ((1.0f/(1.0f + expf(-x*s + 0.5f*s))) - 0.5f) * v + 0.5f;
- }
- };
-
- class v_stretch {
- const GLfloat hw_w, hw_h;
- public:
- v_stretch(uint32_t hw_w, uint32_t hw_h)
- : hw_w(hw_w), hw_h(hw_h) {
- }
- void operator()(GLfloat* vtx, float v) {
- const GLfloat w = hw_w + (hw_w * v);
- const GLfloat h = hw_h - (hw_h * v);
- const GLfloat x = (hw_w - w) * 0.5f;
- const GLfloat y = (hw_h - h) * 0.5f;
- vtx[0] = x; vtx[1] = y;
- vtx[2] = x; vtx[3] = y + h;
- vtx[4] = x + w; vtx[5] = y + h;
- vtx[6] = x + w; vtx[7] = y;
- }
- };
-
- class h_stretch {
- const GLfloat hw_w, hw_h;
- public:
- h_stretch(uint32_t hw_w, uint32_t hw_h)
- : hw_w(hw_w), hw_h(hw_h) {
- }
- void operator()(GLfloat* vtx, float v) {
- const GLfloat w = hw_w - (hw_w * v);
- const GLfloat h = 1.0f;
- const GLfloat x = (hw_w - w) * 0.5f;
- const GLfloat y = (hw_h - h) * 0.5f;
- vtx[0] = x; vtx[1] = y;
- vtx[2] = x; vtx[3] = y + h;
- vtx[4] = x + w; vtx[5] = y + h;
- vtx[6] = x + w; vtx[7] = y;
- }
- };
-
- // the full animation is 24 frames
- char value[PROPERTY_VALUE_MAX];
- property_get("debug.sf.electron_frames", value, "24");
- int nbFrames = (atoi(value) + 1) >> 1;
- if (nbFrames <= 0) // just in case
- nbFrames = 24;
-
- s_curve_interpolator itr(nbFrames, 7.5f);
- s_curve_interpolator itg(nbFrames, 8.0f);
- s_curve_interpolator itb(nbFrames, 8.5f);
-
- v_stretch vverts(hw_w, hw_h);
-
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE);
- for (int i=0 ; i<nbFrames ; i++) {
- float x, y, w, h;
- const float vr = itr(i);
- const float vg = itg(i);
- const float vb = itb(i);
-
- // clear screen
- glColorMask(1,1,1,1);
- glClear(GL_COLOR_BUFFER_BIT);
- glEnable(GL_TEXTURE_2D);
-
- // draw the red plane
- vverts(vtx, vr);
- glColorMask(1,0,0,1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- // draw the green plane
- vverts(vtx, vg);
- glColorMask(0,1,0,1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- // draw the blue plane
- vverts(vtx, vb);
- glColorMask(0,0,1,1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- // draw the white highlight (we use the last vertices)
- glDisable(GL_TEXTURE_2D);
- glColorMask(1,1,1,1);
- glColor4f(vg, vg, vg, 1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- hw.flip(screenBounds);
- }
-
- h_stretch hverts(hw_w, hw_h);
- glDisable(GL_BLEND);
- glDisable(GL_TEXTURE_2D);
- glColorMask(1,1,1,1);
- for (int i=0 ; i<nbFrames ; i++) {
- const float v = itg(i);
- hverts(vtx, v);
- glClear(GL_COLOR_BUFFER_BIT);
- glColor4f(1-v, 1-v, 1-v, 1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- hw.flip(screenBounds);
- }
-
- glColorMask(1,1,1,1);
- glEnable(GL_SCISSOR_TEST);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDeleteTextures(1, &tname);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_BLEND);
- return NO_ERROR;
-}
-
-status_t SurfaceFlinger::electronBeamOnAnimationImplLocked()
-{
- status_t result = PERMISSION_DENIED;
-
- if (!GLExtensions::getInstance().haveFramebufferObject())
- return INVALID_OPERATION;
-
-
- // get screen geometry
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- const uint32_t hw_w = hw.getWidth();
- const uint32_t hw_h = hw.getHeight();
- const Region screenBounds(hw.bounds());
-
- GLfloat u, v;
- GLuint tname;
- result = renderScreenToTextureLocked(0, &tname, &u, &v);
- if (result != NO_ERROR) {
- return result;
- }
-
- GLfloat vtx[8];
- const GLfloat texCoords[4][2] = { {0,v}, {0,0}, {u,0}, {u,v} };
- glBindTexture(GL_TEXTURE_2D, tname);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glVertexPointer(2, GL_FLOAT, 0, vtx);
-
- class s_curve_interpolator {
- const float nbFrames, s, v;
- public:
- s_curve_interpolator(int nbFrames, float s)
- : nbFrames(1.0f / (nbFrames-1)), s(s),
- v(1.0f + expf(-s + 0.5f*s)) {
- }
- float operator()(int f) {
- const float x = f * nbFrames;
- return ((1.0f/(1.0f + expf(-x*s + 0.5f*s))) - 0.5f) * v + 0.5f;
- }
- };
-
- class v_stretch {
- const GLfloat hw_w, hw_h;
- public:
- v_stretch(uint32_t hw_w, uint32_t hw_h)
- : hw_w(hw_w), hw_h(hw_h) {
- }
- void operator()(GLfloat* vtx, float v) {
- const GLfloat w = hw_w + (hw_w * v);
- const GLfloat h = hw_h - (hw_h * v);
- const GLfloat x = (hw_w - w) * 0.5f;
- const GLfloat y = (hw_h - h) * 0.5f;
- vtx[0] = x; vtx[1] = y;
- vtx[2] = x; vtx[3] = y + h;
- vtx[4] = x + w; vtx[5] = y + h;
- vtx[6] = x + w; vtx[7] = y;
- }
- };
-
- class h_stretch {
- const GLfloat hw_w, hw_h;
- public:
- h_stretch(uint32_t hw_w, uint32_t hw_h)
- : hw_w(hw_w), hw_h(hw_h) {
- }
- void operator()(GLfloat* vtx, float v) {
- const GLfloat w = hw_w - (hw_w * v);
- const GLfloat h = 1.0f;
- const GLfloat x = (hw_w - w) * 0.5f;
- const GLfloat y = (hw_h - h) * 0.5f;
- vtx[0] = x; vtx[1] = y;
- vtx[2] = x; vtx[3] = y + h;
- vtx[4] = x + w; vtx[5] = y + h;
- vtx[6] = x + w; vtx[7] = y;
- }
- };
-
- // the full animation is 12 frames
- int nbFrames = 8;
- s_curve_interpolator itr(nbFrames, 7.5f);
- s_curve_interpolator itg(nbFrames, 8.0f);
- s_curve_interpolator itb(nbFrames, 8.5f);
-
- h_stretch hverts(hw_w, hw_h);
- glDisable(GL_BLEND);
- glDisable(GL_TEXTURE_2D);
- glColorMask(1,1,1,1);
- for (int i=nbFrames-1 ; i>=0 ; i--) {
- const float v = itg(i);
- hverts(vtx, v);
- glClear(GL_COLOR_BUFFER_BIT);
- glColor4f(1-v, 1-v, 1-v, 1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- hw.flip(screenBounds);
- }
-
- nbFrames = 4;
- v_stretch vverts(hw_w, hw_h);
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE);
- for (int i=nbFrames-1 ; i>=0 ; i--) {
- float x, y, w, h;
- const float vr = itr(i);
- const float vg = itg(i);
- const float vb = itb(i);
-
- // clear screen
- glColorMask(1,1,1,1);
- glClear(GL_COLOR_BUFFER_BIT);
- glEnable(GL_TEXTURE_2D);
-
- // draw the red plane
- vverts(vtx, vr);
- glColorMask(1,0,0,1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- // draw the green plane
- vverts(vtx, vg);
- glColorMask(0,1,0,1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- // draw the blue plane
- vverts(vtx, vb);
- glColorMask(0,0,1,1);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- hw.flip(screenBounds);
- }
-
- glColorMask(1,1,1,1);
- glEnable(GL_SCISSOR_TEST);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDeleteTextures(1, &tname);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_BLEND);
-
- return NO_ERROR;
-}
-
-// ---------------------------------------------------------------------------
-
-status_t SurfaceFlinger::turnElectronBeamOffImplLocked(int32_t mode)
-{
- DisplayHardware& hw(graphicPlane(0).editDisplayHardware());
- if (!hw.canDraw()) {
- // we're already off
- return NO_ERROR;
- }
-
- // turn off hwc while we're doing the animation
- hw.getHwComposer().disable();
- // and make sure to turn it back on (if needed) next time we compose
- invalidateHwcGeometry();
-
- if (mode & ISurfaceComposer::eElectronBeamAnimationOff) {
- electronBeamOffAnimationImplLocked();
- }
-
- // always clear the whole screen at the end of the animation
- glClearColor(0,0,0,1);
- glDisable(GL_SCISSOR_TEST);
- glClear(GL_COLOR_BUFFER_BIT);
- glEnable(GL_SCISSOR_TEST);
- hw.flip( Region(hw.bounds()) );
-
- return NO_ERROR;
-}
-
-status_t SurfaceFlinger::turnElectronBeamOff(int32_t mode)
-{
- class MessageTurnElectronBeamOff : public MessageBase {
- SurfaceFlinger* flinger;
- int32_t mode;
- status_t result;
- public:
- MessageTurnElectronBeamOff(SurfaceFlinger* flinger, int32_t mode)
- : flinger(flinger), mode(mode), result(PERMISSION_DENIED) {
- }
- status_t getResult() const {
- return result;
- }
- virtual bool handler() {
- Mutex::Autolock _l(flinger->mStateLock);
- result = flinger->turnElectronBeamOffImplLocked(mode);
- return true;
- }
- };
-
- sp<MessageBase> msg = new MessageTurnElectronBeamOff(this, mode);
- status_t res = postMessageSync(msg);
- if (res == NO_ERROR) {
- res = static_cast<MessageTurnElectronBeamOff*>( msg.get() )->getResult();
-
- // work-around: when the power-manager calls us we activate the
- // animation. eventually, the "on" animation will be called
- // by the power-manager itself
- mElectronBeamAnimationMode = mode;
- }
- return res;
-}
-
-// ---------------------------------------------------------------------------
-
-status_t SurfaceFlinger::turnElectronBeamOnImplLocked(int32_t mode)
-{
- DisplayHardware& hw(graphicPlane(0).editDisplayHardware());
- if (hw.canDraw()) {
- // we're already on
- return NO_ERROR;
- }
- if (mode & ISurfaceComposer::eElectronBeamAnimationOn) {
- electronBeamOnAnimationImplLocked();
- }
-
- // make sure to redraw the whole screen when the animation is done
- mDirtyRegion.set(hw.bounds());
- signalTransaction();
-
- return NO_ERROR;
-}
-
-status_t SurfaceFlinger::turnElectronBeamOn(int32_t mode)
-{
- class MessageTurnElectronBeamOn : public MessageBase {
- SurfaceFlinger* flinger;
- int32_t mode;
- status_t result;
- public:
- MessageTurnElectronBeamOn(SurfaceFlinger* flinger, int32_t mode)
- : flinger(flinger), mode(mode), result(PERMISSION_DENIED) {
- }
- status_t getResult() const {
- return result;
- }
- virtual bool handler() {
- Mutex::Autolock _l(flinger->mStateLock);
- result = flinger->turnElectronBeamOnImplLocked(mode);
- return true;
- }
- };
-
- postMessageAsync( new MessageTurnElectronBeamOn(this, mode) );
- return NO_ERROR;
-}
-
-// ---------------------------------------------------------------------------
-
-status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,
- sp<IMemoryHeap>* heap,
- uint32_t* w, uint32_t* h, PixelFormat* f,
- uint32_t sw, uint32_t sh,
- uint32_t minLayerZ, uint32_t maxLayerZ)
-{
- status_t result = PERMISSION_DENIED;
-
- // only one display supported for now
- if (CC_UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
- return BAD_VALUE;
-
- if (!GLExtensions::getInstance().haveFramebufferObject())
- return INVALID_OPERATION;
-
- // get screen geometry
- const DisplayHardware& hw(graphicPlane(dpy).displayHardware());
- const uint32_t hw_w = hw.getWidth();
- const uint32_t hw_h = hw.getHeight();
-
- if ((sw > hw_w) || (sh > hw_h))
- return BAD_VALUE;
-
- sw = (!sw) ? hw_w : sw;
- sh = (!sh) ? hw_h : sh;
- const size_t size = sw * sh * 4;
-
- //ALOGD("screenshot: sw=%d, sh=%d, minZ=%d, maxZ=%d",
- // sw, sh, minLayerZ, maxLayerZ);
-
- // make sure to clear all GL error flags
- while ( glGetError() != GL_NO_ERROR ) ;
-
- // create a FBO
- GLuint name, tname;
- glGenRenderbuffersOES(1, &tname);
- glBindRenderbufferOES(GL_RENDERBUFFER_OES, tname);
- glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_RGBA8_OES, sw, sh);
- glGenFramebuffersOES(1, &name);
- glBindFramebufferOES(GL_FRAMEBUFFER_OES, name);
- glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES,
- GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, tname);
-
- GLenum status = glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
-
- if (status == GL_FRAMEBUFFER_COMPLETE_OES) {
-
- // invert everything, b/c glReadPixel() below will invert the FB
- glViewport(0, 0, sw, sh);
- glScissor(0, 0, sw, sh);
- glEnable(GL_SCISSOR_TEST);
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glOrthof(0, hw_w, hw_h, 0, 0, 1);
- glMatrixMode(GL_MODELVIEW);
-
- // redraw the screen entirely...
- glClearColor(0,0,0,1);
- glClear(GL_COLOR_BUFFER_BIT);
-
- const LayerVector& layers(mDrawingState.layersSortedByZ);
- const size_t count = layers.size();
- for (size_t i=0 ; i<count ; ++i) {
- const sp<LayerBase>& layer(layers[i]);
- const uint32_t flags = layer->drawingState().flags;
- if (!(flags & ISurfaceComposer::eLayerHidden)) {
- const uint32_t z = layer->drawingState().z;
- if (z >= minLayerZ && z <= maxLayerZ) {
- layer->drawForSreenShot();
- }
- }
- }
-
- // XXX: this is needed on tegra
- glEnable(GL_SCISSOR_TEST);
- glScissor(0, 0, sw, sh);
-
- // check for errors and return screen capture
- if (glGetError() != GL_NO_ERROR) {
- // error while rendering
- result = INVALID_OPERATION;
- } else {
- // allocate shared memory large enough to hold the
- // screen capture
- sp<MemoryHeapBase> base(
- new MemoryHeapBase(size, 0, "screen-capture") );
- void* const ptr = base->getBase();
- if (ptr) {
- // capture the screen with glReadPixels()
- glReadPixels(0, 0, sw, sh, GL_RGBA, GL_UNSIGNED_BYTE, ptr);
- if (glGetError() == GL_NO_ERROR) {
- *heap = base;
- *w = sw;
- *h = sh;
- *f = PIXEL_FORMAT_RGBA_8888;
- result = NO_ERROR;
- }
- } else {
- result = NO_MEMORY;
- }
- }
- glEnable(GL_SCISSOR_TEST);
- glViewport(0, 0, hw_w, hw_h);
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- } else {
- result = BAD_VALUE;
- }
-
- // release FBO resources
- glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0);
- glDeleteRenderbuffersOES(1, &tname);
- glDeleteFramebuffersOES(1, &name);
-
- hw.compositionComplete();
-
- // ALOGD("screenshot: result = %s", result<0 ? strerror(result) : "OK");
-
- return result;
-}
-
-
-status_t SurfaceFlinger::captureScreen(DisplayID dpy,
- sp<IMemoryHeap>* heap,
- uint32_t* width, uint32_t* height, PixelFormat* format,
- uint32_t sw, uint32_t sh,
- uint32_t minLayerZ, uint32_t maxLayerZ)
-{
- // only one display supported for now
- if (CC_UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
- return BAD_VALUE;
-
- if (!GLExtensions::getInstance().haveFramebufferObject())
- return INVALID_OPERATION;
-
- class MessageCaptureScreen : public MessageBase {
- SurfaceFlinger* flinger;
- DisplayID dpy;
- sp<IMemoryHeap>* heap;
- uint32_t* w;
- uint32_t* h;
- PixelFormat* f;
- uint32_t sw;
- uint32_t sh;
- uint32_t minLayerZ;
- uint32_t maxLayerZ;
- status_t result;
- public:
- MessageCaptureScreen(SurfaceFlinger* flinger, DisplayID dpy,
- sp<IMemoryHeap>* heap, uint32_t* w, uint32_t* h, PixelFormat* f,
- uint32_t sw, uint32_t sh,
- uint32_t minLayerZ, uint32_t maxLayerZ)
- : flinger(flinger), dpy(dpy),
- heap(heap), w(w), h(h), f(f), sw(sw), sh(sh),
- minLayerZ(minLayerZ), maxLayerZ(maxLayerZ),
- result(PERMISSION_DENIED)
- {
- }
- status_t getResult() const {
- return result;
- }
- virtual bool handler() {
- Mutex::Autolock _l(flinger->mStateLock);
-
- // if we have secure windows, never allow the screen capture
- if (flinger->mSecureFrameBuffer)
- return true;
-
- result = flinger->captureScreenImplLocked(dpy,
- heap, w, h, f, sw, sh, minLayerZ, maxLayerZ);
-
- return true;
- }
- };
-
- sp<MessageBase> msg = new MessageCaptureScreen(this,
- dpy, heap, width, height, format, sw, sh, minLayerZ, maxLayerZ);
- status_t res = postMessageSync(msg);
- if (res == NO_ERROR) {
- res = static_cast<MessageCaptureScreen*>( msg.get() )->getResult();
- }
- return res;
-}
-
-// ---------------------------------------------------------------------------
-
-sp<Layer> SurfaceFlinger::getLayer(const sp<ISurface>& sur) const
-{
- sp<Layer> result;
- Mutex::Autolock _l(mStateLock);
- result = mLayerMap.valueFor( sur->asBinder() ).promote();
- return result;
-}
-
-// ---------------------------------------------------------------------------
-
-Client::Client(const sp<SurfaceFlinger>& flinger)
- : mFlinger(flinger), mNameGenerator(1)
-{
-}
-
-Client::~Client()
-{
- const size_t count = mLayers.size();
- for (size_t i=0 ; i<count ; i++) {
- sp<LayerBaseClient> layer(mLayers.valueAt(i).promote());
- if (layer != 0) {
- mFlinger->removeLayer(layer);
- }
- }
-}
-
-status_t Client::initCheck() const {
- return NO_ERROR;
-}
-
-size_t Client::attachLayer(const sp<LayerBaseClient>& layer)
-{
- Mutex::Autolock _l(mLock);
- size_t name = mNameGenerator++;
- mLayers.add(name, layer);
- return name;
-}
-
-void Client::detachLayer(const LayerBaseClient* layer)
-{
- Mutex::Autolock _l(mLock);
- // we do a linear search here, because this doesn't happen often
- const size_t count = mLayers.size();
- for (size_t i=0 ; i<count ; i++) {
- if (mLayers.valueAt(i) == layer) {
- mLayers.removeItemsAt(i, 1);
- break;
- }
- }
-}
-sp<LayerBaseClient> Client::getLayerUser(int32_t i) const
-{
- Mutex::Autolock _l(mLock);
- sp<LayerBaseClient> lbc;
- wp<LayerBaseClient> layer(mLayers.valueFor(i));
- if (layer != 0) {
- lbc = layer.promote();
- ALOGE_IF(lbc==0, "getLayerUser(name=%d) is dead", int(i));
- }
- return lbc;
-}
-
-
-status_t Client::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- // these must be checked
- IPCThreadState* ipc = IPCThreadState::self();
- const int pid = ipc->getCallingPid();
- const int uid = ipc->getCallingUid();
- const int self_pid = getpid();
- if (CC_UNLIKELY(pid != self_pid && uid != AID_GRAPHICS && uid != 0)) {
- // we're called from a different process, do the real check
- if (!PermissionCache::checkCallingPermission(sAccessSurfaceFlinger))
- {
- ALOGE("Permission Denial: "
- "can't openGlobalTransaction pid=%d, uid=%d", pid, uid);
- return PERMISSION_DENIED;
- }
- }
- return BnSurfaceComposerClient::onTransact(code, data, reply, flags);
-}
-
-
-sp<ISurface> Client::createSurface(
- ISurfaceComposerClient::surface_data_t* params,
- const String8& name,
- DisplayID display, uint32_t w, uint32_t h, PixelFormat format,
- uint32_t flags)
-{
- /*
- * createSurface must be called from the GL thread so that it can
- * have access to the GL context.
- */
-
- class MessageCreateSurface : public MessageBase {
- sp<ISurface> result;
- SurfaceFlinger* flinger;
- ISurfaceComposerClient::surface_data_t* params;
- Client* client;
- const String8& name;
- DisplayID display;
- uint32_t w, h;
- PixelFormat format;
- uint32_t flags;
- public:
- MessageCreateSurface(SurfaceFlinger* flinger,
- ISurfaceComposerClient::surface_data_t* params,
- const String8& name, Client* client,
- DisplayID display, uint32_t w, uint32_t h, PixelFormat format,
- uint32_t flags)
- : flinger(flinger), params(params), client(client), name(name),
- display(display), w(w), h(h), format(format), flags(flags)
- {
- }
- sp<ISurface> getResult() const { return result; }
- virtual bool handler() {
- result = flinger->createSurface(params, name, client,
- display, w, h, format, flags);
- return true;
- }
- };
-
- sp<MessageBase> msg = new MessageCreateSurface(mFlinger.get(),
- params, name, this, display, w, h, format, flags);
- mFlinger->postMessageSync(msg);
- return static_cast<MessageCreateSurface*>( msg.get() )->getResult();
-}
-status_t Client::destroySurface(SurfaceID sid) {
- return mFlinger->removeSurface(this, sid);
-}
-
-// ---------------------------------------------------------------------------
-
-GraphicBufferAlloc::GraphicBufferAlloc() {}
-
-GraphicBufferAlloc::~GraphicBufferAlloc() {}
-
-sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat format, uint32_t usage, status_t* error) {
- sp<GraphicBuffer> graphicBuffer(new GraphicBuffer(w, h, format, usage));
- status_t err = graphicBuffer->initCheck();
- *error = err;
- if (err != 0 || graphicBuffer->handle == 0) {
- if (err == NO_MEMORY) {
- GraphicBuffer::dumpAllocationsToSystemLog();
- }
- ALOGE("GraphicBufferAlloc::createGraphicBuffer(w=%d, h=%d) "
- "failed (%s), handle=%p",
- w, h, strerror(-err), graphicBuffer->handle);
- return 0;
- }
- return graphicBuffer;
-}
-
-// ---------------------------------------------------------------------------
-
-GraphicPlane::GraphicPlane()
- : mHw(0)
-{
-}
-
-GraphicPlane::~GraphicPlane() {
- delete mHw;
-}
-
-bool GraphicPlane::initialized() const {
- return mHw ? true : false;
-}
-
-int GraphicPlane::getWidth() const {
- return mWidth;
-}
-
-int GraphicPlane::getHeight() const {
- return mHeight;
-}
-
-void GraphicPlane::setDisplayHardware(DisplayHardware *hw)
-{
- mHw = hw;
-
- // initialize the display orientation transform.
- // it's a constant that should come from the display driver.
- int displayOrientation = ISurfaceComposer::eOrientationDefault;
- char property[PROPERTY_VALUE_MAX];
- if (property_get("ro.sf.hwrotation", property, NULL) > 0) {
- //displayOrientation
- switch (atoi(property)) {
- case 90:
- displayOrientation = ISurfaceComposer::eOrientation90;
- break;
- case 270:
- displayOrientation = ISurfaceComposer::eOrientation270;
- break;
- }
- }
-
- const float w = hw->getWidth();
- const float h = hw->getHeight();
- GraphicPlane::orientationToTransfrom(displayOrientation, w, h,
- &mDisplayTransform);
- if (displayOrientation & ISurfaceComposer::eOrientationSwapMask) {
- mDisplayWidth = h;
- mDisplayHeight = w;
- } else {
- mDisplayWidth = w;
- mDisplayHeight = h;
- }
-
- setOrientation(ISurfaceComposer::eOrientationDefault);
-}
-
-status_t GraphicPlane::orientationToTransfrom(
- int orientation, int w, int h, Transform* tr)
-{
- uint32_t flags = 0;
- switch (orientation) {
- case ISurfaceComposer::eOrientationDefault:
- flags = Transform::ROT_0;
- break;
- case ISurfaceComposer::eOrientation90:
- flags = Transform::ROT_90;
- break;
- case ISurfaceComposer::eOrientation180:
- flags = Transform::ROT_180;
- break;
- case ISurfaceComposer::eOrientation270:
- flags = Transform::ROT_270;
- break;
- default:
- return BAD_VALUE;
- }
- tr->set(flags, w, h);
- return NO_ERROR;
-}
-
-status_t GraphicPlane::setOrientation(int orientation)
-{
- // If the rotation can be handled in hardware, this is where
- // the magic should happen.
-
- const DisplayHardware& hw(displayHardware());
- const float w = mDisplayWidth;
- const float h = mDisplayHeight;
- mWidth = int(w);
- mHeight = int(h);
-
- Transform orientationTransform;
- GraphicPlane::orientationToTransfrom(orientation, w, h,
- &orientationTransform);
- if (orientation & ISurfaceComposer::eOrientationSwapMask) {
- mWidth = int(h);
- mHeight = int(w);
- }
-
- mOrientation = orientation;
- mGlobalTransform = mDisplayTransform * orientationTransform;
- return NO_ERROR;
-}
-
-const DisplayHardware& GraphicPlane::displayHardware() const {
- return *mHw;
-}
-
-DisplayHardware& GraphicPlane::editDisplayHardware() {
- return *mHw;
-}
-
-const Transform& GraphicPlane::transform() const {
- return mGlobalTransform;
-}
-
-EGLDisplay GraphicPlane::getEGLDisplay() const {
- return mHw->getEGLDisplay();
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
deleted file mode 100644
index b507877..0000000
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_SURFACE_FLINGER_H
-#define ANDROID_SURFACE_FLINGER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <cutils/compiler.h>
-
-#include <utils/Atomic.h>
-#include <utils/Errors.h>
-#include <utils/KeyedVector.h>
-#include <utils/RefBase.h>
-#include <utils/SortedVector.h>
-#include <utils/threads.h>
-
-#include <binder/BinderService.h>
-#include <binder/IMemory.h>
-
-#include <ui/PixelFormat.h>
-#include <gui/IGraphicBufferAlloc.h>
-#include <gui/ISurfaceComposer.h>
-#include <gui/ISurfaceComposerClient.h>
-
-#include "Barrier.h"
-#include "Layer.h"
-
-#include "MessageQueue.h"
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-class Client;
-class DisplayHardware;
-class DisplayEventConnection;
-class EventThread;
-class Layer;
-class LayerDim;
-class LayerScreenshot;
-struct surface_flinger_cblk_t;
-
-// ---------------------------------------------------------------------------
-
-class Client : public BnSurfaceComposerClient
-{
-public:
- Client(const sp<SurfaceFlinger>& flinger);
- ~Client();
-
- status_t initCheck() const;
-
- // protected by SurfaceFlinger::mStateLock
- size_t attachLayer(const sp<LayerBaseClient>& layer);
- void detachLayer(const LayerBaseClient* layer);
- sp<LayerBaseClient> getLayerUser(int32_t i) const;
-
-private:
- // ISurfaceComposerClient interface
- virtual sp<ISurface> createSurface(
- surface_data_t* params, const String8& name,
- DisplayID display, uint32_t w, uint32_t h,PixelFormat format,
- uint32_t flags);
- virtual status_t destroySurface(SurfaceID surfaceId);
- virtual status_t onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags);
-
- // constant
- sp<SurfaceFlinger> mFlinger;
-
- // protected by mLock
- DefaultKeyedVector< size_t, wp<LayerBaseClient> > mLayers;
- size_t mNameGenerator;
-
- // thread-safe
- mutable Mutex mLock;
-};
-
-class GraphicBufferAlloc : public BnGraphicBufferAlloc
-{
-public:
- GraphicBufferAlloc();
- virtual ~GraphicBufferAlloc();
- virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat format, uint32_t usage, status_t* error);
-};
-
-// ---------------------------------------------------------------------------
-
-class GraphicPlane
-{
-public:
- static status_t orientationToTransfrom(int orientation, int w, int h,
- Transform* tr);
-
- GraphicPlane();
- ~GraphicPlane();
-
- bool initialized() const;
-
- void setDisplayHardware(DisplayHardware *);
- status_t setOrientation(int orientation);
- int getOrientation() const { return mOrientation; }
- int getWidth() const;
- int getHeight() const;
-
- const DisplayHardware& displayHardware() const;
- DisplayHardware& editDisplayHardware();
- const Transform& transform() const;
- EGLDisplay getEGLDisplay() const;
-
-private:
- GraphicPlane(const GraphicPlane&);
- GraphicPlane operator = (const GraphicPlane&);
-
- DisplayHardware* mHw;
- Transform mGlobalTransform;
- Transform mDisplayTransform;
- int mOrientation;
- float mDisplayWidth;
- float mDisplayHeight;
- int mWidth;
- int mHeight;
-};
-
-// ---------------------------------------------------------------------------
-
-enum {
- eTransactionNeeded = 0x01,
- eTraversalNeeded = 0x02
-};
-
-class SurfaceFlinger :
- public BinderService<SurfaceFlinger>,
- public BnSurfaceComposer,
- public IBinder::DeathRecipient,
- protected Thread
-{
-public:
- static char const* getServiceName() { return "SurfaceFlinger"; }
-
- SurfaceFlinger();
- virtual ~SurfaceFlinger();
- void init();
-
- virtual status_t onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags);
-
- virtual status_t dump(int fd, const Vector<String16>& args);
-
- // ISurfaceComposer interface
- virtual sp<ISurfaceComposerClient> createConnection();
- virtual sp<IGraphicBufferAlloc> createGraphicBufferAlloc();
- virtual sp<IMemoryHeap> getCblk() const;
- virtual void bootFinished();
- virtual void setTransactionState(const Vector<ComposerState>& state,
- int orientation, uint32_t flags);
- virtual bool authenticateSurfaceTexture(const sp<ISurfaceTexture>& surface) const;
- virtual sp<IDisplayEventConnection> createDisplayEventConnection();
-
- virtual status_t captureScreen(DisplayID dpy,
- sp<IMemoryHeap>* heap,
- uint32_t* width, uint32_t* height,
- PixelFormat* format, uint32_t reqWidth, uint32_t reqHeight,
- uint32_t minLayerZ, uint32_t maxLayerZ);
-
- virtual status_t turnElectronBeamOff(int32_t mode);
- virtual status_t turnElectronBeamOn(int32_t mode);
-
- void screenReleased(DisplayID dpy);
- void screenAcquired(DisplayID dpy);
-
- status_t renderScreenToTexture(DisplayID dpy,
- GLuint* textureName, GLfloat* uOut, GLfloat* vOut);
- status_t renderScreenToTextureLocked(DisplayID dpy,
- GLuint* textureName, GLfloat* uOut, GLfloat* vOut);
-
- void onMessageReceived(int32_t what);
-
- status_t postMessageAsync(const sp<MessageBase>& msg,
- nsecs_t reltime=0, uint32_t flags = 0);
-
- status_t postMessageSync(const sp<MessageBase>& msg,
- nsecs_t reltime=0, uint32_t flags = 0);
-
- status_t removeLayer(const sp<LayerBase>& layer);
- status_t addLayer(const sp<LayerBase>& layer);
- status_t invalidateLayerVisibility(const sp<LayerBase>& layer);
- void invalidateHwcGeometry();
-
- sp<Layer> getLayer(const sp<ISurface>& sur) const;
-
- GLuint getProtectedTexName() const { return mProtectedTexName; }
-
-
- class MessageDestroyGLTexture : public MessageBase {
- GLuint texture;
- public:
- MessageDestroyGLTexture(GLuint texture) : texture(texture) { }
- virtual bool handler() {
- glDeleteTextures(1, &texture);
- return true;
- }
- };
-
-
-private:
- // DeathRecipient interface
- virtual void binderDied(const wp<IBinder>& who);
-
-private:
- friend class Client;
- friend class DisplayEventConnection;
- friend class LayerBase;
- friend class LayerBaseClient;
- friend class Layer;
-
- sp<ISurface> createSurface(
- ISurfaceComposerClient::surface_data_t* params,
- const String8& name,
- const sp<Client>& client,
- DisplayID display, uint32_t w, uint32_t h, PixelFormat format,
- uint32_t flags);
-
- sp<Layer> createNormalSurface(
- const sp<Client>& client, DisplayID display,
- uint32_t w, uint32_t h, uint32_t flags,
- PixelFormat& format);
-
- sp<LayerDim> createDimSurface(
- const sp<Client>& client, DisplayID display,
- uint32_t w, uint32_t h, uint32_t flags);
-
- sp<LayerScreenshot> createScreenshotSurface(
- const sp<Client>& client, DisplayID display,
- uint32_t w, uint32_t h, uint32_t flags);
-
- status_t removeSurface(const sp<Client>& client, SurfaceID sid);
- status_t destroySurface(const wp<LayerBaseClient>& layer);
- uint32_t setClientStateLocked(const sp<Client>& client, const layer_state_t& s);
-
- class LayerVector : public SortedVector< sp<LayerBase> > {
- public:
- LayerVector() { }
- LayerVector(const LayerVector& rhs) : SortedVector< sp<LayerBase> >(rhs) { }
- virtual int do_compare(const void* lhs, const void* rhs) const {
- const sp<LayerBase>& l(*reinterpret_cast<const sp<LayerBase>*>(lhs));
- const sp<LayerBase>& r(*reinterpret_cast<const sp<LayerBase>*>(rhs));
- // sort layers by Z order
- uint32_t lz = l->currentState().z;
- uint32_t rz = r->currentState().z;
- // then by sequence, so we get a stable ordering
- return (lz != rz) ? (lz - rz) : (l->sequence - r->sequence);
- }
- };
-
- struct State {
- State() {
- orientation = ISurfaceComposer::eOrientationDefault;
- }
- LayerVector layersSortedByZ;
- uint8_t orientation;
- uint8_t orientationFlags;
- };
-
- virtual bool threadLoop();
- virtual status_t readyToRun();
- virtual void onFirstRef();
-
-public: // hack to work around gcc 4.0.3 bug
- const GraphicPlane& graphicPlane(int dpy) const;
- GraphicPlane& graphicPlane(int dpy);
-
- void signalTransaction();
- void signalLayerUpdate();
- void signalRefresh();
- void repaintEverything();
-
-private:
- void waitForEvent();
- void handleConsoleEvents();
- void handleTransaction(uint32_t transactionFlags);
- void handleTransactionLocked(uint32_t transactionFlags);
-
- void computeVisibleRegions(
- const LayerVector& currentLayers,
- Region& dirtyRegion,
- Region& wormholeRegion);
-
- void handlePageFlip();
- bool lockPageFlip(const LayerVector& currentLayers);
- void unlockPageFlip(const LayerVector& currentLayers);
- void handleRefresh();
- void handleWorkList();
- void handleRepaint();
- void postFramebuffer();
- void setupHardwareComposer(Region& dirtyInOut);
- void composeSurfaces(const Region& dirty);
-
-
- void setInvalidateRegion(const Region& reg);
- Region getAndClearInvalidateRegion();
-
- ssize_t addClientLayer(const sp<Client>& client,
- const sp<LayerBaseClient>& lbc);
- status_t addLayer_l(const sp<LayerBase>& layer);
- status_t removeLayer_l(const sp<LayerBase>& layer);
- status_t purgatorizeLayer_l(const sp<LayerBase>& layer);
-
- uint32_t getTransactionFlags(uint32_t flags);
- uint32_t peekTransactionFlags(uint32_t flags);
- uint32_t setTransactionFlags(uint32_t flags);
- void commitTransaction();
-
-
- status_t captureScreenImplLocked(DisplayID dpy,
- sp<IMemoryHeap>* heap,
- uint32_t* width, uint32_t* height, PixelFormat* format,
- uint32_t reqWidth, uint32_t reqHeight,
- uint32_t minLayerZ, uint32_t maxLayerZ);
-
- status_t turnElectronBeamOffImplLocked(int32_t mode);
- status_t turnElectronBeamOnImplLocked(int32_t mode);
- status_t electronBeamOffAnimationImplLocked();
- status_t electronBeamOnAnimationImplLocked();
-
- void debugFlashRegions();
- void drawWormhole() const;
-
- void listLayersLocked(const Vector<String16>& args, size_t& index,
- String8& result, char* buffer, size_t SIZE) const;
- void dumpStatsLocked(const Vector<String16>& args, size_t& index,
- String8& result, char* buffer, size_t SIZE) const;
- void clearStatsLocked(const Vector<String16>& args, size_t& index,
- String8& result, char* buffer, size_t SIZE) const;
- void dumpAllLocked(String8& result, char* buffer, size_t SIZE) const;
-
- mutable MessageQueue mEventQueue;
-
- // access must be protected by mStateLock
- mutable Mutex mStateLock;
- State mCurrentState;
- volatile int32_t mTransactionFlags;
- Condition mTransactionCV;
- SortedVector< sp<LayerBase> > mLayerPurgatory;
- bool mTransationPending;
- Vector< sp<LayerBase> > mLayersPendingRemoval;
-
- // protected by mStateLock (but we could use another lock)
- GraphicPlane mGraphicPlanes[1];
- bool mLayersRemoved;
- DefaultKeyedVector< wp<IBinder>, wp<Layer> > mLayerMap;
-
- // access must be protected by mInvalidateLock
- mutable Mutex mInvalidateLock;
- Region mInvalidateRegion;
-
- // constant members (no synchronization needed for access)
- sp<IMemoryHeap> mServerHeap;
- surface_flinger_cblk_t* mServerCblk;
- GLuint mWormholeTexName;
- GLuint mProtectedTexName;
- nsecs_t mBootTime;
- sp<EventThread> mEventThread;
-
- // Can only accessed from the main thread, these members
- // don't need synchronization
- State mDrawingState;
- Region mDirtyRegion;
- Region mDirtyRegionRemovedLayer;
- Region mSwapRegion;
- Region mWormholeRegion;
- bool mVisibleRegionsDirty;
- bool mHwWorkListDirty;
- int32_t mElectronBeamAnimationMode;
- Vector< sp<LayerBase> > mVisibleLayersSortedByZ;
-
-
- // don't use a lock for these, we don't care
- int mDebugRegion;
- int mDebugBackground;
- int mDebugDDMS;
- int mDebugDisableHWC;
- int mDebugDisableTransformHint;
- volatile nsecs_t mDebugInSwapBuffers;
- nsecs_t mLastSwapBufferTime;
- volatile nsecs_t mDebugInTransaction;
- nsecs_t mLastTransactionTime;
- bool mBootFinished;
-
- // these are thread safe
- mutable Barrier mReadyToRunBarrier;
-
-
- // protected by mDestroyedLayerLock;
- mutable Mutex mDestroyedLayerLock;
- Vector<LayerBase const *> mDestroyedLayers;
-
- // atomic variables
- enum {
- eConsoleReleased = 1,
- eConsoleAcquired = 2
- };
- volatile int32_t mConsoleSignals;
-
- // only written in the main thread, only read in other threads
- volatile int32_t mSecureFrameBuffer;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_SURFACE_FLINGER_H
diff --git a/services/surfaceflinger/SurfaceTextureLayer.cpp b/services/surfaceflinger/SurfaceTextureLayer.cpp
deleted file mode 100644
index 49e8e63..0000000
--- a/services/surfaceflinger/SurfaceTextureLayer.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-
-#include "Layer.h"
-#include "SurfaceTextureLayer.h"
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-
-SurfaceTextureLayer::SurfaceTextureLayer(GLuint tex, const sp<Layer>& layer)
- : SurfaceTexture(tex, true, GL_TEXTURE_EXTERNAL_OES, false), mLayer(layer) {
-}
-
-SurfaceTextureLayer::~SurfaceTextureLayer() {
-}
-
-
-status_t SurfaceTextureLayer::setDefaultBufferSize(uint32_t w, uint32_t h)
-{
- //ALOGD("%s, w=%u, h=%u", __PRETTY_FUNCTION__, w, h);
- return SurfaceTexture::setDefaultBufferSize(w, h);
-}
-
-status_t SurfaceTextureLayer::setDefaultBufferFormat(uint32_t format)
-{
- mDefaultFormat = format;
- return NO_ERROR;
-}
-
-status_t SurfaceTextureLayer::setBufferCount(int bufferCount) {
- status_t res = SurfaceTexture::setBufferCount(bufferCount);
- return res;
-}
-
-status_t SurfaceTextureLayer::queueBuffer(int buf, int64_t timestamp,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
-
- status_t res = SurfaceTexture::queueBuffer(buf, timestamp,
- outWidth, outHeight, outTransform);
- sp<Layer> layer(mLayer.promote());
- if (layer != NULL) {
- *outTransform = layer->getTransformHint();
- }
- return res;
-}
-
-status_t SurfaceTextureLayer::dequeueBuffer(int *buf,
- uint32_t w, uint32_t h, uint32_t format, uint32_t usage) {
-
- status_t res(NO_INIT);
- sp<Layer> layer(mLayer.promote());
- if (layer != NULL) {
- if (format == 0)
- format = mDefaultFormat;
- uint32_t effectiveUsage = layer->getEffectiveUsage(usage);
- //ALOGD("%s, w=%u, h=%u, format=%u, usage=%08x, effectiveUsage=%08x",
- // __PRETTY_FUNCTION__, w, h, format, usage, effectiveUsage);
- res = SurfaceTexture::dequeueBuffer(buf, w, h, format, effectiveUsage);
- }
- return res;
-}
-
-status_t SurfaceTextureLayer::connect(int api,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
- status_t err = SurfaceTexture::connect(api,
- outWidth, outHeight, outTransform);
- if (err == NO_ERROR) {
- sp<Layer> layer(mLayer.promote());
- if (layer != NULL) {
- uint32_t orientation = layer->getOrientation();
- if (orientation & Transform::ROT_INVALID) {
- orientation = 0;
- }
- *outTransform = orientation;
- }
- switch(api) {
- case NATIVE_WINDOW_API_CPU:
- // SurfaceTextureClient supports only 2 buffers for CPU connections
- this->setBufferCountServer(2);
- break;
- case NATIVE_WINDOW_API_MEDIA:
- case NATIVE_WINDOW_API_CAMERA:
- // Camera preview and videos are rate-limited on the producer
- // side. If enabled for this build, we use async mode to always
- // show the most recent frame at the cost of requiring an
- // additional buffer.
-#ifndef NEVER_DEFAULT_TO_ASYNC_MODE
- err = setSynchronousMode(false);
- break;
-#endif
- // fall through to set synchronous mode when not defaulting to
- // async mode.
- deafult:
- err = setSynchronousMode(true);
- break;
- }
- if (err != NO_ERROR) {
- disconnect(api);
- }
- }
- return err;
-}
-
-// ---------------------------------------------------------------------------
-}; // namespace android
diff --git a/services/surfaceflinger/SurfaceTextureLayer.h b/services/surfaceflinger/SurfaceTextureLayer.h
deleted file mode 100644
index 9508524..0000000
--- a/services/surfaceflinger/SurfaceTextureLayer.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef ANDROID_SURFACE_TEXTURE_LAYER_H
-#define ANDROID_SURFACE_TEXTURE_LAYER_H
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <gui/SurfaceTexture.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-class Layer;
-
-class SurfaceTextureLayer : public SurfaceTexture
-{
- wp<Layer> mLayer;
- uint32_t mDefaultFormat;
-
-public:
- SurfaceTextureLayer(GLuint tex, const sp<Layer>& layer);
- ~SurfaceTextureLayer();
-
- status_t setDefaultBufferSize(uint32_t w, uint32_t h);
- status_t setDefaultBufferFormat(uint32_t format);
-
-public:
- virtual status_t setBufferCount(int bufferCount);
-
-protected:
- virtual status_t queueBuffer(int buf, int64_t timestamp,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform);
-
- virtual status_t dequeueBuffer(int *buf, uint32_t w, uint32_t h,
- uint32_t format, uint32_t usage);
-
- virtual status_t connect(int api,
- uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform);
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_SURFACE_TEXTURE_LAYER_H
diff --git a/services/surfaceflinger/Transform.cpp b/services/surfaceflinger/Transform.cpp
deleted file mode 100644
index ca3fa6e..0000000
--- a/services/surfaceflinger/Transform.cpp
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <math.h>
-
-#include <cutils/compiler.h>
-#include <utils/String8.h>
-#include <ui/Region.h>
-
-#include "clz.h"
-#include "Transform.h"
-
-// ---------------------------------------------------------------------------
-
-namespace android {
-
-// ---------------------------------------------------------------------------
-
-Transform::Transform() {
- reset();
-}
-
-Transform::Transform(const Transform& other)
- : mMatrix(other.mMatrix), mType(other.mType) {
-}
-
-Transform::Transform(uint32_t orientation) {
- set(orientation, 0, 0);
-}
-
-Transform::~Transform() {
-}
-
-static const float EPSILON = 0.0f;
-
-bool Transform::isZero(float f) {
- return fabs(f) <= EPSILON;
-}
-
-bool Transform::absIsOne(float f) {
- return isZero(fabs(f) - 1.0f);
-}
-
-Transform Transform::operator * (const Transform& rhs) const
-{
- if (CC_LIKELY(mType == IDENTITY))
- return rhs;
-
- Transform r(*this);
- if (rhs.mType == IDENTITY)
- return r;
-
- // TODO: we could use mType to optimize the matrix multiply
- const mat33& A(mMatrix);
- const mat33& B(rhs.mMatrix);
- mat33& D(r.mMatrix);
- for (int i=0 ; i<3 ; i++) {
- const float v0 = A[0][i];
- const float v1 = A[1][i];
- const float v2 = A[2][i];
- D[0][i] = v0*B[0][0] + v1*B[0][1] + v2*B[0][2];
- D[1][i] = v0*B[1][0] + v1*B[1][1] + v2*B[1][2];
- D[2][i] = v0*B[2][0] + v1*B[2][1] + v2*B[2][2];
- }
- r.mType |= rhs.mType;
-
- // TODO: we could recompute this value from r and rhs
- r.mType &= 0xFF;
- r.mType |= UNKNOWN_TYPE;
- return r;
-}
-
-float const* Transform::operator [] (int i) const {
- return mMatrix[i].v;
-}
-
-bool Transform::transformed() const {
- return type() > TRANSLATE;
-}
-
-float Transform::tx() const {
- return mMatrix[2][0];
-}
-
-float Transform::ty() const {
- return mMatrix[2][1];
-}
-
-void Transform::reset() {
- mType = IDENTITY;
- for(int i=0 ; i<3 ; i++) {
- vec3& v(mMatrix[i]);
- for (int j=0 ; j<3 ; j++)
- v[j] = ((i==j) ? 1.0f : 0.0f);
- }
-}
-
-void Transform::set(float tx, float ty)
-{
- mMatrix[2][0] = tx;
- mMatrix[2][1] = ty;
- mMatrix[2][2] = 1.0f;
-
- if (isZero(tx) && isZero(ty)) {
- mType &= ~TRANSLATE;
- } else {
- mType |= TRANSLATE;
- }
-}
-
-void Transform::set(float a, float b, float c, float d)
-{
- mat33& M(mMatrix);
- M[0][0] = a; M[1][0] = b;
- M[0][1] = c; M[1][1] = d;
- M[0][2] = 0; M[1][2] = 0;
- mType = UNKNOWN_TYPE;
-}
-
-status_t Transform::set(uint32_t flags, float w, float h)
-{
- if (flags & ROT_INVALID) {
- // that's not allowed!
- reset();
- return BAD_VALUE;
- }
-
- Transform H, V, R;
- if (flags & ROT_90) {
- // w & h are inverted when rotating by 90 degrees
- swap(w, h);
- }
-
- if (flags & FLIP_H) {
- H.mType = (FLIP_H << 8) | SCALE;
- H.mType |= isZero(w) ? IDENTITY : TRANSLATE;
- mat33& M(H.mMatrix);
- M[0][0] = -1;
- M[2][0] = w;
- }
-
- if (flags & FLIP_V) {
- V.mType = (FLIP_V << 8) | SCALE;
- V.mType |= isZero(h) ? IDENTITY : TRANSLATE;
- mat33& M(V.mMatrix);
- M[1][1] = -1;
- M[2][1] = h;
- }
-
- if (flags & ROT_90) {
- const float original_w = h;
- R.mType = (ROT_90 << 8) | ROTATE;
- R.mType |= isZero(original_w) ? IDENTITY : TRANSLATE;
- mat33& M(R.mMatrix);
- M[0][0] = 0; M[1][0] =-1; M[2][0] = original_w;
- M[0][1] = 1; M[1][1] = 0;
- }
-
- *this = (R*(H*V));
- return NO_ERROR;
-}
-
-Transform::vec2 Transform::transform(const vec2& v) const {
- vec2 r;
- const mat33& M(mMatrix);
- r[0] = M[0][0]*v[0] + M[1][0]*v[1] + M[2][0];
- r[1] = M[0][1]*v[0] + M[1][1]*v[1] + M[2][1];
- return r;
-}
-
-Transform::vec3 Transform::transform(const vec3& v) const {
- vec3 r;
- const mat33& M(mMatrix);
- r[0] = M[0][0]*v[0] + M[1][0]*v[1] + M[2][0]*v[2];
- r[1] = M[0][1]*v[0] + M[1][1]*v[1] + M[2][1]*v[2];
- r[2] = M[0][2]*v[0] + M[1][2]*v[1] + M[2][2]*v[2];
- return r;
-}
-
-void Transform::transform(float* point, int x, int y) const
-{
- const mat33& M(mMatrix);
- vec2 v(x, y);
- v = transform(v);
- point[0] = v[0];
- point[1] = v[1];
-}
-
-Rect Transform::makeBounds(int w, int h) const
-{
- return transform( Rect(w, h) );
-}
-
-Rect Transform::transform(const Rect& bounds) const
-{
- Rect r;
- vec2 lt( bounds.left, bounds.top );
- vec2 rt( bounds.right, bounds.top );
- vec2 lb( bounds.left, bounds.bottom );
- vec2 rb( bounds.right, bounds.bottom );
-
- lt = transform(lt);
- rt = transform(rt);
- lb = transform(lb);
- rb = transform(rb);
-
- r.left = floorf(min(lt[0], rt[0], lb[0], rb[0]) + 0.5f);
- r.top = floorf(min(lt[1], rt[1], lb[1], rb[1]) + 0.5f);
- r.right = floorf(max(lt[0], rt[0], lb[0], rb[0]) + 0.5f);
- r.bottom = floorf(max(lt[1], rt[1], lb[1], rb[1]) + 0.5f);
-
- return r;
-}
-
-Region Transform::transform(const Region& reg) const
-{
- Region out;
- if (CC_UNLIKELY(transformed())) {
- if (CC_LIKELY(preserveRects())) {
- Region::const_iterator it = reg.begin();
- Region::const_iterator const end = reg.end();
- while (it != end) {
- out.orSelf(transform(*it++));
- }
- } else {
- out.set(transform(reg.bounds()));
- }
- } else {
- int xpos = floorf(tx() + 0.5f);
- int ypos = floorf(ty() + 0.5f);
- out = reg.translate(xpos, ypos);
- }
- return out;
-}
-
-uint32_t Transform::type() const
-{
- if (mType & UNKNOWN_TYPE) {
- // recompute what this transform is
-
- const mat33& M(mMatrix);
- const float a = M[0][0];
- const float b = M[1][0];
- const float c = M[0][1];
- const float d = M[1][1];
- const float x = M[2][0];
- const float y = M[2][1];
-
- bool scale = false;
- uint32_t flags = ROT_0;
- if (isZero(b) && isZero(c)) {
- if (a<0) flags |= FLIP_H;
- if (d<0) flags |= FLIP_V;
- if (!absIsOne(a) || !absIsOne(d)) {
- scale = true;
- }
- } else if (isZero(a) && isZero(d)) {
- flags |= ROT_90;
- if (b>0) flags |= FLIP_V;
- if (c<0) flags |= FLIP_H;
- if (!absIsOne(b) || !absIsOne(c)) {
- scale = true;
- }
- } else {
- // there is a skew component and/or a non 90 degrees rotation
- flags = ROT_INVALID;
- }
-
- mType = flags << 8;
- if (flags & ROT_INVALID) {
- mType |= UNKNOWN;
- } else {
- if ((flags & ROT_90) || ((flags & ROT_180) == ROT_180))
- mType |= ROTATE;
- if (flags & FLIP_H)
- mType ^= SCALE;
- if (flags & FLIP_V)
- mType ^= SCALE;
- if (scale)
- mType |= SCALE;
- }
-
- if (!isZero(x) || !isZero(y))
- mType |= TRANSLATE;
- }
- return mType;
-}
-
-uint32_t Transform::getType() const {
- return type() & 0xFF;
-}
-
-uint32_t Transform::getOrientation() const
-{
- return (type() >> 8) & 0xFF;
-}
-
-bool Transform::preserveRects() const
-{
- return (getOrientation() & ROT_INVALID) ? false : true;
-}
-
-void Transform::dump(const char* name) const
-{
- type(); // updates the type
-
- String8 flags, type;
- const mat33& m(mMatrix);
- uint32_t orient = mType >> 8;
-
- if (orient&ROT_INVALID) {
- flags.append("ROT_INVALID ");
- } else {
- if (orient&ROT_90) {
- flags.append("ROT_90 ");
- } else {
- flags.append("ROT_0 ");
- }
- if (orient&FLIP_V)
- flags.append("FLIP_V ");
- if (orient&FLIP_H)
- flags.append("FLIP_H ");
- }
-
- if (!(mType&(SCALE|ROTATE|TRANSLATE)))
- type.append("IDENTITY ");
- if (mType&SCALE)
- type.append("SCALE ");
- if (mType&ROTATE)
- type.append("ROTATE ");
- if (mType&TRANSLATE)
- type.append("TRANSLATE ");
-
- ALOGD("%s 0x%08x (%s, %s)", name, mType, flags.string(), type.string());
- ALOGD("%.4f %.4f %.4f", m[0][0], m[1][0], m[2][0]);
- ALOGD("%.4f %.4f %.4f", m[0][1], m[1][1], m[2][1]);
- ALOGD("%.4f %.4f %.4f", m[0][2], m[1][2], m[2][2]);
-}
-
-// ---------------------------------------------------------------------------
-
-}; // namespace android
diff --git a/services/surfaceflinger/Transform.h b/services/surfaceflinger/Transform.h
deleted file mode 100644
index ec74243..0000000
--- a/services/surfaceflinger/Transform.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_TRANSFORM_H
-#define ANDROID_TRANSFORM_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <ui/Point.h>
-#include <ui/Rect.h>
-
-#include <hardware/hardware.h>
-
-namespace android {
-
-class Region;
-
-// ---------------------------------------------------------------------------
-
-class Transform
-{
-public:
- Transform();
- Transform(const Transform& other);
- explicit Transform(uint32_t orientation);
- ~Transform();
-
- enum orientation_flags {
- ROT_0 = 0x00000000,
- FLIP_H = HAL_TRANSFORM_FLIP_H,
- FLIP_V = HAL_TRANSFORM_FLIP_V,
- ROT_90 = HAL_TRANSFORM_ROT_90,
- ROT_180 = FLIP_H|FLIP_V,
- ROT_270 = ROT_180|ROT_90,
- ROT_INVALID = 0x80
- };
-
- enum type_mask {
- IDENTITY = 0,
- TRANSLATE = 0x1,
- ROTATE = 0x2,
- SCALE = 0x4,
- UNKNOWN = 0x8
- };
-
- // query the transform
- bool transformed() const;
- bool preserveRects() const;
- uint32_t getType() const;
- uint32_t getOrientation() const;
-
- float const* operator [] (int i) const; // returns column i
- float tx() const;
- float ty() const;
-
- // modify the transform
- void reset();
- void set(float tx, float ty);
- void set(float a, float b, float c, float d);
- status_t set(uint32_t flags, float w, float h);
-
- // transform data
- Rect makeBounds(int w, int h) const;
- void transform(float* point, int x, int y) const;
- Region transform(const Region& reg) const;
- Transform operator * (const Transform& rhs) const;
-
- // for debugging
- void dump(const char* name) const;
-
-private:
- struct vec3 {
- float v[3];
- inline vec3() { }
- inline vec3(float a, float b, float c) {
- v[0] = a; v[1] = b; v[2] = c;
- }
- inline float operator [] (int i) const { return v[i]; }
- inline float& operator [] (int i) { return v[i]; }
- };
- struct vec2 {
- float v[2];
- inline vec2() { }
- inline vec2(float a, float b) {
- v[0] = a; v[1] = b;
- }
- inline float operator [] (int i) const { return v[i]; }
- inline float& operator [] (int i) { return v[i]; }
- };
- struct mat33 {
- vec3 v[3];
- inline const vec3& operator [] (int i) const { return v[i]; }
- inline vec3& operator [] (int i) { return v[i]; }
- };
-
- enum { UNKNOWN_TYPE = 0x80000000 };
-
- // assumes the last row is < 0 , 0 , 1 >
- vec2 transform(const vec2& v) const;
- vec3 transform(const vec3& v) const;
- Rect transform(const Rect& bounds) const;
- uint32_t type() const;
- static bool absIsOne(float f);
- static bool isZero(float f);
-
- mat33 mMatrix;
- mutable uint32_t mType;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif /* ANDROID_TRANSFORM_H */
diff --git a/services/surfaceflinger/clz.cpp b/services/surfaceflinger/clz.cpp
deleted file mode 100644
index 2456b86..0000000
--- a/services/surfaceflinger/clz.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include "clz.h"
-
-namespace android {
-
-int clz_impl(int32_t x)
-{
-#if defined(__arm__) && !defined(__thumb__)
- return __builtin_clz(x);
-#else
- if (!x) return 32;
- int e = 31;
- if (x&0xFFFF0000) { e -=16; x >>=16; }
- if (x&0x0000FF00) { e -= 8; x >>= 8; }
- if (x&0x000000F0) { e -= 4; x >>= 4; }
- if (x&0x0000000C) { e -= 2; x >>= 2; }
- if (x&0x00000002) { e -= 1; }
- return e;
-#endif
-}
-
-}; // namespace android
diff --git a/services/surfaceflinger/clz.h b/services/surfaceflinger/clz.h
deleted file mode 100644
index a4c5262..0000000
--- a/services/surfaceflinger/clz.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#ifndef ANDROID_SURFACE_FLINGER_CLZ_H
-
-#include <stdint.h>
-
-namespace android {
-
-int inline clz(int32_t x) {
- return __builtin_clz(x);
-}
-
-template <typename T>
-static inline T min(T a, T b) {
- return a<b ? a : b;
-}
-template <typename T>
-static inline T min(T a, T b, T c) {
- return min(a, min(b, c));
-}
-template <typename T>
-static inline T min(T a, T b, T c, T d) {
- return min(a, b, min(c, d));
-}
-
-template <typename T>
-static inline T max(T a, T b) {
- return a>b ? a : b;
-}
-template <typename T>
-static inline T max(T a, T b, T c) {
- return max(a, max(b, c));
-}
-template <typename T>
-static inline T max(T a, T b, T c, T d) {
- return max(a, b, max(c, d));
-}
-
-template <typename T>
-static inline
-void swap(T& a, T& b) {
- T t(a);
- a = b;
- b = t;
-}
-
-
-}; // namespace android
-
-#endif /* ANDROID_SURFACE_FLINGER_CLZ_H */
diff --git a/services/surfaceflinger/tests/Android.mk b/services/surfaceflinger/tests/Android.mk
deleted file mode 100644
index b655648..0000000
--- a/services/surfaceflinger/tests/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Build the unit tests,
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := SurfaceFlinger_test
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
- Transaction_test.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libEGL \
- libGLESv2 \
- libandroid \
- libbinder \
- libcutils \
- libgui \
- libstlport \
- libui \
- libutils \
-
-LOCAL_C_INCLUDES := \
- bionic \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport \
-
-# Build the binary to $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
-# to integrate with auto-test framework.
-include $(BUILD_NATIVE_TEST)
-
-# Include subdirectory makefiles
-# ============================================================
-
-# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
-# team really wants is to build the stuff defined by this makefile.
-ifeq (,$(ONE_SHOT_MAKEFILE))
-include $(call first-makefiles-under,$(LOCAL_PATH))
-endif
diff --git a/services/surfaceflinger/tests/Transaction_test.cpp b/services/surfaceflinger/tests/Transaction_test.cpp
deleted file mode 100644
index 84ae0d9..0000000
--- a/services/surfaceflinger/tests/Transaction_test.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <gtest/gtest.h>
-
-#include <binder/IMemory.h>
-
-#include <gui/ISurfaceComposer.h>
-#include <gui/Surface.h>
-#include <gui/SurfaceComposerClient.h>
-#include <private/gui/ComposerService.h>
-
-#include <utils/String8.h>
-
-namespace android {
-
-// Fill an RGBA_8888 formatted surface with a single color.
-static void fillSurfaceRGBA8(const sp<SurfaceControl>& sc,
- uint8_t r, uint8_t g, uint8_t b) {
- Surface::SurfaceInfo info;
- sp<Surface> s = sc->getSurface();
- ASSERT_TRUE(s != NULL);
- ASSERT_EQ(NO_ERROR, s->lock(&info));
- uint8_t* img = reinterpret_cast<uint8_t*>(info.bits);
- for (uint32_t y = 0; y < info.h; y++) {
- for (uint32_t x = 0; x < info.w; x++) {
- uint8_t* pixel = img + (4 * (y*info.s + x));
- pixel[0] = r;
- pixel[1] = g;
- pixel[2] = b;
- pixel[3] = 255;
- }
- }
- ASSERT_EQ(NO_ERROR, s->unlockAndPost());
-}
-
-// A ScreenCapture is a screenshot from SurfaceFlinger that can be used to check
-// individual pixel values for testing purposes.
-class ScreenCapture : public RefBase {
-public:
- static void captureScreen(sp<ScreenCapture>* sc) {
- sp<IMemoryHeap> heap;
- uint32_t w=0, h=0;
- PixelFormat fmt=0;
- sp<ISurfaceComposer> sf(ComposerService::getComposerService());
- ASSERT_EQ(NO_ERROR, sf->captureScreen(0, &heap, &w, &h, &fmt, 0, 0,
- 0, INT_MAX));
- ASSERT_TRUE(heap != NULL);
- ASSERT_EQ(PIXEL_FORMAT_RGBA_8888, fmt);
- *sc = new ScreenCapture(w, h, heap);
- }
-
- void checkPixel(uint32_t x, uint32_t y, uint8_t r, uint8_t g, uint8_t b) {
- const uint8_t* img = reinterpret_cast<const uint8_t*>(mHeap->base());
- const uint8_t* pixel = img + (4 * (y*mWidth + x));
- if (r != pixel[0] || g != pixel[1] || b != pixel[2]) {
- String8 err(String8::format("pixel @ (%3d, %3d): "
- "expected [%3d, %3d, %3d], got [%3d, %3d, %3d]",
- x, y, r, g, b, pixel[0], pixel[1], pixel[2]));
- EXPECT_EQ(String8(), err);
- }
- }
-
-private:
- ScreenCapture(uint32_t w, uint32_t h, const sp<IMemoryHeap>& heap) :
- mWidth(w),
- mHeight(h),
- mHeap(heap)
- {}
-
- const uint32_t mWidth;
- const uint32_t mHeight;
- sp<IMemoryHeap> mHeap;
-};
-
-class LayerUpdateTest : public ::testing::Test {
-protected:
- virtual void SetUp() {
- mComposerClient = new SurfaceComposerClient;
- ASSERT_EQ(NO_ERROR, mComposerClient->initCheck());
-
- ssize_t displayWidth = mComposerClient->getDisplayWidth(0);
- ssize_t displayHeight = mComposerClient->getDisplayHeight(0);
-
- // Background surface
- mBGSurfaceControl = mComposerClient->createSurface(
- String8("BG Test Surface"), 0, displayWidth, displayHeight,
- PIXEL_FORMAT_RGBA_8888, 0);
- ASSERT_TRUE(mBGSurfaceControl != NULL);
- ASSERT_TRUE(mBGSurfaceControl->isValid());
- fillSurfaceRGBA8(mBGSurfaceControl, 63, 63, 195);
-
- // Foreground surface
- mFGSurfaceControl = mComposerClient->createSurface(
- String8("FG Test Surface"), 0, 64, 64, PIXEL_FORMAT_RGBA_8888, 0);
- ASSERT_TRUE(mFGSurfaceControl != NULL);
- ASSERT_TRUE(mFGSurfaceControl->isValid());
-
- fillSurfaceRGBA8(mFGSurfaceControl, 195, 63, 63);
-
- // Synchronization surface
- mSyncSurfaceControl = mComposerClient->createSurface(
- String8("Sync Test Surface"), 0, 1, 1, PIXEL_FORMAT_RGBA_8888, 0);
- ASSERT_TRUE(mSyncSurfaceControl != NULL);
- ASSERT_TRUE(mSyncSurfaceControl->isValid());
-
- fillSurfaceRGBA8(mSyncSurfaceControl, 31, 31, 31);
-
- SurfaceComposerClient::openGlobalTransaction();
-
- ASSERT_EQ(NO_ERROR, mBGSurfaceControl->setLayer(INT_MAX-2));
- ASSERT_EQ(NO_ERROR, mBGSurfaceControl->show());
-
- ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setLayer(INT_MAX-1));
- ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setPosition(64, 64));
- ASSERT_EQ(NO_ERROR, mFGSurfaceControl->show());
-
- ASSERT_EQ(NO_ERROR, mSyncSurfaceControl->setLayer(INT_MAX-1));
- ASSERT_EQ(NO_ERROR, mSyncSurfaceControl->setPosition(displayWidth-2,
- displayHeight-2));
- ASSERT_EQ(NO_ERROR, mSyncSurfaceControl->show());
-
- SurfaceComposerClient::closeGlobalTransaction(true);
- }
-
- virtual void TearDown() {
- mComposerClient->dispose();
- mBGSurfaceControl = 0;
- mFGSurfaceControl = 0;
- mSyncSurfaceControl = 0;
- mComposerClient = 0;
- }
-
- void waitForPostedBuffers() {
- // Since the sync surface is in synchronous mode (i.e. double buffered)
- // posting three buffers to it should ensure that at least two
- // SurfaceFlinger::handlePageFlip calls have been made, which should
- // guaranteed that a buffer posted to another Surface has been retired.
- fillSurfaceRGBA8(mSyncSurfaceControl, 31, 31, 31);
- fillSurfaceRGBA8(mSyncSurfaceControl, 31, 31, 31);
- fillSurfaceRGBA8(mSyncSurfaceControl, 31, 31, 31);
- }
-
- sp<SurfaceComposerClient> mComposerClient;
- sp<SurfaceControl> mBGSurfaceControl;
- sp<SurfaceControl> mFGSurfaceControl;
-
- // This surface is used to ensure that the buffers posted to
- // mFGSurfaceControl have been picked up by SurfaceFlinger.
- sp<SurfaceControl> mSyncSurfaceControl;
-};
-
-TEST_F(LayerUpdateTest, LayerMoveWorks) {
- sp<ScreenCapture> sc;
- {
- SCOPED_TRACE("before move");
- ScreenCapture::captureScreen(&sc);
- sc->checkPixel( 0, 12, 63, 63, 195);
- sc->checkPixel( 75, 75, 195, 63, 63);
- sc->checkPixel(145, 145, 63, 63, 195);
- }
-
- SurfaceComposerClient::openGlobalTransaction();
- ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setPosition(128, 128));
- SurfaceComposerClient::closeGlobalTransaction(true);
- {
- // This should reflect the new position, but not the new color.
- SCOPED_TRACE("after move, before redraw");
- ScreenCapture::captureScreen(&sc);
- sc->checkPixel( 24, 24, 63, 63, 195);
- sc->checkPixel( 75, 75, 63, 63, 195);
- sc->checkPixel(145, 145, 195, 63, 63);
- }
-
- fillSurfaceRGBA8(mFGSurfaceControl, 63, 195, 63);
- waitForPostedBuffers();
- {
- // This should reflect the new position and the new color.
- SCOPED_TRACE("after redraw");
- ScreenCapture::captureScreen(&sc);
- sc->checkPixel( 24, 24, 63, 63, 195);
- sc->checkPixel( 75, 75, 63, 63, 195);
- sc->checkPixel(145, 145, 63, 195, 63);
- }
-}
-
-TEST_F(LayerUpdateTest, LayerResizeWorks) {
- sp<ScreenCapture> sc;
- {
- SCOPED_TRACE("before resize");
- ScreenCapture::captureScreen(&sc);
- sc->checkPixel( 0, 12, 63, 63, 195);
- sc->checkPixel( 75, 75, 195, 63, 63);
- sc->checkPixel(145, 145, 63, 63, 195);
- }
-
- ALOGD("resizing");
- SurfaceComposerClient::openGlobalTransaction();
- ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setSize(128, 128));
- SurfaceComposerClient::closeGlobalTransaction(true);
- ALOGD("resized");
- {
- // This should not reflect the new size or color because SurfaceFlinger
- // has not yet received a buffer of the correct size.
- SCOPED_TRACE("after resize, before redraw");
- ScreenCapture::captureScreen(&sc);
- sc->checkPixel( 0, 12, 63, 63, 195);
- sc->checkPixel( 75, 75, 195, 63, 63);
- sc->checkPixel(145, 145, 63, 63, 195);
- }
-
- ALOGD("drawing");
- fillSurfaceRGBA8(mFGSurfaceControl, 63, 195, 63);
- waitForPostedBuffers();
- ALOGD("drawn");
- {
- // This should reflect the new size and the new color.
- SCOPED_TRACE("after redraw");
- ScreenCapture::captureScreen(&sc);
- sc->checkPixel( 24, 24, 63, 63, 195);
- sc->checkPixel( 75, 75, 63, 195, 63);
- sc->checkPixel(145, 145, 63, 195, 63);
- }
-}
-
-}
diff --git a/services/surfaceflinger/tests/resize/Android.mk b/services/surfaceflinger/tests/resize/Android.mk
deleted file mode 100644
index d81679e..0000000
--- a/services/surfaceflinger/tests/resize/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- resize.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libui \
- libgui
-
-LOCAL_MODULE:= test-resize
-
-LOCAL_MODULE_TAGS := tests
-
-include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/resize/resize.cpp b/services/surfaceflinger/tests/resize/resize.cpp
deleted file mode 100644
index c143b3d..0000000
--- a/services/surfaceflinger/tests/resize/resize.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <cutils/memory.h>
-
-#include <utils/Log.h>
-
-#include <binder/IPCThreadState.h>
-#include <binder/ProcessState.h>
-#include <binder/IServiceManager.h>
-
-#include <gui/Surface.h>
-#include <gui/SurfaceComposerClient.h>
-
-using namespace android;
-
-namespace android {
-
-int main(int argc, char** argv)
-{
- // set up the thread-pool
- sp<ProcessState> proc(ProcessState::self());
- ProcessState::self()->startThreadPool();
-
- // create a client to surfaceflinger
- sp<SurfaceComposerClient> client = new SurfaceComposerClient();
-
- sp<Surface> surface = client->createSurface(0, 160, 240,
- PIXEL_FORMAT_RGB_565);
-
-
- SurfaceComposerClient::openGlobalTransaction();
- surface->setLayer(100000);
- SurfaceComposerClient::closeGlobalTransaction();
-
- Surface::SurfaceInfo info;
- surface->lock(&info);
- ssize_t bpr = info.s * bytesPerPixel(info.format);
- android_memset16((uint16_t*)info.bits, 0xF800, bpr*info.h);
- surface->unlockAndPost();
-
- surface->lock(&info);
- android_memset16((uint16_t*)info.bits, 0x07E0, bpr*info.h);
- surface->unlockAndPost();
-
- SurfaceComposerClient::openGlobalTransaction();
- surface->setSize(320, 240);
- SurfaceComposerClient::closeGlobalTransaction();
-
-
- IPCThreadState::self()->joinThreadPool();
-
- return 0;
-}
diff --git a/services/surfaceflinger/tests/screencap/Android.mk b/services/surfaceflinger/tests/screencap/Android.mk
deleted file mode 100644
index 5cdd1a8..0000000
--- a/services/surfaceflinger/tests/screencap/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- screencap.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libbinder \
- libskia \
- libui \
- libgui
-
-LOCAL_MODULE:= test-screencap
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES += \
- external/skia/include/core \
- external/skia/include/effects \
- external/skia/include/images \
- external/skia/src/ports \
- external/skia/include/utils
-
-include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/screencap/screencap.cpp b/services/surfaceflinger/tests/screencap/screencap.cpp
deleted file mode 100644
index 53566e0..0000000
--- a/services/surfaceflinger/tests/screencap/screencap.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <utils/Log.h>
-
-#include <binder/IPCThreadState.h>
-#include <binder/ProcessState.h>
-#include <binder/IServiceManager.h>
-
-#include <binder/IMemory.h>
-#include <gui/ISurfaceComposer.h>
-
-#include <SkImageEncoder.h>
-#include <SkBitmap.h>
-
-using namespace android;
-
-int main(int argc, char** argv)
-{
- if (argc != 2) {
- printf("usage: %s path\n", argv[0]);
- exit(0);
- }
-
- const String16 name("SurfaceFlinger");
- sp<ISurfaceComposer> composer;
- getService(name, &composer);
-
- sp<IMemoryHeap> heap;
- uint32_t w, h;
- PixelFormat f;
- status_t err = composer->captureScreen(0, &heap, &w, &h, &f, 0, 0);
- if (err != NO_ERROR) {
- fprintf(stderr, "screen capture failed: %s\n", strerror(-err));
- exit(0);
- }
-
- printf("screen capture success: w=%u, h=%u, pixels=%p\n",
- w, h, heap->getBase());
-
- printf("saving file as PNG in %s ...\n", argv[1]);
-
- SkBitmap b;
- b.setConfig(SkBitmap::kARGB_8888_Config, w, h);
- b.setPixels(heap->getBase());
- SkImageEncoder::EncodeFile(argv[1], b,
- SkImageEncoder::kPNG_Type, SkImageEncoder::kDefaultQuality);
-
- return 0;
-}
diff --git a/services/surfaceflinger/tests/surface/Android.mk b/services/surfaceflinger/tests/surface/Android.mk
deleted file mode 100644
index c59060e..0000000
--- a/services/surfaceflinger/tests/surface/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- surface.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libbinder \
- libui \
- libgui
-
-LOCAL_MODULE:= test-surface
-
-LOCAL_MODULE_TAGS := tests
-
-include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/surface/surface.cpp b/services/surfaceflinger/tests/surface/surface.cpp
deleted file mode 100644
index a8878f7..0000000
--- a/services/surfaceflinger/tests/surface/surface.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <cutils/memory.h>
-
-#include <utils/Log.h>
-
-#include <binder/IPCThreadState.h>
-#include <binder/ProcessState.h>
-#include <binder/IServiceManager.h>
-
-#include <gui/Surface.h>
-#include <gui/SurfaceComposerClient.h>
-
-using namespace android;
-
-int main(int argc, char** argv)
-{
- // set up the thread-pool
- sp<ProcessState> proc(ProcessState::self());
- ProcessState::self()->startThreadPool();
-
- // create a client to surfaceflinger
- sp<SurfaceComposerClient> client = new SurfaceComposerClient();
-
- sp<SurfaceControl> surfaceControl = client->createSurface(
- 0, 160, 240, PIXEL_FORMAT_RGB_565);
- SurfaceComposerClient::openGlobalTransaction();
- surfaceControl->setLayer(100000);
- SurfaceComposerClient::closeGlobalTransaction();
-
- // pretend it went cross-process
- Parcel parcel;
- SurfaceControl::writeSurfaceToParcel(surfaceControl, &parcel);
- parcel.setDataPosition(0);
- sp<Surface> surface = Surface::readFromParcel(parcel);
- ANativeWindow* window = surface.get();
-
- printf("window=%p\n", window);
-
- int err = native_window_set_buffer_count(window, 8);
- ANativeWindowBuffer* buffer;
-
- for (int i=0 ; i<8 ; i++) {
- window->dequeueBuffer(window, &buffer);
- printf("buffer %d: %p\n", i, buffer);
- }
-
- printf("test complete. CTRL+C to finish.\n");
-
- IPCThreadState::self()->joinThreadPool();
- return 0;
-}
diff --git a/services/surfaceflinger/tests/transform/Android.mk b/services/surfaceflinger/tests/transform/Android.mk
deleted file mode 100644
index 6219dae..0000000
--- a/services/surfaceflinger/tests/transform/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- TransformTest.cpp \
- ../../Transform.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libui \
-
-LOCAL_MODULE:= test-transform
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES += ../..
-
-include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/transform/TransformTest.cpp b/services/surfaceflinger/tests/transform/TransformTest.cpp
deleted file mode 100644
index e112c4e..0000000
--- a/services/surfaceflinger/tests/transform/TransformTest.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#include <utils/Errors.h>
-#include "../../Transform.h"
-
-using namespace android;
-
-int main(int argc, char **argv)
-{
- Transform tr90(Transform::ROT_90);
- Transform trFH(Transform::FLIP_H);
- Transform trFV(Transform::FLIP_V);
-
- Transform tr90FH(Transform::ROT_90 | Transform::FLIP_H);
- Transform tr90FV(Transform::ROT_90 | Transform::FLIP_V);
-
- tr90.dump("tr90");
- trFH.dump("trFH");
- trFV.dump("trFV");
-
- tr90FH.dump("tr90FH");
- tr90FV.dump("tr90FV");
-
- (trFH*tr90).dump("trFH*tr90");
- (trFV*tr90).dump("trFV*tr90");
-
- (tr90*trFH).dump("tr90*trFH");
- (tr90*trFV).dump("tr90*trFV");
-
- return 0;
-}
diff --git a/services/surfaceflinger/tests/vsync/Android.mk b/services/surfaceflinger/tests/vsync/Android.mk
deleted file mode 100644
index 9181760..0000000
--- a/services/surfaceflinger/tests/vsync/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- vsync.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libbinder \
- libui \
- libgui
-
-LOCAL_MODULE:= test-vsync-events
-
-LOCAL_MODULE_TAGS := tests
-
-include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/vsync/vsync.cpp b/services/surfaceflinger/tests/vsync/vsync.cpp
deleted file mode 100644
index b0d54c4..0000000
--- a/services/surfaceflinger/tests/vsync/vsync.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#include <gui/DisplayEventReceiver.h>
-#include <utils/Looper.h>
-
-using namespace android;
-
-int receiver(int fd, int events, void* data)
-{
- DisplayEventReceiver* q = (DisplayEventReceiver*)data;
-
- ssize_t n;
- DisplayEventReceiver::Event buffer[1];
-
- static nsecs_t oldTimeStamp = 0;
-
- while ((n = q->getEvents(buffer, 1)) > 0) {
- for (int i=0 ; i<n ; i++) {
- if (buffer[i].header.type == DisplayEventReceiver::DISPLAY_EVENT_VSYNC) {
- printf("event vsync: count=%d\t", buffer[i].vsync.count);
- }
- if (oldTimeStamp) {
- float t = float(buffer[i].header.timestamp - oldTimeStamp) / s2ns(1);
- printf("%f ms (%f Hz)\n", t*1000, 1.0/t);
- }
- oldTimeStamp = buffer[i].header.timestamp;
- }
- }
- if (n<0) {
- printf("error reading events (%s)\n", strerror(-n));
- }
- return 1;
-}
-
-int main(int argc, char** argv)
-{
- DisplayEventReceiver myDisplayEvent;
-
-
- sp<Looper> loop = new Looper(false);
- loop->addFd(myDisplayEvent.getFd(), 0, ALOOPER_EVENT_INPUT, receiver,
- &myDisplayEvent);
-
- myDisplayEvent.setVsyncRate(1);
-
- do {
- //printf("about to poll...\n");
- int32_t ret = loop->pollOnce(-1);
- switch (ret) {
- case ALOOPER_POLL_WAKE:
- //("ALOOPER_POLL_WAKE\n");
- break;
- case ALOOPER_POLL_CALLBACK:
- //("ALOOPER_POLL_CALLBACK\n");
- break;
- case ALOOPER_POLL_TIMEOUT:
- printf("ALOOPER_POLL_TIMEOUT\n");
- break;
- case ALOOPER_POLL_ERROR:
- printf("ALOOPER_POLL_TIMEOUT\n");
- break;
- default:
- printf("ugh? poll returned %d\n", ret);
- break;
- }
- } while (1);
-
- return 0;
-}
diff --git a/services/surfaceflinger/tests/waitforvsync/Android.mk b/services/surfaceflinger/tests/waitforvsync/Android.mk
deleted file mode 100644
index c25f5ab..0000000
--- a/services/surfaceflinger/tests/waitforvsync/Android.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- waitforvsync.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
-
-LOCAL_MODULE:= test-waitforvsync
-
-LOCAL_MODULE_TAGS := tests
-
-include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp b/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp
deleted file mode 100644
index 279b88b..0000000
--- a/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <linux/fb.h>
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifndef FBIO_WAITFORVSYNC
-#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
-#endif
-
-int main(int argc, char** argv) {
- int fd = open("/dev/graphics/fb0", O_RDWR);
- if (fd >= 0) {
- do {
- uint32_t crt = 0;
- int err = ioctl(fd, FBIO_WAITFORVSYNC, &crt);
- if (err < 0) {
- printf("FBIO_WAITFORVSYNC error: %s\n", strerror(errno));
- break;
- }
- } while(1);
- close(fd);
- }
- return 0;
-}
diff --git a/tests/RenderScriptTests/Fountain_v11/Android.mk b/tests/RenderScriptTests/Fountain_v11/Android.mk
new file mode 100644
index 0000000..e51115c
--- /dev/null
+++ b/tests/RenderScriptTests/Fountain_v11/Android.mk
@@ -0,0 +1,32 @@
+#
+# Copyright (C) 2008 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.
+#
+
+ifneq ($(TARGET_SIMULATOR),true)
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
+#LOCAL_STATIC_JAVA_LIBRARIES := android.renderscript
+
+LOCAL_PACKAGE_NAME := Fountain_v11
+LOCAL_SDK_VERSION := 11
+
+include $(BUILD_PACKAGE)
+
+endif
diff --git a/tests/RenderScriptTests/Fountain_v11/AndroidManifest.xml b/tests/RenderScriptTests/Fountain_v11/AndroidManifest.xml
new file mode 100644
index 0000000..fcb4faf
--- /dev/null
+++ b/tests/RenderScriptTests/Fountain_v11/AndroidManifest.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.fountain_v11">
+ <uses-sdk android:minSdkVersion="11" />
+ <application
+ android:label="Fountain_v11"
+ android:icon="@drawable/test_pattern">
+ <activity android:name="Fountain_v11">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
diff --git a/tests/RenderScriptTests/Fountain_v11/_index.html b/tests/RenderScriptTests/Fountain_v11/_index.html
new file mode 100644
index 0000000..223242f
--- /dev/null
+++ b/tests/RenderScriptTests/Fountain_v11/_index.html
@@ -0,0 +1,5 @@
+<p>An example that renders many dots on the screen that follow a user's touch. The dots fall
+to the bottom of the screen when the user releases the finger.</p>
+
+
+
diff --git a/tests/RenderScriptTests/Fountain_v11/res/drawable/test_pattern.png b/tests/RenderScriptTests/Fountain_v11/res/drawable/test_pattern.png
new file mode 100644
index 0000000..e7d1455
--- /dev/null
+++ b/tests/RenderScriptTests/Fountain_v11/res/drawable/test_pattern.png
Binary files differ
diff --git a/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/FountainRS.java b/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/FountainRS.java
new file mode 100644
index 0000000..e858100
--- /dev/null
+++ b/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/FountainRS.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2008 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.fountain_v11;
+
+import android.content.res.Resources;
+import android.renderscript.*;
+import android.util.Log;
+
+
+public class FountainRS {
+ public static final int PART_COUNT = 50000;
+
+ public FountainRS() {
+ }
+
+ private Resources mRes;
+ private RenderScriptGL mRS;
+ private ScriptC_fountain mScript;
+ public void init(RenderScriptGL rs, Resources res, int width, int height) {
+ mRS = rs;
+ mRes = res;
+
+ ProgramFragmentFixedFunction.Builder pfb = new ProgramFragmentFixedFunction.Builder(rs);
+ pfb.setVaryingColor(true);
+ rs.bindProgramFragment(pfb.create());
+
+ ScriptField_Point points = new ScriptField_Point(mRS, PART_COUNT);//
+ // Allocation.USAGE_GRAPHICS_VERTEX);
+
+ Mesh.AllocationBuilder smb = new Mesh.AllocationBuilder(mRS);
+ smb.addVertexAllocation(points.getAllocation());
+ smb.addIndexSetType(Mesh.Primitive.POINT);
+ Mesh sm = smb.create();
+
+ mScript = new ScriptC_fountain(mRS, mRes, R.raw.fountain);
+ mScript.set_partMesh(sm);
+ mScript.bind_point(points);
+ mRS.bindRootScript(mScript);
+ }
+
+ boolean holdingColor[] = new boolean[10];
+ public void newTouchPosition(float x, float y, float pressure, int id) {
+ if (id >= holdingColor.length) {
+ return;
+ }
+ int rate = (int)(pressure * pressure * 500.f);
+ if (rate > 500) {
+ rate = 500;
+ }
+ if (rate > 0) {
+ mScript.invoke_addParticles(rate, x, y, id, !holdingColor[id]);
+ holdingColor[id] = true;
+ } else {
+ holdingColor[id] = false;
+ }
+
+ }
+}
diff --git a/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/FountainView.java b/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/FountainView.java
new file mode 100644
index 0000000..e82376c
--- /dev/null
+++ b/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/FountainView.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2008 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.fountain_v11;
+
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.concurrent.Semaphore;
+
+import android.renderscript.RSSurfaceView;
+import android.renderscript.RenderScript;
+import android.renderscript.RenderScriptGL;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.os.Handler;
+import android.os.Message;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.Surface;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+
+public class FountainView extends RSSurfaceView {
+
+ public FountainView(Context context) {
+ super(context);
+ //setFocusable(true);
+ }
+
+ private RenderScriptGL mRS;
+ private FountainRS mRender;
+
+ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
+ super.surfaceChanged(holder, format, w, h);
+ if (mRS == null) {
+ RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
+ mRS = createRenderScriptGL(sc);
+ mRS.setSurface(holder, w, h);
+ mRender = new FountainRS();
+ mRender.init(mRS, getResources(), w, h);
+ }
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ if (mRS != null) {
+ mRS = null;
+ destroyRenderScriptGL();
+ }
+ }
+
+
+ @Override
+ public boolean onTouchEvent(MotionEvent ev)
+ {
+ int act = ev.getActionMasked();
+ if (act == ev.ACTION_UP) {
+ mRender.newTouchPosition(0, 0, 0, ev.getPointerId(0));
+ return false;
+ } else if (act == MotionEvent.ACTION_POINTER_UP) {
+ // only one pointer going up, we can get the index like this
+ int pointerIndex = ev.getActionIndex();
+ int pointerId = ev.getPointerId(pointerIndex);
+ mRender.newTouchPosition(0, 0, 0, pointerId);
+ }
+ int count = ev.getHistorySize();
+ int pcount = ev.getPointerCount();
+
+ for (int p=0; p < pcount; p++) {
+ int id = ev.getPointerId(p);
+ mRender.newTouchPosition(ev.getX(p),
+ ev.getY(p),
+ ev.getPressure(p),
+ id);
+
+ for (int i=0; i < count; i++) {
+ mRender.newTouchPosition(ev.getHistoricalX(p, i),
+ ev.getHistoricalY(p, i),
+ ev.getHistoricalPressure(p, i),
+ id);
+ }
+ }
+ return true;
+ }
+}
+
+
diff --git a/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/Fountain_v11.java b/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/Fountain_v11.java
new file mode 100644
index 0000000..2c07b27
--- /dev/null
+++ b/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/Fountain_v11.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2008 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.fountain_v11;
+
+import android.renderscript.RSSurfaceView;
+import android.renderscript.RenderScript;
+
+import android.app.Activity;
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.provider.Settings.System;
+import android.util.Config;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.Window;
+import android.widget.Button;
+import android.widget.ListView;
+
+import java.lang.Runtime;
+
+public class Fountain_v11 extends Activity {
+ //EventListener mListener = new EventListener();
+
+ private static final String LOG_TAG = "libRS_jni";
+ private static final boolean DEBUG = false;
+ private static final boolean LOG_ENABLED = DEBUG ? Config.LOGD : Config.LOGV;
+
+ private FountainView mView;
+
+ // get the current looper (from your Activity UI thread for instance
+
+
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ // Create our Preview view and set it as the content of our
+ // Activity
+ mView = new FountainView(this);
+ setContentView(mView);
+ }
+
+ @Override
+ protected void onResume() {
+ Log.e("rs", "onResume");
+
+ // Ideally a game should implement onResume() and onPause()
+ // to take appropriate action when the activity looses focus
+ super.onResume();
+ mView.resume();
+ }
+
+ @Override
+ protected void onPause() {
+ Log.e("rs", "onPause");
+
+ // Ideally a game should implement onResume() and onPause()
+ // to take appropriate action when the activity looses focus
+ super.onPause();
+ mView.pause();
+
+
+
+ //Runtime.getRuntime().exit(0);
+ }
+
+
+ static void log(String message) {
+ if (LOG_ENABLED) {
+ Log.v(LOG_TAG, message);
+ }
+ }
+
+
+}
+
diff --git a/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/fountain.rs b/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/fountain.rs
new file mode 100644
index 0000000..3b6c89a
--- /dev/null
+++ b/tests/RenderScriptTests/Fountain_v11/src/com/android/fountain/fountain.rs
@@ -0,0 +1,69 @@
+// Fountain test script
+#pragma version(1)
+
+#pragma rs java_package_name(com.android.fountain_v11)
+
+#pragma stateFragment(parent)
+
+#include "rs_graphics.rsh"
+
+static int newPart = 0;
+rs_mesh partMesh;
+
+typedef struct __attribute__((packed, aligned(4))) Point {
+ float2 delta;
+ float2 position;
+ uchar4 color;
+} Point_t;
+Point_t *point;
+
+int root() {
+ float dt = min(rsGetDt(), 0.1f);
+ rsgClearColor(0.f, 0.f, 0.f, 1.f);
+ const float height = rsgGetHeight();
+ const int size = rsAllocationGetDimX(rsGetAllocation(point));
+ float dy2 = dt * (10.f);
+ Point_t * p = point;
+ for (int ct=0; ct < size; ct++) {
+ p->delta.y += dy2;
+ p->position += p->delta;
+ if ((p->position.y > height) && (p->delta.y > 0)) {
+ p->delta.y *= -0.3f;
+ }
+ p++;
+ }
+
+ rsgDrawMesh(partMesh);
+ return 1;
+}
+
+static float4 partColor[10];
+void addParticles(int rate, float x, float y, int index, bool newColor)
+{
+ if (newColor) {
+ partColor[index].x = rsRand(0.5f, 1.0f);
+ partColor[index].y = rsRand(1.0f);
+ partColor[index].z = rsRand(1.0f);
+ }
+ float rMax = ((float)rate) * 0.02f;
+ int size = rsAllocationGetDimX(rsGetAllocation(point));
+ uchar4 c = rsPackColorTo8888(partColor[index]);
+
+ Point_t * np = &point[newPart];
+ float2 p = {x, y};
+ while (rate--) {
+ float angle = rsRand(3.14f * 2.f);
+ float len = rsRand(rMax);
+ np->delta.x = len * sin(angle);
+ np->delta.y = len * cos(angle);
+ np->position = p;
+ np->color = c;
+ newPart++;
+ np++;
+ if (newPart >= size) {
+ newPart = 0;
+ np = &point[newPart];
+ }
+ }
+}
+
diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/diffuse_lights.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/diffuse_lights.glsl
new file mode 100644
index 0000000..ef93e1c
--- /dev/null
+++ b/tests/RenderScriptTests/SceneGraph/res/raw/diffuse_lights.glsl
@@ -0,0 +1,22 @@
+varying vec3 varWorldPos;
+varying vec3 varWorldNormal;
+varying vec2 varTex0;
+
+void main() {
+
+ vec3 V = normalize(UNI_cameraPos.xyz - varWorldPos.xyz);
+ vec3 worldNorm = normalize(varWorldNormal);
+
+ vec3 light0Vec = normalize(UNI_lightPos_0.xyz - varWorldPos.xyz);
+ float light0_Diffuse = clamp(dot(worldNorm, light0Vec), 0.0, 1.0);
+
+ vec3 light1Vec = normalize(UNI_lightPos_1.xyz - varWorldPos.xyz);
+ float light1_Diffuse = clamp(dot(worldNorm, light1Vec), 0.0, 1.0);
+
+ vec2 t0 = varTex0.xy;
+ lowp vec4 col = UNI_diffuse;
+ col.xyz = col.xyz * (light0_Diffuse * UNI_lightColor_0.xyz +
+ light1_Diffuse * UNI_lightColor_1.xyz);
+ gl_FragColor = col;
+}
+
diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/shader2v.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/shader2v.glsl
index 1ea234f..7910a54 100644
--- a/tests/RenderScriptTests/SceneGraph/res/raw/shader2v.glsl
+++ b/tests/RenderScriptTests/SceneGraph/res/raw/shader2v.glsl
@@ -1,3 +1,8 @@
+/*
+ rs_matrix4x4 model;
+ rs_matrix4x4 viewProj;
+*/
+
varying vec3 varWorldPos;
varying vec3 varWorldNormal;
varying vec2 varTex0;
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/SimpleAppView.java b/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/SimpleAppView.java
index 053e545..2112181 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/SimpleAppView.java
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/SimpleAppView.java
@@ -41,6 +41,7 @@
if (mRS == null) {
RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
sc.setDepth(16, 24);
+ sc.setSamples(1, 2, 1);
mRS = createRenderScriptGL(sc);
mRS.setSurface(holder, w, h);
mRender = new SimpleAppRS();
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TestAppRS.java b/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TestAppRS.java
index f159e85..3aa80f4 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TestAppRS.java
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TestAppRS.java
@@ -65,6 +65,7 @@
// Shaders
private FragmentShader mPaintF;
private FragmentShader mLightsF;
+ private FragmentShader mLightsDiffF;
private FragmentShader mAluminumF;
private FragmentShader mPlasticF;
private FragmentShader mDiffuseF;
@@ -173,6 +174,11 @@
fb.setShader(mRes, R.raw.plastic_lights);
mLightsF = fb.create();
+ fb = new FragmentShader.Builder(mRS);
+ fb.setObjectConst(lightParams.getAllocation().getType());
+ fb.setShader(mRes, R.raw.diffuse_lights);
+ mLightsDiffF = fb.create();
+
FullscreenBlur.initShaders(mRes, mRS);
}
@@ -203,6 +209,7 @@
private void addShadersToScene() {
mActiveScene.appendShader(mPaintF);
mActiveScene.appendShader(mLightsF);
+ mActiveScene.appendShader(mLightsDiffF);
mActiveScene.appendShader(mAluminumF);
mActiveScene.appendShader(mPlasticF);
mActiveScene.appendShader(mDiffuseF);
@@ -219,8 +226,12 @@
RenderState paint = new RenderState(mGenericV, mPaintF, null, null);
RenderState aluminum = new RenderState(mGenericV, mAluminumF, null, null);
RenderState lights = new RenderState(mGenericV, mLightsF, null, null);
+ RenderState diff_lights = new RenderState(mGenericV, mLightsDiffF, null, null);
+ RenderState diff_lights_no_cull = new RenderState(mGenericV, mLightsDiffF, null,
+ ProgramRaster.CULL_NONE(mRS));
RenderState glassTransp = new RenderState(mGenericV, mPaintF,
ProgramStore.BLEND_ALPHA_DEPTH_TEST(mRS), null);
+ RenderState texState = new RenderState(mGenericV, mTextureF, null, null);
initRenderPasses();
@@ -239,10 +250,12 @@
mActiveScene.assignRenderStateToMaterial(glassTransp, "^GlassLight");
mActiveScene.assignRenderStateToMaterial(lights, "^LightBlinn");
+ mActiveScene.assignRenderStateToMaterial(diff_lights, "^LightLambert");
+ mActiveScene.assignRenderStateToMaterial(diff_lights_no_cull, "^LightLambertNoCull");
+ mActiveScene.assignRenderStateToMaterial(texState, "^TextureOnly");
Renderable plane = (Renderable)mActiveScene.getRenderableByName("pPlaneShape1");
if (plane != null) {
- RenderState texState = new RenderState(mGenericV, mTextureF, null, null);
plane.setRenderState(texState);
plane.setVisible(!mUseBlur);
}
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TestAppView.java b/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TestAppView.java
index 687f35b..33ca1b8 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TestAppView.java
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TestAppView.java
@@ -59,6 +59,7 @@
if (mRS == null) {
RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
sc.setDepth(16, 24);
+ sc.setSamples(1, 2, 1);
mRS = createRenderScriptGL(sc);
mRS.setSurface(holder, w, h);
mRender = new TestAppRS();
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TouchHandler.java b/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TouchHandler.java
index e272cc5..d0f9797 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TouchHandler.java
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/TouchHandler.java
@@ -43,7 +43,7 @@
public void init(Scene scene) {
// Some initial values for camera position
mRotateXValue = -20;
- mRotateYValue = 45;
+ mRotateYValue = 0;
mDistValue = new Float3(0, 0, 45);
mPosValue = new Float3(0, 4, 0);
diff --git a/tests/RenderScriptTests/tests_v11/Android.mk b/tests/RenderScriptTests/tests_v11/Android.mk
new file mode 100644
index 0000000..93a429b
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/Android.mk
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2008 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.
+#
+
+ifneq ($(TARGET_SIMULATOR),true)
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
+
+LOCAL_PACKAGE_NAME := RSTest_v11
+LOCAL_SDK_VERSION := 11
+
+include $(BUILD_PACKAGE)
+
+endif
diff --git a/tests/RenderScriptTests/tests_v11/AndroidManifest.xml b/tests/RenderScriptTests/tests_v11/AndroidManifest.xml
new file mode 100644
index 0000000..f4aeda2
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/AndroidManifest.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.rs.test_v11">
+ <uses-sdk android:minSdkVersion="11" />
+ <application
+ android:label="_RS_Test_v11"
+ android:icon="@drawable/test_pattern">
+ <activity android:name="RSTest_v11"
+ android:screenOrientation="portrait">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
diff --git a/tests/RenderScriptTests/tests_v11/res/drawable/test_pattern.png b/tests/RenderScriptTests/tests_v11/res/drawable/test_pattern.png
new file mode 100644
index 0000000..e7d1455
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/res/drawable/test_pattern.png
Binary files differ
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/RSTestCore.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/RSTestCore.java
new file mode 100644
index 0000000..888cfe4
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/RSTestCore.java
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2008 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.rs.test_v11;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+import android.util.Log;
+import java.util.ArrayList;
+import java.util.ListIterator;
+import java.util.Timer;
+import java.util.TimerTask;
+
+
+public class RSTestCore {
+ int mWidth;
+ int mHeight;
+ Context mCtx;
+
+ public RSTestCore(Context ctx) {
+ mCtx = ctx;
+ }
+
+ private Resources mRes;
+ private RenderScriptGL mRS;
+
+ private Font mFont;
+ ScriptField_ListAllocs_s mListAllocs;
+ int mLastX;
+ int mLastY;
+ private ScriptC_rslist mScript;
+
+ private ArrayList<UnitTest> unitTests;
+ private ListIterator<UnitTest> test_iter;
+ private UnitTest activeTest;
+ private boolean stopTesting;
+
+ /* Periodic timer for ensuring future tests get scheduled */
+ private Timer mTimer;
+ public static final int RS_TIMER_PERIOD = 100;
+
+ public void init(RenderScriptGL rs, Resources res, int width, int height) {
+ mRS = rs;
+ mRes = res;
+ mWidth = width;
+ mHeight = height;
+ stopTesting = false;
+
+ mScript = new ScriptC_rslist(mRS, mRes, R.raw.rslist);
+
+ unitTests = new ArrayList<UnitTest>();
+
+ unitTests.add(new UT_primitives(this, mRes, mCtx));
+ unitTests.add(new UT_rsdebug(this, mRes, mCtx));
+ unitTests.add(new UT_rstime(this, mRes, mCtx));
+ unitTests.add(new UT_rstypes(this, mRes, mCtx));
+ unitTests.add(new UT_math(this, mRes, mCtx));
+ unitTests.add(new UT_fp_mad(this, mRes, mCtx));
+ /*
+ unitTests.add(new UnitTest(null, "<Pass>", 1));
+ unitTests.add(new UnitTest());
+ unitTests.add(new UnitTest(null, "<Fail>", -1));
+
+ for (int i = 0; i < 20; i++) {
+ unitTests.add(new UnitTest(null, "<Pass>", 1));
+ }
+ */
+
+ UnitTest [] uta = new UnitTest[unitTests.size()];
+ uta = unitTests.toArray(uta);
+
+ mListAllocs = new ScriptField_ListAllocs_s(mRS, uta.length);
+ for (int i = 0; i < uta.length; i++) {
+ ScriptField_ListAllocs_s.Item listElem = new ScriptField_ListAllocs_s.Item();
+ listElem.text = Allocation.createFromString(mRS, uta[i].name, Allocation.USAGE_SCRIPT);
+ listElem.result = uta[i].result;
+ mListAllocs.set(listElem, i, false);
+ uta[i].setItem(listElem);
+ }
+
+ mListAllocs.copyAll();
+
+ mScript.bind_gList(mListAllocs);
+
+ mFont = Font.create(mRS, mRes, "serif", Font.Style.BOLD, 8);
+ mScript.set_gFont(mFont);
+
+ mRS.bindRootScript(mScript);
+
+ test_iter = unitTests.listIterator();
+ refreshTestResults(); /* Kick off the first test */
+
+ TimerTask pTask = new TimerTask() {
+ public void run() {
+ refreshTestResults();
+ }
+ };
+
+ mTimer = new Timer();
+ mTimer.schedule(pTask, RS_TIMER_PERIOD, RS_TIMER_PERIOD);
+ }
+
+ public void checkAndRunNextTest() {
+ if (activeTest != null) {
+ if (!activeTest.isAlive()) {
+ /* Properly clean up on our last test */
+ try {
+ activeTest.join();
+ }
+ catch (InterruptedException e) {
+ }
+ activeTest = null;
+ }
+ }
+
+ if (!stopTesting && activeTest == null) {
+ if (test_iter.hasNext()) {
+ activeTest = test_iter.next();
+ activeTest.start();
+ /* This routine will only get called once when a new test
+ * should start running. The message handler in UnitTest.java
+ * ensures this. */
+ }
+ else {
+ if (mTimer != null) {
+ mTimer.cancel();
+ mTimer.purge();
+ mTimer = null;
+ }
+ }
+ }
+ }
+
+ public void refreshTestResults() {
+ checkAndRunNextTest();
+
+ if (mListAllocs != null && mScript != null && mRS != null) {
+ mListAllocs.copyAll();
+
+ mScript.bind_gList(mListAllocs);
+ mRS.bindRootScript(mScript);
+ }
+ }
+
+ public void cleanup() {
+ stopTesting = true;
+ UnitTest t = activeTest;
+
+ /* Stop periodic refresh of testing */
+ if (mTimer != null) {
+ mTimer.cancel();
+ mTimer.purge();
+ mTimer = null;
+ }
+
+ /* Wait to exit until we finish the current test */
+ if (t != null) {
+ try {
+ t.join();
+ }
+ catch (InterruptedException e) {
+ }
+ t = null;
+ }
+
+ }
+
+ public void newTouchPosition(float x, float y, float pressure, int id) {
+ }
+
+ public void onActionDown(int x, int y) {
+ mScript.set_gDY(0.0f);
+ mLastX = x;
+ mLastY = y;
+ refreshTestResults();
+ }
+
+ public void onActionMove(int x, int y) {
+ int dx = mLastX - x;
+ int dy = mLastY - y;
+
+ if (Math.abs(dy) <= 2) {
+ dy = 0;
+ }
+
+ mScript.set_gDY(dy);
+
+ mLastX = x;
+ mLastY = y;
+ refreshTestResults();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/RSTestView.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/RSTestView.java
new file mode 100644
index 0000000..b5bebe9
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/RSTestView.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2008 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.rs.test_v11;
+
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.concurrent.Semaphore;
+
+import android.renderscript.RSSurfaceView;
+import android.renderscript.RenderScript;
+import android.renderscript.RenderScriptGL;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.os.Handler;
+import android.os.Message;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.Surface;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+
+public class RSTestView extends RSSurfaceView {
+
+ private Context mCtx;
+
+ public RSTestView(Context context) {
+ super(context);
+ mCtx = context;
+ //setFocusable(true);
+ }
+
+ private RenderScriptGL mRS;
+ private RSTestCore mRender;
+
+ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
+ super.surfaceChanged(holder, format, w, h);
+ if (mRS == null) {
+ RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
+ mRS = createRenderScriptGL(sc);
+ mRS.setSurface(holder, w, h);
+ mRender = new RSTestCore(mCtx);
+ mRender.init(mRS, getResources(), w, h);
+ }
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ if(mRS != null) {
+ mRender.cleanup();
+ mRS = null;
+ destroyRenderScriptGL();
+ }
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event)
+ {
+ return super.onKeyDown(keyCode, event);
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent ev)
+ {
+ boolean ret = false;
+ int act = ev.getAction();
+ if (act == ev.ACTION_DOWN) {
+ mRender.onActionDown((int)ev.getX(), (int)ev.getY());
+ ret = true;
+ }
+ else if (act == ev.ACTION_MOVE) {
+ mRender.onActionMove((int)ev.getX(), (int)ev.getY());
+ ret = true;
+ }
+
+ return ret;
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/RSTest_v11.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/RSTest_v11.java
new file mode 100644
index 0000000..1dedfce
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/RSTest_v11.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2008 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.rs.test_v11;
+
+import android.renderscript.RSSurfaceView;
+import android.renderscript.RenderScript;
+
+import android.app.Activity;
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.provider.Settings.System;
+import android.util.Config;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.Window;
+import android.widget.Button;
+import android.widget.ListView;
+
+import java.lang.Runtime;
+
+public class RSTest_v11 extends Activity {
+ //EventListener mListener = new EventListener();
+
+ private static final String LOG_TAG = "libRS_jni";
+ private static final boolean DEBUG = false;
+ private static final boolean LOG_ENABLED = DEBUG ? Config.LOGD : Config.LOGV;
+
+ private RSTestView mView;
+
+ // get the current looper (from your Activity UI thread for instance
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ // Create our Preview view and set it as the content of our
+ // Activity
+ mView = new RSTestView(this);
+ setContentView(mView);
+ }
+
+ @Override
+ protected void onResume() {
+ // Ideally a game should implement onResume() and onPause()
+ // to take appropriate action when the activity loses focus
+ super.onResume();
+ mView.resume();
+ }
+
+ @Override
+ protected void onPause() {
+ // Ideally a game should implement onResume() and onPause()
+ // to take appropriate action when the activity loses focus
+ super.onPause();
+ mView.pause();
+ }
+
+ static void log(String message) {
+ if (LOG_ENABLED) {
+ Log.v(LOG_TAG, message);
+ }
+ }
+
+
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_fp_mad.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_fp_mad.java
new file mode 100644
index 0000000..5d72aa6
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_fp_mad.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v11;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_fp_mad extends UnitTest {
+ private Resources mRes;
+
+ protected UT_fp_mad(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "Fp_Mad", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_fp_mad s = new ScriptC_fp_mad(pRS, mRes, R.raw.fp_mad);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_fp_mad_test(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_math.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_math.java
new file mode 100644
index 0000000..7e356f8
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_math.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v11;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_math extends UnitTest {
+ private Resources mRes;
+
+ protected UT_math(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "Math", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_math s = new ScriptC_math(pRS, mRes, R.raw.math);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_math_test(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_primitives.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_primitives.java
new file mode 100644
index 0000000..dc3efbc
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_primitives.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v11;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_primitives extends UnitTest {
+ private Resources mRes;
+
+ protected UT_primitives(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "Primitives", ctx);
+ mRes = res;
+ }
+
+ private boolean initializeGlobals(ScriptC_primitives s) {
+ float pF = s.get_floatTest();
+ if (pF != 1.99f) {
+ return false;
+ }
+ s.set_floatTest(2.99f);
+
+ double pD = s.get_doubleTest();
+ if (pD != 2.05) {
+ return false;
+ }
+ s.set_doubleTest(3.05);
+
+ byte pC = s.get_charTest();
+ if (pC != -8) {
+ return false;
+ }
+ s.set_charTest((byte)-16);
+
+ short pS = s.get_shortTest();
+ if (pS != -16) {
+ return false;
+ }
+ s.set_shortTest((short)-32);
+
+ int pI = s.get_intTest();
+ if (pI != -32) {
+ return false;
+ }
+ s.set_intTest(-64);
+
+ long pL = s.get_longTest();
+ if (pL != 17179869184l) {
+ return false;
+ }
+ s.set_longTest(17179869185l);
+
+ long puL = s.get_ulongTest();
+ if (puL != 4611686018427387904L) {
+ return false;
+ }
+ s.set_ulongTest(4611686018427387903L);
+
+
+ long pLL = s.get_longlongTest();
+ if (pLL != 68719476736L) {
+ return false;
+ }
+ s.set_longlongTest(68719476735L);
+
+ long pu64 = s.get_uint64_tTest();
+ if (pu64 != 117179869184l) {
+ return false;
+ }
+ s.set_uint64_tTest(117179869185l);
+
+ return true;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_primitives s = new ScriptC_primitives(pRS, mRes, R.raw.primitives);
+ pRS.setMessageHandler(mRsMessage);
+ if (!initializeGlobals(s)) {
+ // initializeGlobals failed
+ result = -1;
+ } else {
+ s.invoke_primitives_test(0, 0);
+ pRS.finish();
+ waitForMessage();
+ }
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_rsdebug.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_rsdebug.java
new file mode 100644
index 0000000..00dbaf5
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_rsdebug.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v11;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_rsdebug extends UnitTest {
+ private Resources mRes;
+
+ protected UT_rsdebug(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "rsDebug", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_rsdebug s = new ScriptC_rsdebug(pRS, mRes, R.raw.rsdebug);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_test_rsdebug(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_rstime.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_rstime.java
new file mode 100644
index 0000000..5b4c399
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_rstime.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v11;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_rstime extends UnitTest {
+ private Resources mRes;
+
+ protected UT_rstime(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "rsTime", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_rstime s = new ScriptC_rstime(pRS, mRes, R.raw.rstime);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_test_rstime(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_rstypes.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_rstypes.java
new file mode 100644
index 0000000..72a97c9
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UT_rstypes.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v11;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_rstypes extends UnitTest {
+ private Resources mRes;
+
+ protected UT_rstypes(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "rsTypes", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_rstypes s = new ScriptC_rstypes(pRS, mRes, R.raw.rstypes);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_test_rstypes(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UnitTest.java b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UnitTest.java
new file mode 100644
index 0000000..b62e535
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/UnitTest.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v11;
+import android.content.Context;
+import android.renderscript.RenderScript.RSMessageHandler;
+import android.util.Log;
+
+public class UnitTest extends Thread {
+ public String name;
+ public int result;
+ private ScriptField_ListAllocs_s.Item mItem;
+ private RSTestCore mRSTC;
+ private boolean msgHandled;
+ protected Context mCtx;
+
+ /* These constants must match those in shared.rsh */
+ public static final int RS_MSG_TEST_PASSED = 100;
+ public static final int RS_MSG_TEST_FAILED = 101;
+
+ private static int numTests = 0;
+ public int testID;
+
+ protected UnitTest(RSTestCore rstc, String n, int initResult, Context ctx) {
+ super();
+ mRSTC = rstc;
+ name = n;
+ msgHandled = false;
+ mCtx = ctx;
+ result = initResult;
+ testID = numTests++;
+ }
+
+ protected UnitTest(RSTestCore rstc, String n, Context ctx) {
+ this(rstc, n, 0, ctx);
+ }
+
+ protected UnitTest(RSTestCore rstc, Context ctx) {
+ this (rstc, "<Unknown>", ctx);
+ }
+
+ protected UnitTest(Context ctx) {
+ this (null, ctx);
+ }
+
+ protected RSMessageHandler mRsMessage = new RSMessageHandler() {
+ public void run() {
+ if (result == 0) {
+ switch (mID) {
+ case RS_MSG_TEST_PASSED:
+ result = 1;
+ break;
+ case RS_MSG_TEST_FAILED:
+ result = -1;
+ break;
+ default:
+ android.util.Log.v("RenderScript", "Unit test got unexpected message");
+ return;
+ }
+ }
+
+ if (mItem != null) {
+ mItem.result = result;
+ msgHandled = true;
+ try {
+ mRSTC.refreshTestResults();
+ }
+ catch (IllegalStateException e) {
+ /* Ignore the case where our message receiver has been
+ disconnected. This happens when we leave the application
+ before it finishes running all of the unit tests. */
+ }
+ }
+ }
+ };
+
+ public void waitForMessage() {
+ while (!msgHandled) {
+ yield();
+ }
+ }
+
+ public void setItem(ScriptField_ListAllocs_s.Item item) {
+ mItem = item;
+ }
+
+ public void run() {
+ /* This method needs to be implemented for each subclass */
+ if (mRSTC != null) {
+ mRSTC.refreshTestResults();
+ }
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/fp_mad.rs b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/fp_mad.rs
new file mode 100644
index 0000000..b6f2b2a6
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/fp_mad.rs
@@ -0,0 +1,174 @@
+#include "shared.rsh"
+
+const int TEST_COUNT = 1;
+
+static float data_f1[1025];
+static float4 data_f4[1025];
+
+static void test_mad4(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~1 billion ops
+ for (int ct=0; ct < 1000 * (1000 / 80); ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f4[i] = (data_f4[i] * 0.02f +
+ data_f4[i+1] * 0.04f +
+ data_f4[i+2] * 0.05f +
+ data_f4[i+3] * 0.1f +
+ data_f4[i+4] * 0.2f +
+ data_f4[i+5] * 0.2f +
+ data_f4[i+6] * 0.1f +
+ data_f4[i+7] * 0.05f +
+ data_f4[i+8] * 0.04f +
+ data_f4[i+9] * 0.02f + 1.f);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_mad4 M ops", 1000.f / time);
+}
+
+static void test_mad(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~1 billion ops
+ for (int ct=0; ct < 1000 * (1000 / 20); ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f1[i] = (data_f1[i] * 0.02f +
+ data_f1[i+1] * 0.04f +
+ data_f1[i+2] * 0.05f +
+ data_f1[i+3] * 0.1f +
+ data_f1[i+4] * 0.2f +
+ data_f1[i+5] * 0.2f +
+ data_f1[i+6] * 0.1f +
+ data_f1[i+7] * 0.05f +
+ data_f1[i+8] * 0.04f +
+ data_f1[i+9] * 0.02f + 1.f);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_mad M ops", 1000.f / time);
+}
+
+static void test_norm(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~10 M ops
+ for (int ct=0; ct < 1000 * 10; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f4[i] = normalize(data_f4[i]);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_norm M ops", 10.f / time);
+}
+
+static void test_sincos4(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~10 M ops
+ for (int ct=0; ct < 1000 * 10 / 4; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f4[i] = sin(data_f4[i]) * cos(data_f4[i]);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_sincos4 M ops", 10.f / time);
+}
+
+static void test_sincos(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~10 M ops
+ for (int ct=0; ct < 1000 * 10; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f1[i] = sin(data_f1[i]) * cos(data_f1[i]);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_sincos M ops", 10.f / time);
+}
+
+static void test_clamp(uint32_t index) {
+ start();
+
+ // Do ~100 M ops
+ for (int ct=0; ct < 1000 * 100; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f1[i] = clamp(data_f1[i], -1.f, 1.f);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_clamp M ops", 100.f / time);
+
+ start();
+ // Do ~100 M ops
+ for (int ct=0; ct < 1000 * 100; ct++) {
+ for (int i=0; i < (1000); i++) {
+ if (data_f1[i] < -1.f) data_f1[i] = -1.f;
+ if (data_f1[i] > -1.f) data_f1[i] = 1.f;
+ }
+ }
+
+ time = end(index);
+ rsDebug("fp_clamp ref M ops", 100.f / time);
+}
+
+static void test_clamp4(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~100 M ops
+ for (int ct=0; ct < 1000 * 100 /4; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f4[i] = clamp(data_f4[i], -1.f, 1.f);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_clamp4 M ops", 100.f / time);
+}
+
+void fp_mad_test(uint32_t index, int test_num) {
+ int x;
+ for (x=0; x < 1025; x++) {
+ data_f1[x] = (x & 0xf) * 0.1f;
+ data_f4[x].x = (x & 0xf) * 0.1f;
+ data_f4[x].y = (x & 0xf0) * 0.1f;
+ data_f4[x].z = (x & 0x33) * 0.1f;
+ data_f4[x].w = (x & 0x77) * 0.1f;
+ }
+
+ test_mad4(index);
+ test_mad(index);
+
+ for (x=0; x < 1025; x++) {
+ data_f1[x] = (x & 0xf) * 0.1f + 1.f;
+ data_f4[x].x = (x & 0xf) * 0.1f + 1.f;
+ data_f4[x].y = (x & 0xf0) * 0.1f + 1.f;
+ data_f4[x].z = (x & 0x33) * 0.1f + 1.f;
+ data_f4[x].w = (x & 0x77) * 0.1f + 1.f;
+ }
+
+ test_norm(index);
+ test_sincos4(index);
+ test_sincos(index);
+ test_clamp4(index);
+ test_clamp(index);
+
+ // TODO Actually verify test result accuracy
+ rsDebug("fp_mad_test PASSED", 0);
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+}
+
+
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/math.rs b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/math.rs
new file mode 100644
index 0000000..2867be1
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/math.rs
@@ -0,0 +1,348 @@
+#include "shared.rsh"
+
+// Testing math library
+
+volatile float f1;
+volatile float2 f2;
+volatile float3 f3;
+volatile float4 f4;
+
+volatile int i1;
+volatile int2 i2;
+volatile int3 i3;
+volatile int4 i4;
+
+volatile uint ui1;
+volatile uint2 ui2;
+volatile uint3 ui3;
+volatile uint4 ui4;
+
+volatile short s1;
+volatile short2 s2;
+volatile short3 s3;
+volatile short4 s4;
+
+volatile ushort us1;
+volatile ushort2 us2;
+volatile ushort3 us3;
+volatile ushort4 us4;
+
+volatile char c1;
+volatile char2 c2;
+volatile char3 c3;
+volatile char4 c4;
+
+volatile uchar uc1;
+volatile uchar2 uc2;
+volatile uchar3 uc3;
+volatile uchar4 uc4;
+
+#define TEST_FN_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1); \
+ f2 = fnc(f2); \
+ f3 = fnc(f3); \
+ f4 = fnc(f4);
+
+#define TEST_FN_FUNC_FN_PFN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, (float*) &f1); \
+ f2 = fnc(f2, (float2*) &f2); \
+ f3 = fnc(f3, (float3*) &f3); \
+ f4 = fnc(f4, (float4*) &f4);
+
+#define TEST_FN_FUNC_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f2 = fnc(f2, f2); \
+ f3 = fnc(f3, f3); \
+ f4 = fnc(f4, f4);
+
+#define TEST_FN_FUNC_FN_F(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f2 = fnc(f2, f1); \
+ f3 = fnc(f3, f1); \
+ f4 = fnc(f4, f1);
+
+#define TEST_FN_FUNC_FN_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, i1); \
+ f2 = fnc(f2, i2); \
+ f3 = fnc(f3, i3); \
+ f4 = fnc(f4, i4);
+
+#define TEST_FN_FUNC_FN_I(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, i1); \
+ f2 = fnc(f2, i1); \
+ f3 = fnc(f3, i1); \
+ f4 = fnc(f4, i1);
+
+#define TEST_FN_FUNC_FN_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, f1); \
+ f2 = fnc(f2, f2, f2); \
+ f3 = fnc(f3, f3, f3); \
+ f4 = fnc(f4, f4, f4);
+
+#define TEST_FN_FUNC_FN_PIN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, (int*) &i1); \
+ f2 = fnc(f2, (int2*) &i2); \
+ f3 = fnc(f3, (int3*) &i3); \
+ f4 = fnc(f4, (int4*) &i4);
+
+#define TEST_FN_FUNC_FN_FN_PIN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, (int*) &i1); \
+ f2 = fnc(f2, f2, (int2*) &i2); \
+ f3 = fnc(f3, f3, (int3*) &i3); \
+ f4 = fnc(f4, f4, (int4*) &i4);
+
+#define TEST_IN_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ i1 = fnc(f1); \
+ i2 = fnc(f2); \
+ i3 = fnc(f3); \
+ i4 = fnc(f4);
+
+
+static bool test_fp_math(uint32_t index) {
+ bool failed = false;
+ start();
+
+ TEST_FN_FUNC_FN(acos);
+ TEST_FN_FUNC_FN(acosh);
+ TEST_FN_FUNC_FN(acospi);
+ TEST_FN_FUNC_FN(asin);
+ TEST_FN_FUNC_FN(asinh);
+ TEST_FN_FUNC_FN(asinpi);
+ TEST_FN_FUNC_FN(atan);
+ TEST_FN_FUNC_FN_FN(atan2);
+ TEST_FN_FUNC_FN(atanh);
+ TEST_FN_FUNC_FN(atanpi);
+ TEST_FN_FUNC_FN_FN(atan2pi);
+ TEST_FN_FUNC_FN(cbrt);
+ TEST_FN_FUNC_FN(ceil);
+ TEST_FN_FUNC_FN_FN(copysign);
+ TEST_FN_FUNC_FN(cos);
+ TEST_FN_FUNC_FN(cosh);
+ TEST_FN_FUNC_FN(cospi);
+ TEST_FN_FUNC_FN(erfc);
+ TEST_FN_FUNC_FN(erf);
+ TEST_FN_FUNC_FN(exp);
+ TEST_FN_FUNC_FN(exp2);
+ TEST_FN_FUNC_FN(exp10);
+ TEST_FN_FUNC_FN(expm1);
+ TEST_FN_FUNC_FN(fabs);
+ TEST_FN_FUNC_FN_FN(fdim);
+ TEST_FN_FUNC_FN(floor);
+ TEST_FN_FUNC_FN_FN_FN(fma);
+ TEST_FN_FUNC_FN_FN(fmax);
+ TEST_FN_FUNC_FN_F(fmax);
+ TEST_FN_FUNC_FN_FN(fmin);
+ TEST_FN_FUNC_FN_F(fmin);
+ TEST_FN_FUNC_FN_FN(fmod);
+ TEST_FN_FUNC_FN_PFN(fract);
+ TEST_FN_FUNC_FN_PIN(frexp);
+ TEST_FN_FUNC_FN_FN(hypot);
+ TEST_IN_FUNC_FN(ilogb);
+ TEST_FN_FUNC_FN_IN(ldexp);
+ TEST_FN_FUNC_FN_I(ldexp);
+ TEST_FN_FUNC_FN(lgamma);
+ TEST_FN_FUNC_FN_PIN(lgamma);
+ TEST_FN_FUNC_FN(log);
+ TEST_FN_FUNC_FN(log2);
+ TEST_FN_FUNC_FN(log10);
+ TEST_FN_FUNC_FN(log1p);
+ TEST_FN_FUNC_FN(logb);
+ TEST_FN_FUNC_FN_FN_FN(mad);
+ TEST_FN_FUNC_FN_PFN(modf);
+ // nan
+ TEST_FN_FUNC_FN_FN(nextafter);
+ TEST_FN_FUNC_FN_FN(pow);
+ TEST_FN_FUNC_FN_IN(pown);
+ TEST_FN_FUNC_FN_FN(powr);
+ TEST_FN_FUNC_FN_FN(remainder);
+ TEST_FN_FUNC_FN_FN_PIN(remquo);
+ TEST_FN_FUNC_FN(rint);
+ TEST_FN_FUNC_FN_IN(rootn);
+ TEST_FN_FUNC_FN(round);
+ TEST_FN_FUNC_FN(rsqrt);
+ TEST_FN_FUNC_FN(sin);
+ TEST_FN_FUNC_FN_PFN(sincos);
+ TEST_FN_FUNC_FN(sinh);
+ TEST_FN_FUNC_FN(sinpi);
+ TEST_FN_FUNC_FN(sqrt);
+ TEST_FN_FUNC_FN(tan);
+ TEST_FN_FUNC_FN(tanh);
+ TEST_FN_FUNC_FN(tanpi);
+ TEST_FN_FUNC_FN(tgamma);
+ TEST_FN_FUNC_FN(trunc);
+
+ float time = end(index);
+
+ if (failed) {
+ rsDebug("test_fp_math FAILED", time);
+ }
+ else {
+ rsDebug("test_fp_math PASSED", time);
+ }
+
+ return failed;
+}
+
+#define DECL_INT(prefix) \
+volatile char prefix##_c_1 = 1; \
+volatile char2 prefix##_c_2 = 1; \
+volatile char3 prefix##_c_3 = 1; \
+volatile char4 prefix##_c_4 = 1; \
+volatile uchar prefix##_uc_1 = 1; \
+volatile uchar2 prefix##_uc_2 = 1; \
+volatile uchar3 prefix##_uc_3 = 1; \
+volatile uchar4 prefix##_uc_4 = 1; \
+volatile short prefix##_s_1 = 1; \
+volatile short2 prefix##_s_2 = 1; \
+volatile short3 prefix##_s_3 = 1; \
+volatile short4 prefix##_s_4 = 1; \
+volatile ushort prefix##_us_1 = 1; \
+volatile ushort2 prefix##_us_2 = 1; \
+volatile ushort3 prefix##_us_3 = 1; \
+volatile ushort4 prefix##_us_4 = 1; \
+volatile int prefix##_i_1 = 1; \
+volatile int2 prefix##_i_2 = 1; \
+volatile int3 prefix##_i_3 = 1; \
+volatile int4 prefix##_i_4 = 1; \
+volatile uint prefix##_ui_1 = 1; \
+volatile uint2 prefix##_ui_2 = 1; \
+volatile uint3 prefix##_ui_3 = 1; \
+volatile uint4 prefix##_ui_4 = 1; \
+volatile long prefix##_l_1 = 1; \
+volatile ulong prefix##_ul_1 = 1;
+
+#define TEST_INT_OP_TYPE(op, type) \
+rsDebug("Testing " #op " for " #type "1", i++); \
+res_##type##_1 = src1_##type##_1 op src2_##type##_1; \
+rsDebug("Testing " #op " for " #type "2", i++); \
+res_##type##_2 = src1_##type##_2 op src2_##type##_2; \
+rsDebug("Testing " #op " for " #type "3", i++); \
+res_##type##_3 = src1_##type##_3 op src2_##type##_3; \
+rsDebug("Testing " #op " for " #type "4", i++); \
+res_##type##_4 = src1_##type##_4 op src2_##type##_4;
+
+#define TEST_INT_OP(op) \
+TEST_INT_OP_TYPE(op, c) \
+TEST_INT_OP_TYPE(op, uc) \
+TEST_INT_OP_TYPE(op, s) \
+TEST_INT_OP_TYPE(op, us) \
+TEST_INT_OP_TYPE(op, i) \
+TEST_INT_OP_TYPE(op, ui) \
+rsDebug("Testing " #op " for l1", i++); \
+res_l_1 = src1_l_1 op src2_l_1; \
+rsDebug("Testing " #op " for ul1", i++); \
+res_ul_1 = src1_ul_1 op src2_ul_1;
+
+DECL_INT(res)
+DECL_INT(src1)
+DECL_INT(src2)
+
+static bool test_basic_operators() {
+ bool failed = false;
+ int i = 0;
+
+ TEST_INT_OP(+);
+ TEST_INT_OP(-);
+ TEST_INT_OP(*);
+ TEST_INT_OP(/);
+ TEST_INT_OP(%);
+ TEST_INT_OP(<<);
+ TEST_INT_OP(>>);
+
+ if (failed) {
+ rsDebug("test_basic_operators FAILED", 0);
+ }
+ else {
+ rsDebug("test_basic_operators PASSED", 0);
+ }
+
+ return failed;
+}
+
+#define TEST_CVT(to, from, type) \
+rsDebug("Testing convert from " #from " to " #to, 0); \
+to##1 = from##1; \
+to##2 = convert_##type##2(from##2); \
+to##3 = convert_##type##3(from##3); \
+to##4 = convert_##type##4(from##4);
+
+#define TEST_CVT_MATRIX(to, type) \
+TEST_CVT(to, c, type); \
+TEST_CVT(to, uc, type); \
+TEST_CVT(to, s, type); \
+TEST_CVT(to, us, type); \
+TEST_CVT(to, i, type); \
+TEST_CVT(to, ui, type); \
+TEST_CVT(to, f, type); \
+
+static bool test_convert() {
+ bool failed = false;
+
+ TEST_CVT_MATRIX(c, char);
+ TEST_CVT_MATRIX(uc, uchar);
+ TEST_CVT_MATRIX(s, short);
+ TEST_CVT_MATRIX(us, ushort);
+ TEST_CVT_MATRIX(i, int);
+ TEST_CVT_MATRIX(ui, uint);
+ TEST_CVT_MATRIX(f, float);
+
+ if (failed) {
+ rsDebug("test_convert FAILED", 0);
+ }
+ else {
+ rsDebug("test_convert PASSED", 0);
+ }
+
+ return failed;
+}
+
+#define INIT_PREFIX_TYPE(prefix, type) \
+prefix##_##type##_1 = 1; \
+prefix##_##type##_2.x = 1; \
+prefix##_##type##_2.y = 1; \
+prefix##_##type##_3.x = 1; \
+prefix##_##type##_3.y = 1; \
+prefix##_##type##_3.z = 1; \
+prefix##_##type##_4.x = 1; \
+prefix##_##type##_4.y = 1; \
+prefix##_##type##_4.z = 1; \
+prefix##_##type##_4.w = 1;
+
+#define INIT_TYPE(type) \
+INIT_PREFIX_TYPE(src1, type) \
+INIT_PREFIX_TYPE(src2, type) \
+INIT_PREFIX_TYPE(res, type)
+
+#define INIT_ALL \
+INIT_TYPE(c); \
+INIT_TYPE(uc); \
+INIT_TYPE(s); \
+INIT_TYPE(us); \
+INIT_TYPE(i); \
+INIT_TYPE(ui);
+
+void math_test(uint32_t index, int test_num) {
+ bool failed = false;
+ INIT_ALL;
+ failed |= test_convert();
+ failed |= test_fp_math(index);
+ failed |= test_basic_operators();
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/primitives.rs b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/primitives.rs
new file mode 100644
index 0000000..ce451da
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/primitives.rs
@@ -0,0 +1,61 @@
+#include "shared.rsh"
+
+// Testing primitive types
+float floatTest = 1.99f;
+double doubleTest = 2.05;
+char charTest = -8;
+short shortTest = -16;
+int intTest = -32;
+long longTest = 17179869184l; // 1 << 34
+long long longlongTest = 68719476736l; // 1 << 36
+
+uchar ucharTest = 8;
+ushort ushortTest = 16;
+uint uintTest = 32;
+ulong ulongTest = 4611686018427387904L;
+int64_t int64_tTest = -17179869184l; // - 1 << 34
+uint64_t uint64_tTest = 117179869184l;
+
+static bool test_primitive_types(uint32_t index) {
+ bool failed = false;
+ start();
+
+ _RS_ASSERT(floatTest == 2.99f);
+ _RS_ASSERT(doubleTest == 3.05);
+ _RS_ASSERT(charTest == -16);
+ _RS_ASSERT(shortTest == -32);
+ _RS_ASSERT(intTest == -64);
+ _RS_ASSERT(longTest == 17179869185l);
+ _RS_ASSERT(longlongTest == 68719476735l);
+
+ _RS_ASSERT(ucharTest == 8);
+ _RS_ASSERT(ushortTest == 16);
+ _RS_ASSERT(uintTest == 32);
+ _RS_ASSERT(ulongTest == 4611686018427387903L);
+ _RS_ASSERT(int64_tTest == -17179869184l);
+ _RS_ASSERT(uint64_tTest == 117179869185l);
+
+ float time = end(index);
+
+ if (failed) {
+ rsDebug("test_primitives FAILED", time);
+ }
+ else {
+ rsDebug("test_primitives PASSED", time);
+ }
+
+ return failed;
+}
+
+void primitives_test(uint32_t index, int test_num) {
+ bool failed = false;
+ failed |= test_primitive_types(index);
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rsdebug.rs b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rsdebug.rs
new file mode 100644
index 0000000..f7942a5
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rsdebug.rs
@@ -0,0 +1,56 @@
+#include "shared.rsh"
+
+// Testing primitive types
+float floatTest = 1.99f;
+double doubleTest = 2.05;
+char charTest = -8;
+short shortTest = -16;
+int intTest = -32;
+long longTest = 17179869184l; // 1 << 34
+long long longlongTest = 68719476736l; // 1 << 36
+
+uchar ucharTest = 8;
+ushort ushortTest = 16;
+uint uintTest = 32;
+ulong ulongTest = 4611686018427387904L;
+int64_t int64_tTest = -17179869184l; // - 1 << 34
+uint64_t uint64_tTest = 117179869184l;
+
+static bool basic_test(uint32_t index) {
+ bool failed = false;
+
+ // This test focuses primarily on compilation-time, not run-time.
+ // For this reason, none of the outputs are actually checked.
+
+ rsDebug("floatTest", floatTest);
+ rsDebug("doubleTest", doubleTest);
+ rsDebug("charTest", charTest);
+ rsDebug("shortTest", shortTest);
+ rsDebug("intTest", intTest);
+ rsDebug("longTest", longTest);
+ rsDebug("longlongTest", longlongTest);
+
+ rsDebug("ucharTest", ucharTest);
+ rsDebug("ushortTest", ushortTest);
+ rsDebug("uintTest", uintTest);
+ rsDebug("ulongTest", ulongTest);
+ rsDebug("int64_tTest", int64_tTest);
+ rsDebug("uint64_tTest", uint64_tTest);
+
+ return failed;
+}
+
+void test_rsdebug(uint32_t index, int test_num) {
+ bool failed = false;
+ failed |= basic_test(index);
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ rsDebug("rsdebug_test FAILED", -1);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ rsDebug("rsdebug_test PASSED", 0);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rslist.rs b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rslist.rs
new file mode 100644
index 0000000..5b2501f
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rslist.rs
@@ -0,0 +1,107 @@
+// Copyright (C) 2009 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.
+
+#pragma version(1)
+
+#pragma rs java_package_name(com.android.rs.test_v11)
+
+#include "rs_graphics.rsh"
+
+float gDY;
+
+rs_font gFont;
+
+typedef struct ListAllocs_s {
+ rs_allocation text;
+ int result;
+} ListAllocs;
+
+ListAllocs *gList;
+
+void init() {
+ gDY = 0.0f;
+}
+
+int textPos = 0;
+
+int root(int launchID) {
+
+ rsgClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ rsgClearDepth(1.0f);
+
+ textPos -= (int)gDY*2;
+ gDY *= 0.95;
+
+ rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f);
+ rsgBindFont(gFont);
+
+ rs_allocation listAlloc;
+ rsSetObject(&listAlloc, rsGetAllocation(gList));
+ int allocSize = rsAllocationGetDimX(listAlloc);
+
+ int width = rsgGetWidth();
+ int height = rsgGetHeight();
+
+ int itemHeight = 80;
+ int totalItemHeight = itemHeight * allocSize;
+
+ /* Prevent scrolling above the top of the list */
+ int firstItem = height - totalItemHeight;
+ if (firstItem < 0) {
+ firstItem = 0;
+ }
+
+ /* Prevent scrolling past the last line of the list */
+ int lastItem = -1 * (totalItemHeight - height);
+ if (lastItem > 0) {
+ lastItem = 0;
+ }
+
+ if (textPos > firstItem) {
+ textPos = firstItem;
+ }
+ else if (textPos < lastItem) {
+ textPos = lastItem;
+ }
+
+ int currentYPos = itemHeight + textPos;
+
+ for(int i = 0; i < allocSize; i ++) {
+ if(currentYPos - itemHeight > height) {
+ break;
+ }
+
+ if(currentYPos > 0) {
+ switch(gList[i].result) {
+ case 1: /* Passed */
+ rsgFontColor(0.5f, 0.9f, 0.5f, 1.0f);
+ break;
+ case -1: /* Failed */
+ rsgFontColor(0.9f, 0.5f, 0.5f, 1.0f);
+ break;
+ case 0: /* Still Testing */
+ rsgFontColor(0.9f, 0.9f, 0.5f, 1.0f);
+ break;
+ default: /* Unknown */
+ rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f);
+ break;
+ }
+ rsgDrawRect(0, currentYPos - 1, width, currentYPos, 0);
+ rsgDrawText(gList[i].text, 30, currentYPos - 32);
+ }
+ currentYPos += itemHeight;
+ }
+
+ return 10;
+}
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rstime.rs b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rstime.rs
new file mode 100644
index 0000000..5e3e078
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rstime.rs
@@ -0,0 +1,52 @@
+#include "shared.rsh"
+
+static bool basic_test(uint32_t index) {
+ bool failed = false;
+
+ rs_time_t curTime = rsTime(0);
+ rs_tm tm;
+ rsDebug("curTime", curTime);
+
+ rsLocaltime(&tm, &curTime);
+
+ rsDebug("tm.tm_sec", tm.tm_sec);
+ rsDebug("tm.tm_min", tm.tm_min);
+ rsDebug("tm.tm_hour", tm.tm_hour);
+ rsDebug("tm.tm_mday", tm.tm_mday);
+ rsDebug("tm.tm_mon", tm.tm_mon);
+ rsDebug("tm.tm_year", tm.tm_year);
+ rsDebug("tm.tm_wday", tm.tm_wday);
+ rsDebug("tm.tm_yday", tm.tm_yday);
+ rsDebug("tm.tm_isdst", tm.tm_isdst);
+
+ // Test a specific time (only valid for PST localtime)
+ curTime = 1294438893;
+ rsLocaltime(&tm, &curTime);
+
+ _RS_ASSERT(tm.tm_sec == 33);
+ _RS_ASSERT(tm.tm_min == 21);
+ _RS_ASSERT(tm.tm_hour == 14);
+ _RS_ASSERT(tm.tm_mday == 7);
+ _RS_ASSERT(tm.tm_mon == 0);
+ _RS_ASSERT(tm.tm_year == 111);
+ _RS_ASSERT(tm.tm_wday == 5);
+ _RS_ASSERT(tm.tm_yday == 6);
+ _RS_ASSERT(tm.tm_isdst == 0);
+
+ return failed;
+}
+
+void test_rstime(uint32_t index, int test_num) {
+ bool failed = false;
+ failed |= basic_test(index);
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ rsDebug("rstime_test FAILED", -1);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ rsDebug("rstime_test PASSED", 0);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rstypes.rs b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rstypes.rs
new file mode 100644
index 0000000..f3bf244
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/rstypes.rs
@@ -0,0 +1,79 @@
+#include "shared.rsh"
+#include "rs_graphics.rsh"
+
+rs_element elementTest;
+rs_type typeTest;
+rs_allocation allocationTest;
+rs_sampler samplerTest;
+rs_script scriptTest;
+rs_mesh meshTest;
+rs_program_fragment program_fragmentTest;
+rs_program_vertex program_vertexTest;
+rs_program_raster program_rasterTest;
+rs_program_store program_storeTest;
+rs_font fontTest;
+
+rs_matrix4x4 matrix4x4Test;
+rs_matrix3x3 matrix3x3Test;
+rs_matrix2x2 matrix2x2Test;
+
+struct my_struct {
+ int i;
+ rs_font fontTestStruct;
+};
+
+static bool basic_test(uint32_t index) {
+ bool failed = false;
+
+ rs_matrix4x4 matrix4x4TestLocal;
+ rs_matrix3x3 matrix3x3TestLocal;
+ rs_matrix2x2 matrix2x2TestLocal;
+
+ // This test focuses primarily on compilation-time, not run-time.
+ rs_element elementTestLocal;
+ rs_type typeTestLocal;
+ rs_allocation allocationTestLocal;
+ rs_sampler samplerTestLocal;
+ rs_script scriptTestLocal;
+ rs_mesh meshTestLocal;
+ rs_program_fragment program_fragmentTestLocal;
+ rs_program_vertex program_vertexTestLocal;
+ rs_program_raster program_rasterTestLocal;
+ rs_program_store program_storeTestLocal;
+ rs_font fontTestLocal;
+
+ rs_font fontTestLocalArray[4];
+
+ rs_font fontTestLocalPreInit = fontTest;
+
+ struct my_struct structTest;
+
+ rsSetObject(&fontTestLocal, fontTest);
+ //allocationTestLocal = allocationTest;
+
+ rsSetObject(&fontTest, fontTestLocal);
+ //allocationTest = allocationTestLocal;
+
+ /*for (int i = 0; i < 4; i++) {
+ rsSetObject(&fontTestLocalArray[i], fontTestLocal);
+ }*/
+
+ /*rsSetObject(&fontTest, fontTestLocalArray[3]);*/
+
+ return failed;
+}
+
+void test_rstypes(uint32_t index, int test_num) {
+ bool failed = false;
+ failed |= basic_test(index);
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ rsDebug("rstypes_test FAILED", -1);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ rsDebug("rstypes_test PASSED", 0);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/shared.rsh b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/shared.rsh
new file mode 100644
index 0000000..6d34481
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/shared.rsh
@@ -0,0 +1,38 @@
+#pragma version(1)
+
+#pragma rs java_package_name(com.android.rs.test_v11)
+
+typedef struct TestResult_s {
+ rs_allocation name;
+ bool pass;
+ float score;
+ int64_t time;
+} TestResult;
+//TestResult *g_results;
+
+static int64_t g_time;
+
+static void start(void) {
+ g_time = rsUptimeMillis();
+}
+
+static float end(uint32_t idx) {
+ int64_t t = rsUptimeMillis() - g_time;
+ //g_results[idx].time = t;
+ //rsDebug("test time", (int)t);
+ return ((float)t) / 1000.f;
+}
+
+#define _RS_ASSERT(b) \
+do { \
+ if (!(b)) { \
+ failed = true; \
+ rsDebug(#b " FAILED", 0); \
+ } \
+\
+} while (0)
+
+/* These constants must match those in UnitTest.java */
+static const int RS_MSG_TEST_PASSED = 100;
+static const int RS_MSG_TEST_FAILED = 101;
+
diff --git a/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/test_root.rs b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/test_root.rs
new file mode 100644
index 0000000..6dc83ba
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v11/src/com/android/rs/test/test_root.rs
@@ -0,0 +1,23 @@
+// Fountain test script
+#pragma version(1)
+
+#pragma rs java_package_name(com.android.rs.test)
+
+#pragma stateFragment(parent)
+
+#include "rs_graphics.rsh"
+
+
+typedef struct TestResult {
+ rs_allocation name;
+ bool pass;
+ float score;
+} TestResult_t;
+TestResult_t *results;
+
+int root() {
+
+ return 0;
+}
+
+
diff --git a/tests/RenderScriptTests/tests_v14/Android.mk b/tests/RenderScriptTests/tests_v14/Android.mk
new file mode 100644
index 0000000..c4c3a37
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/Android.mk
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2008 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
+
+LOCAL_PACKAGE_NAME := RSTest_v14
+LOCAL_SDK_VERSION := 14
+
+include $(BUILD_PACKAGE)
diff --git a/tests/RenderScriptTests/tests_v14/AndroidManifest.xml b/tests/RenderScriptTests/tests_v14/AndroidManifest.xml
new file mode 100644
index 0000000..1cd9bbd
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/AndroidManifest.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.rs.test_v14">
+ <uses-sdk android:minSdkVersion="14" />
+ <application
+ android:label="_RS_Test_v14"
+ android:icon="@drawable/test_pattern">
+ <activity android:name="RSTest_v14"
+ android:screenOrientation="portrait">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
diff --git a/tests/RenderScriptTests/tests_v14/res/drawable-nodpi/test_pattern.png b/tests/RenderScriptTests/tests_v14/res/drawable-nodpi/test_pattern.png
new file mode 100644
index 0000000..e7d1455
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/res/drawable-nodpi/test_pattern.png
Binary files differ
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/RSTestCore.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/RSTestCore.java
new file mode 100644
index 0000000..f1e81a4
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/RSTestCore.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2008-2011 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+import android.util.Log;
+import java.util.ArrayList;
+import java.util.ListIterator;
+import java.util.Timer;
+import java.util.TimerTask;
+
+
+public class RSTestCore {
+ int mWidth;
+ int mHeight;
+ Context mCtx;
+
+ public RSTestCore(Context ctx) {
+ mCtx = ctx;
+ }
+
+ private Resources mRes;
+ private RenderScriptGL mRS;
+
+ private Font mFont;
+ ScriptField_ListAllocs_s mListAllocs;
+ int mLastX;
+ int mLastY;
+ private ScriptC_rslist mScript;
+
+ private ArrayList<UnitTest> unitTests;
+ private ListIterator<UnitTest> test_iter;
+ private UnitTest activeTest;
+ private boolean stopTesting;
+
+ /* Periodic timer for ensuring future tests get scheduled */
+ private Timer mTimer;
+ public static final int RS_TIMER_PERIOD = 100;
+
+ public void init(RenderScriptGL rs, Resources res, int width, int height) {
+ mRS = rs;
+ mRes = res;
+ mWidth = width;
+ mHeight = height;
+ stopTesting = false;
+
+ mScript = new ScriptC_rslist(mRS, mRes, R.raw.rslist);
+
+ unitTests = new ArrayList<UnitTest>();
+
+ unitTests.add(new UT_primitives(this, mRes, mCtx));
+ unitTests.add(new UT_vector(this, mRes, mCtx));
+ unitTests.add(new UT_rsdebug(this, mRes, mCtx));
+ unitTests.add(new UT_rstime(this, mRes, mCtx));
+ unitTests.add(new UT_rstypes(this, mRes, mCtx));
+ unitTests.add(new UT_alloc(this, mRes, mCtx));
+ unitTests.add(new UT_refcount(this, mRes, mCtx));
+ unitTests.add(new UT_foreach(this, mRes, mCtx));
+ unitTests.add(new UT_math(this, mRes, mCtx));
+ unitTests.add(new UT_fp_mad(this, mRes, mCtx));
+ /*
+ unitTests.add(new UnitTest(null, "<Pass>", 1));
+ unitTests.add(new UnitTest());
+ unitTests.add(new UnitTest(null, "<Fail>", -1));
+
+ for (int i = 0; i < 20; i++) {
+ unitTests.add(new UnitTest(null, "<Pass>", 1));
+ }
+ */
+
+ UnitTest [] uta = new UnitTest[unitTests.size()];
+ uta = unitTests.toArray(uta);
+
+ mListAllocs = new ScriptField_ListAllocs_s(mRS, uta.length);
+ for (int i = 0; i < uta.length; i++) {
+ ScriptField_ListAllocs_s.Item listElem = new ScriptField_ListAllocs_s.Item();
+ listElem.text = Allocation.createFromString(mRS, uta[i].name, Allocation.USAGE_SCRIPT);
+ listElem.result = uta[i].result;
+ mListAllocs.set(listElem, i, false);
+ uta[i].setItem(listElem);
+ }
+
+ mListAllocs.copyAll();
+
+ mScript.bind_gList(mListAllocs);
+
+ mFont = Font.create(mRS, mRes, "serif", Font.Style.BOLD, 8);
+ mScript.set_gFont(mFont);
+
+ mRS.bindRootScript(mScript);
+
+ test_iter = unitTests.listIterator();
+ refreshTestResults(); /* Kick off the first test */
+
+ TimerTask pTask = new TimerTask() {
+ public void run() {
+ refreshTestResults();
+ }
+ };
+
+ mTimer = new Timer();
+ mTimer.schedule(pTask, RS_TIMER_PERIOD, RS_TIMER_PERIOD);
+ }
+
+ public void checkAndRunNextTest() {
+ if (activeTest != null) {
+ if (!activeTest.isAlive()) {
+ /* Properly clean up on our last test */
+ try {
+ activeTest.join();
+ }
+ catch (InterruptedException e) {
+ }
+ activeTest = null;
+ }
+ }
+
+ if (!stopTesting && activeTest == null) {
+ if (test_iter.hasNext()) {
+ activeTest = test_iter.next();
+ activeTest.start();
+ /* This routine will only get called once when a new test
+ * should start running. The message handler in UnitTest.java
+ * ensures this. */
+ }
+ else {
+ if (mTimer != null) {
+ mTimer.cancel();
+ mTimer.purge();
+ mTimer = null;
+ }
+ }
+ }
+ }
+
+ public void refreshTestResults() {
+ checkAndRunNextTest();
+
+ if (mListAllocs != null && mScript != null && mRS != null) {
+ mListAllocs.copyAll();
+
+ mScript.bind_gList(mListAllocs);
+ mRS.bindRootScript(mScript);
+ }
+ }
+
+ public void cleanup() {
+ stopTesting = true;
+ UnitTest t = activeTest;
+
+ /* Stop periodic refresh of testing */
+ if (mTimer != null) {
+ mTimer.cancel();
+ mTimer.purge();
+ mTimer = null;
+ }
+
+ /* Wait to exit until we finish the current test */
+ if (t != null) {
+ try {
+ t.join();
+ }
+ catch (InterruptedException e) {
+ }
+ t = null;
+ }
+
+ }
+
+ public void newTouchPosition(float x, float y, float pressure, int id) {
+ }
+
+ public void onActionDown(int x, int y) {
+ mScript.set_gDY(0.0f);
+ mLastX = x;
+ mLastY = y;
+ refreshTestResults();
+ }
+
+ public void onActionMove(int x, int y) {
+ int dx = mLastX - x;
+ int dy = mLastY - y;
+
+ if (Math.abs(dy) <= 2) {
+ dy = 0;
+ }
+
+ mScript.set_gDY(dy);
+
+ mLastX = x;
+ mLastY = y;
+ refreshTestResults();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/RSTestView.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/RSTestView.java
new file mode 100644
index 0000000..40192e4
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/RSTestView.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2008 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.rs.test_v14;
+
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.concurrent.Semaphore;
+
+import android.renderscript.RSSurfaceView;
+import android.renderscript.RenderScript;
+import android.renderscript.RenderScriptGL;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.os.Handler;
+import android.os.Message;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.Surface;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+
+public class RSTestView extends RSSurfaceView {
+
+ private Context mCtx;
+
+ public RSTestView(Context context) {
+ super(context);
+ mCtx = context;
+ //setFocusable(true);
+ }
+
+ private RenderScriptGL mRS;
+ private RSTestCore mRender;
+
+ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
+ super.surfaceChanged(holder, format, w, h);
+ if (mRS == null) {
+ RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
+ mRS = createRenderScriptGL(sc);
+ mRS.setSurface(holder, w, h);
+ mRender = new RSTestCore(mCtx);
+ mRender.init(mRS, getResources(), w, h);
+ }
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ if(mRS != null) {
+ mRender.cleanup();
+ mRS = null;
+ destroyRenderScriptGL();
+ }
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event)
+ {
+ return super.onKeyDown(keyCode, event);
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent ev)
+ {
+ boolean ret = false;
+ int act = ev.getAction();
+ if (act == ev.ACTION_DOWN) {
+ mRender.onActionDown((int)ev.getX(), (int)ev.getY());
+ ret = true;
+ }
+ else if (act == ev.ACTION_MOVE) {
+ mRender.onActionMove((int)ev.getX(), (int)ev.getY());
+ ret = true;
+ }
+
+ return ret;
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/RSTest_v14.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/RSTest_v14.java
new file mode 100644
index 0000000..da09691
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/RSTest_v14.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2008 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.rs.test_v14;
+
+import android.renderscript.RSSurfaceView;
+import android.renderscript.RenderScript;
+
+import android.app.Activity;
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.provider.Settings.System;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.Window;
+import android.widget.Button;
+import android.widget.ListView;
+
+import java.lang.Runtime;
+
+public class RSTest_v14 extends Activity {
+ //EventListener mListener = new EventListener();
+
+ private static final String LOG_TAG = "RSTest_v14";
+ private static final boolean DEBUG = false;
+ private static final boolean LOG_ENABLED = false;
+
+ private RSTestView mView;
+
+ // get the current looper (from your Activity UI thread for instance
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ // Create our Preview view and set it as the content of our
+ // Activity
+ mView = new RSTestView(this);
+ setContentView(mView);
+ }
+
+ @Override
+ protected void onResume() {
+ // Ideally a game should implement onResume() and onPause()
+ // to take appropriate action when the activity loses focus
+ super.onResume();
+ mView.resume();
+ }
+
+ @Override
+ protected void onPause() {
+ // Ideally a game should implement onResume() and onPause()
+ // to take appropriate action when the activity loses focus
+ super.onPause();
+ mView.pause();
+ }
+
+ @Override
+ protected void onStop() {
+ // Actually kill the app if we are stopping. We don't want to
+ // continue/resume this test ever. It should always start fresh.
+ finish();
+ super.onStop();
+ }
+
+ static void log(String message) {
+ if (LOG_ENABLED) {
+ Log.v(LOG_TAG, message);
+ }
+ }
+
+
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_alloc.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_alloc.java
new file mode 100644
index 0000000..da42b29
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_alloc.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2011 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_alloc extends UnitTest {
+ private Resources mRes;
+
+ protected UT_alloc(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "Alloc", ctx);
+ mRes = res;
+ }
+
+ private void initializeGlobals(RenderScript RS, ScriptC_alloc s) {
+ Type.Builder typeBuilder = new Type.Builder(RS, Element.I32(RS));
+ int X = 5;
+ int Y = 7;
+ int Z = 0;
+ s.set_dimX(X);
+ s.set_dimY(Y);
+ s.set_dimZ(Z);
+ typeBuilder.setX(X).setY(Y);
+ Allocation A = Allocation.createTyped(RS, typeBuilder.create());
+ s.bind_a(A);
+
+ typeBuilder = new Type.Builder(RS, Element.I32(RS));
+ typeBuilder.setX(X).setY(Y).setFaces(true);
+ Allocation AFaces = Allocation.createTyped(RS, typeBuilder.create());
+ s.set_aFaces(AFaces);
+ typeBuilder.setFaces(false).setMipmaps(true);
+ Allocation ALOD = Allocation.createTyped(RS, typeBuilder.create());
+ s.set_aLOD(ALOD);
+ typeBuilder.setFaces(true).setMipmaps(true);
+ Allocation AFacesLOD = Allocation.createTyped(RS, typeBuilder.create());
+ s.set_aFacesLOD(AFacesLOD);
+
+ return;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_alloc s = new ScriptC_alloc(pRS, mRes, R.raw.alloc);
+ pRS.setMessageHandler(mRsMessage);
+ initializeGlobals(pRS, s);
+ s.invoke_alloc_test();
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_foreach.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_foreach.java
new file mode 100644
index 0000000..aeb5bb7
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_foreach.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2011 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_foreach extends UnitTest {
+ private Resources mRes;
+ private Allocation A;
+
+ protected UT_foreach(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "ForEach", ctx);
+ mRes = res;
+ }
+
+ private void initializeGlobals(RenderScript RS, ScriptC_foreach s) {
+ Type.Builder typeBuilder = new Type.Builder(RS, Element.I32(RS));
+ int X = 5;
+ int Y = 7;
+ s.set_dimX(X);
+ s.set_dimY(Y);
+ typeBuilder.setX(X).setY(Y);
+ A = Allocation.createTyped(RS, typeBuilder.create());
+ s.bind_a(A);
+
+ return;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_foreach s = new ScriptC_foreach(pRS, mRes, R.raw.foreach);
+ pRS.setMessageHandler(mRsMessage);
+ initializeGlobals(pRS, s);
+ s.forEach_root(A);
+ s.invoke_foreach_test();
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_fp_mad.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_fp_mad.java
new file mode 100644
index 0000000..239496a
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_fp_mad.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_fp_mad extends UnitTest {
+ private Resources mRes;
+
+ protected UT_fp_mad(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "Fp_Mad", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_fp_mad s = new ScriptC_fp_mad(pRS, mRes, R.raw.fp_mad);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_fp_mad_test(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_math.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_math.java
new file mode 100644
index 0000000..7b135c4
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_math.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_math extends UnitTest {
+ private Resources mRes;
+
+ protected UT_math(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "Math", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_math s = new ScriptC_math(pRS, mRes, R.raw.math);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_math_test(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_primitives.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_primitives.java
new file mode 100644
index 0000000..d3c56f3
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_primitives.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_primitives extends UnitTest {
+ private Resources mRes;
+
+ protected UT_primitives(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "Primitives", ctx);
+ mRes = res;
+ }
+
+ private boolean initializeGlobals(ScriptC_primitives s) {
+ float pF = s.get_floatTest();
+ if (pF != 1.99f) {
+ return false;
+ }
+ s.set_floatTest(2.99f);
+
+ double pD = s.get_doubleTest();
+ if (pD != 2.05) {
+ return false;
+ }
+ s.set_doubleTest(3.05);
+
+ byte pC = s.get_charTest();
+ if (pC != -8) {
+ return false;
+ }
+ s.set_charTest((byte)-16);
+
+ short pS = s.get_shortTest();
+ if (pS != -16) {
+ return false;
+ }
+ s.set_shortTest((short)-32);
+
+ int pI = s.get_intTest();
+ if (pI != -32) {
+ return false;
+ }
+ s.set_intTest(-64);
+
+ long pL = s.get_longTest();
+ if (pL != 17179869184l) {
+ return false;
+ }
+ s.set_longTest(17179869185l);
+
+ long puL = s.get_ulongTest();
+ if (puL != 4611686018427387904L) {
+ return false;
+ }
+ s.set_ulongTest(4611686018427387903L);
+
+
+ long pLL = s.get_longlongTest();
+ if (pLL != 68719476736L) {
+ return false;
+ }
+ s.set_longlongTest(68719476735L);
+
+ long pu64 = s.get_uint64_tTest();
+ if (pu64 != 117179869184l) {
+ return false;
+ }
+ s.set_uint64_tTest(117179869185l);
+
+ return true;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_primitives s = new ScriptC_primitives(pRS, mRes, R.raw.primitives);
+ pRS.setMessageHandler(mRsMessage);
+ if (!initializeGlobals(s)) {
+ // initializeGlobals failed
+ result = -1;
+ } else {
+ s.invoke_primitives_test(0, 0);
+ pRS.finish();
+ waitForMessage();
+ }
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_refcount.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_refcount.java
new file mode 100644
index 0000000..05a516b
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_refcount.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_refcount extends UnitTest {
+ private Resources mRes;
+
+ protected UT_refcount(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "Refcount", ctx);
+ mRes = res;
+ }
+
+ private void initializeGlobals(RenderScript RS, ScriptC_refcount s) {
+ Type.Builder typeBuilder = new Type.Builder(RS, Element.I32(RS));
+ int X = 500;
+ int Y = 700;
+ typeBuilder.setX(X).setY(Y);
+ Allocation A = Allocation.createTyped(RS, typeBuilder.create());
+ s.set_globalA(A);
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ pRS.setMessageHandler(mRsMessage);
+ ScriptC_refcount s = new ScriptC_refcount(pRS, mRes, R.raw.refcount);
+ initializeGlobals(pRS, s);
+ s.invoke_refcount_test();
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_rsdebug.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_rsdebug.java
new file mode 100644
index 0000000..95e92ee
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_rsdebug.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_rsdebug extends UnitTest {
+ private Resources mRes;
+
+ protected UT_rsdebug(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "rsDebug", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_rsdebug s = new ScriptC_rsdebug(pRS, mRes, R.raw.rsdebug);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_test_rsdebug(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_rstime.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_rstime.java
new file mode 100644
index 0000000..a72ede9
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_rstime.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_rstime extends UnitTest {
+ private Resources mRes;
+
+ protected UT_rstime(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "rsTime", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_rstime s = new ScriptC_rstime(pRS, mRes, R.raw.rstime);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_test_rstime(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_rstypes.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_rstypes.java
new file mode 100644
index 0000000..ab96867
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_rstypes.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_rstypes extends UnitTest {
+ private Resources mRes;
+
+ protected UT_rstypes(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "rsTypes", ctx);
+ mRes = res;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_rstypes s = new ScriptC_rstypes(pRS, mRes, R.raw.rstypes);
+ pRS.setMessageHandler(mRsMessage);
+ s.invoke_test_rstypes(0, 0);
+ pRS.finish();
+ waitForMessage();
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_vector.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_vector.java
new file mode 100644
index 0000000..657413e
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UT_vector.java
@@ -0,0 +1,318 @@
+/*
+ * Copyright (C) 2011 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.rs.test_v14;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.renderscript.*;
+
+public class UT_vector extends UnitTest {
+ private Resources mRes;
+
+ protected UT_vector(RSTestCore rstc, Resources res, Context ctx) {
+ super(rstc, "Vector", ctx);
+ mRes = res;
+ }
+
+ private boolean initializeGlobals(ScriptC_vector s) {
+ Float2 F2 = s.get_f2();
+ if (F2.x != 1.0f || F2.y != 2.0f) {
+ return false;
+ }
+ F2.x = 2.99f;
+ F2.y = 3.99f;
+ s.set_f2(F2);
+
+ Float3 F3 = s.get_f3();
+ if (F3.x != 1.0f || F3.y != 2.0f || F3.z != 3.0f) {
+ return false;
+ }
+ F3.x = 2.99f;
+ F3.y = 3.99f;
+ F3.z = 4.99f;
+ s.set_f3(F3);
+
+ Float4 F4 = s.get_f4();
+ if (F4.x != 1.0f || F4.y != 2.0f || F4.z != 3.0f || F4.w != 4.0f) {
+ return false;
+ }
+ F4.x = 2.99f;
+ F4.y = 3.99f;
+ F4.z = 4.99f;
+ F4.w = 5.99f;
+ s.set_f4(F4);
+
+ Double2 D2 = s.get_d2();
+ if (D2.x != 1.0 || D2.y != 2.0) {
+ return false;
+ }
+ D2.x = 2.99;
+ D2.y = 3.99;
+ s.set_d2(D2);
+
+ Double3 D3 = s.get_d3();
+ if (D3.x != 1.0 || D3.y != 2.0 || D3.z != 3.0) {
+ return false;
+ }
+ D3.x = 2.99;
+ D3.y = 3.99;
+ D3.z = 4.99;
+ s.set_d3(D3);
+
+ Double4 D4 = s.get_d4();
+ if (D4.x != 1.0 || D4.y != 2.0 || D4.z != 3.0 || D4.w != 4.0) {
+ return false;
+ }
+ D4.x = 2.99;
+ D4.y = 3.99;
+ D4.z = 4.99;
+ D4.w = 5.99;
+ s.set_d4(D4);
+
+ Byte2 B2 = s.get_i8_2();
+ if (B2.x != 1 || B2.y != 2) {
+ return false;
+ }
+ B2.x = 2;
+ B2.y = 3;
+ s.set_i8_2(B2);
+
+ Byte3 B3 = s.get_i8_3();
+ if (B3.x != 1 || B3.y != 2 || B3.z != 3) {
+ return false;
+ }
+ B3.x = 2;
+ B3.y = 3;
+ B3.z = 4;
+ s.set_i8_3(B3);
+
+ Byte4 B4 = s.get_i8_4();
+ if (B4.x != 1 || B4.y != 2 || B4.z != 3 || B4.w != 4) {
+ return false;
+ }
+ B4.x = 2;
+ B4.y = 3;
+ B4.z = 4;
+ B4.w = 5;
+ s.set_i8_4(B4);
+
+ Short2 S2 = s.get_u8_2();
+ if (S2.x != 1 || S2.y != 2) {
+ return false;
+ }
+ S2.x = 2;
+ S2.y = 3;
+ s.set_u8_2(S2);
+
+ Short3 S3 = s.get_u8_3();
+ if (S3.x != 1 || S3.y != 2 || S3.z != 3) {
+ return false;
+ }
+ S3.x = 2;
+ S3.y = 3;
+ S3.z = 4;
+ s.set_u8_3(S3);
+
+ Short4 S4 = s.get_u8_4();
+ if (S4.x != 1 || S4.y != 2 || S4.z != 3 || S4.w != 4) {
+ return false;
+ }
+ S4.x = 2;
+ S4.y = 3;
+ S4.z = 4;
+ S4.w = 5;
+ s.set_u8_4(S4);
+
+ S2 = s.get_i16_2();
+ if (S2.x != 1 || S2.y != 2) {
+ return false;
+ }
+ S2.x = 2;
+ S2.y = 3;
+ s.set_i16_2(S2);
+
+ S3 = s.get_i16_3();
+ if (S3.x != 1 || S3.y != 2 || S3.z != 3) {
+ return false;
+ }
+ S3.x = 2;
+ S3.y = 3;
+ S3.z = 4;
+ s.set_i16_3(S3);
+
+ S4 = s.get_i16_4();
+ if (S4.x != 1 || S4.y != 2 || S4.z != 3 || S4.w != 4) {
+ return false;
+ }
+ S4.x = 2;
+ S4.y = 3;
+ S4.z = 4;
+ S4.w = 5;
+ s.set_i16_4(S4);
+
+ Int2 I2 = s.get_u16_2();
+ if (I2.x != 1 || I2.y != 2) {
+ return false;
+ }
+ I2.x = 2;
+ I2.y = 3;
+ s.set_u16_2(I2);
+
+ Int3 I3 = s.get_u16_3();
+ if (I3.x != 1 || I3.y != 2 || I3.z != 3) {
+ return false;
+ }
+ I3.x = 2;
+ I3.y = 3;
+ I3.z = 4;
+ s.set_u16_3(I3);
+
+ Int4 I4 = s.get_u16_4();
+ if (I4.x != 1 || I4.y != 2 || I4.z != 3 || I4.w != 4) {
+ return false;
+ }
+ I4.x = 2;
+ I4.y = 3;
+ I4.z = 4;
+ I4.w = 5;
+ s.set_u16_4(I4);
+
+ I2 = s.get_i32_2();
+ if (I2.x != 1 || I2.y != 2) {
+ return false;
+ }
+ I2.x = 2;
+ I2.y = 3;
+ s.set_i32_2(I2);
+
+ I3 = s.get_i32_3();
+ if (I3.x != 1 || I3.y != 2 || I3.z != 3) {
+ return false;
+ }
+ I3.x = 2;
+ I3.y = 3;
+ I3.z = 4;
+ s.set_i32_3(I3);
+
+ I4 = s.get_i32_4();
+ if (I4.x != 1 || I4.y != 2 || I4.z != 3 || I4.w != 4) {
+ return false;
+ }
+ I4.x = 2;
+ I4.y = 3;
+ I4.z = 4;
+ I4.w = 5;
+ s.set_i32_4(I4);
+
+ Long2 L2 = s.get_u32_2();
+ if (L2.x != 1 || L2.y != 2) {
+ return false;
+ }
+ L2.x = 2;
+ L2.y = 3;
+ s.set_u32_2(L2);
+
+ Long3 L3 = s.get_u32_3();
+ if (L3.x != 1 || L3.y != 2 || L3.z != 3) {
+ return false;
+ }
+ L3.x = 2;
+ L3.y = 3;
+ L3.z = 4;
+ s.set_u32_3(L3);
+
+ Long4 L4 = s.get_u32_4();
+ if (L4.x != 1 || L4.y != 2 || L4.z != 3 || L4.w != 4) {
+ return false;
+ }
+ L4.x = 2;
+ L4.y = 3;
+ L4.z = 4;
+ L4.w = 5;
+ s.set_u32_4(L4);
+
+ L2 = s.get_i64_2();
+ if (L2.x != 1 || L2.y != 2) {
+ return false;
+ }
+ L2.x = 2;
+ L2.y = 3;
+ s.set_i64_2(L2);
+
+ L3 = s.get_i64_3();
+ if (L3.x != 1 || L3.y != 2 || L3.z != 3) {
+ return false;
+ }
+ L3.x = 2;
+ L3.y = 3;
+ L3.z = 4;
+ s.set_i64_3(L3);
+
+ L4 = s.get_i64_4();
+ if (L4.x != 1 || L4.y != 2 || L4.z != 3 || L4.w != 4) {
+ return false;
+ }
+ L4.x = 2;
+ L4.y = 3;
+ L4.z = 4;
+ L4.w = 5;
+ s.set_i64_4(L4);
+
+ L2 = s.get_u64_2();
+ if (L2.x != 1 || L2.y != 2) {
+ return false;
+ }
+ L2.x = 2;
+ L2.y = 3;
+ s.set_u64_2(L2);
+
+ L3 = s.get_u64_3();
+ if (L3.x != 1 || L3.y != 2 || L3.z != 3) {
+ return false;
+ }
+ L3.x = 2;
+ L3.y = 3;
+ L3.z = 4;
+ s.set_u64_3(L3);
+
+ L4 = s.get_u64_4();
+ if (L4.x != 1 || L4.y != 2 || L4.z != 3 || L4.w != 4) {
+ return false;
+ }
+ L4.x = 2;
+ L4.y = 3;
+ L4.z = 4;
+ L4.w = 5;
+ s.set_u64_4(L4);
+
+ return true;
+ }
+
+ public void run() {
+ RenderScript pRS = RenderScript.create(mCtx);
+ ScriptC_vector s = new ScriptC_vector(pRS, mRes, R.raw.vector);
+ pRS.setMessageHandler(mRsMessage);
+ if (!initializeGlobals(s)) {
+ result = -1;
+ } else {
+ s.invoke_vector_test();
+ pRS.finish();
+ waitForMessage();
+ }
+ pRS.destroy();
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UnitTest.java b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UnitTest.java
new file mode 100644
index 0000000..558a252
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/UnitTest.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2010 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.rs.test_v14;
+import android.content.Context;
+import android.util.Log;
+import android.renderscript.RenderScript.RSMessageHandler;
+
+public class UnitTest extends Thread {
+ public String name;
+ public int result;
+ private ScriptField_ListAllocs_s.Item mItem;
+ private RSTestCore mRSTC;
+ private boolean msgHandled;
+ protected Context mCtx;
+
+ /* These constants must match those in shared.rsh */
+ public static final int RS_MSG_TEST_PASSED = 100;
+ public static final int RS_MSG_TEST_FAILED = 101;
+
+ private static int numTests = 0;
+ public int testID;
+
+ protected UnitTest(RSTestCore rstc, String n, int initResult, Context ctx) {
+ super();
+ mRSTC = rstc;
+ name = n;
+ msgHandled = false;
+ mCtx = ctx;
+ result = initResult;
+ testID = numTests++;
+ }
+
+ protected UnitTest(RSTestCore rstc, String n, Context ctx) {
+ this(rstc, n, 0, ctx);
+ }
+
+ protected UnitTest(RSTestCore rstc, Context ctx) {
+ this (rstc, "<Unknown>", ctx);
+ }
+
+ protected UnitTest(Context ctx) {
+ this (null, ctx);
+ }
+
+ protected void _RS_ASSERT(String message, boolean b) {
+ if(b == false) {
+ result = -1;
+ Log.e(name, message + " FAILED");
+ }
+ }
+
+ protected void updateUI() {
+ if (mItem != null) {
+ mItem.result = result;
+ msgHandled = true;
+ try {
+ mRSTC.refreshTestResults();
+ }
+ catch (IllegalStateException e) {
+ /* Ignore the case where our message receiver has been
+ disconnected. This happens when we leave the application
+ before it finishes running all of the unit tests. */
+ }
+ }
+ }
+
+ protected RSMessageHandler mRsMessage = new RSMessageHandler() {
+ public void run() {
+ if (result == 0) {
+ switch (mID) {
+ case RS_MSG_TEST_PASSED:
+ result = 1;
+ break;
+ case RS_MSG_TEST_FAILED:
+ result = -1;
+ break;
+ default:
+ RSTest_v14.log("Unit test got unexpected message");
+ return;
+ }
+ }
+
+ updateUI();
+ }
+ };
+
+ public void waitForMessage() {
+ while (!msgHandled) {
+ yield();
+ }
+ }
+
+ public void setItem(ScriptField_ListAllocs_s.Item item) {
+ mItem = item;
+ }
+
+ public void run() {
+ /* This method needs to be implemented for each subclass */
+ if (mRSTC != null) {
+ mRSTC.refreshTestResults();
+ }
+ }
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/alloc.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/alloc.rs
new file mode 100644
index 0000000..3116e5a
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/alloc.rs
@@ -0,0 +1,94 @@
+#include "shared.rsh"
+
+int *a;
+int dimX;
+int dimY;
+int dimZ;
+
+rs_allocation aFaces;
+rs_allocation aLOD;
+rs_allocation aFacesLOD;
+
+static bool test_alloc_dims() {
+ bool failed = false;
+ int i, j;
+
+ for (j = 0; j < dimY; j++) {
+ for (i = 0; i < dimX; i++) {
+ a[i + j * dimX] = i + j * dimX;
+ }
+ }
+
+ rs_allocation alloc = rsGetAllocation(a);
+ _RS_ASSERT(rsAllocationGetDimX(alloc) == dimX);
+ _RS_ASSERT(rsAllocationGetDimY(alloc) == dimY);
+ _RS_ASSERT(rsAllocationGetDimZ(alloc) == dimZ);
+
+ // Test 2D addressing
+ for (j = 0; j < dimY; j++) {
+ for (i = 0; i < dimX; i++) {
+ rsDebug("Verifying ", i + j * dimX);
+ const void *p = rsGetElementAt(alloc, i, j);
+ int val = *(const int *)p;
+ _RS_ASSERT(val == (i + j * dimX));
+ }
+ }
+
+ // Test 1D addressing
+ for (i = 0; i < dimX * dimY; i++) {
+ rsDebug("Verifying ", i);
+ const void *p = rsGetElementAt(alloc, i);
+ int val = *(const int *)p;
+ _RS_ASSERT(val == i);
+ }
+
+ // Test 3D addressing
+ for (j = 0; j < dimY; j++) {
+ for (i = 0; i < dimX; i++) {
+ rsDebug("Verifying ", i + j * dimX);
+ const void *p = rsGetElementAt(alloc, i, j, 0);
+ int val = *(const int *)p;
+ _RS_ASSERT(val == (i + j * dimX));
+ }
+ }
+
+ _RS_ASSERT(rsAllocationGetDimX(aFaces) == dimX);
+ _RS_ASSERT(rsAllocationGetDimY(aFaces) == dimY);
+ _RS_ASSERT(rsAllocationGetDimZ(aFaces) == dimZ);
+ _RS_ASSERT(rsAllocationGetDimFaces(aFaces) != 0);
+ _RS_ASSERT(rsAllocationGetDimLOD(aFaces) == 0);
+
+ _RS_ASSERT(rsAllocationGetDimX(aLOD) == dimX);
+ _RS_ASSERT(rsAllocationGetDimY(aLOD) == dimY);
+ _RS_ASSERT(rsAllocationGetDimZ(aLOD) == dimZ);
+ _RS_ASSERT(rsAllocationGetDimFaces(aLOD) == 0);
+ _RS_ASSERT(rsAllocationGetDimLOD(aLOD) != 0);
+
+ _RS_ASSERT(rsAllocationGetDimX(aFacesLOD) == dimX);
+ _RS_ASSERT(rsAllocationGetDimY(aFacesLOD) == dimY);
+ _RS_ASSERT(rsAllocationGetDimZ(aFacesLOD) == dimZ);
+ _RS_ASSERT(rsAllocationGetDimFaces(aFacesLOD) != 0);
+ _RS_ASSERT(rsAllocationGetDimLOD(aFacesLOD) != 0);
+
+ if (failed) {
+ rsDebug("test_alloc_dims FAILED", 0);
+ }
+ else {
+ rsDebug("test_alloc_dims PASSED", 0);
+ }
+
+ return failed;
+}
+
+void alloc_test() {
+ bool failed = false;
+ failed |= test_alloc_dims();
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/foreach.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/foreach.rs
new file mode 100644
index 0000000..3ba3eef
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/foreach.rs
@@ -0,0 +1,42 @@
+#include "shared.rsh"
+
+int *a;
+int dimX;
+int dimY;
+
+void root(int *out, uint32_t x, uint32_t y) {
+ *out = x + y * dimX;
+}
+
+static bool test_foreach_output() {
+ bool failed = false;
+ int i, j;
+
+ for (j = 0; j < dimY; j++) {
+ for (i = 0; i < dimX; i++) {
+ _RS_ASSERT(a[i + j * dimX] == (i + j * dimX));
+ }
+ }
+
+ if (failed) {
+ rsDebug("test_foreach_output FAILED", 0);
+ }
+ else {
+ rsDebug("test_foreach_output PASSED", 0);
+ }
+
+ return failed;
+}
+
+void foreach_test() {
+ bool failed = false;
+ failed |= test_foreach_output();
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/fp_mad.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/fp_mad.rs
new file mode 100644
index 0000000..b6f2b2a6
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/fp_mad.rs
@@ -0,0 +1,174 @@
+#include "shared.rsh"
+
+const int TEST_COUNT = 1;
+
+static float data_f1[1025];
+static float4 data_f4[1025];
+
+static void test_mad4(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~1 billion ops
+ for (int ct=0; ct < 1000 * (1000 / 80); ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f4[i] = (data_f4[i] * 0.02f +
+ data_f4[i+1] * 0.04f +
+ data_f4[i+2] * 0.05f +
+ data_f4[i+3] * 0.1f +
+ data_f4[i+4] * 0.2f +
+ data_f4[i+5] * 0.2f +
+ data_f4[i+6] * 0.1f +
+ data_f4[i+7] * 0.05f +
+ data_f4[i+8] * 0.04f +
+ data_f4[i+9] * 0.02f + 1.f);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_mad4 M ops", 1000.f / time);
+}
+
+static void test_mad(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~1 billion ops
+ for (int ct=0; ct < 1000 * (1000 / 20); ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f1[i] = (data_f1[i] * 0.02f +
+ data_f1[i+1] * 0.04f +
+ data_f1[i+2] * 0.05f +
+ data_f1[i+3] * 0.1f +
+ data_f1[i+4] * 0.2f +
+ data_f1[i+5] * 0.2f +
+ data_f1[i+6] * 0.1f +
+ data_f1[i+7] * 0.05f +
+ data_f1[i+8] * 0.04f +
+ data_f1[i+9] * 0.02f + 1.f);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_mad M ops", 1000.f / time);
+}
+
+static void test_norm(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~10 M ops
+ for (int ct=0; ct < 1000 * 10; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f4[i] = normalize(data_f4[i]);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_norm M ops", 10.f / time);
+}
+
+static void test_sincos4(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~10 M ops
+ for (int ct=0; ct < 1000 * 10 / 4; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f4[i] = sin(data_f4[i]) * cos(data_f4[i]);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_sincos4 M ops", 10.f / time);
+}
+
+static void test_sincos(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~10 M ops
+ for (int ct=0; ct < 1000 * 10; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f1[i] = sin(data_f1[i]) * cos(data_f1[i]);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_sincos M ops", 10.f / time);
+}
+
+static void test_clamp(uint32_t index) {
+ start();
+
+ // Do ~100 M ops
+ for (int ct=0; ct < 1000 * 100; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f1[i] = clamp(data_f1[i], -1.f, 1.f);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_clamp M ops", 100.f / time);
+
+ start();
+ // Do ~100 M ops
+ for (int ct=0; ct < 1000 * 100; ct++) {
+ for (int i=0; i < (1000); i++) {
+ if (data_f1[i] < -1.f) data_f1[i] = -1.f;
+ if (data_f1[i] > -1.f) data_f1[i] = 1.f;
+ }
+ }
+
+ time = end(index);
+ rsDebug("fp_clamp ref M ops", 100.f / time);
+}
+
+static void test_clamp4(uint32_t index) {
+ start();
+
+ float total = 0;
+ // Do ~100 M ops
+ for (int ct=0; ct < 1000 * 100 /4; ct++) {
+ for (int i=0; i < (1000); i++) {
+ data_f4[i] = clamp(data_f4[i], -1.f, 1.f);
+ }
+ }
+
+ float time = end(index);
+ rsDebug("fp_clamp4 M ops", 100.f / time);
+}
+
+void fp_mad_test(uint32_t index, int test_num) {
+ int x;
+ for (x=0; x < 1025; x++) {
+ data_f1[x] = (x & 0xf) * 0.1f;
+ data_f4[x].x = (x & 0xf) * 0.1f;
+ data_f4[x].y = (x & 0xf0) * 0.1f;
+ data_f4[x].z = (x & 0x33) * 0.1f;
+ data_f4[x].w = (x & 0x77) * 0.1f;
+ }
+
+ test_mad4(index);
+ test_mad(index);
+
+ for (x=0; x < 1025; x++) {
+ data_f1[x] = (x & 0xf) * 0.1f + 1.f;
+ data_f4[x].x = (x & 0xf) * 0.1f + 1.f;
+ data_f4[x].y = (x & 0xf0) * 0.1f + 1.f;
+ data_f4[x].z = (x & 0x33) * 0.1f + 1.f;
+ data_f4[x].w = (x & 0x77) * 0.1f + 1.f;
+ }
+
+ test_norm(index);
+ test_sincos4(index);
+ test_sincos(index);
+ test_clamp4(index);
+ test_clamp(index);
+
+ // TODO Actually verify test result accuracy
+ rsDebug("fp_mad_test PASSED", 0);
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+}
+
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/math.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/math.rs
new file mode 100644
index 0000000..e6b37f6
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/math.rs
@@ -0,0 +1,462 @@
+#include "shared.rsh"
+
+// Testing math library
+
+volatile float f1;
+volatile float2 f2;
+volatile float3 f3;
+volatile float4 f4;
+
+volatile int i1;
+volatile int2 i2;
+volatile int3 i3;
+volatile int4 i4;
+
+volatile uint ui1;
+volatile uint2 ui2;
+volatile uint3 ui3;
+volatile uint4 ui4;
+
+volatile short s1;
+volatile short2 s2;
+volatile short3 s3;
+volatile short4 s4;
+
+volatile ushort us1;
+volatile ushort2 us2;
+volatile ushort3 us3;
+volatile ushort4 us4;
+
+volatile char c1;
+volatile char2 c2;
+volatile char3 c3;
+volatile char4 c4;
+
+volatile uchar uc1;
+volatile uchar2 uc2;
+volatile uchar3 uc3;
+volatile uchar4 uc4;
+
+#define DECL_INT(prefix) \
+volatile char prefix##_c_1 = 1; \
+volatile char2 prefix##_c_2 = 1; \
+volatile char3 prefix##_c_3 = 1; \
+volatile char4 prefix##_c_4 = 1; \
+volatile uchar prefix##_uc_1 = 1; \
+volatile uchar2 prefix##_uc_2 = 1; \
+volatile uchar3 prefix##_uc_3 = 1; \
+volatile uchar4 prefix##_uc_4 = 1; \
+volatile short prefix##_s_1 = 1; \
+volatile short2 prefix##_s_2 = 1; \
+volatile short3 prefix##_s_3 = 1; \
+volatile short4 prefix##_s_4 = 1; \
+volatile ushort prefix##_us_1 = 1; \
+volatile ushort2 prefix##_us_2 = 1; \
+volatile ushort3 prefix##_us_3 = 1; \
+volatile ushort4 prefix##_us_4 = 1; \
+volatile int prefix##_i_1 = 1; \
+volatile int2 prefix##_i_2 = 1; \
+volatile int3 prefix##_i_3 = 1; \
+volatile int4 prefix##_i_4 = 1; \
+volatile uint prefix##_ui_1 = 1; \
+volatile uint2 prefix##_ui_2 = 1; \
+volatile uint3 prefix##_ui_3 = 1; \
+volatile uint4 prefix##_ui_4 = 1; \
+volatile long prefix##_l_1 = 1; \
+volatile ulong prefix##_ul_1 = 1;
+
+DECL_INT(res)
+DECL_INT(src1)
+DECL_INT(src2)
+
+#define TEST_INT_OP_TYPE(op, type) \
+rsDebug("Testing " #op " for " #type "1", i++); \
+res_##type##_1 = src1_##type##_1 op src2_##type##_1; \
+rsDebug("Testing " #op " for " #type "2", i++); \
+res_##type##_2 = src1_##type##_2 op src2_##type##_2; \
+rsDebug("Testing " #op " for " #type "3", i++); \
+res_##type##_3 = src1_##type##_3 op src2_##type##_3; \
+rsDebug("Testing " #op " for " #type "4", i++); \
+res_##type##_4 = src1_##type##_4 op src2_##type##_4;
+
+#define TEST_INT_OP(op) \
+TEST_INT_OP_TYPE(op, c) \
+TEST_INT_OP_TYPE(op, uc) \
+TEST_INT_OP_TYPE(op, s) \
+TEST_INT_OP_TYPE(op, us) \
+TEST_INT_OP_TYPE(op, i) \
+TEST_INT_OP_TYPE(op, ui) \
+rsDebug("Testing " #op " for l1", i++); \
+res_l_1 = src1_l_1 op src2_l_1; \
+rsDebug("Testing " #op " for ul1", i++); \
+res_ul_1 = src1_ul_1 op src2_ul_1;
+
+#define TEST_XN_FUNC_YN(typeout, fnc, typein) \
+ res_##typeout##_1 = fnc(src1_##typein##_1); \
+ res_##typeout##_2 = fnc(src1_##typein##_2); \
+ res_##typeout##_3 = fnc(src1_##typein##_3); \
+ res_##typeout##_4 = fnc(src1_##typein##_4);
+
+#define TEST_XN_FUNC_XN_XN(type, fnc) \
+ res_##type##_1 = fnc(src1_##type##_1, src2_##type##_1); \
+ res_##type##_2 = fnc(src1_##type##_2, src2_##type##_2); \
+ res_##type##_3 = fnc(src1_##type##_3, src2_##type##_3); \
+ res_##type##_4 = fnc(src1_##type##_4, src2_##type##_4);
+
+#define TEST_X_FUNC_X_X_X(type, fnc) \
+ res_##type##_1 = fnc(src1_##type##_1, src2_##type##_1, src2_##type##_1);
+
+#define TEST_IN_FUNC_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_XN_FUNC_YN(uc, fnc, uc) \
+ TEST_XN_FUNC_YN(c, fnc, c) \
+ TEST_XN_FUNC_YN(us, fnc, us) \
+ TEST_XN_FUNC_YN(s, fnc, s) \
+ TEST_XN_FUNC_YN(ui, fnc, ui) \
+ TEST_XN_FUNC_YN(i, fnc, i)
+
+#define TEST_UIN_FUNC_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_XN_FUNC_YN(uc, fnc, c) \
+ TEST_XN_FUNC_YN(us, fnc, s) \
+ TEST_XN_FUNC_YN(ui, fnc, i) \
+
+#define TEST_IN_FUNC_IN_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_XN_FUNC_XN_XN(uc, fnc) \
+ TEST_XN_FUNC_XN_XN(c, fnc) \
+ TEST_XN_FUNC_XN_XN(us, fnc) \
+ TEST_XN_FUNC_XN_XN(s, fnc) \
+ TEST_XN_FUNC_XN_XN(ui, fnc) \
+ TEST_XN_FUNC_XN_XN(i, fnc)
+
+#define TEST_I_FUNC_I_I_I(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_X_FUNC_X_X_X(uc, fnc) \
+ TEST_X_FUNC_X_X_X(c, fnc) \
+ TEST_X_FUNC_X_X_X(us, fnc) \
+ TEST_X_FUNC_X_X_X(s, fnc) \
+ TEST_X_FUNC_X_X_X(ui, fnc) \
+ TEST_X_FUNC_X_X_X(i, fnc)
+
+#define TEST_FN_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1); \
+ f2 = fnc(f2); \
+ f3 = fnc(f3); \
+ f4 = fnc(f4);
+
+#define TEST_FN_FUNC_FN_PFN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, (float*) &f1); \
+ f2 = fnc(f2, (float2*) &f2); \
+ f3 = fnc(f3, (float3*) &f3); \
+ f4 = fnc(f4, (float4*) &f4);
+
+#define TEST_FN_FUNC_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f2 = fnc(f2, f2); \
+ f3 = fnc(f3, f3); \
+ f4 = fnc(f4, f4);
+
+#define TEST_F34_FUNC_F34_F34(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f3 = fnc(f3, f3); \
+ f4 = fnc(f4, f4);
+
+#define TEST_FN_FUNC_FN_F(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f2 = fnc(f2, f1); \
+ f3 = fnc(f3, f1); \
+ f4 = fnc(f4, f1);
+
+#define TEST_F_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1); \
+ f1 = fnc(f2); \
+ f1 = fnc(f3); \
+ f1 = fnc(f4);
+
+#define TEST_F_FUNC_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f1 = fnc(f2, f2); \
+ f1 = fnc(f3, f3); \
+ f1 = fnc(f4, f4);
+
+#define TEST_FN_FUNC_FN_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, i1); \
+ f2 = fnc(f2, i2); \
+ f3 = fnc(f3, i3); \
+ f4 = fnc(f4, i4);
+
+#define TEST_FN_FUNC_FN_I(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, i1); \
+ f2 = fnc(f2, i1); \
+ f3 = fnc(f3, i1); \
+ f4 = fnc(f4, i1);
+
+#define TEST_FN_FUNC_FN_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, f1); \
+ f2 = fnc(f2, f2, f2); \
+ f3 = fnc(f3, f3, f3); \
+ f4 = fnc(f4, f4, f4);
+
+#define TEST_FN_FUNC_FN_FN_F(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, f1); \
+ f2 = fnc(f2, f1, f1); \
+ f3 = fnc(f3, f1, f1); \
+ f4 = fnc(f4, f1, f1);
+
+#define TEST_FN_FUNC_FN_PIN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, (int*) &i1); \
+ f2 = fnc(f2, (int2*) &i2); \
+ f3 = fnc(f3, (int3*) &i3); \
+ f4 = fnc(f4, (int4*) &i4);
+
+#define TEST_FN_FUNC_FN_FN_PIN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, (int*) &i1); \
+ f2 = fnc(f2, f2, (int2*) &i2); \
+ f3 = fnc(f3, f3, (int3*) &i3); \
+ f4 = fnc(f4, f4, (int4*) &i4);
+
+#define TEST_IN_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ i1 = fnc(f1); \
+ i2 = fnc(f2); \
+ i3 = fnc(f3); \
+ i4 = fnc(f4);
+
+static bool test_fp_math(uint32_t index) {
+ bool failed = false;
+ start();
+
+ TEST_FN_FUNC_FN(acos);
+ TEST_FN_FUNC_FN(acosh);
+ TEST_FN_FUNC_FN(acospi);
+ TEST_FN_FUNC_FN(asin);
+ TEST_FN_FUNC_FN(asinh);
+ TEST_FN_FUNC_FN(asinpi);
+ TEST_FN_FUNC_FN(atan);
+ TEST_FN_FUNC_FN_FN(atan2);
+ TEST_FN_FUNC_FN(atanh);
+ TEST_FN_FUNC_FN(atanpi);
+ TEST_FN_FUNC_FN_FN(atan2pi);
+ TEST_FN_FUNC_FN(cbrt);
+ TEST_FN_FUNC_FN(ceil);
+ TEST_FN_FUNC_FN_FN_FN(clamp);
+ TEST_FN_FUNC_FN_FN_F(clamp);
+ TEST_FN_FUNC_FN_FN(copysign);
+ TEST_FN_FUNC_FN(cos);
+ TEST_FN_FUNC_FN(cosh);
+ TEST_FN_FUNC_FN(cospi);
+ TEST_F34_FUNC_F34_F34(cross);
+ TEST_FN_FUNC_FN(degrees);
+ TEST_F_FUNC_FN_FN(distance);
+ TEST_F_FUNC_FN_FN(dot);
+ TEST_FN_FUNC_FN(erfc);
+ TEST_FN_FUNC_FN(erf);
+ TEST_FN_FUNC_FN(exp);
+ TEST_FN_FUNC_FN(exp2);
+ TEST_FN_FUNC_FN(exp10);
+ TEST_FN_FUNC_FN(expm1);
+ TEST_FN_FUNC_FN(fabs);
+ TEST_FN_FUNC_FN_FN(fdim);
+ TEST_FN_FUNC_FN(floor);
+ TEST_FN_FUNC_FN_FN_FN(fma);
+ TEST_FN_FUNC_FN_FN(fmax);
+ TEST_FN_FUNC_FN_F(fmax);
+ TEST_FN_FUNC_FN_FN(fmin);
+ TEST_FN_FUNC_FN_F(fmin);
+ TEST_FN_FUNC_FN_FN(fmod);
+ TEST_FN_FUNC_FN_PFN(fract);
+ TEST_FN_FUNC_FN_PIN(frexp);
+ TEST_FN_FUNC_FN_FN(hypot);
+ TEST_IN_FUNC_FN(ilogb);
+ TEST_FN_FUNC_FN_IN(ldexp);
+ TEST_FN_FUNC_FN_I(ldexp);
+ TEST_F_FUNC_FN(length);
+ TEST_FN_FUNC_FN(lgamma);
+ TEST_FN_FUNC_FN_PIN(lgamma);
+ TEST_FN_FUNC_FN(log);
+ TEST_FN_FUNC_FN(log2);
+ TEST_FN_FUNC_FN(log10);
+ TEST_FN_FUNC_FN(log1p);
+ TEST_FN_FUNC_FN(logb);
+ TEST_FN_FUNC_FN_FN_FN(mad);
+ TEST_FN_FUNC_FN_FN(max);
+ TEST_FN_FUNC_FN_F(max);
+ TEST_FN_FUNC_FN_FN(min);
+ TEST_FN_FUNC_FN_F(min);
+ TEST_FN_FUNC_FN_FN_FN(mix);
+ TEST_FN_FUNC_FN_FN_F(mix);
+ TEST_FN_FUNC_FN_PFN(modf);
+ // nan
+ TEST_FN_FUNC_FN_FN(nextafter);
+ TEST_FN_FUNC_FN(normalize);
+ TEST_FN_FUNC_FN_FN(pow);
+ TEST_FN_FUNC_FN_IN(pown);
+ TEST_FN_FUNC_FN_FN(powr);
+ TEST_FN_FUNC_FN(radians);
+ TEST_FN_FUNC_FN_FN(remainder);
+ TEST_FN_FUNC_FN_FN_PIN(remquo);
+ TEST_FN_FUNC_FN(rint);
+ TEST_FN_FUNC_FN_IN(rootn);
+ TEST_FN_FUNC_FN(round);
+ TEST_FN_FUNC_FN(rsqrt);
+ TEST_FN_FUNC_FN(sign);
+ TEST_FN_FUNC_FN(sin);
+ TEST_FN_FUNC_FN_PFN(sincos);
+ TEST_FN_FUNC_FN(sinh);
+ TEST_FN_FUNC_FN(sinpi);
+ TEST_FN_FUNC_FN(sqrt);
+ TEST_FN_FUNC_FN_FN(step);
+ TEST_FN_FUNC_FN_F(step);
+ TEST_FN_FUNC_FN(tan);
+ TEST_FN_FUNC_FN(tanh);
+ TEST_FN_FUNC_FN(tanpi);
+ TEST_FN_FUNC_FN(tgamma);
+ TEST_FN_FUNC_FN(trunc);
+
+ float time = end(index);
+
+ if (failed) {
+ rsDebug("test_fp_math FAILED", time);
+ }
+ else {
+ rsDebug("test_fp_math PASSED", time);
+ }
+
+ return failed;
+}
+
+static bool test_int_math(uint32_t index) {
+ bool failed = false;
+ start();
+
+ TEST_UIN_FUNC_IN(abs);
+ TEST_IN_FUNC_IN(clz);
+ TEST_IN_FUNC_IN_IN(min);
+ TEST_IN_FUNC_IN_IN(max);
+ TEST_I_FUNC_I_I_I(rsClamp);
+
+ float time = end(index);
+
+ if (failed) {
+ rsDebug("test_int_math FAILED", time);
+ }
+ else {
+ rsDebug("test_int_math PASSED", time);
+ }
+
+ return failed;
+}
+
+static bool test_basic_operators() {
+ bool failed = false;
+ int i = 0;
+
+ TEST_INT_OP(+);
+ TEST_INT_OP(-);
+ TEST_INT_OP(*);
+ TEST_INT_OP(/);
+ TEST_INT_OP(%);
+ TEST_INT_OP(<<);
+ TEST_INT_OP(>>);
+
+ if (failed) {
+ rsDebug("test_basic_operators FAILED", 0);
+ }
+ else {
+ rsDebug("test_basic_operators PASSED", 0);
+ }
+
+ return failed;
+}
+
+#define TEST_CVT(to, from, type) \
+rsDebug("Testing convert from " #from " to " #to, 0); \
+to##1 = from##1; \
+to##2 = convert_##type##2(from##2); \
+to##3 = convert_##type##3(from##3); \
+to##4 = convert_##type##4(from##4);
+
+#define TEST_CVT_MATRIX(to, type) \
+TEST_CVT(to, c, type); \
+TEST_CVT(to, uc, type); \
+TEST_CVT(to, s, type); \
+TEST_CVT(to, us, type); \
+TEST_CVT(to, i, type); \
+TEST_CVT(to, ui, type); \
+TEST_CVT(to, f, type); \
+
+static bool test_convert() {
+ bool failed = false;
+
+ TEST_CVT_MATRIX(c, char);
+ TEST_CVT_MATRIX(uc, uchar);
+ TEST_CVT_MATRIX(s, short);
+ TEST_CVT_MATRIX(us, ushort);
+ TEST_CVT_MATRIX(i, int);
+ TEST_CVT_MATRIX(ui, uint);
+ TEST_CVT_MATRIX(f, float);
+
+ if (failed) {
+ rsDebug("test_convert FAILED", 0);
+ }
+ else {
+ rsDebug("test_convert PASSED", 0);
+ }
+
+ return failed;
+}
+
+#define INIT_PREFIX_TYPE(prefix, type) \
+prefix##_##type##_1 = 1; \
+prefix##_##type##_2.x = 1; \
+prefix##_##type##_2.y = 1; \
+prefix##_##type##_3.x = 1; \
+prefix##_##type##_3.y = 1; \
+prefix##_##type##_3.z = 1; \
+prefix##_##type##_4.x = 1; \
+prefix##_##type##_4.y = 1; \
+prefix##_##type##_4.z = 1; \
+prefix##_##type##_4.w = 1;
+
+#define INIT_TYPE(type) \
+INIT_PREFIX_TYPE(src1, type) \
+INIT_PREFIX_TYPE(src2, type) \
+INIT_PREFIX_TYPE(res, type)
+
+#define INIT_ALL \
+INIT_TYPE(c); \
+INIT_TYPE(uc); \
+INIT_TYPE(s); \
+INIT_TYPE(us); \
+INIT_TYPE(i); \
+INIT_TYPE(ui);
+
+void math_test(uint32_t index, int test_num) {
+ bool failed = false;
+ INIT_ALL;
+ failed |= test_convert();
+ failed |= test_fp_math(index);
+ failed |= test_int_math(index);
+ failed |= test_basic_operators();
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/math.rs.bak b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/math.rs.bak
new file mode 100644
index 0000000..ad802ca
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/math.rs.bak
@@ -0,0 +1,423 @@
+#include "shared.rsh"
+
+// Testing math library
+
+volatile float f1;
+volatile float2 f2;
+volatile float3 f3;
+volatile float4 f4;
+
+volatile int i1;
+volatile int2 i2;
+volatile int3 i3;
+volatile int4 i4;
+
+volatile uint ui1;
+volatile uint2 ui2;
+volatile uint3 ui3;
+volatile uint4 ui4;
+
+volatile short s1;
+volatile short2 s2;
+volatile short3 s3;
+volatile short4 s4;
+
+volatile ushort us1;
+volatile ushort2 us2;
+volatile ushort3 us3;
+volatile ushort4 us4;
+
+volatile char c1;
+volatile char2 c2;
+volatile char3 c3;
+volatile char4 c4;
+
+volatile uchar uc1;
+volatile uchar2 uc2;
+volatile uchar3 uc3;
+volatile uchar4 uc4;
+
+#define DECL_INT(prefix) \
+volatile char prefix##_c_1 = 1; \
+volatile char2 prefix##_c_2 = 1; \
+volatile char3 prefix##_c_3 = 1; \
+volatile char4 prefix##_c_4 = 1; \
+volatile uchar prefix##_uc_1 = 1; \
+volatile uchar2 prefix##_uc_2 = 1; \
+volatile uchar3 prefix##_uc_3 = 1; \
+volatile uchar4 prefix##_uc_4 = 1; \
+volatile short prefix##_s_1 = 1; \
+volatile short2 prefix##_s_2 = 1; \
+volatile short3 prefix##_s_3 = 1; \
+volatile short4 prefix##_s_4 = 1; \
+volatile ushort prefix##_us_1 = 1; \
+volatile ushort2 prefix##_us_2 = 1; \
+volatile ushort3 prefix##_us_3 = 1; \
+volatile ushort4 prefix##_us_4 = 1; \
+volatile int prefix##_i_1 = 1; \
+volatile int2 prefix##_i_2 = 1; \
+volatile int3 prefix##_i_3 = 1; \
+volatile int4 prefix##_i_4 = 1; \
+volatile uint prefix##_ui_1 = 1; \
+volatile uint2 prefix##_ui_2 = 1; \
+volatile uint3 prefix##_ui_3 = 1; \
+volatile uint4 prefix##_ui_4 = 1; \
+volatile long prefix##_l_1 = 1; \
+volatile ulong prefix##_ul_1 = 1;
+
+DECL_INT(res)
+DECL_INT(src1)
+DECL_INT(src2)
+
+#define TEST_INT_OP_TYPE(op, type) \
+rsDebug("Testing " #op " for " #type "3", i++); \
+res_##type##_3 = src1_##type##_3 op src2_##type##_3; \
+
+#define TEST_INT_OP(op) \
+TEST_INT_OP_TYPE(op, c) \
+TEST_INT_OP_TYPE(op, uc) \
+
+#define TEST_XN_FUNC_YN(typeout, fnc, typein) \
+ res_##typeout##_1 = fnc(src1_##typein##_1); \
+ res_##typeout##_2 = fnc(src1_##typein##_2); \
+ res_##typeout##_3 = fnc(src1_##typein##_3); \
+ res_##typeout##_4 = fnc(src1_##typein##_4);
+
+#define TEST_XN_FUNC_XN_XN(type, fnc) \
+ res_##type##_1 = fnc(src1_##type##_1, src2_##type##_1); \
+ res_##type##_2 = fnc(src1_##type##_2, src2_##type##_2); \
+ res_##type##_3 = fnc(src1_##type##_3, src2_##type##_3); \
+ res_##type##_4 = fnc(src1_##type##_4, src2_##type##_4);
+
+#define TEST_X_FUNC_X_X_X(type, fnc) \
+ res_##type##_1 = fnc(src1_##type##_1, src2_##type##_1, src2_##type##_1);
+
+#define TEST_IN_FUNC_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_XN_FUNC_YN(uc, fnc, uc) \
+ TEST_XN_FUNC_YN(c, fnc, c) \
+ TEST_XN_FUNC_YN(us, fnc, us) \
+ TEST_XN_FUNC_YN(s, fnc, s) \
+ TEST_XN_FUNC_YN(ui, fnc, ui) \
+ TEST_XN_FUNC_YN(i, fnc, i)
+
+#define TEST_UIN_FUNC_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_XN_FUNC_YN(uc, fnc, c) \
+ TEST_XN_FUNC_YN(us, fnc, s) \
+ TEST_XN_FUNC_YN(ui, fnc, i) \
+
+#define TEST_IN_FUNC_IN_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_XN_FUNC_XN_XN(uc, fnc) \
+ TEST_XN_FUNC_XN_XN(c, fnc) \
+ TEST_XN_FUNC_XN_XN(us, fnc) \
+ TEST_XN_FUNC_XN_XN(s, fnc) \
+ TEST_XN_FUNC_XN_XN(ui, fnc) \
+ TEST_XN_FUNC_XN_XN(i, fnc)
+
+#define TEST_I_FUNC_I_I_I(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_X_FUNC_X_X_X(uc, fnc) \
+ TEST_X_FUNC_X_X_X(c, fnc) \
+ TEST_X_FUNC_X_X_X(us, fnc) \
+ TEST_X_FUNC_X_X_X(s, fnc) \
+ TEST_X_FUNC_X_X_X(ui, fnc) \
+ TEST_X_FUNC_X_X_X(i, fnc)
+
+#define TEST_FN_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1); \
+ f2 = fnc(f2); \
+ f3 = fnc(f3); \
+ f4 = fnc(f4);
+
+#define TEST_FN_FUNC_FN_PFN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, (float*) &f1); \
+ f2 = fnc(f2, (float2*) &f2); \
+ f3 = fnc(f3, (float3*) &f3); \
+ f4 = fnc(f4, (float4*) &f4);
+
+#define TEST_FN_FUNC_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f2 = fnc(f2, f2); \
+ f3 = fnc(f3, f3); \
+ f4 = fnc(f4, f4);
+
+#define TEST_F34_FUNC_F34_F34(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f3 = fnc(f3, f3); \
+ f4 = fnc(f4, f4);
+
+#define TEST_FN_FUNC_FN_F(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f2 = fnc(f2, f1); \
+ f3 = fnc(f3, f1); \
+ f4 = fnc(f4, f1);
+
+#define TEST_F_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1); \
+ f1 = fnc(f2); \
+ f1 = fnc(f3); \
+ f1 = fnc(f4);
+
+#define TEST_F_FUNC_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f1 = fnc(f2, f2); \
+ f1 = fnc(f3, f3); \
+ f1 = fnc(f4, f4);
+
+#define TEST_FN_FUNC_FN_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, i1); \
+ f2 = fnc(f2, i2); \
+ f3 = fnc(f3, i3); \
+ f4 = fnc(f4, i4);
+
+#define TEST_FN_FUNC_FN_I(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, i1); \
+ f2 = fnc(f2, i1); \
+ f3 = fnc(f3, i1); \
+ f4 = fnc(f4, i1);
+
+#define TEST_FN_FUNC_FN_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, f1); \
+ f2 = fnc(f2, f2, f2); \
+ f3 = fnc(f3, f3, f3); \
+ f4 = fnc(f4, f4, f4);
+
+#define TEST_FN_FUNC_FN_FN_F(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, f1); \
+ f2 = fnc(f2, f1, f1); \
+ f3 = fnc(f3, f1, f1); \
+ f4 = fnc(f4, f1, f1);
+
+#define TEST_FN_FUNC_FN_PIN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, (int*) &i1); \
+ f2 = fnc(f2, (int2*) &i2); \
+ f3 = fnc(f3, (int3*) &i3); \
+ f4 = fnc(f4, (int4*) &i4);
+
+#define TEST_FN_FUNC_FN_FN_PIN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, (int*) &i1); \
+ f2 = fnc(f2, f2, (int2*) &i2); \
+ f3 = fnc(f3, f3, (int3*) &i3); \
+ f4 = fnc(f4, f4, (int4*) &i4);
+
+#define TEST_IN_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ i1 = fnc(f1); \
+ i2 = fnc(f2); \
+ i3 = fnc(f3); \
+ i4 = fnc(f4);
+
+static bool test_fp_math(uint32_t index) {
+ bool failed = false;
+ start();
+
+ TEST_FN_FUNC_FN(acos);
+ TEST_FN_FUNC_FN(acosh);
+ TEST_FN_FUNC_FN(acospi);
+ TEST_FN_FUNC_FN(asin);
+ TEST_FN_FUNC_FN(asinh);
+ TEST_FN_FUNC_FN(asinpi);
+ TEST_FN_FUNC_FN(atan);
+ TEST_FN_FUNC_FN_FN(atan2);
+ TEST_FN_FUNC_FN(atanh);
+ TEST_FN_FUNC_FN(atanpi);
+ TEST_FN_FUNC_FN_FN(atan2pi);
+ TEST_FN_FUNC_FN(cbrt);
+ TEST_FN_FUNC_FN(ceil);
+ TEST_FN_FUNC_FN_FN_FN(clamp);
+ TEST_FN_FUNC_FN_FN_F(clamp);
+ TEST_FN_FUNC_FN_FN(copysign);
+ TEST_FN_FUNC_FN(cos);
+ TEST_FN_FUNC_FN(cosh);
+ TEST_FN_FUNC_FN(cospi);
+ TEST_F34_FUNC_F34_F34(cross);
+ TEST_FN_FUNC_FN(degrees);
+ TEST_F_FUNC_FN_FN(distance);
+ TEST_F_FUNC_FN_FN(dot);
+ TEST_FN_FUNC_FN(erfc);
+ TEST_FN_FUNC_FN(erf);
+ TEST_FN_FUNC_FN(exp);
+ TEST_FN_FUNC_FN(exp2);
+ TEST_FN_FUNC_FN(exp10);
+ TEST_FN_FUNC_FN(expm1);
+ TEST_FN_FUNC_FN(fabs);
+ TEST_FN_FUNC_FN_FN(fdim);
+ TEST_FN_FUNC_FN(floor);
+ TEST_FN_FUNC_FN_FN_FN(fma);
+ TEST_FN_FUNC_FN_FN(fmax);
+ TEST_FN_FUNC_FN_F(fmax);
+ TEST_FN_FUNC_FN_FN(fmin);
+ TEST_FN_FUNC_FN_F(fmin);
+ TEST_FN_FUNC_FN_FN(fmod);
+ TEST_FN_FUNC_FN_PFN(fract);
+ TEST_FN_FUNC_FN_PIN(frexp);
+ TEST_FN_FUNC_FN_FN(hypot);
+ TEST_IN_FUNC_FN(ilogb);
+ TEST_FN_FUNC_FN_IN(ldexp);
+ TEST_FN_FUNC_FN_I(ldexp);
+ TEST_F_FUNC_FN(length);
+ TEST_FN_FUNC_FN(lgamma);
+ TEST_FN_FUNC_FN_PIN(lgamma);
+ TEST_FN_FUNC_FN(log);
+ TEST_FN_FUNC_FN(log2);
+ TEST_FN_FUNC_FN(log10);
+ TEST_FN_FUNC_FN(log1p);
+ TEST_FN_FUNC_FN(logb);
+ TEST_FN_FUNC_FN_FN_FN(mad);
+ TEST_FN_FUNC_FN_FN(max);
+ TEST_FN_FUNC_FN_F(max);
+ TEST_FN_FUNC_FN_FN(min);
+ TEST_FN_FUNC_FN_F(min);
+ TEST_FN_FUNC_FN_FN_FN(mix);
+ TEST_FN_FUNC_FN_FN_F(mix);
+ TEST_FN_FUNC_FN_PFN(modf);
+ // nan
+ TEST_FN_FUNC_FN_FN(nextafter);
+ TEST_FN_FUNC_FN(normalize);
+ TEST_FN_FUNC_FN_FN(pow);
+ TEST_FN_FUNC_FN_IN(pown);
+ TEST_FN_FUNC_FN_FN(powr);
+ TEST_FN_FUNC_FN(radians);
+ TEST_FN_FUNC_FN_FN(remainder);
+ TEST_FN_FUNC_FN_FN_PIN(remquo);
+ TEST_FN_FUNC_FN(rint);
+ TEST_FN_FUNC_FN_IN(rootn);
+ TEST_FN_FUNC_FN(round);
+ TEST_FN_FUNC_FN(rsqrt);
+ TEST_FN_FUNC_FN(sign);
+ TEST_FN_FUNC_FN(sin);
+ TEST_FN_FUNC_FN_PFN(sincos);
+ TEST_FN_FUNC_FN(sinh);
+ TEST_FN_FUNC_FN(sinpi);
+ TEST_FN_FUNC_FN(sqrt);
+ TEST_FN_FUNC_FN_FN(step);
+ TEST_FN_FUNC_FN_F(step);
+ TEST_FN_FUNC_FN(tan);
+ TEST_FN_FUNC_FN(tanh);
+ TEST_FN_FUNC_FN(tanpi);
+ TEST_FN_FUNC_FN(tgamma);
+ TEST_FN_FUNC_FN(trunc);
+
+ float time = end(index);
+
+ if (failed) {
+ rsDebug("test_fp_math FAILED", time);
+ }
+ else {
+ rsDebug("test_fp_math PASSED", time);
+ }
+
+ return failed;
+}
+
+static bool test_int_math(uint32_t index) {
+ bool failed = false;
+ start();
+
+ TEST_UIN_FUNC_IN(abs);
+ TEST_IN_FUNC_IN(clz);
+ TEST_IN_FUNC_IN_IN(min);
+ TEST_IN_FUNC_IN_IN(max);
+ TEST_I_FUNC_I_I_I(rsClamp);
+
+ float time = end(index);
+
+ if (failed) {
+ rsDebug("test_int_math FAILED", time);
+ }
+ else {
+ rsDebug("test_int_math PASSED", time);
+ }
+
+ return failed;
+}
+
+static bool test_basic_operators() {
+ bool failed = false;
+ int i = 0;
+
+ TEST_INT_OP(+);
+ TEST_INT_OP(-);
+ TEST_INT_OP(*);
+ TEST_INT_OP(/);
+ TEST_INT_OP(%);
+ TEST_INT_OP(<<);
+ TEST_INT_OP(>>);
+
+ if (failed) {
+ rsDebug("test_basic_operators FAILED", 0);
+ }
+ else {
+ rsDebug("test_basic_operators PASSED", 0);
+ }
+
+ return failed;
+}
+
+#define TEST_CVT(to, from, type) \
+rsDebug("Testing convert from " #from " to " #to, 0); \
+to##1 = from##1; \
+to##2 = convert_##type##2(from##2); \
+to##3 = convert_##type##3(from##3); \
+to##4 = convert_##type##4(from##4);
+
+#define TEST_CVT_MATRIX(to, type) \
+TEST_CVT(to, c, type); \
+TEST_CVT(to, uc, type); \
+TEST_CVT(to, s, type); \
+TEST_CVT(to, us, type); \
+TEST_CVT(to, i, type); \
+TEST_CVT(to, ui, type); \
+TEST_CVT(to, f, type); \
+
+static bool test_convert() {
+ bool failed = false;
+
+ TEST_CVT_MATRIX(c, char);
+ TEST_CVT_MATRIX(uc, uchar);
+ TEST_CVT_MATRIX(s, short);
+ TEST_CVT_MATRIX(us, ushort);
+ TEST_CVT_MATRIX(i, int);
+ TEST_CVT_MATRIX(ui, uint);
+ TEST_CVT_MATRIX(f, float);
+
+ if (failed) {
+ rsDebug("test_convert FAILED", 0);
+ }
+ else {
+ rsDebug("test_convert PASSED", 0);
+ }
+
+ return failed;
+}
+
+void math_test(uint32_t index, int test_num) {
+ bool failed = false;
+ rsDebug("Here ", 1);
+ res_uc_3 = src1_uc_3 / src2_uc_3;
+ rsDebug("Here ", 2);
+ failed |= test_basic_operators();
+ rsDebug("Here ", 3);
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/math.rs.orig b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/math.rs.orig
new file mode 100644
index 0000000..aae29a4
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/math.rs.orig
@@ -0,0 +1,436 @@
+#include "shared.rsh"
+
+// Testing math library
+
+volatile float f1;
+volatile float2 f2;
+volatile float3 f3;
+volatile float4 f4;
+
+volatile int i1;
+volatile int2 i2;
+volatile int3 i3;
+volatile int4 i4;
+
+volatile uint ui1;
+volatile uint2 ui2;
+volatile uint3 ui3;
+volatile uint4 ui4;
+
+volatile short s1;
+volatile short2 s2;
+volatile short3 s3;
+volatile short4 s4;
+
+volatile ushort us1;
+volatile ushort2 us2;
+volatile ushort3 us3;
+volatile ushort4 us4;
+
+volatile char c1;
+volatile char2 c2;
+volatile char3 c3;
+volatile char4 c4;
+
+volatile uchar uc1;
+volatile uchar2 uc2;
+volatile uchar3 uc3;
+volatile uchar4 uc4;
+
+#define DECL_INT(prefix) \
+volatile char prefix##_c_1 = 1; \
+volatile char2 prefix##_c_2 = 1; \
+volatile char3 prefix##_c_3 = 1; \
+volatile char4 prefix##_c_4 = 1; \
+volatile uchar prefix##_uc_1 = 1; \
+volatile uchar2 prefix##_uc_2 = 1; \
+volatile uchar3 prefix##_uc_3 = 1; \
+volatile uchar4 prefix##_uc_4 = 1; \
+volatile short prefix##_s_1 = 1; \
+volatile short2 prefix##_s_2 = 1; \
+volatile short3 prefix##_s_3 = 1; \
+volatile short4 prefix##_s_4 = 1; \
+volatile ushort prefix##_us_1 = 1; \
+volatile ushort2 prefix##_us_2 = 1; \
+volatile ushort3 prefix##_us_3 = 1; \
+volatile ushort4 prefix##_us_4 = 1; \
+volatile int prefix##_i_1 = 1; \
+volatile int2 prefix##_i_2 = 1; \
+volatile int3 prefix##_i_3 = 1; \
+volatile int4 prefix##_i_4 = 1; \
+volatile uint prefix##_ui_1 = 1; \
+volatile uint2 prefix##_ui_2 = 1; \
+volatile uint3 prefix##_ui_3 = 1; \
+volatile uint4 prefix##_ui_4 = 1; \
+volatile long prefix##_l_1 = 1; \
+volatile ulong prefix##_ul_1 = 1;
+
+DECL_INT(res)
+DECL_INT(src1)
+DECL_INT(src2)
+
+#define TEST_INT_OP_TYPE(op, type) \
+rsDebug("Testing " #op " for " #type "1", i++); \
+res_##type##_1 = src1_##type##_1 op src2_##type##_1; \
+rsDebug("Testing " #op " for " #type "2", i++); \
+res_##type##_2 = src1_##type##_2 op src2_##type##_2; \
+rsDebug("Testing " #op " for " #type "3", i++); \
+res_##type##_3 = src1_##type##_3 op src2_##type##_3; \
+rsDebug("Testing " #op " for " #type "4", i++); \
+res_##type##_4 = src1_##type##_4 op src2_##type##_4;
+
+#define TEST_INT_OP(op) \
+TEST_INT_OP_TYPE(op, c) \
+TEST_INT_OP_TYPE(op, uc) \
+TEST_INT_OP_TYPE(op, s) \
+TEST_INT_OP_TYPE(op, us) \
+TEST_INT_OP_TYPE(op, i) \
+TEST_INT_OP_TYPE(op, ui) \
+rsDebug("Testing " #op " for l1", i++); \
+res_l_1 = src1_l_1 op src2_l_1; \
+rsDebug("Testing " #op " for ul1", i++); \
+res_ul_1 = src1_ul_1 op src2_ul_1;
+
+#define TEST_XN_FUNC_YN(typeout, fnc, typein) \
+ res_##typeout##_1 = fnc(src1_##typein##_1); \
+ res_##typeout##_2 = fnc(src1_##typein##_2); \
+ res_##typeout##_3 = fnc(src1_##typein##_3); \
+ res_##typeout##_4 = fnc(src1_##typein##_4);
+
+#define TEST_XN_FUNC_XN_XN(type, fnc) \
+ res_##type##_1 = fnc(src1_##type##_1, src2_##type##_1); \
+ res_##type##_2 = fnc(src1_##type##_2, src2_##type##_2); \
+ res_##type##_3 = fnc(src1_##type##_3, src2_##type##_3); \
+ res_##type##_4 = fnc(src1_##type##_4, src2_##type##_4);
+
+#define TEST_X_FUNC_X_X_X(type, fnc) \
+ res_##type##_1 = fnc(src1_##type##_1, src2_##type##_1, src2_##type##_1);
+
+#define TEST_IN_FUNC_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_XN_FUNC_YN(uc, fnc, uc) \
+ TEST_XN_FUNC_YN(c, fnc, c) \
+ TEST_XN_FUNC_YN(us, fnc, us) \
+ TEST_XN_FUNC_YN(s, fnc, s) \
+ TEST_XN_FUNC_YN(ui, fnc, ui) \
+ TEST_XN_FUNC_YN(i, fnc, i)
+
+#define TEST_UIN_FUNC_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_XN_FUNC_YN(uc, fnc, c) \
+ TEST_XN_FUNC_YN(us, fnc, s) \
+ TEST_XN_FUNC_YN(ui, fnc, i) \
+
+#define TEST_IN_FUNC_IN_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_XN_FUNC_XN_XN(uc, fnc) \
+ TEST_XN_FUNC_XN_XN(c, fnc) \
+ TEST_XN_FUNC_XN_XN(us, fnc) \
+ TEST_XN_FUNC_XN_XN(s, fnc) \
+ TEST_XN_FUNC_XN_XN(ui, fnc) \
+ TEST_XN_FUNC_XN_XN(i, fnc)
+
+#define TEST_I_FUNC_I_I_I(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ TEST_X_FUNC_X_X_X(uc, fnc) \
+ TEST_X_FUNC_X_X_X(c, fnc) \
+ TEST_X_FUNC_X_X_X(us, fnc) \
+ TEST_X_FUNC_X_X_X(s, fnc) \
+ TEST_X_FUNC_X_X_X(ui, fnc) \
+ TEST_X_FUNC_X_X_X(i, fnc)
+
+#define TEST_FN_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1); \
+ f2 = fnc(f2); \
+ f3 = fnc(f3); \
+ f4 = fnc(f4);
+
+#define TEST_FN_FUNC_FN_PFN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, (float*) &f1); \
+ f2 = fnc(f2, (float2*) &f2); \
+ f3 = fnc(f3, (float3*) &f3); \
+ f4 = fnc(f4, (float4*) &f4);
+
+#define TEST_FN_FUNC_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f2 = fnc(f2, f2); \
+ f3 = fnc(f3, f3); \
+ f4 = fnc(f4, f4);
+
+#define TEST_F34_FUNC_F34_F34(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f3 = fnc(f3, f3); \
+ f4 = fnc(f4, f4);
+
+#define TEST_FN_FUNC_FN_F(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f2 = fnc(f2, f1); \
+ f3 = fnc(f3, f1); \
+ f4 = fnc(f4, f1);
+
+#define TEST_F_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1); \
+ f1 = fnc(f2); \
+ f1 = fnc(f3); \
+ f1 = fnc(f4);
+
+#define TEST_F_FUNC_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1); \
+ f1 = fnc(f2, f2); \
+ f1 = fnc(f3, f3); \
+ f1 = fnc(f4, f4);
+
+#define TEST_FN_FUNC_FN_IN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, i1); \
+ f2 = fnc(f2, i2); \
+ f3 = fnc(f3, i3); \
+ f4 = fnc(f4, i4);
+
+#define TEST_FN_FUNC_FN_I(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, i1); \
+ f2 = fnc(f2, i1); \
+ f3 = fnc(f3, i1); \
+ f4 = fnc(f4, i1);
+
+#define TEST_FN_FUNC_FN_FN_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, f1); \
+ f2 = fnc(f2, f2, f2); \
+ f3 = fnc(f3, f3, f3); \
+ f4 = fnc(f4, f4, f4);
+
+#define TEST_FN_FUNC_FN_FN_F(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, f1); \
+ f2 = fnc(f2, f1, f1); \
+ f3 = fnc(f3, f1, f1); \
+ f4 = fnc(f4, f1, f1);
+
+#define TEST_FN_FUNC_FN_PIN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, (int*) &i1); \
+ f2 = fnc(f2, (int2*) &i2); \
+ f3 = fnc(f3, (int3*) &i3); \
+ f4 = fnc(f4, (int4*) &i4);
+
+#define TEST_FN_FUNC_FN_FN_PIN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ f1 = fnc(f1, f1, (int*) &i1); \
+ f2 = fnc(f2, f2, (int2*) &i2); \
+ f3 = fnc(f3, f3, (int3*) &i3); \
+ f4 = fnc(f4, f4, (int4*) &i4);
+
+#define TEST_IN_FUNC_FN(fnc) \
+ rsDebug("Testing " #fnc, 0); \
+ i1 = fnc(f1); \
+ i2 = fnc(f2); \
+ i3 = fnc(f3); \
+ i4 = fnc(f4);
+
+static bool test_fp_math(uint32_t index) {
+ bool failed = false;
+ start();
+
+ TEST_FN_FUNC_FN(acos);
+ TEST_FN_FUNC_FN(acosh);
+ TEST_FN_FUNC_FN(acospi);
+ TEST_FN_FUNC_FN(asin);
+ TEST_FN_FUNC_FN(asinh);
+ TEST_FN_FUNC_FN(asinpi);
+ TEST_FN_FUNC_FN(atan);
+ TEST_FN_FUNC_FN_FN(atan2);
+ TEST_FN_FUNC_FN(atanh);
+ TEST_FN_FUNC_FN(atanpi);
+ TEST_FN_FUNC_FN_FN(atan2pi);
+ TEST_FN_FUNC_FN(cbrt);
+ TEST_FN_FUNC_FN(ceil);
+ TEST_FN_FUNC_FN_FN_FN(clamp);
+ TEST_FN_FUNC_FN_FN_F(clamp);
+ TEST_FN_FUNC_FN_FN(copysign);
+ TEST_FN_FUNC_FN(cos);
+ TEST_FN_FUNC_FN(cosh);
+ TEST_FN_FUNC_FN(cospi);
+ TEST_F34_FUNC_F34_F34(cross);
+ TEST_FN_FUNC_FN(degrees);
+ TEST_F_FUNC_FN_FN(distance);
+ TEST_F_FUNC_FN_FN(dot);
+ TEST_FN_FUNC_FN(erfc);
+ TEST_FN_FUNC_FN(erf);
+ TEST_FN_FUNC_FN(exp);
+ TEST_FN_FUNC_FN(exp2);
+ TEST_FN_FUNC_FN(exp10);
+ TEST_FN_FUNC_FN(expm1);
+ TEST_FN_FUNC_FN(fabs);
+ TEST_FN_FUNC_FN_FN(fdim);
+ TEST_FN_FUNC_FN(floor);
+ TEST_FN_FUNC_FN_FN_FN(fma);
+ TEST_FN_FUNC_FN_FN(fmax);
+ TEST_FN_FUNC_FN_F(fmax);
+ TEST_FN_FUNC_FN_FN(fmin);
+ TEST_FN_FUNC_FN_F(fmin);
+ TEST_FN_FUNC_FN_FN(fmod);
+ TEST_FN_FUNC_FN_PFN(fract);
+ TEST_FN_FUNC_FN_PIN(frexp);
+ TEST_FN_FUNC_FN_FN(hypot);
+ TEST_IN_FUNC_FN(ilogb);
+ TEST_FN_FUNC_FN_IN(ldexp);
+ TEST_FN_FUNC_FN_I(ldexp);
+ TEST_F_FUNC_FN(length);
+ TEST_FN_FUNC_FN(lgamma);
+ TEST_FN_FUNC_FN_PIN(lgamma);
+ TEST_FN_FUNC_FN(log);
+ TEST_FN_FUNC_FN(log2);
+ TEST_FN_FUNC_FN(log10);
+ TEST_FN_FUNC_FN(log1p);
+ TEST_FN_FUNC_FN(logb);
+ TEST_FN_FUNC_FN_FN_FN(mad);
+ TEST_FN_FUNC_FN_FN(max);
+ TEST_FN_FUNC_FN_F(max);
+ TEST_FN_FUNC_FN_FN(min);
+ TEST_FN_FUNC_FN_F(min);
+ TEST_FN_FUNC_FN_FN_FN(mix);
+ TEST_FN_FUNC_FN_FN_F(mix);
+ TEST_FN_FUNC_FN_PFN(modf);
+ // nan
+ TEST_FN_FUNC_FN_FN(nextafter);
+ TEST_FN_FUNC_FN(normalize);
+ TEST_FN_FUNC_FN_FN(pow);
+ TEST_FN_FUNC_FN_IN(pown);
+ TEST_FN_FUNC_FN_FN(powr);
+ TEST_FN_FUNC_FN(radians);
+ TEST_FN_FUNC_FN_FN(remainder);
+ TEST_FN_FUNC_FN_FN_PIN(remquo);
+ TEST_FN_FUNC_FN(rint);
+ TEST_FN_FUNC_FN_IN(rootn);
+ TEST_FN_FUNC_FN(round);
+ TEST_FN_FUNC_FN(rsqrt);
+ TEST_FN_FUNC_FN(sign);
+ TEST_FN_FUNC_FN(sin);
+ TEST_FN_FUNC_FN_PFN(sincos);
+ TEST_FN_FUNC_FN(sinh);
+ TEST_FN_FUNC_FN(sinpi);
+ TEST_FN_FUNC_FN(sqrt);
+ TEST_FN_FUNC_FN_FN(step);
+ TEST_FN_FUNC_FN_F(step);
+ TEST_FN_FUNC_FN(tan);
+ TEST_FN_FUNC_FN(tanh);
+ TEST_FN_FUNC_FN(tanpi);
+ TEST_FN_FUNC_FN(tgamma);
+ TEST_FN_FUNC_FN(trunc);
+
+ float time = end(index);
+
+ if (failed) {
+ rsDebug("test_fp_math FAILED", time);
+ }
+ else {
+ rsDebug("test_fp_math PASSED", time);
+ }
+
+ return failed;
+}
+
+static bool test_int_math(uint32_t index) {
+ bool failed = false;
+ start();
+
+ TEST_UIN_FUNC_IN(abs);
+ TEST_IN_FUNC_IN(clz);
+ TEST_IN_FUNC_IN_IN(min);
+ TEST_IN_FUNC_IN_IN(max);
+ TEST_I_FUNC_I_I_I(rsClamp);
+
+ float time = end(index);
+
+ if (failed) {
+ rsDebug("test_int_math FAILED", time);
+ }
+ else {
+ rsDebug("test_int_math PASSED", time);
+ }
+
+ return failed;
+}
+
+static bool test_basic_operators() {
+ bool failed = false;
+ int i = 0;
+
+ TEST_INT_OP(+);
+ TEST_INT_OP(-);
+ TEST_INT_OP(*);
+ TEST_INT_OP(/);
+ TEST_INT_OP(%);
+ TEST_INT_OP(<<);
+ TEST_INT_OP(>>);
+
+ if (failed) {
+ rsDebug("test_basic_operators FAILED", 0);
+ }
+ else {
+ rsDebug("test_basic_operators PASSED", 0);
+ }
+
+ return failed;
+}
+
+#define TEST_CVT(to, from, type) \
+rsDebug("Testing convert from " #from " to " #to, 0); \
+to##1 = from##1; \
+to##2 = convert_##type##2(from##2); \
+to##3 = convert_##type##3(from##3); \
+to##4 = convert_##type##4(from##4);
+
+#define TEST_CVT_MATRIX(to, type) \
+TEST_CVT(to, c, type); \
+TEST_CVT(to, uc, type); \
+TEST_CVT(to, s, type); \
+TEST_CVT(to, us, type); \
+TEST_CVT(to, i, type); \
+TEST_CVT(to, ui, type); \
+TEST_CVT(to, f, type); \
+
+static bool test_convert() {
+ bool failed = false;
+
+ TEST_CVT_MATRIX(c, char);
+ TEST_CVT_MATRIX(uc, uchar);
+ TEST_CVT_MATRIX(s, short);
+ TEST_CVT_MATRIX(us, ushort);
+ TEST_CVT_MATRIX(i, int);
+ TEST_CVT_MATRIX(ui, uint);
+ TEST_CVT_MATRIX(f, float);
+
+ if (failed) {
+ rsDebug("test_convert FAILED", 0);
+ }
+ else {
+ rsDebug("test_convert PASSED", 0);
+ }
+
+ return failed;
+}
+
+void math_test(uint32_t index, int test_num) {
+ bool failed = false;
+ failed |= test_convert();
+ failed |= test_fp_math(index);
+ failed |= test_int_math(index);
+ failed |= test_basic_operators();
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/primitives.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/primitives.rs
new file mode 100644
index 0000000..ce451da
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/primitives.rs
@@ -0,0 +1,61 @@
+#include "shared.rsh"
+
+// Testing primitive types
+float floatTest = 1.99f;
+double doubleTest = 2.05;
+char charTest = -8;
+short shortTest = -16;
+int intTest = -32;
+long longTest = 17179869184l; // 1 << 34
+long long longlongTest = 68719476736l; // 1 << 36
+
+uchar ucharTest = 8;
+ushort ushortTest = 16;
+uint uintTest = 32;
+ulong ulongTest = 4611686018427387904L;
+int64_t int64_tTest = -17179869184l; // - 1 << 34
+uint64_t uint64_tTest = 117179869184l;
+
+static bool test_primitive_types(uint32_t index) {
+ bool failed = false;
+ start();
+
+ _RS_ASSERT(floatTest == 2.99f);
+ _RS_ASSERT(doubleTest == 3.05);
+ _RS_ASSERT(charTest == -16);
+ _RS_ASSERT(shortTest == -32);
+ _RS_ASSERT(intTest == -64);
+ _RS_ASSERT(longTest == 17179869185l);
+ _RS_ASSERT(longlongTest == 68719476735l);
+
+ _RS_ASSERT(ucharTest == 8);
+ _RS_ASSERT(ushortTest == 16);
+ _RS_ASSERT(uintTest == 32);
+ _RS_ASSERT(ulongTest == 4611686018427387903L);
+ _RS_ASSERT(int64_tTest == -17179869184l);
+ _RS_ASSERT(uint64_tTest == 117179869185l);
+
+ float time = end(index);
+
+ if (failed) {
+ rsDebug("test_primitives FAILED", time);
+ }
+ else {
+ rsDebug("test_primitives PASSED", time);
+ }
+
+ return failed;
+}
+
+void primitives_test(uint32_t index, int test_num) {
+ bool failed = false;
+ failed |= test_primitive_types(index);
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/refcount.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/refcount.rs
new file mode 100644
index 0000000..4ea70e2
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/refcount.rs
@@ -0,0 +1,13 @@
+#include "shared.rsh"
+
+// Testing reference counting of RS object types
+
+rs_allocation globalA;
+static rs_allocation staticGlobalA;
+
+void refcount_test() {
+ staticGlobalA = globalA;
+ rsClearObject(&globalA);
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rsdebug.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rsdebug.rs
new file mode 100644
index 0000000..f7942a5
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rsdebug.rs
@@ -0,0 +1,56 @@
+#include "shared.rsh"
+
+// Testing primitive types
+float floatTest = 1.99f;
+double doubleTest = 2.05;
+char charTest = -8;
+short shortTest = -16;
+int intTest = -32;
+long longTest = 17179869184l; // 1 << 34
+long long longlongTest = 68719476736l; // 1 << 36
+
+uchar ucharTest = 8;
+ushort ushortTest = 16;
+uint uintTest = 32;
+ulong ulongTest = 4611686018427387904L;
+int64_t int64_tTest = -17179869184l; // - 1 << 34
+uint64_t uint64_tTest = 117179869184l;
+
+static bool basic_test(uint32_t index) {
+ bool failed = false;
+
+ // This test focuses primarily on compilation-time, not run-time.
+ // For this reason, none of the outputs are actually checked.
+
+ rsDebug("floatTest", floatTest);
+ rsDebug("doubleTest", doubleTest);
+ rsDebug("charTest", charTest);
+ rsDebug("shortTest", shortTest);
+ rsDebug("intTest", intTest);
+ rsDebug("longTest", longTest);
+ rsDebug("longlongTest", longlongTest);
+
+ rsDebug("ucharTest", ucharTest);
+ rsDebug("ushortTest", ushortTest);
+ rsDebug("uintTest", uintTest);
+ rsDebug("ulongTest", ulongTest);
+ rsDebug("int64_tTest", int64_tTest);
+ rsDebug("uint64_tTest", uint64_tTest);
+
+ return failed;
+}
+
+void test_rsdebug(uint32_t index, int test_num) {
+ bool failed = false;
+ failed |= basic_test(index);
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ rsDebug("rsdebug_test FAILED", -1);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ rsDebug("rsdebug_test PASSED", 0);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rslist.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rslist.rs
new file mode 100644
index 0000000..b3d8b9e
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rslist.rs
@@ -0,0 +1,107 @@
+// Copyright (C) 2009 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.
+
+#pragma version(1)
+
+#pragma rs java_package_name(com.android.rs.test_v14)
+
+#include "rs_graphics.rsh"
+
+float gDY;
+
+rs_font gFont;
+
+typedef struct ListAllocs_s {
+ rs_allocation text;
+ int result;
+} ListAllocs;
+
+ListAllocs *gList;
+
+void init() {
+ gDY = 0.0f;
+}
+
+int textPos = 0;
+
+int root(void) {
+
+ rsgClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ rsgClearDepth(1.0f);
+
+ textPos -= (int)gDY*2;
+ gDY *= 0.95;
+
+ rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f);
+ rsgBindFont(gFont);
+
+ rs_allocation listAlloc;
+ listAlloc = rsGetAllocation(gList);
+ int allocSize = rsAllocationGetDimX(listAlloc);
+
+ int width = rsgGetWidth();
+ int height = rsgGetHeight();
+
+ int itemHeight = 80;
+ int totalItemHeight = itemHeight * allocSize;
+
+ /* Prevent scrolling above the top of the list */
+ int firstItem = height - totalItemHeight;
+ if (firstItem < 0) {
+ firstItem = 0;
+ }
+
+ /* Prevent scrolling past the last line of the list */
+ int lastItem = -1 * (totalItemHeight - height);
+ if (lastItem > 0) {
+ lastItem = 0;
+ }
+
+ if (textPos > firstItem) {
+ textPos = firstItem;
+ }
+ else if (textPos < lastItem) {
+ textPos = lastItem;
+ }
+
+ int currentYPos = itemHeight + textPos;
+
+ for(int i = 0; i < allocSize; i ++) {
+ if(currentYPos - itemHeight > height) {
+ break;
+ }
+
+ if(currentYPos > 0) {
+ switch(gList[i].result) {
+ case 1: /* Passed */
+ rsgFontColor(0.5f, 0.9f, 0.5f, 1.0f);
+ break;
+ case -1: /* Failed */
+ rsgFontColor(0.9f, 0.5f, 0.5f, 1.0f);
+ break;
+ case 0: /* Still Testing */
+ rsgFontColor(0.9f, 0.9f, 0.5f, 1.0f);
+ break;
+ default: /* Unknown */
+ rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f);
+ break;
+ }
+ rsgDrawRect(0, currentYPos - 1, width, currentYPos, 0);
+ rsgDrawText(gList[i].text, 30, currentYPos - 32);
+ }
+ currentYPos += itemHeight;
+ }
+
+ return 10;
+}
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rstime.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rstime.rs
new file mode 100644
index 0000000..5e3e078
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rstime.rs
@@ -0,0 +1,52 @@
+#include "shared.rsh"
+
+static bool basic_test(uint32_t index) {
+ bool failed = false;
+
+ rs_time_t curTime = rsTime(0);
+ rs_tm tm;
+ rsDebug("curTime", curTime);
+
+ rsLocaltime(&tm, &curTime);
+
+ rsDebug("tm.tm_sec", tm.tm_sec);
+ rsDebug("tm.tm_min", tm.tm_min);
+ rsDebug("tm.tm_hour", tm.tm_hour);
+ rsDebug("tm.tm_mday", tm.tm_mday);
+ rsDebug("tm.tm_mon", tm.tm_mon);
+ rsDebug("tm.tm_year", tm.tm_year);
+ rsDebug("tm.tm_wday", tm.tm_wday);
+ rsDebug("tm.tm_yday", tm.tm_yday);
+ rsDebug("tm.tm_isdst", tm.tm_isdst);
+
+ // Test a specific time (only valid for PST localtime)
+ curTime = 1294438893;
+ rsLocaltime(&tm, &curTime);
+
+ _RS_ASSERT(tm.tm_sec == 33);
+ _RS_ASSERT(tm.tm_min == 21);
+ _RS_ASSERT(tm.tm_hour == 14);
+ _RS_ASSERT(tm.tm_mday == 7);
+ _RS_ASSERT(tm.tm_mon == 0);
+ _RS_ASSERT(tm.tm_year == 111);
+ _RS_ASSERT(tm.tm_wday == 5);
+ _RS_ASSERT(tm.tm_yday == 6);
+ _RS_ASSERT(tm.tm_isdst == 0);
+
+ return failed;
+}
+
+void test_rstime(uint32_t index, int test_num) {
+ bool failed = false;
+ failed |= basic_test(index);
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ rsDebug("rstime_test FAILED", -1);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ rsDebug("rstime_test PASSED", 0);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rstypes.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rstypes.rs
new file mode 100644
index 0000000..22d9c13
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/rstypes.rs
@@ -0,0 +1,79 @@
+#include "shared.rsh"
+#include "rs_graphics.rsh"
+
+rs_element elementTest;
+rs_type typeTest;
+rs_allocation allocationTest;
+rs_sampler samplerTest;
+rs_script scriptTest;
+rs_mesh meshTest;
+rs_program_fragment program_fragmentTest;
+rs_program_vertex program_vertexTest;
+rs_program_raster program_rasterTest;
+rs_program_store program_storeTest;
+rs_font fontTest;
+
+rs_matrix4x4 matrix4x4Test;
+rs_matrix3x3 matrix3x3Test;
+rs_matrix2x2 matrix2x2Test;
+
+struct my_struct {
+ int i;
+ rs_font fontTestStruct;
+};
+
+static bool basic_test(uint32_t index) {
+ bool failed = false;
+
+ rs_matrix4x4 matrix4x4TestLocal;
+ rs_matrix3x3 matrix3x3TestLocal;
+ rs_matrix2x2 matrix2x2TestLocal;
+
+ // This test focuses primarily on compilation-time, not run-time.
+ rs_element elementTestLocal;
+ rs_type typeTestLocal;
+ rs_allocation allocationTestLocal;
+ rs_sampler samplerTestLocal;
+ rs_script scriptTestLocal;
+ rs_mesh meshTestLocal;
+ rs_program_fragment program_fragmentTestLocal;
+ rs_program_vertex program_vertexTestLocal;
+ rs_program_raster program_rasterTestLocal;
+ rs_program_store program_storeTestLocal;
+ rs_font fontTestLocal;
+
+ rs_font fontTestLocalArray[4];
+
+ rs_font fontTestLocalPreInit = fontTest;
+
+ struct my_struct structTest;
+
+ fontTestLocal = fontTest;
+ //allocationTestLocal = allocationTest;
+
+ fontTest = fontTestLocal;
+ //allocationTest = allocationTestLocal;
+
+ /*for (int i = 0; i < 4; i++) {
+ fontTestLocalArray[i] = fontTestLocal;
+ }*/
+
+ /*fontTest = fontTestLocalArray[3];*/
+
+ return failed;
+}
+
+void test_rstypes(uint32_t index, int test_num) {
+ bool failed = false;
+ failed |= basic_test(index);
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ rsDebug("rstypes_test FAILED", -1);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ rsDebug("rstypes_test PASSED", 0);
+ }
+}
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/shared.rsh b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/shared.rsh
new file mode 100644
index 0000000..4a7151f
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/shared.rsh
@@ -0,0 +1,38 @@
+#pragma version(1)
+
+#pragma rs java_package_name(com.android.rs.test_v14)
+
+typedef struct TestResult_s {
+ rs_allocation name;
+ bool pass;
+ float score;
+ int64_t time;
+} TestResult;
+//TestResult *g_results;
+
+static int64_t g_time;
+
+static void start(void) {
+ g_time = rsUptimeMillis();
+}
+
+static float end(uint32_t idx) {
+ int64_t t = rsUptimeMillis() - g_time;
+ //g_results[idx].time = t;
+ //rsDebug("test time", (int)t);
+ return ((float)t) / 1000.f;
+}
+
+#define _RS_ASSERT(b) \
+do { \
+ if (!(b)) { \
+ failed = true; \
+ rsDebug(#b " FAILED", 0); \
+ } \
+\
+} while (0)
+
+/* These constants must match those in UnitTest.java */
+static const int RS_MSG_TEST_PASSED = 100;
+static const int RS_MSG_TEST_FAILED = 101;
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/test_root.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/test_root.rs
new file mode 100644
index 0000000..88fe34a
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/test_root.rs
@@ -0,0 +1,23 @@
+// Fountain test script
+#pragma version(1)
+
+#pragma rs java_package_name(com.android.rs.test_v14)
+
+#pragma stateFragment(parent)
+
+#include "rs_graphics.rsh"
+
+
+typedef struct TestResult {
+ rs_allocation name;
+ bool pass;
+ float score;
+} TestResult_t;
+TestResult_t *results;
+
+int root() {
+
+ return 0;
+}
+
+
diff --git a/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/vector.rs b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/vector.rs
new file mode 100644
index 0000000..0430a2f
--- /dev/null
+++ b/tests/RenderScriptTests/tests_v14/src/com/android/rs/test/vector.rs
@@ -0,0 +1,198 @@
+#include "shared.rsh"
+
+// Testing vector types
+float2 f2 = { 1.0f, 2.0f };
+float3 f3 = { 1.0f, 2.0f, 3.0f };
+float4 f4 = { 1.0f, 2.0f, 3.0f, 4.0f };
+
+double2 d2 = { 1.0, 2.0 };
+double3 d3 = { 1.0, 2.0, 3.0 };
+double4 d4 = { 1.0, 2.0, 3.0, 4.0 };
+
+char2 i8_2 = { 1, 2 };
+char3 i8_3 = { 1, 2, 3 };
+char4 i8_4 = { 1, 2, 3, 4 };
+
+uchar2 u8_2 = { 1, 2 };
+uchar3 u8_3 = { 1, 2, 3 };
+uchar4 u8_4 = { 1, 2, 3, 4 };
+
+short2 i16_2 = { 1, 2 };
+short3 i16_3 = { 1, 2, 3 };
+short4 i16_4 = { 1, 2, 3, 4 };
+
+ushort2 u16_2 = { 1, 2 };
+ushort3 u16_3 = { 1, 2, 3 };
+ushort4 u16_4 = { 1, 2, 3, 4 };
+
+int2 i32_2 = { 1, 2 };
+int3 i32_3 = { 1, 2, 3 };
+int4 i32_4 = { 1, 2, 3, 4 };
+
+uint2 u32_2 = { 1, 2 };
+uint3 u32_3 = { 1, 2, 3 };
+uint4 u32_4 = { 1, 2, 3, 4 };
+
+long2 i64_2 = { 1, 2 };
+long3 i64_3 = { 1, 2, 3 };
+long4 i64_4 = { 1, 2, 3, 4 };
+
+ulong2 u64_2 = { 1, 2 };
+ulong3 u64_3 = { 1, 2, 3 };
+ulong4 u64_4 = { 1, 2, 3, 4 };
+
+static bool test_vector_types() {
+ bool failed = false;
+
+ rsDebug("Testing F32", 0);
+ _RS_ASSERT(f2.x == 2.99f);
+ _RS_ASSERT(f2.y == 3.99f);
+
+ _RS_ASSERT(f3.x == 2.99f);
+ _RS_ASSERT(f3.y == 3.99f);
+ _RS_ASSERT(f3.z == 4.99f);
+
+ _RS_ASSERT(f4.x == 2.99f);
+ _RS_ASSERT(f4.y == 3.99f);
+ _RS_ASSERT(f4.z == 4.99f);
+ _RS_ASSERT(f4.w == 5.99f);
+
+ rsDebug("Testing F64", 0);
+ _RS_ASSERT(d2.x == 2.99);
+ _RS_ASSERT(d2.y == 3.99);
+
+ _RS_ASSERT(d3.x == 2.99);
+ _RS_ASSERT(d3.y == 3.99);
+ _RS_ASSERT(d3.z == 4.99);
+
+ _RS_ASSERT(d4.x == 2.99);
+ _RS_ASSERT(d4.y == 3.99);
+ _RS_ASSERT(d4.z == 4.99);
+ _RS_ASSERT(d4.w == 5.99);
+
+ rsDebug("Testing I8", 0);
+ _RS_ASSERT(i8_2.x == 2);
+ _RS_ASSERT(i8_2.y == 3);
+
+ _RS_ASSERT(i8_3.x == 2);
+ _RS_ASSERT(i8_3.y == 3);
+ _RS_ASSERT(i8_3.z == 4);
+
+ _RS_ASSERT(i8_4.x == 2);
+ _RS_ASSERT(i8_4.y == 3);
+ _RS_ASSERT(i8_4.z == 4);
+ _RS_ASSERT(i8_4.w == 5);
+
+ rsDebug("Testing U8", 0);
+ _RS_ASSERT(u8_2.x == 2);
+ _RS_ASSERT(u8_2.y == 3);
+
+ _RS_ASSERT(u8_3.x == 2);
+ _RS_ASSERT(u8_3.y == 3);
+ _RS_ASSERT(u8_3.z == 4);
+
+ _RS_ASSERT(u8_4.x == 2);
+ _RS_ASSERT(u8_4.y == 3);
+ _RS_ASSERT(u8_4.z == 4);
+ _RS_ASSERT(u8_4.w == 5);
+
+ rsDebug("Testing I16", 0);
+ _RS_ASSERT(i16_2.x == 2);
+ _RS_ASSERT(i16_2.y == 3);
+
+ _RS_ASSERT(i16_3.x == 2);
+ _RS_ASSERT(i16_3.y == 3);
+ _RS_ASSERT(i16_3.z == 4);
+
+ _RS_ASSERT(i16_4.x == 2);
+ _RS_ASSERT(i16_4.y == 3);
+ _RS_ASSERT(i16_4.z == 4);
+ _RS_ASSERT(i16_4.w == 5);
+
+ rsDebug("Testing U16", 0);
+ _RS_ASSERT(u16_2.x == 2);
+ _RS_ASSERT(u16_2.y == 3);
+
+ _RS_ASSERT(u16_3.x == 2);
+ _RS_ASSERT(u16_3.y == 3);
+ _RS_ASSERT(u16_3.z == 4);
+
+ _RS_ASSERT(u16_4.x == 2);
+ _RS_ASSERT(u16_4.y == 3);
+ _RS_ASSERT(u16_4.z == 4);
+ _RS_ASSERT(u16_4.w == 5);
+
+ rsDebug("Testing I32", 0);
+ _RS_ASSERT(i32_2.x == 2);
+ _RS_ASSERT(i32_2.y == 3);
+
+ _RS_ASSERT(i32_3.x == 2);
+ _RS_ASSERT(i32_3.y == 3);
+ _RS_ASSERT(i32_3.z == 4);
+
+ _RS_ASSERT(i32_4.x == 2);
+ _RS_ASSERT(i32_4.y == 3);
+ _RS_ASSERT(i32_4.z == 4);
+ _RS_ASSERT(i32_4.w == 5);
+
+ rsDebug("Testing U32", 0);
+ _RS_ASSERT(u32_2.x == 2);
+ _RS_ASSERT(u32_2.y == 3);
+
+ _RS_ASSERT(u32_3.x == 2);
+ _RS_ASSERT(u32_3.y == 3);
+ _RS_ASSERT(u32_3.z == 4);
+
+ _RS_ASSERT(u32_4.x == 2);
+ _RS_ASSERT(u32_4.y == 3);
+ _RS_ASSERT(u32_4.z == 4);
+ _RS_ASSERT(u32_4.w == 5);
+
+ rsDebug("Testing I64", 0);
+ _RS_ASSERT(i64_2.x == 2);
+ _RS_ASSERT(i64_2.y == 3);
+
+ _RS_ASSERT(i64_3.x == 2);
+ _RS_ASSERT(i64_3.y == 3);
+ _RS_ASSERT(i64_3.z == 4);
+
+ _RS_ASSERT(i64_4.x == 2);
+ _RS_ASSERT(i64_4.y == 3);
+ _RS_ASSERT(i64_4.z == 4);
+ _RS_ASSERT(i64_4.w == 5);
+
+ rsDebug("Testing U64", 0);
+ _RS_ASSERT(u64_2.x == 2);
+ _RS_ASSERT(u64_2.y == 3);
+
+ _RS_ASSERT(u64_3.x == 2);
+ _RS_ASSERT(u64_3.y == 3);
+ _RS_ASSERT(u64_3.z == 4);
+
+ _RS_ASSERT(u64_4.x == 2);
+ _RS_ASSERT(u64_4.y == 3);
+ _RS_ASSERT(u64_4.z == 4);
+ _RS_ASSERT(u64_4.w == 5);
+
+ if (failed) {
+ rsDebug("test_vector FAILED", 0);
+ }
+ else {
+ rsDebug("test_vector PASSED", 0);
+ }
+
+ return failed;
+}
+
+void vector_test() {
+ bool failed = false;
+ failed |= test_vector_types();
+
+ if (failed) {
+ rsSendToClientBlocking(RS_MSG_TEST_FAILED);
+ }
+ else {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+ }
+}
+
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index 0c0b2ea..df6abe8 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -2304,10 +2304,8 @@
const char16_t* end = name + nameLen;
const char16_t* pos = name;
- bool failed = false;
- while (pos < end && !failed) {
+ while (pos < end) {
const char16_t* start = pos;
- end++;
while (pos < end && *pos != '|') {
pos++;
}
@@ -2333,9 +2331,7 @@
// Didn't find this flag identifier.
return false;
}
- if (pos < end) {
- pos++;
- }
+ pos++;
}
return true;
diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp
index fe88e37..7f137ce 100644
--- a/tools/aapt/StringPool.cpp
+++ b/tools/aapt/StringPool.cpp
@@ -174,7 +174,9 @@
}
const bool first = vidx < 0;
- if (first || !mergeDuplicates) {
+ const bool styled = (pos >= 0 && (size_t)pos < mEntryStyleArray.size()) ?
+ mEntryStyleArray[pos].spans.size() : 0;
+ if (first || styled || !mergeDuplicates) {
pos = mEntryArray.add(eidx);
if (first) {
vidx = mValues.add(value, pos);
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
index 79606a4..7c683c9 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
@@ -39,6 +39,7 @@
public void dispatchGetNewSurface() throws RemoteException {
// pass for now.
}
+
@Override
public void executeCommand(String arg0, String arg1, ParcelFileDescriptor arg2)
throws RemoteException {
@@ -52,6 +53,11 @@
}
@Override
+ public void dispatchScreenState(boolean on) throws RemoteException {
+ // pass for now.
+ }
+
+ @Override
public void windowFocusChanged(boolean arg0, boolean arg1) throws RemoteException {
// pass for now.
}