am 27d2a07a: am a17e100b: Doc change: fix link target for "Publish" icon.

* commit '27d2a07a5548e238863135280b706751764ef20f':
  Doc change: fix link target for "Publish" icon.
diff --git a/include/binder/CursorWindow.h b/include/binder/CursorWindow.h
index f0284de..8a2979a 100644
--- a/include/binder/CursorWindow.h
+++ b/include/binder/CursorWindow.h
@@ -31,8 +31,8 @@
 
 #else
 
-#define IF_LOG_WINDOW() IF_LOG(LOG_DEBUG, "CursorWindow")
-#define LOG_WINDOW(...) LOG(LOG_DEBUG, "CursorWindow", __VA_ARGS__)
+#define IF_LOG_WINDOW() IF_ALOG(LOG_DEBUG, "CursorWindow")
+#define LOG_WINDOW(...) ALOG(LOG_DEBUG, "CursorWindow", __VA_ARGS__)
 
 #endif
 
diff --git a/include/gui/SensorChannel.h b/include/gui/BitTube.h
similarity index 89%
rename from include/gui/SensorChannel.h
rename to include/gui/BitTube.h
index bb54618..76389a0 100644
--- a/include/gui/SensorChannel.h
+++ b/include/gui/BitTube.h
@@ -28,14 +28,15 @@
 // ----------------------------------------------------------------------------
 class Parcel;
 
-class SensorChannel : public RefBase
+class BitTube : public RefBase
 {
 public:
 
-            SensorChannel();
-            SensorChannel(const Parcel& data);
-    virtual ~SensorChannel();
+            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);
diff --git a/include/gui/DisplayEventReceiver.h b/include/gui/DisplayEventReceiver.h
new file mode 100644
index 0000000..dccc164
--- /dev/null
+++ b/include/gui/DisplayEventReceiver.h
@@ -0,0 +1,119 @@
+/*
+ * 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. 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);
+
+    /*
+     * 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
new file mode 100644
index 0000000..86247de
--- /dev/null
+++ b/include/gui/IDisplayEventConnection.h
@@ -0,0 +1,73 @@
+/*
+ * 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/ISensorEventConnection.h b/include/gui/ISensorEventConnection.h
index ed4e4cc..749065e 100644
--- a/include/gui/ISensorEventConnection.h
+++ b/include/gui/ISensorEventConnection.h
@@ -28,14 +28,14 @@
 namespace android {
 // ----------------------------------------------------------------------------
 
-class SensorChannel;
+class BitTube;
 
 class ISensorEventConnection : public IInterface
 {
 public:
     DECLARE_META_INTERFACE(SensorEventConnection);
 
-    virtual sp<SensorChannel> getSensorChannel() const = 0;
+    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;
 };
diff --git a/include/gui/SensorEventQueue.h b/include/gui/SensorEventQueue.h
index 97dd391..ef7c6e3 100644
--- a/include/gui/SensorEventQueue.h
+++ b/include/gui/SensorEventQueue.h
@@ -24,7 +24,7 @@
 #include <utils/RefBase.h>
 #include <utils/Timers.h>
 
-#include <gui/SensorChannel.h>
+#include <gui/BitTube.h>
 
 // ----------------------------------------------------------------------------
 
@@ -71,7 +71,7 @@
 private:
     sp<Looper> getLooper() const;
     sp<ISensorEventConnection> mSensorEventConnection;
-    sp<SensorChannel> mSensorChannel;
+    sp<BitTube> mSensorChannel;
     mutable Mutex mLock;
     mutable sp<Looper> mLooper;
 };
diff --git a/include/private/gui/ComposerService.h b/include/private/gui/ComposerService.h
new file mode 100644
index 0000000..d04491a
--- /dev/null
+++ b/include/private/gui/ComposerService.h
@@ -0,0 +1,53 @@
+/*
+ * 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/surfaceflinger/ISurfaceComposer.h b/include/surfaceflinger/ISurfaceComposer.h
index 5eb09c7..58fd89d 100644
--- a/include/surfaceflinger/ISurfaceComposer.h
+++ b/include/surfaceflinger/ISurfaceComposer.h
@@ -33,8 +33,9 @@
 namespace android {
 // ----------------------------------------------------------------------------
 
-class IMemoryHeap;
 class ComposerState;
+class IDisplayEventConnection;
+class IMemoryHeap;
 
 class ISurfaceComposer : public IInterface
 {
@@ -124,13 +125,19 @@
             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;
 };
 
 // ----------------------------------------------------------------------------
@@ -151,6 +158,7 @@
         TURN_ELECTRON_BEAM_OFF,
         TURN_ELECTRON_BEAM_ON,
         AUTHENTICATE_SURFACE,
+        CREATE_DISPLAY_EVENT_CONNECTION,
     };
 
     virtual status_t    onTransact( uint32_t code,
diff --git a/include/surfaceflinger/SurfaceComposerClient.h b/include/surfaceflinger/SurfaceComposerClient.h
index 8226abe..99affda 100644
--- a/include/surfaceflinger/SurfaceComposerClient.h
+++ b/include/surfaceflinger/SurfaceComposerClient.h
@@ -28,7 +28,6 @@
 #include <utils/threads.h>
 
 #include <ui/PixelFormat.h>
-#include <ui/Region.h>
 
 #include <surfaceflinger/Surface.h>
 
@@ -39,30 +38,11 @@
 class DisplayInfo;
 class Composer;
 class IMemoryHeap;
-class ISurfaceComposer;
+class ISurfaceComposerClient;
 class Region;
-class surface_flinger_cblk_t;
-struct layer_state_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();
-};
-
-// ---------------------------------------------------------------------------
-
-class Composer;
-
 class SurfaceComposerClient : public RefBase
 {
     friend class Composer;
diff --git a/include/utils/BasicHashtable.h b/include/utils/BasicHashtable.h
new file mode 100644
index 0000000..fdf9738
--- /dev/null
+++ b/include/utils/BasicHashtable.h
@@ -0,0 +1,393 @@
+/*
+ * 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/CallStack.h b/include/utils/CallStack.h
index 8817120..079e20c 100644
--- a/include/utils/CallStack.h
+++ b/include/utils/CallStack.h
@@ -21,6 +21,7 @@
 #include <sys/types.h>
 
 #include <utils/String8.h>
+#include <corkscrew/backtrace.h>
 
 // ---------------------------------------------------------------------------
 
@@ -61,11 +62,8 @@
     size_t size() const { return mCount; }
 
 private:
-    // Internal helper function
-    String8 toStringSingleLevel(const char* prefix, int32_t level) const;
-
-    size_t      mCount;
-    const void* mStack[MAX_DEPTH];
+    size_t mCount;
+    backtrace_frame_t mStack[MAX_DEPTH];
 };
 
 }; // namespace android
diff --git a/include/utils/GenerationCache.h b/include/utils/GenerationCache.h
index bb9ddd6..da85a9a 100644
--- a/include/utils/GenerationCache.h
+++ b/include/utils/GenerationCache.h
@@ -34,17 +34,17 @@
 
 template<typename EntryKey, typename EntryValue>
 struct Entry: public LightRefBase<Entry<EntryKey, EntryValue> > {
-    Entry() { }
-    Entry(const Entry<EntryKey, EntryValue>& e):
-            key(e.key), value(e.value), parent(e.parent), child(e.child) { }
-    Entry(sp<Entry<EntryKey, EntryValue> > e):
-            key(e->key), value(e->value), parent(e->parent), child(e->child) { }
+    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;
-    sp<Entry<EntryKey, EntryValue> > child;
+    sp<Entry<EntryKey, EntryValue> > parent; // next older entry
+    sp<Entry<EntryKey, EntryValue> > child;  // next younger entry
 }; // struct Entry
 
 /**
@@ -62,23 +62,20 @@
 
     void setOnEntryRemovedListener(OnEntryRemoved<K, V>* listener);
 
+    size_t size() const;
+
     void clear();
 
-    bool contains(K key) const;
-    V get(K key);
-    K getKeyAt(uint32_t index) const;
-    bool put(K key, V value);
-    V remove(K key);
-    V removeOldest();
-    V getValueAt(uint32_t index) const;
+    bool contains(const K& key) const;
+    const K& getKeyAt(size_t index) const;
+    const V& getValueAt(size_t index) const;
 
-    uint32_t size() const;
+    const V& get(const K& key);
+    bool put(const K& key, const V& value);
 
-    void addToCache(sp<Entry<K, V> > entry, K key, V value);
-    void attachToCache(sp<Entry<K, V> > entry);
-    void detachFromCache(sp<Entry<K, V> > entry);
-
-    V removeAt(ssize_t index);
+    void removeAt(ssize_t index);
+    bool remove(const K& key);
+    bool removeOldest();
 
 private:
     KeyedVector<K, sp<Entry<K, V> > > mCache;
@@ -88,11 +85,16 @@
 
     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) {
+    mListener(NULL), mNullValue(NULL) {
 };
 
 template<typename K, typename V>
@@ -130,45 +132,44 @@
 }
 
 template<typename K, typename V>
-bool GenerationCache<K, V>::contains(K key) const {
+bool GenerationCache<K, V>::contains(const K& key) const {
     return mCache.indexOfKey(key) >= 0;
 }
 
 template<typename K, typename V>
-K GenerationCache<K, V>::getKeyAt(uint32_t index) const {
+const K& GenerationCache<K, V>::getKeyAt(size_t index) const {
     return mCache.keyAt(index);
 }
 
 template<typename K, typename V>
-V GenerationCache<K, V>::getValueAt(uint32_t index) const {
+const V& GenerationCache<K, V>::getValueAt(size_t index) const {
     return mCache.valueAt(index)->value;
 }
 
 template<typename K, typename V>
-V GenerationCache<K, V>::get(K key) {
+const V& GenerationCache<K, V>::get(const K& key) {
     ssize_t index = mCache.indexOfKey(key);
     if (index >= 0) {
-        sp<Entry<K, V> > entry = mCache.valueAt(index);
-        if (entry.get()) {
-            detachFromCache(entry);
-            attachToCache(entry);
-            return entry->value;
-        }
+        const sp<Entry<K, V> >& entry = mCache.valueAt(index);
+        detachFromCache(entry);
+        attachToCache(entry);
+        return entry->value;
     }
 
-    return NULL;
+    return mNullValue;
 }
 
 template<typename K, typename V>
-bool GenerationCache<K, V>::put(K key, V value) {
+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>;
-        addToCache(entry, key, value);
+        sp<Entry<K, V> > entry = new Entry<K, V>(key, value);
+        mCache.add(key, entry);
+        attachToCache(entry);
         return true;
     }
 
@@ -176,49 +177,44 @@
 }
 
 template<typename K, typename V>
-void GenerationCache<K, V>::addToCache(sp<Entry<K, V> > entry, K key, V value) {
-    entry->key = key;
-    entry->value = value;
-    mCache.add(key, entry);
-    attachToCache(entry);
-}
-
-template<typename K, typename V>
-V GenerationCache<K, V>::remove(K key) {
+bool GenerationCache<K, V>::remove(const K& key) {
     ssize_t index = mCache.indexOfKey(key);
     if (index >= 0) {
-        return removeAt(index);
+        removeAt(index);
+        return true;
     }
 
-    return NULL;
+    return false;
 }
 
 template<typename K, typename V>
-V GenerationCache<K, V>::removeAt(ssize_t index) {
+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);
-
-    return entry->value;
 }
 
 template<typename K, typename V>
-V GenerationCache<K, V>::removeOldest() {
+bool GenerationCache<K, V>::removeOldest() {
     if (mOldest.get()) {
         ssize_t index = mCache.indexOfKey(mOldest->key);
         if (index >= 0) {
-            return removeAt(index);
+            removeAt(index);
+            return true;
         }
+        LOGE("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 NULL;
+    return false;
 }
 
 template<typename K, typename V>
-void GenerationCache<K, V>::attachToCache(sp<Entry<K, V> > entry) {
+void GenerationCache<K, V>::attachToCache(const sp<Entry<K, V> >& entry) {
     if (!mYoungest.get()) {
         mYoungest = mOldest = entry;
     } else {
@@ -229,20 +225,16 @@
 }
 
 template<typename K, typename V>
-void GenerationCache<K, V>::detachFromCache(sp<Entry<K, V> > entry) {
+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;
-    }
-
-    if (mOldest == entry) {
-        mOldest = entry->child;
-    }
-
-    if (mYoungest == entry) {
+    } else {
         mYoungest = entry->parent;
     }
 
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index 612ff93..e045b2c 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -955,6 +955,7 @@
         UI_MODE_TYPE_DESK = ACONFIGURATION_UI_MODE_TYPE_DESK,
         UI_MODE_TYPE_CAR = ACONFIGURATION_UI_MODE_TYPE_CAR,
         UI_MODE_TYPE_TELEVISION = ACONFIGURATION_UI_MODE_TYPE_TELEVISION,
+        UI_MODE_TYPE_APPLIANCE = ACONFIGURATION_UI_MODE_TYPE_APPLIANCE,
 
         // uiMode bits for the night switch.
         MASK_UI_MODE_NIGHT = 0x30,
diff --git a/include/utils/TypeHelpers.h b/include/utils/TypeHelpers.h
index a1663f3..7b4fb70 100644
--- a/include/utils/TypeHelpers.h
+++ b/include/utils/TypeHelpers.h
@@ -213,6 +213,9 @@
 
 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() { }
@@ -222,6 +225,12 @@
     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<>
@@ -243,6 +252,41 @@
 
 // ---------------------------------------------------------------------------
 
+/*
+ * 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
 
 // ---------------------------------------------------------------------------
diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp
index 5de87ec..e8fb1d9 100644
--- a/libs/binder/BpBinder.cpp
+++ b/libs/binder/BpBinder.cpp
@@ -24,8 +24,8 @@
 
 #include <stdio.h>
 
-//#undef LOGV
-//#define LOGV(...) fprintf(stderr, __VA_ARGS__)
+//#undef ALOGV
+//#define ALOGV(...) fprintf(stderr, __VA_ARGS__)
 
 namespace android {
 
@@ -73,7 +73,7 @@
 void BpBinder::ObjectManager::kill()
 {
     const size_t N = mObjects.size();
-    LOGV("Killing %d objects in manager %p", N, this);
+    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) {
@@ -92,7 +92,7 @@
     , mObitsSent(0)
     , mObituaries(NULL)
 {
-    LOGV("Creating BpBinder %p handle %d\n", this, mHandle);
+    ALOGV("Creating BpBinder %p handle %d\n", this, mHandle);
 
     extendObjectLifetime(OBJECT_LIFETIME_WEAK);
     IPCThreadState::self()->incWeakHandle(handle);
@@ -190,7 +190,7 @@
                 if (!mObituaries) {
                     return NO_MEMORY;
                 }
-                LOGV("Requesting death notification: %p handle %d\n", this, mHandle);
+                ALOGV("Requesting death notification: %p handle %d\n", this, mHandle);
                 getWeakRefs()->incWeak(this);
                 IPCThreadState* self = IPCThreadState::self();
                 self->requestDeathNotification(mHandle, this);
@@ -226,7 +226,7 @@
             }
             mObituaries->removeAt(i);
             if (mObituaries->size() == 0) {
-                LOGV("Clearing death notification: %p handle %d\n", this, mHandle);
+                ALOGV("Clearing death notification: %p handle %d\n", this, mHandle);
                 IPCThreadState* self = IPCThreadState::self();
                 self->clearDeathNotification(mHandle, this);
                 self->flushCommands();
@@ -242,7 +242,7 @@
 
 void BpBinder::sendObituary()
 {
-    LOGV("Sending obituary for proxy %p handle %d, mObitsSent=%s\n",
+    ALOGV("Sending obituary for proxy %p handle %d, mObitsSent=%s\n",
         this, mHandle, mObitsSent ? "true" : "false");
 
     mAlive = 0;
@@ -251,7 +251,7 @@
     mLock.lock();
     Vector<Obituary>* obits = mObituaries;
     if(obits != NULL) {
-        LOGV("Clearing sent death notification: %p handle %d\n", this, mHandle);
+        ALOGV("Clearing sent death notification: %p handle %d\n", this, mHandle);
         IPCThreadState* self = IPCThreadState::self();
         self->clearDeathNotification(mHandle, this);
         self->flushCommands();
@@ -260,7 +260,7 @@
     mObitsSent = 1;
     mLock.unlock();
 
-    LOGV("Reporting death of proxy %p for %d recipients\n",
+    ALOGV("Reporting death of proxy %p for %d recipients\n",
         this, obits ? obits->size() : 0);
 
     if (obits != NULL) {
@@ -276,7 +276,7 @@
 void BpBinder::reportOneDeath(const Obituary& obit)
 {
     sp<DeathRecipient> recipient = obit.recipient.promote();
-    LOGV("Reporting death to recipient: %p\n", recipient.get());
+    ALOGV("Reporting death to recipient: %p\n", recipient.get());
     if (recipient == NULL) return;
 
     recipient->binderDied(this);
@@ -288,7 +288,7 @@
     object_cleanup_func func)
 {
     AutoMutex _l(mLock);
-    LOGV("Attaching object %p to binder %p (manager=%p)", object, this, &mObjects);
+    ALOGV("Attaching object %p to binder %p (manager=%p)", object, this, &mObjects);
     mObjects.attach(objectID, object, cleanupCookie, func);
 }
 
@@ -311,7 +311,7 @@
 
 BpBinder::~BpBinder()
 {
-    LOGV("Destroying BpBinder %p handle %d\n", this, mHandle);
+    ALOGV("Destroying BpBinder %p handle %d\n", this, mHandle);
 
     IPCThreadState* ipc = IPCThreadState::self();
 
@@ -338,15 +338,15 @@
 
 void BpBinder::onFirstRef()
 {
-    LOGV("onFirstRef BpBinder %p handle %d\n", this, mHandle);
+    ALOGV("onFirstRef BpBinder %p handle %d\n", this, mHandle);
     IPCThreadState* ipc = IPCThreadState::self();
     if (ipc) ipc->incStrongHandle(mHandle);
 }
 
 void BpBinder::onLastStrongRef(const void* id)
 {
-    LOGV("onLastStrongRef BpBinder %p handle %d\n", this, mHandle);
-    IF_LOGV() {
+    ALOGV("onLastStrongRef BpBinder %p handle %d\n", this, mHandle);
+    IF_ALOGV() {
         printRefs();
     }
     IPCThreadState* ipc = IPCThreadState::self();
@@ -355,7 +355,7 @@
 
 bool BpBinder::onIncStrongAttempted(uint32_t flags, const void* id)
 {
-    LOGV("onIncStrongAttempted BpBinder %p handle %d\n", this, mHandle);
+    ALOGV("onIncStrongAttempted BpBinder %p handle %d\n", this, mHandle);
     IPCThreadState* ipc = IPCThreadState::self();
     return ipc ? ipc->attemptIncStrongHandle(mHandle) == NO_ERROR : false;
 }
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index 5d34787..641134a 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -56,12 +56,12 @@
 
 #else
 
-#define IF_LOG_TRANSACTIONS() IF_LOG(LOG_VERBOSE, "transact")
-#define IF_LOG_COMMANDS() IF_LOG(LOG_VERBOSE, "ipc")
-#define LOG_REMOTEREFS(...) LOG(LOG_DEBUG, "remoterefs", __VA_ARGS__)
-#define IF_LOG_REMOTEREFS() IF_LOG(LOG_DEBUG, "remoterefs")
-#define LOG_THREADPOOL(...) LOG(LOG_DEBUG, "threadpool", __VA_ARGS__)
-#define LOG_ONEWAY(...) LOG(LOG_DEBUG, "ipc", __VA_ARGS__)
+#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
 
diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp
index 18669f7..fc3e31e 100644
--- a/libs/binder/MemoryDealer.cpp
+++ b/libs/binder/MemoryDealer.cpp
@@ -180,7 +180,6 @@
         /* 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). */
-        mDealer->deallocate(freedOffset);
 
         // keep the size to unmap in excess
         size_t pagesize = getpagesize();
@@ -216,6 +215,11 @@
             }
 #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);
     }
 }
 
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 6b4c1a6..6cd43aa 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -44,7 +44,7 @@
 #endif
 
 #define LOG_REFS(...)
-//#define LOG_REFS(...) LOG(LOG_DEBUG, "Parcel", __VA_ARGS__)
+//#define LOG_REFS(...) ALOG(LOG_DEBUG, "Parcel", __VA_ARGS__)
 
 // ---------------------------------------------------------------------------
 
@@ -330,7 +330,7 @@
     err = continueWrite(size);
     if (err == NO_ERROR) {
         mDataSize = size;
-        LOGV("setDataSize Setting data size of %p to %d\n", this, mDataSize);
+        ALOGV("setDataSize Setting data size of %p to %d\n", this, mDataSize);
     }
     return err;
 }
@@ -534,10 +534,10 @@
 {
     //printf("Finish write of %d\n", len);
     mDataPos += len;
-    LOGV("finishWrite Setting data pos of %p to %d\n", this, mDataPos);
+    ALOGV("finishWrite Setting data pos of %p to %d\n", this, mDataPos);
     if (mDataPos > mDataSize) {
         mDataSize = mDataPos;
-        LOGV("finishWrite Setting data size of %p to %d\n", this, mDataSize);
+        ALOGV("finishWrite Setting data size of %p to %d\n", this, mDataSize);
     }
     //printf("New pos=%d, size=%d\n", mDataPos, mDataSize);
     return NO_ERROR;
@@ -722,7 +722,15 @@
 
 status_t Parcel::writeDupFileDescriptor(int fd)
 {
-    return writeFileDescriptor(dup(fd), true /*takeOwnership*/);
+    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)
@@ -730,7 +738,7 @@
     status_t status;
 
     if (!mAllowFds || len <= IN_PLACE_BLOB_LIMIT) {
-        LOGV("writeBlob: write in place");
+        ALOGV("writeBlob: write in place");
         status = writeInt32(0);
         if (status) return status;
 
@@ -741,7 +749,7 @@
         return NO_ERROR;
     }
 
-    LOGV("writeBlob: write to ashmem");
+    ALOGV("writeBlob: write to ashmem");
     int fd = ashmem_create_region("Parcel Blob", len);
     if (fd < 0) return NO_MEMORY;
 
@@ -865,7 +873,7 @@
     if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) {
         memcpy(outData, mData+mDataPos, len);
         mDataPos += PAD_SIZE(len);
-        LOGV("read Setting data pos of %p to %d\n", this, mDataPos);
+        ALOGV("read Setting data pos of %p to %d\n", this, mDataPos);
         return NO_ERROR;
     }
     return NOT_ENOUGH_DATA;
@@ -876,7 +884,7 @@
     if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) {
         const void* data = mData+mDataPos;
         mDataPos += PAD_SIZE(len);
-        LOGV("readInplace Setting data pos of %p to %d\n", this, mDataPos);
+        ALOGV("readInplace Setting data pos of %p to %d\n", this, mDataPos);
         return data;
     }
     return NULL;
@@ -987,7 +995,7 @@
         if (eos) {
             const size_t len = eos - str;
             mDataPos += PAD_SIZE(len+1);
-            LOGV("readCString Setting data pos of %p to %d\n", this, mDataPos);
+            ALOGV("readCString Setting data pos of %p to %d\n", this, mDataPos);
             return str;
         }
     }
@@ -1102,7 +1110,7 @@
     if (status) return status;
 
     if (!useAshmem) {
-        LOGV("readBlob: read in place");
+        ALOGV("readBlob: read in place");
         const void* ptr = readInplace(len);
         if (!ptr) return BAD_VALUE;
 
@@ -1110,7 +1118,7 @@
         return NO_ERROR;
     }
 
-    LOGV("readBlob: read from ashmem");
+    ALOGV("readBlob: read from ashmem");
     int fd = readFileDescriptor();
     if (fd == int(BAD_TYPE)) return BAD_VALUE;
 
@@ -1164,7 +1172,7 @@
             // 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.
-            LOGV("readObject Setting data pos of %p to %d\n", this, mDataPos);
+            ALOGV("readObject Setting data pos of %p to %d\n", this, mDataPos);
             return obj;
         }
         
@@ -1174,7 +1182,7 @@
         size_t opos = mNextObjectHint;
         
         if (N > 0) {
-            LOGV("Parcel %p looking for obj at %d, hint=%d\n",
+            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
@@ -1188,10 +1196,10 @@
             }
             if (OBJS[opos] == DPOS) {
                 // Found it!
-                LOGV("Parcel found obj %d at index %d with forward search",
+                ALOGV("Parcel found obj %d at index %d with forward search",
                      this, DPOS, opos);
                 mNextObjectHint = opos+1;
-                LOGV("readObject Setting data pos of %p to %d\n", this, mDataPos);
+                ALOGV("readObject Setting data pos of %p to %d\n", this, mDataPos);
                 return obj;
             }
         
@@ -1201,10 +1209,10 @@
             }
             if (OBJS[opos] == DPOS) {
                 // Found it!
-                LOGV("Parcel found obj %d at index %d with backward search",
+                ALOGV("Parcel found obj %d at index %d with backward search",
                      this, DPOS, opos);
                 mNextObjectHint = opos+1;
-                LOGV("readObject Setting data pos of %p to %d\n", this, mDataPos);
+                ALOGV("readObject Setting data pos of %p to %d\n", this, mDataPos);
                 return obj;
             }
         }
@@ -1260,7 +1268,7 @@
     mDataSize = mDataCapacity = dataSize;
     //LOGI("setDataReference Setting data size of %p to %lu (pid=%d)\n", this, mDataSize, getpid());
     mDataPos = 0;
-    LOGV("setDataReference Setting data pos of %p to %d\n", this, mDataPos);
+    ALOGV("setDataReference Setting data pos of %p to %d\n", this, mDataPos);
     mObjects = const_cast<size_t*>(objects);
     mObjectsSize = mObjectsCapacity = objectsCount;
     mNextObjectHint = 0;
@@ -1370,8 +1378,8 @@
     }
     
     mDataSize = mDataPos = 0;
-    LOGV("restartWrite Setting data size of %p to %d\n", this, mDataSize);
-    LOGV("restartWrite Setting data pos of %p to %d\n", this, mDataPos);
+    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;
@@ -1445,7 +1453,7 @@
         mData = data;
         mObjects = objects;
         mDataSize = (mDataSize < desired) ? mDataSize : desired;
-        LOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize);
+        ALOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize);
         mDataCapacity = desired;
         mObjectsSize = mObjectsCapacity = objectsSize;
         mNextObjectHint = 0;
@@ -1485,11 +1493,11 @@
         } else {
             if (mDataSize > desired) {
                 mDataSize = desired;
-                LOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize);
+                ALOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize);
             }
             if (mDataPos > desired) {
                 mDataPos = desired;
-                LOGV("continueWrite Setting data pos of %p to %d\n", this, mDataPos);
+                ALOGV("continueWrite Setting data pos of %p to %d\n", this, mDataPos);
             }
         }
         
@@ -1508,8 +1516,8 @@
         
         mData = data;
         mDataSize = mDataPos = 0;
-        LOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize);
-        LOGV("continueWrite Setting data pos of %p to %d\n", this, mDataPos);
+        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;
     }
 
@@ -1523,8 +1531,8 @@
     mDataSize = 0;
     mDataCapacity = 0;
     mDataPos = 0;
-    LOGV("initState Setting data size of %p to %d\n", this, mDataSize);
-    LOGV("initState Setting data pos of %p to %d\n", this, mDataPos);
+    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;
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index f5288c8..f06a59e 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -288,7 +288,7 @@
         int32_t s = android_atomic_add(1, &mThreadPoolSeq);
         char buf[32];
         sprintf(buf, "Binder Thread #%d", s);
-        LOGV("Spawning new pooled thread, name=%s\n", buf);
+        ALOGV("Spawning new pooled thread, name=%s\n", buf);
         sp<Thread> t = new PoolThread(isMain);
         t->run(buf);
     }
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index 9767568..b8be67d 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -2,11 +2,13 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:= \
+	BitTube.cpp \
+	DisplayEventReceiver.cpp \
+	IDisplayEventConnection.cpp \
 	ISensorEventConnection.cpp \
 	ISensorServer.cpp \
 	ISurfaceTexture.cpp \
 	Sensor.cpp \
-	SensorChannel.cpp \
 	SensorEventQueue.cpp \
 	SensorManager.cpp \
 	SurfaceTexture.cpp \
diff --git a/libs/gui/BitTube.cpp b/libs/gui/BitTube.cpp
new file mode 100644
index 0000000..fa8d0ea
--- /dev/null
+++ b/libs/gui/BitTube.cpp
@@ -0,0 +1,120 @@
+/*
+ * 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 <unistd.h>
+#include <fcntl.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);
+    } else {
+        mReceiveFd = -errno;
+        LOGE("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;
+        LOGE("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/DisplayEventReceiver.cpp b/libs/gui/DisplayEventReceiver.cpp
new file mode 100644
index 0000000..fee1feb
--- /dev/null
+++ b/libs/gui/DisplayEventReceiver.cpp
@@ -0,0 +1,103 @@
+/*
+ * 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 <private/gui/ComposerService.h>
+
+#include <surfaceflinger/ISurfaceComposer.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) {
+    ssize_t size = mDataChannel->read(events, sizeof(events[0])*count);
+    LOGE_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
new file mode 100644
index 0000000..887d176
--- /dev/null
+++ b/libs/gui/IDisplayEventConnection.cpp
@@ -0,0 +1,98 @@
+/*
+ * 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/ISensorEventConnection.cpp b/libs/gui/ISensorEventConnection.cpp
index a5083fe..0e51e8e 100644
--- a/libs/gui/ISensorEventConnection.cpp
+++ b/libs/gui/ISensorEventConnection.cpp
@@ -25,7 +25,7 @@
 #include <binder/IInterface.h>
 
 #include <gui/ISensorEventConnection.h>
-#include <gui/SensorChannel.h>
+#include <gui/BitTube.h>
 
 namespace android {
 // ----------------------------------------------------------------------------
@@ -44,12 +44,12 @@
     {
     }
 
-    virtual sp<SensorChannel> getSensorChannel() const
+    virtual sp<BitTube> getSensorChannel() const
     {
         Parcel data, reply;
         data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor());
         remote()->transact(GET_SENSOR_CHANNEL, data, &reply);
-        return new SensorChannel(reply);
+        return new BitTube(reply);
     }
 
     virtual status_t enableDisable(int handle, bool enabled)
@@ -83,7 +83,7 @@
     switch(code) {
         case GET_SENSOR_CHANNEL: {
             CHECK_INTERFACE(ISensorEventConnection, data, reply);
-            sp<SensorChannel> channel(getSensorChannel());
+            sp<BitTube> channel(getSensorChannel());
             channel->writeToParcel(reply);
             return NO_ERROR;
         } break;
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index 86bc62a..db32827 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -29,6 +29,9 @@
 
 #include <surfaceflinger/ISurfaceComposer.h>
 
+#include <gui/BitTube.h>
+#include <gui/IDisplayEventConnection.h>
+
 #include <ui/DisplayInfo.h>
 
 #include <gui/ISurfaceTexture.h>
@@ -44,6 +47,8 @@
 
 namespace android {
 
+class IDisplayEventConnection;
+
 class BpSurfaceComposer : public BpInterface<ISurfaceComposer>
 {
 public:
@@ -174,6 +179,27 @@
         }
         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) {
+            LOGE("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");
@@ -254,6 +280,12 @@
             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);
     }
diff --git a/libs/gui/SensorChannel.cpp b/libs/gui/SensorChannel.cpp
deleted file mode 100644
index 147e1c2..0000000
--- a/libs/gui/SensorChannel.cpp
+++ /dev/null
@@ -1,93 +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 <unistd.h>
-#include <fcntl.h>
-
-#include <utils/Errors.h>
-
-#include <binder/Parcel.h>
-
-#include <gui/SensorChannel.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-SensorChannel::SensorChannel()
-    : 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);
-    }
-}
-
-SensorChannel::SensorChannel(const Parcel& data)
-    : mSendFd(-1), mReceiveFd(-1)
-{
-    mReceiveFd = dup(data.readFileDescriptor());
-    fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
-}
-
-SensorChannel::~SensorChannel()
-{
-    if (mSendFd >= 0)
-        close(mSendFd);
-
-    if (mReceiveFd >= 0)
-        close(mReceiveFd);
-}
-
-int SensorChannel::getFd() const
-{
-    return mReceiveFd;
-}
-
-ssize_t SensorChannel::write(void const* vaddr, size_t size)
-{
-    ssize_t len = ::write(mSendFd, vaddr, size);
-    if (len < 0)
-        return -errno;
-    return len;
-}
-
-ssize_t SensorChannel::read(void* vaddr, size_t size)
-{
-    ssize_t len = ::read(mReceiveFd, vaddr, size);
-    if (len < 0)
-        return -errno;
-    return len;
-}
-
-status_t SensorChannel::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/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp
index f935524..ee21c45 100644
--- a/libs/gui/SensorEventQueue.cpp
+++ b/libs/gui/SensorEventQueue.cpp
@@ -24,7 +24,7 @@
 #include <utils/Looper.h>
 
 #include <gui/Sensor.h>
-#include <gui/SensorChannel.h>
+#include <gui/BitTube.h>
 #include <gui/SensorEventQueue.h>
 #include <gui/ISensorEventConnection.h>
 
@@ -104,7 +104,7 @@
     do {
         result = looper->pollOnce(-1);
         if (result == ALOOPER_EVENT_ERROR) {
-            LOGE("SensorChannel::waitForEvent error (errno=%d)", errno);
+            LOGE("SensorEventQueue::waitForEvent error (errno=%d)", errno);
             result = -EPIPE; // unknown error, so we make up one
             break;
         }
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 4ad6c22..699438c 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -39,6 +39,7 @@
 #include <private/surfaceflinger/LayerState.h>
 #include <private/surfaceflinger/SharedBufferStack.h>
 
+#include <private/gui/ComposerService.h>
 
 namespace android {
 // ---------------------------------------------------------------------------
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 4772189..4310bed 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -29,6 +29,8 @@
 
 #include <hardware/hardware.h>
 
+#include <private/gui/ComposerService.h>
+
 #include <surfaceflinger/ISurfaceComposer.h>
 #include <surfaceflinger/SurfaceComposerClient.h>
 #include <surfaceflinger/IGraphicBufferAlloc.h>
@@ -60,7 +62,7 @@
 #endif
 
 // Macros for including the SurfaceTexture name in log messages
-#define ST_LOGV(x, ...) LOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
 #define ST_LOGD(x, ...) LOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
 #define ST_LOGI(x, ...) LOGI("[%s] "x, mName.string(), ##__VA_ARGS__)
 #define ST_LOGW(x, ...) LOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index 48070d6..691b52d 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -23,6 +23,8 @@
 
 #include <utils/Log.h>
 
+#include <private/gui/ComposerService.h>
+
 namespace android {
 
 SurfaceTextureClient::SurfaceTextureClient(
@@ -136,13 +138,13 @@
 }
 
 int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) {
-    LOGV("SurfaceTextureClient::dequeueBuffer");
+    ALOGV("SurfaceTextureClient::dequeueBuffer");
     Mutex::Autolock lock(mMutex);
     int buf = -1;
     status_t result = mSurfaceTexture->dequeueBuffer(&buf, mReqWidth, mReqHeight,
             mReqFormat, mReqUsage);
     if (result < 0) {
-        LOGV("dequeueBuffer: ISurfaceTexture::dequeueBuffer(%d, %d, %d, %d)"
+        ALOGV("dequeueBuffer: ISurfaceTexture::dequeueBuffer(%d, %d, %d, %d)"
              "failed: %d", mReqWidth, mReqHeight, mReqFormat, mReqUsage,
              result);
         return result;
@@ -165,7 +167,7 @@
 }
 
 int SurfaceTextureClient::cancelBuffer(android_native_buffer_t* buffer) {
-    LOGV("SurfaceTextureClient::cancelBuffer");
+    ALOGV("SurfaceTextureClient::cancelBuffer");
     Mutex::Autolock lock(mMutex);
     int i = getSlotFromBufferLocked(buffer);
     if (i < 0) {
@@ -205,18 +207,18 @@
 }
 
 int SurfaceTextureClient::lockBuffer(android_native_buffer_t* buffer) {
-    LOGV("SurfaceTextureClient::lockBuffer");
+    ALOGV("SurfaceTextureClient::lockBuffer");
     Mutex::Autolock lock(mMutex);
     return OK;
 }
 
 int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) {
-    LOGV("SurfaceTextureClient::queueBuffer");
+    ALOGV("SurfaceTextureClient::queueBuffer");
     Mutex::Autolock lock(mMutex);
     int64_t timestamp;
     if (mTimestamp == NATIVE_WINDOW_TIMESTAMP_AUTO) {
         timestamp = systemTime(SYSTEM_TIME_MONOTONIC);
-        LOGV("SurfaceTextureClient::queueBuffer making up timestamp: %.2f ms",
+        ALOGV("SurfaceTextureClient::queueBuffer making up timestamp: %.2f ms",
              timestamp / 1000000.f);
     } else {
         timestamp = mTimestamp;
@@ -234,7 +236,7 @@
 }
 
 int SurfaceTextureClient::query(int what, int* value) const {
-    LOGV("SurfaceTextureClient::query");
+    ALOGV("SurfaceTextureClient::query");
     { // scope for the lock
         Mutex::Autolock lock(mMutex);
         switch (what) {
@@ -402,7 +404,7 @@
 
 
 int SurfaceTextureClient::connect(int api) {
-    LOGV("SurfaceTextureClient::connect");
+    ALOGV("SurfaceTextureClient::connect");
     Mutex::Autolock lock(mMutex);
     int err = mSurfaceTexture->connect(api,
             &mDefaultWidth, &mDefaultHeight, &mTransformHint);
@@ -413,7 +415,7 @@
 }
 
 int SurfaceTextureClient::disconnect(int api) {
-    LOGV("SurfaceTextureClient::disconnect");
+    ALOGV("SurfaceTextureClient::disconnect");
     Mutex::Autolock lock(mMutex);
     freeAllBuffers();
     int err = mSurfaceTexture->disconnect(api);
@@ -431,7 +433,7 @@
 
 int SurfaceTextureClient::setUsage(uint32_t reqUsage)
 {
-    LOGV("SurfaceTextureClient::setUsage");
+    ALOGV("SurfaceTextureClient::setUsage");
     Mutex::Autolock lock(mMutex);
     mReqUsage = reqUsage;
     return OK;
@@ -439,7 +441,7 @@
 
 int SurfaceTextureClient::setCrop(Rect const* rect)
 {
-    LOGV("SurfaceTextureClient::setCrop");
+    ALOGV("SurfaceTextureClient::setCrop");
     Mutex::Autolock lock(mMutex);
 
     Rect realRect;
@@ -457,7 +459,7 @@
 
 int SurfaceTextureClient::setBufferCount(int bufferCount)
 {
-    LOGV("SurfaceTextureClient::setBufferCount");
+    ALOGV("SurfaceTextureClient::setBufferCount");
     Mutex::Autolock lock(mMutex);
 
     status_t err = mSurfaceTexture->setBufferCount(bufferCount);
@@ -473,7 +475,7 @@
 
 int SurfaceTextureClient::setBuffersDimensions(int w, int h)
 {
-    LOGV("SurfaceTextureClient::setBuffersDimensions");
+    ALOGV("SurfaceTextureClient::setBuffersDimensions");
     Mutex::Autolock lock(mMutex);
 
     if (w<0 || h<0)
@@ -493,7 +495,7 @@
 
 int SurfaceTextureClient::setBuffersFormat(int format)
 {
-    LOGV("SurfaceTextureClient::setBuffersFormat");
+    ALOGV("SurfaceTextureClient::setBuffersFormat");
     Mutex::Autolock lock(mMutex);
 
     if (format<0)
@@ -506,7 +508,7 @@
 
 int SurfaceTextureClient::setScalingMode(int mode)
 {
-    LOGV("SurfaceTextureClient::setScalingMode(%d)", mode);
+    ALOGV("SurfaceTextureClient::setScalingMode(%d)", mode);
     Mutex::Autolock lock(mMutex);
     // mode is validated on the server
     status_t err = mSurfaceTexture->setScalingMode(mode);
@@ -518,7 +520,7 @@
 
 int SurfaceTextureClient::setBuffersTransform(int transform)
 {
-    LOGV("SurfaceTextureClient::setBuffersTransform");
+    ALOGV("SurfaceTextureClient::setBuffersTransform");
     Mutex::Autolock lock(mMutex);
     status_t err = mSurfaceTexture->setTransform(transform);
     return err;
@@ -526,7 +528,7 @@
 
 int SurfaceTextureClient::setBuffersTimestamp(int64_t timestamp)
 {
-    LOGV("SurfaceTextureClient::setBuffersTimestamp");
+    ALOGV("SurfaceTextureClient::setBuffersTimestamp");
     Mutex::Autolock lock(mMutex);
     mTimestamp = timestamp;
     return NO_ERROR;
diff --git a/libs/gui/tests/SurfaceTexture_test.cpp b/libs/gui/tests/SurfaceTexture_test.cpp
index c313904..b18e7b0 100644
--- a/libs/gui/tests/SurfaceTexture_test.cpp
+++ b/libs/gui/tests/SurfaceTexture_test.cpp
@@ -1399,12 +1399,12 @@
         // test.
         void waitForFrame() {
             Mutex::Autolock lock(mMutex);
-            LOGV("+waitForFrame");
+            ALOGV("+waitForFrame");
             while (!mFrameAvailable) {
                 mFrameAvailableCondition.wait(mMutex);
             }
             mFrameAvailable = false;
-            LOGV("-waitForFrame");
+            ALOGV("-waitForFrame");
         }
 
         // Allow the producer to return from its swapBuffers call and continue
@@ -1412,23 +1412,23 @@
         // thread once for every frame expected by the test.
         void finishFrame() {
             Mutex::Autolock lock(mMutex);
-            LOGV("+finishFrame");
+            ALOGV("+finishFrame");
             mFrameFinished = true;
             mFrameFinishCondition.signal();
-            LOGV("-finishFrame");
+            ALOGV("-finishFrame");
         }
 
         // This should be called by SurfaceTexture on the producer thread.
         virtual void onFrameAvailable() {
             Mutex::Autolock lock(mMutex);
-            LOGV("+onFrameAvailable");
+            ALOGV("+onFrameAvailable");
             mFrameAvailable = true;
             mFrameAvailableCondition.signal();
             while (!mFrameFinished) {
                 mFrameFinishCondition.wait(mMutex);
             }
             mFrameFinished = false;
-            LOGV("-onFrameAvailable");
+            ALOGV("-onFrameAvailable");
         }
 
     protected:
@@ -1514,9 +1514,9 @@
             for (int i = 0; i < NUM_ITERATIONS; i++) {
                 glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
                 glClear(GL_COLOR_BUFFER_BIT);
-                LOGV("+swapBuffers");
+                ALOGV("+swapBuffers");
                 swapBuffers();
-                LOGV("-swapBuffers");
+                ALOGV("-swapBuffers");
             }
         }
     };
@@ -1525,9 +1525,9 @@
 
     for (int i = 0; i < NUM_ITERATIONS; i++) {
         mFC->waitForFrame();
-        LOGV("+updateTexImage");
+        ALOGV("+updateTexImage");
         mST->updateTexImage();
-        LOGV("-updateTexImage");
+        ALOGV("-updateTexImage");
         mFC->finishFrame();
 
         // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported!
@@ -1543,9 +1543,9 @@
             for (int i = 0; i < NUM_ITERATIONS; i++) {
                 glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
                 glClear(GL_COLOR_BUFFER_BIT);
-                LOGV("+swapBuffers");
+                ALOGV("+swapBuffers");
                 swapBuffers();
-                LOGV("-swapBuffers");
+                ALOGV("-swapBuffers");
             }
         }
     };
@@ -1555,9 +1555,9 @@
     for (int i = 0; i < NUM_ITERATIONS; i++) {
         mFC->waitForFrame();
         mFC->finishFrame();
-        LOGV("+updateTexImage");
+        ALOGV("+updateTexImage");
         mST->updateTexImage();
-        LOGV("-updateTexImage");
+        ALOGV("-updateTexImage");
 
         // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported!
     }
@@ -1573,9 +1573,9 @@
             for (int i = 0; i < NUM_ITERATIONS; i++) {
                 glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
                 glClear(GL_COLOR_BUFFER_BIT);
-                LOGV("+swapBuffers");
+                ALOGV("+swapBuffers");
                 swapBuffers();
-                LOGV("-swapBuffers");
+                ALOGV("-swapBuffers");
             }
         }
     };
@@ -1624,9 +1624,9 @@
     for (int i = 0; i < NUM_ITERATIONS-3; i++) {
         mFC->waitForFrame();
         mFC->finishFrame();
-        LOGV("+updateTexImage");
+        ALOGV("+updateTexImage");
         mST->updateTexImage();
-        LOGV("-updateTexImage");
+        ALOGV("-updateTexImage");
     }
 }
 
diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp
index 693b7b8..ea52750 100644
--- a/libs/gui/tests/Surface_test.cpp
+++ b/libs/gui/tests/Surface_test.cpp
@@ -22,6 +22,8 @@
 #include <surfaceflinger/SurfaceComposerClient.h>
 #include <utils/String8.h>
 
+#include <private/gui/ComposerService.h>
+
 namespace android {
 
 class SurfaceTest : public ::testing::Test {
diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk
index 831d9e3..544ab74 100644
--- a/libs/utils/Android.mk
+++ b/libs/utils/Android.mk
@@ -21,6 +21,7 @@
 	Asset.cpp \
 	AssetDir.cpp \
 	AssetManager.cpp \
+	BasicHashtable.cpp \
 	BlobCache.cpp \
 	BufferedTextOutput.cpp \
 	CallStack.cpp \
@@ -105,7 +106,8 @@
 	libz \
 	liblog \
 	libcutils \
-	libdl
+	libdl \
+	libcorkscrew
 
 LOCAL_MODULE:= libutils
 include $(BUILD_SHARED_LIBRARY)
diff --git a/libs/utils/Asset.cpp b/libs/utils/Asset.cpp
index a18294b..7fd2c87 100644
--- a/libs/utils/Asset.cpp
+++ b/libs/utils/Asset.cpp
@@ -585,7 +585,7 @@
             return NULL;
         }
 
-        LOGV("Asset %p allocating buffer size %d (smaller than threshold)", this, (int)allocLen);
+        ALOGV("Asset %p allocating buffer size %d (smaller than threshold)", this, (int)allocLen);
         if (mLength > 0) {
             long oldPosn = ftell(mFp);
             fseek(mFp, mStart, SEEK_SET);
@@ -597,7 +597,7 @@
             fseek(mFp, oldPosn, SEEK_SET);
         }
 
-        LOGV(" getBuffer: loaded into buffer\n");
+        ALOGV(" getBuffer: loaded into buffer\n");
 
         mBuf = buf;
         return mBuf;
@@ -610,7 +610,7 @@
             return NULL;
         }
 
-        LOGV(" getBuffer: mapped\n");
+        ALOGV(" getBuffer: mapped\n");
 
         mMap = map;
         if (!wordAligned) {
@@ -648,13 +648,13 @@
     if ((((size_t)data)&0x3) == 0) {
         // We can return this directly if it is aligned on a word
         // boundary.
-        LOGV("Returning aligned FileAsset %p (%s).", this,
+        ALOGV("Returning aligned FileAsset %p (%s).", this,
                 getAssetSource());
         return data;
     }
     // If not aligned on a word boundary, then we need to copy it into
     // our own buffer.
-    LOGV("Copying FileAsset %p (%s) to buffer size %d to make it aligned.", this,
+    ALOGV("Copying FileAsset %p (%s) to buffer size %d to make it aligned.", this,
             getAssetSource(), (int)mLength);
     unsigned char* buf = new unsigned char[mLength];
     if (buf == NULL) {
diff --git a/libs/utils/AssetManager.cpp b/libs/utils/AssetManager.cpp
index 22034c5..203e6fa 100644
--- a/libs/utils/AssetManager.cpp
+++ b/libs/utils/AssetManager.cpp
@@ -167,7 +167,7 @@
         }
     }
 
-    LOGV("In %p Asset %s path: %s", this,
+    ALOGV("In %p Asset %s path: %s", this,
          ap.type == kFileTypeDirectory ? "dir" : "zip", ap.path.string());
 
     mAssetPaths.add(ap);
@@ -498,7 +498,7 @@
     size_t i = mAssetPaths.size();
     while (i > 0) {
         i--;
-        LOGV("Looking for asset '%s' in '%s'\n",
+        ALOGV("Looking for asset '%s' in '%s'\n",
                 assetName.string(), mAssetPaths.itemAt(i).path.string());
         Asset* pAsset = openNonAssetInPathLocked(assetName.string(), mode, mAssetPaths.itemAt(i));
         if (pAsset != NULL) {
@@ -532,7 +532,7 @@
     size_t i = mAssetPaths.size();
     while (i > 0) {
         i--;
-        LOGV("Looking for non-asset '%s' in '%s'\n", fileName, mAssetPaths.itemAt(i).path.string());
+        ALOGV("Looking for non-asset '%s' in '%s'\n", fileName, mAssetPaths.itemAt(i).path.string());
         Asset* pAsset = openNonAssetInPathLocked(
             fileName, mode, mAssetPaths.itemAt(i));
         if (pAsset != NULL) {
@@ -556,7 +556,7 @@
         loadFileNameCacheLocked();
 
     if (which < mAssetPaths.size()) {
-        LOGV("Looking for non-asset '%s' in '%s'\n", fileName,
+        ALOGV("Looking for non-asset '%s' in '%s'\n", fileName,
                 mAssetPaths.itemAt(which).path.string());
         Asset* pAsset = openNonAssetInPathLocked(
             fileName, mode, mAssetPaths.itemAt(which));
@@ -621,7 +621,7 @@
         bool shared = true;
         const asset_path& ap = mAssetPaths.itemAt(i);
         Asset* idmap = openIdmapLocked(ap);
-        LOGV("Looking for resource asset in '%s'\n", ap.path.string());
+        ALOGV("Looking for resource asset in '%s'\n", ap.path.string());
         if (ap.type != kFileTypeDirectory) {
             if (i == 0) {
                 // The first item is typically the framework resources,
@@ -633,7 +633,7 @@
                 ass = const_cast<AssetManager*>(this)->
                     mZipSet.getZipResourceTableAsset(ap.path);
                 if (ass == NULL) {
-                    LOGV("loading resource table %s\n", ap.path.string());
+                    ALOGV("loading resource table %s\n", ap.path.string());
                     ass = const_cast<AssetManager*>(this)->
                         openNonAssetInPathLocked("resources.arsc",
                                                  Asset::ACCESS_BUFFER,
@@ -648,7 +648,7 @@
                     // If this is the first resource table in the asset
                     // manager, then we are going to cache it so that we
                     // can quickly copy it out for others.
-                    LOGV("Creating shared resources for %s", ap.path.string());
+                    ALOGV("Creating shared resources for %s", ap.path.string());
                     sharedRes = new ResTable();
                     sharedRes->add(ass, (void*)(i+1), false, idmap);
                     sharedRes = const_cast<AssetManager*>(this)->
@@ -656,7 +656,7 @@
                 }
             }
         } else {
-            LOGV("loading resource table %s\n", ap.path.string());
+            ALOGV("loading resource table %s\n", ap.path.string());
             Asset* ass = const_cast<AssetManager*>(this)->
                 openNonAssetInPathLocked("resources.arsc",
                                          Asset::ACCESS_BUFFER,
@@ -668,12 +668,12 @@
                 mResources = rt = new ResTable();
                 updateResourceParamsLocked();
             }
-            LOGV("Installing resource asset %p in to table %p\n", ass, mResources);
+            ALOGV("Installing resource asset %p in to table %p\n", ass, mResources);
             if (sharedRes != NULL) {
-                LOGV("Copying existing resources for %s", ap.path.string());
+                ALOGV("Copying existing resources for %s", ap.path.string());
                 rt->add(sharedRes);
             } else {
-                LOGV("Parsing resources for %s", ap.path.string());
+                ALOGV("Parsing resources for %s", ap.path.string());
                 rt->add(ass, (void*)(i+1), !shared, idmap);
             }
 
@@ -725,7 +725,7 @@
         ass = const_cast<AssetManager*>(this)->
             openAssetFromFileLocked(ap.idmap, Asset::ACCESS_BUFFER);
         if (ass) {
-            LOGV("loading idmap %s\n", ap.idmap.string());
+            ALOGV("loading idmap %s\n", ap.idmap.string());
         } else {
             LOGW("failed to load idmap %s\n", ap.idmap.string());
         }
@@ -1019,7 +1019,7 @@
  */
 ZipFileRO* AssetManager::getZipFileLocked(const asset_path& ap)
 {
-    LOGV("getZipFileLocked() in %p\n", this);
+    ALOGV("getZipFileLocked() in %p\n", this);
 
     return mZipSet.getZip(ap.path);
 }
@@ -1086,12 +1086,12 @@
 
     if (method == ZipFileRO::kCompressStored) {
         pAsset = Asset::createFromUncompressedMap(dataMap, mode);
-        LOGV("Opened uncompressed entry %s in zip %s mode %d: %p", entryName.string(),
+        ALOGV("Opened uncompressed entry %s in zip %s mode %d: %p", entryName.string(),
                 dataMap->getFileName(), mode, pAsset);
     } else {
         pAsset = Asset::createFromCompressedMap(dataMap, method,
             uncompressedLen, mode);
-        LOGV("Opened compressed entry %s in zip %s mode %d: %p", entryName.string(),
+        ALOGV("Opened compressed entry %s in zip %s mode %d: %p", entryName.string(),
                 dataMap->getFileName(), mode, pAsset);
     }
     if (pAsset == NULL) {
@@ -1146,10 +1146,10 @@
         i--;
         const asset_path& ap = mAssetPaths.itemAt(i);
         if (ap.type == kFileTypeRegular) {
-            LOGV("Adding directory %s from zip %s", dirName, ap.path.string());
+            ALOGV("Adding directory %s from zip %s", dirName, ap.path.string());
             scanAndMergeZipLocked(pMergedInfo, ap, kAssetsRoot, dirName);
         } else {
-            LOGV("Adding directory %s from dir %s", dirName, ap.path.string());
+            ALOGV("Adding directory %s from dir %s", dirName, ap.path.string());
             scanAndMergeDirLocked(pMergedInfo, ap, kAssetsRoot, dirName);
         }
     }
@@ -1200,10 +1200,10 @@
     if (which < mAssetPaths.size()) {
         const asset_path& ap = mAssetPaths.itemAt(which);
         if (ap.type == kFileTypeRegular) {
-            LOGV("Adding directory %s from zip %s", dirName, ap.path.string());
+            ALOGV("Adding directory %s from zip %s", dirName, ap.path.string());
             scanAndMergeZipLocked(pMergedInfo, ap, NULL, dirName);
         } else {
-            LOGV("Adding directory %s from dir %s", dirName, ap.path.string());
+            ALOGV("Adding directory %s from dir %s", dirName, ap.path.string());
             scanAndMergeDirLocked(pMergedInfo, ap, NULL, dirName);
         }
     }
@@ -1325,7 +1325,7 @@
 
             matchIdx = AssetDir::FileInfo::findEntry(pMergedInfo, match);
             if (matchIdx > 0) {
-                LOGV("Excluding '%s' [%s]\n",
+                ALOGV("Excluding '%s' [%s]\n",
                     pMergedInfo->itemAt(matchIdx).getFileName().string(),
                     pMergedInfo->itemAt(matchIdx).getSourceName().string());
                 pMergedInfo->removeAt(matchIdx);
@@ -1365,7 +1365,7 @@
     struct dirent* entry;
     FileType fileType;
 
-    LOGV("Scanning dir '%s'\n", path.string());
+    ALOGV("Scanning dir '%s'\n", path.string());
 
     dir = opendir(path.string());
     if (dir == NULL)
@@ -1782,7 +1782,7 @@
 {
     //LOGI("Creating SharedZip %p %s\n", this, (const char*)mPath);
     mZipFile = new ZipFileRO;
-    LOGV("+++ opening zip '%s'\n", mPath.string());
+    ALOGV("+++ opening zip '%s'\n", mPath.string());
     if (mZipFile->open(mPath.string()) != NO_ERROR) {
         LOGD("failed to open Zip archive '%s'\n", mPath.string());
         delete mZipFile;
@@ -1811,7 +1811,7 @@
 
 Asset* AssetManager::SharedZip::getResourceTableAsset()
 {
-    LOGV("Getting from SharedZip %p resource asset %p\n", this, mResourceTableAsset);
+    ALOGV("Getting from SharedZip %p resource asset %p\n", this, mResourceTableAsset);
     return mResourceTableAsset;
 }
 
@@ -1833,7 +1833,7 @@
 
 ResTable* AssetManager::SharedZip::getResourceTable()
 {
-    LOGV("Getting from SharedZip %p resource table %p\n", this, mResourceTable);
+    ALOGV("Getting from SharedZip %p resource table %p\n", this, mResourceTable);
     return mResourceTable;
 }
 
@@ -1867,7 +1867,7 @@
     }
     if (mZipFile != NULL) {
         delete mZipFile;
-        LOGV("Closed '%s'\n", mPath.string());
+        ALOGV("Closed '%s'\n", mPath.string());
     }
 }
 
diff --git a/libs/utils/BasicHashtable.cpp b/libs/utils/BasicHashtable.cpp
new file mode 100644
index 0000000..fb8ec9f
--- /dev/null
+++ b/libs/utils/BasicHashtable.cpp
@@ -0,0 +1,338 @@
+/*
+ * 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
index d38aae9..4970828 100644
--- a/libs/utils/BlobCache.cpp
+++ b/libs/utils/BlobCache.cpp
@@ -48,23 +48,23 @@
     mRandState[1] = (now >> 16) & 0xFFFF;
     mRandState[2] = (now >> 32) & 0xFFFF;
 #endif
-    LOGV("initializing random seed using %lld", now);
+    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) {
-        LOGV("set: not caching because the key is too large: %d (limit: %d)",
+        ALOGV("set: not caching because the key is too large: %d (limit: %d)",
                 keySize, mMaxKeySize);
         return;
     }
     if (mMaxValueSize < valueSize) {
-        LOGV("set: not caching because the value is too large: %d (limit: %d)",
+        ALOGV("set: not caching because the value is too large: %d (limit: %d)",
                 valueSize, mMaxValueSize);
         return;
     }
     if (mMaxTotalSize < keySize + valueSize) {
-        LOGV("set: not caching because the combined key/value size is too "
+        ALOGV("set: not caching because the combined key/value size is too "
                 "large: %d (limit: %d)", keySize + valueSize, mMaxTotalSize);
         return;
     }
@@ -93,7 +93,7 @@
                     clean();
                     continue;
                 } else {
-                    LOGV("set: not caching new key/value pair because the "
+                    ALOGV("set: not caching new key/value pair because the "
                             "total cache size limit would be exceeded: %d "
                             "(limit: %d)",
                             keySize + valueSize, mMaxTotalSize);
@@ -102,7 +102,7 @@
             }
             mCacheEntries.add(CacheEntry(keyBlob, valueBlob));
             mTotalSize = newTotalSize;
-            LOGV("set: created new cache entry with %d byte key and %d byte value",
+            ALOGV("set: created new cache entry with %d byte key and %d byte value",
                     keySize, valueSize);
         } else {
             // Update the existing cache entry.
@@ -115,7 +115,7 @@
                     clean();
                     continue;
                 } else {
-                    LOGV("set: not caching new value because the total cache "
+                    ALOGV("set: not caching new value because the total cache "
                             "size limit would be exceeded: %d (limit: %d)",
                             keySize + valueSize, mMaxTotalSize);
                     break;
@@ -123,7 +123,7 @@
             }
             mCacheEntries.editItemAt(index).setValue(valueBlob);
             mTotalSize = newTotalSize;
-            LOGV("set: updated existing cache entry with %d byte key and %d byte "
+            ALOGV("set: updated existing cache entry with %d byte key and %d byte "
                     "value", keySize, valueSize);
         }
         break;
@@ -133,7 +133,7 @@
 size_t BlobCache::get(const void* key, size_t keySize, void* value,
         size_t valueSize) {
     if (mMaxKeySize < keySize) {
-        LOGV("get: not searching because the key is too large: %d (limit %d)",
+        ALOGV("get: not searching because the key is too large: %d (limit %d)",
                 keySize, mMaxKeySize);
         return 0;
     }
@@ -141,7 +141,7 @@
     CacheEntry dummyEntry(dummyKey, NULL);
     ssize_t index = mCacheEntries.indexOf(dummyEntry);
     if (index < 0) {
-        LOGV("get: no cache entry found for key of size %d", keySize);
+        ALOGV("get: no cache entry found for key of size %d", keySize);
         return 0;
     }
 
@@ -150,10 +150,10 @@
     sp<Blob> valueBlob(mCacheEntries[index].getValue());
     size_t valueBlobSize = valueBlob->getSize();
     if (valueBlobSize <= valueSize) {
-        LOGV("get: copying %d bytes to caller's buffer", valueBlobSize);
+        ALOGV("get: copying %d bytes to caller's buffer", valueBlobSize);
         memcpy(value, valueBlob->getData(), valueBlobSize);
     } else {
-        LOGV("get: caller's buffer is too small for value: %d (needs %d)",
+        ALOGV("get: caller's buffer is too small for value: %d (needs %d)",
                 valueSize, valueBlobSize);
     }
     return valueBlobSize;
diff --git a/libs/utils/CallStack.cpp b/libs/utils/CallStack.cpp
index 55b6024..c2a5e55 100644
--- a/libs/utils/CallStack.cpp
+++ b/libs/utils/CallStack.cpp
@@ -17,218 +17,33 @@
 #define LOG_TAG "CallStack"
 
 #include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#if HAVE_DLADDR
-#include <dlfcn.h>
-#endif
-
-#if HAVE_CXXABI
-#include <cxxabi.h>
-#endif
-
-#include <unwind.h>
 
 #include <utils/Log.h>
 #include <utils/Errors.h>
 #include <utils/CallStack.h>
-#include <utils/threads.h>
-
+#include <corkscrew/backtrace.h>
 
 /*****************************************************************************/
 namespace android {
 
-
-typedef struct {
-    size_t count;
-    size_t ignore;
-    const void** addrs;
-} stack_crawl_state_t;
-
-static
-_Unwind_Reason_Code trace_function(_Unwind_Context *context, void *arg)
-{
-    stack_crawl_state_t* state = (stack_crawl_state_t*)arg;
-    if (state->count) {
-        void* ip = (void*)_Unwind_GetIP(context);
-        if (ip) {
-            if (state->ignore) {
-                state->ignore--;
-            } else {
-                state->addrs[0] = ip; 
-                state->addrs++;
-                state->count--;
-            }
-        }
-    }
-    return _URC_NO_REASON;
+CallStack::CallStack() :
+        mCount(0) {
 }
 
-static
-int backtrace(const void** addrs, size_t ignore, size_t size)
-{
-    stack_crawl_state_t state;
-    state.count = size;
-    state.ignore = ignore;
-    state.addrs = addrs;
-    _Unwind_Backtrace(trace_function, (void*)&state);
-    return size - state.count;
-}
-
-/*****************************************************************************/
-
-static 
-const char *lookup_symbol(const void* addr, void **offset, char* name, size_t bufSize)
-{
-#if HAVE_DLADDR
-    Dl_info info;
-    if (dladdr(addr, &info)) {
-        *offset = info.dli_saddr;
-        return info.dli_sname;
-    }
-#endif
-    return NULL;
-}
-
-static 
-int32_t linux_gcc_demangler(const char *mangled_name, char *unmangled_name, size_t buffersize)
-{
-    size_t out_len = 0;
-#if HAVE_CXXABI
-    int status = 0;
-    char *demangled = abi::__cxa_demangle(mangled_name, 0, &out_len, &status);
-    if (status == 0) {
-        // OK
-        if (out_len < buffersize) memcpy(unmangled_name, demangled, out_len);
-        else out_len = 0;
-        free(demangled);
-    } else {
-        out_len = 0;
-    }
-#endif
-    return out_len;
-}
-
-/*****************************************************************************/
-
-class MapInfo {
-    struct mapinfo {
-        struct mapinfo *next;
-        uint64_t start;
-        uint64_t end;
-        char name[];
-    };
-
-    const char *map_to_name(uint64_t pc, const char* def, uint64_t* start) {
-        mapinfo* mi = getMapInfoList();
-        while(mi) {
-            if ((pc >= mi->start) && (pc < mi->end)) {
-                if (start) 
-                    *start = mi->start;
-                return mi->name;
-            }
-            mi = mi->next;
-        }
-        if (start) 
-            *start = 0;
-        return def;
-    }
-
-    mapinfo *parse_maps_line(char *line) {
-        mapinfo *mi;
-        int len = strlen(line);
-        if (len < 1) return 0;
-        line[--len] = 0;
-        if (len < 50) return 0;
-        if (line[20] != 'x') return 0;
-        mi = (mapinfo*)malloc(sizeof(mapinfo) + (len - 47));
-        if (mi == 0) return 0;
-        mi->start = strtoull(line, 0, 16);
-        mi->end = strtoull(line + 9, 0, 16);
-        mi->next = 0;
-        strcpy(mi->name, line + 49);
-        return mi;
-    }
-
-    mapinfo* getMapInfoList() {
-        Mutex::Autolock _l(mLock);
-        if (milist == 0) {
-            char data[1024];
-            FILE *fp;
-            sprintf(data, "/proc/%d/maps", getpid());
-            fp = fopen(data, "r");
-            if (fp) {
-                while(fgets(data, 1024, fp)) {
-                    mapinfo *mi = parse_maps_line(data);
-                    if(mi) {
-                        mi->next = milist;
-                        milist = mi;
-                    }
-                }
-                fclose(fp);
-            }
-        }
-        return milist;
-    }
-    mapinfo*    milist;
-    Mutex       mLock;
-    static MapInfo sMapInfo;
-
-public:
-    MapInfo()
-     : milist(0) {
-    }
-
-    ~MapInfo() {
-        while (milist) {
-            mapinfo *next = milist->next;
-            free(milist);
-            milist = next;
-        }
-    }
-    
-    static const char *mapAddressToName(const void* pc, const char* def,
-            void const** start) 
-    {
-        uint64_t s;
-        char const* name = sMapInfo.map_to_name(uint64_t(uintptr_t(pc)), def, &s);
-        if (start) {
-            *start = (void*)s;
-        }
-        return name;
-    }
-
-};
-
-/*****************************************************************************/
-
-MapInfo MapInfo::sMapInfo;
-
-/*****************************************************************************/
-
-CallStack::CallStack()
-    : mCount(0)
-{
-}
-
-CallStack::CallStack(const CallStack& rhs)
-    : mCount(rhs.mCount)
-{
+CallStack::CallStack(const CallStack& rhs) :
+        mCount(rhs.mCount) {
     if (mCount) {
-        memcpy(mStack, rhs.mStack, mCount*sizeof(void*));
+        memcpy(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t));
     }
 }
 
-CallStack::~CallStack()
-{
+CallStack::~CallStack() {
 }
 
-CallStack& CallStack::operator = (const CallStack& rhs)
-{
+CallStack& CallStack::operator = (const CallStack& rhs) {
     mCount = rhs.mCount;
     if (mCount) {
-        memcpy(mStack, rhs.mStack, mCount*sizeof(void*));
+        memcpy(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t));
     }
     return *this;
 }
@@ -236,7 +51,7 @@
 bool CallStack::operator == (const CallStack& rhs) const {
     if (mCount != rhs.mCount)
         return false;
-    return !mCount || (memcmp(mStack, rhs.mStack, mCount*sizeof(void*)) == 0);
+    return !mCount || memcmp(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t)) == 0;
 }
 
 bool CallStack::operator != (const CallStack& rhs) const {
@@ -246,7 +61,7 @@
 bool CallStack::operator < (const CallStack& rhs) const {
     if (mCount != rhs.mCount)
         return mCount < rhs.mCount;
-    return memcmp(mStack, rhs.mStack, mCount*sizeof(void*)) < 0;
+    return memcmp(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t)) < 0;
 }
 
 bool CallStack::operator >= (const CallStack& rhs) const {
@@ -256,7 +71,7 @@
 bool CallStack::operator > (const CallStack& rhs) const {
     if (mCount != rhs.mCount)
         return mCount > rhs.mCount;
-    return memcmp(mStack, rhs.mStack, mCount*sizeof(void*)) > 0;
+    return memcmp(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t)) > 0;
 }
 
 bool CallStack::operator <= (const CallStack& rhs) const {
@@ -266,84 +81,49 @@
 const void* CallStack::operator [] (int index) const {
     if (index >= int(mCount))
         return 0;
-    return mStack[index];
+    return reinterpret_cast<const void*>(mStack[index].absolute_pc);
 }
 
-
-void CallStack::clear()
-{
+void CallStack::clear() {
     mCount = 0;
 }
 
-void CallStack::update(int32_t ignoreDepth, int32_t maxDepth)
-{
-    if (maxDepth > MAX_DEPTH)
+void CallStack::update(int32_t ignoreDepth, int32_t maxDepth) {
+    if (maxDepth > MAX_DEPTH) {
         maxDepth = MAX_DEPTH;
-    mCount = backtrace(mStack, ignoreDepth, maxDepth);
-}
-
-// Return the stack frame name on the designated level
-String8 CallStack::toStringSingleLevel(const char* prefix, int32_t level) const
-{
-    String8 res;
-    char namebuf[1024];
-    char tmp[256];
-    char tmp1[32];
-    char tmp2[32];
-    void *offs;
-
-    const void* ip = mStack[level];
-    if (!ip) return res;
-
-    if (prefix) res.append(prefix);
-    snprintf(tmp1, 32, "#%02d  ", level);
-    res.append(tmp1);
-
-    const char* name = lookup_symbol(ip, &offs, namebuf, sizeof(namebuf));
-    if (name) {
-        if (linux_gcc_demangler(name, tmp, 256) != 0)
-            name = tmp;
-        snprintf(tmp1, 32, "0x%p: <", ip);
-        snprintf(tmp2, 32, ">+0x%p", offs);
-        res.append(tmp1);
-        res.append(name);
-        res.append(tmp2);
-    } else { 
-        void const* start = 0;
-        name = MapInfo::mapAddressToName(ip, "<unknown>", &start);
-        snprintf(tmp, 256, "pc %08lx  %s", 
-                long(uintptr_t(ip)-uintptr_t(start)), name);
-        res.append(tmp);
     }
-    res.append("\n");
-
-    return res;
+    ssize_t count = unwind_backtrace(mStack, ignoreDepth + 1, maxDepth);
+    mCount = count > 0 ? count : 0;
 }
 
-// Dump a stack trace to the log
-void CallStack::dump(const char* prefix) const
-{
-    /* 
-     * Sending a single long log may be truncated since the stack levels can
-     * get very deep. So we request function names of each frame individually.
-     */
-    for (int i=0; i<int(mCount); i++) {
-        LOGD("%s", toStringSingleLevel(prefix, i).string());
+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);
+        LOGD("%s%s", prefix, line);
     }
+    free_backtrace_symbols(symbols, mCount);
 }
 
-// Return a string (possibly very long) containing the complete stack trace
-String8 CallStack::toString(const char* prefix) const
-{
-    String8 res;
+String8 CallStack::toString(const char* prefix) const {
+    String8 str;
+    backtrace_symbol_t symbols[mCount];
 
-    for (int i=0; i<int(mCount); i++) {
-        res.append(toStringSingleLevel(prefix, i).string());
+    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");
     }
-
-    return res;
+    free_backtrace_symbols(symbols, mCount);
+    return str;
 }
 
-/*****************************************************************************/
-
 }; // namespace android
diff --git a/libs/utils/FileMap.cpp b/libs/utils/FileMap.cpp
index c220a90..294f7b6 100644
--- a/libs/utils/FileMap.cpp
+++ b/libs/utils/FileMap.cpp
@@ -190,7 +190,7 @@
 
     assert(mBasePtr != NULL);
 
-    LOGV("MAP: base %p/%d data %p/%d\n",
+    ALOGV("MAP: base %p/%d data %p/%d\n",
         mBasePtr, (int) mBaseLength, mDataPtr, (int) mDataLength);
 
     return true;
diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp
index 37d061c..959b382 100644
--- a/libs/utils/RefBase.cpp
+++ b/libs/utils/RefBase.cpp
@@ -421,7 +421,7 @@
             // destroy the object now.
             delete impl->mBase;
         } else {
-            // LOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase);
+            // ALOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase);
             delete impl;
         }
     } else {
diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp
index 6cf01c8..6a9e91d 100644
--- a/libs/utils/ResourceTypes.cpp
+++ b/libs/utils/ResourceTypes.cpp
@@ -69,7 +69,7 @@
 
 static void printToLogFunc(void* cookie, const char* txt)
 {
-    LOGV("%s", txt);
+    ALOGV("%s", txt);
 }
 
 // Standard C isspace() is only required to look at the low byte of its input, so
@@ -1867,7 +1867,7 @@
     const bool notDeviceEndian = htods(0xf0) != 0xf0;
 
     LOAD_TABLE_NOISY(
-        LOGV("Adding resources to ResTable: data=%p, size=0x%x, cookie=%p, asset=%p, copy=%d "
+        ALOGV("Adding resources to ResTable: data=%p, size=0x%x, cookie=%p, asset=%p, copy=%d "
              "idmap=%p\n", data, size, cookie, asset, copyData, idmap));
     
     if (copyData || notDeviceEndian) {
@@ -2122,7 +2122,7 @@
                                           resID, &overlayResID);
             if (retval == NO_ERROR && overlayResID != 0x0) {
                 // for this loop iteration, this is the type and entry we really want
-                LOGV("resource map 0x%08x -> 0x%08x\n", resID, overlayResID);
+                ALOGV("resource map 0x%08x -> 0x%08x\n", resID, overlayResID);
                 T = Res_GETTYPE(overlayResID);
                 E = Res_GETENTRY(overlayResID);
             } else {
@@ -2401,7 +2401,7 @@
                                           resID, &overlayResID);
             if (retval == NO_ERROR && overlayResID != 0x0) {
                 // for this loop iteration, this is the type and entry we really want
-                LOGV("resource map 0x%08x -> 0x%08x\n", resID, overlayResID);
+                ALOGV("resource map 0x%08x -> 0x%08x\n", resID, overlayResID);
                 T = Res_GETTYPE(overlayResID);
                 E = Res_GETENTRY(overlayResID);
             } else {
@@ -2413,9 +2413,9 @@
         const ResTable_type* type;
         const ResTable_entry* entry;
         const Type* typeClass;
-        LOGV("Getting entry pkg=%p, t=%d, e=%d\n", package, T, E);
+        ALOGV("Getting entry pkg=%p, t=%d, e=%d\n", package, T, E);
         ssize_t offset = getEntry(package, T, E, &mParams, &type, &entry, &typeClass);
-        LOGV("Resulting offset=%d\n", offset);
+        ALOGV("Resulting offset=%d\n", offset);
         if (offset <= 0) {
             // No {entry, appropriate config} pair found in package. If this
             // package is an overlay package (ip != 0), this simply means the
@@ -3898,9 +3898,9 @@
 void ResTable::getLocales(Vector<String8>* locales) const
 {
     Vector<ResTable_config> configs;
-    LOGV("calling getConfigurations");
+    ALOGV("calling getConfigurations");
     getConfigurations(&configs);
-    LOGV("called getConfigurations size=%d", (int)configs.size());
+    ALOGV("called getConfigurations size=%d", (int)configs.size());
     const size_t I = configs.size();
     for (size_t i=0; i<I; i++) {
         char locale[6];
@@ -3924,13 +3924,13 @@
     const ResTable_type** outType, const ResTable_entry** outEntry,
     const Type** outTypeClass) const
 {
-    LOGV("Getting entry from package %p\n", package);
+    ALOGV("Getting entry from package %p\n", package);
     const ResTable_package* const pkg = package->package;
 
     const Type* allTypes = package->getType(typeIndex);
-    LOGV("allTypes=%p\n", allTypes);
+    ALOGV("allTypes=%p\n", allTypes);
     if (allTypes == NULL) {
-        LOGV("Skipping entry type index 0x%02x because type is NULL!\n", typeIndex);
+        ALOGV("Skipping entry type index 0x%02x because type is NULL!\n", typeIndex);
         return 0;
     }
 
diff --git a/libs/utils/StreamingZipInflater.cpp b/libs/utils/StreamingZipInflater.cpp
index 00498bd..59a46f9 100644
--- a/libs/utils/StreamingZipInflater.cpp
+++ b/libs/utils/StreamingZipInflater.cpp
@@ -77,7 +77,7 @@
 }
 
 void StreamingZipInflater::initInflateState() {
-    LOGV("Initializing inflate state");
+    ALOGV("Initializing inflate state");
 
     memset(&mInflateState, 0, sizeof(mInflateState));
     mInflateState.zalloc = Z_NULL;
@@ -152,13 +152,13 @@
             mInflateState.avail_out = mOutBufSize;
 
             /*
-            LOGV("Inflating to outbuf: avail_in=%u avail_out=%u next_in=%p next_out=%p",
+            ALOGV("Inflating to outbuf: avail_in=%u avail_out=%u next_in=%p next_out=%p",
                     mInflateState.avail_in, mInflateState.avail_out,
                     mInflateState.next_in, mInflateState.next_out);
             */
             int result = Z_OK;
             if (mStreamNeedsInit) {
-                LOGV("Initializing zlib to inflate");
+                ALOGV("Initializing zlib to inflate");
                 result = inflateInit2(&mInflateState, -MAX_WBITS);
                 mStreamNeedsInit = false;
             }
@@ -192,7 +192,7 @@
         size_t toRead = min_of(mInBufSize, mInTotalSize - mInNextChunkOffset);
         if (toRead > 0) {
             ssize_t didRead = ::read(mFd, mInBuf, toRead);
-            //LOGV("Reading input chunk, size %08x didread %08x", toRead, didRead);
+            //ALOGV("Reading input chunk, size %08x didread %08x", toRead, didRead);
             if (didRead < 0) {
                 // TODO: error
                 LOGE("Error reading asset data");
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index 5dbcb75..fe4b8e6 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -205,7 +205,7 @@
 
     delete pDetails;
 
-    LOG(LOG_VERBOSE, "thread", "thread exiting\n");
+    ALOG(LOG_VERBOSE, "thread", "thread exiting\n");
     return (unsigned int) result;
 }
 
@@ -232,7 +232,7 @@
     if (hThread == NULL)
 #endif
     {
-        LOG(LOG_WARN, "thread", "WARNING: thread create failed\n");
+        ALOG(LOG_WARN, "thread", "WARNING: thread create failed\n");
         return false;
     }
 
@@ -470,7 +470,7 @@
 void Mutex::unlock()
 {
     if (!ReleaseMutex((HANDLE) mState))
-        LOG(LOG_WARN, "thread", "WARNING: bad result from unlocking mutex\n");
+        ALOG(LOG_WARN, "thread", "WARNING: bad result from unlocking mutex\n");
 }
 
 status_t Mutex::tryLock()
@@ -479,7 +479,7 @@
 
     dwWaitResult = WaitForSingleObject((HANDLE) mState, 0);
     if (dwWaitResult != WAIT_OBJECT_0 && dwWaitResult != WAIT_TIMEOUT)
-        LOG(LOG_WARN, "thread", "WARNING: bad result from try-locking mutex\n");
+        ALOG(LOG_WARN, "thread", "WARNING: bad result from try-locking mutex\n");
     return (dwWaitResult == WAIT_OBJECT_0) ? 0 : -1;
 }
 
diff --git a/libs/utils/Timers.cpp b/libs/utils/Timers.cpp
index 64a29f5..64b4701 100644
--- a/libs/utils/Timers.cpp
+++ b/libs/utils/Timers.cpp
@@ -113,7 +113,7 @@
 /*static*/ void DurationTimer::addToTimeval(struct timeval* ptv, long usec)
 {
     if (usec < 0) {
-        LOG(LOG_WARN, "", "Negative values not supported in addToTimeval\n");
+        ALOG(LOG_WARN, "", "Negative values not supported in addToTimeval\n");
         return;
     }
 
diff --git a/libs/utils/VectorImpl.cpp b/libs/utils/VectorImpl.cpp
index bfb37a6..4a90296 100644
--- a/libs/utils/VectorImpl.cpp
+++ b/libs/utils/VectorImpl.cpp
@@ -346,7 +346,7 @@
 
 void* VectorImpl::_grow(size_t where, size_t amount)
 {
-//    LOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
+//    ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
 //        this, (int)where, (int)amount, (int)mCount, (int)capacity());
 
     LOG_ASSERT(where <= mCount,
@@ -356,7 +356,7 @@
     const size_t new_size = mCount + amount;
     if (capacity() < new_size) {
         const size_t new_capacity = max(kMinVectorCapacity, ((new_size*3)+1)/2);
-//        LOGV("grow vector %p, new_capacity=%d", this, (int)new_capacity);
+//        ALOGV("grow vector %p, new_capacity=%d", this, (int)new_capacity);
         if ((mStorage) &&
             (mCount==where) &&
             (mFlags & HAS_TRIVIAL_COPY) &&
@@ -399,7 +399,7 @@
     if (!mStorage)
         return;
 
-//    LOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
+//    ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
 //        this, (int)where, (int)amount, (int)mCount, (int)capacity());
 
     LOG_ASSERT(where + amount <= mCount,
@@ -409,7 +409,7 @@
     const size_t new_size = mCount - amount;
     if (new_size*3 < capacity()) {
         const size_t new_capacity = max(kMinVectorCapacity, new_size*2);
-//        LOGV("shrink vector %p, new_capacity=%d", this, (int)new_capacity);
+//        ALOGV("shrink vector %p, new_capacity=%d", this, (int)new_capacity);
         if ((where == new_size) &&
             (mFlags & HAS_TRIVIAL_COPY) &&
             (mFlags & HAS_TRIVIAL_DTOR))
diff --git a/libs/utils/ZipFileRO.cpp b/libs/utils/ZipFileRO.cpp
index b18c383..d880f55 100644
--- a/libs/utils/ZipFileRO.cpp
+++ b/libs/utils/ZipFileRO.cpp
@@ -222,7 +222,7 @@
             free(scanBuf);
             return false;
         } else if (header != kLFHSignature) {
-            LOGV("Not a Zip archive (found 0x%08x)\n", header);
+            ALOGV("Not a Zip archive (found 0x%08x)\n", header);
             free(scanBuf);
             return false;
         }
@@ -264,7 +264,7 @@
     int i;
     for (i = readAmount - kEOCDLen; i >= 0; i--) {
         if (scanBuf[i] == 0x50 && get4LE(&scanBuf[i]) == kEOCDSignature) {
-            LOGV("+++ Found EOCD at buf+%d\n", i);
+            ALOGV("+++ Found EOCD at buf+%d\n", i);
             break;
         }
     }
@@ -299,7 +299,7 @@
         return false;
     }
 
-    LOGV("+++ numEntries=%d dirSize=%d dirOffset=%d\n",
+    ALOGV("+++ numEntries=%d dirSize=%d dirOffset=%d\n",
         numEntries, dirSize, dirOffset);
 
     mDirectoryMap = new FileMap();
@@ -372,7 +372,7 @@
             goto bail;
         }
     }
-    LOGV("+++ zip good scan %d entries\n", numEntries);
+    ALOGV("+++ zip good scan %d entries\n", numEntries);
     result = true;
 
 bail:
diff --git a/libs/utils/ZipUtils.cpp b/libs/utils/ZipUtils.cpp
index 9138878..76725b4 100644
--- a/libs/utils/ZipUtils.cpp
+++ b/libs/utils/ZipUtils.cpp
@@ -95,7 +95,7 @@
         if (zstream.avail_in == 0) {
             getSize = (compRemaining > kReadBufSize) ?
                         kReadBufSize : compRemaining;
-            LOGV("+++ reading %ld bytes (%ld left)\n",
+            ALOGV("+++ reading %ld bytes (%ld left)\n",
                 getSize, compRemaining);
 
             int cc = read(fd, readBuf, getSize);
@@ -207,7 +207,7 @@
         if (zstream.avail_in == 0) {
             getSize = (compRemaining > kReadBufSize) ?
                         kReadBufSize : compRemaining;
-            LOGV("+++ reading %ld bytes (%ld left)\n",
+            ALOGV("+++ reading %ld bytes (%ld left)\n",
                 getSize, compRemaining);
 
             int cc = fread(readBuf, 1, getSize, fp);
diff --git a/libs/utils/primes.py b/libs/utils/primes.py
new file mode 100755
index 0000000..e161dd8
--- /dev/null
+++ b/libs/utils/primes.py
@@ -0,0 +1,47 @@
+#!/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
index b97f52f..58230f4 100644
--- a/libs/utils/tests/Android.mk
+++ b/libs/utils/tests/Android.mk
@@ -4,9 +4,10 @@
 
 # Build the unit tests.
 test_src_files := \
+	BasicHashtable_test.cpp \
 	BlobCache_test.cpp \
-	ObbFile_test.cpp \
 	Looper_test.cpp \
+	ObbFile_test.cpp \
 	String8_test.cpp \
 	Unicode_test.cpp \
 	ZipFileRO_test.cpp \
diff --git a/libs/utils/tests/BasicHashtable_test.cpp b/libs/utils/tests/BasicHashtable_test.cpp
new file mode 100644
index 0000000..764082d
--- /dev/null
+++ b/libs/utils/tests/BasicHashtable_test.cpp
@@ -0,0 +1,577 @@
+/*
+ * 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) {
+    LOGD("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);
+            LOGD("  [%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 {
+            LOGD("  [%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/opengl/libs/Android.mk b/opengl/libs/Android.mk
index 9c1a10e..66bc64d 100644
--- a/opengl/libs/Android.mk
+++ b/opengl/libs/Android.mk
@@ -18,7 +18,7 @@
 	EGL/Loader.cpp 	       \
 #
 
-LOCAL_SHARED_LIBRARIES += libcutils libutils libGLESv2_dbg
+LOCAL_SHARED_LIBRARIES += libcutils libutils libGLES_trace
 LOCAL_LDLIBS := -lpthread -ldl
 LOCAL_MODULE:= libEGL
 LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 325193c..8a8898b 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -28,7 +28,7 @@
 #include <EGL/egl.h>
 
 #include "egldefs.h"
-#include "glesv2dbg.h"
+#include "glestrace.h"
 #include "hooks.h"
 #include "Loader.h"
 
@@ -157,7 +157,7 @@
 
 Loader::~Loader()
 {
-    StopDebugServer();
+    GLTrace_stop();
 }
 
 const char* Loader::getTag(int dpy, int impl)
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 6ad06af..14745b3 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -37,7 +37,7 @@
 #include "egldefs.h"
 #include "egl_impl.h"
 #include "egl_tls.h"
-#include "glesv2dbg.h"
+#include "glestrace.h"
 #include "hooks.h"
 #include "Loader.h"
 
@@ -67,7 +67,6 @@
 static int sEGLApplicationTraceLevel;
 
 extern gl_hooks_t gHooksTrace;
-extern gl_hooks_t gHooksDebug;
 
 static inline void setGlTraceThreadSpecific(gl_hooks_t const *value) {
     pthread_setspecific(gGLTraceKey, value);
@@ -89,27 +88,17 @@
     char procPath[128] = {};
     sprintf(procPath, "/proc/%ld/cmdline", pid);
     FILE * file = fopen(procPath, "r");
-    if (file)
-    {
+    if (file) {
         char cmdline[256] = {};
-        if (fgets(cmdline, sizeof(cmdline) - 1, file))
-        {
+        if (fgets(cmdline, sizeof(cmdline) - 1, file)) {
             if (!strcmp(value, cmdline))
                 gEGLDebugLevel = 1;
         }
         fclose(file);
     }
 
-    if (gEGLDebugLevel > 0)
-    {
-        property_get("debug.egl.debug_port", value, "5039");
-        const unsigned short port = (unsigned short)atoi(value);
-        property_get("debug.egl.debug_forceUseFile", value, "0");
-        const bool forceUseFile = (bool)atoi(value);
-        property_get("debug.egl.debug_maxFileSize", value, "8");
-        const unsigned int maxFileSize = atoi(value) << 20;
-        property_get("debug.egl.debug_filePath", value, "/data/local/tmp/dump.gles2dbg");
-        StartDebugServer(port, forceUseFile, maxFileSize, value);
+    if (gEGLDebugLevel > 0) {
+        GLTrace_start();
     }
 }
 
@@ -119,7 +108,7 @@
         setGlThreadSpecific(&gHooksTrace);
     } else if (gEGLDebugLevel > 0 && value != &gHooksNoContext) {
         setGlTraceThreadSpecific(value);
-        setGlThreadSpecific(&gHooksDebug);
+        setGlThreadSpecific(GLTrace_getGLHooks());
     } else {
         setGlThreadSpecific(value);
     }
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 2b0ed5d..1dbba3f 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -37,7 +37,7 @@
 
 #include "egl_impl.h"
 #include "egl_tls.h"
-#include "glesv2dbg.h"
+#include "glestrace.h"
 #include "hooks.h"
 
 #include "egl_display.h"
@@ -112,7 +112,6 @@
 extern const __eglMustCastToProperFunctionPointerType gExtensionForwarders[MAX_NUMBER_OF_GL_EXTENSIONS];
 extern int gEGLDebugLevel;
 extern gl_hooks_t gHooksTrace;
-extern gl_hooks_t gHooksDebug;
 } // namespace android;
 
 // ----------------------------------------------------------------------------
@@ -516,6 +515,10 @@
             }
             egl_context_t* c = new egl_context_t(dpy, context, config,
                     dp->configs[intptr_t(config)].impl, cnx, version);
+#if EGL_TRACE
+            if (gEGLDebugLevel > 0)
+                GLTrace_eglCreateContext(version, c);
+#endif
             return c;
         }
     }
@@ -657,9 +660,10 @@
         if (ctx != EGL_NO_CONTEXT) {
             setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
             egl_tls_t::setContext(ctx);
-            if (gEGLDebugLevel > 0) {
-                CreateDbgContext(c->version, c->cnx->hooks[c->version]);
-            }
+#if EGL_TRACE
+            if (gEGLDebugLevel > 0)
+                GLTrace_eglMakeCurrent(c->version, c->cnx->hooks[c->version]);
+#endif
             _c.acquire();
             _r.acquire();
             _d.acquire();
@@ -886,6 +890,10 @@
                 "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;
             for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) {
@@ -896,7 +904,7 @@
                     cnx->hooks[GLESv1_INDEX]->ext.extensions[slot] =
                     cnx->hooks[GLESv2_INDEX]->ext.extensions[slot] =
 #if EGL_TRACE
-                    gHooksDebug.ext.extensions[slot] = gHooksTrace.ext.extensions[slot] =
+                    debugHooks->ext.extensions[slot] = gHooksTrace.ext.extensions[slot] =
 #endif
                             cnx->egl.eglGetProcAddress(procname);
                 }
@@ -924,10 +932,6 @@
 
 EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
 {
-    EGLBoolean Debug_eglSwapBuffers(EGLDisplay dpy, EGLSurface draw);
-    if (gEGLDebugLevel > 0)
-        Debug_eglSwapBuffers(dpy, draw);
-
     clearError();
 
     egl_display_t const * const dp = validate_display(dpy);
@@ -937,6 +941,11 @@
     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[s->impl].dpy, s->surface);
 }
@@ -1162,7 +1171,10 @@
         }
     }
     egl_tls_t::clearTLS();
-    dbgReleaseThread();
+#if EGL_TRACE
+    if (gEGLDebugLevel > 0)
+        GLTrace_eglReleaseThread();
+#endif
     return EGL_TRUE;
 }
 
diff --git a/opengl/libs/EGL/egl_tls.cpp b/opengl/libs/EGL/egl_tls.cpp
index b341ddb..6946ecd 100644
--- a/opengl/libs/EGL/egl_tls.cpp
+++ b/opengl/libs/EGL/egl_tls.cpp
@@ -33,7 +33,7 @@
 pthread_mutex_t egl_tls_t::sLockKey = PTHREAD_MUTEX_INITIALIZER;
 
 egl_tls_t::egl_tls_t()
-    : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE), dbg(0) {
+    : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE) {
 }
 
 const char *egl_tls_t::egl_strerror(EGLint err) {
diff --git a/opengl/libs/EGL/egl_tls.h b/opengl/libs/EGL/egl_tls.h
index 78b0b2f..2442ca0 100644
--- a/opengl/libs/EGL/egl_tls.h
+++ b/opengl/libs/EGL/egl_tls.h
@@ -37,7 +37,6 @@
     EGLint      error;
     EGLContext  ctx;
     EGLBoolean  logCallWithNoContext;
-    DbgContext* dbg;
 
     egl_tls_t();
     static void validateTLSKey();
diff --git a/opengl/libs/EGL/trace.cpp b/opengl/libs/EGL/trace.cpp
index 0e934e2..bd6c348 100644
--- a/opengl/libs/EGL/trace.cpp
+++ b/opengl/libs/EGL/trace.cpp
@@ -375,22 +375,6 @@
 #undef TRACE_GL_VOID
 #undef TRACE_GL
 
-// declare all Debug_gl* functions
-#define GL_ENTRY(_r, _api, ...) _r Debug_##_api ( __VA_ARGS__ );
-#include "glesv2dbg_functions.h"
-#undef GL_ENTRY
-
-#define GL_ENTRY(_r, _api, ...) Debug_ ## _api,
-EGLAPI gl_hooks_t gHooksDebug = {
-    {
-        #include "entries.in"
-    },
-    {
-        {0}
-    }
-};
-#undef GL_ENTRY
-
 // ----------------------------------------------------------------------------
 }; // namespace android
 // ----------------------------------------------------------------------------
diff --git a/opengl/libs/ETC1/etc1.cpp b/opengl/libs/ETC1/etc1.cpp
index 5ed2c3c..97d1085 100644
--- a/opengl/libs/ETC1/etc1.cpp
+++ b/opengl/libs/ETC1/etc1.cpp
@@ -149,13 +149,13 @@
 static
 inline int convert8To4(int b) {
     int c = b & 0xff;
-    return divideBy255(b * 15);
+    return divideBy255(c * 15);
 }
 
 static
 inline int convert8To5(int b) {
     int c = b & 0xff;
-    return divideBy255(b * 31);
+    return divideBy255(c * 31);
 }
 
 static
diff --git a/opengl/libs/GLES_trace/.gitignore b/opengl/libs/GLES_trace/.gitignore
new file mode 100644
index 0000000..8df825e
--- /dev/null
+++ b/opengl/libs/GLES_trace/.gitignore
@@ -0,0 +1,4 @@
+java
+*.pyc
+*.swp
+pyratemp.py
diff --git a/opengl/libs/GLES2_dbg/Android.mk b/opengl/libs/GLES_trace/Android.mk
similarity index 69%
rename from opengl/libs/GLES2_dbg/Android.mk
rename to opengl/libs/GLES_trace/Android.mk
index 70853d8..465b6b2 100644
--- a/opengl/libs/GLES2_dbg/Android.mk
+++ b/opengl/libs/GLES_trace/Android.mk
@@ -3,13 +3,14 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := \
-    src/api.cpp \
-    src/caller.cpp \
-    src/dbgcontext.cpp \
-    src/debugger_message.pb.cpp \
-    src/egl.cpp \
-    src/server.cpp \
-    src/vertex.cpp
+    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) \
@@ -19,20 +20,15 @@
     external \
     bionic
 
-#LOCAL_CFLAGS += -O0 -g -DDEBUG -UNDEBUG
 LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
 LOCAL_STATIC_LIBRARIES := libprotobuf-cpp-2.3.0-lite liblzf
 LOCAL_SHARED_LIBRARIES := libcutils libutils libstlport
-ifeq ($(TARGET_ARCH),arm)
-	LOCAL_CFLAGS += -fstrict-aliasing
-endif
 
 ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
     LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
 endif
 
-LOCAL_CFLAGS += -DLOG_TAG=\"libGLES2_dbg\"
-
+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
@@ -42,9 +38,7 @@
 endif
 LOCAL_C_INCLUDES += bionic/libc/private
 
-LOCAL_MODULE:= libGLESv2_dbg
+LOCAL_MODULE:= libGLES_trace
 LOCAL_MODULE_TAGS := optional
 
 include $(BUILD_SHARED_LIBRARY)
-
-include $(LOCAL_PATH)/test/Android.mk
diff --git a/opengl/libs/GLES_trace/DESIGN.txt b/opengl/libs/GLES_trace/DESIGN.txt
new file mode 100644
index 0000000..a189e1d
--- /dev/null
+++ b/opengl/libs/GLES_trace/DESIGN.txt
@@ -0,0 +1,51 @@
+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/TODO.txt b/opengl/libs/GLES_trace/TODO.txt
new file mode 100644
index 0000000..f5e6e95
--- /dev/null
+++ b/opengl/libs/GLES_trace/TODO.txt
@@ -0,0 +1,14 @@
+TODO:
+    - Context - Currently, we don't do anything regarding the contexts that are created.
+    Need to maintain more state regarding contexts, and figure out what happens in the
+    presence of multiple contexts.
+
+    - Transport: Each GLMessage is sent via a socket as soon as the message is received.
+    i.e., there is no buffering of messages. Buffering should improve performance.
+
+    - Initialization: On first connection, send some basic information that includes:
+        1. version of the trace library
+        2. implementation dependent GL state variables such as # of vertex arrays etc.
+
+    - eglSwapBuffers: The images are lzf compressed, but there is no mode that transfers
+    only the differences from the previous images.
diff --git a/opengl/libs/GLES_trace/dev.make b/opengl/libs/GLES_trace/dev.make
new file mode 100644
index 0000000..1d89999
--- /dev/null
+++ b/opengl/libs/GLES_trace/dev.make
@@ -0,0 +1,15 @@
+## 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
+
+# NOTE: $OUT should be defined in the shell by doing a "lunch <config>"
+# push updated files to device
+push:
+	adb push $(OUT)/system/lib/libGLESv2.so /system/lib/
+	adb push $(OUT)/system/lib/libGLESv1_CM.so /system/lib/
+	adb push $(OUT)/system/lib/libGLES_trace.so /system/lib/
+	adb push $(OUT)/system/lib/libEGL.so /system/lib/
diff --git a/opengl/libs/GLES_trace/gltrace.proto b/opengl/libs/GLES_trace/gltrace.proto
new file mode 100644
index 0000000..12d8e7c
--- /dev/null
+++ b/opengl/libs/GLES_trace/gltrace.proto
@@ -0,0 +1,488 @@
+/*
+ * 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;
+
+        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;
+        frameBufferContents = 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 Function   function = 2 [default = invalid];   // GL function called
+    repeated DataType   args = 3;                           // GL function's arguments
+    optional DataType   returnValue = 4;                    // GL function's return value
+    optional float      duration = 5;                       // duration of GL call
+    optional FrameBuffer fb = 6;                            // contents of the framebuffer
+};
diff --git a/opengl/libs/GLES_trace/src/gltrace.pb.cpp b/opengl/libs/GLES_trace/src/gltrace.pb.cpp
new file mode 100644
index 0000000..6c1bb91
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace.pb.cpp
@@ -0,0 +1,1888 @@
+// 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 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::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::frameBufferContents;
+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::kFunctionFieldNumber;
+const int GLMessage::kArgsFieldNumber;
+const int GLMessage::kReturnValueFieldNumber;
+const int GLMessage::kDurationFieldNumber;
+const int GLMessage::kFbFieldNumber;
+#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;
+  function_ = 3000;
+  returnvalue_ = NULL;
+  duration_ = 0;
+  fb_ = NULL;
+  ::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;
+    function_ = 3000;
+    if (_has_bit(3)) {
+      if (returnvalue_ != NULL) returnvalue_->::android::gltrace::GLMessage_DataType::Clear();
+    }
+    duration_ = 0;
+    if (_has_bit(5)) {
+      if (fb_ != NULL) fb_->::android::gltrace::GLMessage_FrameBuffer::Clear();
+    }
+  }
+  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_function;
+        break;
+      }
+      
+      // required .android.gltrace.GLMessage.Function function = 2 [default = invalid];
+      case 2: {
+        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(26)) goto parse_args;
+        break;
+      }
+      
+      // repeated .android.gltrace.GLMessage.DataType args = 3;
+      case 3: {
+        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(26)) goto parse_args;
+        if (input->ExpectTag(34)) goto parse_returnValue;
+        break;
+      }
+      
+      // optional .android.gltrace.GLMessage.DataType returnValue = 4;
+      case 4: {
+        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(45)) goto parse_duration;
+        break;
+      }
+      
+      // optional float duration = 5;
+      case 5: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
+         parse_duration:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
+                 input, &duration_)));
+          _set_bit(4);
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(50)) goto parse_fb;
+        break;
+      }
+      
+      // optional .android.gltrace.GLMessage.FrameBuffer fb = 6;
+      case 6: {
+        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->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 .android.gltrace.GLMessage.Function function = 2 [default = invalid];
+  if (_has_bit(1)) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      2, this->function(), output);
+  }
+  
+  // repeated .android.gltrace.GLMessage.DataType args = 3;
+  for (int i = 0; i < this->args_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      3, this->args(i), output);
+  }
+  
+  // optional .android.gltrace.GLMessage.DataType returnValue = 4;
+  if (_has_bit(3)) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      4, this->returnvalue(), output);
+  }
+  
+  // optional float duration = 5;
+  if (_has_bit(4)) {
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->duration(), output);
+  }
+  
+  // optional .android.gltrace.GLMessage.FrameBuffer fb = 6;
+  if (_has_bit(5)) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      6, this->fb(), 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 .android.gltrace.GLMessage.Function function = 2 [default = invalid];
+    if (has_function()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->function());
+    }
+    
+    // optional .android.gltrace.GLMessage.DataType returnValue = 4;
+    if (has_returnvalue()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->returnvalue());
+    }
+    
+    // optional float duration = 5;
+    if (has_duration()) {
+      total_size += 1 + 4;
+    }
+    
+    // optional .android.gltrace.GLMessage.FrameBuffer fb = 6;
+    if (has_fb()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->fb());
+    }
+    
+  }
+  // repeated .android.gltrace.GLMessage.DataType args = 3;
+  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_function(from.function());
+    }
+    if (from._has_bit(3)) {
+      mutable_returnvalue()->::android::gltrace::GLMessage_DataType::MergeFrom(from.returnvalue());
+    }
+    if (from._has_bit(4)) {
+      set_duration(from.duration());
+    }
+    if (from._has_bit(5)) {
+      mutable_fb()->::android::gltrace::GLMessage_FrameBuffer::MergeFrom(from.fb());
+    }
+  }
+}
+
+void GLMessage::CopyFrom(const GLMessage& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool GLMessage::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000003) != 0x00000003) 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(function_, other->function_);
+    args_.Swap(&other->args_);
+    std::swap(returnvalue_, other->returnvalue_);
+    std::swap(duration_, other->duration_);
+    std::swap(fb_, other->fb_);
+    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
new file mode 100644
index 0000000..c39e1b2
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace.pb.h
@@ -0,0 +1,1725 @@
+// 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_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_frameBufferContents = 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_frameBufferContents;
+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 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 frameBufferContents = GLMessage_Function_frameBufferContents;
+  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 .android.gltrace.GLMessage.Function function = 2 [default = invalid];
+  inline bool has_function() const;
+  inline void clear_function();
+  static const int kFunctionFieldNumber = 2;
+  inline ::android::gltrace::GLMessage_Function function() const;
+  inline void set_function(::android::gltrace::GLMessage_Function value);
+  
+  // repeated .android.gltrace.GLMessage.DataType args = 3;
+  inline int args_size() const;
+  inline void clear_args();
+  static const int kArgsFieldNumber = 3;
+  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 = 4;
+  inline bool has_returnvalue() const;
+  inline void clear_returnvalue();
+  static const int kReturnValueFieldNumber = 4;
+  inline const ::android::gltrace::GLMessage_DataType& returnvalue() const;
+  inline ::android::gltrace::GLMessage_DataType* mutable_returnvalue();
+  
+  // optional float duration = 5;
+  inline bool has_duration() const;
+  inline void clear_duration();
+  static const int kDurationFieldNumber = 5;
+  inline float duration() const;
+  inline void set_duration(float value);
+  
+  // optional .android.gltrace.GLMessage.FrameBuffer fb = 6;
+  inline bool has_fb() const;
+  inline void clear_fb();
+  static const int kFbFieldNumber = 6;
+  inline const ::android::gltrace::GLMessage_FrameBuffer& fb() const;
+  inline ::android::gltrace::GLMessage_FrameBuffer* mutable_fb();
+  
+  // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage)
+ private:
+  mutable int _cached_size_;
+  
+  ::google::protobuf::int32 context_id_;
+  int function_;
+  ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType > args_;
+  ::android::gltrace::GLMessage_DataType* returnvalue_;
+  float duration_;
+  ::android::gltrace::GLMessage_FrameBuffer* fb_;
+  friend void  protobuf_AddDesc_gltrace_2eproto();
+  friend void protobuf_AssignDesc_gltrace_2eproto();
+  friend void protobuf_ShutdownFile_gltrace_2eproto();
+  
+  ::google::protobuf::uint32 _has_bits_[(6 + 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 .android.gltrace.GLMessage.Function function = 2 [default = invalid];
+inline bool GLMessage::has_function() const {
+  return _has_bit(1);
+}
+inline void GLMessage::clear_function() {
+  function_ = 3000;
+  _clear_bit(1);
+}
+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(1);
+  function_ = value;
+}
+
+// repeated .android.gltrace.GLMessage.DataType args = 3;
+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 = 4;
+inline bool GLMessage::has_returnvalue() const {
+  return _has_bit(3);
+}
+inline void GLMessage::clear_returnvalue() {
+  if (returnvalue_ != NULL) returnvalue_->::android::gltrace::GLMessage_DataType::Clear();
+  _clear_bit(3);
+}
+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(3);
+  if (returnvalue_ == NULL) returnvalue_ = new ::android::gltrace::GLMessage_DataType;
+  return returnvalue_;
+}
+
+// optional float duration = 5;
+inline bool GLMessage::has_duration() const {
+  return _has_bit(4);
+}
+inline void GLMessage::clear_duration() {
+  duration_ = 0;
+  _clear_bit(4);
+}
+inline float GLMessage::duration() const {
+  return duration_;
+}
+inline void GLMessage::set_duration(float value) {
+  _set_bit(4);
+  duration_ = value;
+}
+
+// optional .android.gltrace.GLMessage.FrameBuffer fb = 6;
+inline bool GLMessage::has_fb() const {
+  return _has_bit(5);
+}
+inline void GLMessage::clear_fb() {
+  if (fb_ != NULL) fb_->::android::gltrace::GLMessage_FrameBuffer::Clear();
+  _clear_bit(5);
+}
+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(5);
+  if (fb_ == NULL) fb_ = new ::android::gltrace::GLMessage_FrameBuffer;
+  return fb_;
+}
+
+
+// @@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
new file mode 100644
index 0000000..91929f3
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_api.cpp
@@ -0,0 +1,11921 @@
+/*
+ * 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 <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_context_id(1);
+    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
+    glContext->hooks->gl.glActiveTexture(texture);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glAttachShader(GLuint program, GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glAttachShader(program, shader);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindAttribLocation(GLuint program, GLuint index, const GLchar* name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBindAttribLocation(program, index, name);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindBuffer(GLenum target, GLuint buffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBindBuffer(target, buffer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindFramebuffer(GLenum target, GLuint framebuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBindFramebuffer(target, framebuffer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBindRenderbuffer(target, renderbuffer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindTexture(GLenum target, GLuint texture) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBindTexture(target, texture);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBlendColor(red, green, blue, alpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendEquation(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBlendEquation(mode);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBlendEquationSeparate(modeRGB, modeAlpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendFunc(GLenum sfactor, GLenum dfactor) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBlendFunc(sfactor, dfactor);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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((int)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
+    glContext->hooks->gl.glBufferData(target, size, data, usage);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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((int)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((int)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
+    glContext->hooks->gl.glBufferSubData(target, offset, size, data);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLenum GLTrace_glCheckFramebufferStatus(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLenum retValue = glContext->hooks->gl.glCheckFramebufferStatus(target);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::ENUM);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glClear(GLbitfield mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClear(mask);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClearColor(red, green, blue, alpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearDepthf(GLclampf depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClearDepthf(depth);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearStencil(GLint s) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClearStencil(s);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glColorMask(red, green, blue, alpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCompileShader(GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glCompileShader(shader);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLuint GLTrace_glCreateProgram(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    glmsg.set_function(GLMessage::glCreateProgram);
+
+    // call function
+    GLuint retValue = glContext->hooks->gl.glCreateProgram();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLuint GLTrace_glCreateShader(GLenum type) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLuint retValue = glContext->hooks->gl.glCreateShader(type);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glCullFace(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glCullFace(mode);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteBuffers(GLsizei n, const GLuint* buffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteBuffers(n, buffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteFramebuffers(n, framebuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteProgram(program);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteRenderbuffers(n, renderbuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteShader(GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteShader(shader);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteTextures(GLsizei n, const GLuint* textures) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteTextures(n, textures);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthFunc(GLenum func) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDepthFunc(func);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthMask(GLboolean flag) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDepthMask(flag);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthRangef(GLclampf zNear, GLclampf zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDepthRangef(zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDetachShader(GLuint program, GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDetachShader(program, shader);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDisable(GLenum cap) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDisable(cap);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDisableVertexAttribArray(GLuint index) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDisableVertexAttribArray(index);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawArrays(GLenum mode, GLint first, GLsizei count) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawArrays(mode, first, count);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawElements(mode, count, type, indices);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEnable(GLenum cap) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glEnable(cap);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEnableVertexAttribArray(GLuint index) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glEnableVertexAttribArray(index);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFinish(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    glmsg.set_function(GLMessage::glFinish);
+
+    // call function
+    glContext->hooks->gl.glFinish();
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFlush(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    glmsg.set_function(GLMessage::glFlush);
+
+    // call function
+    glContext->hooks->gl.glFlush();
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFramebufferTexture2D(target, attachment, textarget, texture, level);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrontFace(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFrontFace(mode);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenBuffers(GLsizei n, GLuint* buffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenBuffers(n, buffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenerateMipmap(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenerateMipmap(target);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenFramebuffers(GLsizei n, GLuint* framebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenFramebuffers(n, framebuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenRenderbuffers(GLsizei n, GLuint* renderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenRenderbuffers(n, renderbuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenTextures(GLsizei n, GLuint* textures) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenTextures(n, textures);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glGetActiveAttrib(program, index, bufsize, length, size, type, name);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glGetActiveUniform(program, index, bufsize, length, size, type, name);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetAttachedShaders(program, maxcount, count, shaders);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+int GLTrace_glGetAttribLocation(GLuint program, const GLchar* name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    int retValue = glContext->hooks->gl.glGetAttribLocation(program, name);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetBooleanv(GLenum pname, GLboolean* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetBooleanv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetBufferParameteriv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLenum GLTrace_glGetError(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    glmsg.set_function(GLMessage::glGetError);
+
+    // call function
+    GLenum retValue = glContext->hooks->gl.glGetError();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::ENUM);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetFloatv(GLenum pname, GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetFloatv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetIntegerv(GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetIntegerv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramiv(GLuint program, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetProgramiv(program, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetProgramInfoLog(program, bufsize, length, infolog);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetRenderbufferParameteriv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetShaderiv(GLuint shader, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetShaderiv(shader, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetShaderInfoLog(shader, bufsize, length, infolog);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetShaderSource(shader, bufsize, length, source);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+const GLubyte* GLTrace_glGetString(GLenum name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    const GLubyte* retValue = glContext->hooks->gl.glGetString(name);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexParameterfv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexParameteriv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetUniformfv(GLuint program, GLint location, GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetUniformfv(program, location, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetUniformiv(GLuint program, GLint location, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetUniformiv(program, location, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+int GLTrace_glGetUniformLocation(GLuint program, const GLchar* name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    int retValue = glContext->hooks->gl.glGetUniformLocation(program, name);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetVertexAttribfv(index, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetVertexAttribiv(index, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetVertexAttribPointerv(index, pname, pointer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glHint(GLenum target, GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glHint(target, mode);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsBuffer(GLuint buffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsBuffer(buffer);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsEnabled(GLenum cap) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsEnabled(cap);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsFramebuffer(GLuint framebuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsFramebuffer(framebuffer);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsProgram(program);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsRenderbuffer(GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsRenderbuffer(renderbuffer);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsShader(GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsShader(shader);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsTexture(GLuint texture) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsTexture(texture);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glLineWidth(GLfloat width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLineWidth(width);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLinkProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLinkProgram(program);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPixelStorei(GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPixelStorei(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPolygonOffset(GLfloat factor, GLfloat units) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPolygonOffset(factor, units);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glReadPixels(x, y, width, height, format, type, pixels);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glReleaseShaderCompiler(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    glmsg.set_function(GLMessage::glReleaseShaderCompiler);
+
+    // call function
+    glContext->hooks->gl.glReleaseShaderCompiler();
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glRenderbufferStorage(target, internalformat, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSampleCoverage(GLclampf value, GLboolean invert) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glSampleCoverage(value, invert);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glScissor(GLint x, GLint y, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glScissor(x, y, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glShaderBinary(n, shaders, binaryformat, binary, length);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glShaderSource(shader, count, string, length);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilFunc(GLenum func, GLint ref, GLuint mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glStencilFunc(func, ref, mask);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glStencilFuncSeparate(face, func, ref, mask);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilMask(GLuint mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glStencilMask(mask);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilMaskSeparate(GLenum face, GLuint mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glStencilMaskSeparate(face, mask);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glStencilOp(fail, zfail, zpass);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glStencilOpSeparate(face, fail, zfail, zpass);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterf(GLenum target, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexParameterf(target, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexParameterfv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameteri(GLenum target, GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexParameteri(target, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameteriv(GLenum target, GLenum pname, const GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexParameteriv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform1f(GLint location, GLfloat x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform1f(location, x);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform1fv(GLint location, GLsizei count, const GLfloat* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform1fv(location, count, v);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform1i(GLint location, GLint x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform1i(location, x);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform1iv(GLint location, GLsizei count, const GLint* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform1iv(location, count, v);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform2f(GLint location, GLfloat x, GLfloat y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform2f(location, x, y);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform2fv(GLint location, GLsizei count, const GLfloat* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform2fv(location, count, v);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform2i(GLint location, GLint x, GLint y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform2i(location, x, y);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform2iv(GLint location, GLsizei count, const GLint* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform2iv(location, count, v);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform3f(location, x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform3fv(GLint location, GLsizei count, const GLfloat* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform3fv(location, count, v);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform3i(GLint location, GLint x, GLint y, GLint z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform3i(location, x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform3iv(GLint location, GLsizei count, const GLint* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform3iv(location, count, v);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform4f(location, x, y, z, w);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform4fv(GLint location, GLsizei count, const GLfloat* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform4fv(location, count, v);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform4i(location, x, y, z, w);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform4iv(GLint location, GLsizei count, const GLint* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniform4iv(location, count, v);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniformMatrix2fv(location, count, transpose, value);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniformMatrix3fv(location, count, transpose, value);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUniformMatrix4fv(location, count, transpose, value);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUseProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glUseProgram(program);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glValidateProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glValidateProgram(program);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib1f(GLuint indx, GLfloat x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glVertexAttrib1f(indx, x);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib1fv(GLuint indx, const GLfloat* values) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glVertexAttrib1fv(indx, values);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glVertexAttrib2f(indx, x, y);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib2fv(GLuint indx, const GLfloat* values) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glVertexAttrib2fv(indx, values);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glVertexAttrib3f(indx, x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib3fv(GLuint indx, const GLfloat* values) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glVertexAttrib3fv(indx, values);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glVertexAttrib4f(indx, x, y, z, w);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib4fv(GLuint indx, const GLfloat* values) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glVertexAttrib4fv(indx, values);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glViewport(x, y, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+
+// Definitions for GL2Ext APIs
+
+void GLTrace_glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glEGLImageTargetTexture2DOES(target, image);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glEGLImageTargetRenderbufferStorageOES(target, image);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glProgramBinaryOES(program, binaryFormat, binary, length);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void* GLTrace_glMapBufferOES(GLenum target, GLenum access) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    void* retValue = glContext->hooks->gl.glMapBufferOES(target, access);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glUnmapBufferOES(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glUnmapBufferOES(target);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetBufferPointervOES(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glTexImage3DOES(target, level, internalformat, width, height, depth, border, format, type, pixels);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glCopyTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glCompressedTexImage3DOES(target, level, internalformat, width, height, depth, border, imageSize, data);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glCompressedTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindVertexArrayOES(GLuint array) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBindVertexArrayOES(array);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteVertexArraysOES(n, arrays);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenVertexArraysOES(GLsizei n, GLuint *arrays) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenVertexArraysOES(n, arrays);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsVertexArrayOES(GLuint array) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsVertexArrayOES(array);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetPerfMonitorGroupsAMD(numGroups, groupsSize, groups);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorCountersAMD(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetPerfMonitorCountersAMD(group, numCounters, maxActiveCounters, counterSize, counters);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetPerfMonitorGroupStringAMD(group, bufSize, length, groupString);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid *data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetPerfMonitorCounterInfoAMD(group, counter, pname, data);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenPerfMonitorsAMD(GLsizei n, GLuint *monitors) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenPerfMonitorsAMD(n, monitors);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeletePerfMonitorsAMD(GLsizei n, GLuint *monitors) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeletePerfMonitorsAMD(n, monitors);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glSelectPerfMonitorCountersAMD(monitor, enable, group, numCounters, countersList);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBeginPerfMonitorAMD(GLuint monitor) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBeginPerfMonitorAMD(monitor);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEndPerfMonitorAMD(GLuint monitor) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glEndPerfMonitorAMD(monitor);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetPerfMonitorCounterDataAMD(monitor, pname, dataSize, data, bytesWritten);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDiscardFramebufferEXT(target, numAttachments, attachments);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMultiDrawArraysEXT(mode, first, count, primcount);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMultiDrawElementsEXT(mode, count, type, indices, primcount);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glRenderbufferStorageMultisampleIMG(target, samples, internalformat, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFramebufferTexture2DMultisampleIMG(target, attachment, textarget, texture, level, samples);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteFencesNV(GLsizei n, const GLuint *fences) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteFencesNV(n, fences);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenFencesNV(GLsizei n, GLuint *fences) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenFencesNV(n, fences);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsFenceNV(GLuint fence) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsFenceNV(fence);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glTestFenceNV(GLuint fence) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glTestFenceNV(fence);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetFenceivNV(GLuint fence, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetFenceivNV(fence, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFinishFenceNV(GLuint fence) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFinishFenceNV(fence);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSetFenceNV(GLuint fence, GLenum condition) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glSetFenceNV(fence, condition);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCoverageMaskNV(GLboolean mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glCoverageMaskNV(mask);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCoverageOperationNV(GLenum operation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glCoverageOperationNV(operation);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetDriverControlsQCOM(num, size, driverControls);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetDriverControlStringQCOM(driverControl, bufSize, length, driverControlString);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEnableDriverControlQCOM(GLuint driverControl) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glEnableDriverControlQCOM(driverControl);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDisableDriverControlQCOM(GLuint driverControl) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDisableDriverControlQCOM(driverControl);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetTexturesQCOM(GLuint *textures, GLint maxTextures, GLint *numTextures) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetTexturesQCOM(textures, maxTextures, numTextures);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetBuffersQCOM(GLuint *buffers, GLint maxBuffers, GLint *numBuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetBuffersQCOM(buffers, maxBuffers, numBuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetRenderbuffersQCOM(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetRenderbuffersQCOM(renderbuffers, maxRenderbuffers, numRenderbuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetFramebuffersQCOM(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetFramebuffersQCOM(framebuffers, maxFramebuffers, numFramebuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetTexLevelParameterivQCOM(texture, face, level, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtTexObjectStateOverrideiQCOM(target, pname, param);
+
+    fixupGLMessage(&glmsg);
+    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_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetTexSubImageQCOM(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetBufferPointervQCOM(GLenum target, GLvoid **params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetBufferPointervQCOM(target, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetShadersQCOM(GLuint *shaders, GLint maxShaders, GLint *numShaders) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetShadersQCOM(shaders, maxShaders, numShaders);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetProgramsQCOM(GLuint *programs, GLint maxPrograms, GLint *numPrograms) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetProgramsQCOM(programs, maxPrograms, numPrograms);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glExtIsProgramBinaryQCOM(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glExtIsProgramBinaryQCOM(program);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar *source, GLint *length) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glExtGetProgramBinarySourceQCOM(program, shadertype, source, length);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glStartTilingQCOM(x, y, width, height, preserveMask);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEndTilingQCOM(GLbitfield preserveMask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glEndTilingQCOM(preserveMask);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+
+// Definitions for GL1 APIs
+
+void GLTrace_glAlphaFunc(GLenum func, GLclampf ref) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glAlphaFunc(func, ref);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanef(GLenum plane, const GLfloat *equation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClipPlanef(plane, equation);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glColor4f(red, green, blue, alpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogf(GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFogf(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogfv(GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFogfv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFrustumf(left, right, bottom, top, zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetClipPlanef(GLenum pname, GLfloat eqn[4]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetClipPlanef(pname, eqn);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetLightfv(GLenum light, GLenum pname, GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetLightfv(light, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetMaterialfv(face, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexEnvfv(GLenum env, GLenum pname, GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexEnvfv(env, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelf(GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightModelf(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelfv(GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightModelfv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightf(GLenum light, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightf(light, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightfv(GLenum light, GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightfv(light, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadMatrixf(const GLfloat *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLoadMatrixf(m);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialf(GLenum face, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMaterialf(face, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMaterialfv(face, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultMatrixf(const GLfloat *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMultMatrixf(m);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMultiTexCoord4f(target, s, t, r, q);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glNormal3f(nx, ny, nz);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glOrthof(left, right, bottom, top, zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterf(GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointParameterf(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterfv(GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointParameterfv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointSize(GLfloat size) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointSize(size);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glRotatef(angle, x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glScalef(GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glScalef(x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvf(GLenum target, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexEnvf(target, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexEnvfv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTranslatef(GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTranslatef(x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glAlphaFuncx(GLenum func, GLclampx ref) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glAlphaFuncx(func, ref);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClearColorx(red, green, blue, alpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearDepthx(GLclampx depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClearDepthx(depth);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClientActiveTexture(GLenum texture) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClientActiveTexture(texture);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanex(GLenum plane, const GLfixed *equation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClipPlanex(plane, equation);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glColor4ub(red, green, blue, alpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glColor4x(red, green, blue, alpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glColorPointer(size, type, stride, pointer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthRangex(GLclampx zNear, GLclampx zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDepthRangex(zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDisableClientState(GLenum array) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDisableClientState(array);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEnableClientState(GLenum array) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glEnableClientState(array);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogx(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFogx(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogxv(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFogxv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFrustumx(left, right, bottom, top, zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetClipPlanex(GLenum pname, GLfixed eqn[4]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetClipPlanex(pname, eqn);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetFixedv(GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetFixedv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetLightxv(GLenum light, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetLightxv(light, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetMaterialxv(GLenum face, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetMaterialxv(face, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPointerv(GLenum pname, GLvoid **params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetPointerv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexEnviv(GLenum env, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexEnviv(env, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexEnvxv(GLenum env, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexEnvxv(env, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexParameterxv(GLenum target, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexParameterxv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelx(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightModelx(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelxv(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightModelxv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightx(GLenum light, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightx(light, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightxv(GLenum light, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightxv(light, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLineWidthx(GLfixed width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLineWidthx(width);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadIdentity(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    glmsg.set_function(GLMessage::glLoadIdentity);
+
+    // call function
+    glContext->hooks->gl.glLoadIdentity();
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadMatrixx(const GLfixed *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLoadMatrixx(m);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLogicOp(GLenum opcode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLogicOp(opcode);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialx(GLenum face, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMaterialx(face, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialxv(GLenum face, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMaterialxv(face, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMatrixMode(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMatrixMode(mode);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultMatrixx(const GLfixed *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMultMatrixx(m);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMultiTexCoord4x(target, s, t, r, q);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glNormal3x(nx, ny, nz);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glNormalPointer(type, stride, pointer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glOrthox(left, right, bottom, top, zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterx(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointParameterx(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterxv(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointParameterxv(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointSizex(GLfixed size) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointSizex(size);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPolygonOffsetx(GLfixed factor, GLfixed units) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPolygonOffsetx(factor, units);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPopMatrix(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    glmsg.set_function(GLMessage::glPopMatrix);
+
+    // call function
+    glContext->hooks->gl.glPopMatrix();
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPushMatrix(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    glmsg.set_function(GLMessage::glPushMatrix);
+
+    // call function
+    glContext->hooks->gl.glPushMatrix();
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glRotatex(angle, x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSampleCoveragex(GLclampx value, GLboolean invert) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glSampleCoveragex(value, invert);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glScalex(GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glScalex(x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glShadeModel(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glShadeModel(mode);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexCoordPointer(size, type, stride, pointer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvi(GLenum target, GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexEnvi(target, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvx(GLenum target, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexEnvx(target, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnviv(GLenum target, GLenum pname, const GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexEnviv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvxv(GLenum target, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexEnvxv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterx(GLenum target, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexParameterx(target, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterxv(GLenum target, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexParameterxv(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTranslatex(GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTranslatex(x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glVertexPointer(size, type, stride, pointer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointSizePointerOES(type, stride, pointer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+
+// Definitions for GL1Ext APIs
+
+void GLTrace_glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBlendEquationSeparateOES(modeRGB, modeAlpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendEquationOES(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBlendEquationOES(mode);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawTexsOES(x, y, z, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawTexiOES(x, y, z, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawTexxOES(x, y, z, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexsvOES(const GLshort *coords) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawTexsvOES(coords);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexivOES(const GLint *coords) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawTexivOES(coords);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexxvOES(const GLfixed *coords) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawTexxvOES(coords);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawTexfOES(x, y, z, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexfvOES(const GLfloat *coords) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDrawTexfvOES(coords);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glAlphaFuncxOES(GLenum func, GLclampx ref) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glAlphaFuncxOES(func, ref);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClearColorxOES(red, green, blue, alpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearDepthxOES(GLclampx depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClearDepthxOES(depth);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanexOES(GLenum plane, const GLfixed *equation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClipPlanexOES(plane, equation);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glColor4xOES(red, green, blue, alpha);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthRangexOES(GLclampx zNear, GLclampx zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDepthRangexOES(zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogxOES(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFogxOES(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogxvOES(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFogxvOES(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFrustumxOES(left, right, bottom, top, zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetClipPlanexOES(GLenum pname, GLfixed eqn[4]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetClipPlanexOES(pname, eqn);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetFixedvOES(GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetFixedvOES(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetLightxvOES(GLenum light, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetLightxvOES(light, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetMaterialxvOES(face, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexEnvxvOES(env, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexParameterxvOES(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelxOES(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightModelxOES(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelxvOES(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightModelxvOES(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightxOES(GLenum light, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightxOES(light, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightxvOES(GLenum light, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLightxvOES(light, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLineWidthxOES(GLfixed width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLineWidthxOES(width);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadMatrixxOES(const GLfixed *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glLoadMatrixxOES(m);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialxOES(GLenum face, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMaterialxOES(face, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialxvOES(GLenum face, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMaterialxvOES(face, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultMatrixxOES(const GLfixed *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMultMatrixxOES(m);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMultiTexCoord4xOES(target, s, t, r, q);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glNormal3xOES(nx, ny, nz);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glOrthoxOES(left, right, bottom, top, zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterxOES(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointParameterxOES(pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterxvOES(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointParameterxvOES(pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointSizexOES(GLfixed size) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPointSizexOES(size);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPolygonOffsetxOES(GLfixed factor, GLfixed units) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glPolygonOffsetxOES(factor, units);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glRotatexOES(angle, x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSampleCoveragexOES(GLclampx value, GLboolean invert) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glSampleCoveragexOES(value, invert);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glScalexOES(GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glScalexOES(x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvxOES(GLenum target, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexEnvxOES(target, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexEnvxvOES(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterxOES(GLenum target, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexParameterxOES(target, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexParameterxvOES(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTranslatexOES(GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTranslatexOES(x, y, z);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsRenderbufferOES(GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsRenderbufferOES(renderbuffer);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glBindRenderbufferOES(GLenum target, GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBindRenderbufferOES(target, renderbuffer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteRenderbuffersOES(n, renderbuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenRenderbuffersOES(n, renderbuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glRenderbufferStorageOES(target, internalformat, width, height);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetRenderbufferParameterivOES(target, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsFramebufferOES(GLuint framebuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLboolean retValue = glContext->hooks->gl.glIsFramebufferOES(framebuffer);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glBindFramebufferOES(GLenum target, GLuint framebuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glBindFramebufferOES(target, framebuffer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDeleteFramebuffersOES(n, framebuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenFramebuffersOES(GLsizei n, GLuint* framebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenFramebuffersOES(n, framebuffers);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLenum GLTrace_glCheckFramebufferStatusOES(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLenum retValue = glContext->hooks->gl.glCheckFramebufferStatusOES(target);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::ENUM);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, renderbuffer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFramebufferTexture2DOES(target, attachment, textarget, texture, level);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetFramebufferAttachmentParameterivOES(target, attachment, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenerateMipmapOES(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGenerateMipmapOES(target);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCurrentPaletteMatrixOES(GLuint matrixpaletteindex) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glCurrentPaletteMatrixOES(matrixpaletteindex);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadPaletteFromModelViewMatrixOES(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    glmsg.set_function(GLMessage::glLoadPaletteFromModelViewMatrixOES);
+
+    // call function
+    glContext->hooks->gl.glLoadPaletteFromModelViewMatrixOES();
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glMatrixIndexPointerOES(size, type, stride, pointer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glWeightPointerOES(size, type, stride, pointer);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+GLbitfield GLTrace_glQueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    GLbitfield retValue = glContext->hooks->gl.glQueryMatrixxOES(mantissa, exponent);
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glDepthRangefOES(GLclampf zNear, GLclampf zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glDepthRangefOES(zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glFrustumfOES(left, right, bottom, top, zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glOrthofOES(left, right, bottom, top, zNear, zFar);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanefOES(GLenum plane, const GLfloat *equation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClipPlanefOES(plane, equation);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetClipPlanefOES(pname, eqn);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearDepthfOES(GLclampf depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClearDepthfOES(depth);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenfOES(GLenum coord, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexGenfOES(coord, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexGenfvOES(coord, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGeniOES(GLenum coord, GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexGeniOES(coord, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenivOES(GLenum coord, GLenum pname, const GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexGenivOES(coord, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenxOES(GLenum coord, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexGenxOES(coord, pname, param);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glTexGenxvOES(coord, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexGenfvOES(coord, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexGenivOES(GLenum coord, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexGenivOES(coord, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glGetTexGenxvOES(coord, pname, params);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanefIMG(GLenum p, const GLfloat *eqn) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClipPlanefIMG(p, eqn);
+
+    fixupGLMessage(&glmsg);
+    traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanexIMG(GLenum p, const GLfixed *eqn) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_context_id(1);
+    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
+    glContext->hooks->gl.glClipPlanexIMG(p, eqn);
+
+    fixupGLMessage(&glmsg);
+    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
new file mode 100644
index 0000000..a13ede3
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_api.h
@@ -0,0 +1,421 @@
+/*
+ * 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 <GLES2/gl2.h>
+
+#include "gltrace.pb.h"
+#include "gltrace_context.h"
+#include "gltrace_fixup.h"
+#include "gltrace_transport.h"
+
+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_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+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_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_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_glCoverageMaskNV(GLboolean mask);
+void GLTrace_glCoverageOperationNV(GLenum operation);
+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
new file mode 100644
index 0000000..8cf5a51
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_context.cpp
@@ -0,0 +1,105 @@
+/*
+ * 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>
+
+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 initContext(unsigned version, gl_hooks_t *hooks) {
+    pthread_once(&sPthreadOnceKey, createTLSKey);
+
+    GLTraceContext *context = new GLTraceContext();
+    context->hooks = hooks;
+
+    setGLTraceContext(context);
+}
+
+void releaseContext() {
+    GLTraceContext *c = getGLTraceContext();
+    if (c != NULL) {
+        delete c;
+        setGLTraceContext(NULL);
+    }
+}
+
+GLTraceContext::GLTraceContext() {
+    fbcontents = fbcompressed = NULL;
+    fbcontentsSize = 0;
+}
+
+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) {
+    int viewport[4] = {};
+    hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
+    unsigned fbContentsSize = viewport[2] * viewport[3] * 4;
+
+    resizeFBMemory(fbContentsSize);
+
+    //TODO: On eglSwapBuffer, read FB0. For glDraw calls, read currently
+    //      bound FB.
+    //hooks->gl.glGetIntegerv(GL_FRAMEBUFFER_BINDING, &bound_fb);
+    //hooks->gl.glBindFramebuffer(GL_FRAMEBUFFER, 0);
+    hooks->gl.glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
+                                        GL_RGBA, GL_UNSIGNED_BYTE, fbcontents);
+    *fbsize = lzf_compress(fbcontents, fbContentsSize, fbcompressed, fbContentsSize);
+    *fb = fbcompressed;
+    *fbwidth = viewport[2];
+    *fbheight = viewport[3];
+}
+
+}; // namespace gltrace
+}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_context.h b/opengl/libs/GLES_trace/src/gltrace_context.h
new file mode 100644
index 0000000..7dbbca4
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_context.h
@@ -0,0 +1,48 @@
+/*
+ * 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 "hooks.h"
+
+namespace android {
+namespace gltrace {
+
+using ::android::gl_hooks_t;
+
+class GLTraceContext {
+    void *fbcontents;           /* memory area to read framebuffer contents */
+    void *fbcompressed;         /* destination for lzf compressed framebuffer */
+    unsigned fbcontentsSize;    /* size of fbcontents & fbcompressed buffers */
+
+    void resizeFBMemory(unsigned minSize);
+public:
+    gl_hooks_t *hooks;
+
+    GLTraceContext();
+    void getCompressedFB(void **fb, unsigned *fbsize, unsigned *fbwidth, unsigned *fbheight);
+};
+
+GLTraceContext *getGLTraceContext();
+void setGLTraceContext(GLTraceContext *c);
+void initContext(unsigned version, gl_hooks_t *hooks);
+void releaseContext();
+
+};
+};
+
+#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.cpp b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
new file mode 100644
index 0000000..5d1f370
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
@@ -0,0 +1,39 @@
+/*
+ * 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 "gltrace.pb.h"
+#include "gltrace_context.h"
+#include "gltrace_fixup.h"
+#include "gltrace_transport.h"
+
+namespace android {
+namespace gltrace {
+
+void GLTrace_eglSwapBuffers(void *dpy, void *draw) {
+    GLMessage glmessage;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmessage.set_context_id(1);
+    glmessage.set_function(GLMessage::eglSwapBuffers);
+
+    fixup_addFBContents(&glmessage);
+    traceGLMessage(&glmessage);
+}
+
+};
+};
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.h b/opengl/libs/GLES_trace/src/gltrace_egl.h
new file mode 100644
index 0000000..27a4837
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_egl.h
@@ -0,0 +1,28 @@
+/*
+ * 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_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
new file mode 100644
index 0000000..3fe5f8b
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp
@@ -0,0 +1,64 @@
+/*
+ * 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 <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 {
+
+void GLTrace_eglMakeCurrent(const unsigned version, gl_hooks_t *hooks) {
+    gltrace::initContext(version, hooks);
+}
+
+void GLTrace_eglReleaseThread() {
+    gltrace::releaseContext();
+}
+
+void GLTrace_eglCreateContext(int version, EGLContext c) {
+    // TODO
+}
+
+void GLTrace_start() {
+    char value[PROPERTY_VALUE_MAX];
+
+    property_get("debug.egl.debug_port", value, "5039");
+    const unsigned short port = (unsigned short)atoi(value);
+
+    gltrace::startServer(port);
+}
+
+void GLTrace_stop() {
+    gltrace::stopServer();
+}
+
+gl_hooks_t *GLTrace_getGLHooks() {
+    return gltrace::getGLHooks();
+}
+
+void GLTrace_eglSwapBuffers(void *dpy, void *draw) {
+    gltrace::GLTrace_eglSwapBuffers(dpy, draw);
+}
+
+}
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
new file mode 100644
index 0000000..c5b0451
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
@@ -0,0 +1,310 @@
+/*
+ * 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 <GLES2/gl2.h>
+
+#include "gltrace.pb.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:
+        LOGE("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:
+        LOGE("GetBytesPerPixel: unknown format %x", format);
+    }
+
+    return 1;   // in doubt...
+}
+
+/** Generic helper function: extract pointer at argIndex and
+    replace it with the C style string at *pointer */
+void fixup_CStringPtr(int argIndex, GLMessage *glmsg) {
+    GLMessage_DataType *arg = glmsg->mutable_args(argIndex);
+    GLchar *ptr = (GLchar *)arg->intvalue(0);
+
+    arg->set_type(GLMessage::DataType::CHAR);
+    arg->set_isarray(true);
+    arg->add_charvalue(ptr);
+}
+
+void fixup_glGetString(GLMessage *glmsg) {
+    /* const GLubyte* GLTrace_glGetString(GLenum name) */
+    GLMessage_DataType *ret = glmsg->mutable_returnvalue();
+    GLchar *ptr = (GLchar *)ret->intvalue(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(GLMessage *glmsg) {
+    void *fbcontents;
+    unsigned fbsize, fbwidth, fbheight;
+    getGLTraceContext()->getCompressedFB(&fbcontents, &fbsize, &fbwidth, &fbheight);
+
+    GLMessage_FrameBuffer *fb = glmsg->mutable_fb();
+    fb->set_width(fbwidth);
+    fb->set_height(fbheight);
+    fb->add_contents(fbcontents, fbsize);
+}
+
+void fixup_glTexImage2D(GLMessage *glmsg) {
+    /* void glTexImage2D(GLenum target,
+                        GLint level,
+                        GLint internalformat,
+                        GLsizei width,
+                        GLsizei height,
+                        GLint border,
+                        GLenum format,
+                        GLenum type,
+                        const GLvoid *data); 
+     */
+    GLMessage_DataType arg_width  = glmsg->args(3);
+    GLMessage_DataType arg_height = glmsg->args(4);
+    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 *)arg_data->intvalue(0);
+
+    int bytesPerTexel = getBytesPerTexel(format, type);
+
+    arg_data->set_type(GLMessage::DataType::BYTE);
+    arg_data->set_isarray(true);
+    arg_data->clear_rawbytes();
+
+    if (data != NULL) {
+        arg_data->add_rawbytes(data, bytesPerTexel * width * height);
+    } else {
+        LOGE("fixup_glTexImage2D: image data is NULL.\n");
+        arg_data->set_type(GLMessage::DataType::VOID);
+        // FIXME:
+        // This will create the texture, but it will be uninitialized. 
+        // It can later be initialized with glTexSubImage2D or by
+        // attaching an FBO to it and rendering into the FBO.
+    }
+}
+
+void fixup_glShaderSource(GLMessage *glmsg) {
+    /* 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 **)arg_strpp->intvalue(0);
+    GLint *lengthp = (GLint *)arg_lenp.intvalue(0);
+
+    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_glUniformGeneric(int argIndex, int nFloats, GLMessage *glmsg) {
+    GLMessage_DataType *arg_values = glmsg->mutable_args(argIndex);
+    GLfloat *src = (GLfloat*)arg_values->intvalue(0);
+
+    arg_values->set_type(GLMessage::DataType::FLOAT);
+    arg_values->set_isarray(true);
+    arg_values->clear_floatvalue();
+
+    for (int i = 0; i < nFloats; i++) {
+        arg_values->add_floatvalue(*src++);
+    }
+}
+
+void fixup_glUniformMatrixGeneric(int matrixSize, GLMessage *glmsg) {
+    /* 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);
+}
+
+void fixup_GenericIntArray(int argIndex, int nInts, GLMessage *glmsg) {
+    GLMessage_DataType *arg_intarray = glmsg->mutable_args(argIndex);
+    GLint *intp = (GLint *)arg_intarray->intvalue(0);
+
+    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_glGenGeneric(GLMessage *glmsg) {
+    /* void glGen*(GLsizei n, GLuint * buffers); */
+    GLMessage_DataType arg_n  = glmsg->args(0);
+    GLsizei n = arg_n.intvalue(0);
+
+    fixup_GenericIntArray(1, n, glmsg);
+}
+
+void fixup_glGetBooleanv(GLMessage *glmsg) {
+    /* void glGetBooleanv(GLenum pname, GLboolean *params); */
+    GLMessage_DataType *arg_params = glmsg->mutable_args(1);
+    GLboolean *src = (GLboolean*)arg_params->intvalue(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 glGetFloatv(GLenum pname, GLfloat *params); */
+    GLMessage_DataType *arg_params = glmsg->mutable_args(1);
+    GLfloat *src = (GLfloat*)arg_params->intvalue(0);
+
+    arg_params->set_type(GLMessage::DataType::FLOAT);
+    arg_params->set_isarray(true);
+    arg_params->clear_floatvalue();
+    arg_params->add_floatvalue(*src);
+}
+
+void fixupGLMessage(GLMessage *glmsg) {
+    switch (glmsg->function()) {
+    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 * buffers); */
+        fixup_glGenGeneric(glmsg);
+        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);
+        break;
+    case GLMessage::glGetBooleanv:
+        fixup_glGetBooleanv(glmsg);
+        break;
+    case GLMessage::glGetFloatv:
+        fixup_glGetFloatv(glmsg);
+        break;
+    case GLMessage::glGetIntegerv:        /* void glGetIntegerv(GLenum pname, GLint *params); */
+        fixup_GenericIntArray(1, 1, glmsg);
+        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);
+        break;
+    case GLMessage::glGetString:
+        fixup_glGetString(glmsg);
+        break;
+    case GLMessage::glTexImage2D:
+        fixup_glTexImage2D(glmsg);
+        break;
+    case GLMessage::glShaderSource:
+        fixup_glShaderSource(glmsg);
+        break;
+    case GLMessage::glUniformMatrix2fv:
+        /* void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
+                                                                    const GLfloat* value) */
+        fixup_glUniformMatrixGeneric(2, glmsg);
+        break;
+    case GLMessage::glUniformMatrix3fv:
+        /* void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
+                                                                    const GLfloat* value) */
+        fixup_glUniformMatrixGeneric(3, glmsg);
+        break;
+    case GLMessage::glUniformMatrix4fv:
+        /* void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
+                                                                    const GLfloat* value) */
+        fixup_glUniformMatrixGeneric(4, glmsg);
+        break;
+    case GLMessage::glDrawArrays:
+    case GLMessage::glDrawElements:
+        /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */
+        /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */
+        fixup_addFBContents(glmsg);
+        break;
+    default:
+        break;
+    }
+}
+
+};
+};
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.h b/opengl/libs/GLES_trace/src/gltrace_fixup.h
new file mode 100644
index 0000000..bf15a88
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_fixup.h
@@ -0,0 +1,31 @@
+/*
+ * 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 "gltrace.pb.h"
+
+#ifndef __GLTRACE_FIXUP_H_
+#define __GLTRACE_FIXUP_H_
+
+namespace android {
+namespace gltrace {
+
+void fixupGLMessage(GLMessage *message);
+void fixup_addFBContents(GLMessage *message);
+
+};
+};
+
+#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_hooks.cpp b/opengl/libs/GLES_trace/src/gltrace_hooks.cpp
new file mode 100644
index 0000000..de8d463
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_hooks.cpp
@@ -0,0 +1,41 @@
+/*
+ * 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
new file mode 100644
index 0000000..c946a09
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_hooks.h
@@ -0,0 +1,32 @@
+/*
+ * 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
new file mode 100644
index 0000000..c52ca5f
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_transport.cpp
@@ -0,0 +1,113 @@
+/*
+ * 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 <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <cutils/log.h>
+
+#include "gltrace_transport.h"
+
+namespace android {
+namespace gltrace {
+
+int gServerSocket, gClientSocket;
+
+void startServer(int port) {
+    if (gServerSocket > 0) {
+        LOGD("startServer: server socket already open!");
+        return;
+    }
+
+    gServerSocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+    if (gServerSocket < 0) {
+        LOGE("Error (%d) while creating socket. Check if app has network permissions.",
+                                                                            gServerSocket);
+        exit(-1);
+    }
+
+    struct sockaddr_in server, client;
+
+    server.sin_family = AF_INET;
+    server.sin_addr.s_addr = htonl(INADDR_ANY);
+    server.sin_port = htons(port);
+
+    socklen_t sockaddr_len = sizeof(sockaddr_in);
+    if (bind(gServerSocket, (struct sockaddr *) &server, sizeof(server)) < 0) {
+        close(gServerSocket);
+        LOGE("Failed to bind the server socket");
+        exit(-1);
+    }
+
+    if (listen(gServerSocket, 1) < 0) {
+        close(gServerSocket);
+        LOGE("Failed to listen on server socket");
+        exit(-1);
+    }
+
+    LOGD("startServer: server started on %d", port);
+
+    /* Wait for client connection */
+    if ((gClientSocket = accept(gServerSocket, (struct sockaddr *)&client, &sockaddr_len)) < 0) {
+        close(gServerSocket);
+        LOGE("Failed to accept client connection");
+        exit(-1);
+    }
+
+    LOGD("startServer: client connected: %s", inet_ntoa(client.sin_addr));
+}
+
+void stopServer() {
+    if (gServerSocket > 0) {
+        close(gServerSocket);
+        close(gClientSocket);
+        gServerSocket = gClientSocket = 0;
+    }
+}
+
+/** Send GLMessage to the receiver on the host. */
+void traceGLMessage(GLMessage *call) {
+    if (gClientSocket <= 0) {
+        LOGE("traceGLMessage: Attempt to send while client connection is not established");
+        return;
+    }
+
+    std::string str;
+    call->SerializeToString(&str);
+    const uint32_t len = str.length();
+
+    int n = write(gClientSocket, &len, sizeof len);
+    if (n != sizeof len) {
+        LOGE("traceGLMessage: Error (%d) while writing message length\n", n);
+        stopServer();
+        exit(-1);
+    }
+
+    n = write(gClientSocket, str.data(), str.length());
+    if (n != (int) str.length()) {
+        LOGE("traceGLMessage: Error while writing out message, result = %d, length = %d\n",
+            n, str.length());
+        stopServer();
+        exit(-1);
+    }
+}
+
+};  // namespace gltrace
+};  // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.h b/opengl/libs/GLES_trace/src/gltrace_transport.h
new file mode 100644
index 0000000..a0d89be
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_transport.h
@@ -0,0 +1,33 @@
+/*
+ * 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 "gltrace.pb.h"
+
+namespace android {
+namespace gltrace {
+
+void startServer(int port);
+void stopServer();
+
+void traceGLMessage(GLMessage *msg);
+
+};
+};
+
+#endif
diff --git a/opengl/libs/GLES_trace/tools/genapi.py b/opengl/libs/GLES_trace/tools/genapi.py
new file mode 100755
index 0000000..3c47a5f
--- /dev/null
+++ b/opengl/libs/GLES_trace/tools/genapi.py
@@ -0,0 +1,386 @@
+#!/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 GLES2_trace/tools folder, or update PYTHONPATH
+#   to point to wherever it was downloaded.
+#
+# USAGE
+#   $ cd GLES2_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.POINTER,
+    "GLintptr":DataType.POINTER,
+    "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_TEXT = """/*
+ * 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 <GLES2/gl2.h>
+
+#include "gltrace.pb.h"
+#include "gltrace_context.h"
+#include "gltrace_fixup.h"
+#include "gltrace_transport.h"
+
+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_context_id(1);
+    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
+<!--(if retType != "void")-->
+    $!retType!$ retValue = glContext->hooks->gl.$!callsite!$;
+<!--(else)-->
+    glContext->hooks->gl.$!callsite!$;
+<!--(end)-->
+<!--(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)-->
+
+    fixupGLMessage(&glmsg);
+    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_TEXT)
+    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_TEXT)
+    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
new file mode 100644
index 0000000..58a12a8
--- /dev/null
+++ b/opengl/libs/GLES_trace/tools/testgenapi.py
@@ -0,0 +1,66 @@
+#!/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 GLES2_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), 60)
+        self.assertEqual(len(gl_apis), 145)
+        self.assertEqual(len(glext_apis), 126)
+
+    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/glestrace.h b/opengl/libs/glestrace.h
new file mode 100644
index 0000000..5cfacd4
--- /dev/null
+++ b/opengl/libs/glestrace.h
@@ -0,0 +1,41 @@
+/*
+ * 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);
+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/glesv2dbg.h b/opengl/libs/glesv2dbg.h
deleted file mode 100644
index 44bc288..0000000
--- a/opengl/libs/glesv2dbg.h
+++ /dev/null
@@ -1,38 +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 _GLESV2_DBG_H_
-#define _GLESV2_DBG_H_
-
-#include <pthread.h>
-
-namespace android
-{
-struct DbgContext;
-
-DbgContext* CreateDbgContext(const unsigned version, const gl_hooks_t * const hooks);
-
-void dbgReleaseThread();
-
-// create and bind socket if haven't already, if failed to create socket or
-//  forceUseFile, then open /data/local/tmp/dump.gles2dbg, exit when size reached
-void StartDebugServer(const unsigned short port, const bool forceUseFile,
-                      const unsigned int maxFileSize, const char * const filePath);
-void StopDebugServer(); // close socket if open
-
-}; // namespace android
-
-#endif // #ifndef _GLESV2_DBG_H_
diff --git a/opengl/libs/glesv2dbg_functions.h b/opengl/libs/glesv2dbg_functions.h
deleted file mode 100644
index 2d70032..0000000
--- a/opengl/libs/glesv2dbg_functions.h
+++ /dev/null
@@ -1,381 +0,0 @@
-extern "C"
-{
-GL_ENTRY(void, glActiveTexture, GLenum texture)
-GL_ENTRY(void, glAlphaFunc, 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, 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, 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, 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(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, 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, 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, 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, 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, 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(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, 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, glGetProgramiv, GLuint program, 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, glHint, GLenum target, GLenum mode)
-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, 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, 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, glPopMatrix, void)
-GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length)
-GL_ENTRY(void, glPushMatrix, void)
-GL_ENTRY(GLbitfield, glQueryMatrixxOES, GLfixed mantissa[16], GLint exponent[16])
-GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
-GL_ENTRY(void, glReleaseShaderCompiler, void)
-GL_ENTRY(void, glRenderbufferStorage, GLenum target, 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, 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, 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, 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, glValidateProgram, GLuint program)
-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/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index f63c0c1..95d651a 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -2,19 +2,22 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:= \
-    Layer.cpp 								\
-    LayerBase.cpp 							\
-    LayerDim.cpp 							\
-    LayerScreenshot.cpp						\
-    DdmConnection.cpp						\
-    DisplayHardware/DisplayHardware.cpp 	\
+    EventThread.cpp                         \
+    Layer.cpp                               \
+    LayerBase.cpp                           \
+    LayerDim.cpp                            \
+    LayerScreenshot.cpp                     \
+    DdmConnection.cpp                       \
+    DisplayHardware/DisplayHardware.cpp     \
     DisplayHardware/DisplayHardwareBase.cpp \
-    DisplayHardware/HWComposer.cpp 			\
-    GLExtensions.cpp 						\
-    MessageQueue.cpp 						\
-    SurfaceFlinger.cpp 						\
-    SurfaceTextureLayer.cpp 				\
-    Transform.cpp 							\
+    DisplayHardware/HWComposer.cpp          \
+    DisplayHardware/VSyncBarrier.cpp        \
+    DisplayEventConnection.cpp              \
+    GLExtensions.cpp                        \
+    MessageQueue.cpp                        \
+    SurfaceFlinger.cpp                      \
+    SurfaceTextureLayer.cpp                 \
+    Transform.cpp                           \
     
 
 LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
diff --git a/services/surfaceflinger/DisplayEventConnection.cpp b/services/surfaceflinger/DisplayEventConnection.cpp
new file mode 100644
index 0000000..77ecbd2
--- /dev/null
+++ b/services/surfaceflinger/DisplayEventConnection.cpp
@@ -0,0 +1,71 @@
+/*
+ * 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
new file mode 100644
index 0000000..cc3ee36
--- /dev/null
+++ b/services/surfaceflinger/DisplayEventConnection.h
@@ -0,0 +1,62 @@
+/*
+ * 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
index f94d321..3bbc75e 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
@@ -140,6 +140,7 @@
     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
@@ -152,6 +153,8 @@
 #warning "refresh rate set via makefile to REFRESH_RATE"
 #endif
 
+    mRefreshPeriod = nsecs_t(1e9 / mRefreshRate);
+
     EGLint w, h, dummy;
     EGLint numConfigs=0;
     EGLSurface surface;
@@ -346,6 +349,37 @@
     return mPageFlipCount;
 }
 
+// this needs to be thread safe
+nsecs_t DisplayHardware::waitForVSync() const {
+    nsecs_t timestamp;
+    if (mVSync.wait(&timestamp) < 0) {
+        // vsync not supported!
+        usleep( getDelayToNextVSyncUs(&timestamp) );
+    }
+    return timestamp;
+}
+
+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();
 }
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.h b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
index f02c954..45d4b45 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.h
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
@@ -32,6 +32,7 @@
 #include "GLExtensions.h"
 
 #include "DisplayHardware/DisplayHardwareBase.h"
+#include "DisplayHardware/VSyncBarrier.h"
 
 namespace android {
 
@@ -74,6 +75,9 @@
     uint32_t    getMaxTextureSize() const;
     uint32_t    getMaxViewportDims() const;
 
+    // waits for the next vsync and returns the timestamp of when it happened
+    nsecs_t        waitForVSync() const;
+
     uint32_t getPageFlipCount() const;
     EGLDisplay getEGLDisplay() const { return mDisplay; }
 
@@ -95,6 +99,7 @@
 private:
     void init(uint32_t displayIndex) __attribute__((noinline));
     void fini() __attribute__((noinline));
+    int32_t getDelayToNextVSyncUs(nsecs_t* timestamp) const;
 
     sp<SurfaceFlinger> mFlinger;
     EGLDisplay      mDisplay;
@@ -112,7 +117,12 @@
     mutable uint32_t mPageFlipCount;
     GLint           mMaxViewportDims[2];
     GLint           mMaxTextureSize;
-    
+    VSyncBarrier    mVSync;
+
+    mutable Mutex   mFakeVSyncMutex;
+    mutable nsecs_t mNextFakeVSync;
+    nsecs_t         mRefreshPeriod;
+
     HWComposer*     mHwc;
 
     sp<FramebufferNativeWindow> mNativeWindow;
diff --git a/services/surfaceflinger/DisplayHardware/VSyncBarrier.cpp b/services/surfaceflinger/DisplayHardware/VSyncBarrier.cpp
new file mode 100644
index 0000000..187da20
--- /dev/null
+++ b/services/surfaceflinger/DisplayHardware/VSyncBarrier.cpp
@@ -0,0 +1,81 @@
+/*
+ * 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
new file mode 100644
index 0000000..3c32950
--- /dev/null
+++ b/services/surfaceflinger/DisplayHardware/VSyncBarrier.h
@@ -0,0 +1,41 @@
+/*
+ * 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
new file mode 100644
index 0000000..dc39f88
--- /dev/null
+++ b/services/surfaceflinger/EventThread.cpp
@@ -0,0 +1,226 @@
+/*
+ * 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/DisplayEventReceiver.h>
+
+#include <utils/Errors.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()),
+      mDeliveredEvents(0)
+{
+}
+
+void EventThread::onFirstRef() {
+    run("EventThread", PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);
+}
+
+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) {
+            info->count = (count == 0) ? -1 : count;
+            mCondition.signal();
+        }
+    }
+}
+
+void EventThread::requestNextVsync(
+        const wp<DisplayEventConnection>& connection) {
+    Mutex::Autolock _l(mLock);
+    ConnectionInfo* info = getConnectionInfoLocked(connection);
+    if (info) {
+        if (info->count < 0) {
+            info->count = 0;
+        }
+        mCondition.signal();
+    }
+}
+
+bool EventThread::threadLoop() {
+
+    nsecs_t timestamp;
+    DisplayEventReceiver::Event vsync;
+    KeyedVector< wp<DisplayEventConnection>, ConnectionInfo > displayEventConnections;
+
+    { // scope for the lock
+        Mutex::Autolock _l(mLock);
+        do {
+            // wait for listeners
+            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 >= 1) {
+                        // continuous mode
+                        waitForNextVsync = true;
+                    } else {
+                        // one-shot event
+                        if (info.count >= -1) {
+                            ConnectionInfo& info(
+                                    mDisplayEventConnections.editValueAt(i));
+                            info.count--;
+                            if (info.count == -1) {
+                                // fired this time around
+                                waitForNextVsync = true;
+                            }
+                        }
+                    }
+                }
+
+                if (waitForNextVsync)
+                    break;
+
+                mCondition.wait(mLock);
+            } while(true);
+
+            // wait for vsync
+            mLock.unlock();
+            timestamp = mHw.waitForVSync();
+            mLock.lock();
+            mDeliveredEvents++;
+
+            // make sure we still have some listeners
+        } while (!mDisplayEventConnections.size());
+
+        // dispatch vsync events to listeners...
+        vsync.header.type = DisplayEventReceiver::DISPLAY_EVENT_VSYNC;
+        vsync.header.timestamp = timestamp;
+        vsync.vsync.count = mDeliveredEvents;
+
+        // make a copy of our connection list, so we can
+        // dispatch events without holding mLock
+        displayEventConnections = mDisplayEventConnections;
+    }
+
+    const size_t count = displayEventConnections.size();
+    for (size_t i=0 ; i<count ; i++) {
+        sp<DisplayEventConnection> conn(displayEventConnections.keyAt(i).promote());
+        // make sure the connection didn't die
+        if (conn != NULL) {
+
+            const ConnectionInfo& info(
+                    displayEventConnections.valueAt(i));
+
+            if ((info.count > 1) && (mDeliveredEvents % info.count)) {
+                // continuous event, but not time to send this event yet
+                continue;
+            } else if (info.count < -1) {
+                // disabled event
+                continue;
+            } else if (info.count == 0) {
+                // impossible by construction. but we prefer to be safe.
+                continue;
+            }
+
+            // here, either:
+            // count = -1 : one-shot scheduled this time around
+            // count =  1 : continuous not rate-limited
+            // count >  1 : continuous, rate-limited
+            // Note: count == 0 is not possible by construction
+
+            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.keyAt(i));
+            }
+        } else {
+            // somehow the connection is dead, but we still have it in our list
+            // just clean the list.
+            removeDisplayEventConnection(displayEventConnections.keyAt(i));
+        }
+    }
+
+    // clear all our references without holding mLock
+    displayEventConnections.clear();
+
+    return true;
+}
+
+status_t EventThread::readyToRun() {
+    LOGI("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
new file mode 100644
index 0000000..35bd299
--- /dev/null
+++ b/services/surfaceflinger/EventThread.h
@@ -0,0 +1,102 @@
+/*
+ * 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 EventThread : public Thread {
+    friend class DisplayEventConnection;
+
+public:
+    EventThread(const sp<SurfaceFlinger>& flinger);
+
+    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);
+
+    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;
+
+    // main thread only
+    size_t mDeliveredEvents;
+};
+
+// ---------------------------------------------------------------------------
+
+}; // namespace android
+
+// ---------------------------------------------------------------------------
+
+#endif /* ANDROID_SURFACE_FLINGER_EVENT_THREAD_H */
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp
index aebe1b8..85845c9 100644
--- a/services/surfaceflinger/MessageQueue.cpp
+++ b/services/surfaceflinger/MessageQueue.cpp
@@ -29,167 +29,75 @@
 
 // ---------------------------------------------------------------------------
 
-void MessageList::insert(const sp<MessageBase>& node) 
-{
-    LIST::iterator cur(mList.begin());
-    LIST::iterator end(mList.end());
-    while (cur != end) {
-        if (*node < **cur) {
-            mList.insert(cur, node);
-            return;
-        }
-        ++cur;
-    }
-    mList.insert(++end, node);
+MessageBase::MessageBase()
+    : MessageHandler() {
 }
 
-void MessageList::remove(MessageList::LIST::iterator pos) 
-{
-    mList.erase(pos);
+MessageBase::~MessageBase() {
 }
 
+void MessageBase::handleMessage(const Message&) {
+    this->handler();
+    barrier.open();
+};
+
 // ---------------------------------------------------------------------------
 
 MessageQueue::MessageQueue()
-    : mInvalidate(false)
-{
-    mInvalidateMessage = new MessageBase(INVALIDATE);
-}
-
-MessageQueue::~MessageQueue()
+    : mLooper(new Looper(true)), mWorkPending(0)
 {
 }
 
-sp<MessageBase> MessageQueue::waitMessage(nsecs_t timeout)
-{
-    sp<MessageBase> result;
+MessageQueue::~MessageQueue() {
+}
 
-    bool again;
+void MessageQueue::waitMessage() {
     do {
-        const nsecs_t timeoutTime = systemTime() + timeout;
-        while (true) {
-            Mutex::Autolock _l(mLock);
-            nsecs_t now = systemTime();
-            nsecs_t nextEventTime = -1;
+        IPCThreadState::self()->flushCommands();
 
-            LIST::iterator cur(mMessages.begin());
-            if (cur != mMessages.end()) {
-                result = *cur;
-            }
-            
-            if (result != 0) {
-                if (result->when <= now) {
-                    // there is a message to deliver
-                    mMessages.remove(cur);
-                    break;
+        int32_t ret = mLooper->pollOnce(-1);
+        switch (ret) {
+            case ALOOPER_POLL_WAKE:
+            case ALOOPER_POLL_CALLBACK:
+                // callback and/or wake
+                if (android_atomic_and(0, &mWorkPending)) {
+                    return;
                 }
-                nextEventTime = result->when;
-                result = 0;
-            }
+                continue;
 
-            // see if we have an invalidate message
-            if (mInvalidate) {
-                mInvalidate = false;
-                mInvalidateMessage->when = now;
-                result = mInvalidateMessage;
-                break;
-            }
+            case ALOOPER_POLL_TIMEOUT:
+                // timeout (should not happen)
+                continue;
 
-            if (timeout >= 0) {
-                if (timeoutTime < now) {
-                    // we timed-out, return a NULL message
-                    result = 0;
-                    break;
-                }
-                if (nextEventTime > 0) {
-                    if (nextEventTime > timeoutTime) {
-                        nextEventTime = timeoutTime;
-                    }
-                } else {
-                    nextEventTime = timeoutTime;
-                }
-            }
+            case ALOOPER_POLL_ERROR:
+                LOGE("ALOOPER_POLL_ERROR");
+                continue;
 
-            if (nextEventTime >= 0) {
-                //LOGD("nextEventTime = %lld ms", nextEventTime);
-                if (nextEventTime > 0) {
-                    // we're about to wait, flush the binder command buffer
-                    IPCThreadState::self()->flushCommands();
-                    const nsecs_t reltime = nextEventTime - systemTime();
-                    if (reltime > 0) {
-                        mCondition.waitRelative(mLock, reltime);
-                    }
-                }
-            } else {
-                //LOGD("going to wait");
-                // we're about to wait, flush the binder command buffer
-                IPCThreadState::self()->flushCommands();
-                mCondition.wait(mLock);
-            }
-        } 
-        // here we're not holding the lock anymore
-
-        if (result == 0)
-            break;
-
-        again = result->handler();
-        if (again) {
-            // the message has been processed. release our reference to it
-            // without holding the lock.
-            result->notify();
-            result = 0;
+            default:
+                // should not happen
+                LOGE("Looper::pollOnce() returned unknown status %d", ret);
+                continue;
         }
-        
-    } while (again);
-
-    return result;
+    } while (true);
 }
 
 status_t MessageQueue::postMessage(
-        const sp<MessageBase>& message, nsecs_t relTime, uint32_t flags)
+        const sp<MessageBase>& messageHandler, nsecs_t relTime)
 {
-    return queueMessage(message, relTime, flags);
+    const Message dummyMessage;
+    if (relTime > 0) {
+        mLooper->sendMessageDelayed(relTime, messageHandler, dummyMessage);
+    } else {
+        mLooper->sendMessage(messageHandler, dummyMessage);
+    }
+    return NO_ERROR;
 }
 
 status_t MessageQueue::invalidate() {
-    Mutex::Autolock _l(mLock);
-    mInvalidate = true;
-    mCondition.signal();
-    return NO_ERROR;
-}
-
-status_t MessageQueue::queueMessage(
-        const sp<MessageBase>& message, nsecs_t relTime, uint32_t flags)
-{
-    Mutex::Autolock _l(mLock);
-    message->when = systemTime() + relTime;
-    mMessages.insert(message);
-    
-    //LOGD("MessageQueue::queueMessage time = %lld ms", message->when);
-    //dumpLocked(message);
-
-    mCondition.signal();
-    return NO_ERROR;
-}
-
-void MessageQueue::dump(const sp<MessageBase>& message)
-{
-    Mutex::Autolock _l(mLock);
-    dumpLocked(message);
-}
-
-void MessageQueue::dumpLocked(const sp<MessageBase>& message)
-{
-    LIST::const_iterator cur(mMessages.begin());
-    LIST::const_iterator end(mMessages.end());
-    int c = 0;
-    while (cur != end) {
-        const char tick = (*cur == message) ? '>' : ' ';
-        LOGD("%c %d: msg{.what=%08x, when=%lld}",
-                tick, c, (*cur)->what, (*cur)->when);
-        ++cur;
-        c++;
+    if (android_atomic_or(1, &mWorkPending) == 0) {
+        mLooper->wake();
     }
+    return NO_ERROR;
 }
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/MessageQueue.h b/services/surfaceflinger/MessageQueue.h
index 890f809..2317d81 100644
--- a/services/surfaceflinger/MessageQueue.h
+++ b/services/surfaceflinger/MessageQueue.h
@@ -23,7 +23,7 @@
 
 #include <utils/threads.h>
 #include <utils/Timers.h>
-#include <utils/List.h>
+#include <utils/Looper.h>
 
 #include "Barrier.h"
 
@@ -31,92 +31,39 @@
 
 // ---------------------------------------------------------------------------
 
-class MessageBase;
-
-class MessageList 
-{
-    List< sp<MessageBase> > mList;
-    typedef List< sp<MessageBase> > LIST;
-public:
-    inline LIST::iterator begin()                { return mList.begin(); }
-    inline LIST::const_iterator begin() const    { return mList.begin(); }
-    inline LIST::iterator end()                  { return mList.end(); }
-    inline LIST::const_iterator end() const      { return mList.end(); }
-    inline bool isEmpty() const { return mList.empty(); }
-    void insert(const sp<MessageBase>& node);
-    void remove(LIST::iterator pos);
-};
-
-// ============================================================================
-
-class MessageBase : 
-    public LightRefBase<MessageBase>
+class MessageBase : public MessageHandler
 {
 public:
-    nsecs_t     when;
-    uint32_t    what;
-    int32_t     arg0;    
-
-    MessageBase() : when(0), what(0), arg0(0) { }
-    MessageBase(uint32_t what, int32_t arg0=0)
-        : when(0), what(what), arg0(arg0) { }
+    MessageBase();
     
     // return true if message has a handler
-    virtual bool handler() { return false; }
+    virtual bool handler() = 0;
 
     // waits for the handler to be processed
     void wait() const { barrier.wait(); }
-    
-    // releases all waiters. this is done automatically if
-    // handler returns true
-    void notify() const { barrier.open(); }
 
 protected:
-    virtual ~MessageBase() { }
+    virtual ~MessageBase();
 
 private:
-    mutable Barrier barrier;
-    friend class LightRefBase<MessageBase>;
-};
+    virtual void handleMessage(const Message& message);
 
-inline bool operator < (const MessageBase& lhs, const MessageBase& rhs) {
-    return lhs.when < rhs.when;
-}
+    mutable Barrier barrier;
+};
 
 // ---------------------------------------------------------------------------
 
-class MessageQueue
-{
-    typedef List< sp<MessageBase> > LIST;
-public:
+class MessageQueue {
+    sp<Looper> mLooper;
+    volatile int32_t mWorkPending;
 
+public:
     MessageQueue();
     ~MessageQueue();
 
-    // pre-defined messages
-    enum {
-        INVALIDATE = '_upd'
-    };
-
-    sp<MessageBase> waitMessage(nsecs_t timeout = -1);
-    
-    status_t postMessage(const sp<MessageBase>& message,
-            nsecs_t reltime=0, uint32_t flags = 0);
-
+    void waitMessage();
+    status_t postMessage(const sp<MessageBase>& message, nsecs_t reltime=0);
     status_t invalidate();
-    
-    void dump(const sp<MessageBase>& message);
-
-private:
-    status_t queueMessage(const sp<MessageBase>& message,
-            nsecs_t reltime, uint32_t flags);
-    void dumpLocked(const sp<MessageBase>& message);
-    
-    Mutex           mLock;
-    Condition       mCondition;
-    MessageList     mMessages;
-    bool            mInvalidate;
-    sp<MessageBase> mInvalidateMessage;
 };
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 24bd2a6..014c7e2 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -34,6 +34,8 @@
 #include <binder/MemoryHeapBase.h>
 #include <binder/PermissionCache.h>
 
+#include <gui/IDisplayEventConnection.h>
+
 #include <utils/String8.h>
 #include <utils/String16.h>
 #include <utils/StopWatch.h>
@@ -46,6 +48,8 @@
 #include <GLES/gl.h>
 
 #include "clz.h"
+#include "DisplayEventConnection.h"
+#include "EventThread.h"
 #include "GLExtensions.h"
 #include "DdmConnection.h"
 #include "Layer.h"
@@ -295,12 +299,16 @@
     // put the origin in the left-bottom corner
     glOrthof(0, w, 0, h, 0, 1); // l=0, r=w ; b=0, t=h
 
-    mReadyToRunBarrier.open();
+
+    // start the EventThread
+    mEventThread = new EventThread(this);
 
     /*
      *  We're now ready to accept clients...
      */
 
+    mReadyToRunBarrier.open();
+
     // start boot animation
     property_set("ctl.start", "bootanim");
 
@@ -313,25 +321,30 @@
 #pragma mark Events Handler
 #endif
 
-void SurfaceFlinger::waitForEvent()
-{
-    while (true) {
-        nsecs_t timeout = -1;
-        sp<MessageBase> msg = mEventQueue.waitMessage(timeout);
-        if (msg != 0) {
-            switch (msg->what) {
-                case MessageQueue::INVALIDATE:
-                    // invalidate message, just return to the main loop
-                    return;
-            }
-        }
-    }
+void SurfaceFlinger::waitForEvent() {
+    mEventQueue.waitMessage();
 }
 
 void SurfaceFlinger::signalEvent() {
     mEventQueue.invalidate();
 }
 
+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::authenticateSurfaceTexture(
         const sp<ISurfaceTexture>& surfaceTexture) const {
     Mutex::Autolock _l(mStateLock);
@@ -373,20 +386,11 @@
     return false;
 }
 
-status_t SurfaceFlinger::postMessageAsync(const sp<MessageBase>& msg,
-        nsecs_t reltime, uint32_t flags)
-{
-    return mEventQueue.postMessage(msg, reltime, flags);
-}
+// ----------------------------------------------------------------------------
 
-status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg,
-        nsecs_t reltime, uint32_t flags)
-{
-    status_t res = mEventQueue.postMessage(msg, reltime, flags);
-    if (res == NO_ERROR) {
-        msg->wait();
-    }
-    return res;
+sp<IDisplayEventConnection> SurfaceFlinger::createDisplayEventConnection() {
+    sp<DisplayEventConnection> result(new DisplayEventConnection(mEventThread));
+    return result;
 }
 
 // ----------------------------------------------------------------------------
@@ -445,7 +449,7 @@
     } else {
         // pretend we did the post
         hw.compositionComplete();
-        usleep(16667); // 60 fps period
+        hw.waitForVSync();
     }
     return true;
 }
@@ -1599,9 +1603,16 @@
         }
 
         /*
+         * 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");
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 17b80a6..41caee3 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -46,6 +46,8 @@
 
 class Client;
 class DisplayHardware;
+class DisplayEventConnection;
+class EventThread;
 class Layer;
 class LayerDim;
 class LayerScreenshot;
@@ -171,6 +173,7 @@
                                                             int orientation, uint32_t flags);
     virtual int                         setOrientation(DisplayID dpy, 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,
@@ -222,6 +225,7 @@
 
 private:
     friend class Client;
+    friend class DisplayEventConnection;
     friend class LayerBase;
     friend class LayerBaseClient;
     friend class Layer;
@@ -362,6 +366,7 @@
                 GLuint                      mWormholeTexName;
                 GLuint                      mProtectedTexName;
                 nsecs_t                     mBootTime;
+                sp<EventThread>             mEventThread;
 
                 // Can only accessed from the main thread, these members
                 // don't need synchronization
diff --git a/services/surfaceflinger/tests/vsync/Android.mk b/services/surfaceflinger/tests/vsync/Android.mk
new file mode 100644
index 0000000..9181760
--- /dev/null
+++ b/services/surfaceflinger/tests/vsync/Android.mk
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000..4f79080
--- /dev/null
+++ b/services/surfaceflinger/tests/vsync/vsync.cpp
@@ -0,0 +1,81 @@
+/*
+ * 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);
+
+    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
new file mode 100644
index 0000000..c25f5ab
--- /dev/null
+++ b/services/surfaceflinger/tests/waitforvsync/Android.mk
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000..279b88b
--- /dev/null
+++ b/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp
@@ -0,0 +1,45 @@
+/*
+ * 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;
+}