summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/androidfw/ApkAssets.cpp3
-rw-r--r--libs/androidfw/Asset.cpp12
-rw-r--r--libs/androidfw/AssetManager2.cpp66
-rw-r--r--libs/androidfw/CursorWindow.cpp6
-rw-r--r--libs/androidfw/ResourceTypes.cpp3
-rw-r--r--libs/androidfw/include/androidfw/AssetManager2.h6
-rw-r--r--libs/androidfw/include/androidfw/Util.h7
-rw-r--r--libs/androidfw/tests/AssetManager2_test.cpp8
-rw-r--r--libs/hostgraphics/Android.bp31
-rw-r--r--libs/hostgraphics/Fence.cpp (renamed from libs/hwui/debug/wrap_gles.cpp)20
-rw-r--r--libs/hostgraphics/HostBufferQueue.cpp69
-rw-r--r--libs/hostgraphics/PublicFormat.cpp (renamed from libs/hwui/debug/DefaultGlesDriver.cpp)31
-rw-r--r--libs/hostgraphics/gui/BufferItem.h65
-rw-r--r--libs/hostgraphics/gui/BufferItemConsumer.h75
-rw-r--r--libs/hostgraphics/gui/BufferQueue.h37
-rw-r--r--libs/hostgraphics/gui/ConsumerBase.h (renamed from libs/hwui/debug/FatalBaseDriver.h)30
-rw-r--r--libs/hostgraphics/gui/IGraphicBufferConsumer.h65
-rw-r--r--libs/hostgraphics/gui/IGraphicBufferProducer.h (renamed from libs/hwui/debug/GlesErrorCheckWrapper.h)35
-rw-r--r--libs/hostgraphics/gui/Surface.h66
-rw-r--r--libs/hostgraphics/ui/Fence.h72
-rw-r--r--libs/hostgraphics/ui/GraphicBuffer.h64
-rw-r--r--libs/hwui/Android.bp260
-rw-r--r--libs/hwui/AndroidTest.xml2
-rw-r--r--libs/hwui/CanvasTransform.cpp4
-rw-r--r--libs/hwui/DamageAccumulator.cpp26
-rw-r--r--libs/hwui/DeferredLayerUpdater.cpp13
-rw-r--r--libs/hwui/DeferredLayerUpdater.h13
-rw-r--r--libs/hwui/DeviceInfo.cpp1
-rw-r--r--libs/hwui/DisplayListOps.in1
-rw-r--r--libs/hwui/FrameInfo.cpp3
-rw-r--r--libs/hwui/FrameInfo.h17
-rw-r--r--libs/hwui/HardwareBitmapUploader.cpp5
-rw-r--r--libs/hwui/HardwareBitmapUploader.h6
-rw-r--r--libs/hwui/JankTracker.cpp8
-rw-r--r--libs/hwui/JankTracker.h1
-rw-r--r--libs/hwui/LightingInfo.cpp (renamed from libs/hwui/debug/DefaultGlesDriver.h)23
-rw-r--r--libs/hwui/LightingInfo.h86
-rw-r--r--libs/hwui/ProfileData.cpp50
-rw-r--r--libs/hwui/ProfileData.h11
-rw-r--r--libs/hwui/Properties.cpp74
-rw-r--r--libs/hwui/Properties.h1
-rw-r--r--libs/hwui/RecordingCanvas.cpp25
-rw-r--r--libs/hwui/RecordingCanvas.h8
-rw-r--r--libs/hwui/RenderNode.cpp23
-rw-r--r--libs/hwui/RenderNode.h3
-rw-r--r--libs/hwui/RenderProperties.h4
-rw-r--r--libs/hwui/RootRenderNode.cpp306
-rw-r--r--libs/hwui/RootRenderNode.h90
-rw-r--r--libs/hwui/SkiaCanvas.cpp149
-rw-r--r--libs/hwui/SkiaCanvas.h85
-rw-r--r--libs/hwui/TEST_MAPPING8
-rw-r--r--libs/hwui/TreeInfo.h1
-rw-r--r--libs/hwui/VectorDrawable.cpp51
-rw-r--r--libs/hwui/WebViewFunctorManager.h10
-rw-r--r--libs/hwui/debug/FatalBaseDriver.cpp40
-rw-r--r--libs/hwui/debug/GlesDriver.cpp46
-rw-r--r--libs/hwui/debug/GlesDriver.h55
-rw-r--r--libs/hwui/debug/GlesErrorCheckWrapper.cpp75
-rw-r--r--libs/hwui/debug/NullGlesDriver.cpp172
-rw-r--r--libs/hwui/debug/NullGlesDriver.h202
-rw-r--r--libs/hwui/debug/ScopedReplaceDriver.h45
-rw-r--r--libs/hwui/debug/gles_decls.in543
-rw-r--r--libs/hwui/debug/gles_redefine.h914
-rw-r--r--libs/hwui/debug/gles_stubs.in1629
-rw-r--r--libs/hwui/debug/gles_undefine.h913
-rw-r--r--libs/hwui/debug/nullegl.cpp175
-rw-r--r--libs/hwui/debug/wrap_gles.h40
-rw-r--r--libs/hwui/hwui/AnimatedImageDrawable.cpp4
-rw-r--r--libs/hwui/hwui/Bitmap.cpp69
-rw-r--r--libs/hwui/hwui/Bitmap.h29
-rw-r--r--libs/hwui/hwui/Canvas.cpp38
-rw-r--r--libs/hwui/hwui/Canvas.h55
-rw-r--r--libs/hwui/hwui/MinikinSkia.h2
-rw-r--r--libs/hwui/hwui/Paint.h7
-rw-r--r--libs/hwui/hwui/PaintImpl.cpp4
-rw-r--r--libs/hwui/hwui/Typeface.cpp4
-rw-r--r--libs/hwui/pipeline/skia/RenderNodeDrawable.cpp11
-rw-r--r--libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp12
-rw-r--r--libs/hwui/pipeline/skia/SkiaDisplayList.cpp16
-rw-r--r--libs/hwui/pipeline/skia/SkiaDisplayList.h5
-rw-r--r--libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp3
-rw-r--r--libs/hwui/pipeline/skia/SkiaPipeline.cpp182
-rw-r--r--libs/hwui/pipeline/skia/SkiaPipeline.h98
-rw-r--r--libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp75
-rw-r--r--libs/hwui/pipeline/skia/SkiaRecordingCanvas.h8
-rw-r--r--libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp3
-rw-r--r--libs/hwui/protos/graphicsstats.proto3
-rw-r--r--libs/hwui/renderthread/CacheManager.cpp10
-rw-r--r--libs/hwui/renderthread/CacheManager.h9
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp88
-rw-r--r--libs/hwui/renderthread/CanvasContext.h13
-rw-r--r--libs/hwui/renderthread/DrawFrameTask.cpp2
-rw-r--r--libs/hwui/renderthread/EglManager.cpp5
-rw-r--r--libs/hwui/renderthread/ReliableSurface.cpp17
-rw-r--r--libs/hwui/renderthread/ReliableSurface.h31
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp9
-rw-r--r--libs/hwui/renderthread/RenderProxy.h2
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp11
-rw-r--r--libs/hwui/renderthread/RenderThread.h7
-rw-r--r--libs/hwui/renderthread/TimeLord.cpp2
-rw-r--r--libs/hwui/renderthread/VulkanManager.cpp68
-rw-r--r--libs/hwui/renderthread/VulkanManager.h9
-rw-r--r--libs/hwui/renderthread/VulkanSurface.cpp356
-rw-r--r--libs/hwui/renderthread/VulkanSurface.h16
-rw-r--r--libs/hwui/service/GraphicsStatsService.cpp56
-rw-r--r--libs/hwui/tests/common/scenes/BitmapShaders.cpp9
-rw-r--r--libs/hwui/tests/common/scenes/HwBitmapInCompositeShader.cpp11
-rw-r--r--libs/hwui/tests/common/scenes/ListOfFadedTextAnimation.cpp4
-rw-r--r--libs/hwui/tests/common/scenes/ListViewAnimation.cpp4
-rw-r--r--libs/hwui/tests/common/scenes/OvalAnimation.cpp2
-rw-r--r--libs/hwui/tests/common/scenes/RectGridAnimation.cpp4
-rw-r--r--libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp2
-rw-r--r--libs/hwui/tests/common/scenes/ShapeAnimation.cpp18
-rw-r--r--libs/hwui/tests/common/scenes/SimpleColorMatrixAnimation.cpp20
-rw-r--r--libs/hwui/tests/common/scenes/SimpleGradientAnimation.cpp4
-rw-r--r--libs/hwui/tests/common/scenes/TestSceneBase.h1
-rw-r--r--libs/hwui/tests/common/scenes/TvApp.cpp4
-rw-r--r--libs/hwui/tests/macrobench/TestSceneRunner.cpp10
-rw-r--r--libs/hwui/tests/microbench/DisplayListCanvasBench.cpp3
-rw-r--r--libs/hwui/tests/microbench/main.cpp5
-rwxr-xr-xlibs/hwui/tests/scripts/skp-capture.sh78
-rw-r--r--libs/hwui/tests/unit/RenderNodeDrawableTests.cpp43
-rw-r--r--libs/hwui/tests/unit/SkiaBehaviorTests.cpp4
-rw-r--r--libs/hwui/tests/unit/SkiaCanvasTests.cpp5
-rw-r--r--libs/hwui/tests/unit/SkiaPipelineTests.cpp18
-rw-r--r--libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp3
-rw-r--r--libs/hwui/tests/unit/VectorDrawableTests.cpp2
-rw-r--r--libs/hwui/tests/unit/main.cpp3
-rw-r--r--libs/hwui/thread/WorkQueue.h2
-rw-r--r--libs/hwui/utils/Color.cpp49
-rw-r--r--libs/hwui/utils/Color.h11
-rw-r--r--libs/hwui/utils/GLUtils.cpp10
-rw-r--r--libs/hwui/utils/HostColorSpace.cpp417
-rw-r--r--libs/hwui/utils/LinearAllocator.h1
-rw-r--r--libs/hwui/utils/PaintUtils.h23
-rw-r--r--libs/hwui/utils/TraceUtils.h1
-rw-r--r--libs/input/Android.bp3
-rw-r--r--libs/input/PointerController.cpp6
-rw-r--r--libs/input/SpriteController.cpp76
-rw-r--r--libs/input/SpriteController.h31
-rw-r--r--libs/input/TEST_MAPPING7
-rw-r--r--libs/input/tests/Android.bp45
-rw-r--r--libs/input/tests/PointerController_test.cpp215
-rw-r--r--libs/input/tests/mocks/MockSprite.h41
-rw-r--r--libs/input/tests/mocks/MockSpriteController.h (renamed from libs/hwui/debug/MockGlesDriver.h)28
145 files changed, 3516 insertions, 6034 deletions
diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp
index 237c1e970b17..cf2ef3070385 100644
--- a/libs/androidfw/ApkAssets.cpp
+++ b/libs/androidfw/ApkAssets.cpp
@@ -116,6 +116,7 @@ std::unique_ptr<const ApkAssets> ApkAssets::LoadImpl(
if (result != 0) {
LOG(ERROR) << "Failed to open APK '" << path << "' " << ::ErrorCodeString(result);
+ ::CloseArchive(unmanaged_handle);
return {};
}
@@ -134,7 +135,7 @@ std::unique_ptr<const ApkAssets> ApkAssets::LoadImpl(
}
if (entry.method == kCompressDeflated) {
- LOG(WARNING) << kResourcesArsc << " in APK '" << path << "' is compressed.";
+ ANDROID_LOG(WARNING) << kResourcesArsc << " in APK '" << path << "' is compressed.";
}
// Open the resource table via mmap unless it is compressed. This logic is taken care of by Open.
diff --git a/libs/androidfw/Asset.cpp b/libs/androidfw/Asset.cpp
index 9a95fdf80cb5..92125c9da8bb 100644
--- a/libs/androidfw/Asset.cpp
+++ b/libs/androidfw/Asset.cpp
@@ -253,8 +253,10 @@ Asset::Asset(void)
pAsset = new _FileAsset;
result = pAsset->openChunk(NULL, fd, offset, length);
- if (result != NO_ERROR)
+ if (result != NO_ERROR) {
+ delete pAsset;
return NULL;
+ }
pAsset->mAccessMode = mode;
return pAsset;
@@ -273,8 +275,10 @@ Asset::Asset(void)
pAsset = new _CompressedAsset;
result = pAsset->openChunk(fd, offset, compressionMethod,
uncompressedLen, compressedLen);
- if (result != NO_ERROR)
+ if (result != NO_ERROR) {
+ delete pAsset;
return NULL;
+ }
pAsset->mAccessMode = mode;
return pAsset;
@@ -328,8 +332,10 @@ Asset::Asset(void)
pAsset = new _CompressedAsset;
result = pAsset->openChunk(dataMap, uncompressedLen);
- if (result != NO_ERROR)
+ if (result != NO_ERROR) {
+ delete pAsset;
return NULL;
+ }
pAsset->mAccessMode = mode;
return pAsset;
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp
index d20aecaaf0f6..eec49df79630 100644
--- a/libs/androidfw/AssetManager2.cpp
+++ b/libs/androidfw/AssetManager2.cpp
@@ -22,10 +22,10 @@
#include <iterator>
#include <map>
#include <set>
-#include <sstream>
#include "android-base/logging.h"
#include "android-base/stringprintf.h"
+#include "androidfw/Util.h"
#include "utils/ByteOrder.h"
#include "utils/Trace.h"
@@ -35,12 +35,6 @@
#endif
#endif
-#ifdef __ANDROID__
-#define ANDROID_LOG(x) LOG(x)
-#else
-#define ANDROID_LOG(x) std::stringstream()
-#endif
-
#include "androidfw/ResourceUtils.h"
namespace android {
@@ -230,6 +224,62 @@ const std::unordered_map<std::string, std::string>*
return &loaded_package->GetOverlayableMap();
}
+bool AssetManager2::GetOverlayablesToString(const android::StringPiece& package_name,
+ std::string* out) const {
+ uint8_t package_id = 0U;
+ for (const auto& apk_assets : apk_assets_) {
+ const LoadedArsc* loaded_arsc = apk_assets->GetLoadedArsc();
+ if (loaded_arsc == nullptr) {
+ continue;
+ }
+
+ const auto& loaded_packages = loaded_arsc->GetPackages();
+ if (loaded_packages.empty()) {
+ continue;
+ }
+
+ const auto& loaded_package = loaded_packages[0];
+ if (loaded_package->GetPackageName() == package_name) {
+ package_id = GetAssignedPackageId(loaded_package.get());
+ break;
+ }
+ }
+
+ if (package_id == 0U) {
+ ANDROID_LOG(ERROR) << base::StringPrintf("No package with name '%s", package_name.data());
+ return false;
+ }
+
+ const size_t idx = package_ids_[package_id];
+ if (idx == 0xff) {
+ return false;
+ }
+
+ std::string output;
+ for (const ConfiguredPackage& package : package_groups_[idx].packages_) {
+ const LoadedPackage* loaded_package = package.loaded_package_;
+ for (auto it = loaded_package->begin(); it != loaded_package->end(); it++) {
+ const OverlayableInfo* info = loaded_package->GetOverlayableInfo(*it);
+ if (info != nullptr) {
+ ResourceName res_name;
+ if (!GetResourceName(*it, &res_name)) {
+ ANDROID_LOG(ERROR) << base::StringPrintf(
+ "Unable to retrieve name of overlayable resource 0x%08x", *it);
+ return false;
+ }
+
+ const std::string name = ToFormattedResourceString(&res_name);
+ output.append(base::StringPrintf(
+ "resource='%s' overlayable='%s' actor='%s' policy='0x%08x'\n",
+ name.c_str(), info->name.c_str(), info->actor.c_str(), info->policy_flags));
+ }
+ }
+ }
+
+ *out = std::move(output);
+ return true;
+}
+
void AssetManager2::SetConfiguration(const ResTable_config& configuration) {
const int diff = configuration_.diff(configuration);
configuration_ = configuration;
@@ -1079,7 +1129,7 @@ void AssetManager2::InvalidateCaches(uint32_t diff) {
}
}
-uint8_t AssetManager2::GetAssignedPackageId(const LoadedPackage* package) {
+uint8_t AssetManager2::GetAssignedPackageId(const LoadedPackage* package) const {
for (auto& package_group : package_groups_) {
for (auto& package2 : package_group.packages_) {
if (package2.loaded_package_ == package) {
diff --git a/libs/androidfw/CursorWindow.cpp b/libs/androidfw/CursorWindow.cpp
index e1067fcd4d3d..6f05cbd0ebb3 100644
--- a/libs/androidfw/CursorWindow.cpp
+++ b/libs/androidfw/CursorWindow.cpp
@@ -69,7 +69,7 @@ status_t CursorWindow::create(const String8& name, size_t size, CursorWindow** o
result = window->clear();
if (!result) {
LOG_WINDOW("Created new CursorWindow: freeOffset=%d, "
- "numRows=%d, numColumns=%d, mSize=%d, mData=%p",
+ "numRows=%d, numColumns=%d, mSize=%zu, mData=%p",
window->mHeader->freeOffset,
window->mHeader->numRows,
window->mHeader->numColumns,
@@ -124,7 +124,7 @@ status_t CursorWindow::createFromParcel(Parcel* parcel, CursorWindow** outCursor
CursorWindow* window = new CursorWindow(name, dupAshmemFd,
data, size, true /*readOnly*/);
LOG_WINDOW("Created CursorWindow from parcel: freeOffset=%d, "
- "numRows=%d, numColumns=%d, mSize=%d, mData=%p",
+ "numRows=%d, numColumns=%d, mSize=%zu, mData=%p",
window->mHeader->freeOffset,
window->mHeader->numRows,
window->mHeader->numColumns,
@@ -200,7 +200,7 @@ status_t CursorWindow::allocRow() {
FieldSlot* fieldDir = static_cast<FieldSlot*>(offsetToPtr(fieldDirOffset));
memset(fieldDir, 0, fieldDirSize);
- LOG_WINDOW("Allocated row %u, rowSlot is at offset %u, fieldDir is %d bytes at offset %u\n",
+ LOG_WINDOW("Allocated row %u, rowSlot is at offset %u, fieldDir is %zu bytes at offset %u\n",
mHeader->numRows - 1, offsetFromPtr(rowSlot), fieldDirSize, fieldDirOffset);
rowSlot->offset = fieldDirOffset;
return OK;
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 66df59b4c83b..535386920265 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -6902,9 +6902,8 @@ std::unique_ptr<DynamicRefTable> DynamicRefTable::clone() const {
status_t DynamicRefTable::load(const ResTable_lib_header* const header)
{
const uint32_t entryCount = dtohl(header->count);
- const uint32_t sizeOfEntries = sizeof(ResTable_lib_entry) * entryCount;
const uint32_t expectedSize = dtohl(header->header.size) - dtohl(header->header.headerSize);
- if (sizeOfEntries > expectedSize) {
+ if (entryCount > (expectedSize / sizeof(ResTable_lib_entry))) {
ALOGE("ResTable_lib_header size %u is too small to fit %u entries (x %u).",
expectedSize, entryCount, (uint32_t)sizeof(ResTable_lib_entry));
return UNKNOWN_ERROR;
diff --git a/libs/androidfw/include/androidfw/AssetManager2.h b/libs/androidfw/include/androidfw/AssetManager2.h
index 1e2b36cb1703..de46081a6aa3 100644
--- a/libs/androidfw/include/androidfw/AssetManager2.h
+++ b/libs/androidfw/include/androidfw/AssetManager2.h
@@ -124,6 +124,10 @@ class AssetManager2 {
// This may be nullptr if the APK represented by `cookie` has no resource table.
const DynamicRefTable* GetDynamicRefTableForCookie(ApkAssetsCookie cookie) const;
+ // Returns a string representation of the overlayable API of a package.
+ bool GetOverlayablesToString(const android::StringPiece& package_name,
+ std::string* out) const;
+
const std::unordered_map<std::string, std::string>*
GetOverlayableMapForPackage(uint32_t package_id) const;
@@ -308,7 +312,7 @@ class AssetManager2 {
const ResolvedBag* GetBag(uint32_t resid, std::vector<uint32_t>& child_resids);
// Retrieve the assigned package id of the package if loaded into this AssetManager
- uint8_t GetAssignedPackageId(const LoadedPackage* package);
+ uint8_t GetAssignedPackageId(const LoadedPackage* package) const;
// The ordered list of ApkAssets to search. These are not owned by the AssetManager, and must
// have a longer lifetime.
diff --git a/libs/androidfw/include/androidfw/Util.h b/libs/androidfw/include/androidfw/Util.h
index aa1466fde778..9a3646b49db8 100644
--- a/libs/androidfw/include/androidfw/Util.h
+++ b/libs/androidfw/include/androidfw/Util.h
@@ -19,12 +19,19 @@
#include <cstdlib>
#include <memory>
+#include <sstream>
#include <vector>
#include "android-base/macros.h"
#include "androidfw/StringPiece.h"
+#ifdef __ANDROID__
+#define ANDROID_LOG(x) LOG(x)
+#else
+#define ANDROID_LOG(x) std::stringstream()
+#endif
+
namespace android {
namespace util {
diff --git a/libs/androidfw/tests/AssetManager2_test.cpp b/libs/androidfw/tests/AssetManager2_test.cpp
index 40c8e46e4d84..15910241518d 100644
--- a/libs/androidfw/tests/AssetManager2_test.cpp
+++ b/libs/androidfw/tests/AssetManager2_test.cpp
@@ -707,7 +707,7 @@ TEST_F(AssetManager2Test, GetLastPathAfterDisablingReturnsEmpty) {
EXPECT_EQ("", resultDisabled);
}
-TEST_F(AssetManager2Test, GetOverlayableMap) {
+TEST_F(AssetManager2Test, GetOverlayablesToString) {
ResTable_config desired_config;
memset(&desired_config, 0, sizeof(desired_config));
@@ -721,6 +721,12 @@ TEST_F(AssetManager2Test, GetOverlayableMap) {
ASSERT_EQ(2, map->size());
ASSERT_EQ(map->at("OverlayableResources1"), "overlay://theme");
ASSERT_EQ(map->at("OverlayableResources2"), "overlay://com.android.overlayable");
+
+ std::string api;
+ ASSERT_TRUE(assetmanager.GetOverlayablesToString("com.android.overlayable", &api));
+ ASSERT_EQ(api.find("not_overlayable"), std::string::npos);
+ ASSERT_NE(api.find("resource='com.android.overlayable:string/overlayable2' overlayable='OverlayableResources1' actor='overlay://theme' policy='0x0000000a'\n"),
+ std::string::npos);
}
} // namespace android
diff --git a/libs/hostgraphics/Android.bp b/libs/hostgraphics/Android.bp
new file mode 100644
index 000000000000..e713b98b867e
--- /dev/null
+++ b/libs/hostgraphics/Android.bp
@@ -0,0 +1,31 @@
+cc_library_host_static {
+ name: "libhostgraphics",
+
+ cflags: [
+ "-Wno-unused-parameter",
+ ],
+
+ srcs: [
+ ":libui_host_common",
+ "Fence.cpp",
+ "HostBufferQueue.cpp",
+ "PublicFormat.cpp",
+ ],
+
+ include_dirs: [
+ // Here we override all the headers automatically included with frameworks/native/include.
+ // When frameworks/native/include will be removed from the list of automatic includes.
+ // We will have to copy necessary headers with a pre-build step (generated headers).
+ ".",
+ "frameworks/native/libs/nativebase/include",
+ "frameworks/native/libs/nativewindow/include",
+ "frameworks/native/libs/arect/include",
+ ],
+ export_include_dirs: ["."],
+
+ target: {
+ windows: {
+ enabled: true,
+ }
+ },
+} \ No newline at end of file
diff --git a/libs/hwui/debug/wrap_gles.cpp b/libs/hostgraphics/Fence.cpp
index 8dc946e5667b..9e54816651c4 100644
--- a/libs/hwui/debug/wrap_gles.cpp
+++ b/libs/hostgraphics/Fence.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,20 +14,10 @@
* limitations under the License.
*/
-#include "GlesDriver.h"
+#include <ui/Fence.h>
-using namespace android::uirenderer::debug;
+namespace android {
-#undef API_ENTRY
-#undef CALL_GL_API
-#undef CALL_GL_API_RETURN
+const sp<Fence> Fence::NO_FENCE = sp<Fence>(new Fence);
-#define API_ENTRY(x) x
-#define CALL_GL_API(api, ...) GlesDriver::get()->api##_(__VA_ARGS__)
-#define CALL_GL_API_RETURN(api, ...) return GlesDriver::get()->api##_(__VA_ARGS__)
-
-#include "gles_stubs.in"
-
-#undef API_ENTRY
-#undef CALL_GL_API
-#undef CALL_GL_API_RETURN
+} // namespace android \ No newline at end of file
diff --git a/libs/hostgraphics/HostBufferQueue.cpp b/libs/hostgraphics/HostBufferQueue.cpp
new file mode 100644
index 000000000000..ec304378c6c4
--- /dev/null
+++ b/libs/hostgraphics/HostBufferQueue.cpp
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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/BufferQueue.h>
+
+namespace android {
+
+class HostBufferQueue : public IGraphicBufferProducer, public IGraphicBufferConsumer {
+public:
+ HostBufferQueue() : mWidth(0), mHeight(0) { }
+
+ virtual status_t setConsumerIsProtected(bool isProtected) { return OK; }
+
+ virtual status_t detachBuffer(int slot) { return OK; }
+
+ virtual status_t getReleasedBuffers(uint64_t* slotMask) { return OK; }
+
+ virtual status_t setDefaultBufferSize(uint32_t w, uint32_t h) {
+ mWidth = w;
+ mHeight = h;
+ mBuffer = sp<GraphicBuffer>(new GraphicBuffer(mWidth, mHeight));
+ return OK;
+ }
+
+ virtual status_t setDefaultBufferFormat(PixelFormat defaultFormat) { return OK; }
+
+ virtual status_t setDefaultBufferDataSpace(android_dataspace defaultDataSpace) { return OK; }
+
+ virtual status_t discardFreeBuffers() { return OK; }
+
+ virtual status_t acquireBuffer(BufferItem* buffer, nsecs_t presentWhen,
+ uint64_t maxFrameNumber = 0) {
+ buffer->mGraphicBuffer = mBuffer;
+ buffer->mSlot = 0;
+ return OK;
+ }
+
+ virtual status_t setMaxAcquiredBufferCount(int maxAcquiredBuffers) { return OK; }
+
+ virtual status_t setConsumerUsageBits(uint64_t usage) { return OK; }
+private:
+ sp<GraphicBuffer> mBuffer;
+ uint32_t mWidth;
+ uint32_t mHeight;
+};
+
+void BufferQueue::createBufferQueue(sp<IGraphicBufferProducer>* outProducer,
+ sp<IGraphicBufferConsumer>* outConsumer) {
+
+ sp<HostBufferQueue> obj(new HostBufferQueue());
+
+ *outProducer = obj;
+ *outConsumer = obj;
+}
+
+} // namespace android
diff --git a/libs/hwui/debug/DefaultGlesDriver.cpp b/libs/hostgraphics/PublicFormat.cpp
index 46ab20081d17..af6d2738c801 100644
--- a/libs/hwui/debug/DefaultGlesDriver.cpp
+++ b/libs/hostgraphics/PublicFormat.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,27 +14,20 @@
* limitations under the License.
*/
-#include "DefaultGlesDriver.h"
-
-#include "gles_undefine.h"
-
-#include <EGL/egl.h>
+#include <ui/PublicFormat.h>
namespace android {
-namespace uirenderer {
-namespace debug {
-// Generate the proxy
-#define API_ENTRY(x) DefaultGlesDriver::x##_
-#define CALL_GL_API(x, ...) x(__VA_ARGS__);
-#define CALL_GL_API_RETURN(x, ...) return x(__VA_ARGS__);
+android_dataspace mapPublicFormatToHalDataspace(PublicFormat f) {
+ return static_cast<android_dataspace>(0);
+}
-#include "gles_stubs.in"
+int mapPublicFormatToHalFormat(PublicFormat f) {
+ return static_cast<int>(f);
+}
-#undef API_ENTRY
-#undef CALL_GL_API
-#undef CALL_GL_API_RETURN
+PublicFormat mapHalFormatDataspaceToPublicFormat(int format, android_dataspace dataSpace) {
+ return static_cast<PublicFormat>(format);
+}
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
+} // namespace android \ No newline at end of file
diff --git a/libs/hostgraphics/gui/BufferItem.h b/libs/hostgraphics/gui/BufferItem.h
new file mode 100644
index 000000000000..01409e19c715
--- /dev/null
+++ b/libs/hostgraphics/gui/BufferItem.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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_BUFFERITEM_H
+#define ANDROID_GUI_BUFFERITEM_H
+
+#include <ui/Fence.h>
+#include <ui/Rect.h>
+
+#include <system/graphics.h>
+
+#include <utils/StrongPointer.h>
+
+namespace android {
+
+class Fence;
+class GraphicBuffer;
+
+// The only thing we need here for layoutlib is mGraphicBuffer. The rest of the fields are added
+// just to satisfy the calls from the android_media_ImageReader.h
+
+class BufferItem {
+public:
+ enum { INVALID_BUFFER_SLOT = -1 };
+
+ BufferItem() : mGraphicBuffer(nullptr), mFence(Fence::NO_FENCE) {}
+ ~BufferItem() {}
+
+ sp<GraphicBuffer> mGraphicBuffer;
+
+ sp<Fence> mFence;
+
+ Rect mCrop;
+
+ uint32_t mTransform;
+
+ uint32_t mScalingMode;
+
+ int64_t mTimestamp;
+
+ android_dataspace mDataSpace;
+
+ uint64_t mFrameNumber;
+
+ int mSlot;
+
+ bool mTransformToDisplayInverse;
+};
+
+}
+
+#endif // ANDROID_GUI_BUFFERITEM_H
diff --git a/libs/hostgraphics/gui/BufferItemConsumer.h b/libs/hostgraphics/gui/BufferItemConsumer.h
new file mode 100644
index 000000000000..707b313eb102
--- /dev/null
+++ b/libs/hostgraphics/gui/BufferItemConsumer.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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_BUFFERITEMCONSUMER_H
+#define ANDROID_GUI_BUFFERITEMCONSUMER_H
+
+#include <utils/RefBase.h>
+
+#include <gui/ConsumerBase.h>
+#include <gui/IGraphicBufferConsumer.h>
+
+namespace android {
+
+class BufferItemConsumer : public ConsumerBase {
+public:
+ BufferItemConsumer(
+ const sp<IGraphicBufferConsumer>& consumer,
+ uint64_t consumerUsage,
+ int bufferCount,
+ bool controlledByApp) : mConsumer(consumer) {
+ }
+
+ status_t acquireBuffer(BufferItem *item, nsecs_t presentWhen, bool waitForFence = true) {
+ return mConsumer->acquireBuffer(item, presentWhen, 0);
+ }
+
+ status_t releaseBuffer(
+ const BufferItem &item, const sp<Fence>& releaseFence = Fence::NO_FENCE) { return OK; }
+
+ void setName(const String8& name) { }
+
+ void setFrameAvailableListener(const wp<FrameAvailableListener>& listener) { }
+
+ status_t setDefaultBufferSize(uint32_t width, uint32_t height) {
+ return mConsumer->setDefaultBufferSize(width, height);
+ }
+
+ status_t setDefaultBufferFormat(PixelFormat defaultFormat) {
+ return mConsumer->setDefaultBufferFormat(defaultFormat);
+ }
+
+ status_t setDefaultBufferDataSpace(android_dataspace defaultDataSpace) {
+ return mConsumer->setDefaultBufferDataSpace(defaultDataSpace);
+ }
+
+ void abandon() { }
+
+ status_t detachBuffer(int slot) { return OK; }
+
+ status_t discardFreeBuffers() { return OK; }
+
+ void freeBufferLocked(int slotIndex) { }
+
+ status_t addReleaseFenceLocked(
+ int slot, const sp<GraphicBuffer> graphicBuffer, const sp<Fence>& fence) { return OK; }
+private:
+ sp<IGraphicBufferConsumer> mConsumer;
+};
+
+} // namespace android
+
+#endif // ANDROID_GUI_BUFFERITEMCONSUMER_H
diff --git a/libs/hostgraphics/gui/BufferQueue.h b/libs/hostgraphics/gui/BufferQueue.h
new file mode 100644
index 000000000000..aa3e7268e11c
--- /dev/null
+++ b/libs/hostgraphics/gui/BufferQueue.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_GUI_BUFFERQUEUE_H
+#define ANDROID_GUI_BUFFERQUEUE_H
+
+#include <gui/BufferItem.h>
+#include <gui/IGraphicBufferConsumer.h>
+#include <gui/IGraphicBufferProducer.h>
+
+namespace android {
+
+class BufferQueue {
+public:
+ enum { INVALID_BUFFER_SLOT = BufferItem::INVALID_BUFFER_SLOT };
+ enum { NO_BUFFER_AVAILABLE = IGraphicBufferConsumer::NO_BUFFER_AVAILABLE };
+
+ static void createBufferQueue(sp<IGraphicBufferProducer>* outProducer,
+ sp<IGraphicBufferConsumer>* outConsumer);
+};
+
+} // namespace android
+
+#endif // ANDROID_GUI_BUFFERQUEUE_H
diff --git a/libs/hwui/debug/FatalBaseDriver.h b/libs/hostgraphics/gui/ConsumerBase.h
index 45353d0568aa..9002953c0848 100644
--- a/libs/hwui/debug/FatalBaseDriver.h
+++ b/libs/hostgraphics/gui/ConsumerBase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,24 +14,24 @@
* limitations under the License.
*/
-#pragma once
+#ifndef ANDROID_GUI_CONSUMERBASE_H
+#define ANDROID_GUI_CONSUMERBASE_H
-#include "GlesDriver.h"
+#include <gui/BufferItem.h>
+
+#include <utils/RefBase.h>
namespace android {
-namespace uirenderer {
-namespace debug {
-// A base driver that implements all the pure virtuals in the form of
-// LOG_ALWAYS_FATALS. Suitable for selective-override implementations
-// where only a known subset of methods need to be overridden
-class FatalBaseDriver : public GlesDriver {
+class ConsumerBase : public virtual RefBase {
public:
-#define GL_ENTRY(ret, api, ...) virtual ret api##_(__VA_ARGS__) override;
-#include "gles_decls.in"
-#undef GL_ENTRY
+ struct FrameAvailableListener : public virtual RefBase {
+ // See IConsumerListener::onFrame{Available,Replaced}
+ virtual void onFrameAvailable(const BufferItem& item) = 0;
+ virtual void onFrameReplaced(const BufferItem& /* item */) {}
+ };
};
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
+} // namespace android
+
+#endif // ANDROID_GUI_CONSUMERBASE_H \ No newline at end of file
diff --git a/libs/hostgraphics/gui/IGraphicBufferConsumer.h b/libs/hostgraphics/gui/IGraphicBufferConsumer.h
new file mode 100644
index 000000000000..9eb67b218800
--- /dev/null
+++ b/libs/hostgraphics/gui/IGraphicBufferConsumer.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <utils/RefBase.h>
+
+#include <ui/PixelFormat.h>
+
+#include <utils/Errors.h>
+
+namespace android {
+
+class BufferItem;
+class Fence;
+class GraphicBuffer;
+
+class IGraphicBufferConsumer : virtual public RefBase {
+public:
+ enum {
+ // Returned by releaseBuffer, after which the consumer must free any references to the
+ // just-released buffer that it might have.
+ STALE_BUFFER_SLOT = 1,
+ // Returned by dequeueBuffer if there are no pending buffers available.
+ NO_BUFFER_AVAILABLE,
+ // Returned by dequeueBuffer if it's too early for the buffer to be acquired.
+ PRESENT_LATER,
+ };
+
+ virtual status_t acquireBuffer(BufferItem* buffer, nsecs_t presentWhen,
+ uint64_t maxFrameNumber = 0) = 0;
+
+ virtual status_t detachBuffer(int slot) = 0;
+
+ virtual status_t getReleasedBuffers(uint64_t* slotMask) = 0;
+
+ virtual status_t setDefaultBufferSize(uint32_t w, uint32_t h) = 0;
+
+ virtual status_t setMaxAcquiredBufferCount(int maxAcquiredBuffers) = 0;
+
+ virtual status_t setDefaultBufferFormat(PixelFormat defaultFormat) = 0;
+
+ virtual status_t setDefaultBufferDataSpace(android_dataspace defaultDataSpace) = 0;
+
+ virtual status_t setConsumerUsageBits(uint64_t usage) = 0;
+
+ virtual status_t setConsumerIsProtected(bool isProtected) = 0;
+
+ virtual status_t discardFreeBuffers() = 0;
+};
+
+} // namespace android \ No newline at end of file
diff --git a/libs/hwui/debug/GlesErrorCheckWrapper.h b/libs/hostgraphics/gui/IGraphicBufferProducer.h
index 791400bf30ec..a1efd0bcfa4c 100644
--- a/libs/hwui/debug/GlesErrorCheckWrapper.h
+++ b/libs/hostgraphics/gui/IGraphicBufferProducer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,28 +14,25 @@
* limitations under the License.
*/
-#pragma once
+#ifndef ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H
+#define ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H
-#include "GlesDriver.h"
+#include <utils/RefBase.h>
+
+#include <ui/GraphicBuffer.h>
namespace android {
-namespace uirenderer {
-namespace debug {
-class GlesErrorCheckWrapper : public GlesDriver {
+class IGraphicBufferProducer : virtual public RefBase {
public:
- explicit GlesErrorCheckWrapper(GlesDriver& base) : mBase(base) {}
-
-#define GL_ENTRY(ret, api, ...) virtual ret api##_(__VA_ARGS__) override;
-#include "gles_decls.in"
-#undef GL_ENTRY
-
-private:
- void assertNoErrors(const char* apicall);
-
- GlesDriver& mBase;
+ enum class DisconnectMode {
+ // Disconnect only the specified API.
+ Api,
+ // Disconnect any API originally connected from the process calling disconnect.
+ AllLocal
+ };
};
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
+} // namespace android
+
+#endif // ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H
diff --git a/libs/hostgraphics/gui/Surface.h b/libs/hostgraphics/gui/Surface.h
new file mode 100644
index 000000000000..de1ba00211d3
--- /dev/null
+++ b/libs/hostgraphics/gui/Surface.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_GUI_SURFACE_H
+#define ANDROID_GUI_SURFACE_H
+
+#include <gui/IGraphicBufferProducer.h>
+#include <ui/ANativeObjectBase.h>
+#include <utils/RefBase.h>
+#include <system/window.h>
+
+namespace android {
+
+class Surface : public ANativeObjectBase<ANativeWindow, Surface, RefBase> {
+public:
+ explicit Surface(const sp<IGraphicBufferProducer>& bufferProducer,
+ bool controlledByApp = false) {
+ ANativeWindow::perform = hook_perform;
+ }
+ static bool isValid(const sp<Surface>& surface) { return surface != nullptr; }
+ void allocateBuffers() {}
+
+ uint64_t getNextFrameNumber() const { return 0; }
+
+ int setScalingMode(int mode) { return 0; }
+
+ virtual int disconnect(int api,
+ IGraphicBufferProducer::DisconnectMode mode =
+ IGraphicBufferProducer::DisconnectMode::Api) {
+ return 0;
+ }
+
+ virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds) {
+ // TODO: implement this
+ return 0;
+ }
+ virtual int unlockAndPost() { return 0; }
+ virtual int query(int what, int* value) const { return 0; }
+
+protected:
+ virtual ~Surface() {}
+
+ static int hook_perform(ANativeWindow* window, int operation, ...) { return 0; }
+
+private:
+ // can't be copied
+ Surface& operator=(const Surface& rhs);
+ Surface(const Surface& rhs);
+};
+
+} // namespace android
+
+#endif // ANDROID_GUI_SURFACE_H
diff --git a/libs/hostgraphics/ui/Fence.h b/libs/hostgraphics/ui/Fence.h
new file mode 100644
index 000000000000..04d535c3a211
--- /dev/null
+++ b/libs/hostgraphics/ui/Fence.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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_FENCE_H
+#define ANDROID_FENCE_H
+
+#include <utils/String8.h>
+#include <utils/RefBase.h>
+
+typedef int64_t nsecs_t;
+
+namespace android {
+
+class Fence : public LightRefBase<Fence> {
+public:
+ Fence() { }
+ Fence(int) { }
+ static const sp<Fence> NO_FENCE;
+ static constexpr nsecs_t SIGNAL_TIME_PENDING = INT64_MAX;
+ static constexpr nsecs_t SIGNAL_TIME_INVALID = -1;
+ static sp<Fence> merge(const char* name, const sp<Fence>& f1, const sp<Fence>& f2) {
+ return NO_FENCE;
+ }
+
+ static sp<Fence> merge(const String8& name, const sp<Fence>& f1, const sp<Fence>& f2) {
+ return NO_FENCE;
+ }
+
+ enum class Status {
+ Invalid, // Fence is invalid
+ Unsignaled, // Fence is valid but has not yet signaled
+ Signaled, // Fence is valid and has signaled
+ };
+
+ status_t wait(int timeout) { return OK; }
+
+ status_t waitForever(const char* logname) { return OK; }
+
+ int dup() const { return 0; }
+
+ inline Status getStatus() {
+ // The sync_wait call underlying wait() has been measured to be
+ // significantly faster than the sync_fence_info call underlying
+ // getSignalTime(), which might otherwise appear to be the more obvious
+ // way to check whether a fence has signaled.
+ switch (wait(0)) {
+ case NO_ERROR:
+ return Status::Signaled;
+ case -ETIME:
+ return Status::Unsignaled;
+ default:
+ return Status::Invalid;
+ }
+ }
+};
+
+} // namespace android
+
+#endif // ANDROID_FENCE_H
diff --git a/libs/hostgraphics/ui/GraphicBuffer.h b/libs/hostgraphics/ui/GraphicBuffer.h
new file mode 100644
index 000000000000..ac88e44dbc65
--- /dev/null
+++ b/libs/hostgraphics/ui/GraphicBuffer.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_GRAPHIC_BUFFER_H
+#define ANDROID_GRAPHIC_BUFFER_H
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <vector>
+
+#include <ui/PixelFormat.h>
+#include <ui/Rect.h>
+
+#include <utils/RefBase.h>
+
+namespace android {
+
+class GraphicBuffer : virtual public RefBase {
+public:
+ GraphicBuffer(uint32_t w, uint32_t h):width(w),height(h) {
+ data.resize(w*h);
+ }
+ uint32_t getWidth() const { return static_cast<uint32_t>(width); }
+ uint32_t getHeight() const { return static_cast<uint32_t>(height); }
+ uint32_t getStride() const { return static_cast<uint32_t>(width); }
+ uint64_t getUsage() const { return 0; }
+ PixelFormat getPixelFormat() const { return PIXEL_FORMAT_RGBA_8888; }
+ //uint32_t getLayerCount() const { return static_cast<uint32_t>(layerCount); }
+ Rect getBounds() const { return Rect(width, height); }
+
+ status_t lockAsyncYCbCr(uint32_t inUsage, const Rect& rect,
+ android_ycbcr *ycbcr, int fenceFd) { return OK; }
+
+ status_t lockAsync(uint32_t inUsage, const Rect& rect, void** vaddr, int fenceFd,
+ int32_t* outBytesPerPixel = nullptr, int32_t* outBytesPerStride = nullptr) {
+ *vaddr = data.data();
+ return OK;
+ }
+
+ status_t unlockAsync(int *fenceFd) { return OK; }
+
+private:
+ uint32_t width;
+ uint32_t height;
+ std::vector<uint32_t> data;
+};
+
+}; // namespace android
+
+#endif // ANDROID_GRAPHIC_BUFFER_H
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index ebba4cb79dfb..ae90f117d448 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -33,11 +33,6 @@ cc_defaults {
include_dirs: [
"external/skia/include/private",
"external/skia/src/core",
- "external/skia/src/effects",
- "external/skia/src/image",
- "external/skia/src/utils",
- "external/skia/src/gpu",
- "external/skia/src/shaders",
],
product_variables: {
@@ -47,33 +42,70 @@ cc_defaults {
},
},
},
+
+ target: {
+ android: {
+ include_dirs: [
+ "external/skia/src/effects",
+ "external/skia/src/image",
+ "external/skia/src/utils",
+ "external/skia/src/gpu",
+ "external/skia/src/shaders",
+ ],
+ },
+ host: {
+ include_dirs: [
+ "external/vulkan-headers/include",
+ "frameworks/native/libs/math/include",
+ "frameworks/native/libs/ui/include",
+ ],
+ cflags: [
+ "-Wno-unused-variable",
+ ],
+ }
+ }
}
cc_defaults {
name: "hwui_static_deps",
shared_libs: [
- "liblog",
- "libcutils",
- "libstatslog",
- "libutils",
- "libEGL",
- "libGLESv1_CM",
- "libGLESv2",
- "libGLESv3",
- "libvulkan",
- "libui",
- "libgui",
- "libprotobuf-cpp-lite",
+ "libbase",
"libharfbuzz_ng",
- "libft2",
"libminikin",
- "libandroidfw",
- "libcrypto",
- "libsync",
- ],
- static_libs: [
- "libEGL_blobCache",
],
+
+ target: {
+ android: {
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libstatslog",
+ "libutils",
+ "libEGL",
+ "libGLESv1_CM",
+ "libGLESv2",
+ "libGLESv3",
+ "libvulkan",
+ "libui",
+ "libgui",
+ "libnativewindow",
+ "libprotobuf-cpp-lite",
+ "libft2",
+ "libandroidfw",
+ "libcrypto",
+ "libsync",
+ ],
+ static_libs: [
+ "libEGL_blobCache",
+ ],
+ },
+ host: {
+ static_libs: [
+ "libandroidfw",
+ "libutils",
+ ],
+ }
+ }
}
cc_defaults {
@@ -91,27 +123,6 @@ cc_defaults {
],
}
-cc_defaults {
- name: "hwui_debug",
- cflags: ["-include debug/wrap_gles.h"],
- srcs: [
- "debug/wrap_gles.cpp",
- "debug/DefaultGlesDriver.cpp",
- "debug/GlesErrorCheckWrapper.cpp",
- "debug/GlesDriver.cpp",
- "debug/FatalBaseDriver.cpp",
- "debug/NullGlesDriver.cpp",
- ],
- include_dirs: ["frameworks/native/opengl/libs/GLES2"],
-}
-
-cc_defaults {
- name: "hwui_enable_opengl_validation",
- defaults: ["hwui_debug"],
- cflags: ["-DDEBUG_OPENGL=3"],
- include_dirs: ["frameworks/native/opengl/libs/GLES2"],
-}
-
// Build libhwui with PGO by default.
// Location of PGO profile data is defined in build/soong/cc/pgo.go
// and is separate from hwui.
@@ -151,6 +162,13 @@ cc_defaults {
whole_static_libs: ["libskia"],
srcs: [
+ "pipeline/skia/SkiaDisplayList.cpp",
+ "pipeline/skia/SkiaRecordingCanvas.cpp",
+ "pipeline/skia/RenderNodeDrawable.cpp",
+ "pipeline/skia/ReorderBarrierDrawables.cpp",
+ "renderthread/Frame.cpp",
+ "renderthread/RenderTask.cpp",
+ "renderthread/TimeLord.cpp",
"hwui/AnimatedImageDrawable.cpp",
"hwui/AnimatedImageThread.cpp",
"hwui/Bitmap.cpp",
@@ -159,114 +177,112 @@ cc_defaults {
"hwui/MinikinUtils.cpp",
"hwui/PaintImpl.cpp",
"hwui/Typeface.cpp",
- "pipeline/skia/GLFunctorDrawable.cpp",
- "pipeline/skia/LayerDrawable.cpp",
- "pipeline/skia/RenderNodeDrawable.cpp",
- "pipeline/skia/ReorderBarrierDrawables.cpp",
- "pipeline/skia/ShaderCache.cpp",
- "pipeline/skia/SkiaDisplayList.cpp",
- "pipeline/skia/SkiaMemoryTracer.cpp",
- "pipeline/skia/SkiaOpenGLPipeline.cpp",
- "pipeline/skia/SkiaPipeline.cpp",
- "pipeline/skia/SkiaProfileRenderer.cpp",
- "pipeline/skia/SkiaRecordingCanvas.cpp",
- "pipeline/skia/SkiaVulkanPipeline.cpp",
- "pipeline/skia/VectorDrawableAtlas.cpp",
- "pipeline/skia/VkFunctorDrawable.cpp",
- "pipeline/skia/VkInteropFunctorDrawable.cpp",
- "renderstate/RenderState.cpp",
- "renderthread/CacheManager.cpp",
- "renderthread/CanvasContext.cpp",
- "renderthread/DrawFrameTask.cpp",
- "renderthread/EglManager.cpp",
- "renderthread/ReliableSurface.cpp",
- "renderthread/VulkanManager.cpp",
- "renderthread/VulkanSurface.cpp",
- "renderthread/RenderProxy.cpp",
- "renderthread/RenderTask.cpp",
- "renderthread/RenderThread.cpp",
- "renderthread/TimeLord.cpp",
- "renderthread/Frame.cpp",
- "service/GraphicsStatsService.cpp",
- "surfacetexture/EGLConsumer.cpp",
- "surfacetexture/ImageConsumer.cpp",
- "surfacetexture/SurfaceTexture.cpp",
- "thread/CommonPool.cpp",
"utils/Blur.cpp",
"utils/Color.cpp",
- "utils/GLUtils.cpp",
"utils/LinearAllocator.cpp",
- "utils/StringUtils.cpp",
"utils/VectorDrawableUtils.cpp",
"AnimationContext.cpp",
"Animator.cpp",
"AnimatorManager.cpp",
"CanvasTransform.cpp",
"DamageAccumulator.cpp",
- "DeferredLayerUpdater.cpp",
- "DeviceInfo.cpp",
- "FrameInfo.cpp",
- "FrameInfoVisualizer.cpp",
- "GpuMemoryTracker.cpp",
- "HardwareBitmapUploader.cpp",
- "HWUIProperties.sysprop",
"Interpolator.cpp",
- "JankTracker.cpp",
- "Layer.cpp",
- "LayerUpdateQueue.cpp",
+ "LightingInfo.cpp",
"Matrix.cpp",
"PathParser.cpp",
- "ProfileData.cpp",
- "ProfileDataContainer.cpp",
"Properties.cpp",
"PropertyValuesAnimatorSet.cpp",
"PropertyValuesHolder.cpp",
- "Readback.cpp",
"RecordingCanvas.cpp",
"RenderNode.cpp",
"RenderProperties.cpp",
+ "RootRenderNode.cpp",
"SkiaCanvas.cpp",
- "TreeInfo.cpp",
- "WebViewFunctorManager.cpp",
"VectorDrawable.cpp",
- "protos/graphicsstats.proto",
],
- // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
- cflags: ["-Wno-implicit-fallthrough"],
-
proto: {
export_proto_headers: true,
},
export_include_dirs: ["."],
+
+ target: {
+ android: {
+
+ srcs: [
+ "pipeline/skia/GLFunctorDrawable.cpp",
+ "pipeline/skia/LayerDrawable.cpp",
+ "pipeline/skia/ShaderCache.cpp",
+ "pipeline/skia/SkiaMemoryTracer.cpp",
+ "pipeline/skia/SkiaOpenGLPipeline.cpp",
+ "pipeline/skia/SkiaPipeline.cpp",
+ "pipeline/skia/SkiaProfileRenderer.cpp",
+ "pipeline/skia/SkiaVulkanPipeline.cpp",
+ "pipeline/skia/VectorDrawableAtlas.cpp",
+ "pipeline/skia/VkFunctorDrawable.cpp",
+ "pipeline/skia/VkInteropFunctorDrawable.cpp",
+ "renderstate/RenderState.cpp",
+ "renderthread/CacheManager.cpp",
+ "renderthread/CanvasContext.cpp",
+ "renderthread/DrawFrameTask.cpp",
+ "renderthread/EglManager.cpp",
+ "renderthread/ReliableSurface.cpp",
+ "renderthread/VulkanManager.cpp",
+ "renderthread/VulkanSurface.cpp",
+ "renderthread/RenderProxy.cpp",
+ "renderthread/RenderThread.cpp",
+ "service/GraphicsStatsService.cpp",
+ "surfacetexture/EGLConsumer.cpp",
+ "surfacetexture/ImageConsumer.cpp",
+ "surfacetexture/SurfaceTexture.cpp",
+ "thread/CommonPool.cpp",
+ "utils/GLUtils.cpp",
+ "utils/StringUtils.cpp",
+ "DeferredLayerUpdater.cpp",
+ "DeviceInfo.cpp",
+ "FrameInfo.cpp",
+ "FrameInfoVisualizer.cpp",
+ "GpuMemoryTracker.cpp",
+ "HardwareBitmapUploader.cpp",
+ "HWUIProperties.sysprop",
+ "JankTracker.cpp",
+ "Layer.cpp",
+ "LayerUpdateQueue.cpp",
+ "ProfileData.cpp",
+ "ProfileDataContainer.cpp",
+ "Readback.cpp",
+ "TreeInfo.cpp",
+ "WebViewFunctorManager.cpp",
+ "protos/graphicsstats.proto",
+ ],
+
+ // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
+ cflags: ["-Wno-implicit-fallthrough"],
+ },
+ host: {
+ srcs: [
+ "utils/HostColorSpace.cpp",
+ ],
+ export_static_lib_headers: [
+ "libarect",
+ ],
+ }
+ }
}
cc_library {
name: "libhwui",
+ host_supported: true,
defaults: [
"libhwui_defaults",
-
- // Enables fine-grained GLES error checking
- // If enabled, every GLES call is wrapped & error checked
- // Has moderate overhead
- //"hwui_enable_opengl_validation",
],
}
-// ------------------------
-// static library null gpu
-// ------------------------
-
cc_library_static {
- name: "libhwui_static_debug",
+ name: "libhwui_static",
defaults: [
"libhwui_defaults",
- "hwui_debug",
- ],
- cflags: ["-DHWUI_NULL_GPU"],
- srcs: [
- "debug/nullegl.cpp",
],
}
@@ -294,15 +310,11 @@ cc_test {
static_libs: [
"libgmock",
- "libhwui_static_debug",
+ "libhwui_static",
],
shared_libs: [
"libmemunreachable",
],
- cflags: [
- "-include debug/wrap_gles.h",
- "-DHWUI_NULL_GPU",
- ],
srcs: [
"tests/unit/main.cpp",
@@ -346,8 +358,7 @@ cc_benchmark {
name: "hwuimacro",
defaults: ["hwui_test_defaults"],
- // set to libhwui_static_debug to skip actual GL commands
- whole_static_libs: ["libhwui"],
+ static_libs: ["libhwui"],
shared_libs: [
"libmemunreachable",
],
@@ -366,12 +377,7 @@ cc_benchmark {
name: "hwuimicro",
defaults: ["hwui_test_defaults"],
- cflags: [
- "-include debug/wrap_gles.h",
- "-DHWUI_NULL_GPU",
- ],
-
- whole_static_libs: ["libhwui_static_debug"],
+ static_libs: ["libhwui_static"],
shared_libs: [
"libmemunreachable",
],
diff --git a/libs/hwui/AndroidTest.xml b/libs/hwui/AndroidTest.xml
index eab32c5a67ce..381fb9f6c7bf 100644
--- a/libs/hwui/AndroidTest.xml
+++ b/libs/hwui/AndroidTest.xml
@@ -28,9 +28,11 @@
<test class="com.android.tradefed.testtype.GoogleBenchmarkTest" >
<option name="native-benchmark-device-path" value="/data/benchmarktest" />
<option name="benchmark-module-name" value="hwuimicro" />
+ <option name="file-exclusion-filter-regex" value=".*\.config$" />
</test>
<test class="com.android.tradefed.testtype.GoogleBenchmarkTest" >
<option name="native-benchmark-device-path" value="/data/benchmarktest" />
<option name="benchmark-module-name" value="hwuimacro" />
+ <option name="file-exclusion-filter-regex" value=".*\.config$" />
</test>
</configuration>
diff --git a/libs/hwui/CanvasTransform.cpp b/libs/hwui/CanvasTransform.cpp
index 0cfaa8c61279..8c37d73366c2 100644
--- a/libs/hwui/CanvasTransform.cpp
+++ b/libs/hwui/CanvasTransform.cpp
@@ -100,9 +100,9 @@ static void applyColorTransform(ColorTransform transform, SkPaint& paint) {
SkBlendMode mode;
SkColor color;
// TODO: LRU this or something to avoid spamming new color mode filters
- if (paint.getColorFilter()->asColorMode(&color, &mode)) {
+ if (paint.getColorFilter()->asAColorMode(&color, &mode)) {
color = transformColor(transform, color);
- paint.setColorFilter(SkColorFilter::MakeModeFilter(color, mode));
+ paint.setColorFilter(SkColorFilters::Blend(color, mode));
}
}
}
diff --git a/libs/hwui/DamageAccumulator.cpp b/libs/hwui/DamageAccumulator.cpp
index cca0032b230e..b39f4f20dc0d 100644
--- a/libs/hwui/DamageAccumulator.cpp
+++ b/libs/hwui/DamageAccumulator.cpp
@@ -130,27 +130,35 @@ static inline void mapRect(const Matrix4* matrix, const SkRect& in, SkRect* out)
// calculations. Just give up and expand to DIRTY_MIN/DIRTY_MAX
temp.set(DIRTY_MIN, DIRTY_MIN, DIRTY_MAX, DIRTY_MAX);
}
- out->join(RECT_ARGS(temp));
+ out->join({RECT_ARGS(temp)});
}
void DamageAccumulator::applyMatrix4Transform(DirtyStack* frame) {
mapRect(frame->matrix4, frame->pendingDirty, &mHead->pendingDirty);
}
-static inline void mapRect(const RenderProperties& props, const SkRect& in, SkRect* out) {
- if (in.isEmpty()) return;
- const SkMatrix* transform = props.getTransformMatrix();
- SkRect temp(in);
+static inline void applyMatrix(const SkMatrix* transform, SkRect* rect) {
if (transform && !transform->isIdentity()) {
if (CC_LIKELY(!transform->hasPerspective())) {
- transform->mapRect(&temp);
+ transform->mapRect(rect);
} else {
// Don't attempt to calculate damage for a perspective transform
// as the numbers this works with can break the perspective
// calculations. Just give up and expand to DIRTY_MIN/DIRTY_MAX
- temp.set(DIRTY_MIN, DIRTY_MIN, DIRTY_MAX, DIRTY_MAX);
+ rect->setLTRB(DIRTY_MIN, DIRTY_MIN, DIRTY_MAX, DIRTY_MAX);
}
}
+}
+
+static inline void mapRect(const RenderProperties& props, const SkRect& in, SkRect* out) {
+ if (in.isEmpty()) return;
+ SkRect temp(in);
+ applyMatrix(props.getTransformMatrix(), &temp);
+ if (props.getStaticMatrix()) {
+ applyMatrix(props.getStaticMatrix(), &temp);
+ } else if (props.getAnimationMatrix()) {
+ applyMatrix(props.getAnimationMatrix(), &temp);
+ }
temp.offset(props.getLeft(), props.getTop());
out->join(temp);
}
@@ -201,7 +209,7 @@ void DamageAccumulator::applyRenderNodeTransform(DirtyStack* frame) {
// Perform clipping
if (props.getClipDamageToBounds() && !frame->pendingDirty.isEmpty()) {
- if (!frame->pendingDirty.intersect(0, 0, props.getWidth(), props.getHeight())) {
+ if (!frame->pendingDirty.intersect(SkRect::MakeIWH(props.getWidth(), props.getHeight()))) {
frame->pendingDirty.setEmpty();
}
}
@@ -225,7 +233,7 @@ void DamageAccumulator::applyRenderNodeTransform(DirtyStack* frame) {
}
void DamageAccumulator::dirty(float left, float top, float right, float bottom) {
- mHead->pendingDirty.join(left, top, right, bottom);
+ mHead->pendingDirty.join({left, top, right, bottom});
}
void DamageAccumulator::peekAtDirty(SkRect* dest) const {
diff --git a/libs/hwui/DeferredLayerUpdater.cpp b/libs/hwui/DeferredLayerUpdater.cpp
index 3bee3018d36e..f300703e7e00 100644
--- a/libs/hwui/DeferredLayerUpdater.cpp
+++ b/libs/hwui/DeferredLayerUpdater.cpp
@@ -15,6 +15,9 @@
*/
#include "DeferredLayerUpdater.h"
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
#include "renderstate/RenderState.h"
#include "utils/PaintUtils.h"
@@ -38,6 +41,16 @@ DeferredLayerUpdater::~DeferredLayerUpdater() {
destroyLayer();
}
+void DeferredLayerUpdater::setSurfaceTexture(const sp<SurfaceTexture>& consumer) {
+ if (consumer.get() != mSurfaceTexture.get()) {
+ mSurfaceTexture = consumer;
+
+ GLenum target = consumer->getCurrentTextureTarget();
+ LOG_ALWAYS_FATAL_IF(target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES,
+ "set unsupported SurfaceTexture with target %x", target);
+ }
+}
+
void DeferredLayerUpdater::onContextDestroyed() {
destroyLayer();
}
diff --git a/libs/hwui/DeferredLayerUpdater.h b/libs/hwui/DeferredLayerUpdater.h
index a91c111933c4..1491f99402ba 100644
--- a/libs/hwui/DeferredLayerUpdater.h
+++ b/libs/hwui/DeferredLayerUpdater.h
@@ -24,9 +24,6 @@
#include <system/graphics.h>
#include <utils/StrongPointer.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
#include "renderstate/RenderState.h"
#include "surfacetexture/SurfaceTexture.h"
#include "Layer.h"
@@ -67,15 +64,7 @@ public:
return false;
}
- ANDROID_API void setSurfaceTexture(const sp<SurfaceTexture>& consumer) {
- if (consumer.get() != mSurfaceTexture.get()) {
- mSurfaceTexture = consumer;
-
- GLenum target = consumer->getCurrentTextureTarget();
- LOG_ALWAYS_FATAL_IF(target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES,
- "set unsupported SurfaceTexture with target %x", target);
- }
- }
+ ANDROID_API void setSurfaceTexture(const sp<SurfaceTexture>& consumer);
ANDROID_API void updateTexImage() { mUpdateTexImage = true; }
diff --git a/libs/hwui/DeviceInfo.cpp b/libs/hwui/DeviceInfo.cpp
index 0a9d965d0444..a0d3ff995e78 100644
--- a/libs/hwui/DeviceInfo.cpp
+++ b/libs/hwui/DeviceInfo.cpp
@@ -18,7 +18,6 @@
#include "Properties.h"
-#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
#include <ui/GraphicTypes.h>
diff --git a/libs/hwui/DisplayListOps.in b/libs/hwui/DisplayListOps.in
index 2deb5657c877..4a252afc1df3 100644
--- a/libs/hwui/DisplayListOps.in
+++ b/libs/hwui/DisplayListOps.in
@@ -49,3 +49,4 @@ X(DrawVertices)
X(DrawAtlas)
X(DrawShadowRec)
X(DrawVectorDrawable)
+X(DrawWebView)
diff --git a/libs/hwui/FrameInfo.cpp b/libs/hwui/FrameInfo.cpp
index 71cc9a81a09f..0698775b0021 100644
--- a/libs/hwui/FrameInfo.cpp
+++ b/libs/hwui/FrameInfo.cpp
@@ -37,13 +37,14 @@ const std::string FrameInfoNames[] = {
"FrameCompleted",
"DequeueBufferDuration",
"QueueBufferDuration",
+ "GpuCompleted",
};
static_assert((sizeof(FrameInfoNames) / sizeof(FrameInfoNames[0])) ==
static_cast<int>(FrameInfoIndex::NumIndexes),
"size mismatch: FrameInfoNames doesn't match the enum!");
-static_assert(static_cast<int>(FrameInfoIndex::NumIndexes) == 16,
+static_assert(static_cast<int>(FrameInfoIndex::NumIndexes) == 17,
"Must update value in FrameMetrics.java#FRAME_STATS_COUNT (and here)");
void FrameInfo::importUiThreadInfo(int64_t* info) {
diff --git a/libs/hwui/FrameInfo.h b/libs/hwui/FrameInfo.h
index 0aab58c38ba0..51674fbd557e 100644
--- a/libs/hwui/FrameInfo.h
+++ b/libs/hwui/FrameInfo.h
@@ -51,6 +51,8 @@ enum class FrameInfoIndex {
DequeueBufferDuration,
QueueBufferDuration,
+ GpuCompleted,
+
// Must be the last value!
// Also must be kept in sync with FrameMetrics.java#FRAME_STATS_COUNT
NumIndexes
@@ -100,15 +102,15 @@ class FrameInfo {
public:
void importUiThreadInfo(int64_t* info);
- void markSyncStart() { set(FrameInfoIndex::SyncStart) = systemTime(CLOCK_MONOTONIC); }
+ void markSyncStart() { set(FrameInfoIndex::SyncStart) = systemTime(SYSTEM_TIME_MONOTONIC); }
void markIssueDrawCommandsStart() {
- set(FrameInfoIndex::IssueDrawCommandsStart) = systemTime(CLOCK_MONOTONIC);
+ set(FrameInfoIndex::IssueDrawCommandsStart) = systemTime(SYSTEM_TIME_MONOTONIC);
}
- void markSwapBuffers() { set(FrameInfoIndex::SwapBuffers) = systemTime(CLOCK_MONOTONIC); }
+ void markSwapBuffers() { set(FrameInfoIndex::SwapBuffers) = systemTime(SYSTEM_TIME_MONOTONIC); }
- void markFrameCompleted() { set(FrameInfoIndex::FrameCompleted) = systemTime(CLOCK_MONOTONIC); }
+ void markFrameCompleted() { set(FrameInfoIndex::FrameCompleted) = systemTime(SYSTEM_TIME_MONOTONIC); }
void addFlag(int frameInfoFlag) {
set(FrameInfoIndex::Flags) |= static_cast<uint64_t>(frameInfoFlag);
@@ -143,6 +145,13 @@ public:
return duration(FrameInfoIndex::IntendedVsync, FrameInfoIndex::FrameCompleted);
}
+ inline int64_t gpuDrawTime() const {
+ // GPU start time is approximated to the moment before swapBuffer is invoked.
+ // We could add an EGLSyncKHR fence at the beginning of the frame, but that is an overhead.
+ int64_t endTime = get(FrameInfoIndex::GpuCompleted);
+ return endTime > 0 ? endTime - get(FrameInfoIndex::SwapBuffers) : -1;
+ }
+
inline int64_t& set(FrameInfoIndex index) { return mFrameInfo[static_cast<int>(index)]; }
inline int64_t get(FrameInfoIndex index) const {
diff --git a/libs/hwui/HardwareBitmapUploader.cpp b/libs/hwui/HardwareBitmapUploader.cpp
index 9bb6031b76ac..40bff88b7512 100644
--- a/libs/hwui/HardwareBitmapUploader.cpp
+++ b/libs/hwui/HardwareBitmapUploader.cpp
@@ -403,8 +403,9 @@ sk_sp<Bitmap> HardwareBitmapUploader::allocateHardwareBitmap(const SkBitmap& sou
if (!sUploader->uploadHardwareBitmap(bitmap, format, buffer)) {
return nullptr;
}
- return Bitmap::createFrom(buffer, bitmap.colorType(), bitmap.refColorSpace(),
- bitmap.alphaType(), Bitmap::computePalette(bitmap));
+ return Bitmap::createFrom(buffer->toAHardwareBuffer(), bitmap.colorType(),
+ bitmap.refColorSpace(), bitmap.alphaType(),
+ Bitmap::computePalette(bitmap));
}
void HardwareBitmapUploader::initialize() {
diff --git a/libs/hwui/HardwareBitmapUploader.h b/libs/hwui/HardwareBitmapUploader.h
index c300593d47a1..72243d23dd35 100644
--- a/libs/hwui/HardwareBitmapUploader.h
+++ b/libs/hwui/HardwareBitmapUploader.h
@@ -27,7 +27,13 @@ public:
static sk_sp<Bitmap> allocateHardwareBitmap(const SkBitmap& sourceBitmap);
+#ifdef __ANDROID__
static bool hasFP16Support();
+#else
+ static bool hasFP16Support() {
+ return true;
+ }
+#endif
};
} // namespace android::uirenderer
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp
index 53c5ad8eff3c..eae3584465e4 100644
--- a/libs/hwui/JankTracker.cpp
+++ b/libs/hwui/JankTracker.cpp
@@ -232,5 +232,13 @@ void JankTracker::reset() {
: FrameInfoIndex::IntendedVsync;
}
+void JankTracker::finishGpuDraw(const FrameInfo& frame) {
+ int64_t totalGPUDrawTime = frame.gpuDrawTime();
+ if (totalGPUDrawTime >= 0) {
+ mData->reportGPUFrame(totalGPUDrawTime);
+ (*mGlobalData)->reportGPUFrame(totalGPUDrawTime);
+ }
+}
+
} /* namespace uirenderer */
} /* namespace android */
diff --git a/libs/hwui/JankTracker.h b/libs/hwui/JankTracker.h
index 110211eda23a..08059268f03e 100644
--- a/libs/hwui/JankTracker.h
+++ b/libs/hwui/JankTracker.h
@@ -58,6 +58,7 @@ public:
FrameInfo* startFrame() { return &mFrames.next(); }
void finishFrame(const FrameInfo& frame);
+ void finishGpuDraw(const FrameInfo& frame);
void dumpStats(int fd) { dumpData(fd, &mDescription, mData.get()); }
void dumpFrames(int fd);
diff --git a/libs/hwui/debug/DefaultGlesDriver.h b/libs/hwui/LightingInfo.cpp
index 8027ea284aaa..83bb255f3c3b 100644
--- a/libs/hwui/debug/DefaultGlesDriver.h
+++ b/libs/hwui/LightingInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,21 +14,18 @@
* limitations under the License.
*/
-#pragma once
+#include "LightingInfo.h"
-#include "GlesDriver.h"
+#include <float.h>
namespace android {
namespace uirenderer {
-namespace debug {
-class DefaultGlesDriver : public GlesDriver {
-public:
-#define GL_ENTRY(ret, api, ...) virtual ret api##_(__VA_ARGS__) override;
-#include "gles_decls.in"
-#undef GL_ENTRY
-};
+float LightingInfo::mLightRadius = 0;
+uint8_t LightingInfo::mAmbientShadowAlpha = 0;
+uint8_t LightingInfo::mSpotShadowAlpha = 0;
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
+Vector3 LightingInfo::mLightCenter = {FLT_MIN, FLT_MIN, FLT_MIN};
+
+} /* namespace uirenderer */
+} /* namespace android */
diff --git a/libs/hwui/LightingInfo.h b/libs/hwui/LightingInfo.h
new file mode 100644
index 000000000000..3112eb3e0d73
--- /dev/null
+++ b/libs/hwui/LightingInfo.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "Lighting.h"
+#include "Properties.h"
+
+namespace android {
+namespace uirenderer {
+
+class LightingInfo {
+public:
+
+ static float getLightRadius() {
+ if (CC_UNLIKELY(Properties::overrideLightRadius > 0)) {
+ return Properties::overrideLightRadius;
+ }
+ return mLightRadius;
+ }
+
+ static uint8_t getAmbientShadowAlpha() {
+ if (CC_UNLIKELY(Properties::overrideAmbientShadowStrength >= 0)) {
+ return Properties::overrideAmbientShadowStrength;
+ }
+ return mAmbientShadowAlpha;
+ }
+
+ static uint8_t getSpotShadowAlpha() {
+ if (CC_UNLIKELY(Properties::overrideSpotShadowStrength >= 0)) {
+ return Properties::overrideSpotShadowStrength;
+ }
+ return mSpotShadowAlpha;
+ }
+
+ static Vector3 getLightCenter() {
+ if (CC_UNLIKELY(Properties::overrideLightPosY > 0 || Properties::overrideLightPosZ > 0)) {
+ Vector3 adjustedLightCenter = mLightCenter;
+ if (CC_UNLIKELY(Properties::overrideLightPosY > 0)) {
+ // negated since this shifts up
+ adjustedLightCenter.y = -Properties::overrideLightPosY;
+ }
+ if (CC_UNLIKELY(Properties::overrideLightPosZ > 0)) {
+ adjustedLightCenter.z = Properties::overrideLightPosZ;
+ }
+ return adjustedLightCenter;
+ }
+ return mLightCenter;
+ }
+
+ static Vector3 getLightCenterRaw() {
+ return mLightCenter;
+ }
+
+ static void setLightCenterRaw(const Vector3& lightCenter) {
+ mLightCenter = lightCenter;
+ }
+
+ static void updateLighting(const LightGeometry& lightGeometry, const LightInfo& lightInfo) {
+ mLightRadius = lightGeometry.radius;
+ mAmbientShadowAlpha = lightInfo.ambientShadowAlpha;
+ mSpotShadowAlpha = lightInfo.spotShadowAlpha;
+ mLightCenter = lightGeometry.center;
+ }
+private:
+ static float mLightRadius;
+ static uint8_t mAmbientShadowAlpha;
+ static uint8_t mSpotShadowAlpha;
+ static Vector3 mLightCenter;
+};
+
+} /* namespace uirenderer */
+} /* namespace android */
diff --git a/libs/hwui/ProfileData.cpp b/libs/hwui/ProfileData.cpp
index 70ca4e3e8074..7921662b213c 100644
--- a/libs/hwui/ProfileData.cpp
+++ b/libs/hwui/ProfileData.cpp
@@ -98,6 +98,10 @@ void ProfileData::mergeWith(const ProfileData& other) {
if (mStatStartTime > other.mStatStartTime || mStatStartTime == 0) {
mStatStartTime = other.mStatStartTime;
}
+ for (size_t i = 0; i < other.mGPUFrameCounts.size(); i++) {
+ mGPUFrameCounts[i] >>= divider;
+ mGPUFrameCounts[i] += other.mGPUFrameCounts[i];
+ }
}
void ProfileData::dump(int fd) const {
@@ -117,6 +121,14 @@ void ProfileData::dump(int fd) const {
histogramForEach([fd](HistogramEntry entry) {
dprintf(fd, " %ums=%u", entry.renderTimeMs, entry.frameCount);
});
+ dprintf(fd, "\n50th gpu percentile: %ums", findGPUPercentile(50));
+ dprintf(fd, "\n90th gpu percentile: %ums", findGPUPercentile(90));
+ dprintf(fd, "\n95th gpu percentile: %ums", findGPUPercentile(95));
+ dprintf(fd, "\n99th gpu percentile: %ums", findGPUPercentile(99));
+ dprintf(fd, "\nGPU HISTOGRAM:");
+ histogramGPUForEach([fd](HistogramEntry entry) {
+ dprintf(fd, " %ums=%u", entry.renderTimeMs, entry.frameCount);
+ });
}
uint32_t ProfileData::findPercentile(int percentile) const {
@@ -140,10 +152,11 @@ uint32_t ProfileData::findPercentile(int percentile) const {
void ProfileData::reset() {
mJankTypeCounts.fill(0);
mFrameCounts.fill(0);
+ mGPUFrameCounts.fill(0);
mSlowFrameCounts.fill(0);
mTotalFrameCount = 0;
mJankFrameCount = 0;
- mStatStartTime = systemTime(CLOCK_MONOTONIC);
+ mStatStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
}
void ProfileData::reportFrame(int64_t duration) {
@@ -167,5 +180,40 @@ void ProfileData::histogramForEach(const std::function<void(HistogramEntry)>& ca
}
}
+uint32_t ProfileData::findGPUPercentile(int percentile) const {
+ uint32_t totalGPUFrameCount = 0; // this is usually mTotalFrameCount - 3.
+ for (int i = mGPUFrameCounts.size() - 1; i >= 0; i--) {
+ totalGPUFrameCount += mGPUFrameCounts[i];
+ }
+ int pos = percentile * totalGPUFrameCount / 100;
+ int remaining = totalGPUFrameCount - pos;
+ for (int i = mGPUFrameCounts.size() - 1; i >= 0; i--) {
+ remaining -= mGPUFrameCounts[i];
+ if (remaining <= 0) {
+ return GPUFrameTimeForFrameCountIndex(i);
+ }
+ }
+ return 0;
+}
+
+uint32_t ProfileData::GPUFrameTimeForFrameCountIndex(uint32_t index) {
+ return index != 25 ? index + 1 : 4950;
+}
+
+void ProfileData::reportGPUFrame(int64_t duration) {
+ uint32_t index = static_cast<uint32_t>(ns2ms(duration));
+ if (index > 25) {
+ index = 25;
+ }
+
+ mGPUFrameCounts[index]++;
+}
+
+void ProfileData::histogramGPUForEach(const std::function<void(HistogramEntry)>& callback) const {
+ for (size_t i = 0; i < mGPUFrameCounts.size(); i++) {
+ callback(HistogramEntry{GPUFrameTimeForFrameCountIndex(i), mGPUFrameCounts[i]});
+ }
+}
+
} /* namespace uirenderer */
} /* namespace android */ \ No newline at end of file
diff --git a/libs/hwui/ProfileData.h b/libs/hwui/ProfileData.h
index 564920b60328..ccbffc6f136e 100644
--- a/libs/hwui/ProfileData.h
+++ b/libs/hwui/ProfileData.h
@@ -54,8 +54,10 @@ public:
void mergeWith(const ProfileData& other);
void dump(int fd) const;
uint32_t findPercentile(int percentile) const;
+ uint32_t findGPUPercentile(int percentile) const;
void reportFrame(int64_t duration);
+ void reportGPUFrame(int64_t duration);
void reportJank() { mJankFrameCount++; }
void reportJankType(JankType type) { mJankTypeCounts[static_cast<int>(type)]++; }
@@ -69,15 +71,21 @@ public:
uint32_t frameCount;
};
void histogramForEach(const std::function<void(HistogramEntry)>& callback) const;
+ void histogramGPUForEach(const std::function<void(HistogramEntry)>& callback) const;
constexpr static int HistogramSize() {
return std::tuple_size<decltype(ProfileData::mFrameCounts)>::value +
std::tuple_size<decltype(ProfileData::mSlowFrameCounts)>::value;
}
+ constexpr static int GPUHistogramSize() {
+ return std::tuple_size<decltype(ProfileData::mGPUFrameCounts)>::value;
+ }
+
// Visible for testing
static uint32_t frameTimeForFrameCountIndex(uint32_t index);
static uint32_t frameTimeForSlowFrameCountIndex(uint32_t index);
+ static uint32_t GPUFrameTimeForFrameCountIndex(uint32_t index);
private:
// Open our guts up to unit tests
@@ -88,6 +96,9 @@ private:
std::array<uint32_t, 57> mFrameCounts;
// Holds a histogram of frame times in 50ms increments from 150ms to 5s
std::array<uint16_t, 97> mSlowFrameCounts;
+ // Holds a histogram of GPU draw times in 1ms increments. Frames longer than 25ms are placed in
+ // last bucket.
+ std::array<uint32_t, 26> mGPUFrameCounts;
uint32_t mTotalFrameCount;
uint32_t mJankFrameCount;
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index af20c4f4f20e..4e7df88b8095 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -17,19 +17,32 @@
#include "Properties.h"
#include "Debug.h"
#include "DeviceInfo.h"
+#ifdef __ANDROID__
#include "HWUIProperties.sysprop.h"
+#endif
#include "SkTraceEventCommon.h"
#include <algorithm>
#include <cstdlib>
+#include <optional>
+#include <android-base/properties.h>
#include <cutils/compiler.h>
-#include <cutils/properties.h>
#include <log/log.h>
namespace android {
namespace uirenderer {
+#ifndef __ANDROID__ // Layoutlib does not compile HWUIProperties.sysprop as it depends on cutils properties
+std::optional<bool> use_vulkan() {
+ return base::GetBoolProperty("ro.hwui.use_vulkan", false);
+}
+
+std::optional<std::int32_t> render_ahead() {
+ return base::GetIntProperty("ro.hwui.render_ahead", 0);
+}
+#endif
+
bool Properties::debugLayersUpdates = false;
bool Properties::debugOverdraw = false;
bool Properties::showDirtyRegions = false;
@@ -67,64 +80,54 @@ bool Properties::isolatedProcess = false;
int Properties::contextPriority = 0;
int Properties::defaultRenderAhead = -1;
-static int property_get_int(const char* key, int defaultValue) {
- char buf[PROPERTY_VALUE_MAX] = {
- '\0',
- };
-
- if (property_get(key, buf, "") > 0) {
- return atoi(buf);
- }
- return defaultValue;
-}
-
bool Properties::load() {
- char property[PROPERTY_VALUE_MAX];
bool prevDebugLayersUpdates = debugLayersUpdates;
bool prevDebugOverdraw = debugOverdraw;
debugOverdraw = false;
- if (property_get(PROPERTY_DEBUG_OVERDRAW, property, nullptr) > 0) {
- INIT_LOGD(" Overdraw debug enabled: %s", property);
- if (!strcmp(property, "show")) {
+ std::string debugOverdrawProperty = base::GetProperty(PROPERTY_DEBUG_OVERDRAW, "");
+ if (debugOverdrawProperty != "") {
+ INIT_LOGD(" Overdraw debug enabled: %s", debugOverdrawProperty);
+ if (debugOverdrawProperty == "show") {
debugOverdraw = true;
overdrawColorSet = OverdrawColorSet::Default;
- } else if (!strcmp(property, "show_deuteranomaly")) {
+ } else if (debugOverdrawProperty == "show_deuteranomaly") {
debugOverdraw = true;
overdrawColorSet = OverdrawColorSet::Deuteranomaly;
}
}
sProfileType = ProfileType::None;
- if (property_get(PROPERTY_PROFILE, property, "") > 0) {
- if (!strcmp(property, PROPERTY_PROFILE_VISUALIZE_BARS)) {
+ std::string profileProperty = base::GetProperty(PROPERTY_PROFILE, "");
+ if (profileProperty != "") {
+ if (profileProperty == PROPERTY_PROFILE_VISUALIZE_BARS) {
sProfileType = ProfileType::Bars;
- } else if (!strcmp(property, "true")) {
+ } else if (profileProperty == "true") {
sProfileType = ProfileType::Console;
}
}
- debugLayersUpdates = property_get_bool(PROPERTY_DEBUG_LAYERS_UPDATES, false);
+ debugLayersUpdates = base::GetBoolProperty(PROPERTY_DEBUG_LAYERS_UPDATES, false);
INIT_LOGD(" Layers updates debug enabled: %d", debugLayersUpdates);
- showDirtyRegions = property_get_bool(PROPERTY_DEBUG_SHOW_DIRTY_REGIONS, false);
+ showDirtyRegions = base::GetBoolProperty(PROPERTY_DEBUG_SHOW_DIRTY_REGIONS, false);
- debugLevel = (DebugLevel)property_get_int(PROPERTY_DEBUG, kDebugDisabled);
+ debugLevel = (DebugLevel)base::GetIntProperty(PROPERTY_DEBUG, (int)kDebugDisabled);
- skipEmptyFrames = property_get_bool(PROPERTY_SKIP_EMPTY_DAMAGE, true);
- useBufferAge = property_get_bool(PROPERTY_USE_BUFFER_AGE, true);
- enablePartialUpdates = property_get_bool(PROPERTY_ENABLE_PARTIAL_UPDATES, true);
+ skipEmptyFrames = base::GetBoolProperty(PROPERTY_SKIP_EMPTY_DAMAGE, true);
+ useBufferAge = base::GetBoolProperty(PROPERTY_USE_BUFFER_AGE, true);
+ enablePartialUpdates = base::GetBoolProperty(PROPERTY_ENABLE_PARTIAL_UPDATES, true);
- filterOutTestOverhead = property_get_bool(PROPERTY_FILTER_TEST_OVERHEAD, false);
+ filterOutTestOverhead = base::GetBoolProperty(PROPERTY_FILTER_TEST_OVERHEAD, false);
- skpCaptureEnabled = debuggingEnabled && property_get_bool(PROPERTY_CAPTURE_SKP_ENABLED, false);
+ skpCaptureEnabled = debuggingEnabled && base::GetBoolProperty(PROPERTY_CAPTURE_SKP_ENABLED, false);
SkAndroidFrameworkTraceUtil::setEnableTracing(
- property_get_bool(PROPERTY_SKIA_ATRACE_ENABLED, false));
+ base::GetBoolProperty(PROPERTY_SKIA_ATRACE_ENABLED, false));
- runningInEmulator = property_get_bool(PROPERTY_QEMU_KERNEL, false);
+ runningInEmulator = base::GetBoolProperty(PROPERTY_QEMU_KERNEL, false);
- defaultRenderAhead = std::max(-1, std::min(2, property_get_int(PROPERTY_RENDERAHEAD,
+ defaultRenderAhead = std::max(-1, std::min(2, base::GetIntProperty(PROPERTY_RENDERAHEAD,
render_ahead().value_or(0))));
return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw);
@@ -175,9 +178,8 @@ RenderPipelineType Properties::peekRenderPipelineType() {
return sRenderPipelineType;
}
bool useVulkan = use_vulkan().value_or(false);
- char prop[PROPERTY_VALUE_MAX];
- property_get(PROPERTY_RENDERER, prop, useVulkan ? "skiavk" : "skiagl");
- if (!strcmp(prop, "skiavk")) {
+ std::string rendererProperty = base::GetProperty(PROPERTY_RENDERER, useVulkan ? "skiavk" : "skiagl");
+ if (rendererProperty == "skiavk") {
return RenderPipelineType::SkiaVulkan;
}
return RenderPipelineType::SkiaGL;
@@ -189,14 +191,14 @@ RenderPipelineType Properties::getRenderPipelineType() {
}
void Properties::overrideRenderPipelineType(RenderPipelineType type) {
-#if !defined(HWUI_GLES_WRAP_ENABLED)
// If we're doing actual rendering then we can't change the renderer after it's been set.
// Unit tests can freely change this as often as it wants, though, as there's no actual
// GL rendering happening
if (sRenderPipelineType != RenderPipelineType::NotInitialized) {
+ LOG_ALWAYS_FATAL_IF(sRenderPipelineType != type,
+ "Trying to change pipeline but it's already set");
return;
}
-#endif
sRenderPipelineType = type;
}
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 71b07c947716..d3ecb54d94f6 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -18,7 +18,6 @@
#define ANDROID_HWUI_PROPERTIES_H
#include <cutils/compiler.h>
-#include <cutils/properties.h>
/**
* This file contains the list of system properties used to configure libhwui.
diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp
index e58fbbe8e667..c0df2faf120a 100644
--- a/libs/hwui/RecordingCanvas.cpp
+++ b/libs/hwui/RecordingCanvas.cpp
@@ -16,6 +16,7 @@
#include "RecordingCanvas.h"
+#include "pipeline/skia/FunctorDrawable.h"
#include "VectorDrawable.h"
#include "SkAndroidFrameworkUtils.h"
@@ -274,7 +275,12 @@ struct DrawDrawable final : Op {
}
sk_sp<SkDrawable> drawable;
SkMatrix matrix = SkMatrix::I();
- void draw(SkCanvas* c, const SkMatrix&) const { c->drawDrawable(drawable.get(), &matrix); }
+ // It is important that we call drawable->draw(c) here instead of c->drawDrawable(drawable).
+ // Drawables are mutable and in cases, like RenderNodeDrawable, are not expected to produce the
+ // same content if retained outside the duration of the frame. Therefore we resolve
+ // them now and do not allow the canvas to take a reference to the drawable and potentially
+ // keep it alive for longer than the frames duration (e.g. SKP serialization).
+ void draw(SkCanvas* c, const SkMatrix&) const { drawable->draw(c, &matrix); }
};
struct DrawPicture final : Op {
static const auto kType = Type::DrawPicture;
@@ -491,6 +497,16 @@ struct DrawVectorDrawable final : Op {
SkPaint paint;
BitmapPalette palette;
};
+struct DrawWebView final : Op {
+ static const auto kType = Type::DrawWebView;
+ DrawWebView(skiapipeline::FunctorDrawable* drawable) : drawable(sk_ref_sp(drawable)) {}
+ sk_sp<skiapipeline::FunctorDrawable> drawable;
+ // We can't invoke SkDrawable::draw directly, because VkFunctorDrawable expects
+ // SkDrawable::onSnapGpuDrawHandler callback instead of SkDrawable::onDraw.
+ // SkCanvas::drawDrawable/SkGpuDevice::drawDrawable has the logic to invoke
+ // onSnapGpuDrawHandler.
+ void draw(SkCanvas* c, const SkMatrix&) const { c->drawDrawable(drawable.get()); }
+};
}
template <typename T, typename... Args>
@@ -675,6 +691,9 @@ void DisplayListData::drawShadowRec(const SkPath& path, const SkDrawShadowRec& r
void DisplayListData::drawVectorDrawable(VectorDrawableRoot* tree) {
this->push<DrawVectorDrawable>(0, tree);
}
+void DisplayListData::drawWebView(skiapipeline::FunctorDrawable* drawable) {
+ this->push<DrawWebView>(0, drawable);
+}
typedef void (*draw_fn)(const void*, SkCanvas*, const SkMatrix&);
typedef void (*void_fn)(const void*);
@@ -981,5 +1000,9 @@ void RecordingCanvas::drawVectorDrawable(VectorDrawableRoot* tree) {
fDL->drawVectorDrawable(tree);
}
+void RecordingCanvas::drawWebView(skiapipeline::FunctorDrawable* drawable) {
+ fDL->drawWebView(drawable);
+}
+
} // namespace uirenderer
} // namespace android
diff --git a/libs/hwui/RecordingCanvas.h b/libs/hwui/RecordingCanvas.h
index 7269bcad3d7a..322eff24dd34 100644
--- a/libs/hwui/RecordingCanvas.h
+++ b/libs/hwui/RecordingCanvas.h
@@ -29,7 +29,6 @@
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRect.h"
-#include "SkTDArray.h"
#include "SkTemplates.h"
#include <vector>
@@ -37,6 +36,10 @@
namespace android {
namespace uirenderer {
+namespace skiapipeline {
+class FunctorDrawable;
+}
+
enum class DisplayListOpType : uint8_t {
#define X(T) T,
#include "DisplayListOps.in"
@@ -66,6 +69,7 @@ public:
bool hasText() const { return mHasText; }
size_t usedSize() const { return fUsed; }
+ size_t allocatedSize() const { return fReserved; }
private:
friend class RecordingCanvas;
@@ -120,6 +124,7 @@ private:
SkBlendMode, const SkRect*, const SkPaint*);
void drawShadowRec(const SkPath&, const SkDrawShadowRec&);
void drawVectorDrawable(VectorDrawableRoot* tree);
+ void drawWebView(skiapipeline::FunctorDrawable*);
template <typename T, typename... Args>
void* push(size_t, Args&&...);
@@ -204,6 +209,7 @@ public:
void onDrawShadowRec(const SkPath&, const SkDrawShadowRec&) override;
void drawVectorDrawable(VectorDrawableRoot* tree);
+ void drawWebView(skiapipeline::FunctorDrawable*);
/**
* If "isClipMayBeComplex" returns false, it is guaranteed the current clip is a rectangle.
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index b73347b233d7..6761435a8171 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -20,8 +20,13 @@
#include "Debug.h"
#include "TreeInfo.h"
#include "VectorDrawable.h"
-#include "renderstate/RenderState.h"
+#include "private/hwui/WebViewFunctor.h"
+#ifdef __ANDROID__
#include "renderthread/CanvasContext.h"
+#else
+#include "DamageAccumulator.h"
+#include "pipeline/skia/SkiaDisplayList.h"
+#endif
#include "utils/FatVector.h"
#include "utils/MathUtils.h"
#include "utils/StringUtils.h"
@@ -103,7 +108,7 @@ void RenderNode::output(std::ostream& output, uint32_t level) {
output << std::endl;
}
-int RenderNode::getDebugSize() {
+int RenderNode::getUsageSize() {
int size = sizeof(RenderNode);
if (mStagingDisplayList) {
size += mStagingDisplayList->getUsedSize();
@@ -114,6 +119,18 @@ int RenderNode::getDebugSize() {
return size;
}
+int RenderNode::getAllocatedSize() {
+ int size = sizeof(RenderNode);
+ if (mStagingDisplayList) {
+ size += mStagingDisplayList->getAllocatedSize();
+ }
+ if (mDisplayList && mDisplayList != mStagingDisplayList) {
+ size += mDisplayList->getAllocatedSize();
+ }
+ return size;
+}
+
+
void RenderNode::prepareTree(TreeInfo& info) {
ATRACE_CALL();
LOG_ALWAYS_FATAL_IF(!info.damageAccumulator, "DamageAccumulator missing");
@@ -161,6 +178,7 @@ void RenderNode::prepareLayer(TreeInfo& info, uint32_t dirtyMask) {
}
void RenderNode::pushLayerUpdate(TreeInfo& info) {
+#ifdef __ANDROID__ // Layoutlib does not support CanvasContext and Layers
LayerType layerType = properties().effectiveLayerType();
// If we are not a layer OR we cannot be rendered (eg, view was detached)
// we need to destroy any Layers we may have had previously
@@ -189,6 +207,7 @@ void RenderNode::pushLayerUpdate(TreeInfo& info) {
// That might be us, so tell CanvasContext that this layer is in the
// tree and should not be destroyed.
info.canvasContext.markLayerInUse(this);
+#endif
}
/**
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index c6db7f1ba60d..d55e5b0ce836 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -102,7 +102,8 @@ public:
ANDROID_API void setStagingDisplayList(DisplayList* newData);
ANDROID_API void output();
- ANDROID_API int getDebugSize();
+ ANDROID_API int getUsageSize();
+ ANDROID_API int getAllocatedSize();
bool isRenderable() const { return mDisplayList && !mDisplayList->isEmpty(); }
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index e6710cc8f950..e9794489f171 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -526,9 +526,13 @@ public:
}
bool fitsOnLayer() const {
+#ifdef __ANDROID__ // Layoutlib does not support device info
const DeviceInfo* deviceInfo = DeviceInfo::get();
return mPrimitiveFields.mWidth <= deviceInfo->maxTextureSize() &&
mPrimitiveFields.mHeight <= deviceInfo->maxTextureSize();
+#else
+ return mPrimitiveFields.mWidth <= 4096 && mPrimitiveFields.mHeight <= 4096;
+#endif
}
bool promotedToLayer() const {
diff --git a/libs/hwui/RootRenderNode.cpp b/libs/hwui/RootRenderNode.cpp
new file mode 100644
index 000000000000..ddbbf58b3071
--- /dev/null
+++ b/libs/hwui/RootRenderNode.cpp
@@ -0,0 +1,306 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 "RootRenderNode.h"
+
+#ifdef __ANDROID__ // Layoutlib does not support Looper (windows)
+#include <utils/Looper.h>
+#endif
+
+namespace android::uirenderer {
+
+#ifdef __ANDROID__ // Layoutlib does not support Looper
+class FinishAndInvokeListener : public MessageHandler {
+public:
+ explicit FinishAndInvokeListener(PropertyValuesAnimatorSet* anim) : mAnimator(anim) {
+ mListener = anim->getOneShotListener();
+ mRequestId = anim->getRequestId();
+ }
+
+ virtual void handleMessage(const Message& message) {
+ if (mAnimator->getRequestId() == mRequestId) {
+ // Request Id has not changed, meaning there's no animation lifecyle change since the
+ // message is posted, so go ahead and call finish to make sure the PlayState is properly
+ // updated. This is needed because before the next frame comes in from UI thread to
+ // trigger an animation update, there could be reverse/cancel etc. So we need to update
+ // the playstate in time to ensure all the subsequent events get chained properly.
+ mAnimator->end();
+ }
+ mListener->onAnimationFinished(nullptr);
+ }
+
+private:
+ sp<PropertyValuesAnimatorSet> mAnimator;
+ sp<AnimationListener> mListener;
+ uint32_t mRequestId;
+};
+
+void RootRenderNode::prepareTree(TreeInfo& info) {
+ info.errorHandler = mErrorHandler.get();
+
+ for (auto& anim : mRunningVDAnimators) {
+ // Assume that the property change in VD from the animators will not be consumed. Mark
+ // otherwise if the VDs are found in the display list tree. For VDs that are not in
+ // the display list tree, we stop providing animation pulses by 1) removing them from
+ // the animation list, 2) post a delayed message to end them at end time so their
+ // listeners can receive the corresponding callbacks.
+ anim->getVectorDrawable()->setPropertyChangeWillBeConsumed(false);
+ // Mark the VD dirty so it will damage itself during prepareTree.
+ anim->getVectorDrawable()->markDirty();
+ }
+ if (info.mode == TreeInfo::MODE_FULL) {
+ for (auto& anim : mPausedVDAnimators) {
+ anim->getVectorDrawable()->setPropertyChangeWillBeConsumed(false);
+ anim->getVectorDrawable()->markDirty();
+ }
+ }
+ // TODO: This is hacky
+ info.updateWindowPositions = true;
+ RenderNode::prepareTree(info);
+ info.updateWindowPositions = false;
+ info.errorHandler = nullptr;
+}
+
+void RootRenderNode::attachAnimatingNode(RenderNode* animatingNode) {
+ mPendingAnimatingRenderNodes.push_back(animatingNode);
+}
+
+void RootRenderNode::attachPendingVectorDrawableAnimators() {
+ mRunningVDAnimators.insert(mPendingVectorDrawableAnimators.begin(),
+ mPendingVectorDrawableAnimators.end());
+ mPendingVectorDrawableAnimators.clear();
+}
+
+void RootRenderNode::detachAnimators() {
+ // Remove animators from the list and post a delayed message in future to end the animator
+ // For infinite animators, remove the listener so we no longer hold a global ref to the AVD
+ // java object, and therefore the AVD objects in both native and Java can be properly
+ // released.
+ for (auto& anim : mRunningVDAnimators) {
+ detachVectorDrawableAnimator(anim.get());
+ anim->clearOneShotListener();
+ }
+ for (auto& anim : mPausedVDAnimators) {
+ anim->clearOneShotListener();
+ }
+ mRunningVDAnimators.clear();
+ mPausedVDAnimators.clear();
+}
+
+// Move all the animators to the paused list, and send a delayed message to notify the finished
+// listener.
+void RootRenderNode::pauseAnimators() {
+ mPausedVDAnimators.insert(mRunningVDAnimators.begin(), mRunningVDAnimators.end());
+ for (auto& anim : mRunningVDAnimators) {
+ detachVectorDrawableAnimator(anim.get());
+ }
+ mRunningVDAnimators.clear();
+}
+
+void RootRenderNode::doAttachAnimatingNodes(AnimationContext* context) {
+ for (size_t i = 0; i < mPendingAnimatingRenderNodes.size(); i++) {
+ RenderNode* node = mPendingAnimatingRenderNodes[i].get();
+ context->addAnimatingRenderNode(*node);
+ }
+ mPendingAnimatingRenderNodes.clear();
+}
+
+// Run VectorDrawable animators after prepareTree.
+void RootRenderNode::runVectorDrawableAnimators(AnimationContext* context, TreeInfo& info) {
+ // Push staging.
+ if (info.mode == TreeInfo::MODE_FULL) {
+ pushStagingVectorDrawableAnimators(context);
+ }
+
+ // Run the animators in the running list.
+ for (auto it = mRunningVDAnimators.begin(); it != mRunningVDAnimators.end();) {
+ if ((*it)->animate(*context)) {
+ it = mRunningVDAnimators.erase(it);
+ } else {
+ it++;
+ }
+ }
+
+ // Run the animators in paused list during full sync.
+ if (info.mode == TreeInfo::MODE_FULL) {
+ // During full sync we also need to pulse paused animators, in case their targets
+ // have been added back to the display list. All the animators that passed the
+ // scheduled finish time will be removed from the paused list.
+ for (auto it = mPausedVDAnimators.begin(); it != mPausedVDAnimators.end();) {
+ if ((*it)->animate(*context)) {
+ // Animator has finished, remove from the list.
+ it = mPausedVDAnimators.erase(it);
+ } else {
+ it++;
+ }
+ }
+ }
+
+ // Move the animators with a target not in DisplayList to paused list.
+ for (auto it = mRunningVDAnimators.begin(); it != mRunningVDAnimators.end();) {
+ if (!(*it)->getVectorDrawable()->getPropertyChangeWillBeConsumed()) {
+ // Vector Drawable is not in the display list, we should remove this animator from
+ // the list, put it in the paused list, and post a delayed message to end the
+ // animator.
+ detachVectorDrawableAnimator(it->get());
+ mPausedVDAnimators.insert(*it);
+ it = mRunningVDAnimators.erase(it);
+ } else {
+ it++;
+ }
+ }
+
+ // Move the animators with a target in DisplayList from paused list to running list, and
+ // trim paused list.
+ if (info.mode == TreeInfo::MODE_FULL) {
+ // Check whether any paused animator's target is back in Display List. If so, put the
+ // animator back in the running list.
+ for (auto it = mPausedVDAnimators.begin(); it != mPausedVDAnimators.end();) {
+ if ((*it)->getVectorDrawable()->getPropertyChangeWillBeConsumed()) {
+ mRunningVDAnimators.insert(*it);
+ it = mPausedVDAnimators.erase(it);
+ } else {
+ it++;
+ }
+ }
+ // Trim paused VD animators at full sync, so that when Java loses reference to an
+ // animator, we know we won't be requested to animate it any more, then we remove such
+ // animators from the paused list so they can be properly freed. We also remove the
+ // animators from paused list when the time elapsed since start has exceeded duration.
+ trimPausedVDAnimators(context);
+ }
+
+ info.out.hasAnimations |= !mRunningVDAnimators.empty();
+}
+
+void RootRenderNode::trimPausedVDAnimators(AnimationContext* context) {
+ // Trim paused vector drawable animator list.
+ for (auto it = mPausedVDAnimators.begin(); it != mPausedVDAnimators.end();) {
+ // Remove paused VD animator if no one else is referencing it. Note that animators that
+ // have passed scheduled finish time are removed from list when they are being pulsed
+ // before prepare tree.
+ // TODO: this is a bit hacky, need to figure out a better way to track when the paused
+ // animators should be freed.
+ if ((*it)->getStrongCount() == 1) {
+ it = mPausedVDAnimators.erase(it);
+ } else {
+ it++;
+ }
+ }
+}
+
+void RootRenderNode::pushStagingVectorDrawableAnimators(AnimationContext* context) {
+ for (auto& anim : mRunningVDAnimators) {
+ anim->pushStaging(*context);
+ }
+}
+
+void RootRenderNode::destroy() {
+ for (auto& renderNode : mPendingAnimatingRenderNodes) {
+ renderNode->animators().endAllStagingAnimators();
+ }
+ mPendingAnimatingRenderNodes.clear();
+ mPendingVectorDrawableAnimators.clear();
+}
+
+void RootRenderNode::addVectorDrawableAnimator(PropertyValuesAnimatorSet* anim) {
+ mPendingVectorDrawableAnimators.insert(anim);
+}
+
+void RootRenderNode::detachVectorDrawableAnimator(PropertyValuesAnimatorSet* anim) {
+ if (anim->isInfinite() || !anim->isRunning()) {
+ // Do not need to post anything if the animation is infinite (i.e. no meaningful
+ // end listener action), or if the animation has already ended.
+ return;
+ }
+ nsecs_t remainingTimeInMs = anim->getRemainingPlayTime();
+ // Post a delayed onFinished event that is scheduled to be handled when the animator ends.
+ if (anim->getOneShotListener()) {
+ // VectorDrawable's oneshot listener is updated when there are user triggered animation
+ // lifecycle changes, such as start(), end(), etc. By using checking and clearing
+ // one shot listener, we ensure the same end listener event gets posted only once.
+ // Therefore no duplicates. Another benefit of using one shot listener is that no
+ // removal is necessary: the end time of animation will not change unless triggered by
+ // user events, in which case the already posted listener's id will become stale, and
+ // the onFinished callback will then be ignored.
+ sp<FinishAndInvokeListener> message = new FinishAndInvokeListener(anim);
+ auto looper = Looper::getForThread();
+ LOG_ALWAYS_FATAL_IF(looper == nullptr, "Not on a looper thread?");
+ looper->sendMessageDelayed(ms2ns(remainingTimeInMs), message, 0);
+ anim->clearOneShotListener();
+ }
+}
+
+class AnimationContextBridge : public AnimationContext {
+public:
+ AnimationContextBridge(renderthread::TimeLord& clock, RootRenderNode* rootNode)
+ : AnimationContext(clock), mRootNode(rootNode) {}
+
+ virtual ~AnimationContextBridge() {}
+
+ // Marks the start of a frame, which will update the frame time and move all
+ // next frame animations into the current frame
+ virtual void startFrame(TreeInfo::TraversalMode mode) {
+ if (mode == TreeInfo::MODE_FULL) {
+ mRootNode->doAttachAnimatingNodes(this);
+ mRootNode->attachPendingVectorDrawableAnimators();
+ }
+ AnimationContext::startFrame(mode);
+ }
+
+ // Runs any animations still left in mCurrentFrameAnimations
+ virtual void runRemainingAnimations(TreeInfo& info) {
+ AnimationContext::runRemainingAnimations(info);
+ mRootNode->runVectorDrawableAnimators(this, info);
+ }
+
+ virtual void pauseAnimators() override { mRootNode->pauseAnimators(); }
+
+ virtual void callOnFinished(BaseRenderNodeAnimator* animator, AnimationListener* listener) {
+ listener->onAnimationFinished(animator);
+ }
+
+ virtual void destroy() {
+ AnimationContext::destroy();
+ mRootNode->detachAnimators();
+ }
+
+private:
+ sp<RootRenderNode> mRootNode;
+};
+
+AnimationContext* ContextFactoryImpl::createAnimationContext(renderthread::TimeLord& clock) {
+ return new AnimationContextBridge(clock, mRootNode);
+}
+#else
+
+void RootRenderNode::prepareTree(TreeInfo& info) {
+ info.errorHandler = mErrorHandler.get();
+ info.updateWindowPositions = true;
+ RenderNode::prepareTree(info);
+ info.updateWindowPositions = false;
+ info.errorHandler = nullptr;
+}
+
+void RootRenderNode::attachAnimatingNode(RenderNode* animatingNode) { }
+
+void RootRenderNode::destroy() { }
+
+void RootRenderNode::addVectorDrawableAnimator(PropertyValuesAnimatorSet* anim) { }
+
+#endif
+
+} // namespace android::uirenderer
diff --git a/libs/hwui/RootRenderNode.h b/libs/hwui/RootRenderNode.h
new file mode 100644
index 000000000000..12de4ecac94b
--- /dev/null
+++ b/libs/hwui/RootRenderNode.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <set>
+#include <vector>
+
+#include "AnimationContext.h"
+#include "Animator.h"
+#include <IContextFactory.h>
+#include "PropertyValuesAnimatorSet.h"
+#include "RenderNode.h"
+
+namespace android::uirenderer {
+
+class ANDROID_API RootRenderNode : public RenderNode {
+public:
+ ANDROID_API explicit RootRenderNode(std::unique_ptr<ErrorHandler> errorHandler)
+ : RenderNode(), mErrorHandler(std::move(errorHandler)) {}
+
+ ANDROID_API virtual ~RootRenderNode() {}
+
+ virtual void prepareTree(TreeInfo& info) override;
+
+ ANDROID_API void attachAnimatingNode(RenderNode* animatingNode);
+
+ void attachPendingVectorDrawableAnimators();
+
+ void detachAnimators();
+
+ void pauseAnimators();
+
+ void doAttachAnimatingNodes(AnimationContext* context);
+
+ // Run VectorDrawable animators after prepareTree.
+ void runVectorDrawableAnimators(AnimationContext* context, TreeInfo& info);
+
+ void trimPausedVDAnimators(AnimationContext* context);
+
+ void pushStagingVectorDrawableAnimators(AnimationContext* context);
+
+ ANDROID_API void destroy();
+
+ ANDROID_API void addVectorDrawableAnimator(PropertyValuesAnimatorSet* anim);
+
+private:
+ const std::unique_ptr<ErrorHandler> mErrorHandler;
+ std::vector<sp<RenderNode> > mPendingAnimatingRenderNodes;
+ std::set<sp<PropertyValuesAnimatorSet> > mPendingVectorDrawableAnimators;
+ std::set<sp<PropertyValuesAnimatorSet> > mRunningVDAnimators;
+ // mPausedVDAnimators stores a list of animators that have not yet passed the finish time, but
+ // their VectorDrawable targets are no longer in the DisplayList. We skip these animators when
+ // render thread runs animators independent of UI thread (i.e. RT_ONLY mode). These animators
+ // need to be re-activated once their VD target is added back into DisplayList. Since that could
+ // only happen when we do a full sync, we need to make sure to pulse these paused animators at
+ // full sync. If any animator's VD target is found in DisplayList during a full sync, we move
+ // the animator back to the running list.
+ std::set<sp<PropertyValuesAnimatorSet> > mPausedVDAnimators;
+
+ void detachVectorDrawableAnimator(PropertyValuesAnimatorSet* anim);
+};
+
+#ifdef __ANDROID__ // Layoutlib does not support Animations
+class ANDROID_API ContextFactoryImpl : public IContextFactory {
+public:
+ ANDROID_API explicit ContextFactoryImpl(RootRenderNode* rootNode) : mRootNode(rootNode) {}
+
+ ANDROID_API virtual AnimationContext* createAnimationContext(
+ renderthread::TimeLord& clock) override;
+
+private:
+ RootRenderNode* mRootNode;
+};
+#endif
+
+} // namespace android::uirenderer
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index bebda8527def..23140724ef64 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -163,7 +163,7 @@ static inline SkCanvas::SaveLayerFlags layerFlags(SaveFlags::Flags flags) {
SkCanvas::SaveLayerFlags layerFlags = 0;
if (!(flags & SaveFlags::ClipToLayer)) {
- layerFlags |= SkCanvas::kDontClipToLayer_Legacy_SaveLayerFlag;
+ layerFlags |= SkCanvasPriv::kDontClipToLayer_SaveLayerFlag;
}
return layerFlags;
@@ -454,7 +454,7 @@ void SkiaCanvas::drawPaint(const SkPaint& paint) {
// Canvas draw operations: Geometry
// ----------------------------------------------------------------------------
-void SkiaCanvas::drawPoints(const float* points, int count, const SkPaint& paint,
+void SkiaCanvas::drawPoints(const float* points, int count, const Paint& paint,
SkCanvas::PointMode mode) {
if (CC_UNLIKELY(count < 2 || paint.nothingToDraw())) return;
// convert the floats into SkPoints
@@ -464,109 +464,142 @@ void SkiaCanvas::drawPoints(const float* points, int count, const SkPaint& paint
pts[i].set(points[0], points[1]);
points += 2;
}
- mCanvas->drawPoints(mode, count, pts.get(), *filterPaint(paint));
+
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawPoints(mode, count, pts.get(), p);
+ });
}
-void SkiaCanvas::drawPoint(float x, float y, const SkPaint& paint) {
- mCanvas->drawPoint(x, y, *filterPaint(paint));
+void SkiaCanvas::drawPoint(float x, float y, const Paint& paint) {
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawPoint(x, y, p);
+ });
}
-void SkiaCanvas::drawPoints(const float* points, int count, const SkPaint& paint) {
- this->drawPoints(points, count, *filterPaint(paint), SkCanvas::kPoints_PointMode);
+void SkiaCanvas::drawPoints(const float* points, int count, const Paint& paint) {
+ this->drawPoints(points, count, paint, SkCanvas::kPoints_PointMode);
}
void SkiaCanvas::drawLine(float startX, float startY, float stopX, float stopY,
- const SkPaint& paint) {
- mCanvas->drawLine(startX, startY, stopX, stopY, *filterPaint(paint));
+ const Paint& paint) {
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawLine(startX, startY, stopX, stopY, p);
+ });
}
-void SkiaCanvas::drawLines(const float* points, int count, const SkPaint& paint) {
+void SkiaCanvas::drawLines(const float* points, int count, const Paint& paint) {
if (CC_UNLIKELY(count < 4 || paint.nothingToDraw())) return;
- this->drawPoints(points, count, *filterPaint(paint), SkCanvas::kLines_PointMode);
+ this->drawPoints(points, count, paint, SkCanvas::kLines_PointMode);
}
-void SkiaCanvas::drawRect(float left, float top, float right, float bottom, const SkPaint& paint) {
+void SkiaCanvas::drawRect(float left, float top, float right, float bottom, const Paint& paint) {
if (CC_UNLIKELY(paint.nothingToDraw())) return;
- mCanvas->drawRect({left, top, right, bottom}, *filterPaint(paint));
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawRect({left, top, right, bottom}, p);
+ });
}
-void SkiaCanvas::drawRegion(const SkRegion& region, const SkPaint& paint) {
+void SkiaCanvas::drawRegion(const SkRegion& region, const Paint& paint) {
if (CC_UNLIKELY(paint.nothingToDraw())) return;
- mCanvas->drawRegion(region, *filterPaint(paint));
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawRegion(region, p);
+ });
}
void SkiaCanvas::drawRoundRect(float left, float top, float right, float bottom, float rx, float ry,
- const SkPaint& paint) {
+ const Paint& paint) {
if (CC_UNLIKELY(paint.nothingToDraw())) return;
SkRect rect = SkRect::MakeLTRB(left, top, right, bottom);
- mCanvas->drawRoundRect(rect, rx, ry, *filterPaint(paint));
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawRoundRect(rect, rx, ry, p);
+ });
}
void SkiaCanvas::drawDoubleRoundRect(const SkRRect& outer, const SkRRect& inner,
- const SkPaint& paint) {
- mCanvas->drawDRRect(outer, inner, *filterPaint(paint));
+ const Paint& paint) {
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawDRRect(outer, inner, p);
+ });
}
-void SkiaCanvas::drawCircle(float x, float y, float radius, const SkPaint& paint) {
+void SkiaCanvas::drawCircle(float x, float y, float radius, const Paint& paint) {
if (CC_UNLIKELY(radius <= 0 || paint.nothingToDraw())) return;
- mCanvas->drawCircle(x, y, radius, *filterPaint(paint));
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawCircle(x, y, radius, p);
+ });
}
-void SkiaCanvas::drawOval(float left, float top, float right, float bottom, const SkPaint& paint) {
+void SkiaCanvas::drawOval(float left, float top, float right, float bottom, const Paint& paint) {
if (CC_UNLIKELY(paint.nothingToDraw())) return;
SkRect oval = SkRect::MakeLTRB(left, top, right, bottom);
- mCanvas->drawOval(oval, *filterPaint(paint));
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawOval(oval, p);
+ });
}
void SkiaCanvas::drawArc(float left, float top, float right, float bottom, float startAngle,
- float sweepAngle, bool useCenter, const SkPaint& paint) {
+ float sweepAngle, bool useCenter, const Paint& paint) {
if (CC_UNLIKELY(paint.nothingToDraw())) return;
SkRect arc = SkRect::MakeLTRB(left, top, right, bottom);
- if (fabs(sweepAngle) >= 360.0f) {
- mCanvas->drawOval(arc, *filterPaint(paint));
- } else {
- mCanvas->drawArc(arc, startAngle, sweepAngle, useCenter, *filterPaint(paint));
- }
+ apply_looper(&paint, [&](const SkPaint& p) {
+ if (fabs(sweepAngle) >= 360.0f) {
+ mCanvas->drawOval(arc, p);
+ } else {
+ mCanvas->drawArc(arc, startAngle, sweepAngle, useCenter, p);
+ }
+ });
}
-void SkiaCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
+void SkiaCanvas::drawPath(const SkPath& path, const Paint& paint) {
if (CC_UNLIKELY(paint.nothingToDraw())) return;
if (CC_UNLIKELY(path.isEmpty() && (!path.isInverseFillType()))) {
return;
}
- mCanvas->drawPath(path, *filterPaint(paint));
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawPath(path, p);
+ });
}
-void SkiaCanvas::drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) {
- mCanvas->drawVertices(vertices, mode, *filterPaint(paint));
+void SkiaCanvas::drawVertices(const SkVertices* vertices, SkBlendMode mode, const Paint& paint) {
+ apply_looper(&paint, [&](const SkPaint& p) {
+ mCanvas->drawVertices(vertices, mode, p);
+ });
}
// ----------------------------------------------------------------------------
// Canvas draw operations: Bitmaps
// ----------------------------------------------------------------------------
-void SkiaCanvas::drawBitmap(Bitmap& bitmap, float left, float top, const SkPaint* paint) {
- mCanvas->drawImage(bitmap.makeImage(), left, top, filterPaint(paint));
+void SkiaCanvas::drawBitmap(Bitmap& bitmap, float left, float top, const Paint* paint) {
+ auto image = bitmap.makeImage();
+ apply_looper(paint, [&](const SkPaint& p) {
+ mCanvas->drawImage(image, left, top, &p);
+ });
}
-void SkiaCanvas::drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint) {
+void SkiaCanvas::drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const Paint* paint) {
+ auto image = bitmap.makeImage();
SkAutoCanvasRestore acr(mCanvas, true);
mCanvas->concat(matrix);
- mCanvas->drawImage(bitmap.makeImage(), 0, 0, filterPaint(paint));
+ apply_looper(paint, [&](const SkPaint& p) {
+ mCanvas->drawImage(image, 0, 0, &p);
+ });
}
void SkiaCanvas::drawBitmap(Bitmap& bitmap, float srcLeft, float srcTop, float srcRight,
float srcBottom, float dstLeft, float dstTop, float dstRight,
- float dstBottom, const SkPaint* paint) {
+ float dstBottom, const Paint* paint) {
+ auto image = bitmap.makeImage();
SkRect srcRect = SkRect::MakeLTRB(srcLeft, srcTop, srcRight, srcBottom);
SkRect dstRect = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom);
- mCanvas->drawImageRect(bitmap.makeImage(), srcRect, dstRect, filterPaint(paint),
- SkCanvas::kFast_SrcRectConstraint);
+ apply_looper(paint, [&](const SkPaint& p) {
+ mCanvas->drawImageRect(image, srcRect, dstRect, &p, SkCanvas::kFast_SrcRectConstraint);
+ });
}
void SkiaCanvas::drawBitmapMesh(Bitmap& bitmap, int meshWidth, int meshHeight,
- const float* vertices, const int* colors, const SkPaint* paint) {
+ const float* vertices, const int* colors, const Paint* paint) {
const int ptCount = (meshWidth + 1) * (meshHeight + 1);
const int indexCount = meshWidth * meshHeight * 6;
uint32_t flags = SkVertices::kHasTexCoords_BuilderFlag;
@@ -640,21 +673,20 @@ void SkiaCanvas::drawBitmapMesh(Bitmap& bitmap, int meshWidth, int meshHeight,
#endif
// cons-up a shader for the bitmap
- PaintCoW paintCoW(paint);
- SkPaint& tmpPaint = paintCoW.writeable();
-
- sk_sp<SkImage> image = bitmap.makeImage();
- sk_sp<SkShader> shader =
- image->makeShader(SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
- tmpPaint.setShader(std::move(shader));
-
- mCanvas->drawVertices(builder.detach(), SkBlendMode::kModulate,
- *filterPaint(std::move(paintCoW)));
+ Paint pnt;
+ if (paint) {
+ pnt = *paint;
+ }
+ pnt.setShader(bitmap.makeImage()->makeShader());
+ auto v = builder.detach();
+ apply_looper(&pnt, [&](const SkPaint& p) {
+ mCanvas->drawVertices(v, SkBlendMode::kModulate, p);
+ });
}
void SkiaCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& chunk, float dstLeft,
float dstTop, float dstRight, float dstBottom,
- const SkPaint* paint) {
+ const Paint* paint) {
SkCanvas::Lattice lattice;
NinePatchUtils::SetLatticeDivs(&lattice, chunk, bitmap.width(), bitmap.height());
@@ -675,8 +707,10 @@ void SkiaCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& chunk, floa
lattice.fBounds = nullptr;
SkRect dst = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom);
-
- mCanvas->drawImageLattice(bitmap.makeImage().get(), lattice, dst, filterPaint(paint));
+ auto image = bitmap.makeImage();
+ apply_looper(paint, [&](const SkPaint& p) {
+ mCanvas->drawImageLattice(image.get(), lattice, dst, &p);
+ });
}
double SkiaCanvas::drawAnimatedImage(AnimatedImageDrawable* imgDrawable) {
@@ -779,6 +813,13 @@ void SkiaCanvas::drawCircle(uirenderer::CanvasPropertyPrimitive* x,
mCanvas->drawDrawable(drawable.get());
}
+void SkiaCanvas::drawPicture(const SkPicture& picture) {
+ // TODO: Change to mCanvas->drawPicture()? SkCanvas::drawPicture seems to be
+ // where the logic is for playback vs. ref picture. Using picture.playback here
+ // to stay behavior-identical for now, but should revisit this at some point.
+ picture.playback(mCanvas);
+}
+
// ----------------------------------------------------------------------------
// Canvas draw operations: View System
// ----------------------------------------------------------------------------
diff --git a/libs/hwui/SkiaCanvas.h b/libs/hwui/SkiaCanvas.h
index bbe91eb2fbc4..ec83a1961eff 100644
--- a/libs/hwui/SkiaCanvas.h
+++ b/libs/hwui/SkiaCanvas.h
@@ -16,12 +16,16 @@
#pragma once
#include "CanvasProperty.h"
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
#include "DeferredLayerUpdater.h"
+#endif
#include "RenderNode.h"
#include "VectorDrawable.h"
#include "hwui/Canvas.h"
+#include "hwui/Paint.h"
#include <SkCanvas.h>
+#include "src/core/SkArenaAlloc.h"
#include <cassert>
#include <optional>
@@ -44,8 +48,6 @@ public:
virtual ~SkiaCanvas();
- virtual SkCanvas* asSkCanvas() override { return mCanvas; }
-
virtual void resetRecording(int width, int height,
uirenderer::RenderNode* renderNode) override {
LOG_ALWAYS_FATAL("SkiaCanvas cannot be reset as a recording canvas");
@@ -99,39 +101,39 @@ public:
virtual void drawColor(int color, SkBlendMode mode) override;
virtual void drawPaint(const SkPaint& paint) override;
- virtual void drawPoint(float x, float y, const SkPaint& paint) override;
- virtual void drawPoints(const float* points, int count, const SkPaint& paint) override;
+ virtual void drawPoint(float x, float y, const Paint& paint) override;
+ virtual void drawPoints(const float* points, int count, const Paint& paint) override;
virtual void drawLine(float startX, float startY, float stopX, float stopY,
- const SkPaint& paint) override;
- virtual void drawLines(const float* points, int count, const SkPaint& paint) override;
+ const Paint& paint) override;
+ virtual void drawLines(const float* points, int count, const Paint& paint) override;
virtual void drawRect(float left, float top, float right, float bottom,
- const SkPaint& paint) override;
- virtual void drawRegion(const SkRegion& region, const SkPaint& paint) override;
+ const Paint& paint) override;
+ virtual void drawRegion(const SkRegion& region, const Paint& paint) override;
virtual void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry,
- const SkPaint& paint) override;
+ const Paint& paint) override;
virtual void drawDoubleRoundRect(const SkRRect& outer, const SkRRect& inner,
- const SkPaint& paint) override;
+ const Paint& paint) override;
- virtual void drawCircle(float x, float y, float radius, const SkPaint& paint) override;
+ virtual void drawCircle(float x, float y, float radius, const Paint& paint) override;
virtual void drawOval(float left, float top, float right, float bottom,
- const SkPaint& paint) override;
+ const Paint& paint) override;
virtual void drawArc(float left, float top, float right, float bottom, float startAngle,
- float sweepAngle, bool useCenter, const SkPaint& paint) override;
- virtual void drawPath(const SkPath& path, const SkPaint& paint) override;
- virtual void drawVertices(const SkVertices*, SkBlendMode, const SkPaint& paint) override;
+ float sweepAngle, bool useCenter, const Paint& paint) override;
+ virtual void drawPath(const SkPath& path, const Paint& paint) override;
+ virtual void drawVertices(const SkVertices*, SkBlendMode, const Paint& paint) override;
- virtual void drawBitmap(Bitmap& bitmap, float left, float top, const SkPaint* paint) override;
- virtual void drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint) override;
+ virtual void drawBitmap(Bitmap& bitmap, float left, float top, const Paint* paint) override;
+ virtual void drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const Paint* paint) override;
virtual void drawBitmap(Bitmap& bitmap, float srcLeft, float srcTop, float srcRight,
float srcBottom, float dstLeft, float dstTop, float dstRight,
- float dstBottom, const SkPaint* paint) override;
+ float dstBottom, const Paint* paint) override;
virtual void drawBitmapMesh(Bitmap& bitmap, int meshWidth, int meshHeight,
const float* vertices, const int* colors,
- const SkPaint* paint) override;
+ const Paint* paint) override;
virtual void drawNinePatch(Bitmap& bitmap, const android::Res_png_9patch& chunk, float dstLeft,
float dstTop, float dstRight, float dstBottom,
- const SkPaint* paint) override;
+ const Paint* paint) override;
virtual double drawAnimatedImage(AnimatedImageDrawable* imgDrawable) override;
virtual bool drawTextAbsolutePos() const override { return true; }
@@ -153,9 +155,11 @@ public:
virtual void drawRenderNode(uirenderer::RenderNode* renderNode) override;
virtual void callDrawGLFunction(Functor* functor,
uirenderer::GlFunctorLifecycleListener* listener) override;
+ virtual void drawPicture(const SkPicture& picture) override;
protected:
SkiaCanvas();
+ SkCanvas* asSkCanvas() { return mCanvas; }
void reset(SkCanvas* skiaCanvas);
void drawDrawable(SkDrawable* drawable) { mCanvas->drawDrawable(drawable); }
@@ -206,6 +210,35 @@ protected:
*/
PaintCoW&& filterPaint(PaintCoW&& paint) const;
+ template <typename Proc> void apply_looper(const Paint* paint, Proc proc) {
+ SkPaint skp;
+ SkDrawLooper* looper = nullptr;
+ if (paint) {
+ skp = *filterPaint(paint);
+ looper = paint->getLooper();
+ }
+ if (looper) {
+ SkSTArenaAlloc<256> alloc;
+ SkDrawLooper::Context* ctx = looper->makeContext(&alloc);
+ if (ctx) {
+ SkDrawLooper::Context::Info info;
+ for (;;) {
+ SkPaint p = skp;
+ if (!ctx->next(&info, &p)) {
+ break;
+ }
+ mCanvas->save();
+ mCanvas->translate(info.fTranslate.fX, info.fTranslate.fY);
+ proc(p);
+ mCanvas->restore();
+ }
+ }
+ } else {
+ proc(skp);
+ }
+ }
+
+
private:
struct SaveRec {
int saveCount;
@@ -220,17 +253,7 @@ private:
void recordClip(const T&, SkClipOp);
void applyPersistentClips(size_t clipStartIndex);
- void drawPoints(const float* points, int count, const SkPaint& paint, SkCanvas::PointMode mode);
-
- /** Filters the paint for bitmap drawing.
- *
- * After filtering the paint for bitmap drawing,
- * also calls filterPaint on the paint.
- *
- * @param paint the paint to filter. Will be initialized with the default
- * SkPaint before filtering if filtering is required.
- */
- PaintCoW&& filterBitmap(PaintCoW&& paint, sk_sp<SkColorFilter> colorSpaceFilter) const;
+ void drawPoints(const float* points, int count, const Paint& paint, SkCanvas::PointMode mode);
class Clip;
diff --git a/libs/hwui/TEST_MAPPING b/libs/hwui/TEST_MAPPING
index d9f2acbb49d2..b1719a979ce5 100644
--- a/libs/hwui/TEST_MAPPING
+++ b/libs/hwui/TEST_MAPPING
@@ -1,13 +1,15 @@
{
"presubmit": [
{
- "name": "CtsUiRenderingTestCases"
- },
- {
"name": "CtsGraphicsTestCases"
},
{
"name": "CtsAccelerationTestCases"
}
+ ],
+ "imports": [
+ {
+ "path": "cts/tests/tests/uirendering"
+ }
]
} \ No newline at end of file
diff --git a/libs/hwui/TreeInfo.h b/libs/hwui/TreeInfo.h
index 7e8d12fd4597..f2481f83767d 100644
--- a/libs/hwui/TreeInfo.h
+++ b/libs/hwui/TreeInfo.h
@@ -40,7 +40,6 @@ class ErrorHandler {
public:
virtual void onError(const std::string& message) = 0;
-protected:
virtual ~ErrorHandler() = default;
};
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp
index 5418b337c371..61403aa93c97 100644
--- a/libs/hwui/VectorDrawable.cpp
+++ b/libs/hwui/VectorDrawable.cpp
@@ -16,18 +16,24 @@
#include "VectorDrawable.h"
+#include <math.h>
+#include <string.h>
#include <utils/Log.h>
+
#include "PathParser.h"
#include "SkColorFilter.h"
#include "SkImageInfo.h"
#include "SkShader.h"
+#include "hwui/Paint.h"
+
+#ifdef __ANDROID__
+#include "renderthread/RenderThread.h"
+#endif
+
#include "utils/Macros.h"
#include "utils/TraceUtils.h"
#include "utils/VectorDrawableUtils.h"
-#include <math.h>
-#include <string.h>
-
namespace android {
namespace uirenderer {
namespace VectorDrawable {
@@ -458,8 +464,12 @@ void Tree::drawStaging(Canvas* outCanvas) {
mStagingCache.dirty = false;
}
- SkPaint paint;
- getPaintFor(&paint, mStagingProperties);
+ SkPaint skp;
+ getPaintFor(&skp, mStagingProperties);
+ Paint paint;
+ paint.setFilterQuality(skp.getFilterQuality());
+ paint.setColorFilter(skp.refColorFilter());
+ paint.setAlpha(skp.getAlpha());
outCanvas->drawBitmap(*mStagingCache.bitmap, 0, 0, mStagingCache.bitmap->width(),
mStagingCache.bitmap->height(), mStagingProperties.getBounds().left(),
mStagingProperties.getBounds().top(),
@@ -467,7 +477,7 @@ void Tree::drawStaging(Canvas* outCanvas) {
mStagingProperties.getBounds().bottom(), &paint);
}
-void Tree::getPaintFor(SkPaint* outPaint, const TreeProperties &prop) const {
+void Tree::getPaintFor(SkPaint* outPaint, const TreeProperties& prop) const {
// HWUI always draws VD with bilinear filtering.
outPaint->setFilterQuality(kLow_SkFilterQuality);
if (prop.getColorFilter() != nullptr) {
@@ -487,6 +497,7 @@ Bitmap& Tree::getBitmapUpdateIfDirty() {
}
void Tree::updateCache(sp<skiapipeline::VectorDrawableAtlas>& atlas, GrContext* context) {
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
SkRect dst;
sk_sp<SkSurface> surface = mCache.getSurface(&dst);
bool canReuseSurface = surface && dst.width() >= mProperties.getScaledWidth() &&
@@ -514,6 +525,7 @@ void Tree::updateCache(sp<skiapipeline::VectorDrawableAtlas>& atlas, GrContext*
}
mCache.dirty = false;
}
+#endif
}
void Tree::Cache::setAtlas(sp<skiapipeline::VectorDrawableAtlas> newAtlas,
@@ -526,6 +538,7 @@ void Tree::Cache::setAtlas(sp<skiapipeline::VectorDrawableAtlas> newAtlas,
sk_sp<SkSurface> Tree::Cache::getSurface(SkRect* bounds) {
sk_sp<SkSurface> surface;
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
sp<skiapipeline::VectorDrawableAtlas> atlas = mAtlas.promote();
if (atlas.get() && mAtlasKey != INVALID_ATLAS_KEY) {
auto atlasEntry = atlas->getEntry(mAtlasKey);
@@ -533,17 +546,35 @@ sk_sp<SkSurface> Tree::Cache::getSurface(SkRect* bounds) {
surface = atlasEntry.surface;
mAtlasKey = atlasEntry.key;
}
+#endif
return surface;
}
void Tree::Cache::clear() {
- sp<skiapipeline::VectorDrawableAtlas> lockAtlas = mAtlas.promote();
- if (lockAtlas.get()) {
- lockAtlas->releaseEntry(mAtlasKey);
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
+ if (mAtlasKey != INVALID_ATLAS_KEY) {
+ if (renderthread::RenderThread::isCurrent()) {
+ sp<skiapipeline::VectorDrawableAtlas> lockAtlas = mAtlas.promote();
+ if (lockAtlas.get()) {
+ lockAtlas->releaseEntry(mAtlasKey);
+ }
+ } else {
+ // VectorDrawableAtlas can be accessed only on RenderThread.
+ // Use by-copy capture of the current Cache variables, because "this" may not be valid
+ // by the time the lambda is evaluated on RenderThread.
+ renderthread::RenderThread::getInstance().queue().post(
+ [atlas = mAtlas, atlasKey = mAtlasKey]() {
+ sp<skiapipeline::VectorDrawableAtlas> lockAtlas = atlas.promote();
+ if (lockAtlas.get()) {
+ lockAtlas->releaseEntry(atlasKey);
+ }
+ });
+ }
+ mAtlasKey = INVALID_ATLAS_KEY;
}
mAtlas = nullptr;
- mAtlasKey = INVALID_ATLAS_KEY;
+#endif
}
void Tree::draw(SkCanvas* canvas, const SkRect& bounds, const SkPaint& inPaint) {
diff --git a/libs/hwui/WebViewFunctorManager.h b/libs/hwui/WebViewFunctorManager.h
index 2846cb1f087b..675b738c6406 100644
--- a/libs/hwui/WebViewFunctorManager.h
+++ b/libs/hwui/WebViewFunctorManager.h
@@ -17,7 +17,11 @@
#pragma once
#include <private/hwui/WebViewFunctor.h>
+#ifdef __ANDROID__ // Layoutlib does not support render thread
#include <renderthread/RenderProxy.h>
+#else
+#include <utils/Log.h>
+#endif
#include <utils/LightRefBase.h>
#include <mutex>
@@ -34,7 +38,11 @@ public:
class Handle : public LightRefBase<Handle> {
public:
- ~Handle() { renderthread::RenderProxy::destroyFunctor(id()); }
+ ~Handle() {
+#ifdef __ANDROID__ // Layoutlib does not support render thread
+ renderthread::RenderProxy::destroyFunctor(id());
+#endif
+ }
int id() const { return mReference.id(); }
diff --git a/libs/hwui/debug/FatalBaseDriver.cpp b/libs/hwui/debug/FatalBaseDriver.cpp
deleted file mode 100644
index ed0f8316d208..000000000000
--- a/libs/hwui/debug/FatalBaseDriver.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 "FatalBaseDriver.h"
-
-#include <log/log.h>
-
-namespace android {
-namespace uirenderer {
-namespace debug {
-
-// Generate the proxy
-#define API_ENTRY(x) FatalBaseDriver::x##_
-#define CALL_GL_API(x, ...) LOG_ALWAYS_FATAL("Not Implemented");
-#define CALL_GL_API_RETURN(x, ...) \
- LOG_ALWAYS_FATAL("Not Implemented"); \
- return static_cast<decltype(x(__VA_ARGS__))>(0);
-
-#include "gles_stubs.in"
-
-#undef API_ENTRY
-#undef CALL_GL_API
-#undef CALL_GL_API_RETURN
-
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
diff --git a/libs/hwui/debug/GlesDriver.cpp b/libs/hwui/debug/GlesDriver.cpp
deleted file mode 100644
index 98f06b0cb4f0..000000000000
--- a/libs/hwui/debug/GlesDriver.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 "GlesDriver.h"
-#include "DefaultGlesDriver.h"
-#include "GlesErrorCheckWrapper.h"
-
-namespace android {
-namespace uirenderer {
-namespace debug {
-
-static DefaultGlesDriver sDefaultDriver;
-
-static std::unique_ptr<GlesDriver> sGlesDriver(new GlesErrorCheckWrapper(sDefaultDriver));
-
-GlesDriver* GlesDriver::get() {
- return sGlesDriver.get();
-}
-
-std::unique_ptr<GlesDriver> GlesDriver::replace(std::unique_ptr<GlesDriver>&& driver) {
- std::unique_ptr<GlesDriver> ret = std::move(sGlesDriver);
- sGlesDriver = std::move(driver);
- return ret;
-}
-
-sk_sp<const GrGLInterface> GlesDriver::getSkiaInterface() {
- sk_sp<const GrGLInterface> skiaInterface(GrGLCreateNativeInterface());
- return skiaInterface;
-}
-
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
diff --git a/libs/hwui/debug/GlesDriver.h b/libs/hwui/debug/GlesDriver.h
deleted file mode 100644
index 1c77c1a45b82..000000000000
--- a/libs/hwui/debug/GlesDriver.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#ifndef HWUI_GLES_WRAP_ENABLED
-#error Wrapping wasn't enabled, can't use this!
-#endif
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#include <GLES3/gl3.h>
-#include <GLES3/gl31.h>
-#include <GLES3/gl32.h>
-
-#include <gl/GrGLInterface.h>
-#include <memory>
-
-namespace android {
-namespace uirenderer {
-namespace debug {
-
-// All the gl methods on GlesDriver have a trailing underscore
-// This is to avoid collision with gles_redefine/gles_undefine
-class GlesDriver {
-public:
- virtual ~GlesDriver() {}
- virtual sk_sp<const GrGLInterface> getSkiaInterface();
-
-#define GL_ENTRY(ret, api, ...) virtual ret api##_(__VA_ARGS__) = 0;
-#include "gles_decls.in"
-#undef GL_ENTRY
-
- static GlesDriver* get();
- static std::unique_ptr<GlesDriver> replace(std::unique_ptr<GlesDriver>&& driver);
-};
-
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
diff --git a/libs/hwui/debug/GlesErrorCheckWrapper.cpp b/libs/hwui/debug/GlesErrorCheckWrapper.cpp
deleted file mode 100644
index 8d11c1905da3..000000000000
--- a/libs/hwui/debug/GlesErrorCheckWrapper.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 "GlesErrorCheckWrapper.h"
-
-#include <log/log.h>
-
-namespace android {
-namespace uirenderer {
-namespace debug {
-
-void GlesErrorCheckWrapper::assertNoErrors(const char* apicall) {
- GLenum status = GL_NO_ERROR;
- GLenum lastError = GL_NO_ERROR;
- const char* lastErrorName = nullptr;
- while ((status = mBase.glGetError_()) != GL_NO_ERROR) {
- lastError = status;
- switch (status) {
- case GL_INVALID_ENUM:
- ALOGE("GL error: GL_INVALID_ENUM");
- lastErrorName = "GL_INVALID_ENUM";
- break;
- case GL_INVALID_VALUE:
- ALOGE("GL error: GL_INVALID_VALUE");
- lastErrorName = "GL_INVALID_VALUE";
- break;
- case GL_INVALID_OPERATION:
- ALOGE("GL error: GL_INVALID_OPERATION");
- lastErrorName = "GL_INVALID_OPERATION";
- break;
- case GL_OUT_OF_MEMORY:
- ALOGE("GL error: Out of memory!");
- lastErrorName = "GL_OUT_OF_MEMORY";
- break;
- default:
- ALOGE("GL error: 0x%x", status);
- lastErrorName = "UNKNOWN";
- }
- }
- LOG_ALWAYS_FATAL_IF(lastError != GL_NO_ERROR, "%s error! %s (0x%x)", apicall, lastErrorName,
- lastError);
-}
-
-#define API_ENTRY(x) GlesErrorCheckWrapper::x##_
-#define CALL_GL_API(x, ...) \
- mBase.x##_(__VA_ARGS__); \
- assertNoErrors(#x)
-
-#define CALL_GL_API_RETURN(x, ...) \
- auto ret = mBase.x##_(__VA_ARGS__); \
- assertNoErrors(#x); \
- return ret
-
-#include "gles_stubs.in"
-
-#undef API_ENTRY
-#undef CALL_GL_API
-#undef CALL_GL_API_RETURN
-
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
diff --git a/libs/hwui/debug/NullGlesDriver.cpp b/libs/hwui/debug/NullGlesDriver.cpp
deleted file mode 100644
index 212b24290e22..000000000000
--- a/libs/hwui/debug/NullGlesDriver.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 <debug/NullGlesDriver.h>
-
-namespace android {
-namespace uirenderer {
-namespace debug {
-
-sk_sp<const GrGLInterface> NullGlesDriver::getSkiaInterface() {
- sk_sp<const GrGLInterface> skiaInterface(GrGLCreateNullInterface());
- return skiaInterface;
-}
-
-struct {
- GLboolean scissorEnabled;
-} gState;
-
-static void nullglGenCommon(GLsizei n, GLuint* buffers) {
- static GLuint nextId = 0;
- int i;
- for (i = 0; i < n; i++) {
- buffers[i] = ++nextId;
- }
-}
-
-void NullGlesDriver::glGenBuffers_(GLsizei n, GLuint* buffers) {
- nullglGenCommon(n, buffers);
-}
-
-void NullGlesDriver::glGenFramebuffers_(GLsizei n, GLuint* framebuffers) {
- nullglGenCommon(n, framebuffers);
-}
-
-void NullGlesDriver::glGenRenderbuffers_(GLsizei n, GLuint* renderbuffers) {
- nullglGenCommon(n, renderbuffers);
-}
-
-void NullGlesDriver::glGenTextures_(GLsizei n, GLuint* textures) {
- nullglGenCommon(n, textures);
-}
-
-GLuint NullGlesDriver::glCreateProgram_(void) {
- static GLuint nextProgram = 0;
- return ++nextProgram;
-}
-
-GLuint NullGlesDriver::glCreateShader_(GLenum type) {
- static GLuint nextShader = 0;
- return ++nextShader;
-}
-
-void NullGlesDriver::glGetProgramiv_(GLuint program, GLenum pname, GLint* params) {
- switch (pname) {
- case GL_DELETE_STATUS:
- case GL_LINK_STATUS:
- case GL_VALIDATE_STATUS:
- *params = GL_TRUE;
- break;
- case GL_INFO_LOG_LENGTH:
- *params = 16;
- break;
- }
-}
-
-void NullGlesDriver::glGetProgramInfoLog_(GLuint program, GLsizei bufSize, GLsizei* length,
- GLchar* infoLog) {
- *length = snprintf(infoLog, bufSize, "success");
- if (*length >= bufSize) {
- *length = bufSize - 1;
- }
-}
-
-void NullGlesDriver::glGetShaderiv_(GLuint shader, GLenum pname, GLint* params) {
- switch (pname) {
- case GL_COMPILE_STATUS:
- case GL_DELETE_STATUS:
- *params = GL_TRUE;
- }
-}
-
-void NullGlesDriver::glGetShaderInfoLog_(GLuint shader, GLsizei bufSize, GLsizei* length,
- GLchar* infoLog) {
- *length = snprintf(infoLog, bufSize, "success");
- if (*length >= bufSize) {
- *length = bufSize - 1;
- }
-}
-
-void setBooleanState(GLenum cap, GLboolean value) {
- switch (cap) {
- case GL_SCISSOR_TEST:
- gState.scissorEnabled = value;
- break;
- }
-}
-
-void NullGlesDriver::glEnable_(GLenum cap) {
- setBooleanState(cap, GL_TRUE);
-}
-
-void NullGlesDriver::glDisable_(GLenum cap) {
- setBooleanState(cap, GL_FALSE);
-}
-
-GLboolean NullGlesDriver::glIsEnabled_(GLenum cap) {
- switch (cap) {
- case GL_SCISSOR_TEST:
- return gState.scissorEnabled;
- default:
- return GL_FALSE;
- }
-}
-
-void NullGlesDriver::glGetIntegerv_(GLenum pname, GLint* data) {
- switch (pname) {
- case GL_MAX_TEXTURE_SIZE:
- *data = 2048;
- break;
- case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
- *data = 4;
- break;
- default:
- *data = 0;
- }
-}
-
-GLenum NullGlesDriver::glCheckFramebufferStatus_(GLenum target) {
- switch (target) {
- case GL_FRAMEBUFFER:
- return GL_FRAMEBUFFER_COMPLETE;
- default:
- return 0; // error case
- }
-}
-
-static const char* getString(GLenum name) {
- switch (name) {
- case GL_VENDOR:
- return "android";
- case GL_RENDERER:
- return "null";
- case GL_VERSION:
- return "OpenGL ES 2.0 rev1";
- case GL_SHADING_LANGUAGE_VERSION:
- return "OpenGL ES GLSL ES 2.0 rev1";
- case GL_EXTENSIONS:
- default:
- return "";
- }
-}
-
-const GLubyte* NullGlesDriver::glGetString_(GLenum name) {
- return (GLubyte*)getString(name);
-}
-
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
diff --git a/libs/hwui/debug/NullGlesDriver.h b/libs/hwui/debug/NullGlesDriver.h
deleted file mode 100644
index 1a27dbc35299..000000000000
--- a/libs/hwui/debug/NullGlesDriver.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "FatalBaseDriver.h"
-
-namespace android {
-namespace uirenderer {
-namespace debug {
-
-class NullGlesDriver : public FatalBaseDriver {
-public:
- virtual sk_sp<const GrGLInterface> getSkiaInterface() override;
-
- virtual void glGenBuffers_(GLsizei n, GLuint* buffers) override;
- virtual void glGenFramebuffers_(GLsizei n, GLuint* framebuffers) override;
- virtual void glGenRenderbuffers_(GLsizei n, GLuint* renderbuffers) override;
- virtual void glGenTextures_(GLsizei n, GLuint* textures) override;
- virtual GLuint glCreateProgram_(void) override;
- virtual GLuint glCreateShader_(GLenum type) override;
- virtual void glGetProgramiv_(GLuint program, GLenum pname, GLint* params) override;
- virtual void glGetProgramInfoLog_(GLuint program, GLsizei bufSize, GLsizei* length,
- GLchar* infoLog) override;
- virtual void glGetShaderiv_(GLuint shader, GLenum pname, GLint* params) override;
- virtual void glGetShaderInfoLog_(GLuint shader, GLsizei bufSize, GLsizei* length,
- GLchar* infoLog) override;
- virtual void glEnable_(GLenum cap) override;
- virtual void glDisable_(GLenum cap) override;
- virtual GLboolean glIsEnabled_(GLenum cap) override;
- virtual void glGetIntegerv_(GLenum pname, GLint* data) override;
- virtual const GLubyte* glGetString_(GLenum name) override;
- virtual GLenum glCheckFramebufferStatus_(GLenum target) override;
-
- virtual void glActiveTexture_(GLenum texture) override {}
- virtual void glAttachShader_(GLuint program, GLuint shader) override {}
- virtual void glBindAttribLocation_(GLuint program, GLuint index, const GLchar* name) override {}
- virtual void glBindBuffer_(GLenum target, GLuint buffer) override {}
- virtual void glBindFramebuffer_(GLenum target, GLuint framebuffer) override {}
- virtual void glBindRenderbuffer_(GLenum target, GLuint renderbuffer) override {}
- virtual void glBindTexture_(GLenum target, GLuint texture) override {}
- virtual void glBlendColor_(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) override {}
- virtual void glBlendEquation_(GLenum mode) override {}
- virtual void glBlendEquationSeparate_(GLenum modeRGB, GLenum modeAlpha) override {}
- virtual void glBlendFunc_(GLenum sfactor, GLenum dfactor) override {}
- virtual void glBlendFuncSeparate_(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha,
- GLenum dfactorAlpha) override {}
- virtual void glBufferData_(GLenum target, GLsizeiptr size, const void* data,
- GLenum usage) override {}
- virtual void glBufferSubData_(GLenum target, GLintptr offset, GLsizeiptr size,
- const void* data) override {}
- virtual void glClear_(GLbitfield mask) override {}
- virtual void glClearColor_(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) override {}
- virtual void glClearDepthf_(GLfloat d) override {}
- virtual void glClearStencil_(GLint s) override {}
- virtual void glColorMask_(GLboolean red, GLboolean green, GLboolean blue,
- GLboolean alpha) override {}
- virtual void glCompileShader_(GLuint shader) override {}
- virtual void glCompressedTexImage2D_(GLenum target, GLint level, GLenum internalformat,
- GLsizei width, GLsizei height, GLint border,
- GLsizei imageSize, const void* data) override {}
- virtual void glCompressedTexSubImage2D_(GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height,
- GLenum format, GLsizei imageSize,
- const void* data) override {}
- virtual void glCopyTexImage2D_(GLenum target, GLint level, GLenum internalformat, GLint x,
- GLint y, GLsizei width, GLsizei height, GLint border) override {}
- virtual void glCopyTexSubImage2D_(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height) override {}
- virtual void glCullFace_(GLenum mode) override {}
- virtual void glDeleteBuffers_(GLsizei n, const GLuint* buffers) override {}
- virtual void glDeleteFramebuffers_(GLsizei n, const GLuint* framebuffers) override {}
- virtual void glDeleteProgram_(GLuint program) override {}
- virtual void glDeleteRenderbuffers_(GLsizei n, const GLuint* renderbuffers) override {}
- virtual void glDeleteShader_(GLuint shader) override {}
- virtual void glDeleteTextures_(GLsizei n, const GLuint* textures) override {}
- virtual void glDepthFunc_(GLenum func) override {}
- virtual void glDepthMask_(GLboolean flag) override {}
- virtual void glDepthRangef_(GLfloat n, GLfloat f) override {}
- virtual void glDetachShader_(GLuint program, GLuint shader) override {}
- virtual void glDisableVertexAttribArray_(GLuint index) override {}
- virtual void glDrawArrays_(GLenum mode, GLint first, GLsizei count) override {}
- virtual void glDrawElements_(GLenum mode, GLsizei count, GLenum type,
- const void* indices) override {}
- virtual void glEnableVertexAttribArray_(GLuint index) override {}
- virtual void glFinish_(void) override {}
- virtual void glFlush_(void) override {}
- virtual void glFramebufferRenderbuffer_(GLenum target, GLenum attachment,
- GLenum renderbuffertarget,
- GLuint renderbuffer) override {}
- virtual void glFramebufferTexture2D_(GLenum target, GLenum attachment, GLenum textarget,
- GLuint texture, GLint level) override {}
- virtual void glFrontFace_(GLenum mode) override {}
- virtual void glGenerateMipmap_(GLenum target) override {}
- virtual GLint glGetAttribLocation_(GLuint program, const GLchar* name) override { return 1; }
- virtual GLenum glGetError_(void) override { return GL_NO_ERROR; }
- virtual GLint glGetUniformLocation_(GLuint program, const GLchar* name) override { return 2; }
- virtual void glHint_(GLenum target, GLenum mode) override {}
- virtual void glLineWidth_(GLfloat width) override {}
- virtual void glLinkProgram_(GLuint program) override {}
- virtual void glPixelStorei_(GLenum pname, GLint param) override {}
- virtual void glPolygonOffset_(GLfloat factor, GLfloat units) override {}
- virtual void glReadPixels_(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
- GLenum type, void* pixels) override {}
- virtual void glReleaseShaderCompiler_(void) override {}
- virtual void glRenderbufferStorage_(GLenum target, GLenum internalformat, GLsizei width,
- GLsizei height) override {}
- virtual void glSampleCoverage_(GLfloat value, GLboolean invert) override {}
- virtual void glScissor_(GLint x, GLint y, GLsizei width, GLsizei height) override {}
- virtual void glShaderBinary_(GLsizei count, const GLuint* shaders, GLenum binaryformat,
- const void* binary, GLsizei length) override {}
- virtual void glShaderSource_(GLuint shader, GLsizei count, const GLchar* const* string,
- const GLint* length) override {}
- virtual void glStencilFunc_(GLenum func, GLint ref, GLuint mask) override {}
- virtual void glStencilFuncSeparate_(GLenum face, GLenum func, GLint ref, GLuint mask) override {
- }
- virtual void glStencilMask_(GLuint mask) override {}
- virtual void glStencilMaskSeparate_(GLenum face, GLuint mask) override {}
- virtual void glStencilOp_(GLenum fail, GLenum zfail, GLenum zpass) override {}
- virtual void glStencilOpSeparate_(GLenum face, GLenum sfail, GLenum dpfail,
- GLenum dppass) override {}
- virtual void glTexImage2D_(GLenum target, GLint level, GLint internalformat, GLsizei width,
- GLsizei height, GLint border, GLenum format, GLenum type,
- const void* pixels) override {}
- virtual void glTexParameterf_(GLenum target, GLenum pname, GLfloat param) override {}
- virtual void glTexParameterfv_(GLenum target, GLenum pname, const GLfloat* params) override {}
- virtual void glTexParameteri_(GLenum target, GLenum pname, GLint param) override {}
- virtual void glTexParameteriv_(GLenum target, GLenum pname, const GLint* params) override {}
- virtual void glTexSubImage2D_(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height, GLenum format, GLenum type,
- const void* pixels) override {}
- virtual void glUniform1f_(GLint location, GLfloat v0) override {}
- virtual void glUniform1fv_(GLint location, GLsizei count, const GLfloat* value) override {}
- virtual void glUniform1i_(GLint location, GLint v0) override {}
- virtual void glUniform1iv_(GLint location, GLsizei count, const GLint* value) override {}
- virtual void glUniform2f_(GLint location, GLfloat v0, GLfloat v1) override {}
- virtual void glUniform2fv_(GLint location, GLsizei count, const GLfloat* value) override {}
- virtual void glUniform2i_(GLint location, GLint v0, GLint v1) override {}
- virtual void glUniform2iv_(GLint location, GLsizei count, const GLint* value) override {}
- virtual void glUniform3f_(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) override {}
- virtual void glUniform3fv_(GLint location, GLsizei count, const GLfloat* value) override {}
- virtual void glUniform3i_(GLint location, GLint v0, GLint v1, GLint v2) override {}
- virtual void glUniform3iv_(GLint location, GLsizei count, const GLint* value) override {}
- virtual void glUniform4f_(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
- GLfloat v3) override {}
- virtual void glUniform4fv_(GLint location, GLsizei count, const GLfloat* value) override {}
- virtual void glUniform4i_(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) override {}
- virtual void glUniform4iv_(GLint location, GLsizei count, const GLint* value) override {}
- virtual void glUniformMatrix2fv_(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat* value) override {}
- virtual void glUniformMatrix3fv_(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat* value) override {}
- virtual void glUniformMatrix4fv_(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat* value) override {}
- virtual void glUseProgram_(GLuint program) override {}
- virtual void glValidateProgram_(GLuint program) override {}
- virtual void glVertexAttrib1f_(GLuint index, GLfloat x) override {}
- virtual void glVertexAttrib1fv_(GLuint index, const GLfloat* v) override {}
- virtual void glVertexAttrib2f_(GLuint index, GLfloat x, GLfloat y) override {}
- virtual void glVertexAttrib2fv_(GLuint index, const GLfloat* v) override {}
- virtual void glVertexAttrib3f_(GLuint index, GLfloat x, GLfloat y, GLfloat z) override {}
- virtual void glVertexAttrib3fv_(GLuint index, const GLfloat* v) override {}
- virtual void glVertexAttrib4f_(GLuint index, GLfloat x, GLfloat y, GLfloat z,
- GLfloat w) override {}
- virtual void glVertexAttrib4fv_(GLuint index, const GLfloat* v) override {}
- virtual void glVertexAttribPointer_(GLuint index, GLint size, GLenum type, GLboolean normalized,
- GLsizei stride, const void* pointer) override {}
- virtual void glViewport_(GLint x, GLint y, GLsizei width, GLsizei height) override {}
-
- // gles2 ext
- virtual void glInsertEventMarkerEXT_(GLsizei length, const GLchar* marker) override {}
- virtual void glPushGroupMarkerEXT_(GLsizei length, const GLchar* marker) override {}
- virtual void glPopGroupMarkerEXT_(void) override {}
- virtual void glDiscardFramebufferEXT_(GLenum target, GLsizei numAttachments,
- const GLenum* attachments) override {}
- virtual void glEGLImageTargetTexture2DOES_(GLenum target, GLeglImageOES image) override {}
-
- // GLES3
- virtual void* glMapBufferRange_(GLenum target, GLintptr offset, GLsizeiptr length,
- GLbitfield access) override {
- return 0;
- }
-
- virtual GLboolean glUnmapBuffer_(GLenum target) override { return GL_FALSE; }
-};
-
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
diff --git a/libs/hwui/debug/ScopedReplaceDriver.h b/libs/hwui/debug/ScopedReplaceDriver.h
deleted file mode 100644
index 110196fb2a01..000000000000
--- a/libs/hwui/debug/ScopedReplaceDriver.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "GlesDriver.h"
-
-namespace android {
-namespace uirenderer {
-namespace debug {
-
-template <typename Driver>
-class ScopedReplaceDriver {
-public:
- ScopedReplaceDriver() {
- std::unique_ptr<Driver> glDriver = std::make_unique<Driver>();
- mCurrentDriver = glDriver.get();
- mOldDriver = GlesDriver::replace(std::move(glDriver));
- }
-
- Driver& get() { return *mCurrentDriver; }
-
- ~ScopedReplaceDriver() { GlesDriver::replace(std::move(mOldDriver)); }
-
-private:
- std::unique_ptr<GlesDriver> mOldDriver;
- Driver* mCurrentDriver;
-};
-
-} // namespace debug
-} // namespace uirenderer
-} // namespace android
diff --git a/libs/hwui/debug/gles_decls.in b/libs/hwui/debug/gles_decls.in
deleted file mode 100644
index 3900959c29de..000000000000
--- a/libs/hwui/debug/gles_decls.in
+++ /dev/null
@@ -1,543 +0,0 @@
-GL_ENTRY(void, glActiveTexture, GLenum texture)
-GL_ENTRY(void, glAttachShader, GLuint program, GLuint shader)
-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, glBindRenderbuffer, GLenum target, GLuint renderbuffer)
-GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture)
-GL_ENTRY(void, glBlendColor, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-GL_ENTRY(void, glBlendEquation, GLenum mode)
-GL_ENTRY(void, glBlendEquationSeparate, GLenum modeRGB, GLenum modeAlpha)
-GL_ENTRY(void, glBlendFunc, GLenum sfactor, GLenum dfactor)
-GL_ENTRY(void, glBlendFuncSeparate, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
-GL_ENTRY(void, glBufferData, GLenum target, GLsizeiptr size, const void *data, GLenum usage)
-GL_ENTRY(void, glBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, const void *data)
-GL_ENTRY(GLenum, glCheckFramebufferStatus, GLenum target)
-GL_ENTRY(void, glClear, GLbitfield mask)
-GL_ENTRY(void, glClearColor, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-GL_ENTRY(void, glClearDepthf, GLfloat d)
-GL_ENTRY(void, glClearStencil, GLint s)
-GL_ENTRY(void, glColorMask, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-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 void *data)
-GL_ENTRY(void, glCompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *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(GLuint, glCreateProgram, void)
-GL_ENTRY(GLuint, glCreateShader, GLenum type)
-GL_ENTRY(void, glCullFace, GLenum mode)
-GL_ENTRY(void, glDeleteBuffers, GLsizei n, const GLuint *buffers)
-GL_ENTRY(void, glDeleteFramebuffers, GLsizei n, const GLuint *framebuffers)
-GL_ENTRY(void, glDeleteProgram, GLuint program)
-GL_ENTRY(void, glDeleteRenderbuffers, GLsizei n, const GLuint *renderbuffers)
-GL_ENTRY(void, glDeleteShader, GLuint shader)
-GL_ENTRY(void, glDeleteTextures, GLsizei n, const GLuint *textures)
-GL_ENTRY(void, glDepthFunc, GLenum func)
-GL_ENTRY(void, glDepthMask, GLboolean flag)
-GL_ENTRY(void, glDepthRangef, GLfloat n, GLfloat f)
-GL_ENTRY(void, glDetachShader, GLuint program, GLuint shader)
-GL_ENTRY(void, glDisable, GLenum cap)
-GL_ENTRY(void, glDisableVertexAttribArray, GLuint index)
-GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count)
-GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const void *indices)
-GL_ENTRY(void, glEnable, GLenum cap)
-GL_ENTRY(void, glEnableVertexAttribArray, GLuint index)
-GL_ENTRY(void, glFinish, void)
-GL_ENTRY(void, glFlush, void)
-GL_ENTRY(void, glFramebufferRenderbuffer, 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, glFrontFace, GLenum mode)
-GL_ENTRY(void, glGenBuffers, GLsizei n, GLuint *buffers)
-GL_ENTRY(void, glGenerateMipmap, GLenum target)
-GL_ENTRY(void, glGenFramebuffers, GLsizei n, GLuint *framebuffers)
-GL_ENTRY(void, glGenRenderbuffers, GLsizei n, GLuint *renderbuffers)
-GL_ENTRY(void, glGenTextures, GLsizei n, GLuint *textures)
-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(GLint, glGetAttribLocation, GLuint program, const GLchar *name)
-GL_ENTRY(void, glGetBooleanv, GLenum pname, GLboolean *data)
-GL_ENTRY(void, glGetBufferParameteriv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(GLenum, glGetError, void)
-GL_ENTRY(void, glGetFloatv, GLenum pname, GLfloat *data)
-GL_ENTRY(void, glGetFramebufferAttachmentParameteriv, GLenum target, GLenum attachment, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetIntegerv, GLenum pname, GLint *data)
-GL_ENTRY(void, glGetProgramiv, GLuint program, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
-GL_ENTRY(void, glGetRenderbufferParameteriv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetShaderiv, GLuint shader, 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(const GLubyte *, glGetString, GLenum name)
-GL_ENTRY(void, glGetTexParameterfv, GLenum target, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetTexParameteriv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetUniformfv, GLuint program, GLint location, GLfloat *params)
-GL_ENTRY(void, glGetUniformiv, GLuint program, GLint location, GLint *params)
-GL_ENTRY(GLint, glGetUniformLocation, GLuint program, const GLchar *name)
-GL_ENTRY(void, glGetVertexAttribfv, GLuint index, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetVertexAttribiv, GLuint index, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, void **pointer)
-GL_ENTRY(void, glHint, GLenum target, GLenum mode)
-GL_ENTRY(GLboolean, glIsBuffer, GLuint buffer)
-GL_ENTRY(GLboolean, glIsEnabled, GLenum cap)
-GL_ENTRY(GLboolean, glIsFramebuffer, GLuint framebuffer)
-GL_ENTRY(GLboolean, glIsProgram, GLuint program)
-GL_ENTRY(GLboolean, glIsRenderbuffer, GLuint renderbuffer)
-GL_ENTRY(GLboolean, glIsShader, GLuint shader)
-GL_ENTRY(GLboolean, glIsTexture, GLuint texture)
-GL_ENTRY(void, glLineWidth, GLfloat width)
-GL_ENTRY(void, glLinkProgram, GLuint program)
-GL_ENTRY(void, glPixelStorei, GLenum pname, GLint param)
-GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units)
-GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels)
-GL_ENTRY(void, glReleaseShaderCompiler, void)
-GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glSampleCoverage, GLfloat value, GLboolean invert)
-GL_ENTRY(void, glScissor, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glShaderBinary, GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length)
-GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length)
-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 sfail, GLenum dpfail, GLenum dppass)
-GL_ENTRY(void, glTexImage2D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *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, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels)
-GL_ENTRY(void, glUniform1f, GLint location, GLfloat v0)
-GL_ENTRY(void, glUniform1fv, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glUniform1i, GLint location, GLint v0)
-GL_ENTRY(void, glUniform1iv, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glUniform2f, GLint location, GLfloat v0, GLfloat v1)
-GL_ENTRY(void, glUniform2fv, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glUniform2i, GLint location, GLint v0, GLint v1)
-GL_ENTRY(void, glUniform2iv, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glUniform3f, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
-GL_ENTRY(void, glUniform3fv, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glUniform3i, GLint location, GLint v0, GLint v1, GLint v2)
-GL_ENTRY(void, glUniform3iv, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glUniform4f, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
-GL_ENTRY(void, glUniform4fv, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glUniform4i, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
-GL_ENTRY(void, glUniform4iv, GLint location, GLsizei count, const GLint *value)
-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(void, glUseProgram, GLuint program)
-GL_ENTRY(void, glValidateProgram, GLuint program)
-GL_ENTRY(void, glVertexAttrib1f, GLuint index, GLfloat x)
-GL_ENTRY(void, glVertexAttrib1fv, GLuint index, const GLfloat *v)
-GL_ENTRY(void, glVertexAttrib2f, GLuint index, GLfloat x, GLfloat y)
-GL_ENTRY(void, glVertexAttrib2fv, GLuint index, const GLfloat *v)
-GL_ENTRY(void, glVertexAttrib3f, GLuint index, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glVertexAttrib3fv, GLuint index, const GLfloat *v)
-GL_ENTRY(void, glVertexAttrib4f, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-GL_ENTRY(void, glVertexAttrib4fv, GLuint index, const GLfloat *v)
-GL_ENTRY(void, glVertexAttribPointer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer)
-GL_ENTRY(void, glViewport, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glReadBuffer, GLenum src)
-GL_ENTRY(void, glDrawRangeElements, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices)
-GL_ENTRY(void, glTexImage3D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels)
-GL_ENTRY(void, glTexSubImage3D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels)
-GL_ENTRY(void, glCopyTexSubImage3D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glCompressedTexImage3D, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data)
-GL_ENTRY(void, glCompressedTexSubImage3D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data)
-GL_ENTRY(void, glGenQueries, GLsizei n, GLuint *ids)
-GL_ENTRY(void, glDeleteQueries, GLsizei n, const GLuint *ids)
-GL_ENTRY(GLboolean, glIsQuery, GLuint id)
-GL_ENTRY(void, glBeginQuery, GLenum target, GLuint id)
-GL_ENTRY(void, glEndQuery, GLenum target)
-GL_ENTRY(void, glGetQueryiv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetQueryObjectuiv, GLuint id, GLenum pname, GLuint *params)
-GL_ENTRY(GLboolean, glUnmapBuffer, GLenum target)
-GL_ENTRY(void, glGetBufferPointerv, GLenum target, GLenum pname, void **params)
-GL_ENTRY(void, glDrawBuffers, GLsizei n, const GLenum *bufs)
-GL_ENTRY(void, glUniformMatrix2x3fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glUniformMatrix3x2fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glUniformMatrix2x4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glUniformMatrix4x2fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glUniformMatrix3x4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glUniformMatrix4x3fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glBlitFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
-GL_ENTRY(void, glRenderbufferStorageMultisample, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glFramebufferTextureLayer, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
-GL_ENTRY(void *, glMapBufferRange, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
-GL_ENTRY(void, glFlushMappedBufferRange, GLenum target, GLintptr offset, GLsizeiptr length)
-GL_ENTRY(void, glBindVertexArray, GLuint array)
-GL_ENTRY(void, glDeleteVertexArrays, GLsizei n, const GLuint *arrays)
-GL_ENTRY(void, glGenVertexArrays, GLsizei n, GLuint *arrays)
-GL_ENTRY(GLboolean, glIsVertexArray, GLuint array)
-GL_ENTRY(void, glGetIntegeri_v, GLenum target, GLuint index, GLint *data)
-GL_ENTRY(void, glBeginTransformFeedback, GLenum primitiveMode)
-GL_ENTRY(void, glEndTransformFeedback, void)
-GL_ENTRY(void, glBindBufferRange, GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
-GL_ENTRY(void, glBindBufferBase, GLenum target, GLuint index, GLuint buffer)
-GL_ENTRY(void, glTransformFeedbackVaryings, GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode)
-GL_ENTRY(void, glGetTransformFeedbackVarying, GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)
-GL_ENTRY(void, glVertexAttribIPointer, GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer)
-GL_ENTRY(void, glGetVertexAttribIiv, GLuint index, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetVertexAttribIuiv, GLuint index, GLenum pname, GLuint *params)
-GL_ENTRY(void, glVertexAttribI4i, GLuint index, GLint x, GLint y, GLint z, GLint w)
-GL_ENTRY(void, glVertexAttribI4ui, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
-GL_ENTRY(void, glVertexAttribI4iv, GLuint index, const GLint *v)
-GL_ENTRY(void, glVertexAttribI4uiv, GLuint index, const GLuint *v)
-GL_ENTRY(void, glGetUniformuiv, GLuint program, GLint location, GLuint *params)
-GL_ENTRY(GLint, glGetFragDataLocation, GLuint program, const GLchar *name)
-GL_ENTRY(void, glUniform1ui, GLint location, GLuint v0)
-GL_ENTRY(void, glUniform2ui, GLint location, GLuint v0, GLuint v1)
-GL_ENTRY(void, glUniform3ui, GLint location, GLuint v0, GLuint v1, GLuint v2)
-GL_ENTRY(void, glUniform4ui, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-GL_ENTRY(void, glUniform1uiv, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glUniform2uiv, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glUniform3uiv, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glUniform4uiv, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glClearBufferiv, GLenum buffer, GLint drawbuffer, const GLint *value)
-GL_ENTRY(void, glClearBufferuiv, GLenum buffer, GLint drawbuffer, const GLuint *value)
-GL_ENTRY(void, glClearBufferfv, GLenum buffer, GLint drawbuffer, const GLfloat *value)
-GL_ENTRY(void, glClearBufferfi, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
-GL_ENTRY(const GLubyte *, glGetStringi, GLenum name, GLuint index)
-GL_ENTRY(void, glCopyBufferSubData, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
-GL_ENTRY(void, glGetUniformIndices, GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices)
-GL_ENTRY(void, glGetActiveUniformsiv, GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params)
-GL_ENTRY(GLuint, glGetUniformBlockIndex, GLuint program, const GLchar *uniformBlockName)
-GL_ENTRY(void, glGetActiveUniformBlockiv, GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetActiveUniformBlockName, GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName)
-GL_ENTRY(void, glUniformBlockBinding, GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
-GL_ENTRY(void, glDrawArraysInstanced, GLenum mode, GLint first, GLsizei count, GLsizei instancecount)
-GL_ENTRY(void, glDrawElementsInstanced, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount)
-GL_ENTRY(GLsync, glFenceSync, GLenum condition, GLbitfield flags)
-GL_ENTRY(GLboolean, glIsSync, GLsync sync)
-GL_ENTRY(void, glDeleteSync, GLsync sync)
-GL_ENTRY(GLenum, glClientWaitSync, GLsync sync, GLbitfield flags, GLuint64 timeout)
-GL_ENTRY(void, glWaitSync, GLsync sync, GLbitfield flags, GLuint64 timeout)
-GL_ENTRY(void, glGetInteger64v, GLenum pname, GLint64 *data)
-GL_ENTRY(void, glGetSynciv, GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
-GL_ENTRY(void, glGetInteger64i_v, GLenum target, GLuint index, GLint64 *data)
-GL_ENTRY(void, glGetBufferParameteri64v, GLenum target, GLenum pname, GLint64 *params)
-GL_ENTRY(void, glGenSamplers, GLsizei count, GLuint *samplers)
-GL_ENTRY(void, glDeleteSamplers, GLsizei count, const GLuint *samplers)
-GL_ENTRY(GLboolean, glIsSampler, GLuint sampler)
-GL_ENTRY(void, glBindSampler, GLuint unit, GLuint sampler)
-GL_ENTRY(void, glSamplerParameteri, GLuint sampler, GLenum pname, GLint param)
-GL_ENTRY(void, glSamplerParameteriv, GLuint sampler, GLenum pname, const GLint *param)
-GL_ENTRY(void, glSamplerParameterf, GLuint sampler, GLenum pname, GLfloat param)
-GL_ENTRY(void, glSamplerParameterfv, GLuint sampler, GLenum pname, const GLfloat *param)
-GL_ENTRY(void, glGetSamplerParameteriv, GLuint sampler, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetSamplerParameterfv, GLuint sampler, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glVertexAttribDivisor, GLuint index, GLuint divisor)
-GL_ENTRY(void, glBindTransformFeedback, GLenum target, GLuint id)
-GL_ENTRY(void, glDeleteTransformFeedbacks, GLsizei n, const GLuint *ids)
-GL_ENTRY(void, glGenTransformFeedbacks, GLsizei n, GLuint *ids)
-GL_ENTRY(GLboolean, glIsTransformFeedback, GLuint id)
-GL_ENTRY(void, glPauseTransformFeedback, void)
-GL_ENTRY(void, glResumeTransformFeedback, void)
-GL_ENTRY(void, glGetProgramBinary, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary)
-GL_ENTRY(void, glProgramBinary, GLuint program, GLenum binaryFormat, const void *binary, GLsizei length)
-GL_ENTRY(void, glProgramParameteri, GLuint program, GLenum pname, GLint value)
-GL_ENTRY(void, glInvalidateFramebuffer, GLenum target, GLsizei numAttachments, const GLenum *attachments)
-GL_ENTRY(void, glInvalidateSubFramebuffer, GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glTexStorage2D, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glTexStorage3D, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
-GL_ENTRY(void, glGetInternalformativ, GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params)
-GL_ENTRY(void, glDispatchCompute, GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
-GL_ENTRY(void, glDispatchComputeIndirect, GLintptr indirect)
-GL_ENTRY(void, glDrawArraysIndirect, GLenum mode, const void *indirect)
-GL_ENTRY(void, glDrawElementsIndirect, GLenum mode, GLenum type, const void *indirect)
-GL_ENTRY(void, glFramebufferParameteri, GLenum target, GLenum pname, GLint param)
-GL_ENTRY(void, glGetFramebufferParameteriv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetProgramInterfaceiv, GLuint program, GLenum programInterface, GLenum pname, GLint *params)
-GL_ENTRY(GLuint, glGetProgramResourceIndex, GLuint program, GLenum programInterface, const GLchar *name)
-GL_ENTRY(void, glGetProgramResourceName, GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name)
-GL_ENTRY(void, glGetProgramResourceiv, GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params)
-GL_ENTRY(GLint, glGetProgramResourceLocation, GLuint program, GLenum programInterface, const GLchar *name)
-GL_ENTRY(void, glUseProgramStages, GLuint pipeline, GLbitfield stages, GLuint program)
-GL_ENTRY(void, glActiveShaderProgram, GLuint pipeline, GLuint program)
-GL_ENTRY(GLuint, glCreateShaderProgramv, GLenum type, GLsizei count, const GLchar *const*strings)
-GL_ENTRY(void, glBindProgramPipeline, GLuint pipeline)
-GL_ENTRY(void, glDeleteProgramPipelines, GLsizei n, const GLuint *pipelines)
-GL_ENTRY(void, glGenProgramPipelines, GLsizei n, GLuint *pipelines)
-GL_ENTRY(GLboolean, glIsProgramPipeline, GLuint pipeline)
-GL_ENTRY(void, glGetProgramPipelineiv, GLuint pipeline, GLenum pname, GLint *params)
-GL_ENTRY(void, glProgramUniform1i, GLuint program, GLint location, GLint v0)
-GL_ENTRY(void, glProgramUniform2i, GLuint program, GLint location, GLint v0, GLint v1)
-GL_ENTRY(void, glProgramUniform3i, GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
-GL_ENTRY(void, glProgramUniform4i, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
-GL_ENTRY(void, glProgramUniform1ui, GLuint program, GLint location, GLuint v0)
-GL_ENTRY(void, glProgramUniform2ui, GLuint program, GLint location, GLuint v0, GLuint v1)
-GL_ENTRY(void, glProgramUniform3ui, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
-GL_ENTRY(void, glProgramUniform4ui, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-GL_ENTRY(void, glProgramUniform1f, GLuint program, GLint location, GLfloat v0)
-GL_ENTRY(void, glProgramUniform2f, GLuint program, GLint location, GLfloat v0, GLfloat v1)
-GL_ENTRY(void, glProgramUniform3f, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
-GL_ENTRY(void, glProgramUniform4f, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
-GL_ENTRY(void, glProgramUniform1iv, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform2iv, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform3iv, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform4iv, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform1uiv, GLuint program, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glProgramUniform2uiv, GLuint program, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glProgramUniform3uiv, GLuint program, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glProgramUniform4uiv, GLuint program, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glProgramUniform1fv, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform2fv, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform3fv, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform4fv, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix2fv, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix3fv, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix4fv, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix2x3fv, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix3x2fv, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix2x4fv, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix4x2fv, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix3x4fv, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix4x3fv, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glValidateProgramPipeline, GLuint pipeline)
-GL_ENTRY(void, glGetProgramPipelineInfoLog, GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
-GL_ENTRY(void, glBindImageTexture, GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
-GL_ENTRY(void, glGetBooleani_v, GLenum target, GLuint index, GLboolean *data)
-GL_ENTRY(void, glMemoryBarrier, GLbitfield barriers)
-GL_ENTRY(void, glMemoryBarrierByRegion, GLbitfield barriers)
-GL_ENTRY(void, glTexStorage2DMultisample, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
-GL_ENTRY(void, glGetMultisamplefv, GLenum pname, GLuint index, GLfloat *val)
-GL_ENTRY(void, glSampleMaski, GLuint maskNumber, GLbitfield mask)
-GL_ENTRY(void, glGetTexLevelParameteriv, GLenum target, GLint level, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexLevelParameterfv, GLenum target, GLint level, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glBindVertexBuffer, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
-GL_ENTRY(void, glVertexAttribFormat, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
-GL_ENTRY(void, glVertexAttribIFormat, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
-GL_ENTRY(void, glVertexAttribBinding, GLuint attribindex, GLuint bindingindex)
-GL_ENTRY(void, glVertexBindingDivisor, GLuint bindingindex, GLuint divisor)
-GL_ENTRY(void, glBlendBarrier, void)
-GL_ENTRY(void, glCopyImageSubData, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth)
-GL_ENTRY(void, glDebugMessageControl, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled)
-GL_ENTRY(void, glDebugMessageInsert, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf)
-GL_ENTRY(void, glDebugMessageCallback, GLDEBUGPROC callback, const void *userParam)
-GL_ENTRY(GLuint, glGetDebugMessageLog, GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog)
-GL_ENTRY(void, glPushDebugGroup, GLenum source, GLuint id, GLsizei length, const GLchar *message)
-GL_ENTRY(void, glPopDebugGroup, void)
-GL_ENTRY(void, glObjectLabel, GLenum identifier, GLuint name, GLsizei length, const GLchar *label)
-GL_ENTRY(void, glGetObjectLabel, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label)
-GL_ENTRY(void, glObjectPtrLabel, const void *ptr, GLsizei length, const GLchar *label)
-GL_ENTRY(void, glGetObjectPtrLabel, const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label)
-GL_ENTRY(void, glGetPointerv, GLenum pname, void **params)
-GL_ENTRY(void, glEnablei, GLenum target, GLuint index)
-GL_ENTRY(void, glDisablei, GLenum target, GLuint index)
-GL_ENTRY(void, glBlendEquationi, GLuint buf, GLenum mode)
-GL_ENTRY(void, glBlendEquationSeparatei, GLuint buf, GLenum modeRGB, GLenum modeAlpha)
-GL_ENTRY(void, glBlendFunci, GLuint buf, GLenum src, GLenum dst)
-GL_ENTRY(void, glBlendFuncSeparatei, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-GL_ENTRY(void, glColorMaski, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
-GL_ENTRY(GLboolean, glIsEnabledi, GLenum target, GLuint index)
-GL_ENTRY(void, glDrawElementsBaseVertex, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex)
-GL_ENTRY(void, glDrawRangeElementsBaseVertex, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex)
-GL_ENTRY(void, glDrawElementsInstancedBaseVertex, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex)
-GL_ENTRY(void, glFramebufferTexture, GLenum target, GLenum attachment, GLuint texture, GLint level)
-GL_ENTRY(void, glPrimitiveBoundingBox, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW)
-GL_ENTRY(GLenum, glGetGraphicsResetStatus, void)
-GL_ENTRY(void, glReadnPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)
-GL_ENTRY(void, glGetnUniformfv, GLuint program, GLint location, GLsizei bufSize, GLfloat *params)
-GL_ENTRY(void, glGetnUniformiv, GLuint program, GLint location, GLsizei bufSize, GLint *params)
-GL_ENTRY(void, glGetnUniformuiv, GLuint program, GLint location, GLsizei bufSize, GLuint *params)
-GL_ENTRY(void, glMinSampleShading, GLfloat value)
-GL_ENTRY(void, glPatchParameteri, GLenum pname, GLint value)
-GL_ENTRY(void, glTexParameterIiv, GLenum target, GLenum pname, const GLint *params)
-GL_ENTRY(void, glTexParameterIuiv, GLenum target, GLenum pname, const GLuint *params)
-GL_ENTRY(void, glGetTexParameterIiv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexParameterIuiv, GLenum target, GLenum pname, GLuint *params)
-GL_ENTRY(void, glSamplerParameterIiv, GLuint sampler, GLenum pname, const GLint *param)
-GL_ENTRY(void, glSamplerParameterIuiv, GLuint sampler, GLenum pname, const GLuint *param)
-GL_ENTRY(void, glGetSamplerParameterIiv, GLuint sampler, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetSamplerParameterIuiv, GLuint sampler, GLenum pname, GLuint *params)
-GL_ENTRY(void, glTexBuffer, GLenum target, GLenum internalformat, GLuint buffer)
-GL_ENTRY(void, glTexBufferRange, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
-GL_ENTRY(void, glTexStorage3DMultisample, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
-GL_ENTRY(void, glBlendBarrierKHR, void)
-GL_ENTRY(void, glDebugMessageControlKHR, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled)
-GL_ENTRY(void, glDebugMessageInsertKHR, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf)
-GL_ENTRY(void, glDebugMessageCallbackKHR, GLDEBUGPROCKHR callback, const void *userParam)
-GL_ENTRY(GLuint, glGetDebugMessageLogKHR, GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog)
-GL_ENTRY(void, glPushDebugGroupKHR, GLenum source, GLuint id, GLsizei length, const GLchar *message)
-GL_ENTRY(void, glPopDebugGroupKHR, void)
-GL_ENTRY(void, glObjectLabelKHR, GLenum identifier, GLuint name, GLsizei length, const GLchar *label)
-GL_ENTRY(void, glGetObjectLabelKHR, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label)
-GL_ENTRY(void, glObjectPtrLabelKHR, const void *ptr, GLsizei length, const GLchar *label)
-GL_ENTRY(void, glGetObjectPtrLabelKHR, const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label)
-GL_ENTRY(void, glGetPointervKHR, GLenum pname, void **params)
-GL_ENTRY(GLenum, glGetGraphicsResetStatusKHR, void)
-GL_ENTRY(void, glReadnPixelsKHR, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)
-GL_ENTRY(void, glGetnUniformfvKHR, GLuint program, GLint location, GLsizei bufSize, GLfloat *params)
-GL_ENTRY(void, glGetnUniformivKHR, GLuint program, GLint location, GLsizei bufSize, GLint *params)
-GL_ENTRY(void, glGetnUniformuivKHR, GLuint program, GLint location, GLsizei bufSize, GLuint *params)
-GL_ENTRY(void, glEGLImageTargetTexture2DOES, GLenum target, GLeglImageOES image)
-GL_ENTRY(void, glEGLImageTargetRenderbufferStorageOES, GLenum target, GLeglImageOES image)
-GL_ENTRY(void, glCopyImageSubDataOES, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth)
-GL_ENTRY(void, glEnableiOES, GLenum target, GLuint index)
-GL_ENTRY(void, glDisableiOES, GLenum target, GLuint index)
-GL_ENTRY(void, glBlendEquationiOES, GLuint buf, GLenum mode)
-GL_ENTRY(void, glBlendEquationSeparateiOES, GLuint buf, GLenum modeRGB, GLenum modeAlpha)
-GL_ENTRY(void, glBlendFunciOES, GLuint buf, GLenum src, GLenum dst)
-GL_ENTRY(void, glBlendFuncSeparateiOES, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-GL_ENTRY(void, glColorMaskiOES, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
-GL_ENTRY(GLboolean, glIsEnablediOES, GLenum target, GLuint index)
-GL_ENTRY(void, glDrawElementsBaseVertexOES, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex)
-GL_ENTRY(void, glDrawRangeElementsBaseVertexOES, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex)
-GL_ENTRY(void, glDrawElementsInstancedBaseVertexOES, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex)
-GL_ENTRY(void, glFramebufferTextureOES, GLenum target, GLenum attachment, GLuint texture, GLint level)
-GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary)
-GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const void *binary, GLint length)
-GL_ENTRY(void *, glMapBufferOES, GLenum target, GLenum access)
-GL_ENTRY(GLboolean, glUnmapBufferOES, GLenum target)
-GL_ENTRY(void, glGetBufferPointervOES, GLenum target, GLenum pname, void **params)
-GL_ENTRY(void, glPrimitiveBoundingBoxOES, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW)
-GL_ENTRY(void, glMinSampleShadingOES, GLfloat value)
-GL_ENTRY(void, glPatchParameteriOES, GLenum pname, GLint value)
-GL_ENTRY(void, glTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *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 void *pixels)
-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, glCompressedTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *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 void *data)
-GL_ENTRY(void, glFramebufferTexture3DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-GL_ENTRY(void, glTexParameterIivOES, GLenum target, GLenum pname, const GLint *params)
-GL_ENTRY(void, glTexParameterIuivOES, GLenum target, GLenum pname, const GLuint *params)
-GL_ENTRY(void, glGetTexParameterIivOES, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexParameterIuivOES, GLenum target, GLenum pname, GLuint *params)
-GL_ENTRY(void, glSamplerParameterIivOES, GLuint sampler, GLenum pname, const GLint *param)
-GL_ENTRY(void, glSamplerParameterIuivOES, GLuint sampler, GLenum pname, const GLuint *param)
-GL_ENTRY(void, glGetSamplerParameterIivOES, GLuint sampler, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetSamplerParameterIuivOES, GLuint sampler, GLenum pname, GLuint *params)
-GL_ENTRY(void, glTexBufferOES, GLenum target, GLenum internalformat, GLuint buffer)
-GL_ENTRY(void, glTexBufferRangeOES, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
-GL_ENTRY(void, glTexStorage3DMultisampleOES, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
-GL_ENTRY(void, glTextureViewOES, GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers)
-GL_ENTRY(void, glBindVertexArrayOES, GLuint array)
-GL_ENTRY(void, glDeleteVertexArraysOES, GLsizei n, const GLuint *arrays)
-GL_ENTRY(void, glGenVertexArraysOES, GLsizei n, GLuint *arrays)
-GL_ENTRY(GLboolean, glIsVertexArrayOES, GLuint array)
-GL_ENTRY(void, glDrawArraysInstancedBaseInstanceEXT, GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance)
-GL_ENTRY(void, glDrawElementsInstancedBaseInstanceEXT, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance)
-GL_ENTRY(void, glDrawElementsInstancedBaseVertexBaseInstanceEXT, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance)
-GL_ENTRY(void, glBindFragDataLocationIndexedEXT, GLuint program, GLuint colorNumber, GLuint index, const GLchar *name)
-GL_ENTRY(void, glBindFragDataLocationEXT, GLuint program, GLuint color, const GLchar *name)
-GL_ENTRY(GLint, glGetProgramResourceLocationIndexEXT, GLuint program, GLenum programInterface, const GLchar *name)
-GL_ENTRY(GLint, glGetFragDataIndexEXT, GLuint program, const GLchar *name)
-GL_ENTRY(void, glBufferStorageEXT, GLenum target, GLsizeiptr size, const void *data, GLbitfield flags)
-GL_ENTRY(void, glCopyImageSubDataEXT, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth)
-GL_ENTRY(void, glLabelObjectEXT, GLenum type, GLuint object, GLsizei length, const GLchar *label)
-GL_ENTRY(void, glGetObjectLabelEXT, GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label)
-GL_ENTRY(void, glInsertEventMarkerEXT, GLsizei length, const GLchar *marker)
-GL_ENTRY(void, glPushGroupMarkerEXT, GLsizei length, const GLchar *marker)
-GL_ENTRY(void, glPopGroupMarkerEXT, void)
-GL_ENTRY(void, glDiscardFramebufferEXT, GLenum target, GLsizei numAttachments, const GLenum *attachments)
-GL_ENTRY(void, glGenQueriesEXT, GLsizei n, GLuint *ids)
-GL_ENTRY(void, glDeleteQueriesEXT, GLsizei n, const GLuint *ids)
-GL_ENTRY(GLboolean, glIsQueryEXT, GLuint id)
-GL_ENTRY(void, glBeginQueryEXT, GLenum target, GLuint id)
-GL_ENTRY(void, glEndQueryEXT, GLenum target)
-GL_ENTRY(void, glQueryCounterEXT, GLuint id, GLenum target)
-GL_ENTRY(void, glGetQueryivEXT, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetQueryObjectivEXT, GLuint id, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetQueryObjectuivEXT, GLuint id, GLenum pname, GLuint *params)
-GL_ENTRY(void, glGetQueryObjecti64vEXT, GLuint id, GLenum pname, GLint64 *params)
-GL_ENTRY(void, glGetQueryObjectui64vEXT, GLuint id, GLenum pname, GLuint64 *params)
-GL_ENTRY(void, glDrawBuffersEXT, GLsizei n, const GLenum *bufs)
-GL_ENTRY(void, glEnableiEXT, GLenum target, GLuint index)
-GL_ENTRY(void, glDisableiEXT, GLenum target, GLuint index)
-GL_ENTRY(void, glBlendEquationiEXT, GLuint buf, GLenum mode)
-GL_ENTRY(void, glBlendEquationSeparateiEXT, GLuint buf, GLenum modeRGB, GLenum modeAlpha)
-GL_ENTRY(void, glBlendFunciEXT, GLuint buf, GLenum src, GLenum dst)
-GL_ENTRY(void, glBlendFuncSeparateiEXT, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-GL_ENTRY(void, glColorMaskiEXT, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
-GL_ENTRY(GLboolean, glIsEnablediEXT, GLenum target, GLuint index)
-GL_ENTRY(void, glDrawElementsBaseVertexEXT, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex)
-GL_ENTRY(void, glDrawRangeElementsBaseVertexEXT, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex)
-GL_ENTRY(void, glDrawElementsInstancedBaseVertexEXT, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex)
-GL_ENTRY(void, glMultiDrawElementsBaseVertexEXT, GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex)
-GL_ENTRY(void, glDrawArraysInstancedEXT, GLenum mode, GLint start, GLsizei count, GLsizei primcount)
-GL_ENTRY(void, glDrawElementsInstancedEXT, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount)
-GL_ENTRY(void, glFramebufferTextureEXT, GLenum target, GLenum attachment, GLuint texture, GLint level)
-GL_ENTRY(void, glVertexAttribDivisorEXT, GLuint index, GLuint divisor)
-GL_ENTRY(void *, glMapBufferRangeEXT, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
-GL_ENTRY(void, glFlushMappedBufferRangeEXT, GLenum target, GLintptr offset, GLsizeiptr length)
-GL_ENTRY(void, glMultiDrawArraysEXT, GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)
-GL_ENTRY(void, glMultiDrawElementsEXT, GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount)
-GL_ENTRY(void, glMultiDrawArraysIndirectEXT, GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride)
-GL_ENTRY(void, glMultiDrawElementsIndirectEXT, GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride)
-GL_ENTRY(void, glRenderbufferStorageMultisampleEXT, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glFramebufferTexture2DMultisampleEXT, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
-GL_ENTRY(void, glReadBufferIndexedEXT, GLenum src, GLint index)
-GL_ENTRY(void, glDrawBuffersIndexedEXT, GLint n, const GLenum *location, const GLint *indices)
-GL_ENTRY(void, glGetIntegeri_vEXT, GLenum target, GLuint index, GLint *data)
-GL_ENTRY(void, glPrimitiveBoundingBoxEXT, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW)
-GL_ENTRY(void, glRasterSamplesEXT, GLuint samples, GLboolean fixedsamplelocations)
-GL_ENTRY(GLenum, glGetGraphicsResetStatusEXT, void)
-GL_ENTRY(void, glReadnPixelsEXT, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)
-GL_ENTRY(void, glGetnUniformfvEXT, GLuint program, GLint location, GLsizei bufSize, GLfloat *params)
-GL_ENTRY(void, glGetnUniformivEXT, GLuint program, GLint location, GLsizei bufSize, GLint *params)
-GL_ENTRY(void, glActiveShaderProgramEXT, GLuint pipeline, GLuint program)
-GL_ENTRY(void, glBindProgramPipelineEXT, GLuint pipeline)
-GL_ENTRY(GLuint, glCreateShaderProgramvEXT, GLenum type, GLsizei count, const GLchar **strings)
-GL_ENTRY(void, glDeleteProgramPipelinesEXT, GLsizei n, const GLuint *pipelines)
-GL_ENTRY(void, glGenProgramPipelinesEXT, GLsizei n, GLuint *pipelines)
-GL_ENTRY(void, glGetProgramPipelineInfoLogEXT, GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
-GL_ENTRY(void, glGetProgramPipelineivEXT, GLuint pipeline, GLenum pname, GLint *params)
-GL_ENTRY(GLboolean, glIsProgramPipelineEXT, GLuint pipeline)
-GL_ENTRY(void, glProgramParameteriEXT, GLuint program, GLenum pname, GLint value)
-GL_ENTRY(void, glProgramUniform1fEXT, GLuint program, GLint location, GLfloat v0)
-GL_ENTRY(void, glProgramUniform1fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform1iEXT, GLuint program, GLint location, GLint v0)
-GL_ENTRY(void, glProgramUniform1ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform2fEXT, GLuint program, GLint location, GLfloat v0, GLfloat v1)
-GL_ENTRY(void, glProgramUniform2fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform2iEXT, GLuint program, GLint location, GLint v0, GLint v1)
-GL_ENTRY(void, glProgramUniform2ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform3fEXT, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
-GL_ENTRY(void, glProgramUniform3fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform3iEXT, GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
-GL_ENTRY(void, glProgramUniform3ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniform4fEXT, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
-GL_ENTRY(void, glProgramUniform4fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
-GL_ENTRY(void, glProgramUniform4iEXT, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
-GL_ENTRY(void, glProgramUniform4ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
-GL_ENTRY(void, glProgramUniformMatrix2fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix3fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix4fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glUseProgramStagesEXT, GLuint pipeline, GLbitfield stages, GLuint program)
-GL_ENTRY(void, glValidateProgramPipelineEXT, GLuint pipeline)
-GL_ENTRY(void, glProgramUniform1uiEXT, GLuint program, GLint location, GLuint v0)
-GL_ENTRY(void, glProgramUniform2uiEXT, GLuint program, GLint location, GLuint v0, GLuint v1)
-GL_ENTRY(void, glProgramUniform3uiEXT, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
-GL_ENTRY(void, glProgramUniform4uiEXT, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-GL_ENTRY(void, glProgramUniform1uivEXT, GLuint program, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glProgramUniform2uivEXT, GLuint program, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glProgramUniform3uivEXT, GLuint program, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glProgramUniform4uivEXT, GLuint program, GLint location, GLsizei count, const GLuint *value)
-GL_ENTRY(void, glProgramUniformMatrix2x3fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix3x2fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix2x4fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix4x2fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix3x4fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glProgramUniformMatrix4x3fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-GL_ENTRY(void, glTexPageCommitmentEXT, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit)
-GL_ENTRY(void, glPatchParameteriEXT, GLenum pname, GLint value)
-GL_ENTRY(void, glTexParameterIivEXT, GLenum target, GLenum pname, const GLint *params)
-GL_ENTRY(void, glTexParameterIuivEXT, GLenum target, GLenum pname, const GLuint *params)
-GL_ENTRY(void, glGetTexParameterIivEXT, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexParameterIuivEXT, GLenum target, GLenum pname, GLuint *params)
-GL_ENTRY(void, glSamplerParameterIivEXT, GLuint sampler, GLenum pname, const GLint *param)
-GL_ENTRY(void, glSamplerParameterIuivEXT, GLuint sampler, GLenum pname, const GLuint *param)
-GL_ENTRY(void, glGetSamplerParameterIivEXT, GLuint sampler, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetSamplerParameterIuivEXT, GLuint sampler, GLenum pname, GLuint *params)
-GL_ENTRY(void, glTexBufferEXT, GLenum target, GLenum internalformat, GLuint buffer)
-GL_ENTRY(void, glTexBufferRangeEXT, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
-GL_ENTRY(void, glTexStorage1DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
-GL_ENTRY(void, glTexStorage2DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glTexStorage3DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
-GL_ENTRY(void, glTextureStorage1DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
-GL_ENTRY(void, glTextureStorage2DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glTextureStorage3DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
-GL_ENTRY(void, glTextureViewEXT, GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers)
diff --git a/libs/hwui/debug/gles_redefine.h b/libs/hwui/debug/gles_redefine.h
deleted file mode 100644
index 49b506918372..000000000000
--- a/libs/hwui/debug/gles_redefine.h
+++ /dev/null
@@ -1,914 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 glActiveShaderProgram wrap_glActiveShaderProgram
-#define glActiveShaderProgramEXT wrap_glActiveShaderProgramEXT
-#define glActiveTexture wrap_glActiveTexture
-#define glAlphaFunc wrap_glAlphaFunc
-#define glAlphaFuncQCOM wrap_glAlphaFuncQCOM
-#define glAlphaFuncx wrap_glAlphaFuncx
-#define glAlphaFuncxOES wrap_glAlphaFuncxOES
-#define glApplyFramebufferAttachmentCMAAINTEL wrap_glApplyFramebufferAttachmentCMAAINTEL
-#define glAttachShader wrap_glAttachShader
-#define glBeginConditionalRenderNV wrap_glBeginConditionalRenderNV
-#define glBeginPerfMonitorAMD wrap_glBeginPerfMonitorAMD
-#define glBeginPerfQueryINTEL wrap_glBeginPerfQueryINTEL
-#define glBeginQuery wrap_glBeginQuery
-#define glBeginQueryEXT wrap_glBeginQueryEXT
-#define glBeginTransformFeedback wrap_glBeginTransformFeedback
-#define glBindAttribLocation wrap_glBindAttribLocation
-#define glBindBuffer wrap_glBindBuffer
-#define glBindBufferBase wrap_glBindBufferBase
-#define glBindBufferRange wrap_glBindBufferRange
-#define glBindFragDataLocationEXT wrap_glBindFragDataLocationEXT
-#define glBindFragDataLocationIndexedEXT wrap_glBindFragDataLocationIndexedEXT
-#define glBindFramebuffer wrap_glBindFramebuffer
-#define glBindFramebufferOES wrap_glBindFramebufferOES
-#define glBindImageTexture wrap_glBindImageTexture
-#define glBindProgramPipeline wrap_glBindProgramPipeline
-#define glBindProgramPipelineEXT wrap_glBindProgramPipelineEXT
-#define glBindRenderbuffer wrap_glBindRenderbuffer
-#define glBindRenderbufferOES wrap_glBindRenderbufferOES
-#define glBindSampler wrap_glBindSampler
-#define glBindTexture wrap_glBindTexture
-#define glBindTransformFeedback wrap_glBindTransformFeedback
-#define glBindVertexArray wrap_glBindVertexArray
-#define glBindVertexArrayOES wrap_glBindVertexArrayOES
-#define glBindVertexBuffer wrap_glBindVertexBuffer
-#define glBlendBarrier wrap_glBlendBarrier
-#define glBlendBarrierKHR wrap_glBlendBarrierKHR
-#define glBlendBarrierNV wrap_glBlendBarrierNV
-#define glBlendColor wrap_glBlendColor
-#define glBlendEquation wrap_glBlendEquation
-#define glBlendEquationOES wrap_glBlendEquationOES
-#define glBlendEquationSeparate wrap_glBlendEquationSeparate
-#define glBlendEquationSeparateOES wrap_glBlendEquationSeparateOES
-#define glBlendEquationSeparatei wrap_glBlendEquationSeparatei
-#define glBlendEquationSeparateiEXT wrap_glBlendEquationSeparateiEXT
-#define glBlendEquationSeparateiOES wrap_glBlendEquationSeparateiOES
-#define glBlendEquationi wrap_glBlendEquationi
-#define glBlendEquationiEXT wrap_glBlendEquationiEXT
-#define glBlendEquationiOES wrap_glBlendEquationiOES
-#define glBlendFunc wrap_glBlendFunc
-#define glBlendFuncSeparate wrap_glBlendFuncSeparate
-#define glBlendFuncSeparateOES wrap_glBlendFuncSeparateOES
-#define glBlendFuncSeparatei wrap_glBlendFuncSeparatei
-#define glBlendFuncSeparateiEXT wrap_glBlendFuncSeparateiEXT
-#define glBlendFuncSeparateiOES wrap_glBlendFuncSeparateiOES
-#define glBlendFunci wrap_glBlendFunci
-#define glBlendFunciEXT wrap_glBlendFunciEXT
-#define glBlendFunciOES wrap_glBlendFunciOES
-#define glBlendParameteriNV wrap_glBlendParameteriNV
-#define glBlitFramebuffer wrap_glBlitFramebuffer
-#define glBlitFramebufferANGLE wrap_glBlitFramebufferANGLE
-#define glBlitFramebufferNV wrap_glBlitFramebufferNV
-#define glBufferData wrap_glBufferData
-#define glBufferStorageEXT wrap_glBufferStorageEXT
-#define glBufferSubData wrap_glBufferSubData
-#define glCheckFramebufferStatus wrap_glCheckFramebufferStatus
-#define glCheckFramebufferStatusOES wrap_glCheckFramebufferStatusOES
-#define glClear wrap_glClear
-#define glClearBufferfi wrap_glClearBufferfi
-#define glClearBufferfv wrap_glClearBufferfv
-#define glClearBufferiv wrap_glClearBufferiv
-#define glClearBufferuiv wrap_glClearBufferuiv
-#define glClearColor wrap_glClearColor
-#define glClearColorx wrap_glClearColorx
-#define glClearColorxOES wrap_glClearColorxOES
-#define glClearDepthf wrap_glClearDepthf
-#define glClearDepthfOES wrap_glClearDepthfOES
-#define glClearDepthx wrap_glClearDepthx
-#define glClearDepthxOES wrap_glClearDepthxOES
-#define glClearStencil wrap_glClearStencil
-#define glClientActiveTexture wrap_glClientActiveTexture
-#define glClientWaitSync wrap_glClientWaitSync
-#define glClientWaitSyncAPPLE wrap_glClientWaitSyncAPPLE
-#define glClipPlanef wrap_glClipPlanef
-#define glClipPlanefIMG wrap_glClipPlanefIMG
-#define glClipPlanefOES wrap_glClipPlanefOES
-#define glClipPlanex wrap_glClipPlanex
-#define glClipPlanexIMG wrap_glClipPlanexIMG
-#define glClipPlanexOES wrap_glClipPlanexOES
-#define glColor4f wrap_glColor4f
-#define glColor4ub wrap_glColor4ub
-#define glColor4x wrap_glColor4x
-#define glColor4xOES wrap_glColor4xOES
-#define glColorMask wrap_glColorMask
-#define glColorMaski wrap_glColorMaski
-#define glColorMaskiEXT wrap_glColorMaskiEXT
-#define glColorMaskiOES wrap_glColorMaskiOES
-#define glColorPointer wrap_glColorPointer
-#define glCompileShader wrap_glCompileShader
-#define glCompressedTexImage2D wrap_glCompressedTexImage2D
-#define glCompressedTexImage3D wrap_glCompressedTexImage3D
-#define glCompressedTexImage3DOES wrap_glCompressedTexImage3DOES
-#define glCompressedTexSubImage2D wrap_glCompressedTexSubImage2D
-#define glCompressedTexSubImage3D wrap_glCompressedTexSubImage3D
-#define glCompressedTexSubImage3DOES wrap_glCompressedTexSubImage3DOES
-#define glCopyBufferSubData wrap_glCopyBufferSubData
-#define glCopyBufferSubDataNV wrap_glCopyBufferSubDataNV
-#define glCopyImageSubData wrap_glCopyImageSubData
-#define glCopyImageSubDataEXT wrap_glCopyImageSubDataEXT
-#define glCopyImageSubDataOES wrap_glCopyImageSubDataOES
-#define glCopyPathNV wrap_glCopyPathNV
-#define glCopyTexImage2D wrap_glCopyTexImage2D
-#define glCopyTexSubImage2D wrap_glCopyTexSubImage2D
-#define glCopyTexSubImage3D wrap_glCopyTexSubImage3D
-#define glCopyTexSubImage3DOES wrap_glCopyTexSubImage3DOES
-#define glCopyTextureLevelsAPPLE wrap_glCopyTextureLevelsAPPLE
-#define glCoverFillPathInstancedNV wrap_glCoverFillPathInstancedNV
-#define glCoverFillPathNV wrap_glCoverFillPathNV
-#define glCoverStrokePathInstancedNV wrap_glCoverStrokePathInstancedNV
-#define glCoverStrokePathNV wrap_glCoverStrokePathNV
-#define glCoverageMaskNV wrap_glCoverageMaskNV
-#define glCoverageModulationNV wrap_glCoverageModulationNV
-#define glCoverageModulationTableNV wrap_glCoverageModulationTableNV
-#define glCoverageOperationNV wrap_glCoverageOperationNV
-#define glCreatePerfQueryINTEL wrap_glCreatePerfQueryINTEL
-#define glCreateProgram wrap_glCreateProgram
-#define glCreateShader wrap_glCreateShader
-#define glCreateShaderProgramv wrap_glCreateShaderProgramv
-#define glCreateShaderProgramvEXT wrap_glCreateShaderProgramvEXT
-#define glCullFace wrap_glCullFace
-#define glCurrentPaletteMatrixOES wrap_glCurrentPaletteMatrixOES
-#define glDebugMessageCallback wrap_glDebugMessageCallback
-#define glDebugMessageCallbackKHR wrap_glDebugMessageCallbackKHR
-#define glDebugMessageControl wrap_glDebugMessageControl
-#define glDebugMessageControlKHR wrap_glDebugMessageControlKHR
-#define glDebugMessageInsert wrap_glDebugMessageInsert
-#define glDebugMessageInsertKHR wrap_glDebugMessageInsertKHR
-#define glDeleteBuffers wrap_glDeleteBuffers
-#define glDeleteFencesNV wrap_glDeleteFencesNV
-#define glDeleteFramebuffers wrap_glDeleteFramebuffers
-#define glDeleteFramebuffersOES wrap_glDeleteFramebuffersOES
-#define glDeletePathsNV wrap_glDeletePathsNV
-#define glDeletePerfMonitorsAMD wrap_glDeletePerfMonitorsAMD
-#define glDeletePerfQueryINTEL wrap_glDeletePerfQueryINTEL
-#define glDeleteProgram wrap_glDeleteProgram
-#define glDeleteProgramPipelines wrap_glDeleteProgramPipelines
-#define glDeleteProgramPipelinesEXT wrap_glDeleteProgramPipelinesEXT
-#define glDeleteQueries wrap_glDeleteQueries
-#define glDeleteQueriesEXT wrap_glDeleteQueriesEXT
-#define glDeleteRenderbuffers wrap_glDeleteRenderbuffers
-#define glDeleteRenderbuffersOES wrap_glDeleteRenderbuffersOES
-#define glDeleteSamplers wrap_glDeleteSamplers
-#define glDeleteShader wrap_glDeleteShader
-#define glDeleteSync wrap_glDeleteSync
-#define glDeleteSyncAPPLE wrap_glDeleteSyncAPPLE
-#define glDeleteTextures wrap_glDeleteTextures
-#define glDeleteTransformFeedbacks wrap_glDeleteTransformFeedbacks
-#define glDeleteVertexArrays wrap_glDeleteVertexArrays
-#define glDeleteVertexArraysOES wrap_glDeleteVertexArraysOES
-#define glDepthFunc wrap_glDepthFunc
-#define glDepthMask wrap_glDepthMask
-#define glDepthRangeArrayfvNV wrap_glDepthRangeArrayfvNV
-#define glDepthRangeIndexedfNV wrap_glDepthRangeIndexedfNV
-#define glDepthRangef wrap_glDepthRangef
-#define glDepthRangefOES wrap_glDepthRangefOES
-#define glDepthRangex wrap_glDepthRangex
-#define glDepthRangexOES wrap_glDepthRangexOES
-#define glDetachShader wrap_glDetachShader
-#define glDisable wrap_glDisable
-#define glDisableClientState wrap_glDisableClientState
-#define glDisableDriverControlQCOM wrap_glDisableDriverControlQCOM
-#define glDisableVertexAttribArray wrap_glDisableVertexAttribArray
-#define glDisablei wrap_glDisablei
-#define glDisableiEXT wrap_glDisableiEXT
-#define glDisableiNV wrap_glDisableiNV
-#define glDisableiOES wrap_glDisableiOES
-#define glDiscardFramebufferEXT wrap_glDiscardFramebufferEXT
-#define glDispatchCompute wrap_glDispatchCompute
-#define glDispatchComputeIndirect wrap_glDispatchComputeIndirect
-#define glDrawArrays wrap_glDrawArrays
-#define glDrawArraysIndirect wrap_glDrawArraysIndirect
-#define glDrawArraysInstanced wrap_glDrawArraysInstanced
-#define glDrawArraysInstancedANGLE wrap_glDrawArraysInstancedANGLE
-#define glDrawArraysInstancedBaseInstanceEXT wrap_glDrawArraysInstancedBaseInstanceEXT
-#define glDrawArraysInstancedEXT wrap_glDrawArraysInstancedEXT
-#define glDrawArraysInstancedNV wrap_glDrawArraysInstancedNV
-#define glDrawBuffers wrap_glDrawBuffers
-#define glDrawBuffersEXT wrap_glDrawBuffersEXT
-#define glDrawBuffersIndexedEXT wrap_glDrawBuffersIndexedEXT
-#define glDrawBuffersNV wrap_glDrawBuffersNV
-#define glDrawElements wrap_glDrawElements
-#define glDrawElementsBaseVertex wrap_glDrawElementsBaseVertex
-#define glDrawElementsBaseVertexEXT wrap_glDrawElementsBaseVertexEXT
-#define glDrawElementsBaseVertexOES wrap_glDrawElementsBaseVertexOES
-#define glDrawElementsIndirect wrap_glDrawElementsIndirect
-#define glDrawElementsInstanced wrap_glDrawElementsInstanced
-#define glDrawElementsInstancedANGLE wrap_glDrawElementsInstancedANGLE
-#define glDrawElementsInstancedBaseInstanceEXT wrap_glDrawElementsInstancedBaseInstanceEXT
-#define glDrawElementsInstancedBaseVertex wrap_glDrawElementsInstancedBaseVertex
-#define glDrawElementsInstancedBaseVertexBaseInstanceEXT \
- wrap_glDrawElementsInstancedBaseVertexBaseInstanceEXT
-#define glDrawElementsInstancedBaseVertexEXT wrap_glDrawElementsInstancedBaseVertexEXT
-#define glDrawElementsInstancedBaseVertexOES wrap_glDrawElementsInstancedBaseVertexOES
-#define glDrawElementsInstancedEXT wrap_glDrawElementsInstancedEXT
-#define glDrawElementsInstancedNV wrap_glDrawElementsInstancedNV
-#define glDrawRangeElements wrap_glDrawRangeElements
-#define glDrawRangeElementsBaseVertex wrap_glDrawRangeElementsBaseVertex
-#define glDrawRangeElementsBaseVertexEXT wrap_glDrawRangeElementsBaseVertexEXT
-#define glDrawRangeElementsBaseVertexOES wrap_glDrawRangeElementsBaseVertexOES
-#define glDrawTexfOES wrap_glDrawTexfOES
-#define glDrawTexfvOES wrap_glDrawTexfvOES
-#define glDrawTexiOES wrap_glDrawTexiOES
-#define glDrawTexivOES wrap_glDrawTexivOES
-#define glDrawTexsOES wrap_glDrawTexsOES
-#define glDrawTexsvOES wrap_glDrawTexsvOES
-#define glDrawTexxOES wrap_glDrawTexxOES
-#define glDrawTexxvOES wrap_glDrawTexxvOES
-#define glEGLImageTargetRenderbufferStorageOES wrap_glEGLImageTargetRenderbufferStorageOES
-#define glEGLImageTargetTexture2DOES wrap_glEGLImageTargetTexture2DOES
-#define glEnable wrap_glEnable
-#define glEnableClientState wrap_glEnableClientState
-#define glEnableDriverControlQCOM wrap_glEnableDriverControlQCOM
-#define glEnableVertexAttribArray wrap_glEnableVertexAttribArray
-#define glEnablei wrap_glEnablei
-#define glEnableiEXT wrap_glEnableiEXT
-#define glEnableiNV wrap_glEnableiNV
-#define glEnableiOES wrap_glEnableiOES
-#define glEndConditionalRenderNV wrap_glEndConditionalRenderNV
-#define glEndPerfMonitorAMD wrap_glEndPerfMonitorAMD
-#define glEndPerfQueryINTEL wrap_glEndPerfQueryINTEL
-#define glEndQuery wrap_glEndQuery
-#define glEndQueryEXT wrap_glEndQueryEXT
-#define glEndTilingQCOM wrap_glEndTilingQCOM
-#define glEndTransformFeedback wrap_glEndTransformFeedback
-#define glExtGetBufferPointervQCOM wrap_glExtGetBufferPointervQCOM
-#define glExtGetBuffersQCOM wrap_glExtGetBuffersQCOM
-#define glExtGetFramebuffersQCOM wrap_glExtGetFramebuffersQCOM
-#define glExtGetProgramBinarySourceQCOM wrap_glExtGetProgramBinarySourceQCOM
-#define glExtGetProgramsQCOM wrap_glExtGetProgramsQCOM
-#define glExtGetRenderbuffersQCOM wrap_glExtGetRenderbuffersQCOM
-#define glExtGetShadersQCOM wrap_glExtGetShadersQCOM
-#define glExtGetTexLevelParameterivQCOM wrap_glExtGetTexLevelParameterivQCOM
-#define glExtGetTexSubImageQCOM wrap_glExtGetTexSubImageQCOM
-#define glExtGetTexturesQCOM wrap_glExtGetTexturesQCOM
-#define glExtIsProgramBinaryQCOM wrap_glExtIsProgramBinaryQCOM
-#define glExtTexObjectStateOverrideiQCOM wrap_glExtTexObjectStateOverrideiQCOM
-#define glFenceSync wrap_glFenceSync
-#define glFenceSyncAPPLE wrap_glFenceSyncAPPLE
-#define glFinish wrap_glFinish
-#define glFinishFenceNV wrap_glFinishFenceNV
-#define glFlush wrap_glFlush
-#define glFlushMappedBufferRange wrap_glFlushMappedBufferRange
-#define glFlushMappedBufferRangeEXT wrap_glFlushMappedBufferRangeEXT
-#define glFogf wrap_glFogf
-#define glFogfv wrap_glFogfv
-#define glFogx wrap_glFogx
-#define glFogxOES wrap_glFogxOES
-#define glFogxv wrap_glFogxv
-#define glFogxvOES wrap_glFogxvOES
-#define glFragmentCoverageColorNV wrap_glFragmentCoverageColorNV
-#define glFramebufferParameteri wrap_glFramebufferParameteri
-#define glFramebufferRenderbuffer wrap_glFramebufferRenderbuffer
-#define glFramebufferRenderbufferOES wrap_glFramebufferRenderbufferOES
-#define glFramebufferSampleLocationsfvNV wrap_glFramebufferSampleLocationsfvNV
-#define glFramebufferTexture wrap_glFramebufferTexture
-#define glFramebufferTexture2D wrap_glFramebufferTexture2D
-#define glFramebufferTexture2DMultisampleEXT wrap_glFramebufferTexture2DMultisampleEXT
-#define glFramebufferTexture2DMultisampleIMG wrap_glFramebufferTexture2DMultisampleIMG
-#define glFramebufferTexture2DOES wrap_glFramebufferTexture2DOES
-#define glFramebufferTexture3DOES wrap_glFramebufferTexture3DOES
-#define glFramebufferTextureEXT wrap_glFramebufferTextureEXT
-#define glFramebufferTextureLayer wrap_glFramebufferTextureLayer
-#define glFramebufferTextureMultisampleMultiviewOVR wrap_glFramebufferTextureMultisampleMultiviewOVR
-#define glFramebufferTextureMultiviewOVR wrap_glFramebufferTextureMultiviewOVR
-#define glFramebufferTextureOES wrap_glFramebufferTextureOES
-#define glFrontFace wrap_glFrontFace
-#define glFrustumf wrap_glFrustumf
-#define glFrustumfOES wrap_glFrustumfOES
-#define glFrustumx wrap_glFrustumx
-#define glFrustumxOES wrap_glFrustumxOES
-#define glGenBuffers wrap_glGenBuffers
-#define glGenFencesNV wrap_glGenFencesNV
-#define glGenFramebuffers wrap_glGenFramebuffers
-#define glGenFramebuffersOES wrap_glGenFramebuffersOES
-#define glGenPathsNV wrap_glGenPathsNV
-#define glGenPerfMonitorsAMD wrap_glGenPerfMonitorsAMD
-#define glGenProgramPipelines wrap_glGenProgramPipelines
-#define glGenProgramPipelinesEXT wrap_glGenProgramPipelinesEXT
-#define glGenQueries wrap_glGenQueries
-#define glGenQueriesEXT wrap_glGenQueriesEXT
-#define glGenRenderbuffers wrap_glGenRenderbuffers
-#define glGenRenderbuffersOES wrap_glGenRenderbuffersOES
-#define glGenSamplers wrap_glGenSamplers
-#define glGenTextures wrap_glGenTextures
-#define glGenTransformFeedbacks wrap_glGenTransformFeedbacks
-#define glGenVertexArrays wrap_glGenVertexArrays
-#define glGenVertexArraysOES wrap_glGenVertexArraysOES
-#define glGenerateMipmap wrap_glGenerateMipmap
-#define glGenerateMipmapOES wrap_glGenerateMipmapOES
-#define glGetActiveAttrib wrap_glGetActiveAttrib
-#define glGetActiveUniform wrap_glGetActiveUniform
-#define glGetActiveUniformBlockName wrap_glGetActiveUniformBlockName
-#define glGetActiveUniformBlockiv wrap_glGetActiveUniformBlockiv
-#define glGetActiveUniformsiv wrap_glGetActiveUniformsiv
-#define glGetAttachedShaders wrap_glGetAttachedShaders
-#define glGetAttribLocation wrap_glGetAttribLocation
-#define glGetBooleani_v wrap_glGetBooleani_v
-#define glGetBooleanv wrap_glGetBooleanv
-#define glGetBufferParameteri64v wrap_glGetBufferParameteri64v
-#define glGetBufferParameteriv wrap_glGetBufferParameteriv
-#define glGetBufferPointerv wrap_glGetBufferPointerv
-#define glGetBufferPointervOES wrap_glGetBufferPointervOES
-#define glGetClipPlanef wrap_glGetClipPlanef
-#define glGetClipPlanefOES wrap_glGetClipPlanefOES
-#define glGetClipPlanex wrap_glGetClipPlanex
-#define glGetClipPlanexOES wrap_glGetClipPlanexOES
-#define glGetCoverageModulationTableNV wrap_glGetCoverageModulationTableNV
-#define glGetDebugMessageLog wrap_glGetDebugMessageLog
-#define glGetDebugMessageLogKHR wrap_glGetDebugMessageLogKHR
-#define glGetDriverControlStringQCOM wrap_glGetDriverControlStringQCOM
-#define glGetDriverControlsQCOM wrap_glGetDriverControlsQCOM
-#define glGetError wrap_glGetError
-#define glGetFenceivNV wrap_glGetFenceivNV
-#define glGetFirstPerfQueryIdINTEL wrap_glGetFirstPerfQueryIdINTEL
-#define glGetFixedv wrap_glGetFixedv
-#define glGetFixedvOES wrap_glGetFixedvOES
-#define glGetFloati_vNV wrap_glGetFloati_vNV
-#define glGetFloatv wrap_glGetFloatv
-#define glGetFragDataIndexEXT wrap_glGetFragDataIndexEXT
-#define glGetFragDataLocation wrap_glGetFragDataLocation
-#define glGetFramebufferAttachmentParameteriv wrap_glGetFramebufferAttachmentParameteriv
-#define glGetFramebufferAttachmentParameterivOES wrap_glGetFramebufferAttachmentParameterivOES
-#define glGetFramebufferParameteriv wrap_glGetFramebufferParameteriv
-#define glGetGraphicsResetStatus wrap_glGetGraphicsResetStatus
-#define glGetGraphicsResetStatusEXT wrap_glGetGraphicsResetStatusEXT
-#define glGetGraphicsResetStatusKHR wrap_glGetGraphicsResetStatusKHR
-#define glGetImageHandleNV wrap_glGetImageHandleNV
-#define glGetInteger64i_v wrap_glGetInteger64i_v
-#define glGetInteger64v wrap_glGetInteger64v
-#define glGetInteger64vAPPLE wrap_glGetInteger64vAPPLE
-#define glGetIntegeri_v wrap_glGetIntegeri_v
-#define glGetIntegeri_vEXT wrap_glGetIntegeri_vEXT
-#define glGetIntegerv wrap_glGetIntegerv
-#define glGetInternalformatSampleivNV wrap_glGetInternalformatSampleivNV
-#define glGetInternalformativ wrap_glGetInternalformativ
-#define glGetLightfv wrap_glGetLightfv
-#define glGetLightxv wrap_glGetLightxv
-#define glGetLightxvOES wrap_glGetLightxvOES
-#define glGetMaterialfv wrap_glGetMaterialfv
-#define glGetMaterialxv wrap_glGetMaterialxv
-#define glGetMaterialxvOES wrap_glGetMaterialxvOES
-#define glGetMultisamplefv wrap_glGetMultisamplefv
-#define glGetNextPerfQueryIdINTEL wrap_glGetNextPerfQueryIdINTEL
-#define glGetObjectLabel wrap_glGetObjectLabel
-#define glGetObjectLabelEXT wrap_glGetObjectLabelEXT
-#define glGetObjectLabelKHR wrap_glGetObjectLabelKHR
-#define glGetObjectPtrLabel wrap_glGetObjectPtrLabel
-#define glGetObjectPtrLabelKHR wrap_glGetObjectPtrLabelKHR
-#define glGetPathCommandsNV wrap_glGetPathCommandsNV
-#define glGetPathCoordsNV wrap_glGetPathCoordsNV
-#define glGetPathDashArrayNV wrap_glGetPathDashArrayNV
-#define glGetPathLengthNV wrap_glGetPathLengthNV
-#define glGetPathMetricRangeNV wrap_glGetPathMetricRangeNV
-#define glGetPathMetricsNV wrap_glGetPathMetricsNV
-#define glGetPathParameterfvNV wrap_glGetPathParameterfvNV
-#define glGetPathParameterivNV wrap_glGetPathParameterivNV
-#define glGetPathSpacingNV wrap_glGetPathSpacingNV
-#define glGetPerfCounterInfoINTEL wrap_glGetPerfCounterInfoINTEL
-#define glGetPerfMonitorCounterDataAMD wrap_glGetPerfMonitorCounterDataAMD
-#define glGetPerfMonitorCounterInfoAMD wrap_glGetPerfMonitorCounterInfoAMD
-#define glGetPerfMonitorCounterStringAMD wrap_glGetPerfMonitorCounterStringAMD
-#define glGetPerfMonitorCountersAMD wrap_glGetPerfMonitorCountersAMD
-#define glGetPerfMonitorGroupStringAMD wrap_glGetPerfMonitorGroupStringAMD
-#define glGetPerfMonitorGroupsAMD wrap_glGetPerfMonitorGroupsAMD
-#define glGetPerfQueryDataINTEL wrap_glGetPerfQueryDataINTEL
-#define glGetPerfQueryIdByNameINTEL wrap_glGetPerfQueryIdByNameINTEL
-#define glGetPerfQueryInfoINTEL wrap_glGetPerfQueryInfoINTEL
-#define glGetPointerv wrap_glGetPointerv
-#define glGetPointervKHR wrap_glGetPointervKHR
-#define glGetProgramBinary wrap_glGetProgramBinary
-#define glGetProgramBinaryOES wrap_glGetProgramBinaryOES
-#define glGetProgramInfoLog wrap_glGetProgramInfoLog
-#define glGetProgramInterfaceiv wrap_glGetProgramInterfaceiv
-#define glGetProgramPipelineInfoLog wrap_glGetProgramPipelineInfoLog
-#define glGetProgramPipelineInfoLogEXT wrap_glGetProgramPipelineInfoLogEXT
-#define glGetProgramPipelineiv wrap_glGetProgramPipelineiv
-#define glGetProgramPipelineivEXT wrap_glGetProgramPipelineivEXT
-#define glGetProgramResourceIndex wrap_glGetProgramResourceIndex
-#define glGetProgramResourceLocation wrap_glGetProgramResourceLocation
-#define glGetProgramResourceLocationIndexEXT wrap_glGetProgramResourceLocationIndexEXT
-#define glGetProgramResourceName wrap_glGetProgramResourceName
-#define glGetProgramResourcefvNV wrap_glGetProgramResourcefvNV
-#define glGetProgramResourceiv wrap_glGetProgramResourceiv
-#define glGetProgramiv wrap_glGetProgramiv
-#define glGetQueryObjecti64vEXT wrap_glGetQueryObjecti64vEXT
-#define glGetQueryObjectivEXT wrap_glGetQueryObjectivEXT
-#define glGetQueryObjectui64vEXT wrap_glGetQueryObjectui64vEXT
-#define glGetQueryObjectuiv wrap_glGetQueryObjectuiv
-#define glGetQueryObjectuivEXT wrap_glGetQueryObjectuivEXT
-#define glGetQueryiv wrap_glGetQueryiv
-#define glGetQueryivEXT wrap_glGetQueryivEXT
-#define glGetRenderbufferParameteriv wrap_glGetRenderbufferParameteriv
-#define glGetRenderbufferParameterivOES wrap_glGetRenderbufferParameterivOES
-#define glGetSamplerParameterIiv wrap_glGetSamplerParameterIiv
-#define glGetSamplerParameterIivEXT wrap_glGetSamplerParameterIivEXT
-#define glGetSamplerParameterIivOES wrap_glGetSamplerParameterIivOES
-#define glGetSamplerParameterIuiv wrap_glGetSamplerParameterIuiv
-#define glGetSamplerParameterIuivEXT wrap_glGetSamplerParameterIuivEXT
-#define glGetSamplerParameterIuivOES wrap_glGetSamplerParameterIuivOES
-#define glGetSamplerParameterfv wrap_glGetSamplerParameterfv
-#define glGetSamplerParameteriv wrap_glGetSamplerParameteriv
-#define glGetShaderInfoLog wrap_glGetShaderInfoLog
-#define glGetShaderPrecisionFormat wrap_glGetShaderPrecisionFormat
-#define glGetShaderSource wrap_glGetShaderSource
-#define glGetShaderiv wrap_glGetShaderiv
-#define glGetString wrap_glGetString
-#define glGetStringi wrap_glGetStringi
-#define glGetSynciv wrap_glGetSynciv
-#define glGetSyncivAPPLE wrap_glGetSyncivAPPLE
-#define glGetTexEnvfv wrap_glGetTexEnvfv
-#define glGetTexEnviv wrap_glGetTexEnviv
-#define glGetTexEnvxv wrap_glGetTexEnvxv
-#define glGetTexEnvxvOES wrap_glGetTexEnvxvOES
-#define glGetTexGenfvOES wrap_glGetTexGenfvOES
-#define glGetTexGenivOES wrap_glGetTexGenivOES
-#define glGetTexGenxvOES wrap_glGetTexGenxvOES
-#define glGetTexLevelParameterfv wrap_glGetTexLevelParameterfv
-#define glGetTexLevelParameteriv wrap_glGetTexLevelParameteriv
-#define glGetTexParameterIiv wrap_glGetTexParameterIiv
-#define glGetTexParameterIivEXT wrap_glGetTexParameterIivEXT
-#define glGetTexParameterIivOES wrap_glGetTexParameterIivOES
-#define glGetTexParameterIuiv wrap_glGetTexParameterIuiv
-#define glGetTexParameterIuivEXT wrap_glGetTexParameterIuivEXT
-#define glGetTexParameterIuivOES wrap_glGetTexParameterIuivOES
-#define glGetTexParameterfv wrap_glGetTexParameterfv
-#define glGetTexParameteriv wrap_glGetTexParameteriv
-#define glGetTexParameterxv wrap_glGetTexParameterxv
-#define glGetTexParameterxvOES wrap_glGetTexParameterxvOES
-#define glGetTextureHandleNV wrap_glGetTextureHandleNV
-#define glGetTextureSamplerHandleNV wrap_glGetTextureSamplerHandleNV
-#define glGetTransformFeedbackVarying wrap_glGetTransformFeedbackVarying
-#define glGetTranslatedShaderSourceANGLE wrap_glGetTranslatedShaderSourceANGLE
-#define glGetUniformBlockIndex wrap_glGetUniformBlockIndex
-#define glGetUniformIndices wrap_glGetUniformIndices
-#define glGetUniformLocation wrap_glGetUniformLocation
-#define glGetUniformfv wrap_glGetUniformfv
-#define glGetUniformiv wrap_glGetUniformiv
-#define glGetUniformuiv wrap_glGetUniformuiv
-#define glGetVertexAttribIiv wrap_glGetVertexAttribIiv
-#define glGetVertexAttribIuiv wrap_glGetVertexAttribIuiv
-#define glGetVertexAttribPointerv wrap_glGetVertexAttribPointerv
-#define glGetVertexAttribfv wrap_glGetVertexAttribfv
-#define glGetVertexAttribiv wrap_glGetVertexAttribiv
-#define glGetnUniformfv wrap_glGetnUniformfv
-#define glGetnUniformfvEXT wrap_glGetnUniformfvEXT
-#define glGetnUniformfvKHR wrap_glGetnUniformfvKHR
-#define glGetnUniformiv wrap_glGetnUniformiv
-#define glGetnUniformivEXT wrap_glGetnUniformivEXT
-#define glGetnUniformivKHR wrap_glGetnUniformivKHR
-#define glGetnUniformuiv wrap_glGetnUniformuiv
-#define glGetnUniformuivKHR wrap_glGetnUniformuivKHR
-#define glHint wrap_glHint
-#define glInsertEventMarkerEXT wrap_glInsertEventMarkerEXT
-#define glInterpolatePathsNV wrap_glInterpolatePathsNV
-#define glInvalidateFramebuffer wrap_glInvalidateFramebuffer
-#define glInvalidateSubFramebuffer wrap_glInvalidateSubFramebuffer
-#define glIsBuffer wrap_glIsBuffer
-#define glIsEnabled wrap_glIsEnabled
-#define glIsEnabledi wrap_glIsEnabledi
-#define glIsEnablediEXT wrap_glIsEnablediEXT
-#define glIsEnablediNV wrap_glIsEnablediNV
-#define glIsEnablediOES wrap_glIsEnablediOES
-#define glIsFenceNV wrap_glIsFenceNV
-#define glIsFramebuffer wrap_glIsFramebuffer
-#define glIsFramebufferOES wrap_glIsFramebufferOES
-#define glIsImageHandleResidentNV wrap_glIsImageHandleResidentNV
-#define glIsPathNV wrap_glIsPathNV
-#define glIsPointInFillPathNV wrap_glIsPointInFillPathNV
-#define glIsPointInStrokePathNV wrap_glIsPointInStrokePathNV
-#define glIsProgram wrap_glIsProgram
-#define glIsProgramPipeline wrap_glIsProgramPipeline
-#define glIsProgramPipelineEXT wrap_glIsProgramPipelineEXT
-#define glIsQuery wrap_glIsQuery
-#define glIsQueryEXT wrap_glIsQueryEXT
-#define glIsRenderbuffer wrap_glIsRenderbuffer
-#define glIsRenderbufferOES wrap_glIsRenderbufferOES
-#define glIsSampler wrap_glIsSampler
-#define glIsShader wrap_glIsShader
-#define glIsSync wrap_glIsSync
-#define glIsSyncAPPLE wrap_glIsSyncAPPLE
-#define glIsTexture wrap_glIsTexture
-#define glIsTextureHandleResidentNV wrap_glIsTextureHandleResidentNV
-#define glIsTransformFeedback wrap_glIsTransformFeedback
-#define glIsVertexArray wrap_glIsVertexArray
-#define glIsVertexArrayOES wrap_glIsVertexArrayOES
-#define glLabelObjectEXT wrap_glLabelObjectEXT
-#define glLightModelf wrap_glLightModelf
-#define glLightModelfv wrap_glLightModelfv
-#define glLightModelx wrap_glLightModelx
-#define glLightModelxOES wrap_glLightModelxOES
-#define glLightModelxv wrap_glLightModelxv
-#define glLightModelxvOES wrap_glLightModelxvOES
-#define glLightf wrap_glLightf
-#define glLightfv wrap_glLightfv
-#define glLightx wrap_glLightx
-#define glLightxOES wrap_glLightxOES
-#define glLightxv wrap_glLightxv
-#define glLightxvOES wrap_glLightxvOES
-#define glLineWidth wrap_glLineWidth
-#define glLineWidthx wrap_glLineWidthx
-#define glLineWidthxOES wrap_glLineWidthxOES
-#define glLinkProgram wrap_glLinkProgram
-#define glLoadIdentity wrap_glLoadIdentity
-#define glLoadMatrixf wrap_glLoadMatrixf
-#define glLoadMatrixx wrap_glLoadMatrixx
-#define glLoadMatrixxOES wrap_glLoadMatrixxOES
-#define glLoadPaletteFromModelViewMatrixOES wrap_glLoadPaletteFromModelViewMatrixOES
-#define glLogicOp wrap_glLogicOp
-#define glMakeImageHandleNonResidentNV wrap_glMakeImageHandleNonResidentNV
-#define glMakeImageHandleResidentNV wrap_glMakeImageHandleResidentNV
-#define glMakeTextureHandleNonResidentNV wrap_glMakeTextureHandleNonResidentNV
-#define glMakeTextureHandleResidentNV wrap_glMakeTextureHandleResidentNV
-#define glMapBufferOES wrap_glMapBufferOES
-#define glMapBufferRange wrap_glMapBufferRange
-#define glMapBufferRangeEXT wrap_glMapBufferRangeEXT
-#define glMaterialf wrap_glMaterialf
-#define glMaterialfv wrap_glMaterialfv
-#define glMaterialx wrap_glMaterialx
-#define glMaterialxOES wrap_glMaterialxOES
-#define glMaterialxv wrap_glMaterialxv
-#define glMaterialxvOES wrap_glMaterialxvOES
-#define glMatrixIndexPointerOES wrap_glMatrixIndexPointerOES
-#define glMatrixLoad3x2fNV wrap_glMatrixLoad3x2fNV
-#define glMatrixLoad3x3fNV wrap_glMatrixLoad3x3fNV
-#define glMatrixLoadTranspose3x3fNV wrap_glMatrixLoadTranspose3x3fNV
-#define glMatrixMode wrap_glMatrixMode
-#define glMatrixMult3x2fNV wrap_glMatrixMult3x2fNV
-#define glMatrixMult3x3fNV wrap_glMatrixMult3x3fNV
-#define glMatrixMultTranspose3x3fNV wrap_glMatrixMultTranspose3x3fNV
-#define glMemoryBarrier wrap_glMemoryBarrier
-#define glMemoryBarrierByRegion wrap_glMemoryBarrierByRegion
-#define glMinSampleShading wrap_glMinSampleShading
-#define glMinSampleShadingOES wrap_glMinSampleShadingOES
-#define glMultMatrixf wrap_glMultMatrixf
-#define glMultMatrixx wrap_glMultMatrixx
-#define glMultMatrixxOES wrap_glMultMatrixxOES
-#define glMultiDrawArraysEXT wrap_glMultiDrawArraysEXT
-#define glMultiDrawArraysIndirectEXT wrap_glMultiDrawArraysIndirectEXT
-#define glMultiDrawElementsBaseVertexEXT wrap_glMultiDrawElementsBaseVertexEXT
-#define glMultiDrawElementsBaseVertexOES wrap_glMultiDrawElementsBaseVertexOES
-#define glMultiDrawElementsEXT wrap_glMultiDrawElementsEXT
-#define glMultiDrawElementsIndirectEXT wrap_glMultiDrawElementsIndirectEXT
-#define glMultiTexCoord4f wrap_glMultiTexCoord4f
-#define glMultiTexCoord4x wrap_glMultiTexCoord4x
-#define glMultiTexCoord4xOES wrap_glMultiTexCoord4xOES
-#define glNamedFramebufferSampleLocationsfvNV wrap_glNamedFramebufferSampleLocationsfvNV
-#define glNormal3f wrap_glNormal3f
-#define glNormal3x wrap_glNormal3x
-#define glNormal3xOES wrap_glNormal3xOES
-#define glNormalPointer wrap_glNormalPointer
-#define glObjectLabel wrap_glObjectLabel
-#define glObjectLabelKHR wrap_glObjectLabelKHR
-#define glObjectPtrLabel wrap_glObjectPtrLabel
-#define glObjectPtrLabelKHR wrap_glObjectPtrLabelKHR
-#define glOrthof wrap_glOrthof
-#define glOrthofOES wrap_glOrthofOES
-#define glOrthox wrap_glOrthox
-#define glOrthoxOES wrap_glOrthoxOES
-#define glPatchParameteri wrap_glPatchParameteri
-#define glPatchParameteriEXT wrap_glPatchParameteriEXT
-#define glPatchParameteriOES wrap_glPatchParameteriOES
-#define glPathCommandsNV wrap_glPathCommandsNV
-#define glPathCoordsNV wrap_glPathCoordsNV
-#define glPathCoverDepthFuncNV wrap_glPathCoverDepthFuncNV
-#define glPathDashArrayNV wrap_glPathDashArrayNV
-#define glPathGlyphIndexArrayNV wrap_glPathGlyphIndexArrayNV
-#define glPathGlyphIndexRangeNV wrap_glPathGlyphIndexRangeNV
-#define glPathGlyphRangeNV wrap_glPathGlyphRangeNV
-#define glPathGlyphsNV wrap_glPathGlyphsNV
-#define glPathMemoryGlyphIndexArrayNV wrap_glPathMemoryGlyphIndexArrayNV
-#define glPathParameterfNV wrap_glPathParameterfNV
-#define glPathParameterfvNV wrap_glPathParameterfvNV
-#define glPathParameteriNV wrap_glPathParameteriNV
-#define glPathParameterivNV wrap_glPathParameterivNV
-#define glPathStencilDepthOffsetNV wrap_glPathStencilDepthOffsetNV
-#define glPathStencilFuncNV wrap_glPathStencilFuncNV
-#define glPathStringNV wrap_glPathStringNV
-#define glPathSubCommandsNV wrap_glPathSubCommandsNV
-#define glPathSubCoordsNV wrap_glPathSubCoordsNV
-#define glPauseTransformFeedback wrap_glPauseTransformFeedback
-#define glPixelStorei wrap_glPixelStorei
-#define glPointAlongPathNV wrap_glPointAlongPathNV
-#define glPointParameterf wrap_glPointParameterf
-#define glPointParameterfv wrap_glPointParameterfv
-#define glPointParameterx wrap_glPointParameterx
-#define glPointParameterxOES wrap_glPointParameterxOES
-#define glPointParameterxv wrap_glPointParameterxv
-#define glPointParameterxvOES wrap_glPointParameterxvOES
-#define glPointSize wrap_glPointSize
-#define glPointSizePointerOES wrap_glPointSizePointerOES
-#define glPointSizex wrap_glPointSizex
-#define glPointSizexOES wrap_glPointSizexOES
-#define glPolygonModeNV wrap_glPolygonModeNV
-#define glPolygonOffset wrap_glPolygonOffset
-#define glPolygonOffsetx wrap_glPolygonOffsetx
-#define glPolygonOffsetxOES wrap_glPolygonOffsetxOES
-#define glPopDebugGroup wrap_glPopDebugGroup
-#define glPopDebugGroupKHR wrap_glPopDebugGroupKHR
-#define glPopGroupMarkerEXT wrap_glPopGroupMarkerEXT
-#define glPopMatrix wrap_glPopMatrix
-#define glPrimitiveBoundingBox wrap_glPrimitiveBoundingBox
-#define glPrimitiveBoundingBoxEXT wrap_glPrimitiveBoundingBoxEXT
-#define glPrimitiveBoundingBoxOES wrap_glPrimitiveBoundingBoxOES
-#define glProgramBinary wrap_glProgramBinary
-#define glProgramBinaryOES wrap_glProgramBinaryOES
-#define glProgramParameteri wrap_glProgramParameteri
-#define glProgramParameteriEXT wrap_glProgramParameteriEXT
-#define glProgramPathFragmentInputGenNV wrap_glProgramPathFragmentInputGenNV
-#define glProgramUniform1f wrap_glProgramUniform1f
-#define glProgramUniform1fEXT wrap_glProgramUniform1fEXT
-#define glProgramUniform1fv wrap_glProgramUniform1fv
-#define glProgramUniform1fvEXT wrap_glProgramUniform1fvEXT
-#define glProgramUniform1i wrap_glProgramUniform1i
-#define glProgramUniform1iEXT wrap_glProgramUniform1iEXT
-#define glProgramUniform1iv wrap_glProgramUniform1iv
-#define glProgramUniform1ivEXT wrap_glProgramUniform1ivEXT
-#define glProgramUniform1ui wrap_glProgramUniform1ui
-#define glProgramUniform1uiEXT wrap_glProgramUniform1uiEXT
-#define glProgramUniform1uiv wrap_glProgramUniform1uiv
-#define glProgramUniform1uivEXT wrap_glProgramUniform1uivEXT
-#define glProgramUniform2f wrap_glProgramUniform2f
-#define glProgramUniform2fEXT wrap_glProgramUniform2fEXT
-#define glProgramUniform2fv wrap_glProgramUniform2fv
-#define glProgramUniform2fvEXT wrap_glProgramUniform2fvEXT
-#define glProgramUniform2i wrap_glProgramUniform2i
-#define glProgramUniform2iEXT wrap_glProgramUniform2iEXT
-#define glProgramUniform2iv wrap_glProgramUniform2iv
-#define glProgramUniform2ivEXT wrap_glProgramUniform2ivEXT
-#define glProgramUniform2ui wrap_glProgramUniform2ui
-#define glProgramUniform2uiEXT wrap_glProgramUniform2uiEXT
-#define glProgramUniform2uiv wrap_glProgramUniform2uiv
-#define glProgramUniform2uivEXT wrap_glProgramUniform2uivEXT
-#define glProgramUniform3f wrap_glProgramUniform3f
-#define glProgramUniform3fEXT wrap_glProgramUniform3fEXT
-#define glProgramUniform3fv wrap_glProgramUniform3fv
-#define glProgramUniform3fvEXT wrap_glProgramUniform3fvEXT
-#define glProgramUniform3i wrap_glProgramUniform3i
-#define glProgramUniform3iEXT wrap_glProgramUniform3iEXT
-#define glProgramUniform3iv wrap_glProgramUniform3iv
-#define glProgramUniform3ivEXT wrap_glProgramUniform3ivEXT
-#define glProgramUniform3ui wrap_glProgramUniform3ui
-#define glProgramUniform3uiEXT wrap_glProgramUniform3uiEXT
-#define glProgramUniform3uiv wrap_glProgramUniform3uiv
-#define glProgramUniform3uivEXT wrap_glProgramUniform3uivEXT
-#define glProgramUniform4f wrap_glProgramUniform4f
-#define glProgramUniform4fEXT wrap_glProgramUniform4fEXT
-#define glProgramUniform4fv wrap_glProgramUniform4fv
-#define glProgramUniform4fvEXT wrap_glProgramUniform4fvEXT
-#define glProgramUniform4i wrap_glProgramUniform4i
-#define glProgramUniform4iEXT wrap_glProgramUniform4iEXT
-#define glProgramUniform4iv wrap_glProgramUniform4iv
-#define glProgramUniform4ivEXT wrap_glProgramUniform4ivEXT
-#define glProgramUniform4ui wrap_glProgramUniform4ui
-#define glProgramUniform4uiEXT wrap_glProgramUniform4uiEXT
-#define glProgramUniform4uiv wrap_glProgramUniform4uiv
-#define glProgramUniform4uivEXT wrap_glProgramUniform4uivEXT
-#define glProgramUniformHandleui64NV wrap_glProgramUniformHandleui64NV
-#define glProgramUniformHandleui64vNV wrap_glProgramUniformHandleui64vNV
-#define glProgramUniformMatrix2fv wrap_glProgramUniformMatrix2fv
-#define glProgramUniformMatrix2fvEXT wrap_glProgramUniformMatrix2fvEXT
-#define glProgramUniformMatrix2x3fv wrap_glProgramUniformMatrix2x3fv
-#define glProgramUniformMatrix2x3fvEXT wrap_glProgramUniformMatrix2x3fvEXT
-#define glProgramUniformMatrix2x4fv wrap_glProgramUniformMatrix2x4fv
-#define glProgramUniformMatrix2x4fvEXT wrap_glProgramUniformMatrix2x4fvEXT
-#define glProgramUniformMatrix3fv wrap_glProgramUniformMatrix3fv
-#define glProgramUniformMatrix3fvEXT wrap_glProgramUniformMatrix3fvEXT
-#define glProgramUniformMatrix3x2fv wrap_glProgramUniformMatrix3x2fv
-#define glProgramUniformMatrix3x2fvEXT wrap_glProgramUniformMatrix3x2fvEXT
-#define glProgramUniformMatrix3x4fv wrap_glProgramUniformMatrix3x4fv
-#define glProgramUniformMatrix3x4fvEXT wrap_glProgramUniformMatrix3x4fvEXT
-#define glProgramUniformMatrix4fv wrap_glProgramUniformMatrix4fv
-#define glProgramUniformMatrix4fvEXT wrap_glProgramUniformMatrix4fvEXT
-#define glProgramUniformMatrix4x2fv wrap_glProgramUniformMatrix4x2fv
-#define glProgramUniformMatrix4x2fvEXT wrap_glProgramUniformMatrix4x2fvEXT
-#define glProgramUniformMatrix4x3fv wrap_glProgramUniformMatrix4x3fv
-#define glProgramUniformMatrix4x3fvEXT wrap_glProgramUniformMatrix4x3fvEXT
-#define glPushDebugGroup wrap_glPushDebugGroup
-#define glPushDebugGroupKHR wrap_glPushDebugGroupKHR
-#define glPushGroupMarkerEXT wrap_glPushGroupMarkerEXT
-#define glPushMatrix wrap_glPushMatrix
-#define glQueryCounterEXT wrap_glQueryCounterEXT
-#define glQueryMatrixxOES wrap_glQueryMatrixxOES
-#define glRasterSamplesEXT wrap_glRasterSamplesEXT
-#define glReadBuffer wrap_glReadBuffer
-#define glReadBufferIndexedEXT wrap_glReadBufferIndexedEXT
-#define glReadBufferNV wrap_glReadBufferNV
-#define glReadPixels wrap_glReadPixels
-#define glReadnPixels wrap_glReadnPixels
-#define glReadnPixelsEXT wrap_glReadnPixelsEXT
-#define glReadnPixelsKHR wrap_glReadnPixelsKHR
-#define glReleaseShaderCompiler wrap_glReleaseShaderCompiler
-#define glRenderbufferStorage wrap_glRenderbufferStorage
-#define glRenderbufferStorageMultisample wrap_glRenderbufferStorageMultisample
-#define glRenderbufferStorageMultisampleANGLE wrap_glRenderbufferStorageMultisampleANGLE
-#define glRenderbufferStorageMultisampleAPPLE wrap_glRenderbufferStorageMultisampleAPPLE
-#define glRenderbufferStorageMultisampleEXT wrap_glRenderbufferStorageMultisampleEXT
-#define glRenderbufferStorageMultisampleIMG wrap_glRenderbufferStorageMultisampleIMG
-#define glRenderbufferStorageMultisampleNV wrap_glRenderbufferStorageMultisampleNV
-#define glRenderbufferStorageOES wrap_glRenderbufferStorageOES
-#define glResolveDepthValuesNV wrap_glResolveDepthValuesNV
-#define glResolveMultisampleFramebufferAPPLE wrap_glResolveMultisampleFramebufferAPPLE
-#define glResumeTransformFeedback wrap_glResumeTransformFeedback
-#define glRotatef wrap_glRotatef
-#define glRotatex wrap_glRotatex
-#define glRotatexOES wrap_glRotatexOES
-#define glSampleCoverage wrap_glSampleCoverage
-#define glSampleCoveragex wrap_glSampleCoveragex
-#define glSampleCoveragexOES wrap_glSampleCoveragexOES
-#define glSampleMaski wrap_glSampleMaski
-#define glSamplerParameterIiv wrap_glSamplerParameterIiv
-#define glSamplerParameterIivEXT wrap_glSamplerParameterIivEXT
-#define glSamplerParameterIivOES wrap_glSamplerParameterIivOES
-#define glSamplerParameterIuiv wrap_glSamplerParameterIuiv
-#define glSamplerParameterIuivEXT wrap_glSamplerParameterIuivEXT
-#define glSamplerParameterIuivOES wrap_glSamplerParameterIuivOES
-#define glSamplerParameterf wrap_glSamplerParameterf
-#define glSamplerParameterfv wrap_glSamplerParameterfv
-#define glSamplerParameteri wrap_glSamplerParameteri
-#define glSamplerParameteriv wrap_glSamplerParameteriv
-#define glScalef wrap_glScalef
-#define glScalex wrap_glScalex
-#define glScalexOES wrap_glScalexOES
-#define glScissor wrap_glScissor
-#define glScissorArrayvNV wrap_glScissorArrayvNV
-#define glScissorIndexedNV wrap_glScissorIndexedNV
-#define glScissorIndexedvNV wrap_glScissorIndexedvNV
-#define glSelectPerfMonitorCountersAMD wrap_glSelectPerfMonitorCountersAMD
-#define glSetFenceNV wrap_glSetFenceNV
-#define glShadeModel wrap_glShadeModel
-#define glShaderBinary wrap_glShaderBinary
-#define glShaderSource wrap_glShaderSource
-#define glStartTilingQCOM wrap_glStartTilingQCOM
-#define glStencilFillPathInstancedNV wrap_glStencilFillPathInstancedNV
-#define glStencilFillPathNV wrap_glStencilFillPathNV
-#define glStencilFunc wrap_glStencilFunc
-#define glStencilFuncSeparate wrap_glStencilFuncSeparate
-#define glStencilMask wrap_glStencilMask
-#define glStencilMaskSeparate wrap_glStencilMaskSeparate
-#define glStencilOp wrap_glStencilOp
-#define glStencilOpSeparate wrap_glStencilOpSeparate
-#define glStencilStrokePathInstancedNV wrap_glStencilStrokePathInstancedNV
-#define glStencilStrokePathNV wrap_glStencilStrokePathNV
-#define glStencilThenCoverFillPathInstancedNV wrap_glStencilThenCoverFillPathInstancedNV
-#define glStencilThenCoverFillPathNV wrap_glStencilThenCoverFillPathNV
-#define glStencilThenCoverStrokePathInstancedNV wrap_glStencilThenCoverStrokePathInstancedNV
-#define glStencilThenCoverStrokePathNV wrap_glStencilThenCoverStrokePathNV
-#define glSubpixelPrecisionBiasNV wrap_glSubpixelPrecisionBiasNV
-#define glTestFenceNV wrap_glTestFenceNV
-#define glTexBuffer wrap_glTexBuffer
-#define glTexBufferEXT wrap_glTexBufferEXT
-#define glTexBufferOES wrap_glTexBufferOES
-#define glTexBufferRange wrap_glTexBufferRange
-#define glTexBufferRangeEXT wrap_glTexBufferRangeEXT
-#define glTexBufferRangeOES wrap_glTexBufferRangeOES
-#define glTexCoordPointer wrap_glTexCoordPointer
-#define glTexEnvf wrap_glTexEnvf
-#define glTexEnvfv wrap_glTexEnvfv
-#define glTexEnvi wrap_glTexEnvi
-#define glTexEnviv wrap_glTexEnviv
-#define glTexEnvx wrap_glTexEnvx
-#define glTexEnvxOES wrap_glTexEnvxOES
-#define glTexEnvxv wrap_glTexEnvxv
-#define glTexEnvxvOES wrap_glTexEnvxvOES
-#define glTexGenfOES wrap_glTexGenfOES
-#define glTexGenfvOES wrap_glTexGenfvOES
-#define glTexGeniOES wrap_glTexGeniOES
-#define glTexGenivOES wrap_glTexGenivOES
-#define glTexGenxOES wrap_glTexGenxOES
-#define glTexGenxvOES wrap_glTexGenxvOES
-#define glTexImage2D wrap_glTexImage2D
-#define glTexImage3D wrap_glTexImage3D
-#define glTexImage3DOES wrap_glTexImage3DOES
-#define glTexPageCommitmentEXT wrap_glTexPageCommitmentEXT
-#define glTexParameterIiv wrap_glTexParameterIiv
-#define glTexParameterIivEXT wrap_glTexParameterIivEXT
-#define glTexParameterIivOES wrap_glTexParameterIivOES
-#define glTexParameterIuiv wrap_glTexParameterIuiv
-#define glTexParameterIuivEXT wrap_glTexParameterIuivEXT
-#define glTexParameterIuivOES wrap_glTexParameterIuivOES
-#define glTexParameterf wrap_glTexParameterf
-#define glTexParameterfv wrap_glTexParameterfv
-#define glTexParameteri wrap_glTexParameteri
-#define glTexParameteriv wrap_glTexParameteriv
-#define glTexParameterx wrap_glTexParameterx
-#define glTexParameterxOES wrap_glTexParameterxOES
-#define glTexParameterxv wrap_glTexParameterxv
-#define glTexParameterxvOES wrap_glTexParameterxvOES
-#define glTexStorage1DEXT wrap_glTexStorage1DEXT
-#define glTexStorage2D wrap_glTexStorage2D
-#define glTexStorage2DEXT wrap_glTexStorage2DEXT
-#define glTexStorage2DMultisample wrap_glTexStorage2DMultisample
-#define glTexStorage3D wrap_glTexStorage3D
-#define glTexStorage3DEXT wrap_glTexStorage3DEXT
-#define glTexStorage3DMultisample wrap_glTexStorage3DMultisample
-#define glTexStorage3DMultisampleOES wrap_glTexStorage3DMultisampleOES
-#define glTexSubImage2D wrap_glTexSubImage2D
-#define glTexSubImage3D wrap_glTexSubImage3D
-#define glTexSubImage3DOES wrap_glTexSubImage3DOES
-#define glTextureStorage1DEXT wrap_glTextureStorage1DEXT
-#define glTextureStorage2DEXT wrap_glTextureStorage2DEXT
-#define glTextureStorage3DEXT wrap_glTextureStorage3DEXT
-#define glTextureViewEXT wrap_glTextureViewEXT
-#define glTextureViewOES wrap_glTextureViewOES
-#define glTransformFeedbackVaryings wrap_glTransformFeedbackVaryings
-#define glTransformPathNV wrap_glTransformPathNV
-#define glTranslatef wrap_glTranslatef
-#define glTranslatex wrap_glTranslatex
-#define glTranslatexOES wrap_glTranslatexOES
-#define glUniform1f wrap_glUniform1f
-#define glUniform1fv wrap_glUniform1fv
-#define glUniform1i wrap_glUniform1i
-#define glUniform1iv wrap_glUniform1iv
-#define glUniform1ui wrap_glUniform1ui
-#define glUniform1uiv wrap_glUniform1uiv
-#define glUniform2f wrap_glUniform2f
-#define glUniform2fv wrap_glUniform2fv
-#define glUniform2i wrap_glUniform2i
-#define glUniform2iv wrap_glUniform2iv
-#define glUniform2ui wrap_glUniform2ui
-#define glUniform2uiv wrap_glUniform2uiv
-#define glUniform3f wrap_glUniform3f
-#define glUniform3fv wrap_glUniform3fv
-#define glUniform3i wrap_glUniform3i
-#define glUniform3iv wrap_glUniform3iv
-#define glUniform3ui wrap_glUniform3ui
-#define glUniform3uiv wrap_glUniform3uiv
-#define glUniform4f wrap_glUniform4f
-#define glUniform4fv wrap_glUniform4fv
-#define glUniform4i wrap_glUniform4i
-#define glUniform4iv wrap_glUniform4iv
-#define glUniform4ui wrap_glUniform4ui
-#define glUniform4uiv wrap_glUniform4uiv
-#define glUniformBlockBinding wrap_glUniformBlockBinding
-#define glUniformHandleui64NV wrap_glUniformHandleui64NV
-#define glUniformHandleui64vNV wrap_glUniformHandleui64vNV
-#define glUniformMatrix2fv wrap_glUniformMatrix2fv
-#define glUniformMatrix2x3fv wrap_glUniformMatrix2x3fv
-#define glUniformMatrix2x3fvNV wrap_glUniformMatrix2x3fvNV
-#define glUniformMatrix2x4fv wrap_glUniformMatrix2x4fv
-#define glUniformMatrix2x4fvNV wrap_glUniformMatrix2x4fvNV
-#define glUniformMatrix3fv wrap_glUniformMatrix3fv
-#define glUniformMatrix3x2fv wrap_glUniformMatrix3x2fv
-#define glUniformMatrix3x2fvNV wrap_glUniformMatrix3x2fvNV
-#define glUniformMatrix3x4fv wrap_glUniformMatrix3x4fv
-#define glUniformMatrix3x4fvNV wrap_glUniformMatrix3x4fvNV
-#define glUniformMatrix4fv wrap_glUniformMatrix4fv
-#define glUniformMatrix4x2fv wrap_glUniformMatrix4x2fv
-#define glUniformMatrix4x2fvNV wrap_glUniformMatrix4x2fvNV
-#define glUniformMatrix4x3fv wrap_glUniformMatrix4x3fv
-#define glUniformMatrix4x3fvNV wrap_glUniformMatrix4x3fvNV
-#define glUnmapBuffer wrap_glUnmapBuffer
-#define glUnmapBufferOES wrap_glUnmapBufferOES
-#define glUseProgram wrap_glUseProgram
-#define glUseProgramStages wrap_glUseProgramStages
-#define glUseProgramStagesEXT wrap_glUseProgramStagesEXT
-#define glValidateProgram wrap_glValidateProgram
-#define glValidateProgramPipeline wrap_glValidateProgramPipeline
-#define glValidateProgramPipelineEXT wrap_glValidateProgramPipelineEXT
-#define glVertexAttrib1f wrap_glVertexAttrib1f
-#define glVertexAttrib1fv wrap_glVertexAttrib1fv
-#define glVertexAttrib2f wrap_glVertexAttrib2f
-#define glVertexAttrib2fv wrap_glVertexAttrib2fv
-#define glVertexAttrib3f wrap_glVertexAttrib3f
-#define glVertexAttrib3fv wrap_glVertexAttrib3fv
-#define glVertexAttrib4f wrap_glVertexAttrib4f
-#define glVertexAttrib4fv wrap_glVertexAttrib4fv
-#define glVertexAttribBinding wrap_glVertexAttribBinding
-#define glVertexAttribDivisor wrap_glVertexAttribDivisor
-#define glVertexAttribDivisorANGLE wrap_glVertexAttribDivisorANGLE
-#define glVertexAttribDivisorEXT wrap_glVertexAttribDivisorEXT
-#define glVertexAttribDivisorNV wrap_glVertexAttribDivisorNV
-#define glVertexAttribFormat wrap_glVertexAttribFormat
-#define glVertexAttribI4i wrap_glVertexAttribI4i
-#define glVertexAttribI4iv wrap_glVertexAttribI4iv
-#define glVertexAttribI4ui wrap_glVertexAttribI4ui
-#define glVertexAttribI4uiv wrap_glVertexAttribI4uiv
-#define glVertexAttribIFormat wrap_glVertexAttribIFormat
-#define glVertexAttribIPointer wrap_glVertexAttribIPointer
-#define glVertexAttribPointer wrap_glVertexAttribPointer
-#define glVertexBindingDivisor wrap_glVertexBindingDivisor
-#define glVertexPointer wrap_glVertexPointer
-#define glViewport wrap_glViewport
-#define glViewportArrayvNV wrap_glViewportArrayvNV
-#define glViewportIndexedfNV wrap_glViewportIndexedfNV
-#define glViewportIndexedfvNV wrap_glViewportIndexedfvNV
-#define glWaitSync wrap_glWaitSync
-#define glWaitSyncAPPLE wrap_glWaitSyncAPPLE
-#define glWeightPathsNV wrap_glWeightPathsNV
-#define glWeightPointerOES wrap_glWeightPointerOES \ No newline at end of file
diff --git a/libs/hwui/debug/gles_stubs.in b/libs/hwui/debug/gles_stubs.in
deleted file mode 100644
index 7cba0c115814..000000000000
--- a/libs/hwui/debug/gles_stubs.in
+++ /dev/null
@@ -1,1629 +0,0 @@
-void API_ENTRY(glActiveTexture)(GLenum texture) {
- CALL_GL_API(glActiveTexture, texture);
-}
-void API_ENTRY(glAttachShader)(GLuint program, GLuint shader) {
- CALL_GL_API(glAttachShader, program, shader);
-}
-void API_ENTRY(glBindAttribLocation)(GLuint program, GLuint index, const GLchar *name) {
- CALL_GL_API(glBindAttribLocation, program, index, name);
-}
-void API_ENTRY(glBindBuffer)(GLenum target, GLuint buffer) {
- CALL_GL_API(glBindBuffer, target, buffer);
-}
-void API_ENTRY(glBindFramebuffer)(GLenum target, GLuint framebuffer) {
- CALL_GL_API(glBindFramebuffer, target, framebuffer);
-}
-void API_ENTRY(glBindRenderbuffer)(GLenum target, GLuint renderbuffer) {
- CALL_GL_API(glBindRenderbuffer, target, renderbuffer);
-}
-void API_ENTRY(glBindTexture)(GLenum target, GLuint texture) {
- CALL_GL_API(glBindTexture, target, texture);
-}
-void API_ENTRY(glBlendColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
- CALL_GL_API(glBlendColor, red, green, blue, alpha);
-}
-void API_ENTRY(glBlendEquation)(GLenum mode) {
- CALL_GL_API(glBlendEquation, mode);
-}
-void API_ENTRY(glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) {
- CALL_GL_API(glBlendEquationSeparate, modeRGB, modeAlpha);
-}
-void API_ENTRY(glBlendFunc)(GLenum sfactor, GLenum dfactor) {
- CALL_GL_API(glBlendFunc, sfactor, dfactor);
-}
-void API_ENTRY(glBlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {
- CALL_GL_API(glBlendFuncSeparate, sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
-}
-void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const void *data, GLenum usage) {
- CALL_GL_API(glBufferData, target, size, data, usage);
-}
-void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const void *data) {
- CALL_GL_API(glBufferSubData, target, offset, size, data);
-}
-GLenum API_ENTRY(glCheckFramebufferStatus)(GLenum target) {
- CALL_GL_API_RETURN(glCheckFramebufferStatus, target);
-}
-void API_ENTRY(glClear)(GLbitfield mask) {
- CALL_GL_API(glClear, mask);
-}
-void API_ENTRY(glClearColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
- CALL_GL_API(glClearColor, red, green, blue, alpha);
-}
-void API_ENTRY(glClearDepthf)(GLfloat d) {
- CALL_GL_API(glClearDepthf, d);
-}
-void API_ENTRY(glClearStencil)(GLint s) {
- CALL_GL_API(glClearStencil, s);
-}
-void API_ENTRY(glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
- CALL_GL_API(glColorMask, red, green, blue, alpha);
-}
-void API_ENTRY(glCompileShader)(GLuint shader) {
- CALL_GL_API(glCompileShader, shader);
-}
-void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data) {
- CALL_GL_API(glCompressedTexImage2D, target, level, internalformat, width, height, border, imageSize, data);
-}
-void API_ENTRY(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) {
- CALL_GL_API(glCompressedTexSubImage2D, target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-void API_ENTRY(glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
- CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y, width, height, border);
-}
-void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glCopyTexSubImage2D, target, level, xoffset, yoffset, x, y, width, height);
-}
-GLuint API_ENTRY(glCreateProgram)(void) {
- CALL_GL_API_RETURN(glCreateProgram);
-}
-GLuint API_ENTRY(glCreateShader)(GLenum type) {
- CALL_GL_API_RETURN(glCreateShader, type);
-}
-void API_ENTRY(glCullFace)(GLenum mode) {
- CALL_GL_API(glCullFace, mode);
-}
-void API_ENTRY(glDeleteBuffers)(GLsizei n, const GLuint *buffers) {
- CALL_GL_API(glDeleteBuffers, n, buffers);
-}
-void API_ENTRY(glDeleteFramebuffers)(GLsizei n, const GLuint *framebuffers) {
- CALL_GL_API(glDeleteFramebuffers, n, framebuffers);
-}
-void API_ENTRY(glDeleteProgram)(GLuint program) {
- CALL_GL_API(glDeleteProgram, program);
-}
-void API_ENTRY(glDeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers) {
- CALL_GL_API(glDeleteRenderbuffers, n, renderbuffers);
-}
-void API_ENTRY(glDeleteShader)(GLuint shader) {
- CALL_GL_API(glDeleteShader, shader);
-}
-void API_ENTRY(glDeleteTextures)(GLsizei n, const GLuint *textures) {
- CALL_GL_API(glDeleteTextures, n, textures);
-}
-void API_ENTRY(glDepthFunc)(GLenum func) {
- CALL_GL_API(glDepthFunc, func);
-}
-void API_ENTRY(glDepthMask)(GLboolean flag) {
- CALL_GL_API(glDepthMask, flag);
-}
-void API_ENTRY(glDepthRangef)(GLfloat n, GLfloat f) {
- CALL_GL_API(glDepthRangef, n, f);
-}
-void API_ENTRY(glDetachShader)(GLuint program, GLuint shader) {
- CALL_GL_API(glDetachShader, program, shader);
-}
-void API_ENTRY(glDisable)(GLenum cap) {
- CALL_GL_API(glDisable, cap);
-}
-void API_ENTRY(glDisableVertexAttribArray)(GLuint index) {
- CALL_GL_API(glDisableVertexAttribArray, index);
-}
-void API_ENTRY(glDrawArrays)(GLenum mode, GLint first, GLsizei count) {
- CALL_GL_API(glDrawArrays, mode, first, count);
-}
-void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, GLenum type, const void *indices) {
- CALL_GL_API(glDrawElements, mode, count, type, indices);
-}
-void API_ENTRY(glEnable)(GLenum cap) {
- CALL_GL_API(glEnable, cap);
-}
-void API_ENTRY(glEnableVertexAttribArray)(GLuint index) {
- CALL_GL_API(glEnableVertexAttribArray, index);
-}
-void API_ENTRY(glFinish)(void) {
- CALL_GL_API(glFinish);
-}
-void API_ENTRY(glFlush)(void) {
- CALL_GL_API(glFlush);
-}
-void API_ENTRY(glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
- CALL_GL_API(glFramebufferRenderbuffer, target, attachment, renderbuffertarget, renderbuffer);
-}
-void API_ENTRY(glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
- CALL_GL_API(glFramebufferTexture2D, target, attachment, textarget, texture, level);
-}
-void API_ENTRY(glFrontFace)(GLenum mode) {
- CALL_GL_API(glFrontFace, mode);
-}
-void API_ENTRY(glGenBuffers)(GLsizei n, GLuint *buffers) {
- CALL_GL_API(glGenBuffers, n, buffers);
-}
-void API_ENTRY(glGenerateMipmap)(GLenum target) {
- CALL_GL_API(glGenerateMipmap, target);
-}
-void API_ENTRY(glGenFramebuffers)(GLsizei n, GLuint *framebuffers) {
- CALL_GL_API(glGenFramebuffers, n, framebuffers);
-}
-void API_ENTRY(glGenRenderbuffers)(GLsizei n, GLuint *renderbuffers) {
- CALL_GL_API(glGenRenderbuffers, n, renderbuffers);
-}
-void API_ENTRY(glGenTextures)(GLsizei n, GLuint *textures) {
- CALL_GL_API(glGenTextures, n, textures);
-}
-void API_ENTRY(glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) {
- CALL_GL_API(glGetActiveAttrib, program, index, bufSize, length, size, type, name);
-}
-void API_ENTRY(glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) {
- CALL_GL_API(glGetActiveUniform, program, index, bufSize, length, size, type, name);
-}
-void API_ENTRY(glGetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders) {
- CALL_GL_API(glGetAttachedShaders, program, maxCount, count, shaders);
-}
-GLint API_ENTRY(glGetAttribLocation)(GLuint program, const GLchar *name) {
- CALL_GL_API_RETURN(glGetAttribLocation, program, name);
-}
-void API_ENTRY(glGetBooleanv)(GLenum pname, GLboolean *data) {
- CALL_GL_API(glGetBooleanv, pname, data);
-}
-void API_ENTRY(glGetBufferParameteriv)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetBufferParameteriv, target, pname, params);
-}
-GLenum API_ENTRY(glGetError)(void) {
- CALL_GL_API_RETURN(glGetError);
-}
-void API_ENTRY(glGetFloatv)(GLenum pname, GLfloat *data) {
- CALL_GL_API(glGetFloatv, pname, data);
-}
-void API_ENTRY(glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params) {
- CALL_GL_API(glGetFramebufferAttachmentParameteriv, target, attachment, pname, params);
-}
-void API_ENTRY(glGetIntegerv)(GLenum pname, GLint *data) {
- CALL_GL_API(glGetIntegerv, pname, data);
-}
-void API_ENTRY(glGetProgramiv)(GLuint program, GLenum pname, GLint *params) {
- CALL_GL_API(glGetProgramiv, program, pname, params);
-}
-void API_ENTRY(glGetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
- CALL_GL_API(glGetProgramInfoLog, program, bufSize, length, infoLog);
-}
-void API_ENTRY(glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetRenderbufferParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetShaderiv)(GLuint shader, GLenum pname, GLint *params) {
- CALL_GL_API(glGetShaderiv, shader, pname, params);
-}
-void API_ENTRY(glGetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
- CALL_GL_API(glGetShaderInfoLog, shader, bufSize, length, infoLog);
-}
-void API_ENTRY(glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision) {
- CALL_GL_API(glGetShaderPrecisionFormat, shadertype, precisiontype, range, precision);
-}
-void API_ENTRY(glGetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source) {
- CALL_GL_API(glGetShaderSource, shader, bufSize, length, source);
-}
-const GLubyte * API_ENTRY(glGetString)(GLenum name) {
- CALL_GL_API_RETURN(glGetString, name);
-}
-void API_ENTRY(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetUniformfv)(GLuint program, GLint location, GLfloat *params) {
- CALL_GL_API(glGetUniformfv, program, location, params);
-}
-void API_ENTRY(glGetUniformiv)(GLuint program, GLint location, GLint *params) {
- CALL_GL_API(glGetUniformiv, program, location, params);
-}
-GLint API_ENTRY(glGetUniformLocation)(GLuint program, const GLchar *name) {
- CALL_GL_API_RETURN(glGetUniformLocation, program, name);
-}
-void API_ENTRY(glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetVertexAttribfv, index, pname, params);
-}
-void API_ENTRY(glGetVertexAttribiv)(GLuint index, GLenum pname, GLint *params) {
- CALL_GL_API(glGetVertexAttribiv, index, pname, params);
-}
-void API_ENTRY(glGetVertexAttribPointerv)(GLuint index, GLenum pname, void **pointer) {
- CALL_GL_API(glGetVertexAttribPointerv, index, pname, pointer);
-}
-void API_ENTRY(glHint)(GLenum target, GLenum mode) {
- CALL_GL_API(glHint, target, mode);
-}
-GLboolean API_ENTRY(glIsBuffer)(GLuint buffer) {
- CALL_GL_API_RETURN(glIsBuffer, buffer);
-}
-GLboolean API_ENTRY(glIsEnabled)(GLenum cap) {
- CALL_GL_API_RETURN(glIsEnabled, cap);
-}
-GLboolean API_ENTRY(glIsFramebuffer)(GLuint framebuffer) {
- CALL_GL_API_RETURN(glIsFramebuffer, framebuffer);
-}
-GLboolean API_ENTRY(glIsProgram)(GLuint program) {
- CALL_GL_API_RETURN(glIsProgram, program);
-}
-GLboolean API_ENTRY(glIsRenderbuffer)(GLuint renderbuffer) {
- CALL_GL_API_RETURN(glIsRenderbuffer, renderbuffer);
-}
-GLboolean API_ENTRY(glIsShader)(GLuint shader) {
- CALL_GL_API_RETURN(glIsShader, shader);
-}
-GLboolean API_ENTRY(glIsTexture)(GLuint texture) {
- CALL_GL_API_RETURN(glIsTexture, texture);
-}
-void API_ENTRY(glLineWidth)(GLfloat width) {
- CALL_GL_API(glLineWidth, width);
-}
-void API_ENTRY(glLinkProgram)(GLuint program) {
- CALL_GL_API(glLinkProgram, program);
-}
-void API_ENTRY(glPixelStorei)(GLenum pname, GLint param) {
- CALL_GL_API(glPixelStorei, pname, param);
-}
-void API_ENTRY(glPolygonOffset)(GLfloat factor, GLfloat units) {
- CALL_GL_API(glPolygonOffset, factor, units);
-}
-void API_ENTRY(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels) {
- CALL_GL_API(glReadPixels, x, y, width, height, format, type, pixels);
-}
-void API_ENTRY(glReleaseShaderCompiler)(void) {
- CALL_GL_API(glReleaseShaderCompiler);
-}
-void API_ENTRY(glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorage, target, internalformat, width, height);
-}
-void API_ENTRY(glSampleCoverage)(GLfloat value, GLboolean invert) {
- CALL_GL_API(glSampleCoverage, value, invert);
-}
-void API_ENTRY(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glScissor, x, y, width, height);
-}
-void API_ENTRY(glShaderBinary)(GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length) {
- CALL_GL_API(glShaderBinary, count, shaders, binaryformat, binary, length);
-}
-void API_ENTRY(glShaderSource)(GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length) {
- CALL_GL_API(glShaderSource, shader, count, string, length);
-}
-void API_ENTRY(glStencilFunc)(GLenum func, GLint ref, GLuint mask) {
- CALL_GL_API(glStencilFunc, func, ref, mask);
-}
-void API_ENTRY(glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) {
- CALL_GL_API(glStencilFuncSeparate, face, func, ref, mask);
-}
-void API_ENTRY(glStencilMask)(GLuint mask) {
- CALL_GL_API(glStencilMask, mask);
-}
-void API_ENTRY(glStencilMaskSeparate)(GLenum face, GLuint mask) {
- CALL_GL_API(glStencilMaskSeparate, face, mask);
-}
-void API_ENTRY(glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) {
- CALL_GL_API(glStencilOp, fail, zfail, zpass);
-}
-void API_ENTRY(glStencilOpSeparate)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) {
- CALL_GL_API(glStencilOpSeparate, face, sfail, dpfail, dppass);
-}
-void API_ENTRY(glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels) {
- CALL_GL_API(glTexImage2D, target, level, internalformat, width, height, border, format, type, pixels);
-}
-void API_ENTRY(glTexParameterf)(GLenum target, GLenum pname, GLfloat param) {
- CALL_GL_API(glTexParameterf, target, pname, param);
-}
-void API_ENTRY(glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params) {
- CALL_GL_API(glTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glTexParameteri)(GLenum target, GLenum pname, GLint param) {
- CALL_GL_API(glTexParameteri, target, pname, param);
-}
-void API_ENTRY(glTexParameteriv)(GLenum target, GLenum pname, const GLint *params) {
- CALL_GL_API(glTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) {
- CALL_GL_API(glTexSubImage2D, target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-void API_ENTRY(glUniform1f)(GLint location, GLfloat v0) {
- CALL_GL_API(glUniform1f, location, v0);
-}
-void API_ENTRY(glUniform1fv)(GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glUniform1fv, location, count, value);
-}
-void API_ENTRY(glUniform1i)(GLint location, GLint v0) {
- CALL_GL_API(glUniform1i, location, v0);
-}
-void API_ENTRY(glUniform1iv)(GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glUniform1iv, location, count, value);
-}
-void API_ENTRY(glUniform2f)(GLint location, GLfloat v0, GLfloat v1) {
- CALL_GL_API(glUniform2f, location, v0, v1);
-}
-void API_ENTRY(glUniform2fv)(GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glUniform2fv, location, count, value);
-}
-void API_ENTRY(glUniform2i)(GLint location, GLint v0, GLint v1) {
- CALL_GL_API(glUniform2i, location, v0, v1);
-}
-void API_ENTRY(glUniform2iv)(GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glUniform2iv, location, count, value);
-}
-void API_ENTRY(glUniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
- CALL_GL_API(glUniform3f, location, v0, v1, v2);
-}
-void API_ENTRY(glUniform3fv)(GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glUniform3fv, location, count, value);
-}
-void API_ENTRY(glUniform3i)(GLint location, GLint v0, GLint v1, GLint v2) {
- CALL_GL_API(glUniform3i, location, v0, v1, v2);
-}
-void API_ENTRY(glUniform3iv)(GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glUniform3iv, location, count, value);
-}
-void API_ENTRY(glUniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
- CALL_GL_API(glUniform4f, location, v0, v1, v2, v3);
-}
-void API_ENTRY(glUniform4fv)(GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glUniform4fv, location, count, value);
-}
-void API_ENTRY(glUniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
- CALL_GL_API(glUniform4i, location, v0, v1, v2, v3);
-}
-void API_ENTRY(glUniform4iv)(GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glUniform4iv, location, count, value);
-}
-void API_ENTRY(glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glUniformMatrix2fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glUniformMatrix3fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glUniformMatrix4fv, location, count, transpose, value);
-}
-void API_ENTRY(glUseProgram)(GLuint program) {
- CALL_GL_API(glUseProgram, program);
-}
-void API_ENTRY(glValidateProgram)(GLuint program) {
- CALL_GL_API(glValidateProgram, program);
-}
-void API_ENTRY(glVertexAttrib1f)(GLuint index, GLfloat x) {
- CALL_GL_API(glVertexAttrib1f, index, x);
-}
-void API_ENTRY(glVertexAttrib1fv)(GLuint index, const GLfloat *v) {
- CALL_GL_API(glVertexAttrib1fv, index, v);
-}
-void API_ENTRY(glVertexAttrib2f)(GLuint index, GLfloat x, GLfloat y) {
- CALL_GL_API(glVertexAttrib2f, index, x, y);
-}
-void API_ENTRY(glVertexAttrib2fv)(GLuint index, const GLfloat *v) {
- CALL_GL_API(glVertexAttrib2fv, index, v);
-}
-void API_ENTRY(glVertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z) {
- CALL_GL_API(glVertexAttrib3f, index, x, y, z);
-}
-void API_ENTRY(glVertexAttrib3fv)(GLuint index, const GLfloat *v) {
- CALL_GL_API(glVertexAttrib3fv, index, v);
-}
-void API_ENTRY(glVertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
- CALL_GL_API(glVertexAttrib4f, index, x, y, z, w);
-}
-void API_ENTRY(glVertexAttrib4fv)(GLuint index, const GLfloat *v) {
- CALL_GL_API(glVertexAttrib4fv, index, v);
-}
-void API_ENTRY(glVertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer) {
- CALL_GL_API(glVertexAttribPointer, index, size, type, normalized, stride, pointer);
-}
-void API_ENTRY(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glViewport, x, y, width, height);
-}
-void API_ENTRY(glReadBuffer)(GLenum src) {
- CALL_GL_API(glReadBuffer, src);
-}
-void API_ENTRY(glDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices) {
- CALL_GL_API(glDrawRangeElements, mode, start, end, count, type, indices);
-}
-void API_ENTRY(glTexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels) {
- CALL_GL_API(glTexImage3D, target, level, internalformat, width, height, depth, border, format, type, pixels);
-}
-void API_ENTRY(glTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels) {
- CALL_GL_API(glTexSubImage3D, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-}
-void API_ENTRY(glCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glCopyTexSubImage3D, target, level, xoffset, yoffset, zoffset, x, y, width, height);
-}
-void API_ENTRY(glCompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data) {
- CALL_GL_API(glCompressedTexImage3D, target, level, internalformat, width, height, depth, border, imageSize, data);
-}
-void API_ENTRY(glCompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data) {
- CALL_GL_API(glCompressedTexSubImage3D, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
-}
-void API_ENTRY(glGenQueries)(GLsizei n, GLuint *ids) {
- CALL_GL_API(glGenQueries, n, ids);
-}
-void API_ENTRY(glDeleteQueries)(GLsizei n, const GLuint *ids) {
- CALL_GL_API(glDeleteQueries, n, ids);
-}
-GLboolean API_ENTRY(glIsQuery)(GLuint id) {
- CALL_GL_API_RETURN(glIsQuery, id);
-}
-void API_ENTRY(glBeginQuery)(GLenum target, GLuint id) {
- CALL_GL_API(glBeginQuery, target, id);
-}
-void API_ENTRY(glEndQuery)(GLenum target) {
- CALL_GL_API(glEndQuery, target);
-}
-void API_ENTRY(glGetQueryiv)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetQueryiv, target, pname, params);
-}
-void API_ENTRY(glGetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetQueryObjectuiv, id, pname, params);
-}
-GLboolean API_ENTRY(glUnmapBuffer)(GLenum target) {
- CALL_GL_API_RETURN(glUnmapBuffer, target);
-}
-void API_ENTRY(glGetBufferPointerv)(GLenum target, GLenum pname, void **params) {
- CALL_GL_API(glGetBufferPointerv, target, pname, params);
-}
-void API_ENTRY(glDrawBuffers)(GLsizei n, const GLenum *bufs) {
- CALL_GL_API(glDrawBuffers, n, bufs);
-}
-void API_ENTRY(glUniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glUniformMatrix2x3fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glUniformMatrix3x2fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glUniformMatrix2x4fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glUniformMatrix4x2fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glUniformMatrix3x4fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glUniformMatrix4x3fv, location, count, transpose, value);
-}
-void API_ENTRY(glBlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
- CALL_GL_API(glBlitFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-}
-void API_ENTRY(glRenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageMultisample, target, samples, internalformat, width, height);
-}
-void API_ENTRY(glFramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
- CALL_GL_API(glFramebufferTextureLayer, target, attachment, texture, level, layer);
-}
-void * API_ENTRY(glMapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) {
- CALL_GL_API_RETURN(glMapBufferRange, target, offset, length, access);
-}
-void API_ENTRY(glFlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length) {
- CALL_GL_API(glFlushMappedBufferRange, target, offset, length);
-}
-void API_ENTRY(glBindVertexArray)(GLuint array) {
- CALL_GL_API(glBindVertexArray, array);
-}
-void API_ENTRY(glDeleteVertexArrays)(GLsizei n, const GLuint *arrays) {
- CALL_GL_API(glDeleteVertexArrays, n, arrays);
-}
-void API_ENTRY(glGenVertexArrays)(GLsizei n, GLuint *arrays) {
- CALL_GL_API(glGenVertexArrays, n, arrays);
-}
-GLboolean API_ENTRY(glIsVertexArray)(GLuint array) {
- CALL_GL_API_RETURN(glIsVertexArray, array);
-}
-void API_ENTRY(glGetIntegeri_v)(GLenum target, GLuint index, GLint *data) {
- CALL_GL_API(glGetIntegeri_v, target, index, data);
-}
-void API_ENTRY(glBeginTransformFeedback)(GLenum primitiveMode) {
- CALL_GL_API(glBeginTransformFeedback, primitiveMode);
-}
-void API_ENTRY(glEndTransformFeedback)(void) {
- CALL_GL_API(glEndTransformFeedback);
-}
-void API_ENTRY(glBindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {
- CALL_GL_API(glBindBufferRange, target, index, buffer, offset, size);
-}
-void API_ENTRY(glBindBufferBase)(GLenum target, GLuint index, GLuint buffer) {
- CALL_GL_API(glBindBufferBase, target, index, buffer);
-}
-void API_ENTRY(glTransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode) {
- CALL_GL_API(glTransformFeedbackVaryings, program, count, varyings, bufferMode);
-}
-void API_ENTRY(glGetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name) {
- CALL_GL_API(glGetTransformFeedbackVarying, program, index, bufSize, length, size, type, name);
-}
-void API_ENTRY(glVertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer) {
- CALL_GL_API(glVertexAttribIPointer, index, size, type, stride, pointer);
-}
-void API_ENTRY(glGetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params) {
- CALL_GL_API(glGetVertexAttribIiv, index, pname, params);
-}
-void API_ENTRY(glGetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetVertexAttribIuiv, index, pname, params);
-}
-void API_ENTRY(glVertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w) {
- CALL_GL_API(glVertexAttribI4i, index, x, y, z, w);
-}
-void API_ENTRY(glVertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {
- CALL_GL_API(glVertexAttribI4ui, index, x, y, z, w);
-}
-void API_ENTRY(glVertexAttribI4iv)(GLuint index, const GLint *v) {
- CALL_GL_API(glVertexAttribI4iv, index, v);
-}
-void API_ENTRY(glVertexAttribI4uiv)(GLuint index, const GLuint *v) {
- CALL_GL_API(glVertexAttribI4uiv, index, v);
-}
-void API_ENTRY(glGetUniformuiv)(GLuint program, GLint location, GLuint *params) {
- CALL_GL_API(glGetUniformuiv, program, location, params);
-}
-GLint API_ENTRY(glGetFragDataLocation)(GLuint program, const GLchar *name) {
- CALL_GL_API_RETURN(glGetFragDataLocation, program, name);
-}
-void API_ENTRY(glUniform1ui)(GLint location, GLuint v0) {
- CALL_GL_API(glUniform1ui, location, v0);
-}
-void API_ENTRY(glUniform2ui)(GLint location, GLuint v0, GLuint v1) {
- CALL_GL_API(glUniform2ui, location, v0, v1);
-}
-void API_ENTRY(glUniform3ui)(GLint location, GLuint v0, GLuint v1, GLuint v2) {
- CALL_GL_API(glUniform3ui, location, v0, v1, v2);
-}
-void API_ENTRY(glUniform4ui)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
- CALL_GL_API(glUniform4ui, location, v0, v1, v2, v3);
-}
-void API_ENTRY(glUniform1uiv)(GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glUniform1uiv, location, count, value);
-}
-void API_ENTRY(glUniform2uiv)(GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glUniform2uiv, location, count, value);
-}
-void API_ENTRY(glUniform3uiv)(GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glUniform3uiv, location, count, value);
-}
-void API_ENTRY(glUniform4uiv)(GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glUniform4uiv, location, count, value);
-}
-void API_ENTRY(glClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value) {
- CALL_GL_API(glClearBufferiv, buffer, drawbuffer, value);
-}
-void API_ENTRY(glClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value) {
- CALL_GL_API(glClearBufferuiv, buffer, drawbuffer, value);
-}
-void API_ENTRY(glClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value) {
- CALL_GL_API(glClearBufferfv, buffer, drawbuffer, value);
-}
-void API_ENTRY(glClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) {
- CALL_GL_API(glClearBufferfi, buffer, drawbuffer, depth, stencil);
-}
-const GLubyte * API_ENTRY(glGetStringi)(GLenum name, GLuint index) {
- CALL_GL_API_RETURN(glGetStringi, name, index);
-}
-void API_ENTRY(glCopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) {
- CALL_GL_API(glCopyBufferSubData, readTarget, writeTarget, readOffset, writeOffset, size);
-}
-void API_ENTRY(glGetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices) {
- CALL_GL_API(glGetUniformIndices, program, uniformCount, uniformNames, uniformIndices);
-}
-void API_ENTRY(glGetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params) {
- CALL_GL_API(glGetActiveUniformsiv, program, uniformCount, uniformIndices, pname, params);
-}
-GLuint API_ENTRY(glGetUniformBlockIndex)(GLuint program, const GLchar *uniformBlockName) {
- CALL_GL_API_RETURN(glGetUniformBlockIndex, program, uniformBlockName);
-}
-void API_ENTRY(glGetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params) {
- CALL_GL_API(glGetActiveUniformBlockiv, program, uniformBlockIndex, pname, params);
-}
-void API_ENTRY(glGetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName) {
- CALL_GL_API(glGetActiveUniformBlockName, program, uniformBlockIndex, bufSize, length, uniformBlockName);
-}
-void API_ENTRY(glUniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) {
- CALL_GL_API(glUniformBlockBinding, program, uniformBlockIndex, uniformBlockBinding);
-}
-void API_ENTRY(glDrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount) {
- CALL_GL_API(glDrawArraysInstanced, mode, first, count, instancecount);
-}
-void API_ENTRY(glDrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount) {
- CALL_GL_API(glDrawElementsInstanced, mode, count, type, indices, instancecount);
-}
-GLsync API_ENTRY(glFenceSync)(GLenum condition, GLbitfield flags) {
- CALL_GL_API_RETURN(glFenceSync, condition, flags);
-}
-GLboolean API_ENTRY(glIsSync)(GLsync sync) {
- CALL_GL_API_RETURN(glIsSync, sync);
-}
-void API_ENTRY(glDeleteSync)(GLsync sync) {
- CALL_GL_API(glDeleteSync, sync);
-}
-GLenum API_ENTRY(glClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout) {
- CALL_GL_API_RETURN(glClientWaitSync, sync, flags, timeout);
-}
-void API_ENTRY(glWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout) {
- CALL_GL_API(glWaitSync, sync, flags, timeout);
-}
-void API_ENTRY(glGetInteger64v)(GLenum pname, GLint64 *data) {
- CALL_GL_API(glGetInteger64v, pname, data);
-}
-void API_ENTRY(glGetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values) {
- CALL_GL_API(glGetSynciv, sync, pname, bufSize, length, values);
-}
-void API_ENTRY(glGetInteger64i_v)(GLenum target, GLuint index, GLint64 *data) {
- CALL_GL_API(glGetInteger64i_v, target, index, data);
-}
-void API_ENTRY(glGetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 *params) {
- CALL_GL_API(glGetBufferParameteri64v, target, pname, params);
-}
-void API_ENTRY(glGenSamplers)(GLsizei count, GLuint *samplers) {
- CALL_GL_API(glGenSamplers, count, samplers);
-}
-void API_ENTRY(glDeleteSamplers)(GLsizei count, const GLuint *samplers) {
- CALL_GL_API(glDeleteSamplers, count, samplers);
-}
-GLboolean API_ENTRY(glIsSampler)(GLuint sampler) {
- CALL_GL_API_RETURN(glIsSampler, sampler);
-}
-void API_ENTRY(glBindSampler)(GLuint unit, GLuint sampler) {
- CALL_GL_API(glBindSampler, unit, sampler);
-}
-void API_ENTRY(glSamplerParameteri)(GLuint sampler, GLenum pname, GLint param) {
- CALL_GL_API(glSamplerParameteri, sampler, pname, param);
-}
-void API_ENTRY(glSamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *param) {
- CALL_GL_API(glSamplerParameteriv, sampler, pname, param);
-}
-void API_ENTRY(glSamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param) {
- CALL_GL_API(glSamplerParameterf, sampler, pname, param);
-}
-void API_ENTRY(glSamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *param) {
- CALL_GL_API(glSamplerParameterfv, sampler, pname, param);
-}
-void API_ENTRY(glGetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint *params) {
- CALL_GL_API(glGetSamplerParameteriv, sampler, pname, params);
-}
-void API_ENTRY(glGetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetSamplerParameterfv, sampler, pname, params);
-}
-void API_ENTRY(glVertexAttribDivisor)(GLuint index, GLuint divisor) {
- CALL_GL_API(glVertexAttribDivisor, index, divisor);
-}
-void API_ENTRY(glBindTransformFeedback)(GLenum target, GLuint id) {
- CALL_GL_API(glBindTransformFeedback, target, id);
-}
-void API_ENTRY(glDeleteTransformFeedbacks)(GLsizei n, const GLuint *ids) {
- CALL_GL_API(glDeleteTransformFeedbacks, n, ids);
-}
-void API_ENTRY(glGenTransformFeedbacks)(GLsizei n, GLuint *ids) {
- CALL_GL_API(glGenTransformFeedbacks, n, ids);
-}
-GLboolean API_ENTRY(glIsTransformFeedback)(GLuint id) {
- CALL_GL_API_RETURN(glIsTransformFeedback, id);
-}
-void API_ENTRY(glPauseTransformFeedback)(void) {
- CALL_GL_API(glPauseTransformFeedback);
-}
-void API_ENTRY(glResumeTransformFeedback)(void) {
- CALL_GL_API(glResumeTransformFeedback);
-}
-void API_ENTRY(glGetProgramBinary)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary) {
- CALL_GL_API(glGetProgramBinary, program, bufSize, length, binaryFormat, binary);
-}
-void API_ENTRY(glProgramBinary)(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length) {
- CALL_GL_API(glProgramBinary, program, binaryFormat, binary, length);
-}
-void API_ENTRY(glProgramParameteri)(GLuint program, GLenum pname, GLint value) {
- CALL_GL_API(glProgramParameteri, program, pname, value);
-}
-void API_ENTRY(glInvalidateFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
- CALL_GL_API(glInvalidateFramebuffer, target, numAttachments, attachments);
-}
-void API_ENTRY(glInvalidateSubFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glInvalidateSubFramebuffer, target, numAttachments, attachments, x, y, width, height);
-}
-void API_ENTRY(glTexStorage2D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glTexStorage2D, target, levels, internalformat, width, height);
-}
-void API_ENTRY(glTexStorage3D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
- CALL_GL_API(glTexStorage3D, target, levels, internalformat, width, height, depth);
-}
-void API_ENTRY(glGetInternalformativ)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params) {
- CALL_GL_API(glGetInternalformativ, target, internalformat, pname, bufSize, params);
-}
-void API_ENTRY(glDispatchCompute)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) {
- CALL_GL_API(glDispatchCompute, num_groups_x, num_groups_y, num_groups_z);
-}
-void API_ENTRY(glDispatchComputeIndirect)(GLintptr indirect) {
- CALL_GL_API(glDispatchComputeIndirect, indirect);
-}
-void API_ENTRY(glDrawArraysIndirect)(GLenum mode, const void *indirect) {
- CALL_GL_API(glDrawArraysIndirect, mode, indirect);
-}
-void API_ENTRY(glDrawElementsIndirect)(GLenum mode, GLenum type, const void *indirect) {
- CALL_GL_API(glDrawElementsIndirect, mode, type, indirect);
-}
-void API_ENTRY(glFramebufferParameteri)(GLenum target, GLenum pname, GLint param) {
- CALL_GL_API(glFramebufferParameteri, target, pname, param);
-}
-void API_ENTRY(glGetFramebufferParameteriv)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetFramebufferParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetProgramInterfaceiv)(GLuint program, GLenum programInterface, GLenum pname, GLint *params) {
- CALL_GL_API(glGetProgramInterfaceiv, program, programInterface, pname, params);
-}
-GLuint API_ENTRY(glGetProgramResourceIndex)(GLuint program, GLenum programInterface, const GLchar *name) {
- CALL_GL_API_RETURN(glGetProgramResourceIndex, program, programInterface, name);
-}
-void API_ENTRY(glGetProgramResourceName)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name) {
- CALL_GL_API(glGetProgramResourceName, program, programInterface, index, bufSize, length, name);
-}
-void API_ENTRY(glGetProgramResourceiv)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params) {
- CALL_GL_API(glGetProgramResourceiv, program, programInterface, index, propCount, props, bufSize, length, params);
-}
-GLint API_ENTRY(glGetProgramResourceLocation)(GLuint program, GLenum programInterface, const GLchar *name) {
- CALL_GL_API_RETURN(glGetProgramResourceLocation, program, programInterface, name);
-}
-void API_ENTRY(glUseProgramStages)(GLuint pipeline, GLbitfield stages, GLuint program) {
- CALL_GL_API(glUseProgramStages, pipeline, stages, program);
-}
-void API_ENTRY(glActiveShaderProgram)(GLuint pipeline, GLuint program) {
- CALL_GL_API(glActiveShaderProgram, pipeline, program);
-}
-GLuint API_ENTRY(glCreateShaderProgramv)(GLenum type, GLsizei count, const GLchar *const*strings) {
- CALL_GL_API_RETURN(glCreateShaderProgramv, type, count, strings);
-}
-void API_ENTRY(glBindProgramPipeline)(GLuint pipeline) {
- CALL_GL_API(glBindProgramPipeline, pipeline);
-}
-void API_ENTRY(glDeleteProgramPipelines)(GLsizei n, const GLuint *pipelines) {
- CALL_GL_API(glDeleteProgramPipelines, n, pipelines);
-}
-void API_ENTRY(glGenProgramPipelines)(GLsizei n, GLuint *pipelines) {
- CALL_GL_API(glGenProgramPipelines, n, pipelines);
-}
-GLboolean API_ENTRY(glIsProgramPipeline)(GLuint pipeline) {
- CALL_GL_API_RETURN(glIsProgramPipeline, pipeline);
-}
-void API_ENTRY(glGetProgramPipelineiv)(GLuint pipeline, GLenum pname, GLint *params) {
- CALL_GL_API(glGetProgramPipelineiv, pipeline, pname, params);
-}
-void API_ENTRY(glProgramUniform1i)(GLuint program, GLint location, GLint v0) {
- CALL_GL_API(glProgramUniform1i, program, location, v0);
-}
-void API_ENTRY(glProgramUniform2i)(GLuint program, GLint location, GLint v0, GLint v1) {
- CALL_GL_API(glProgramUniform2i, program, location, v0, v1);
-}
-void API_ENTRY(glProgramUniform3i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2) {
- CALL_GL_API(glProgramUniform3i, program, location, v0, v1, v2);
-}
-void API_ENTRY(glProgramUniform4i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
- CALL_GL_API(glProgramUniform4i, program, location, v0, v1, v2, v3);
-}
-void API_ENTRY(glProgramUniform1ui)(GLuint program, GLint location, GLuint v0) {
- CALL_GL_API(glProgramUniform1ui, program, location, v0);
-}
-void API_ENTRY(glProgramUniform2ui)(GLuint program, GLint location, GLuint v0, GLuint v1) {
- CALL_GL_API(glProgramUniform2ui, program, location, v0, v1);
-}
-void API_ENTRY(glProgramUniform3ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) {
- CALL_GL_API(glProgramUniform3ui, program, location, v0, v1, v2);
-}
-void API_ENTRY(glProgramUniform4ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
- CALL_GL_API(glProgramUniform4ui, program, location, v0, v1, v2, v3);
-}
-void API_ENTRY(glProgramUniform1f)(GLuint program, GLint location, GLfloat v0) {
- CALL_GL_API(glProgramUniform1f, program, location, v0);
-}
-void API_ENTRY(glProgramUniform2f)(GLuint program, GLint location, GLfloat v0, GLfloat v1) {
- CALL_GL_API(glProgramUniform2f, program, location, v0, v1);
-}
-void API_ENTRY(glProgramUniform3f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
- CALL_GL_API(glProgramUniform3f, program, location, v0, v1, v2);
-}
-void API_ENTRY(glProgramUniform4f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
- CALL_GL_API(glProgramUniform4f, program, location, v0, v1, v2, v3);
-}
-void API_ENTRY(glProgramUniform1iv)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform1iv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform2iv)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform2iv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform3iv)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform3iv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform4iv)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform4iv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform1uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glProgramUniform1uiv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform2uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glProgramUniform2uiv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform3uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glProgramUniform3uiv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform4uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glProgramUniform4uiv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform1fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform1fv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform2fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform2fv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform3fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform3fv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform4fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform4fv, program, location, count, value);
-}
-void API_ENTRY(glProgramUniformMatrix2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix2fv, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix3fv, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix4fv, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix2x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix2x3fv, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix3x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix3x2fv, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix2x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix2x4fv, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix4x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix4x2fv, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix3x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix3x4fv, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix4x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix4x3fv, program, location, count, transpose, value);
-}
-void API_ENTRY(glValidateProgramPipeline)(GLuint pipeline) {
- CALL_GL_API(glValidateProgramPipeline, pipeline);
-}
-void API_ENTRY(glGetProgramPipelineInfoLog)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
- CALL_GL_API(glGetProgramPipelineInfoLog, pipeline, bufSize, length, infoLog);
-}
-void API_ENTRY(glBindImageTexture)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) {
- CALL_GL_API(glBindImageTexture, unit, texture, level, layered, layer, access, format);
-}
-void API_ENTRY(glGetBooleani_v)(GLenum target, GLuint index, GLboolean *data) {
- CALL_GL_API(glGetBooleani_v, target, index, data);
-}
-void API_ENTRY(glMemoryBarrier)(GLbitfield barriers) {
- CALL_GL_API(glMemoryBarrier, barriers);
-}
-void API_ENTRY(glMemoryBarrierByRegion)(GLbitfield barriers) {
- CALL_GL_API(glMemoryBarrierByRegion, barriers);
-}
-void API_ENTRY(glTexStorage2DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) {
- CALL_GL_API(glTexStorage2DMultisample, target, samples, internalformat, width, height, fixedsamplelocations);
-}
-void API_ENTRY(glGetMultisamplefv)(GLenum pname, GLuint index, GLfloat *val) {
- CALL_GL_API(glGetMultisamplefv, pname, index, val);
-}
-void API_ENTRY(glSampleMaski)(GLuint maskNumber, GLbitfield mask) {
- CALL_GL_API(glSampleMaski, maskNumber, mask);
-}
-void API_ENTRY(glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params) {
- CALL_GL_API(glGetTexLevelParameteriv, target, level, pname, params);
-}
-void API_ENTRY(glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params) {
- CALL_GL_API(glGetTexLevelParameterfv, target, level, pname, params);
-}
-void API_ENTRY(glBindVertexBuffer)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) {
- CALL_GL_API(glBindVertexBuffer, bindingindex, buffer, offset, stride);
-}
-void API_ENTRY(glVertexAttribFormat)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) {
- CALL_GL_API(glVertexAttribFormat, attribindex, size, type, normalized, relativeoffset);
-}
-void API_ENTRY(glVertexAttribIFormat)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) {
- CALL_GL_API(glVertexAttribIFormat, attribindex, size, type, relativeoffset);
-}
-void API_ENTRY(glVertexAttribBinding)(GLuint attribindex, GLuint bindingindex) {
- CALL_GL_API(glVertexAttribBinding, attribindex, bindingindex);
-}
-void API_ENTRY(glVertexBindingDivisor)(GLuint bindingindex, GLuint divisor) {
- CALL_GL_API(glVertexBindingDivisor, bindingindex, divisor);
-}
-void API_ENTRY(glBlendBarrier)(void) {
- CALL_GL_API(glBlendBarrier);
-}
-void API_ENTRY(glCopyImageSubData)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) {
- CALL_GL_API(glCopyImageSubData, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
-}
-void API_ENTRY(glDebugMessageControl)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled) {
- CALL_GL_API(glDebugMessageControl, source, type, severity, count, ids, enabled);
-}
-void API_ENTRY(glDebugMessageInsert)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf) {
- CALL_GL_API(glDebugMessageInsert, source, type, id, severity, length, buf);
-}
-void API_ENTRY(glDebugMessageCallback)(GLDEBUGPROC callback, const void *userParam) {
- CALL_GL_API(glDebugMessageCallback, callback, userParam);
-}
-GLuint API_ENTRY(glGetDebugMessageLog)(GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog) {
- CALL_GL_API_RETURN(glGetDebugMessageLog, count, bufSize, sources, types, ids, severities, lengths, messageLog);
-}
-void API_ENTRY(glPushDebugGroup)(GLenum source, GLuint id, GLsizei length, const GLchar *message) {
- CALL_GL_API(glPushDebugGroup, source, id, length, message);
-}
-void API_ENTRY(glPopDebugGroup)(void) {
- CALL_GL_API(glPopDebugGroup);
-}
-void API_ENTRY(glObjectLabel)(GLenum identifier, GLuint name, GLsizei length, const GLchar *label) {
- CALL_GL_API(glObjectLabel, identifier, name, length, label);
-}
-void API_ENTRY(glGetObjectLabel)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label) {
- CALL_GL_API(glGetObjectLabel, identifier, name, bufSize, length, label);
-}
-void API_ENTRY(glObjectPtrLabel)(const void *ptr, GLsizei length, const GLchar *label) {
- CALL_GL_API(glObjectPtrLabel, ptr, length, label);
-}
-void API_ENTRY(glGetObjectPtrLabel)(const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label) {
- CALL_GL_API(glGetObjectPtrLabel, ptr, bufSize, length, label);
-}
-void API_ENTRY(glGetPointerv)(GLenum pname, void **params) {
- CALL_GL_API(glGetPointerv, pname, params);
-}
-void API_ENTRY(glEnablei)(GLenum target, GLuint index) {
- CALL_GL_API(glEnablei, target, index);
-}
-void API_ENTRY(glDisablei)(GLenum target, GLuint index) {
- CALL_GL_API(glDisablei, target, index);
-}
-void API_ENTRY(glBlendEquationi)(GLuint buf, GLenum mode) {
- CALL_GL_API(glBlendEquationi, buf, mode);
-}
-void API_ENTRY(glBlendEquationSeparatei)(GLuint buf, GLenum modeRGB, GLenum modeAlpha) {
- CALL_GL_API(glBlendEquationSeparatei, buf, modeRGB, modeAlpha);
-}
-void API_ENTRY(glBlendFunci)(GLuint buf, GLenum src, GLenum dst) {
- CALL_GL_API(glBlendFunci, buf, src, dst);
-}
-void API_ENTRY(glBlendFuncSeparatei)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
- CALL_GL_API(glBlendFuncSeparatei, buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-void API_ENTRY(glColorMaski)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {
- CALL_GL_API(glColorMaski, index, r, g, b, a);
-}
-GLboolean API_ENTRY(glIsEnabledi)(GLenum target, GLuint index) {
- CALL_GL_API_RETURN(glIsEnabledi, target, index);
-}
-void API_ENTRY(glDrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex) {
- CALL_GL_API(glDrawElementsBaseVertex, mode, count, type, indices, basevertex);
-}
-void API_ENTRY(glDrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex) {
- CALL_GL_API(glDrawRangeElementsBaseVertex, mode, start, end, count, type, indices, basevertex);
-}
-void API_ENTRY(glDrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex) {
- CALL_GL_API(glDrawElementsInstancedBaseVertex, mode, count, type, indices, instancecount, basevertex);
-}
-void API_ENTRY(glFramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level) {
- CALL_GL_API(glFramebufferTexture, target, attachment, texture, level);
-}
-void API_ENTRY(glPrimitiveBoundingBox)(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) {
- CALL_GL_API(glPrimitiveBoundingBox, minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
-}
-GLenum API_ENTRY(glGetGraphicsResetStatus)(void) {
- CALL_GL_API_RETURN(glGetGraphicsResetStatus);
-}
-void API_ENTRY(glReadnPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
- CALL_GL_API(glReadnPixels, x, y, width, height, format, type, bufSize, data);
-}
-void API_ENTRY(glGetnUniformfv)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params) {
- CALL_GL_API(glGetnUniformfv, program, location, bufSize, params);
-}
-void API_ENTRY(glGetnUniformiv)(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
- CALL_GL_API(glGetnUniformiv, program, location, bufSize, params);
-}
-void API_ENTRY(glGetnUniformuiv)(GLuint program, GLint location, GLsizei bufSize, GLuint *params) {
- CALL_GL_API(glGetnUniformuiv, program, location, bufSize, params);
-}
-void API_ENTRY(glMinSampleShading)(GLfloat value) {
- CALL_GL_API(glMinSampleShading, value);
-}
-void API_ENTRY(glPatchParameteri)(GLenum pname, GLint value) {
- CALL_GL_API(glPatchParameteri, pname, value);
-}
-void API_ENTRY(glTexParameterIiv)(GLenum target, GLenum pname, const GLint *params) {
- CALL_GL_API(glTexParameterIiv, target, pname, params);
-}
-void API_ENTRY(glTexParameterIuiv)(GLenum target, GLenum pname, const GLuint *params) {
- CALL_GL_API(glTexParameterIuiv, target, pname, params);
-}
-void API_ENTRY(glGetTexParameterIiv)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetTexParameterIiv, target, pname, params);
-}
-void API_ENTRY(glGetTexParameterIuiv)(GLenum target, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetTexParameterIuiv, target, pname, params);
-}
-void API_ENTRY(glSamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint *param) {
- CALL_GL_API(glSamplerParameterIiv, sampler, pname, param);
-}
-void API_ENTRY(glSamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint *param) {
- CALL_GL_API(glSamplerParameterIuiv, sampler, pname, param);
-}
-void API_ENTRY(glGetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint *params) {
- CALL_GL_API(glGetSamplerParameterIiv, sampler, pname, params);
-}
-void API_ENTRY(glGetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetSamplerParameterIuiv, sampler, pname, params);
-}
-void API_ENTRY(glTexBuffer)(GLenum target, GLenum internalformat, GLuint buffer) {
- CALL_GL_API(glTexBuffer, target, internalformat, buffer);
-}
-void API_ENTRY(glTexBufferRange)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) {
- CALL_GL_API(glTexBufferRange, target, internalformat, buffer, offset, size);
-}
-void API_ENTRY(glTexStorage3DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) {
- CALL_GL_API(glTexStorage3DMultisample, target, samples, internalformat, width, height, depth, fixedsamplelocations);
-}
-void API_ENTRY(glBlendBarrierKHR)(void) {
- CALL_GL_API(glBlendBarrierKHR);
-}
-void API_ENTRY(glDebugMessageControlKHR)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled) {
- CALL_GL_API(glDebugMessageControlKHR, source, type, severity, count, ids, enabled);
-}
-void API_ENTRY(glDebugMessageInsertKHR)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf) {
- CALL_GL_API(glDebugMessageInsertKHR, source, type, id, severity, length, buf);
-}
-void API_ENTRY(glDebugMessageCallbackKHR)(GLDEBUGPROCKHR callback, const void *userParam) {
- CALL_GL_API(glDebugMessageCallbackKHR, callback, userParam);
-}
-GLuint API_ENTRY(glGetDebugMessageLogKHR)(GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog) {
- CALL_GL_API_RETURN(glGetDebugMessageLogKHR, count, bufSize, sources, types, ids, severities, lengths, messageLog);
-}
-void API_ENTRY(glPushDebugGroupKHR)(GLenum source, GLuint id, GLsizei length, const GLchar *message) {
- CALL_GL_API(glPushDebugGroupKHR, source, id, length, message);
-}
-void API_ENTRY(glPopDebugGroupKHR)(void) {
- CALL_GL_API(glPopDebugGroupKHR);
-}
-void API_ENTRY(glObjectLabelKHR)(GLenum identifier, GLuint name, GLsizei length, const GLchar *label) {
- CALL_GL_API(glObjectLabelKHR, identifier, name, length, label);
-}
-void API_ENTRY(glGetObjectLabelKHR)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label) {
- CALL_GL_API(glGetObjectLabelKHR, identifier, name, bufSize, length, label);
-}
-void API_ENTRY(glObjectPtrLabelKHR)(const void *ptr, GLsizei length, const GLchar *label) {
- CALL_GL_API(glObjectPtrLabelKHR, ptr, length, label);
-}
-void API_ENTRY(glGetObjectPtrLabelKHR)(const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label) {
- CALL_GL_API(glGetObjectPtrLabelKHR, ptr, bufSize, length, label);
-}
-void API_ENTRY(glGetPointervKHR)(GLenum pname, void **params) {
- CALL_GL_API(glGetPointervKHR, pname, params);
-}
-GLenum API_ENTRY(glGetGraphicsResetStatusKHR)(void) {
- CALL_GL_API_RETURN(glGetGraphicsResetStatusKHR);
-}
-void API_ENTRY(glReadnPixelsKHR)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
- CALL_GL_API(glReadnPixelsKHR, x, y, width, height, format, type, bufSize, data);
-}
-void API_ENTRY(glGetnUniformfvKHR)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params) {
- CALL_GL_API(glGetnUniformfvKHR, program, location, bufSize, params);
-}
-void API_ENTRY(glGetnUniformivKHR)(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
- CALL_GL_API(glGetnUniformivKHR, program, location, bufSize, params);
-}
-void API_ENTRY(glGetnUniformuivKHR)(GLuint program, GLint location, GLsizei bufSize, GLuint *params) {
- CALL_GL_API(glGetnUniformuivKHR, program, location, bufSize, params);
-}
-void API_ENTRY(glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image) {
- CALL_GL_API(glEGLImageTargetTexture2DOES, target, image);
-}
-void API_ENTRY(glEGLImageTargetRenderbufferStorageOES)(GLenum target, GLeglImageOES image) {
- CALL_GL_API(glEGLImageTargetRenderbufferStorageOES, target, image);
-}
-void API_ENTRY(glCopyImageSubDataOES)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) {
- CALL_GL_API(glCopyImageSubDataOES, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
-}
-void API_ENTRY(glEnableiOES)(GLenum target, GLuint index) {
- CALL_GL_API(glEnableiOES, target, index);
-}
-void API_ENTRY(glDisableiOES)(GLenum target, GLuint index) {
- CALL_GL_API(glDisableiOES, target, index);
-}
-void API_ENTRY(glBlendEquationiOES)(GLuint buf, GLenum mode) {
- CALL_GL_API(glBlendEquationiOES, buf, mode);
-}
-void API_ENTRY(glBlendEquationSeparateiOES)(GLuint buf, GLenum modeRGB, GLenum modeAlpha) {
- CALL_GL_API(glBlendEquationSeparateiOES, buf, modeRGB, modeAlpha);
-}
-void API_ENTRY(glBlendFunciOES)(GLuint buf, GLenum src, GLenum dst) {
- CALL_GL_API(glBlendFunciOES, buf, src, dst);
-}
-void API_ENTRY(glBlendFuncSeparateiOES)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
- CALL_GL_API(glBlendFuncSeparateiOES, buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-void API_ENTRY(glColorMaskiOES)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {
- CALL_GL_API(glColorMaskiOES, index, r, g, b, a);
-}
-GLboolean API_ENTRY(glIsEnablediOES)(GLenum target, GLuint index) {
- CALL_GL_API_RETURN(glIsEnablediOES, target, index);
-}
-void API_ENTRY(glDrawElementsBaseVertexOES)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex) {
- CALL_GL_API(glDrawElementsBaseVertexOES, mode, count, type, indices, basevertex);
-}
-void API_ENTRY(glDrawRangeElementsBaseVertexOES)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex) {
- CALL_GL_API(glDrawRangeElementsBaseVertexOES, mode, start, end, count, type, indices, basevertex);
-}
-void API_ENTRY(glDrawElementsInstancedBaseVertexOES)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex) {
- CALL_GL_API(glDrawElementsInstancedBaseVertexOES, mode, count, type, indices, instancecount, basevertex);
-}
-void API_ENTRY(glFramebufferTextureOES)(GLenum target, GLenum attachment, GLuint texture, GLint level) {
- CALL_GL_API(glFramebufferTextureOES, target, attachment, texture, level);
-}
-void API_ENTRY(glGetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary) {
- CALL_GL_API(glGetProgramBinaryOES, program, bufSize, length, binaryFormat, binary);
-}
-void API_ENTRY(glProgramBinaryOES)(GLuint program, GLenum binaryFormat, const void *binary, GLint length) {
- CALL_GL_API(glProgramBinaryOES, program, binaryFormat, binary, length);
-}
-void * API_ENTRY(glMapBufferOES)(GLenum target, GLenum access) {
- CALL_GL_API_RETURN(glMapBufferOES, target, access);
-}
-GLboolean API_ENTRY(glUnmapBufferOES)(GLenum target) {
- CALL_GL_API_RETURN(glUnmapBufferOES, target);
-}
-void API_ENTRY(glGetBufferPointervOES)(GLenum target, GLenum pname, void **params) {
- CALL_GL_API(glGetBufferPointervOES, target, pname, params);
-}
-void API_ENTRY(glPrimitiveBoundingBoxOES)(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) {
- CALL_GL_API(glPrimitiveBoundingBoxOES, minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
-}
-void API_ENTRY(glMinSampleShadingOES)(GLfloat value) {
- CALL_GL_API(glMinSampleShadingOES, value);
-}
-void API_ENTRY(glPatchParameteriOES)(GLenum pname, GLint value) {
- CALL_GL_API(glPatchParameteriOES, pname, value);
-}
-void API_ENTRY(glTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels) {
- CALL_GL_API(glTexImage3DOES, target, level, internalformat, width, height, depth, border, format, type, pixels);
-}
-void API_ENTRY(glTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels) {
- CALL_GL_API(glTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-}
-void API_ENTRY(glCopyTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
- CALL_GL_API(glCopyTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, x, y, width, height);
-}
-void API_ENTRY(glCompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data) {
- CALL_GL_API(glCompressedTexImage3DOES, target, level, internalformat, width, height, depth, border, imageSize, data);
-}
-void API_ENTRY(glCompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data) {
- CALL_GL_API(glCompressedTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
-}
-void API_ENTRY(glFramebufferTexture3DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
- CALL_GL_API(glFramebufferTexture3DOES, target, attachment, textarget, texture, level, zoffset);
-}
-void API_ENTRY(glTexParameterIivOES)(GLenum target, GLenum pname, const GLint *params) {
- CALL_GL_API(glTexParameterIivOES, target, pname, params);
-}
-void API_ENTRY(glTexParameterIuivOES)(GLenum target, GLenum pname, const GLuint *params) {
- CALL_GL_API(glTexParameterIuivOES, target, pname, params);
-}
-void API_ENTRY(glGetTexParameterIivOES)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetTexParameterIivOES, target, pname, params);
-}
-void API_ENTRY(glGetTexParameterIuivOES)(GLenum target, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetTexParameterIuivOES, target, pname, params);
-}
-void API_ENTRY(glSamplerParameterIivOES)(GLuint sampler, GLenum pname, const GLint *param) {
- CALL_GL_API(glSamplerParameterIivOES, sampler, pname, param);
-}
-void API_ENTRY(glSamplerParameterIuivOES)(GLuint sampler, GLenum pname, const GLuint *param) {
- CALL_GL_API(glSamplerParameterIuivOES, sampler, pname, param);
-}
-void API_ENTRY(glGetSamplerParameterIivOES)(GLuint sampler, GLenum pname, GLint *params) {
- CALL_GL_API(glGetSamplerParameterIivOES, sampler, pname, params);
-}
-void API_ENTRY(glGetSamplerParameterIuivOES)(GLuint sampler, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetSamplerParameterIuivOES, sampler, pname, params);
-}
-void API_ENTRY(glTexBufferOES)(GLenum target, GLenum internalformat, GLuint buffer) {
- CALL_GL_API(glTexBufferOES, target, internalformat, buffer);
-}
-void API_ENTRY(glTexBufferRangeOES)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) {
- CALL_GL_API(glTexBufferRangeOES, target, internalformat, buffer, offset, size);
-}
-void API_ENTRY(glTexStorage3DMultisampleOES)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) {
- CALL_GL_API(glTexStorage3DMultisampleOES, target, samples, internalformat, width, height, depth, fixedsamplelocations);
-}
-void API_ENTRY(glTextureViewOES)(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) {
- CALL_GL_API(glTextureViewOES, texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers);
-}
-void API_ENTRY(glBindVertexArrayOES)(GLuint array) {
- CALL_GL_API(glBindVertexArrayOES, array);
-}
-void API_ENTRY(glDeleteVertexArraysOES)(GLsizei n, const GLuint *arrays) {
- CALL_GL_API(glDeleteVertexArraysOES, n, arrays);
-}
-void API_ENTRY(glGenVertexArraysOES)(GLsizei n, GLuint *arrays) {
- CALL_GL_API(glGenVertexArraysOES, n, arrays);
-}
-GLboolean API_ENTRY(glIsVertexArrayOES)(GLuint array) {
- CALL_GL_API_RETURN(glIsVertexArrayOES, array);
-}
-void API_ENTRY(glDrawArraysInstancedBaseInstanceEXT)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance) {
- CALL_GL_API(glDrawArraysInstancedBaseInstanceEXT, mode, first, count, instancecount, baseinstance);
-}
-void API_ENTRY(glDrawElementsInstancedBaseInstanceEXT)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance) {
- CALL_GL_API(glDrawElementsInstancedBaseInstanceEXT, mode, count, type, indices, instancecount, baseinstance);
-}
-void API_ENTRY(glDrawElementsInstancedBaseVertexBaseInstanceEXT)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance) {
- CALL_GL_API(glDrawElementsInstancedBaseVertexBaseInstanceEXT, mode, count, type, indices, instancecount, basevertex, baseinstance);
-}
-void API_ENTRY(glBindFragDataLocationIndexedEXT)(GLuint program, GLuint colorNumber, GLuint index, const GLchar *name) {
- CALL_GL_API(glBindFragDataLocationIndexedEXT, program, colorNumber, index, name);
-}
-void API_ENTRY(glBindFragDataLocationEXT)(GLuint program, GLuint color, const GLchar *name) {
- CALL_GL_API(glBindFragDataLocationEXT, program, color, name);
-}
-GLint API_ENTRY(glGetProgramResourceLocationIndexEXT)(GLuint program, GLenum programInterface, const GLchar *name) {
- CALL_GL_API_RETURN(glGetProgramResourceLocationIndexEXT, program, programInterface, name);
-}
-GLint API_ENTRY(glGetFragDataIndexEXT)(GLuint program, const GLchar *name) {
- CALL_GL_API_RETURN(glGetFragDataIndexEXT, program, name);
-}
-void API_ENTRY(glBufferStorageEXT)(GLenum target, GLsizeiptr size, const void *data, GLbitfield flags) {
- CALL_GL_API(glBufferStorageEXT, target, size, data, flags);
-}
-void API_ENTRY(glCopyImageSubDataEXT)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) {
- CALL_GL_API(glCopyImageSubDataEXT, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
-}
-void API_ENTRY(glLabelObjectEXT)(GLenum type, GLuint object, GLsizei length, const GLchar *label) {
- CALL_GL_API(glLabelObjectEXT, type, object, length, label);
-}
-void API_ENTRY(glGetObjectLabelEXT)(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label) {
- CALL_GL_API(glGetObjectLabelEXT, type, object, bufSize, length, label);
-}
-void API_ENTRY(glInsertEventMarkerEXT)(GLsizei length, const GLchar *marker) {
- CALL_GL_API(glInsertEventMarkerEXT, length, marker);
-}
-void API_ENTRY(glPushGroupMarkerEXT)(GLsizei length, const GLchar *marker) {
- CALL_GL_API(glPushGroupMarkerEXT, length, marker);
-}
-void API_ENTRY(glPopGroupMarkerEXT)(void) {
- CALL_GL_API(glPopGroupMarkerEXT);
-}
-void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
- CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments);
-}
-void API_ENTRY(glGenQueriesEXT)(GLsizei n, GLuint *ids) {
- CALL_GL_API(glGenQueriesEXT, n, ids);
-}
-void API_ENTRY(glDeleteQueriesEXT)(GLsizei n, const GLuint *ids) {
- CALL_GL_API(glDeleteQueriesEXT, n, ids);
-}
-GLboolean API_ENTRY(glIsQueryEXT)(GLuint id) {
- CALL_GL_API_RETURN(glIsQueryEXT, id);
-}
-void API_ENTRY(glBeginQueryEXT)(GLenum target, GLuint id) {
- CALL_GL_API(glBeginQueryEXT, target, id);
-}
-void API_ENTRY(glEndQueryEXT)(GLenum target) {
- CALL_GL_API(glEndQueryEXT, target);
-}
-void API_ENTRY(glQueryCounterEXT)(GLuint id, GLenum target) {
- CALL_GL_API(glQueryCounterEXT, id, target);
-}
-void API_ENTRY(glGetQueryivEXT)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetQueryivEXT, target, pname, params);
-}
-void API_ENTRY(glGetQueryObjectivEXT)(GLuint id, GLenum pname, GLint *params) {
- CALL_GL_API(glGetQueryObjectivEXT, id, pname, params);
-}
-void API_ENTRY(glGetQueryObjectuivEXT)(GLuint id, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetQueryObjectuivEXT, id, pname, params);
-}
-void API_ENTRY(glGetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64 *params) {
- CALL_GL_API(glGetQueryObjecti64vEXT, id, pname, params);
-}
-void API_ENTRY(glGetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64 *params) {
- CALL_GL_API(glGetQueryObjectui64vEXT, id, pname, params);
-}
-void API_ENTRY(glDrawBuffersEXT)(GLsizei n, const GLenum *bufs) {
- CALL_GL_API(glDrawBuffersEXT, n, bufs);
-}
-void API_ENTRY(glEnableiEXT)(GLenum target, GLuint index) {
- CALL_GL_API(glEnableiEXT, target, index);
-}
-void API_ENTRY(glDisableiEXT)(GLenum target, GLuint index) {
- CALL_GL_API(glDisableiEXT, target, index);
-}
-void API_ENTRY(glBlendEquationiEXT)(GLuint buf, GLenum mode) {
- CALL_GL_API(glBlendEquationiEXT, buf, mode);
-}
-void API_ENTRY(glBlendEquationSeparateiEXT)(GLuint buf, GLenum modeRGB, GLenum modeAlpha) {
- CALL_GL_API(glBlendEquationSeparateiEXT, buf, modeRGB, modeAlpha);
-}
-void API_ENTRY(glBlendFunciEXT)(GLuint buf, GLenum src, GLenum dst) {
- CALL_GL_API(glBlendFunciEXT, buf, src, dst);
-}
-void API_ENTRY(glBlendFuncSeparateiEXT)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
- CALL_GL_API(glBlendFuncSeparateiEXT, buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-void API_ENTRY(glColorMaskiEXT)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {
- CALL_GL_API(glColorMaskiEXT, index, r, g, b, a);
-}
-GLboolean API_ENTRY(glIsEnablediEXT)(GLenum target, GLuint index) {
- CALL_GL_API_RETURN(glIsEnablediEXT, target, index);
-}
-void API_ENTRY(glDrawElementsBaseVertexEXT)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex) {
- CALL_GL_API(glDrawElementsBaseVertexEXT, mode, count, type, indices, basevertex);
-}
-void API_ENTRY(glDrawRangeElementsBaseVertexEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex) {
- CALL_GL_API(glDrawRangeElementsBaseVertexEXT, mode, start, end, count, type, indices, basevertex);
-}
-void API_ENTRY(glDrawElementsInstancedBaseVertexEXT)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex) {
- CALL_GL_API(glDrawElementsInstancedBaseVertexEXT, mode, count, type, indices, instancecount, basevertex);
-}
-void API_ENTRY(glMultiDrawElementsBaseVertexEXT)(GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex) {
- CALL_GL_API(glMultiDrawElementsBaseVertexEXT, mode, count, type, indices, primcount, basevertex);
-}
-void API_ENTRY(glDrawArraysInstancedEXT)(GLenum mode, GLint start, GLsizei count, GLsizei primcount) {
- CALL_GL_API(glDrawArraysInstancedEXT, mode, start, count, primcount);
-}
-void API_ENTRY(glDrawElementsInstancedEXT)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount) {
- CALL_GL_API(glDrawElementsInstancedEXT, mode, count, type, indices, primcount);
-}
-void API_ENTRY(glFramebufferTextureEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level) {
- CALL_GL_API(glFramebufferTextureEXT, target, attachment, texture, level);
-}
-void API_ENTRY(glVertexAttribDivisorEXT)(GLuint index, GLuint divisor) {
- CALL_GL_API(glVertexAttribDivisorEXT, index, divisor);
-}
-void * API_ENTRY(glMapBufferRangeEXT)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) {
- CALL_GL_API_RETURN(glMapBufferRangeEXT, target, offset, length, access);
-}
-void API_ENTRY(glFlushMappedBufferRangeEXT)(GLenum target, GLintptr offset, GLsizeiptr length) {
- CALL_GL_API(glFlushMappedBufferRangeEXT, target, offset, length);
-}
-void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount) {
- CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount);
-}
-void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount) {
- CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount);
-}
-void API_ENTRY(glMultiDrawArraysIndirectEXT)(GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride) {
- CALL_GL_API(glMultiDrawArraysIndirectEXT, mode, indirect, drawcount, stride);
-}
-void API_ENTRY(glMultiDrawElementsIndirectEXT)(GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride) {
- CALL_GL_API(glMultiDrawElementsIndirectEXT, mode, type, indirect, drawcount, stride);
-}
-void API_ENTRY(glRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glRenderbufferStorageMultisampleEXT, target, samples, internalformat, width, height);
-}
-void API_ENTRY(glFramebufferTexture2DMultisampleEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
- CALL_GL_API(glFramebufferTexture2DMultisampleEXT, target, attachment, textarget, texture, level, samples);
-}
-void API_ENTRY(glReadBufferIndexedEXT)(GLenum src, GLint index) {
- CALL_GL_API(glReadBufferIndexedEXT, src, index);
-}
-void API_ENTRY(glDrawBuffersIndexedEXT)(GLint n, const GLenum *location, const GLint *indices) {
- CALL_GL_API(glDrawBuffersIndexedEXT, n, location, indices);
-}
-void API_ENTRY(glGetIntegeri_vEXT)(GLenum target, GLuint index, GLint *data) {
- CALL_GL_API(glGetIntegeri_vEXT, target, index, data);
-}
-void API_ENTRY(glPrimitiveBoundingBoxEXT)(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) {
- CALL_GL_API(glPrimitiveBoundingBoxEXT, minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
-}
-void API_ENTRY(glRasterSamplesEXT)(GLuint samples, GLboolean fixedsamplelocations) {
- CALL_GL_API(glRasterSamplesEXT, samples, fixedsamplelocations);
-}
-GLenum API_ENTRY(glGetGraphicsResetStatusEXT)(void) {
- CALL_GL_API_RETURN(glGetGraphicsResetStatusEXT);
-}
-void API_ENTRY(glReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
- CALL_GL_API(glReadnPixelsEXT, x, y, width, height, format, type, bufSize, data);
-}
-void API_ENTRY(glGetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params) {
- CALL_GL_API(glGetnUniformfvEXT, program, location, bufSize, params);
-}
-void API_ENTRY(glGetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
- CALL_GL_API(glGetnUniformivEXT, program, location, bufSize, params);
-}
-void API_ENTRY(glActiveShaderProgramEXT)(GLuint pipeline, GLuint program) {
- CALL_GL_API(glActiveShaderProgramEXT, pipeline, program);
-}
-void API_ENTRY(glBindProgramPipelineEXT)(GLuint pipeline) {
- CALL_GL_API(glBindProgramPipelineEXT, pipeline);
-}
-GLuint API_ENTRY(glCreateShaderProgramvEXT)(GLenum type, GLsizei count, const GLchar **strings) {
- CALL_GL_API_RETURN(glCreateShaderProgramvEXT, type, count, strings);
-}
-void API_ENTRY(glDeleteProgramPipelinesEXT)(GLsizei n, const GLuint *pipelines) {
- CALL_GL_API(glDeleteProgramPipelinesEXT, n, pipelines);
-}
-void API_ENTRY(glGenProgramPipelinesEXT)(GLsizei n, GLuint *pipelines) {
- CALL_GL_API(glGenProgramPipelinesEXT, n, pipelines);
-}
-void API_ENTRY(glGetProgramPipelineInfoLogEXT)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
- CALL_GL_API(glGetProgramPipelineInfoLogEXT, pipeline, bufSize, length, infoLog);
-}
-void API_ENTRY(glGetProgramPipelineivEXT)(GLuint pipeline, GLenum pname, GLint *params) {
- CALL_GL_API(glGetProgramPipelineivEXT, pipeline, pname, params);
-}
-GLboolean API_ENTRY(glIsProgramPipelineEXT)(GLuint pipeline) {
- CALL_GL_API_RETURN(glIsProgramPipelineEXT, pipeline);
-}
-void API_ENTRY(glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value) {
- CALL_GL_API(glProgramParameteriEXT, program, pname, value);
-}
-void API_ENTRY(glProgramUniform1fEXT)(GLuint program, GLint location, GLfloat v0) {
- CALL_GL_API(glProgramUniform1fEXT, program, location, v0);
-}
-void API_ENTRY(glProgramUniform1fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform1fvEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform1iEXT)(GLuint program, GLint location, GLint v0) {
- CALL_GL_API(glProgramUniform1iEXT, program, location, v0);
-}
-void API_ENTRY(glProgramUniform1ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform1ivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform2fEXT)(GLuint program, GLint location, GLfloat v0, GLfloat v1) {
- CALL_GL_API(glProgramUniform2fEXT, program, location, v0, v1);
-}
-void API_ENTRY(glProgramUniform2fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform2fvEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform2iEXT)(GLuint program, GLint location, GLint v0, GLint v1) {
- CALL_GL_API(glProgramUniform2iEXT, program, location, v0, v1);
-}
-void API_ENTRY(glProgramUniform2ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform2ivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform3fEXT)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
- CALL_GL_API(glProgramUniform3fEXT, program, location, v0, v1, v2);
-}
-void API_ENTRY(glProgramUniform3fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform3fvEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform3iEXT)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2) {
- CALL_GL_API(glProgramUniform3iEXT, program, location, v0, v1, v2);
-}
-void API_ENTRY(glProgramUniform3ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform3ivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform4fEXT)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
- CALL_GL_API(glProgramUniform4fEXT, program, location, v0, v1, v2, v3);
-}
-void API_ENTRY(glProgramUniform4fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
- CALL_GL_API(glProgramUniform4fvEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform4iEXT)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
- CALL_GL_API(glProgramUniform4iEXT, program, location, v0, v1, v2, v3);
-}
-void API_ENTRY(glProgramUniform4ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
- CALL_GL_API(glProgramUniform4ivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniformMatrix2fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix2fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix3fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix3fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix4fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix4fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glUseProgramStagesEXT)(GLuint pipeline, GLbitfield stages, GLuint program) {
- CALL_GL_API(glUseProgramStagesEXT, pipeline, stages, program);
-}
-void API_ENTRY(glValidateProgramPipelineEXT)(GLuint pipeline) {
- CALL_GL_API(glValidateProgramPipelineEXT, pipeline);
-}
-void API_ENTRY(glProgramUniform1uiEXT)(GLuint program, GLint location, GLuint v0) {
- CALL_GL_API(glProgramUniform1uiEXT, program, location, v0);
-}
-void API_ENTRY(glProgramUniform2uiEXT)(GLuint program, GLint location, GLuint v0, GLuint v1) {
- CALL_GL_API(glProgramUniform2uiEXT, program, location, v0, v1);
-}
-void API_ENTRY(glProgramUniform3uiEXT)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) {
- CALL_GL_API(glProgramUniform3uiEXT, program, location, v0, v1, v2);
-}
-void API_ENTRY(glProgramUniform4uiEXT)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
- CALL_GL_API(glProgramUniform4uiEXT, program, location, v0, v1, v2, v3);
-}
-void API_ENTRY(glProgramUniform1uivEXT)(GLuint program, GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glProgramUniform1uivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform2uivEXT)(GLuint program, GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glProgramUniform2uivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform3uivEXT)(GLuint program, GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glProgramUniform3uivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniform4uivEXT)(GLuint program, GLint location, GLsizei count, const GLuint *value) {
- CALL_GL_API(glProgramUniform4uivEXT, program, location, count, value);
-}
-void API_ENTRY(glProgramUniformMatrix2x3fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix2x3fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix3x2fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix3x2fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix2x4fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix2x4fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix4x2fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix4x2fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix3x4fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix3x4fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glProgramUniformMatrix4x3fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
- CALL_GL_API(glProgramUniformMatrix4x3fvEXT, program, location, count, transpose, value);
-}
-void API_ENTRY(glTexPageCommitmentEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit) {
- CALL_GL_API(glTexPageCommitmentEXT, target, level, xoffset, yoffset, zoffset, width, height, depth, commit);
-}
-void API_ENTRY(glPatchParameteriEXT)(GLenum pname, GLint value) {
- CALL_GL_API(glPatchParameteriEXT, pname, value);
-}
-void API_ENTRY(glTexParameterIivEXT)(GLenum target, GLenum pname, const GLint *params) {
- CALL_GL_API(glTexParameterIivEXT, target, pname, params);
-}
-void API_ENTRY(glTexParameterIuivEXT)(GLenum target, GLenum pname, const GLuint *params) {
- CALL_GL_API(glTexParameterIuivEXT, target, pname, params);
-}
-void API_ENTRY(glGetTexParameterIivEXT)(GLenum target, GLenum pname, GLint *params) {
- CALL_GL_API(glGetTexParameterIivEXT, target, pname, params);
-}
-void API_ENTRY(glGetTexParameterIuivEXT)(GLenum target, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetTexParameterIuivEXT, target, pname, params);
-}
-void API_ENTRY(glSamplerParameterIivEXT)(GLuint sampler, GLenum pname, const GLint *param) {
- CALL_GL_API(glSamplerParameterIivEXT, sampler, pname, param);
-}
-void API_ENTRY(glSamplerParameterIuivEXT)(GLuint sampler, GLenum pname, const GLuint *param) {
- CALL_GL_API(glSamplerParameterIuivEXT, sampler, pname, param);
-}
-void API_ENTRY(glGetSamplerParameterIivEXT)(GLuint sampler, GLenum pname, GLint *params) {
- CALL_GL_API(glGetSamplerParameterIivEXT, sampler, pname, params);
-}
-void API_ENTRY(glGetSamplerParameterIuivEXT)(GLuint sampler, GLenum pname, GLuint *params) {
- CALL_GL_API(glGetSamplerParameterIuivEXT, sampler, pname, params);
-}
-void API_ENTRY(glTexBufferEXT)(GLenum target, GLenum internalformat, GLuint buffer) {
- CALL_GL_API(glTexBufferEXT, target, internalformat, buffer);
-}
-void API_ENTRY(glTexBufferRangeEXT)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) {
- CALL_GL_API(glTexBufferRangeEXT, target, internalformat, buffer, offset, size);
-}
-void API_ENTRY(glTexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
- CALL_GL_API(glTexStorage1DEXT, target, levels, internalformat, width);
-}
-void API_ENTRY(glTexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glTexStorage2DEXT, target, levels, internalformat, width, height);
-}
-void API_ENTRY(glTexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
- CALL_GL_API(glTexStorage3DEXT, target, levels, internalformat, width, height, depth);
-}
-void API_ENTRY(glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
- CALL_GL_API(glTextureStorage1DEXT, texture, target, levels, internalformat, width);
-}
-void API_ENTRY(glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
- CALL_GL_API(glTextureStorage2DEXT, texture, target, levels, internalformat, width, height);
-}
-void API_ENTRY(glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
- CALL_GL_API(glTextureStorage3DEXT, texture, target, levels, internalformat, width, height, depth);
-}
-void API_ENTRY(glTextureViewEXT)(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) {
- CALL_GL_API(glTextureViewEXT, texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers);
-}
diff --git a/libs/hwui/debug/gles_undefine.h b/libs/hwui/debug/gles_undefine.h
deleted file mode 100644
index e43829d98e38..000000000000
--- a/libs/hwui/debug/gles_undefine.h
+++ /dev/null
@@ -1,913 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#undef glActiveShaderProgram
-#undef glActiveShaderProgramEXT
-#undef glActiveTexture
-#undef glAlphaFunc
-#undef glAlphaFuncQCOM
-#undef glAlphaFuncx
-#undef glAlphaFuncxOES
-#undef glApplyFramebufferAttachmentCMAAINTEL
-#undef glAttachShader
-#undef glBeginConditionalRenderNV
-#undef glBeginPerfMonitorAMD
-#undef glBeginPerfQueryINTEL
-#undef glBeginQuery
-#undef glBeginQueryEXT
-#undef glBeginTransformFeedback
-#undef glBindAttribLocation
-#undef glBindBuffer
-#undef glBindBufferBase
-#undef glBindBufferRange
-#undef glBindFragDataLocationEXT
-#undef glBindFragDataLocationIndexedEXT
-#undef glBindFramebuffer
-#undef glBindFramebufferOES
-#undef glBindImageTexture
-#undef glBindProgramPipeline
-#undef glBindProgramPipelineEXT
-#undef glBindRenderbuffer
-#undef glBindRenderbufferOES
-#undef glBindSampler
-#undef glBindTexture
-#undef glBindTransformFeedback
-#undef glBindVertexArray
-#undef glBindVertexArrayOES
-#undef glBindVertexBuffer
-#undef glBlendBarrier
-#undef glBlendBarrierKHR
-#undef glBlendBarrierNV
-#undef glBlendColor
-#undef glBlendEquation
-#undef glBlendEquationOES
-#undef glBlendEquationSeparate
-#undef glBlendEquationSeparateOES
-#undef glBlendEquationSeparatei
-#undef glBlendEquationSeparateiEXT
-#undef glBlendEquationSeparateiOES
-#undef glBlendEquationi
-#undef glBlendEquationiEXT
-#undef glBlendEquationiOES
-#undef glBlendFunc
-#undef glBlendFuncSeparate
-#undef glBlendFuncSeparateOES
-#undef glBlendFuncSeparatei
-#undef glBlendFuncSeparateiEXT
-#undef glBlendFuncSeparateiOES
-#undef glBlendFunci
-#undef glBlendFunciEXT
-#undef glBlendFunciOES
-#undef glBlendParameteriNV
-#undef glBlitFramebuffer
-#undef glBlitFramebufferANGLE
-#undef glBlitFramebufferNV
-#undef glBufferData
-#undef glBufferStorageEXT
-#undef glBufferSubData
-#undef glCheckFramebufferStatus
-#undef glCheckFramebufferStatusOES
-#undef glClear
-#undef glClearBufferfi
-#undef glClearBufferfv
-#undef glClearBufferiv
-#undef glClearBufferuiv
-#undef glClearColor
-#undef glClearColorx
-#undef glClearColorxOES
-#undef glClearDepthf
-#undef glClearDepthfOES
-#undef glClearDepthx
-#undef glClearDepthxOES
-#undef glClearStencil
-#undef glClientActiveTexture
-#undef glClientWaitSync
-#undef glClientWaitSyncAPPLE
-#undef glClipPlanef
-#undef glClipPlanefIMG
-#undef glClipPlanefOES
-#undef glClipPlanex
-#undef glClipPlanexIMG
-#undef glClipPlanexOES
-#undef glColor4f
-#undef glColor4ub
-#undef glColor4x
-#undef glColor4xOES
-#undef glColorMask
-#undef glColorMaski
-#undef glColorMaskiEXT
-#undef glColorMaskiOES
-#undef glColorPointer
-#undef glCompileShader
-#undef glCompressedTexImage2D
-#undef glCompressedTexImage3D
-#undef glCompressedTexImage3DOES
-#undef glCompressedTexSubImage2D
-#undef glCompressedTexSubImage3D
-#undef glCompressedTexSubImage3DOES
-#undef glCopyBufferSubData
-#undef glCopyBufferSubDataNV
-#undef glCopyImageSubData
-#undef glCopyImageSubDataEXT
-#undef glCopyImageSubDataOES
-#undef glCopyPathNV
-#undef glCopyTexImage2D
-#undef glCopyTexSubImage2D
-#undef glCopyTexSubImage3D
-#undef glCopyTexSubImage3DOES
-#undef glCopyTextureLevelsAPPLE
-#undef glCoverFillPathInstancedNV
-#undef glCoverFillPathNV
-#undef glCoverStrokePathInstancedNV
-#undef glCoverStrokePathNV
-#undef glCoverageMaskNV
-#undef glCoverageModulationNV
-#undef glCoverageModulationTableNV
-#undef glCoverageOperationNV
-#undef glCreatePerfQueryINTEL
-#undef glCreateProgram
-#undef glCreateShader
-#undef glCreateShaderProgramv
-#undef glCreateShaderProgramvEXT
-#undef glCullFace
-#undef glCurrentPaletteMatrixOES
-#undef glDebugMessageCallback
-#undef glDebugMessageCallbackKHR
-#undef glDebugMessageControl
-#undef glDebugMessageControlKHR
-#undef glDebugMessageInsert
-#undef glDebugMessageInsertKHR
-#undef glDeleteBuffers
-#undef glDeleteFencesNV
-#undef glDeleteFramebuffers
-#undef glDeleteFramebuffersOES
-#undef glDeletePathsNV
-#undef glDeletePerfMonitorsAMD
-#undef glDeletePerfQueryINTEL
-#undef glDeleteProgram
-#undef glDeleteProgramPipelines
-#undef glDeleteProgramPipelinesEXT
-#undef glDeleteQueries
-#undef glDeleteQueriesEXT
-#undef glDeleteRenderbuffers
-#undef glDeleteRenderbuffersOES
-#undef glDeleteSamplers
-#undef glDeleteShader
-#undef glDeleteSync
-#undef glDeleteSyncAPPLE
-#undef glDeleteTextures
-#undef glDeleteTransformFeedbacks
-#undef glDeleteVertexArrays
-#undef glDeleteVertexArraysOES
-#undef glDepthFunc
-#undef glDepthMask
-#undef glDepthRangeArrayfvNV
-#undef glDepthRangeIndexedfNV
-#undef glDepthRangef
-#undef glDepthRangefOES
-#undef glDepthRangex
-#undef glDepthRangexOES
-#undef glDetachShader
-#undef glDisable
-#undef glDisableClientState
-#undef glDisableDriverControlQCOM
-#undef glDisableVertexAttribArray
-#undef glDisablei
-#undef glDisableiEXT
-#undef glDisableiNV
-#undef glDisableiOES
-#undef glDiscardFramebufferEXT
-#undef glDispatchCompute
-#undef glDispatchComputeIndirect
-#undef glDrawArrays
-#undef glDrawArraysIndirect
-#undef glDrawArraysInstanced
-#undef glDrawArraysInstancedANGLE
-#undef glDrawArraysInstancedBaseInstanceEXT
-#undef glDrawArraysInstancedEXT
-#undef glDrawArraysInstancedNV
-#undef glDrawBuffers
-#undef glDrawBuffersEXT
-#undef glDrawBuffersIndexedEXT
-#undef glDrawBuffersNV
-#undef glDrawElements
-#undef glDrawElementsBaseVertex
-#undef glDrawElementsBaseVertexEXT
-#undef glDrawElementsBaseVertexOES
-#undef glDrawElementsIndirect
-#undef glDrawElementsInstanced
-#undef glDrawElementsInstancedANGLE
-#undef glDrawElementsInstancedBaseInstanceEXT
-#undef glDrawElementsInstancedBaseVertex
-#undef glDrawElementsInstancedBaseVertexBaseInstanceEXT
-#undef glDrawElementsInstancedBaseVertexEXT
-#undef glDrawElementsInstancedBaseVertexOES
-#undef glDrawElementsInstancedEXT
-#undef glDrawElementsInstancedNV
-#undef glDrawRangeElements
-#undef glDrawRangeElementsBaseVertex
-#undef glDrawRangeElementsBaseVertexEXT
-#undef glDrawRangeElementsBaseVertexOES
-#undef glDrawTexfOES
-#undef glDrawTexfvOES
-#undef glDrawTexiOES
-#undef glDrawTexivOES
-#undef glDrawTexsOES
-#undef glDrawTexsvOES
-#undef glDrawTexxOES
-#undef glDrawTexxvOES
-#undef glEGLImageTargetRenderbufferStorageOES
-#undef glEGLImageTargetTexture2DOES
-#undef glEnable
-#undef glEnableClientState
-#undef glEnableDriverControlQCOM
-#undef glEnableVertexAttribArray
-#undef glEnablei
-#undef glEnableiEXT
-#undef glEnableiNV
-#undef glEnableiOES
-#undef glEndConditionalRenderNV
-#undef glEndPerfMonitorAMD
-#undef glEndPerfQueryINTEL
-#undef glEndQuery
-#undef glEndQueryEXT
-#undef glEndTilingQCOM
-#undef glEndTransformFeedback
-#undef glExtGetBufferPointervQCOM
-#undef glExtGetBuffersQCOM
-#undef glExtGetFramebuffersQCOM
-#undef glExtGetProgramBinarySourceQCOM
-#undef glExtGetProgramsQCOM
-#undef glExtGetRenderbuffersQCOM
-#undef glExtGetShadersQCOM
-#undef glExtGetTexLevelParameterivQCOM
-#undef glExtGetTexSubImageQCOM
-#undef glExtGetTexturesQCOM
-#undef glExtIsProgramBinaryQCOM
-#undef glExtTexObjectStateOverrideiQCOM
-#undef glFenceSync
-#undef glFenceSyncAPPLE
-#undef glFinish
-#undef glFinishFenceNV
-#undef glFlush
-#undef glFlushMappedBufferRange
-#undef glFlushMappedBufferRangeEXT
-#undef glFogf
-#undef glFogfv
-#undef glFogx
-#undef glFogxOES
-#undef glFogxv
-#undef glFogxvOES
-#undef glFragmentCoverageColorNV
-#undef glFramebufferParameteri
-#undef glFramebufferRenderbuffer
-#undef glFramebufferRenderbufferOES
-#undef glFramebufferSampleLocationsfvNV
-#undef glFramebufferTexture
-#undef glFramebufferTexture2D
-#undef glFramebufferTexture2DMultisampleEXT
-#undef glFramebufferTexture2DMultisampleIMG
-#undef glFramebufferTexture2DOES
-#undef glFramebufferTexture3DOES
-#undef glFramebufferTextureEXT
-#undef glFramebufferTextureLayer
-#undef glFramebufferTextureMultisampleMultiviewOVR
-#undef glFramebufferTextureMultiviewOVR
-#undef glFramebufferTextureOES
-#undef glFrontFace
-#undef glFrustumf
-#undef glFrustumfOES
-#undef glFrustumx
-#undef glFrustumxOES
-#undef glGenBuffers
-#undef glGenFencesNV
-#undef glGenFramebuffers
-#undef glGenFramebuffersOES
-#undef glGenPathsNV
-#undef glGenPerfMonitorsAMD
-#undef glGenProgramPipelines
-#undef glGenProgramPipelinesEXT
-#undef glGenQueries
-#undef glGenQueriesEXT
-#undef glGenRenderbuffers
-#undef glGenRenderbuffersOES
-#undef glGenSamplers
-#undef glGenTextures
-#undef glGenTransformFeedbacks
-#undef glGenVertexArrays
-#undef glGenVertexArraysOES
-#undef glGenerateMipmap
-#undef glGenerateMipmapOES
-#undef glGetActiveAttrib
-#undef glGetActiveUniform
-#undef glGetActiveUniformBlockName
-#undef glGetActiveUniformBlockiv
-#undef glGetActiveUniformsiv
-#undef glGetAttachedShaders
-#undef glGetAttribLocation
-#undef glGetBooleani_v
-#undef glGetBooleanv
-#undef glGetBufferParameteri64v
-#undef glGetBufferParameteriv
-#undef glGetBufferPointerv
-#undef glGetBufferPointervOES
-#undef glGetClipPlanef
-#undef glGetClipPlanefOES
-#undef glGetClipPlanex
-#undef glGetClipPlanexOES
-#undef glGetCoverageModulationTableNV
-#undef glGetDebugMessageLog
-#undef glGetDebugMessageLogKHR
-#undef glGetDriverControlStringQCOM
-#undef glGetDriverControlsQCOM
-#undef glGetError
-#undef glGetFenceivNV
-#undef glGetFirstPerfQueryIdINTEL
-#undef glGetFixedv
-#undef glGetFixedvOES
-#undef glGetFloati_vNV
-#undef glGetFloatv
-#undef glGetFragDataIndexEXT
-#undef glGetFragDataLocation
-#undef glGetFramebufferAttachmentParameteriv
-#undef glGetFramebufferAttachmentParameterivOES
-#undef glGetFramebufferParameteriv
-#undef glGetGraphicsResetStatus
-#undef glGetGraphicsResetStatusEXT
-#undef glGetGraphicsResetStatusKHR
-#undef glGetImageHandleNV
-#undef glGetInteger64i_v
-#undef glGetInteger64v
-#undef glGetInteger64vAPPLE
-#undef glGetIntegeri_v
-#undef glGetIntegeri_vEXT
-#undef glGetIntegerv
-#undef glGetInternalformatSampleivNV
-#undef glGetInternalformativ
-#undef glGetLightfv
-#undef glGetLightxv
-#undef glGetLightxvOES
-#undef glGetMaterialfv
-#undef glGetMaterialxv
-#undef glGetMaterialxvOES
-#undef glGetMultisamplefv
-#undef glGetNextPerfQueryIdINTEL
-#undef glGetObjectLabel
-#undef glGetObjectLabelEXT
-#undef glGetObjectLabelKHR
-#undef glGetObjectPtrLabel
-#undef glGetObjectPtrLabelKHR
-#undef glGetPathCommandsNV
-#undef glGetPathCoordsNV
-#undef glGetPathDashArrayNV
-#undef glGetPathLengthNV
-#undef glGetPathMetricRangeNV
-#undef glGetPathMetricsNV
-#undef glGetPathParameterfvNV
-#undef glGetPathParameterivNV
-#undef glGetPathSpacingNV
-#undef glGetPerfCounterInfoINTEL
-#undef glGetPerfMonitorCounterDataAMD
-#undef glGetPerfMonitorCounterInfoAMD
-#undef glGetPerfMonitorCounterStringAMD
-#undef glGetPerfMonitorCountersAMD
-#undef glGetPerfMonitorGroupStringAMD
-#undef glGetPerfMonitorGroupsAMD
-#undef glGetPerfQueryDataINTEL
-#undef glGetPerfQueryIdByNameINTEL
-#undef glGetPerfQueryInfoINTEL
-#undef glGetPointerv
-#undef glGetPointervKHR
-#undef glGetProgramBinary
-#undef glGetProgramBinaryOES
-#undef glGetProgramInfoLog
-#undef glGetProgramInterfaceiv
-#undef glGetProgramPipelineInfoLog
-#undef glGetProgramPipelineInfoLogEXT
-#undef glGetProgramPipelineiv
-#undef glGetProgramPipelineivEXT
-#undef glGetProgramResourceIndex
-#undef glGetProgramResourceLocation
-#undef glGetProgramResourceLocationIndexEXT
-#undef glGetProgramResourceName
-#undef glGetProgramResourcefvNV
-#undef glGetProgramResourceiv
-#undef glGetProgramiv
-#undef glGetQueryObjecti64vEXT
-#undef glGetQueryObjectivEXT
-#undef glGetQueryObjectui64vEXT
-#undef glGetQueryObjectuiv
-#undef glGetQueryObjectuivEXT
-#undef glGetQueryiv
-#undef glGetQueryivEXT
-#undef glGetRenderbufferParameteriv
-#undef glGetRenderbufferParameterivOES
-#undef glGetSamplerParameterIiv
-#undef glGetSamplerParameterIivEXT
-#undef glGetSamplerParameterIivOES
-#undef glGetSamplerParameterIuiv
-#undef glGetSamplerParameterIuivEXT
-#undef glGetSamplerParameterIuivOES
-#undef glGetSamplerParameterfv
-#undef glGetSamplerParameteriv
-#undef glGetShaderInfoLog
-#undef glGetShaderPrecisionFormat
-#undef glGetShaderSource
-#undef glGetShaderiv
-#undef glGetString
-#undef glGetStringi
-#undef glGetSynciv
-#undef glGetSyncivAPPLE
-#undef glGetTexEnvfv
-#undef glGetTexEnviv
-#undef glGetTexEnvxv
-#undef glGetTexEnvxvOES
-#undef glGetTexGenfvOES
-#undef glGetTexGenivOES
-#undef glGetTexGenxvOES
-#undef glGetTexLevelParameterfv
-#undef glGetTexLevelParameteriv
-#undef glGetTexParameterIiv
-#undef glGetTexParameterIivEXT
-#undef glGetTexParameterIivOES
-#undef glGetTexParameterIuiv
-#undef glGetTexParameterIuivEXT
-#undef glGetTexParameterIuivOES
-#undef glGetTexParameterfv
-#undef glGetTexParameteriv
-#undef glGetTexParameterxv
-#undef glGetTexParameterxvOES
-#undef glGetTextureHandleNV
-#undef glGetTextureSamplerHandleNV
-#undef glGetTransformFeedbackVarying
-#undef glGetTranslatedShaderSourceANGLE
-#undef glGetUniformBlockIndex
-#undef glGetUniformIndices
-#undef glGetUniformLocation
-#undef glGetUniformfv
-#undef glGetUniformiv
-#undef glGetUniformuiv
-#undef glGetVertexAttribIiv
-#undef glGetVertexAttribIuiv
-#undef glGetVertexAttribPointerv
-#undef glGetVertexAttribfv
-#undef glGetVertexAttribiv
-#undef glGetnUniformfv
-#undef glGetnUniformfvEXT
-#undef glGetnUniformfvKHR
-#undef glGetnUniformiv
-#undef glGetnUniformivEXT
-#undef glGetnUniformivKHR
-#undef glGetnUniformuiv
-#undef glGetnUniformuivKHR
-#undef glHint
-#undef glInsertEventMarkerEXT
-#undef glInterpolatePathsNV
-#undef glInvalidateFramebuffer
-#undef glInvalidateSubFramebuffer
-#undef glIsBuffer
-#undef glIsEnabled
-#undef glIsEnabledi
-#undef glIsEnablediEXT
-#undef glIsEnablediNV
-#undef glIsEnablediOES
-#undef glIsFenceNV
-#undef glIsFramebuffer
-#undef glIsFramebufferOES
-#undef glIsImageHandleResidentNV
-#undef glIsPathNV
-#undef glIsPointInFillPathNV
-#undef glIsPointInStrokePathNV
-#undef glIsProgram
-#undef glIsProgramPipeline
-#undef glIsProgramPipelineEXT
-#undef glIsQuery
-#undef glIsQueryEXT
-#undef glIsRenderbuffer
-#undef glIsRenderbufferOES
-#undef glIsSampler
-#undef glIsShader
-#undef glIsSync
-#undef glIsSyncAPPLE
-#undef glIsTexture
-#undef glIsTextureHandleResidentNV
-#undef glIsTransformFeedback
-#undef glIsVertexArray
-#undef glIsVertexArrayOES
-#undef glLabelObjectEXT
-#undef glLightModelf
-#undef glLightModelfv
-#undef glLightModelx
-#undef glLightModelxOES
-#undef glLightModelxv
-#undef glLightModelxvOES
-#undef glLightf
-#undef glLightfv
-#undef glLightx
-#undef glLightxOES
-#undef glLightxv
-#undef glLightxvOES
-#undef glLineWidth
-#undef glLineWidthx
-#undef glLineWidthxOES
-#undef glLinkProgram
-#undef glLoadIdentity
-#undef glLoadMatrixf
-#undef glLoadMatrixx
-#undef glLoadMatrixxOES
-#undef glLoadPaletteFromModelViewMatrixOES
-#undef glLogicOp
-#undef glMakeImageHandleNonResidentNV
-#undef glMakeImageHandleResidentNV
-#undef glMakeTextureHandleNonResidentNV
-#undef glMakeTextureHandleResidentNV
-#undef glMapBufferOES
-#undef glMapBufferRange
-#undef glMapBufferRangeEXT
-#undef glMaterialf
-#undef glMaterialfv
-#undef glMaterialx
-#undef glMaterialxOES
-#undef glMaterialxv
-#undef glMaterialxvOES
-#undef glMatrixIndexPointerOES
-#undef glMatrixLoad3x2fNV
-#undef glMatrixLoad3x3fNV
-#undef glMatrixLoadTranspose3x3fNV
-#undef glMatrixMode
-#undef glMatrixMult3x2fNV
-#undef glMatrixMult3x3fNV
-#undef glMatrixMultTranspose3x3fNV
-#undef glMemoryBarrier
-#undef glMemoryBarrierByRegion
-#undef glMinSampleShading
-#undef glMinSampleShadingOES
-#undef glMultMatrixf
-#undef glMultMatrixx
-#undef glMultMatrixxOES
-#undef glMultiDrawArraysEXT
-#undef glMultiDrawArraysIndirectEXT
-#undef glMultiDrawElementsBaseVertexEXT
-#undef glMultiDrawElementsBaseVertexOES
-#undef glMultiDrawElementsEXT
-#undef glMultiDrawElementsIndirectEXT
-#undef glMultiTexCoord4f
-#undef glMultiTexCoord4x
-#undef glMultiTexCoord4xOES
-#undef glNamedFramebufferSampleLocationsfvNV
-#undef glNormal3f
-#undef glNormal3x
-#undef glNormal3xOES
-#undef glNormalPointer
-#undef glObjectLabel
-#undef glObjectLabelKHR
-#undef glObjectPtrLabel
-#undef glObjectPtrLabelKHR
-#undef glOrthof
-#undef glOrthofOES
-#undef glOrthox
-#undef glOrthoxOES
-#undef glPatchParameteri
-#undef glPatchParameteriEXT
-#undef glPatchParameteriOES
-#undef glPathCommandsNV
-#undef glPathCoordsNV
-#undef glPathCoverDepthFuncNV
-#undef glPathDashArrayNV
-#undef glPathGlyphIndexArrayNV
-#undef glPathGlyphIndexRangeNV
-#undef glPathGlyphRangeNV
-#undef glPathGlyphsNV
-#undef glPathMemoryGlyphIndexArrayNV
-#undef glPathParameterfNV
-#undef glPathParameterfvNV
-#undef glPathParameteriNV
-#undef glPathParameterivNV
-#undef glPathStencilDepthOffsetNV
-#undef glPathStencilFuncNV
-#undef glPathStringNV
-#undef glPathSubCommandsNV
-#undef glPathSubCoordsNV
-#undef glPauseTransformFeedback
-#undef glPixelStorei
-#undef glPointAlongPathNV
-#undef glPointParameterf
-#undef glPointParameterfv
-#undef glPointParameterx
-#undef glPointParameterxOES
-#undef glPointParameterxv
-#undef glPointParameterxvOES
-#undef glPointSize
-#undef glPointSizePointerOES
-#undef glPointSizex
-#undef glPointSizexOES
-#undef glPolygonModeNV
-#undef glPolygonOffset
-#undef glPolygonOffsetx
-#undef glPolygonOffsetxOES
-#undef glPopDebugGroup
-#undef glPopDebugGroupKHR
-#undef glPopGroupMarkerEXT
-#undef glPopMatrix
-#undef glPrimitiveBoundingBox
-#undef glPrimitiveBoundingBoxEXT
-#undef glPrimitiveBoundingBoxOES
-#undef glProgramBinary
-#undef glProgramBinaryOES
-#undef glProgramParameteri
-#undef glProgramParameteriEXT
-#undef glProgramPathFragmentInputGenNV
-#undef glProgramUniform1f
-#undef glProgramUniform1fEXT
-#undef glProgramUniform1fv
-#undef glProgramUniform1fvEXT
-#undef glProgramUniform1i
-#undef glProgramUniform1iEXT
-#undef glProgramUniform1iv
-#undef glProgramUniform1ivEXT
-#undef glProgramUniform1ui
-#undef glProgramUniform1uiEXT
-#undef glProgramUniform1uiv
-#undef glProgramUniform1uivEXT
-#undef glProgramUniform2f
-#undef glProgramUniform2fEXT
-#undef glProgramUniform2fv
-#undef glProgramUniform2fvEXT
-#undef glProgramUniform2i
-#undef glProgramUniform2iEXT
-#undef glProgramUniform2iv
-#undef glProgramUniform2ivEXT
-#undef glProgramUniform2ui
-#undef glProgramUniform2uiEXT
-#undef glProgramUniform2uiv
-#undef glProgramUniform2uivEXT
-#undef glProgramUniform3f
-#undef glProgramUniform3fEXT
-#undef glProgramUniform3fv
-#undef glProgramUniform3fvEXT
-#undef glProgramUniform3i
-#undef glProgramUniform3iEXT
-#undef glProgramUniform3iv
-#undef glProgramUniform3ivEXT
-#undef glProgramUniform3ui
-#undef glProgramUniform3uiEXT
-#undef glProgramUniform3uiv
-#undef glProgramUniform3uivEXT
-#undef glProgramUniform4f
-#undef glProgramUniform4fEXT
-#undef glProgramUniform4fv
-#undef glProgramUniform4fvEXT
-#undef glProgramUniform4i
-#undef glProgramUniform4iEXT
-#undef glProgramUniform4iv
-#undef glProgramUniform4ivEXT
-#undef glProgramUniform4ui
-#undef glProgramUniform4uiEXT
-#undef glProgramUniform4uiv
-#undef glProgramUniform4uivEXT
-#undef glProgramUniformHandleui64NV
-#undef glProgramUniformHandleui64vNV
-#undef glProgramUniformMatrix2fv
-#undef glProgramUniformMatrix2fvEXT
-#undef glProgramUniformMatrix2x3fv
-#undef glProgramUniformMatrix2x3fvEXT
-#undef glProgramUniformMatrix2x4fv
-#undef glProgramUniformMatrix2x4fvEXT
-#undef glProgramUniformMatrix3fv
-#undef glProgramUniformMatrix3fvEXT
-#undef glProgramUniformMatrix3x2fv
-#undef glProgramUniformMatrix3x2fvEXT
-#undef glProgramUniformMatrix3x4fv
-#undef glProgramUniformMatrix3x4fvEXT
-#undef glProgramUniformMatrix4fv
-#undef glProgramUniformMatrix4fvEXT
-#undef glProgramUniformMatrix4x2fv
-#undef glProgramUniformMatrix4x2fvEXT
-#undef glProgramUniformMatrix4x3fv
-#undef glProgramUniformMatrix4x3fvEXT
-#undef glPushDebugGroup
-#undef glPushDebugGroupKHR
-#undef glPushGroupMarkerEXT
-#undef glPushMatrix
-#undef glQueryCounterEXT
-#undef glQueryMatrixxOES
-#undef glRasterSamplesEXT
-#undef glReadBuffer
-#undef glReadBufferIndexedEXT
-#undef glReadBufferNV
-#undef glReadPixels
-#undef glReadnPixels
-#undef glReadnPixelsEXT
-#undef glReadnPixelsKHR
-#undef glReleaseShaderCompiler
-#undef glRenderbufferStorage
-#undef glRenderbufferStorageMultisample
-#undef glRenderbufferStorageMultisampleANGLE
-#undef glRenderbufferStorageMultisampleAPPLE
-#undef glRenderbufferStorageMultisampleEXT
-#undef glRenderbufferStorageMultisampleIMG
-#undef glRenderbufferStorageMultisampleNV
-#undef glRenderbufferStorageOES
-#undef glResolveDepthValuesNV
-#undef glResolveMultisampleFramebufferAPPLE
-#undef glResumeTransformFeedback
-#undef glRotatef
-#undef glRotatex
-#undef glRotatexOES
-#undef glSampleCoverage
-#undef glSampleCoveragex
-#undef glSampleCoveragexOES
-#undef glSampleMaski
-#undef glSamplerParameterIiv
-#undef glSamplerParameterIivEXT
-#undef glSamplerParameterIivOES
-#undef glSamplerParameterIuiv
-#undef glSamplerParameterIuivEXT
-#undef glSamplerParameterIuivOES
-#undef glSamplerParameterf
-#undef glSamplerParameterfv
-#undef glSamplerParameteri
-#undef glSamplerParameteriv
-#undef glScalef
-#undef glScalex
-#undef glScalexOES
-#undef glScissor
-#undef glScissorArrayvNV
-#undef glScissorIndexedNV
-#undef glScissorIndexedvNV
-#undef glSelectPerfMonitorCountersAMD
-#undef glSetFenceNV
-#undef glShadeModel
-#undef glShaderBinary
-#undef glShaderSource
-#undef glStartTilingQCOM
-#undef glStencilFillPathInstancedNV
-#undef glStencilFillPathNV
-#undef glStencilFunc
-#undef glStencilFuncSeparate
-#undef glStencilMask
-#undef glStencilMaskSeparate
-#undef glStencilOp
-#undef glStencilOpSeparate
-#undef glStencilStrokePathInstancedNV
-#undef glStencilStrokePathNV
-#undef glStencilThenCoverFillPathInstancedNV
-#undef glStencilThenCoverFillPathNV
-#undef glStencilThenCoverStrokePathInstancedNV
-#undef glStencilThenCoverStrokePathNV
-#undef glSubpixelPrecisionBiasNV
-#undef glTestFenceNV
-#undef glTexBuffer
-#undef glTexBufferEXT
-#undef glTexBufferOES
-#undef glTexBufferRange
-#undef glTexBufferRangeEXT
-#undef glTexBufferRangeOES
-#undef glTexCoordPointer
-#undef glTexEnvf
-#undef glTexEnvfv
-#undef glTexEnvi
-#undef glTexEnviv
-#undef glTexEnvx
-#undef glTexEnvxOES
-#undef glTexEnvxv
-#undef glTexEnvxvOES
-#undef glTexGenfOES
-#undef glTexGenfvOES
-#undef glTexGeniOES
-#undef glTexGenivOES
-#undef glTexGenxOES
-#undef glTexGenxvOES
-#undef glTexImage2D
-#undef glTexImage3D
-#undef glTexImage3DOES
-#undef glTexPageCommitmentEXT
-#undef glTexParameterIiv
-#undef glTexParameterIivEXT
-#undef glTexParameterIivOES
-#undef glTexParameterIuiv
-#undef glTexParameterIuivEXT
-#undef glTexParameterIuivOES
-#undef glTexParameterf
-#undef glTexParameterfv
-#undef glTexParameteri
-#undef glTexParameteriv
-#undef glTexParameterx
-#undef glTexParameterxOES
-#undef glTexParameterxv
-#undef glTexParameterxvOES
-#undef glTexStorage1DEXT
-#undef glTexStorage2D
-#undef glTexStorage2DEXT
-#undef glTexStorage2DMultisample
-#undef glTexStorage3D
-#undef glTexStorage3DEXT
-#undef glTexStorage3DMultisample
-#undef glTexStorage3DMultisampleOES
-#undef glTexSubImage2D
-#undef glTexSubImage3D
-#undef glTexSubImage3DOES
-#undef glTextureStorage1DEXT
-#undef glTextureStorage2DEXT
-#undef glTextureStorage3DEXT
-#undef glTextureViewEXT
-#undef glTextureViewOES
-#undef glTransformFeedbackVaryings
-#undef glTransformPathNV
-#undef glTranslatef
-#undef glTranslatex
-#undef glTranslatexOES
-#undef glUniform1f
-#undef glUniform1fv
-#undef glUniform1i
-#undef glUniform1iv
-#undef glUniform1ui
-#undef glUniform1uiv
-#undef glUniform2f
-#undef glUniform2fv
-#undef glUniform2i
-#undef glUniform2iv
-#undef glUniform2ui
-#undef glUniform2uiv
-#undef glUniform3f
-#undef glUniform3fv
-#undef glUniform3i
-#undef glUniform3iv
-#undef glUniform3ui
-#undef glUniform3uiv
-#undef glUniform4f
-#undef glUniform4fv
-#undef glUniform4i
-#undef glUniform4iv
-#undef glUniform4ui
-#undef glUniform4uiv
-#undef glUniformBlockBinding
-#undef glUniformHandleui64NV
-#undef glUniformHandleui64vNV
-#undef glUniformMatrix2fv
-#undef glUniformMatrix2x3fv
-#undef glUniformMatrix2x3fvNV
-#undef glUniformMatrix2x4fv
-#undef glUniformMatrix2x4fvNV
-#undef glUniformMatrix3fv
-#undef glUniformMatrix3x2fv
-#undef glUniformMatrix3x2fvNV
-#undef glUniformMatrix3x4fv
-#undef glUniformMatrix3x4fvNV
-#undef glUniformMatrix4fv
-#undef glUniformMatrix4x2fv
-#undef glUniformMatrix4x2fvNV
-#undef glUniformMatrix4x3fv
-#undef glUniformMatrix4x3fvNV
-#undef glUnmapBuffer
-#undef glUnmapBufferOES
-#undef glUseProgram
-#undef glUseProgramStages
-#undef glUseProgramStagesEXT
-#undef glValidateProgram
-#undef glValidateProgramPipeline
-#undef glValidateProgramPipelineEXT
-#undef glVertexAttrib1f
-#undef glVertexAttrib1fv
-#undef glVertexAttrib2f
-#undef glVertexAttrib2fv
-#undef glVertexAttrib3f
-#undef glVertexAttrib3fv
-#undef glVertexAttrib4f
-#undef glVertexAttrib4fv
-#undef glVertexAttribBinding
-#undef glVertexAttribDivisor
-#undef glVertexAttribDivisorANGLE
-#undef glVertexAttribDivisorEXT
-#undef glVertexAttribDivisorNV
-#undef glVertexAttribFormat
-#undef glVertexAttribI4i
-#undef glVertexAttribI4iv
-#undef glVertexAttribI4ui
-#undef glVertexAttribI4uiv
-#undef glVertexAttribIFormat
-#undef glVertexAttribIPointer
-#undef glVertexAttribPointer
-#undef glVertexBindingDivisor
-#undef glVertexPointer
-#undef glViewport
-#undef glViewportArrayvNV
-#undef glViewportIndexedfNV
-#undef glViewportIndexedfvNV
-#undef glWaitSync
-#undef glWaitSyncAPPLE
-#undef glWeightPathsNV
-#undef glWeightPointerOES
diff --git a/libs/hwui/debug/nullegl.cpp b/libs/hwui/debug/nullegl.cpp
deleted file mode 100644
index ca47f8fd22ef..000000000000
--- a/libs/hwui/debug/nullegl.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-
-static EGLDisplay gDisplay = (EGLDisplay)1;
-static EGLSyncKHR gFence = (EGLSyncKHR)1;
-
-typedef struct {
- EGLSurface surface;
- EGLContext context;
-} ThreadState;
-
-static pthread_key_t ThreadStateKey;
-static pthread_once_t ThreadStateSetupOnce = PTHREAD_ONCE_INIT;
-
-static void destroyThreadState(void* state) {
- free(state);
-}
-
-static void makeThreadState() {
- pthread_key_create(&ThreadStateKey, destroyThreadState);
-}
-
-ThreadState* getThreadState() {
- ThreadState* ptr;
- pthread_once(&ThreadStateSetupOnce, makeThreadState);
- if ((ptr = (ThreadState*)pthread_getspecific(ThreadStateKey)) == NULL) {
- ptr = (ThreadState*)calloc(1, sizeof(ThreadState));
- ptr->context = EGL_NO_CONTEXT;
- ptr->surface = EGL_NO_SURFACE;
- pthread_setspecific(ThreadStateKey, ptr);
- }
- return ptr;
-}
-
-EGLint eglGetError(void) {
- return EGL_SUCCESS;
-}
-
-EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id) {
- return gDisplay;
-}
-
-EGLBoolean eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor) {
- return EGL_TRUE;
-}
-
-EGLBoolean eglTerminate(EGLDisplay dpy) {
- return EGL_TRUE;
-}
-
-const char* eglQueryString(EGLDisplay dpy, EGLint name) {
- if (name == EGL_EXTENSIONS) {
- return "EGL_KHR_swap_buffers_with_damage";
- }
- return "";
-}
-
-EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs,
- EGLint config_size, EGLint* num_config) {
- memset(configs, 9, sizeof(EGLConfig) * config_size);
- *num_config = config_size;
- return EGL_TRUE;
-}
-
-EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win,
- const EGLint* attrib_list) {
- return (EGLSurface)malloc(sizeof(void*));
-}
-
-EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint* attrib_list) {
- return (EGLSurface)malloc(sizeof(void*));
-}
-
-EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface) {
- free(surface);
- return EGL_TRUE;
-}
-
-EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint* value) {
- *value = 1000;
- return EGL_TRUE;
-}
-
-EGLBoolean eglReleaseThread(void) {
- return EGL_TRUE;
-}
-
-EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value) {
- return EGL_TRUE;
-}
-
-EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) {
- return EGL_TRUE;
-}
-
-EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context,
- const EGLint* attrib_list) {
- return (EGLContext)malloc(sizeof(void*));
-}
-EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) {
- free(ctx);
- return EGL_TRUE;
-}
-
-EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) {
- ThreadState* state = getThreadState();
- state->surface = draw;
- state->context = ctx;
- return EGL_TRUE;
-}
-
-EGLContext eglGetCurrentContext(void) {
- return getThreadState()->context;
-}
-
-EGLSurface eglGetCurrentSurface(EGLint readdraw) {
- return getThreadState()->surface;
-}
-
-EGLDisplay eglGetCurrentDisplay(void) {
- return gDisplay;
-}
-
-EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) {
- return EGL_TRUE;
-}
-
-EGLBoolean eglSwapBuffersWithDamageKHR(EGLDisplay dpy, EGLSurface surface, EGLint* rects,
- EGLint rectCount) {
- return EGL_TRUE;
-}
-
-EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
- EGLClientBuffer buffer, const EGLint* attrib_list) {
- return (EGLImageKHR)malloc(sizeof(EGLImageKHR));
-}
-
-EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint* attrib_list) {
- return gFence;
-}
-
-EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) {
- return EGL_TRUE;
-}
-
-EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) {
- return EGL_CONDITION_SATISFIED_KHR;
-}
-
-EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image) {
- free(image);
- return EGL_TRUE;
-}
-
-void eglBeginFrame(EGLDisplay dpy, EGLSurface surface) {}
diff --git a/libs/hwui/debug/wrap_gles.h b/libs/hwui/debug/wrap_gles.h
deleted file mode 100644
index 3da6e802d178..000000000000
--- a/libs/hwui/debug/wrap_gles.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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'ing this file is bad, bad things should be compile errors
-#ifdef HWUI_GLES_WRAP_ENABLED
-#error wrap_gles.h should only be used as an auto-included header, don't directly #include it
-#endif
-#define HWUI_GLES_WRAP_ENABLED
-
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#include <GLES3/gl3.h>
-#include <GLES3/gl31.h>
-#include <GLES3/gl32.h>
-
-// constant used by the NULL GPU implementation as well as HWUI's unit tests
-constexpr int NULL_GPU_MAX_TEXTURE_SIZE = 2048;
-
-// Generate stubs that route all the calls to our function table
-#include "gles_redefine.h"
-
-#define GL_ENTRY(ret, api, ...) ret api(__VA_ARGS__);
-
-#include "gles_decls.in"
-#undef GL_ENTRY
diff --git a/libs/hwui/hwui/AnimatedImageDrawable.cpp b/libs/hwui/hwui/AnimatedImageDrawable.cpp
index 8d4e7e09b458..4544beae5df8 100644
--- a/libs/hwui/hwui/AnimatedImageDrawable.cpp
+++ b/libs/hwui/hwui/AnimatedImageDrawable.cpp
@@ -64,7 +64,7 @@ bool AnimatedImageDrawable::nextSnapshotReady() const {
// Only called on the RenderThread while UI thread is locked.
bool AnimatedImageDrawable::isDirty(nsecs_t* outDelay) {
*outDelay = 0;
- const nsecs_t currentTime = systemTime(CLOCK_MONOTONIC);
+ const nsecs_t currentTime = systemTime(SYSTEM_TIME_MONOTONIC);
const nsecs_t lastWallTime = mLastWallTime;
mLastWallTime = currentTime;
@@ -244,7 +244,7 @@ int AnimatedImageDrawable::drawStaging(SkCanvas* canvas) {
bool update = false;
{
- const nsecs_t currentTime = systemTime(CLOCK_MONOTONIC);
+ const nsecs_t currentTime = systemTime(SYSTEM_TIME_MONOTONIC);
std::unique_lock lock{mSwapLock};
// mLastWallTime starts off at 0. If it is still 0, just update it to
// the current time and avoid updating
diff --git a/libs/hwui/hwui/Bitmap.cpp b/libs/hwui/hwui/Bitmap.cpp
index 219d04055eae..2ba6fbe76de1 100644
--- a/libs/hwui/hwui/Bitmap.cpp
+++ b/libs/hwui/hwui/Bitmap.cpp
@@ -17,17 +17,23 @@
#include "HardwareBitmapUploader.h"
#include "Properties.h"
+#ifdef __ANDROID__ // Layoutlib does not support render thread
#include "renderthread/RenderProxy.h"
+#endif
#include "utils/Color.h"
#include <utils/Trace.h>
+#ifndef _WIN32
#include <sys/mman.h>
+#endif
#include <cutils/ashmem.h>
#include <log/log.h>
+#ifndef _WIN32
#include <binder/IServiceManager.h>
#include <private/gui/ComposerService.h>
+#endif
#include <ui/PixelFormat.h>
#include <SkCanvas.h>
@@ -76,6 +82,7 @@ sk_sp<Bitmap> Bitmap::allocateAshmemBitmap(SkBitmap* bitmap) {
}
sk_sp<Bitmap> Bitmap::allocateAshmemBitmap(size_t size, const SkImageInfo& info, size_t rowBytes) {
+#ifdef __ANDROID__
// Create new ashmem region with read/write priv
int fd = ashmem_create_region("bitmap", size);
if (fd < 0) {
@@ -94,10 +101,17 @@ sk_sp<Bitmap> Bitmap::allocateAshmemBitmap(size_t size, const SkImageInfo& info,
return nullptr;
}
return sk_sp<Bitmap>(new Bitmap(addr, fd, size, info, rowBytes));
+#else
+ return Bitmap::allocateHeapBitmap(size, info, rowBytes);
+#endif
}
sk_sp<Bitmap> Bitmap::allocateHardwareBitmap(const SkBitmap& bitmap) {
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
return uirenderer::HardwareBitmapUploader::allocateHardwareBitmap(bitmap);
+#else
+ return Bitmap::allocateHeapBitmap(bitmap.info());
+#endif
}
sk_sp<Bitmap> Bitmap::allocateHeapBitmap(SkBitmap* bitmap) {
@@ -133,16 +147,35 @@ sk_sp<Bitmap> Bitmap::createFrom(const SkImageInfo& info, SkPixelRef& pixelRef)
}
-sk_sp<Bitmap> Bitmap::createFrom(sp<GraphicBuffer> graphicBuffer, SkColorType colorType,
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
+sk_sp<Bitmap> Bitmap::createFrom(AHardwareBuffer* hardwareBuffer, sk_sp<SkColorSpace> colorSpace,
+ BitmapPalette palette) {
+ AHardwareBuffer_Desc bufferDesc;
+ AHardwareBuffer_describe(hardwareBuffer, &bufferDesc);
+ SkImageInfo info = uirenderer::BufferDescriptionToImageInfo(bufferDesc, colorSpace);
+
+ const size_t rowBytes = info.bytesPerPixel() * bufferDesc.stride;
+ return sk_sp<Bitmap>(new Bitmap(hardwareBuffer, info, rowBytes, palette));
+}
+
+sk_sp<Bitmap> Bitmap::createFrom(AHardwareBuffer* hardwareBuffer, SkColorType colorType,
sk_sp<SkColorSpace> colorSpace, SkAlphaType alphaType,
BitmapPalette palette) {
- SkImageInfo info = SkImageInfo::Make(graphicBuffer->getWidth(), graphicBuffer->getHeight(),
+ AHardwareBuffer_Desc bufferDesc;
+ AHardwareBuffer_describe(hardwareBuffer, &bufferDesc);
+ SkImageInfo info = SkImageInfo::Make(bufferDesc.width, bufferDesc.height,
colorType, alphaType, colorSpace);
- return sk_sp<Bitmap>(new Bitmap(graphicBuffer.get(), info, palette));
+
+ const size_t rowBytes = info.bytesPerPixel() * bufferDesc.stride;
+ return sk_sp<Bitmap>(new Bitmap(hardwareBuffer, info, rowBytes, palette));
}
+#endif
sk_sp<Bitmap> Bitmap::createFrom(const SkImageInfo& info, size_t rowBytes, int fd, void* addr,
size_t size, bool readOnly) {
+#ifdef _WIN32 // ashmem not implemented on Windows
+ return nullptr;
+#else
if (info.colorType() == kUnknown_SkColorType) {
LOG_ALWAYS_FATAL("unknown bitmap configuration");
return nullptr;
@@ -163,6 +196,7 @@ sk_sp<Bitmap> Bitmap::createFrom(const SkImageInfo& info, size_t rowBytes, int f
bitmap->setImmutable();
}
return bitmap;
+#endif
}
void Bitmap::setColorSpace(sk_sp<SkColorSpace> colorSpace) {
@@ -217,19 +251,20 @@ Bitmap::Bitmap(void* address, int fd, size_t mappedSize, const SkImageInfo& info
mPixelStorage.ashmem.size = mappedSize;
}
-Bitmap::Bitmap(GraphicBuffer* buffer, const SkImageInfo& info, BitmapPalette palette)
- : SkPixelRef(info.width(), info.height(), nullptr,
- bytesPerPixel(buffer->getPixelFormat()) * buffer->getStride())
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
+Bitmap::Bitmap(AHardwareBuffer* buffer, const SkImageInfo& info, size_t rowBytes,
+ BitmapPalette palette)
+ : SkPixelRef(info.width(), info.height(), nullptr, rowBytes)
, mInfo(validateAlpha(info))
, mPixelStorageType(PixelStorageType::Hardware)
, mPalette(palette)
, mPaletteGenerationId(getGenerationID()) {
mPixelStorage.hardware.buffer = buffer;
- buffer->incStrong(buffer);
+ AHardwareBuffer_acquire(buffer);
setImmutable(); // HW bitmaps are always immutable
- mImage = SkImage::MakeFromAHardwareBuffer(reinterpret_cast<AHardwareBuffer*>(buffer),
- mInfo.alphaType(), mInfo.refColorSpace());
+ mImage = SkImage::MakeFromAHardwareBuffer(buffer, mInfo.alphaType(), mInfo.refColorSpace());
}
+#endif
Bitmap::~Bitmap() {
switch (mPixelStorageType) {
@@ -238,17 +273,23 @@ Bitmap::~Bitmap() {
mPixelStorage.external.context);
break;
case PixelStorageType::Ashmem:
+#ifndef _WIN32 // ashmem not implemented on Windows
munmap(mPixelStorage.ashmem.address, mPixelStorage.ashmem.size);
+#endif
close(mPixelStorage.ashmem.fd);
break;
case PixelStorageType::Heap:
free(mPixelStorage.heap.address);
+#ifdef __ANDROID__
mallopt(M_PURGE, 0);
+#endif
break;
case PixelStorageType::Hardware:
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
auto buffer = mPixelStorage.hardware.buffer;
- buffer->decStrong(buffer);
+ AHardwareBuffer_release(buffer);
mPixelStorage.hardware.buffer = nullptr;
+#endif
break;
}
}
@@ -307,26 +348,30 @@ void Bitmap::setAlphaType(SkAlphaType alphaType) {
}
void Bitmap::getSkBitmap(SkBitmap* outBitmap) {
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
if (isHardware()) {
outBitmap->allocPixels(mInfo);
uirenderer::renderthread::RenderProxy::copyHWBitmapInto(this, outBitmap);
return;
}
+#endif
outBitmap->setInfo(mInfo, rowBytes());
outBitmap->setPixelRef(sk_ref_sp(this), 0, 0);
}
void Bitmap::getBounds(SkRect* bounds) const {
SkASSERT(bounds);
- bounds->set(0, 0, SkIntToScalar(width()), SkIntToScalar(height()));
+ bounds->setIWH(width(), height());
}
-GraphicBuffer* Bitmap::graphicBuffer() {
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
+AHardwareBuffer* Bitmap::hardwareBuffer() {
if (isHardware()) {
return mPixelStorage.hardware.buffer;
}
return nullptr;
}
+#endif
sk_sp<SkImage> Bitmap::makeImage() {
sk_sp<SkImage> image = mImage;
diff --git a/libs/hwui/hwui/Bitmap.h b/libs/hwui/hwui/Bitmap.h
index dd98b25ac7e8..00733c6b245b 100644
--- a/libs/hwui/hwui/Bitmap.h
+++ b/libs/hwui/hwui/Bitmap.h
@@ -23,7 +23,9 @@
#include <SkImageInfo.h>
#include <SkPixelRef.h>
#include <cutils/compiler.h>
-#include <ui/GraphicBuffer.h>
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
+#include <android/hardware_buffer.h>
+#endif
namespace android {
@@ -71,11 +73,17 @@ public:
/* The createFrom factories construct a new Bitmap object by wrapping the already allocated
* memory that is provided as an input param.
*/
- static sk_sp<Bitmap> createFrom(sp<GraphicBuffer> graphicBuffer,
- SkColorType colorType,
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
+ static sk_sp<Bitmap> createFrom(AHardwareBuffer* hardwareBuffer,
sk_sp<SkColorSpace> colorSpace,
- SkAlphaType alphaType = kPremul_SkAlphaType,
BitmapPalette palette = BitmapPalette::Unknown);
+
+ static sk_sp<Bitmap> createFrom(AHardwareBuffer* hardwareBuffer,
+ SkColorType colorType,
+ sk_sp<SkColorSpace> colorSpace,
+ SkAlphaType alphaType,
+ BitmapPalette palette);
+#endif
static sk_sp<Bitmap> createFrom(const SkImageInfo& info, size_t rowBytes, int fd, void* addr,
size_t size, bool readOnly);
static sk_sp<Bitmap> createFrom(const SkImageInfo&, SkPixelRef&);
@@ -105,7 +113,9 @@ public:
PixelStorageType pixelStorageType() const { return mPixelStorageType; }
- GraphicBuffer* graphicBuffer();
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
+ AHardwareBuffer* hardwareBuffer();
+#endif
/**
* Creates or returns a cached SkImage and is safe to be invoked from either
@@ -136,7 +146,10 @@ private:
Bitmap(void* address, void* context, FreeFunc freeFunc, const SkImageInfo& info,
size_t rowBytes);
Bitmap(void* address, int fd, size_t mappedSize, const SkImageInfo& info, size_t rowBytes);
- Bitmap(GraphicBuffer* buffer, const SkImageInfo& info, BitmapPalette palette);
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
+ Bitmap(AHardwareBuffer* buffer, const SkImageInfo& info, size_t rowBytes,
+ BitmapPalette palette);
+#endif
virtual ~Bitmap();
void* getStorage() const;
@@ -165,9 +178,11 @@ private:
void* address;
size_t size;
} heap;
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
struct {
- GraphicBuffer* buffer;
+ AHardwareBuffer* buffer;
} hardware;
+#endif
} mPixelStorage;
sk_sp<SkImage> mImage; // Cache is used only for HW Bitmaps with Skia pipeline.
diff --git a/libs/hwui/hwui/Canvas.cpp b/libs/hwui/hwui/Canvas.cpp
index 68aa7374fec4..b98ffca84dfc 100644
--- a/libs/hwui/hwui/Canvas.cpp
+++ b/libs/hwui/hwui/Canvas.cpp
@@ -34,7 +34,7 @@ Canvas* Canvas::create_recording_canvas(int width, int height, uirenderer::Rende
}
static inline void drawStroke(SkScalar left, SkScalar right, SkScalar top, SkScalar thickness,
- const SkPaint& paint, Canvas* canvas) {
+ const Paint& paint, Canvas* canvas) {
const SkScalar strokeWidth = fmax(thickness, 1.0f);
const SkScalar bottom = top + strokeWidth;
canvas->drawRect(left, top, right, bottom, paint);
@@ -154,6 +154,11 @@ void Canvas::drawText(const uint16_t* text, int textSize, int start, int count,
// minikin may modify the original paint
Paint paint(origPaint);
+ // interpret 'linear metrics' flag as 'linear', forcing no-hinting when drawing
+ if (paint.getSkFont().isLinearMetrics()) {
+ paint.getSkFont().setHinting(SkFontHinting::kNone);
+ }
+
minikin::Layout layout = MinikinUtils::doLayout(&paint, bidiFlags, typeface, text, textSize,
start, count, contextStart, contextCount, mt);
@@ -177,7 +182,7 @@ void Canvas::drawText(const uint16_t* text, int textSize, int start, int count,
void Canvas::drawDoubleRoundRectXY(float outerLeft, float outerTop, float outerRight,
float outerBottom, float outerRx, float outerRy, float innerLeft,
float innerTop, float innerRight, float innerBottom, float innerRx,
- float innerRy, const SkPaint& paint) {
+ float innerRy, const Paint& paint) {
if (CC_UNLIKELY(paint.nothingToDraw())) return;
SkRect outer = SkRect::MakeLTRB(outerLeft, outerTop, outerRight, outerBottom);
SkRect inner = SkRect::MakeLTRB(innerLeft, innerTop, innerRight, innerBottom);
@@ -193,7 +198,7 @@ void Canvas::drawDoubleRoundRectXY(float outerLeft, float outerTop, float outerR
void Canvas::drawDoubleRoundRectRadii(float outerLeft, float outerTop, float outerRight,
float outerBottom, const float* outerRadii, float innerLeft,
float innerTop, float innerRight, float innerBottom,
- const float* innerRadii, const SkPaint& paint) {
+ const float* innerRadii, const Paint& paint) {
static_assert(sizeof(SkVector) == sizeof(float) * 2);
if (CC_UNLIKELY(paint.nothingToDraw())) return;
SkRect outer = SkRect::MakeLTRB(outerLeft, outerTop, outerRight, outerBottom);
@@ -234,23 +239,30 @@ private:
};
void Canvas::drawTextOnPath(const uint16_t* text, int count, minikin::Bidi bidiFlags,
- const SkPath& path, float hOffset, float vOffset, const Paint& paint,
- const Typeface* typeface) {
- Paint paintCopy(paint);
+ const SkPath& path, float hOffset, float vOffset,
+ const Paint& origPaint, const Typeface* typeface) {
+ // minikin may modify the original paint
+ Paint paint(origPaint);
+
+ // interpret 'linear metrics' flag as 'linear', forcing no-hinting when drawing
+ if (paint.getSkFont().isLinearMetrics()) {
+ paint.getSkFont().setHinting(SkFontHinting::kNone);
+ }
+
minikin::Layout layout =
- MinikinUtils::doLayout(&paintCopy, bidiFlags, typeface, text, count, // text buffer
- 0, count, // draw range
- 0, count, // context range
+ MinikinUtils::doLayout(&paint, bidiFlags, typeface, text, count, // text buffer
+ 0, count, // draw range
+ 0, count, // context range
nullptr);
- hOffset += MinikinUtils::hOffsetForTextAlign(&paintCopy, layout, path);
+ hOffset += MinikinUtils::hOffsetForTextAlign(&paint, layout, path);
// Set align to left for drawing, as we don't want individual
// glyphs centered or right-aligned; the offset above takes
// care of all alignment.
- paintCopy.setTextAlign(Paint::kLeft_Align);
+ paint.setTextAlign(Paint::kLeft_Align);
- DrawTextOnPathFunctor f(layout, this, hOffset, vOffset, paintCopy, path);
- MinikinUtils::forFontRun(layout, &paintCopy, f);
+ DrawTextOnPathFunctor f(layout, this, hOffset, vOffset, paint, path);
+ MinikinUtils::forFontRun(layout, &paint, f);
}
int Canvas::sApiLevel = 1;
diff --git a/libs/hwui/hwui/Canvas.h b/libs/hwui/hwui/Canvas.h
index ac8db216b059..b90a4a3d68e6 100644
--- a/libs/hwui/hwui/Canvas.h
+++ b/libs/hwui/hwui/Canvas.h
@@ -131,20 +131,6 @@ public:
*/
static void setCompatibilityVersion(int apiLevel);
- /**
- * Provides a Skia SkCanvas interface that acts as a proxy to this Canvas.
- * It is useful for testing and clients (e.g. Picture/Movie) that expect to
- * draw their contents into an SkCanvas.
- *
- * The SkCanvas returned is *only* valid until another Canvas call is made
- * that would change state (e.g. matrix or clip). Clients of asSkCanvas()
- * are responsible for *not* persisting this pointer.
- *
- * Further, the returned SkCanvas should NOT be unref'd and is valid until
- * this canvas is destroyed or a new bitmap is set.
- */
- virtual SkCanvas* asSkCanvas() = 0;
-
virtual void setBitmap(const SkBitmap& bitmap) = 0;
virtual bool isOpaque() = 0;
@@ -231,39 +217,40 @@ public:
virtual void drawPaint(const SkPaint& paint) = 0;
// Geometry
- virtual void drawPoint(float x, float y, const SkPaint& paint) = 0;
- virtual void drawPoints(const float* points, int floatCount, const SkPaint& paint) = 0;
+ virtual void drawPoint(float x, float y, const Paint& paint) = 0;
+ virtual void drawPoints(const float* points, int floatCount, const Paint& paint) = 0;
virtual void drawLine(float startX, float startY, float stopX, float stopY,
- const SkPaint& paint) = 0;
- virtual void drawLines(const float* points, int floatCount, const SkPaint& paint) = 0;
+ const Paint& paint) = 0;
+ virtual void drawLines(const float* points, int floatCount, const Paint& paint) = 0;
virtual void drawRect(float left, float top, float right, float bottom,
- const SkPaint& paint) = 0;
- virtual void drawRegion(const SkRegion& region, const SkPaint& paint) = 0;
+ const Paint& paint) = 0;
+ virtual void drawRegion(const SkRegion& region, const Paint& paint) = 0;
virtual void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry,
- const SkPaint& paint) = 0;
+ const Paint& paint) = 0;
virtual void drawDoubleRoundRect(const SkRRect& outer, const SkRRect& inner,
- const SkPaint& paint) = 0;
- virtual void drawCircle(float x, float y, float radius, const SkPaint& paint) = 0;
+ const Paint& paint) = 0;
+ virtual void drawCircle(float x, float y, float radius, const Paint& paint) = 0;
virtual void drawOval(float left, float top, float right, float bottom,
- const SkPaint& paint) = 0;
+ const Paint& paint) = 0;
virtual void drawArc(float left, float top, float right, float bottom, float startAngle,
- float sweepAngle, bool useCenter, const SkPaint& paint) = 0;
- virtual void drawPath(const SkPath& path, const SkPaint& paint) = 0;
- virtual void drawVertices(const SkVertices*, SkBlendMode, const SkPaint& paint) = 0;
+ float sweepAngle, bool useCenter, const Paint& paint) = 0;
+ virtual void drawPath(const SkPath& path, const Paint& paint) = 0;
+ virtual void drawVertices(const SkVertices*, SkBlendMode, const Paint& paint) = 0;
// Bitmap-based
- virtual void drawBitmap(Bitmap& bitmap, float left, float top, const SkPaint* paint) = 0;
- virtual void drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint) = 0;
+ virtual void drawBitmap(Bitmap& bitmap, float left, float top, const Paint* paint) = 0;
+ virtual void drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const Paint* paint) = 0;
virtual void drawBitmap(Bitmap& bitmap, float srcLeft, float srcTop, float srcRight,
float srcBottom, float dstLeft, float dstTop, float dstRight,
- float dstBottom, const SkPaint* paint) = 0;
+ float dstBottom, const Paint* paint) = 0;
virtual void drawBitmapMesh(Bitmap& bitmap, int meshWidth, int meshHeight,
- const float* vertices, const int* colors, const SkPaint* paint) = 0;
+ const float* vertices, const int* colors, const Paint* paint) = 0;
virtual void drawNinePatch(Bitmap& bitmap, const android::Res_png_9patch& chunk, float dstLeft,
float dstTop, float dstRight, float dstBottom,
- const SkPaint* paint) = 0;
+ const Paint* paint) = 0;
virtual double drawAnimatedImage(AnimatedImageDrawable* imgDrawable) = 0;
+ virtual void drawPicture(const SkPicture& picture) = 0;
/**
* Specifies if the positions passed to ::drawText are absolute or relative
@@ -294,12 +281,12 @@ public:
void drawDoubleRoundRectXY(float outerLeft, float outerTop, float outerRight,
float outerBottom, float outerRx, float outerRy, float innerLeft,
float innerTop, float innerRight, float innerBottom, float innerRx,
- float innerRy, const SkPaint& paint);
+ float innerRy, const Paint& paint);
void drawDoubleRoundRectRadii(float outerLeft, float outerTop, float outerRight,
float outerBottom, const float* outerRadii, float innerLeft,
float innerTop, float innerRight, float innerBottom,
- const float* innerRadii, const SkPaint& paint);
+ const float* innerRadii, const Paint& paint);
static int GetApiLevel() { return sApiLevel; }
diff --git a/libs/hwui/hwui/MinikinSkia.h b/libs/hwui/hwui/MinikinSkia.h
index 90f7d48a47ee..298967689cd9 100644
--- a/libs/hwui/hwui/MinikinSkia.h
+++ b/libs/hwui/hwui/MinikinSkia.h
@@ -20,6 +20,8 @@
#include <SkRefCnt.h>
#include <cutils/compiler.h>
#include <minikin/MinikinFont.h>
+#include <string>
+#include <string_view>
class SkFont;
class SkTypeface;
diff --git a/libs/hwui/hwui/Paint.h b/libs/hwui/hwui/Paint.h
index 9b2fa9df1e8f..281ecd27d780 100644
--- a/libs/hwui/hwui/Paint.h
+++ b/libs/hwui/hwui/Paint.h
@@ -21,6 +21,7 @@
#include <cutils/compiler.h>
+#include <SkDrawLooper.h>
#include <SkFont.h>
#include <SkPaint.h>
#include <string>
@@ -58,12 +59,17 @@ public:
SkFont& getSkFont() { return mFont; }
const SkFont& getSkFont() const { return mFont; }
+ SkDrawLooper* getLooper() const { return mLooper.get(); }
+ void setLooper(sk_sp<SkDrawLooper> looper) { mLooper = std::move(looper); }
+
// These shadow the methods on SkPaint, but we need to so we can keep related
// attributes in-sync.
void reset();
void setAntiAlias(bool);
+ bool nothingToDraw() const { return !mLooper && SkPaint::nothingToDraw(); }
+
// End method shadowing
void setLetterSpacing(float letterSpacing) { mLetterSpacing = letterSpacing; }
@@ -146,6 +152,7 @@ public:
private:
SkFont mFont;
+ sk_sp<SkDrawLooper> mLooper;
float mLetterSpacing = 0;
float mWordSpacing = 0;
diff --git a/libs/hwui/hwui/PaintImpl.cpp b/libs/hwui/hwui/PaintImpl.cpp
index 2f2d575bca29..fa2674fc2f5e 100644
--- a/libs/hwui/hwui/PaintImpl.cpp
+++ b/libs/hwui/hwui/PaintImpl.cpp
@@ -34,6 +34,7 @@ Paint::Paint()
Paint::Paint(const Paint& paint)
: SkPaint(paint)
, mFont(paint.mFont)
+ , mLooper(paint.mLooper)
, mLetterSpacing(paint.mLetterSpacing)
, mWordSpacing(paint.mWordSpacing)
, mFontFeatureSettings(paint.mFontFeatureSettings)
@@ -52,6 +53,7 @@ Paint::~Paint() {}
Paint& Paint::operator=(const Paint& other) {
SkPaint::operator=(other);
mFont = other.mFont;
+ mLooper = other.mLooper;
mLetterSpacing = other.mLetterSpacing;
mWordSpacing = other.mWordSpacing;
mFontFeatureSettings = other.mFontFeatureSettings;
@@ -69,6 +71,7 @@ Paint& Paint::operator=(const Paint& other) {
bool operator==(const Paint& a, const Paint& b) {
return static_cast<const SkPaint&>(a) == static_cast<const SkPaint&>(b) &&
a.mFont == b.mFont &&
+ a.mLooper == b.mLooper &&
a.mLetterSpacing == b.mLetterSpacing && a.mWordSpacing == b.mWordSpacing &&
a.mFontFeatureSettings == b.mFontFeatureSettings &&
a.mMinikinLocaleListId == b.mMinikinLocaleListId &&
@@ -83,6 +86,7 @@ void Paint::reset() {
mFont = SkFont();
mFont.setEdging(SkFont::Edging::kAlias);
+ mLooper.reset();
mStrikeThru = false;
mUnderline = false;
diff --git a/libs/hwui/hwui/Typeface.cpp b/libs/hwui/hwui/Typeface.cpp
index c4d8aa6c8fad..ccc328c702db 100644
--- a/libs/hwui/hwui/Typeface.cpp
+++ b/libs/hwui/hwui/Typeface.cpp
@@ -18,7 +18,9 @@
#include <fcntl.h> // For tests.
#include <pthread.h>
+#ifndef _WIN32
#include <sys/mman.h> // For tests.
+#endif
#include <sys/stat.h> // For tests.
#include "MinikinSkia.h"
@@ -171,6 +173,7 @@ void Typeface::setDefault(const Typeface* face) {
}
void Typeface::setRobotoTypefaceForTest() {
+#ifndef _WIN32
const char* kRobotoFont = "/system/fonts/Roboto-Regular.ttf";
int fd = open(kRobotoFont, O_RDONLY);
@@ -198,5 +201,6 @@ void Typeface::setRobotoTypefaceForTest() {
hwTypeface->fStyle = minikin::FontStyle();
Typeface::setDefault(hwTypeface);
+#endif
}
} // namespace android
diff --git a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
index 1bd30eb5371b..9c8463417e0a 100644
--- a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
+++ b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
@@ -18,7 +18,6 @@
#include <SkPaintFilterCanvas.h>
#include "RenderNode.h"
#include "SkiaDisplayList.h"
-#include "SkiaPipeline.h"
#include "utils/TraceUtils.h"
#include <optional>
@@ -187,17 +186,13 @@ public:
AlphaFilterCanvas(SkCanvas* canvas, float alpha) : SkPaintFilterCanvas(canvas), mAlpha(alpha) {}
protected:
- bool onFilter(SkTCopyOnFirstWrite<SkPaint>* paint, Type t) const override {
- std::optional<SkPaint> defaultPaint;
- if (!*paint) {
- paint->init(defaultPaint.emplace());
- }
- paint->writable()->setAlpha((uint8_t)(*paint)->getAlpha() * mAlpha);
+ bool onFilter(SkPaint& paint) const override {
+ paint.setAlpha((uint8_t)paint.getAlpha() * mAlpha);
return true;
}
void onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) override {
// We unroll the drawable using "this" canvas, so that draw calls contained inside will
- // get their alpha applied. THe default SkPaintFilterCanvas::onDrawDrawable does not unroll.
+ // get their alpha applied. The default SkPaintFilterCanvas::onDrawDrawable does not unroll.
drawable->draw(this, matrix);
}
diff --git a/libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp b/libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp
index 0a3c8f4347eb..3b8caeb3aab1 100644
--- a/libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp
+++ b/libs/hwui/pipeline/skia/ReorderBarrierDrawables.cpp
@@ -17,7 +17,7 @@
#include "ReorderBarrierDrawables.h"
#include "RenderNode.h"
#include "SkiaDisplayList.h"
-#include "SkiaPipeline.h"
+#include "LightingInfo.h"
#include <SkPathOps.h>
#include <SkShadowUtils.h>
@@ -27,7 +27,7 @@ namespace uirenderer {
namespace skiapipeline {
StartReorderBarrierDrawable::StartReorderBarrierDrawable(SkiaDisplayList* data)
- : mEndChildIndex(0), mBeginChildIndex(data->mChildNodes.size()), mDisplayList(data) {}
+ : mEndChildIndex(-1), mBeginChildIndex(data->mChildNodes.size()), mDisplayList(data) {}
void StartReorderBarrierDrawable::onDraw(SkCanvas* canvas) {
if (mChildren.empty()) {
@@ -139,8 +139,8 @@ void EndReorderBarrierDrawable::drawShadow(SkCanvas* canvas, RenderNodeDrawable*
return;
}
- float ambientAlpha = (SkiaPipeline::getAmbientShadowAlpha() / 255.f) * casterAlpha;
- float spotAlpha = (SkiaPipeline::getSpotShadowAlpha() / 255.f) * casterAlpha;
+ float ambientAlpha = (LightingInfo::getAmbientShadowAlpha() / 255.f) * casterAlpha;
+ float spotAlpha = (LightingInfo::getSpotShadowAlpha() / 255.f) * casterAlpha;
const RevealClip& revealClip = casterProperties.getRevealClip();
const SkPath* revealClipPath = revealClip.getPath();
@@ -192,7 +192,7 @@ void EndReorderBarrierDrawable::drawShadow(SkCanvas* canvas, RenderNodeDrawable*
casterPath = &tmpPath;
}
- const Vector3 lightPos = SkiaPipeline::getLightCenter();
+ const Vector3 lightPos = LightingInfo::getLightCenter();
SkPoint3 skiaLightPos = SkPoint3::Make(lightPos.x, lightPos.y, lightPos.z);
SkPoint3 zParams;
if (shadowMatrix.hasPerspective()) {
@@ -206,7 +206,7 @@ void EndReorderBarrierDrawable::drawShadow(SkCanvas* canvas, RenderNodeDrawable*
SkColor ambientColor = multiplyAlpha(casterProperties.getAmbientShadowColor(), ambientAlpha);
SkColor spotColor = multiplyAlpha(casterProperties.getSpotShadowColor(), spotAlpha);
SkShadowUtils::DrawShadow(
- canvas, *casterPath, zParams, skiaLightPos, SkiaPipeline::getLightRadius(),
+ canvas, *casterPath, zParams, skiaLightPos, LightingInfo::getLightRadius(),
ambientColor, spotColor,
casterAlpha < 1.0f ? SkShadowFlags::kTransparentOccluder_ShadowFlag : 0);
}
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
index 41bcfc25f5c1..d7076d4cf424 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
@@ -15,11 +15,18 @@
*/
#include "SkiaDisplayList.h"
+#include "FunctorDrawable.h"
#include "DumpOpsCanvas.h"
+#ifdef __ANDROID__ // Layoutlib does not support SkiaPipeline
#include "SkiaPipeline.h"
+#else
+#include "DamageAccumulator.h"
+#endif
#include "VectorDrawable.h"
+#ifdef __ANDROID__
#include "renderthread/CanvasContext.h"
+#endif
#include <SkImagePriv.h>
#include <SkPathOps.h>
@@ -81,6 +88,7 @@ bool SkiaDisplayList::prepareListAndChildren(
// If the prepare tree is triggered by the UI thread and no previous call to
// pinImages has failed then we must pin all mutable images in the GPU cache
// until the next UI thread draw.
+#ifdef __ANDROID__ // Layoutlib does not support CanvasContext
if (info.prepareTextures && !info.canvasContext.pinImages(mMutableImages)) {
// In the event that pinning failed we prevent future pinImage calls for the
// remainder of this tree traversal and also unpin any currently pinned images
@@ -88,6 +96,7 @@ bool SkiaDisplayList::prepareListAndChildren(
info.prepareTextures = false;
info.canvasContext.unpinImages();
}
+#endif
bool hasBackwardProjectedNodesHere = false;
bool hasBackwardProjectedNodesSubtree = false;
@@ -131,21 +140,22 @@ bool SkiaDisplayList::prepareListAndChildren(
}
}
- for (auto& vectorDrawablePair : mVectorDrawables) {
+ for (auto& [vectorDrawable, cachedMatrix] : mVectorDrawables) {
// If any vector drawable in the display list needs update, damage the node.
- auto& vectorDrawable = vectorDrawablePair.first;
if (vectorDrawable->isDirty()) {
Matrix4 totalMatrix;
info.damageAccumulator->computeCurrentTransform(&totalMatrix);
- Matrix4 canvasMatrix(vectorDrawablePair.second);
+ Matrix4 canvasMatrix(cachedMatrix);
totalMatrix.multiply(canvasMatrix);
const SkRect& bounds = vectorDrawable->properties().getBounds();
if (intersects(info.screenSize, totalMatrix, bounds)) {
isDirty = true;
+#ifdef __ANDROID__ // Layoutlib does not support CanvasContext
static_cast<SkiaPipeline*>(info.canvasContext.getRenderPipeline())
->getVectorDrawables()
->push_back(vectorDrawable);
vectorDrawable->setPropertyChangeWillBeConsumed(true);
+#endif
}
}
}
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.h b/libs/hwui/pipeline/skia/SkiaDisplayList.h
index b79103787023..cdd00db9afdc 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.h
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.h
@@ -16,7 +16,6 @@
#pragma once
-#include "FunctorDrawable.h"
#include "RecordingCanvas.h"
#include "RenderNodeDrawable.h"
#include "TreeInfo.h"
@@ -34,6 +33,7 @@ class CanvasContext;
}
class Outline;
+struct WebViewSyncData;
namespace VectorDrawable {
class Tree;
@@ -42,9 +42,12 @@ typedef uirenderer::VectorDrawable::Tree VectorDrawableRoot;
namespace skiapipeline {
+class FunctorDrawable;
+
class SkiaDisplayList {
public:
size_t getUsedSize() { return allocator.usedSize() + mDisplayList.usedSize(); }
+ size_t getAllocatedSize() { return allocator.allocatedSize() + mDisplayList.allocatedSize(); }
~SkiaDisplayList() {
/* Given that we are using a LinearStdAllocator to store some of the
diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp
index 8092b1d10659..e7efe2ff798b 100644
--- a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp
@@ -18,6 +18,7 @@
#include "DeferredLayerUpdater.h"
#include "LayerDrawable.h"
+#include "LightingInfo.h"
#include "SkiaPipeline.h"
#include "SkiaProfileRenderer.h"
#include "hwui/Bitmap.h"
@@ -99,7 +100,7 @@ bool SkiaOpenGLPipeline::draw(const Frame& frame, const SkRect& screenDirty, con
mRenderThread.getGrContext(), backendRT, this->getSurfaceOrigin(), colorType,
mSurfaceColorSpace, &props));
- SkiaPipeline::updateLighting(lightGeometry, lightInfo);
+ LightingInfo::updateLighting(lightGeometry, lightInfo);
renderFrame(*layerUpdateQueue, dirty, renderNodes, opaque, contentDrawBounds, surface,
SkMatrix::I());
layerUpdateQueue->clear();
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
index 1f9ab5a242b4..3010206cdc5b 100644
--- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
@@ -19,29 +19,29 @@
#include <SkImageEncoder.h>
#include <SkImageInfo.h>
#include <SkImagePriv.h>
+#include <SkMultiPictureDocument.h>
#include <SkOverdrawCanvas.h>
#include <SkOverdrawColorFilter.h>
#include <SkPicture.h>
#include <SkPictureRecorder.h>
+#include <SkSerialProcs.h>
+#include "LightingInfo.h"
#include "TreeInfo.h"
#include "VectorDrawable.h"
#include "thread/CommonPool.h"
+#include "tools/SkSharingProc.h"
#include "utils/TraceUtils.h"
#include <unistd.h>
+#include <android-base/properties.h>
+
using namespace android::uirenderer::renderthread;
namespace android {
namespace uirenderer {
namespace skiapipeline {
-float SkiaPipeline::mLightRadius = 0;
-uint8_t SkiaPipeline::mAmbientShadowAlpha = 0;
-uint8_t SkiaPipeline::mSpotShadowAlpha = 0;
-
-Vector3 SkiaPipeline::mLightCenter = {FLT_MIN, FLT_MIN, FLT_MIN};
-
SkiaPipeline::SkiaPipeline(RenderThread& thread) : mRenderThread(thread) {
mVectorDrawables.reserve(30);
}
@@ -82,7 +82,7 @@ void SkiaPipeline::onPrepareTree() {
void SkiaPipeline::renderLayers(const LightGeometry& lightGeometry,
LayerUpdateQueue* layerUpdateQueue, bool opaque,
const LightInfo& lightInfo) {
- updateLighting(lightGeometry, lightInfo);
+ LightingInfo::updateLighting(lightGeometry, lightInfo);
ATRACE_NAME("draw layers");
renderVectorDrawableCache();
renderLayersImpl(*layerUpdateQueue, opaque);
@@ -102,7 +102,7 @@ void SkiaPipeline::renderLayersImpl(const LayerUpdateQueue& layers, bool opaque)
SkASSERT(layerNode->getLayerSurface());
SkiaDisplayList* displayList = (SkiaDisplayList*)layerNode->getDisplayList();
if (!displayList || displayList->isEmpty()) {
- SkDEBUGF(("%p drawLayers(%s) : missing drawable", layerNode, layerNode->getName()));
+ ALOGE("%p drawLayers(%s) : missing drawable", layerNode, layerNode->getName());
return;
}
@@ -115,9 +115,13 @@ void SkiaPipeline::renderLayersImpl(const LayerUpdateQueue& layers, bool opaque)
layerCanvas->androidFramework_setDeviceClipRestriction(layerDamage.toSkIRect());
- auto savedLightCenter = mLightCenter;
+ // TODO: put localized light center calculation and storage to a drawable related code.
+ // It does not seem right to store something localized in a global state
+ const Vector3 savedLightCenter(LightingInfo::getLightCenterRaw());
+ Vector3 transformedLightCenter(savedLightCenter);
// map current light center into RenderNode's coordinate space
- layerNode->getSkiaLayer()->inverseTransformInWindow.mapPoint3d(mLightCenter);
+ layerNode->getSkiaLayer()->inverseTransformInWindow.mapPoint3d(transformedLightCenter);
+ LightingInfo::setLightCenterRaw(transformedLightCenter);
const RenderProperties& properties = layerNode->properties();
const SkRect bounds = SkRect::MakeWH(properties.getWidth(), properties.getHeight());
@@ -134,7 +138,7 @@ void SkiaPipeline::renderLayersImpl(const LayerUpdateQueue& layers, bool opaque)
RenderNodeDrawable root(layerNode, layerCanvas, false);
root.forceDraw(layerCanvas);
layerCanvas->restoreToCount(saveCount);
- mLightCenter = savedLightCenter;
+ LightingInfo::setLightCenterRaw(savedLightCenter);
// cache the current context so that we can defer flushing it until
// either all the layers have been rendered or the context changes
@@ -232,59 +236,137 @@ static void savePictureAsync(const sk_sp<SkData>& data, const std::string& filen
if (stream.isValid()) {
stream.write(data->data(), data->size());
stream.flush();
- SkDebugf("SKP Captured Drawing Output (%d bytes) for frame. %s", stream.bytesWritten(),
+ ALOGD("SKP Captured Drawing Output (%zu bytes) for frame. %s", stream.bytesWritten(),
filename.c_str());
}
});
}
-SkCanvas* SkiaPipeline::tryCapture(SkSurface* surface) {
- if (CC_UNLIKELY(Properties::skpCaptureEnabled)) {
- char prop[PROPERTY_VALUE_MAX] = {'\0'};
+// Note multiple SkiaPipeline instances may be loaded if more than one app is visible.
+// Each instance may observe the filename changing and try to record to a file of the same name.
+// Only the first one will succeed. There is no scope available here where we could coordinate
+// to cause this function to return true for only one of the instances.
+bool SkiaPipeline::shouldStartNewFileCapture() {
+ // Don't start a new file based capture if one is currently ongoing.
+ if (mCaptureMode != CaptureMode::None) { return false; }
+
+ // A new capture is started when the filename property changes.
+ // Read the filename property.
+ std::string prop = base::GetProperty(PROPERTY_CAPTURE_SKP_FILENAME, "0");
+ // if the filename property changed to a valid value
+ if (prop[0] != '0' && mCapturedFile != prop) {
+ // remember this new filename
+ mCapturedFile = prop;
+ // and get a property indicating how many frames to capture.
+ mCaptureSequence = base::GetIntProperty(PROPERTY_CAPTURE_SKP_FRAMES, 1);
if (mCaptureSequence <= 0) {
- property_get(PROPERTY_CAPTURE_SKP_FILENAME, prop, "0");
- if (prop[0] != '0' && mCapturedFile != prop) {
- mCapturedFile = prop;
- mCaptureSequence = property_get_int32(PROPERTY_CAPTURE_SKP_FRAMES, 1);
- }
+ return false;
+ } else if (mCaptureSequence == 1) {
+ mCaptureMode = CaptureMode::SingleFrameSKP;
+ } else {
+ mCaptureMode = CaptureMode::MultiFrameSKP;
}
- if (mCaptureSequence > 0 || mPictureCapturedCallback) {
- mRecorder.reset(new SkPictureRecorder());
- SkCanvas* pictureCanvas =
- mRecorder->beginRecording(surface->width(), surface->height(), nullptr,
- SkPictureRecorder::kPlaybackDrawPicture_RecordFlag);
- mNwayCanvas = std::make_unique<SkNWayCanvas>(surface->width(), surface->height());
- mNwayCanvas->addCanvas(surface->getCanvas());
- mNwayCanvas->addCanvas(pictureCanvas);
- return mNwayCanvas.get();
+ return true;
+ }
+ return false;
+}
+
+// performs the first-frame work of a multi frame SKP capture. Returns true if successful.
+bool SkiaPipeline::setupMultiFrameCapture() {
+ ALOGD("Set up multi-frame capture, frames = %d", mCaptureSequence);
+ // We own this stream and need to hold it until close() finishes.
+ auto stream = std::make_unique<SkFILEWStream>(mCapturedFile.c_str());
+ if (stream->isValid()) {
+ mOpenMultiPicStream = std::move(stream);
+ mSerialContext.reset(new SkSharingSerialContext());
+ SkSerialProcs procs;
+ procs.fImageProc = SkSharingSerialContext::serializeImage;
+ procs.fImageCtx = mSerialContext.get();
+ // SkDocuments don't take owership of the streams they write.
+ // we need to keep it until after mMultiPic.close()
+ // procs is passed as a pointer, but just as a method of having an optional default.
+ // procs doesn't need to outlive this Make call.
+ mMultiPic = SkMakeMultiPictureDocument(mOpenMultiPicStream.get(), &procs);
+ return true;
+ } else {
+ ALOGE("Could not open \"%s\" for writing.", mCapturedFile.c_str());
+ mCaptureSequence = 0;
+ mCaptureMode = CaptureMode::None;
+ return false;
+ }
+}
+
+SkCanvas* SkiaPipeline::tryCapture(SkSurface* surface) {
+ if (CC_LIKELY(!Properties::skpCaptureEnabled)) {
+ return surface->getCanvas(); // Bail out early when capture is not turned on.
+ }
+ // Note that shouldStartNewFileCapture tells us if this is the *first* frame of a capture.
+ if (shouldStartNewFileCapture() && mCaptureMode == CaptureMode::MultiFrameSKP) {
+ if (!setupMultiFrameCapture()) {
+ return surface->getCanvas();
}
}
- return surface->getCanvas();
+
+ // Create a canvas pointer, fill it depending on what kind of capture is requested (if any)
+ SkCanvas* pictureCanvas = nullptr;
+ switch (mCaptureMode) {
+ case CaptureMode::CallbackAPI:
+ case CaptureMode::SingleFrameSKP:
+ mRecorder.reset(new SkPictureRecorder());
+ pictureCanvas = mRecorder->beginRecording(surface->width(), surface->height());
+ break;
+ case CaptureMode::MultiFrameSKP:
+ // If a multi frame recording is active, initialize recording for a single frame of a
+ // multi frame file.
+ pictureCanvas = mMultiPic->beginPage(surface->width(), surface->height());
+ break;
+ case CaptureMode::None:
+ // Returning here in the non-capture case means we can count on pictureCanvas being
+ // non-null below.
+ return surface->getCanvas();
+ }
+
+ // Setting up an nway canvas is common to any kind of capture.
+ mNwayCanvas = std::make_unique<SkNWayCanvas>(surface->width(), surface->height());
+ mNwayCanvas->addCanvas(surface->getCanvas());
+ mNwayCanvas->addCanvas(pictureCanvas);
+ return mNwayCanvas.get();
}
void SkiaPipeline::endCapture(SkSurface* surface) {
+ if (CC_LIKELY(mCaptureMode == CaptureMode::None)) { return; }
mNwayCanvas.reset();
- if (CC_UNLIKELY(mRecorder.get())) {
- ATRACE_CALL();
+ ATRACE_CALL();
+ if (mCaptureSequence > 0 && mCaptureMode == CaptureMode::MultiFrameSKP) {
+ mMultiPic->endPage();
+ mCaptureSequence--;
+ if (mCaptureSequence == 0) {
+ mCaptureMode = CaptureMode::None;
+ // Pass mMultiPic and mOpenMultiPicStream to a background thread, which will handle
+ // the heavyweight serialization work and destroy them. mOpenMultiPicStream is released
+ // to a bare pointer because keeping it in a smart pointer makes the lambda
+ // non-copyable. The lambda is only called once, so this is safe.
+ SkFILEWStream* stream = mOpenMultiPicStream.release();
+ CommonPool::post([doc = std::move(mMultiPic), stream]{
+ ALOGD("Finalizing multi frame SKP");
+ doc->close();
+ delete stream;
+ ALOGD("Multi frame SKP complete.");
+ });
+ }
+ } else {
sk_sp<SkPicture> picture = mRecorder->finishRecordingAsPicture();
if (picture->approximateOpCount() > 0) {
- if (mCaptureSequence > 0) {
- ATRACE_BEGIN("picture->serialize");
- auto data = picture->serialize();
- ATRACE_END();
-
- // offload saving to file in a different thread
- if (1 == mCaptureSequence) {
- savePictureAsync(data, mCapturedFile);
- } else {
- savePictureAsync(data, mCapturedFile + "_" + std::to_string(mCaptureSequence));
- }
- mCaptureSequence--;
- }
if (mPictureCapturedCallback) {
std::invoke(mPictureCapturedCallback, std::move(picture));
+ } else {
+ // single frame skp to file
+ auto data = picture->serialize();
+ savePictureAsync(data, mCapturedFile);
+ mCaptureSequence = 0;
}
}
+ mCaptureMode = CaptureMode::None;
mRecorder.reset();
}
}
@@ -305,7 +387,6 @@ void SkiaPipeline::renderFrame(const LayerUpdateQueue& layers, const SkRect& cli
// initialize the canvas for the current frame, that might be a recording canvas if SKP
// capture is enabled.
- std::unique_ptr<SkPictureRecorder> recorder;
SkCanvas* canvas = tryCapture(surface.get());
renderFrameImpl(layers, clip, nodes, opaque, contentDrawBounds, canvas, preTransform);
@@ -430,13 +511,13 @@ void SkiaPipeline::renderFrameImpl(const LayerUpdateQueue& layers, const SkRect&
}
void SkiaPipeline::dumpResourceCacheUsage() const {
- int resources, maxResources;
- size_t bytes, maxBytes;
+ int resources;
+ size_t bytes;
mRenderThread.getGrContext()->getResourceCacheUsage(&resources, &bytes);
- mRenderThread.getGrContext()->getResourceCacheLimits(&maxResources, &maxBytes);
+ size_t maxBytes = mRenderThread.getGrContext()->getResourceCacheLimit();
SkString log("Resource Cache Usage:\n");
- log.appendf("%8d items out of %d maximum items\n", resources, maxResources);
+ log.appendf("%8d items\n", resources);
log.appendf("%8zu bytes (%.2f MB) out of %.2f MB maximum\n", bytes,
bytes * (1.0f / (1024.0f * 1024.0f)), maxBytes * (1.0f / (1024.0f * 1024.0f)));
@@ -488,6 +569,7 @@ void SkiaPipeline::renderOverdraw(const LayerUpdateQueue& layers, const SkRect&
// Set up the overdraw canvas.
SkImageInfo offscreenInfo = SkImageInfo::MakeA8(surface->width(), surface->height());
sk_sp<SkSurface> offscreen = surface->makeSurface(offscreenInfo);
+ LOG_ALWAYS_FATAL_IF(!offscreen, "Failed to create offscreen SkSurface for overdraw viz.");
SkOverdrawCanvas overdrawCanvas(offscreen->getCanvas());
// Fake a redraw to replay the draw commands. This will increment the alpha channel
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.h b/libs/hwui/pipeline/skia/SkiaPipeline.h
index 41d864653b67..37b559f92f05 100644
--- a/libs/hwui/pipeline/skia/SkiaPipeline.h
+++ b/libs/hwui/pipeline/skia/SkiaPipeline.h
@@ -17,12 +17,15 @@
#pragma once
#include <SkSurface.h>
+#include <SkDocument.h>
+#include <SkMultiPictureDocument.h>
#include "Lighting.h"
#include "hwui/AnimatedImageDrawable.h"
#include "renderthread/CanvasContext.h"
#include "renderthread/IRenderPipeline.h"
class SkPictureRecorder;
+struct SkSharingSerialContext;
namespace android {
namespace uirenderer {
@@ -60,52 +63,12 @@ public:
void renderLayersImpl(const LayerUpdateQueue& layers, bool opaque);
- static float getLightRadius() {
- if (CC_UNLIKELY(Properties::overrideLightRadius > 0)) {
- return Properties::overrideLightRadius;
- }
- return mLightRadius;
- }
-
- static uint8_t getAmbientShadowAlpha() {
- if (CC_UNLIKELY(Properties::overrideAmbientShadowStrength >= 0)) {
- return Properties::overrideAmbientShadowStrength;
- }
- return mAmbientShadowAlpha;
- }
-
- static uint8_t getSpotShadowAlpha() {
- if (CC_UNLIKELY(Properties::overrideSpotShadowStrength >= 0)) {
- return Properties::overrideSpotShadowStrength;
- }
- return mSpotShadowAlpha;
- }
-
- static Vector3 getLightCenter() {
- if (CC_UNLIKELY(Properties::overrideLightPosY > 0 || Properties::overrideLightPosZ > 0)) {
- Vector3 adjustedLightCenter = mLightCenter;
- if (CC_UNLIKELY(Properties::overrideLightPosY > 0)) {
- // negated since this shifts up
- adjustedLightCenter.y = -Properties::overrideLightPosY;
- }
- if (CC_UNLIKELY(Properties::overrideLightPosZ > 0)) {
- adjustedLightCenter.z = Properties::overrideLightPosZ;
- }
- return adjustedLightCenter;
- }
- return mLightCenter;
- }
-
- static void updateLighting(const LightGeometry& lightGeometry, const LightInfo& lightInfo) {
- mLightRadius = lightGeometry.radius;
- mAmbientShadowAlpha = lightInfo.ambientShadowAlpha;
- mSpotShadowAlpha = lightInfo.spotShadowAlpha;
- mLightCenter = lightGeometry.center;
- }
-
+ // Sets the recording callback to the provided function and the recording mode
+ // to CallbackAPI
void setPictureCapturedCallback(
const std::function<void(sk_sp<SkPicture>&&)>& callback) override {
mPictureCapturedCallback = callback;
+ mCaptureMode = callback ? CaptureMode::CallbackAPI : CaptureMode::None;
}
protected:
@@ -135,8 +98,18 @@ private:
*/
void renderVectorDrawableCache();
+ // Called every frame. Normally returns early with screen canvas.
+ // But when capture is enabled, returns an nwaycanvas where commands are also recorded.
SkCanvas* tryCapture(SkSurface* surface);
+ // Called at the end of every frame, closes the recording if necessary.
void endCapture(SkSurface* surface);
+ // Determine if a new file-based capture should be started.
+ // If so, sets mCapturedFile and mCaptureSequence and returns true.
+ // Should be called every frame when capture is enabled.
+ // sets mCaptureMode.
+ bool shouldStartNewFileCapture();
+ // Set up a multi frame capture.
+ bool setupMultiFrameCapture();
std::vector<sk_sp<SkImage>> mPinnedImages;
@@ -146,28 +119,47 @@ private:
std::vector<VectorDrawableRoot*> mVectorDrawables;
// Block of properties used only for debugging to record a SkPicture and save it in a file.
+ // There are three possible ways of recording drawing commands.
+ enum class CaptureMode {
+ // return to this mode when capture stops.
+ None,
+ // A mode where every frame is recorded into an SkPicture and sent to a provided callback,
+ // until that callback is cleared
+ CallbackAPI,
+ // A mode where a finite number of frames are recorded to a file with
+ // SkMultiPictureDocument
+ MultiFrameSKP,
+ // A mode which records a single frame to a normal SKP file.
+ SingleFrameSKP,
+ };
+ CaptureMode mCaptureMode = CaptureMode::None;
+
/**
- * mCapturedFile is used to enforce we don't capture more than once for a given name (cause
- * permissions don't allow to reset a property from render thread).
+ * mCapturedFile - the filename to write a recorded SKP to in either MultiFrameSKP or
+ * SingleFrameSKP mode.
*/
std::string mCapturedFile;
/**
- * mCaptureSequence counts how many frames are left to take in the sequence.
+ * mCaptureSequence counts down how many frames are left to take in the sequence. Applicable
+ * only to MultiFrameSKP or SingleFrameSKP mode.
*/
int mCaptureSequence = 0;
+ // Multi frame serialization stream and writer used when serializing more than one frame.
+ std::unique_ptr<SkFILEWStream> mOpenMultiPicStream;
+ sk_sp<SkDocument> mMultiPic;
+ std::unique_ptr<SkSharingSerialContext> mSerialContext;
+
/**
- * mRecorder holds the current picture recorder. We could store it on the stack to support
- * parallel tryCapture calls (not really needed).
+ * mRecorder holds the current picture recorder when serializing in either SingleFrameSKP or
+ * CallbackAPI modes.
*/
std::unique_ptr<SkPictureRecorder> mRecorder;
std::unique_ptr<SkNWayCanvas> mNwayCanvas;
- std::function<void(sk_sp<SkPicture>&&)> mPictureCapturedCallback;
- static float mLightRadius;
- static uint8_t mAmbientShadowAlpha;
- static uint8_t mSpotShadowAlpha;
- static Vector3 mLightCenter;
+ // Set by setPictureCapturedCallback and when set, CallbackAPI mode recording is ongoing.
+ // Not used in other recording modes.
+ std::function<void(sk_sp<SkPicture>&&)> mPictureCapturedCallback;
};
} /* namespace skiapipeline */
diff --git a/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp b/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp
index 16c8b8923074..d67cf8c9c73f 100644
--- a/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp
+++ b/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp
@@ -15,17 +15,21 @@
*/
#include "SkiaRecordingCanvas.h"
-
+#include "hwui/Paint.h"
#include <SkImagePriv.h>
#include "CanvasTransform.h"
+#ifdef __ANDROID__ // Layoutlib does not support Layers
#include "Layer.h"
#include "LayerDrawable.h"
+#endif
#include "NinePatchUtils.h"
#include "RenderNode.h"
#include "pipeline/skia/AnimatedDrawables.h"
+#ifdef __ANDROID__ // Layoutlib does not support GL, Vulcan etc.
#include "pipeline/skia/GLFunctorDrawable.h"
#include "pipeline/skia/VkFunctorDrawable.h"
#include "pipeline/skia/VkInteropFunctorDrawable.h"
+#endif
namespace android {
namespace uirenderer {
@@ -102,13 +106,16 @@ void SkiaRecordingCanvas::insertReorderBarrier(bool enableReorder) {
}
void SkiaRecordingCanvas::drawLayer(uirenderer::DeferredLayerUpdater* layerUpdater) {
+#ifdef __ANDROID__ // Layoutlib does not support Layers
if (layerUpdater != nullptr) {
// Create a ref-counted drawable, which is kept alive by sk_sp in SkLiteDL.
sk_sp<SkDrawable> drawable(new LayerDrawable(layerUpdater));
drawDrawable(drawable.get());
}
+#endif
}
+
void SkiaRecordingCanvas::drawRenderNode(uirenderer::RenderNode* renderNode) {
// Record the child node. Drawable dtor will be invoked when mChildNodes deque is cleared.
mDisplayList->mChildNodes.emplace_back(renderNode, asSkCanvas(), true, mCurrentBarrier);
@@ -125,8 +132,10 @@ void SkiaRecordingCanvas::drawRenderNode(uirenderer::RenderNode* renderNode) {
}
}
+
void SkiaRecordingCanvas::callDrawGLFunction(Functor* functor,
uirenderer::GlFunctorLifecycleListener* listener) {
+#ifdef __ANDROID__ // Layoutlib does not support GL, Vulcan etc.
FunctorDrawable* functorDrawable;
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) {
functorDrawable = mDisplayList->allocateDrawable<VkInteropFunctorDrawable>(
@@ -137,9 +146,11 @@ void SkiaRecordingCanvas::callDrawGLFunction(Functor* functor,
}
mDisplayList->mChildFunctors.push_back(functorDrawable);
drawDrawable(functorDrawable);
+#endif
}
void SkiaRecordingCanvas::drawWebViewFunctor(int functor) {
+#ifdef __ANDROID__ // Layoutlib does not support GL, Vulcan etc.
FunctorDrawable* functorDrawable;
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) {
functorDrawable = mDisplayList->allocateDrawable<VkFunctorDrawable>(functor, asSkCanvas());
@@ -147,7 +158,8 @@ void SkiaRecordingCanvas::drawWebViewFunctor(int functor) {
functorDrawable = mDisplayList->allocateDrawable<GLFunctorDrawable>(functor, asSkCanvas());
}
mDisplayList->mChildFunctors.push_back(functorDrawable);
- drawDrawable(functorDrawable);
+ mRecorder.drawWebView(functorDrawable);
+#endif
}
void SkiaRecordingCanvas::drawVectorDrawable(VectorDrawableRoot* tree) {
@@ -185,9 +197,37 @@ SkiaCanvas::PaintCoW&& SkiaRecordingCanvas::filterBitmap(PaintCoW&& paint) {
return filterPaint(std::move(paint));
}
-void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float left, float top, const SkPaint* paint) {
+static SkDrawLooper* get_looper(const Paint* paint) {
+ return paint ? paint->getLooper() : nullptr;
+}
+
+template <typename Proc>
+void applyLooper(SkDrawLooper* looper, const SkPaint& paint, Proc proc) {
+ if (looper) {
+ SkSTArenaAlloc<256> alloc;
+ SkDrawLooper::Context* ctx = looper->makeContext(&alloc);
+ if (ctx) {
+ SkDrawLooper::Context::Info info;
+ for (;;) {
+ SkPaint p = paint;
+ if (!ctx->next(&info, &p)) {
+ break;
+ }
+ proc(info.fTranslate.fX, info.fTranslate.fY, p);
+ }
+ }
+ } else {
+ proc(0, 0, paint);
+ }
+}
+
+void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float left, float top, const Paint* paint) {
sk_sp<SkImage> image = bitmap.makeImage();
- mRecorder.drawImage(image, left, top, filterBitmap(paint), bitmap.palette());
+
+ applyLooper(get_looper(paint), *filterBitmap(paint), [&](SkScalar x, SkScalar y, const SkPaint& p) {
+ mRecorder.drawImage(image, left + x, top + y, &p, bitmap.palette());
+ });
+
// if image->unique() is true, then mRecorder.drawImage failed for some reason. It also means
// it is not safe to store a raw SkImage pointer, because the image object will be destroyed
// when this function ends.
@@ -196,12 +236,16 @@ void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float left, float top, cons
}
}
-void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint) {
+void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const Paint* paint) {
SkAutoCanvasRestore acr(&mRecorder, true);
concat(matrix);
sk_sp<SkImage> image = bitmap.makeImage();
- mRecorder.drawImage(image, 0, 0, filterBitmap(paint), bitmap.palette());
+
+ applyLooper(get_looper(paint), *filterBitmap(paint), [&](SkScalar x, SkScalar y, const SkPaint& p) {
+ mRecorder.drawImage(image, x, y, &p, bitmap.palette());
+ });
+
if (!bitmap.isImmutable() && image.get() && !image->unique()) {
mDisplayList->mMutableImages.push_back(image.get());
}
@@ -209,13 +253,17 @@ void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, con
void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float srcLeft, float srcTop, float srcRight,
float srcBottom, float dstLeft, float dstTop, float dstRight,
- float dstBottom, const SkPaint* paint) {
+ float dstBottom, const Paint* paint) {
SkRect srcRect = SkRect::MakeLTRB(srcLeft, srcTop, srcRight, srcBottom);
SkRect dstRect = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom);
sk_sp<SkImage> image = bitmap.makeImage();
- mRecorder.drawImageRect(image, srcRect, dstRect, filterBitmap(paint),
- SkCanvas::kFast_SrcRectConstraint, bitmap.palette());
+
+ applyLooper(get_looper(paint), *filterBitmap(paint), [&](SkScalar x, SkScalar y, const SkPaint& p) {
+ mRecorder.drawImageRect(image, srcRect, dstRect.makeOffset(x, y), &p,
+ SkCanvas::kFast_SrcRectConstraint, bitmap.palette());
+ });
+
if (!bitmap.isImmutable() && image.get() && !image->unique() && !srcRect.isEmpty() &&
!dstRect.isEmpty()) {
mDisplayList->mMutableImages.push_back(image.get());
@@ -224,7 +272,7 @@ void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float srcLeft, float srcTop
void SkiaRecordingCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& chunk, float dstLeft,
float dstTop, float dstRight, float dstBottom,
- const SkPaint* paint) {
+ const Paint* paint) {
SkCanvas::Lattice lattice;
NinePatchUtils::SetLatticeDivs(&lattice, chunk, bitmap.width(), bitmap.height());
@@ -252,8 +300,11 @@ void SkiaRecordingCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& ch
filteredPaint.writeable().setFilterQuality(kLow_SkFilterQuality);
}
sk_sp<SkImage> image = bitmap.makeImage();
- mRecorder.drawImageLattice(image, lattice, dst, filterBitmap(std::move(filteredPaint)),
- bitmap.palette());
+
+ applyLooper(get_looper(paint), *filterBitmap(paint), [&](SkScalar x, SkScalar y, const SkPaint& p) {
+ mRecorder.drawImageLattice(image, lattice, dst.makeOffset(x, y), &p, bitmap.palette());
+ });
+
if (!bitmap.isImmutable() && image.get() && !image->unique() && !dst.isEmpty()) {
mDisplayList->mMutableImages.push_back(image.get());
}
diff --git a/libs/hwui/pipeline/skia/SkiaRecordingCanvas.h b/libs/hwui/pipeline/skia/SkiaRecordingCanvas.h
index c42cea33211e..bd5274c94e75 100644
--- a/libs/hwui/pipeline/skia/SkiaRecordingCanvas.h
+++ b/libs/hwui/pipeline/skia/SkiaRecordingCanvas.h
@@ -45,14 +45,14 @@ public:
virtual uirenderer::DisplayList* finishRecording() override;
- virtual void drawBitmap(Bitmap& bitmap, float left, float top, const SkPaint* paint) override;
- virtual void drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint) override;
+ virtual void drawBitmap(Bitmap& bitmap, float left, float top, const Paint* paint) override;
+ virtual void drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const Paint* paint) override;
virtual void drawBitmap(Bitmap& bitmap, float srcLeft, float srcTop, float srcRight,
float srcBottom, float dstLeft, float dstTop, float dstRight,
- float dstBottom, const SkPaint* paint) override;
+ float dstBottom, const Paint* paint) override;
virtual void drawNinePatch(Bitmap& hwuiBitmap, const android::Res_png_9patch& chunk,
float dstLeft, float dstTop, float dstRight, float dstBottom,
- const SkPaint* paint) override;
+ const Paint* paint) override;
virtual double drawAnimatedImage(AnimatedImageDrawable* animatedImage) override;
virtual void drawRoundRect(uirenderer::CanvasPropertyPrimitive* left,
diff --git a/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp b/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
index e8cb219db320..ad7c70614239 100644
--- a/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
@@ -19,6 +19,7 @@
#include "DeferredLayerUpdater.h"
#include "Readback.h"
#include "ShaderCache.h"
+#include "LightingInfo.h"
#include "SkiaPipeline.h"
#include "SkiaProfileRenderer.h"
#include "VkInteropFunctorDrawable.h"
@@ -69,7 +70,7 @@ bool SkiaVulkanPipeline::draw(const Frame& frame, const SkRect& screenDirty, con
if (backBuffer.get() == nullptr) {
return false;
}
- SkiaPipeline::updateLighting(lightGeometry, lightInfo);
+ LightingInfo::updateLighting(lightGeometry, lightInfo);
renderFrame(*layerUpdateQueue, dirty, renderNodes, opaque, contentDrawBounds, backBuffer,
mVkSurface->getCurrentPreTransform());
ShaderCache::get().onVkFrameFlushed(mRenderThread.getGrContext());
diff --git a/libs/hwui/protos/graphicsstats.proto b/libs/hwui/protos/graphicsstats.proto
index 1226d44ceb85..0cd5c6228504 100644
--- a/libs/hwui/protos/graphicsstats.proto
+++ b/libs/hwui/protos/graphicsstats.proto
@@ -46,6 +46,9 @@ message GraphicsStatsProto {
// The frame time histogram for the package
repeated GraphicsStatsHistogramBucketProto histogram = 6;
+
+ // The gpu frame time histogram for the package
+ repeated GraphicsStatsHistogramBucketProto gpu_histogram = 7;
}
message GraphicsStatsJankSummaryProto {
diff --git a/libs/hwui/renderthread/CacheManager.cpp b/libs/hwui/renderthread/CacheManager.cpp
index 1b638c12ac7b..8eb81533fda8 100644
--- a/libs/hwui/renderthread/CacheManager.cpp
+++ b/libs/hwui/renderthread/CacheManager.cpp
@@ -28,7 +28,6 @@
#include <SkExecutor.h>
#include <SkGraphics.h>
#include <SkMathPriv.h>
-#include <gui/Surface.h>
#include <math.h>
#include <set>
@@ -40,7 +39,7 @@ namespace renderthread {
// to the screen resolution. This is meant to be a conservative default based on
// that analysis. The 4.0f is used because the default pixel format is assumed to
// be ARGB_8888.
-#define SURFACE_SIZE_MULTIPLIER (12.0f * 4.0f)
+#define SURFACE_SIZE_MULTIPLIER (5.0f * 4.0f)
#define BACKGROUND_RETENTION_PERCENTAGE (0.5f)
CacheManager::CacheManager(const DisplayInfo& display)
@@ -70,8 +69,7 @@ void CacheManager::reset(sk_sp<GrContext> context) {
if (context) {
mGrContext = std::move(context);
- mGrContext->getResourceCacheLimits(&mMaxResources, nullptr);
- mGrContext->setResourceCacheLimits(mMaxResources, mMaxResourceBytes);
+ mGrContext->setResourceCacheLimit(mMaxResourceBytes);
}
}
@@ -120,8 +118,8 @@ void CacheManager::trimMemory(TrimMemoryMode mode) {
// limits between the background and max amounts. This causes the unlocked resources
// that have persistent data to be purged in LRU order.
mGrContext->purgeUnlockedResources(true);
- mGrContext->setResourceCacheLimits(mMaxResources, mBackgroundResourceBytes);
- mGrContext->setResourceCacheLimits(mMaxResources, mMaxResourceBytes);
+ mGrContext->setResourceCacheLimit(mBackgroundResourceBytes);
+ mGrContext->setResourceCacheLimit(mMaxResourceBytes);
SkGraphics::SetFontCacheLimit(mBackgroundCpuFontCacheBytes);
SkGraphics::SetFontCacheLimit(mMaxCpuFontCacheBytes);
break;
diff --git a/libs/hwui/renderthread/CacheManager.h b/libs/hwui/renderthread/CacheManager.h
index 9a5a00fcf762..d7977cc4566d 100644
--- a/libs/hwui/renderthread/CacheManager.h
+++ b/libs/hwui/renderthread/CacheManager.h
@@ -17,7 +17,9 @@
#ifndef CACHEMANAGER_H
#define CACHEMANAGER_H
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
#include <GrContext.h>
+#endif
#include <SkSurface.h>
#include <ui/DisplayInfo.h>
#include <utils/String8.h>
@@ -42,7 +44,9 @@ class CacheManager {
public:
enum class TrimMemoryMode { Complete, UiHidden };
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
void configureContext(GrContextOptions* context, const void* identity, ssize_t size);
+#endif
void trimMemory(TrimMemoryMode mode);
void trimStaleResources();
void dumpMemoryUsage(String8& log, const RenderState* renderState = nullptr);
@@ -57,13 +61,16 @@ private:
explicit CacheManager(const DisplayInfo& display);
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
void reset(sk_sp<GrContext> grContext);
+#endif
void destroy();
const size_t mMaxSurfaceArea;
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
sk_sp<GrContext> mGrContext;
+#endif
- int mMaxResources = 0;
const size_t mMaxResourceBytes;
const size_t mBackgroundResourceBytes;
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 9898a1c30856..30cc007d454b 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -15,11 +15,20 @@
*/
#include "CanvasContext.h"
+
#include <GpuMemoryTracker.h>
+#include <apex/window.h>
+#include <fcntl.h>
+#include <strings.h>
+#include <sys/stat.h>
+
+#include <algorithm>
+#include <cstdint>
+#include <cstdlib>
+#include <functional>
#include "../Properties.h"
#include "AnimationContext.h"
-#include "EglManager.h"
#include "Frame.h"
#include "LayerUpdateQueue.h"
#include "Properties.h"
@@ -33,18 +42,6 @@
#include "utils/TimeUtils.h"
#include "utils/TraceUtils.h"
-#include <cutils/properties.h>
-#include <private/hwui/DrawGlInfo.h>
-#include <strings.h>
-
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <algorithm>
-
-#include <cstdint>
-#include <cstdlib>
-#include <functional>
-
#define TRIM_MEMORY_COMPLETE 80
#define TRIM_MEMORY_UI_HIDDEN 20
@@ -149,7 +146,8 @@ void CanvasContext::setSurface(sp<Surface>&& surface) {
if (surface) {
mNativeSurface = new ReliableSurface{std::move(surface)};
// TODO: Fix error handling & re-shorten timeout
- mNativeSurface->setDequeueTimeout(4000_ms);
+ ANativeWindow_setDequeueTimeout(mNativeSurface.get(), 4000_ms);
+ mNativeSurface->enableFrameTimestamps(true);
} else {
mNativeSurface = nullptr;
}
@@ -297,6 +295,7 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo, int64_t sy
// just keep using the previous frame's structure instead
if (!wasSkipped(mCurrentFrameInfo)) {
mCurrentFrameInfo = mJankTracker.startFrame();
+ mLast4FrameInfos.next().first = mCurrentFrameInfo;
}
mCurrentFrameInfo->importUiThreadInfo(uiFrameInfo);
mCurrentFrameInfo->set(FrameInfoIndex::SyncQueued) = syncQueued;
@@ -448,48 +447,66 @@ void CanvasContext::draw() {
mContentDrawBounds, mOpaque, mLightInfo, mRenderNodes,
&(profiler()));
- int64_t frameCompleteNr = mFrameCompleteCallbacks.size() ? getFrameNumber() : -1;
+ int64_t frameCompleteNr = getFrameNumber();
waitOnFences();
bool requireSwap = false;
+ int error = OK;
bool didSwap =
mRenderPipeline->swapBuffers(frame, drew, windowDirty, mCurrentFrameInfo, &requireSwap);
mIsDirty = false;
if (requireSwap) {
- if (!didSwap) { // some error happened
+ bool didDraw = true;
+ // Handle any swapchain errors
+ error = mNativeSurface->getAndClearError();
+ if (error == TIMED_OUT) {
+ // Try again
+ mRenderThread.postFrameCallback(this);
+ // But since this frame didn't happen, we need to mark full damage in the swap
+ // history
+ didDraw = false;
+
+ } else if (error != OK || !didSwap) {
+ // Unknown error, abandon the surface
setSurface(nullptr);
+ didDraw = false;
}
+
SwapHistory& swap = mSwapHistory.next();
- swap.damage = windowDirty;
- swap.swapCompletedTime = systemTime(CLOCK_MONOTONIC);
+ if (didDraw) {
+ swap.damage = windowDirty;
+ } else {
+ swap.damage = SkRect::MakeWH(INT_MAX, INT_MAX);
+ }
+ swap.swapCompletedTime = systemTime(SYSTEM_TIME_MONOTONIC);
swap.vsyncTime = mRenderThread.timeLord().latestVsync();
- if (mNativeSurface.get()) {
- int durationUs;
- nsecs_t dequeueStart = mNativeSurface->getLastDequeueStartTime();
+ if (didDraw) {
+ nsecs_t dequeueStart = ANativeWindow_getLastDequeueStartTime(mNativeSurface.get());
if (dequeueStart < mCurrentFrameInfo->get(FrameInfoIndex::SyncStart)) {
// Ignoring dequeue duration as it happened prior to frame render start
// and thus is not part of the frame.
swap.dequeueDuration = 0;
} else {
- mNativeSurface->query(NATIVE_WINDOW_LAST_DEQUEUE_DURATION, &durationUs);
- swap.dequeueDuration = us2ns(durationUs);
+ swap.dequeueDuration =
+ ANativeWindow_getLastDequeueDuration(mNativeSurface.get());
}
- mNativeSurface->query(NATIVE_WINDOW_LAST_QUEUE_DURATION, &durationUs);
- swap.queueDuration = us2ns(durationUs);
+ swap.queueDuration = ANativeWindow_getLastQueueDuration(mNativeSurface.get());
} else {
swap.dequeueDuration = 0;
swap.queueDuration = 0;
}
mCurrentFrameInfo->set(FrameInfoIndex::DequeueBufferDuration) = swap.dequeueDuration;
mCurrentFrameInfo->set(FrameInfoIndex::QueueBufferDuration) = swap.queueDuration;
+ mLast4FrameInfos[-1].second = frameCompleteNr;
mHaveNewSurface = false;
mFrameNumber = -1;
} else {
mCurrentFrameInfo->set(FrameInfoIndex::DequeueBufferDuration) = 0;
mCurrentFrameInfo->set(FrameInfoIndex::QueueBufferDuration) = 0;
+ mLast4FrameInfos[-1].second = -1;
}
// TODO: Use a fence for real completion?
@@ -522,6 +539,19 @@ void CanvasContext::draw() {
mFrameMetricsReporter->reportFrameMetrics(mCurrentFrameInfo->data());
}
+ if (mLast4FrameInfos.size() == mLast4FrameInfos.capacity()) {
+ // By looking 4 frames back, we guarantee all SF stats are available. There are at
+ // most 3 buffers in BufferQueue. Surface object keeps stats for the last 8 frames.
+ FrameInfo* forthBehind = mLast4FrameInfos.front().first;
+ int64_t composedFrameId = mLast4FrameInfos.front().second;
+ nsecs_t acquireTime = -1;
+ mNativeSurface->getFrameTimestamps(composedFrameId, nullptr, &acquireTime, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr, nullptr);
+ // Ignore default -1, NATIVE_WINDOW_TIMESTAMP_INVALID and NATIVE_WINDOW_TIMESTAMP_PENDING
+ forthBehind->set(FrameInfoIndex::GpuCompleted) = acquireTime > 0 ? acquireTime : -1;
+ mJankTracker.finishGpuDraw(*forthBehind);
+ }
+
GpuMemoryTracker::onFrameCompleted();
}
@@ -550,7 +580,7 @@ void CanvasContext::prepareAndDraw(RenderNode* node) {
UiFrameInfoBuilder(frameInfo).addFlag(FrameInfoFlags::RTAnimation).setVsync(vsync, vsync);
TreeInfo info(TreeInfo::MODE_RT_ONLY, *this);
- prepareTree(info, frameInfo, systemTime(CLOCK_MONOTONIC), node);
+ prepareTree(info, frameInfo, systemTime(SYSTEM_TIME_MONOTONIC), node);
if (info.out.canDrawThisFrame) {
draw();
} else {
@@ -694,7 +724,7 @@ SkRect CanvasContext::computeDirtyRect(const Frame& frame, SkRect* dirty) {
// New surface needs a full draw
dirty->setEmpty();
} else {
- if (!dirty->isEmpty() && !dirty->intersect(0, 0, frame.width(), frame.height())) {
+ if (!dirty->isEmpty() && !dirty->intersect(SkRect::MakeIWH(frame.width(), frame.height()))) {
ALOGW("Dirty " RECT_STRING " doesn't intersect with 0 0 %d %d ?", SK_RECT_ARGS(*dirty),
frame.width(), frame.height());
dirty->setEmpty();
@@ -703,7 +733,7 @@ SkRect CanvasContext::computeDirtyRect(const Frame& frame, SkRect* dirty) {
}
if (dirty->isEmpty()) {
- dirty->set(0, 0, frame.width(), frame.height());
+ dirty->setIWH(frame.width(), frame.height());
}
// At this point dirty is the area of the window to update. However,
@@ -719,7 +749,7 @@ SkRect CanvasContext::computeDirtyRect(const Frame& frame, SkRect* dirty) {
if (frame.bufferAge() > (int)mSwapHistory.size()) {
// We don't have enough history to handle this old of a buffer
// Just do a full-draw
- dirty->set(0, 0, frame.width(), frame.height());
+ dirty->setIWH(frame.width(), frame.height());
} else {
// At this point we haven't yet added the latest frame
// to the damage history (happens below)
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index 982c087b031a..8a76d6b3fc7a 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -22,14 +22,15 @@
#include "FrameMetricsReporter.h"
#include "IContextFactory.h"
#include "IRenderPipeline.h"
+#include "JankTracker.h"
#include "LayerUpdateQueue.h"
#include "Lighting.h"
#include "ReliableSurface.h"
#include "RenderNode.h"
#include "renderthread/RenderTask.h"
#include "renderthread/RenderThread.h"
+#include "utils/RingBuffer.h"
-#include <EGL/egl.h>
#include <SkBitmap.h>
#include <SkRect.h>
#include <SkSize.h>
@@ -41,6 +42,7 @@
#include <future>
#include <set>
#include <string>
+#include <utility>
#include <vector>
namespace android {
@@ -55,7 +57,6 @@ class RenderState;
namespace renderthread {
-class EglManager;
class Frame;
// This per-renderer class manages the bridge between the global EGL context
@@ -152,8 +153,6 @@ public:
void setContentDrawBounds(const Rect& bounds) { mContentDrawBounds = bounds; }
- RenderState& getRenderState() { return mRenderThread.renderState(); }
-
void addFrameMetricsObserver(FrameMetricsObserver* observer) {
if (mFrameMetricsReporter.get() == nullptr) {
mFrameMetricsReporter.reset(new FrameMetricsReporter());
@@ -216,8 +215,9 @@ private:
SkRect computeDirtyRect(const Frame& frame, SkRect* dirty);
- EGLint mLastFrameWidth = 0;
- EGLint mLastFrameHeight = 0;
+ // The same type as Frame.mWidth and Frame.mHeight
+ int32_t mLastFrameWidth = 0;
+ int32_t mLastFrameHeight = 0;
RenderThread& mRenderThread;
sp<ReliableSurface> mNativeSurface;
@@ -262,6 +262,7 @@ private:
std::vector<sp<RenderNode>> mRenderNodes;
FrameInfo* mCurrentFrameInfo = nullptr;
+ RingBuffer<std::pair<FrameInfo*, int64_t>, 4> mLast4FrameInfos;
std::string mName;
JankTracker mJankTracker;
FrameInfoVisualizer mProfiler;
diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp
index 91dc3bc6e603..1e593388d063 100644
--- a/libs/hwui/renderthread/DrawFrameTask.cpp
+++ b/libs/hwui/renderthread/DrawFrameTask.cpp
@@ -69,7 +69,7 @@ int DrawFrameTask::drawFrame() {
LOG_ALWAYS_FATAL_IF(!mContext, "Cannot drawFrame with no CanvasContext!");
mSyncResult = SyncResult::OK;
- mSyncQueued = systemTime(CLOCK_MONOTONIC);
+ mSyncQueued = systemTime(SYSTEM_TIME_MONOTONIC);
postAndWait();
return mSyncResult;
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp
index 159cf497384a..12021641518c 100644
--- a/libs/hwui/renderthread/EglManager.cpp
+++ b/libs/hwui/renderthread/EglManager.cpp
@@ -29,7 +29,6 @@
#include <EGL/eglext.h>
#include <GLES/gl.h>
-#include <gui/Surface.h>
#include <system/window.h>
#include <string>
#include <vector>
@@ -289,6 +288,10 @@ void EglManager::createPBufferSurface() {
if (mPBufferSurface == EGL_NO_SURFACE && !EglExtensions.surfacelessContext) {
EGLint attribs[] = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE};
mPBufferSurface = eglCreatePbufferSurface(mEglDisplay, mEglConfig, attribs);
+ LOG_ALWAYS_FATAL_IF(mPBufferSurface == EGL_NO_SURFACE,
+ "Failed to create a pixel buffer display=%p, "
+ "mEglConfig=%p, error=%s",
+ mEglDisplay, mEglConfig, eglErrorString());
}
}
diff --git a/libs/hwui/renderthread/ReliableSurface.cpp b/libs/hwui/renderthread/ReliableSurface.cpp
index ad1fc4921781..864780fb6ae8 100644
--- a/libs/hwui/renderthread/ReliableSurface.cpp
+++ b/libs/hwui/renderthread/ReliableSurface.cpp
@@ -87,21 +87,21 @@ void ReliableSurface::perform(int operation, va_list args) {
}
int ReliableSurface::reserveNext() {
+ if constexpr (DISABLE_BUFFER_PREFETCH) {
+ return OK;
+ }
{
std::lock_guard _lock{mMutex};
if (mReservedBuffer) {
ALOGW("reserveNext called but there was already a buffer reserved?");
return OK;
}
- if (mInErrorState) {
+ if (mBufferQueueState != OK) {
return UNKNOWN_ERROR;
}
if (mHasDequeuedBuffer) {
return OK;
}
- if constexpr (DISABLE_BUFFER_PREFETCH) {
- return OK;
- }
}
// TODO: Update this to better handle when requested dimensions have changed
@@ -165,10 +165,11 @@ int ReliableSurface::dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd) {
}
}
+
int result = callProtected(mSurface, dequeueBuffer, buffer, fenceFd);
if (result != OK) {
ALOGW("dequeueBuffer failed, error = %d; switching to fallback", result);
- *buffer = acquireFallbackBuffer();
+ *buffer = acquireFallbackBuffer(result);
*fenceFd = -1;
return *buffer ? OK : INVALID_OPERATION;
} else {
@@ -201,9 +202,9 @@ bool ReliableSurface::isFallbackBuffer(const ANativeWindowBuffer* windowBuffer)
return windowBuffer == scratchBuffer;
}
-ANativeWindowBuffer* ReliableSurface::acquireFallbackBuffer() {
+ANativeWindowBuffer* ReliableSurface::acquireFallbackBuffer(int error) {
std::lock_guard _lock{mMutex};
- mInErrorState = true;
+ mBufferQueueState = error;
if (mScratchBuffer) {
return AHardwareBuffer_to_ANativeWindowBuffer(mScratchBuffer.get());
@@ -307,4 +308,4 @@ int ReliableSurface::hook_perform(ANativeWindow* window, int operation, ...) {
return result;
}
-}; // namespace android::uirenderer::renderthread \ No newline at end of file
+}; // namespace android::uirenderer::renderthread
diff --git a/libs/hwui/renderthread/ReliableSurface.h b/libs/hwui/renderthread/ReliableSurface.h
index 0bfc72ef61cb..f768df37ba7d 100644
--- a/libs/hwui/renderthread/ReliableSurface.h
+++ b/libs/hwui/renderthread/ReliableSurface.h
@@ -31,18 +31,35 @@ public:
ReliableSurface(sp<Surface>&& surface);
~ReliableSurface();
- void setDequeueTimeout(nsecs_t timeout) { mSurface->setDequeueTimeout(timeout); }
-
int reserveNext();
void allocateBuffers() { mSurface->allocateBuffers(); }
int query(int what, int* value) const { return mSurface->query(what, value); }
- nsecs_t getLastDequeueStartTime() const { return mSurface->getLastDequeueStartTime(); }
-
uint64_t getNextFrameNumber() const { return mSurface->getNextFrameNumber(); }
+ int getAndClearError() {
+ int ret = mBufferQueueState;
+ mBufferQueueState = OK;
+ return ret;
+ }
+
+ status_t getFrameTimestamps(uint64_t frameNumber,
+ nsecs_t* outRequestedPresentTime, nsecs_t* outAcquireTime,
+ nsecs_t* outLatchTime, nsecs_t* outFirstRefreshStartTime,
+ nsecs_t* outLastRefreshStartTime, nsecs_t* outGlCompositionDoneTime,
+ nsecs_t* outDisplayPresentTime, nsecs_t* outDequeueReadyTime,
+ nsecs_t* outReleaseTime) {
+ return mSurface->getFrameTimestamps(frameNumber, outRequestedPresentTime, outAcquireTime,
+ outLatchTime, outFirstRefreshStartTime, outLastRefreshStartTime,
+ outGlCompositionDoneTime, outDisplayPresentTime, outDequeueReadyTime, outReleaseTime);
+ }
+
+ void enableFrameTimestamps(bool enable) {
+ return mSurface->enableFrameTimestamps(enable);
+ }
+
private:
const sp<Surface> mSurface;
@@ -55,10 +72,10 @@ private:
ANativeWindowBuffer* mReservedBuffer = nullptr;
base::unique_fd mReservedFenceFd;
bool mHasDequeuedBuffer = false;
- bool mInErrorState = false;
+ int mBufferQueueState = OK;
bool isFallbackBuffer(const ANativeWindowBuffer* windowBuffer) const;
- ANativeWindowBuffer* acquireFallbackBuffer();
+ ANativeWindowBuffer* acquireFallbackBuffer(int error);
void clearReservedBuffer();
void perform(int operation, va_list args);
@@ -84,4 +101,4 @@ private:
static int hook_queueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer* buffer);
};
-}; // namespace android::uirenderer::renderthread \ No newline at end of file
+}; // namespace android::uirenderer::renderthread
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 1a1b9dac37f6..40fbdffaf90a 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -16,25 +16,22 @@
#include "RenderProxy.h"
+#include <gui/Surface.h>
+
#include "DeferredLayerUpdater.h"
#include "DisplayList.h"
#include "Properties.h"
#include "Readback.h"
#include "Rect.h"
#include "WebViewFunctorManager.h"
-#include "pipeline/skia/SkiaOpenGLPipeline.h"
#include "pipeline/skia/VectorDrawableAtlas.h"
-#include "renderstate/RenderState.h"
#include "renderthread/CanvasContext.h"
-#include "renderthread/EglManager.h"
#include "renderthread/RenderTask.h"
#include "renderthread/RenderThread.h"
#include "utils/Macros.h"
#include "utils/TimeUtils.h"
#include "utils/TraceUtils.h"
-#include <ui/GraphicBuffer.h>
-
namespace android {
namespace uirenderer {
namespace renderthread {
@@ -339,7 +336,7 @@ void RenderProxy::prepareToDraw(Bitmap& bitmap) {
};
nsecs_t lastVsync = renderThread->timeLord().latestVsync();
nsecs_t estimatedNextVsync = lastVsync + renderThread->timeLord().frameIntervalNanos();
- nsecs_t timeToNextVsync = estimatedNextVsync - systemTime(CLOCK_MONOTONIC);
+ nsecs_t timeToNextVsync = estimatedNextVsync - systemTime(SYSTEM_TIME_MONOTONIC);
// We expect the UI thread to take 4ms and for RT to be active from VSYNC+4ms to
// VSYNC+12ms or so, so aim for the gap during which RT is expected to
// be idle
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index a0f08cbd26f9..c3eb6ede9bf2 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -19,7 +19,6 @@
#include <SkBitmap.h>
#include <cutils/compiler.h>
-#include <gui/Surface.h>
#include <utils/Functor.h>
#include "../FrameMetricsObserver.h"
@@ -30,6 +29,7 @@
namespace android {
class GraphicBuffer;
+class Surface;
namespace uirenderer {
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 71c5b53f727a..ee1a7ce19e82 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -31,10 +31,6 @@
#include "utils/TimeUtils.h"
#include "utils/TraceUtils.h"
-#ifdef HWUI_GLES_WRAP_ENABLED
-#include "debug/GlesDriver.h"
-#endif
-
#include <GrContextOptions.h>
#include <gl/GrGLInterface.h>
@@ -107,7 +103,7 @@ public:
[this]() { mRenderThread->drainDisplayEventQueue(); });
}
- virtual nsecs_t latestVsyncEvent() override { return systemTime(CLOCK_MONOTONIC); }
+ virtual nsecs_t latestVsyncEvent() override { return systemTime(SYSTEM_TIME_MONOTONIC); }
private:
RenderThread* mRenderThread;
@@ -199,12 +195,7 @@ void RenderThread::requireGlContext() {
}
mEglManager->initialize();
-#ifdef HWUI_GLES_WRAP_ENABLED
- debug::GlesDriver* driver = debug::GlesDriver::get();
- sk_sp<const GrGLInterface> glInterface(driver->getSkiaInterface());
-#else
sk_sp<const GrGLInterface> glInterface(GrGLCreateNativeInterface());
-#endif
LOG_ALWAYS_FATAL_IF(!glInterface.get());
GrContextOptions options;
diff --git a/libs/hwui/renderthread/RenderThread.h b/libs/hwui/renderthread/RenderThread.h
index c96e284df6b4..5aa1af32094f 100644
--- a/libs/hwui/renderthread/RenderThread.h
+++ b/libs/hwui/renderthread/RenderThread.h
@@ -19,8 +19,8 @@
#include "RenderTask.h"
-#include "../JankTracker.h"
#include "CacheManager.h"
+#include "ProfileDataContainer.h"
#include "TimeLord.h"
#include "WebViewFunctorManager.h"
#include "thread/ThreadBase.h"
@@ -53,6 +53,10 @@ namespace skiapipeline {
class VkFunctorDrawHandler;
}
+namespace VectorDrawable {
+class Tree;
+}
+
namespace renderthread {
class CanvasContext;
@@ -138,6 +142,7 @@ private:
friend class android::uirenderer::TestUtils;
friend class android::uirenderer::WebViewFunctor;
friend class android::uirenderer::skiapipeline::VkFunctorDrawHandler;
+ friend class android::uirenderer::VectorDrawable::Tree;
RenderThread();
virtual ~RenderThread();
diff --git a/libs/hwui/renderthread/TimeLord.cpp b/libs/hwui/renderthread/TimeLord.cpp
index b82c5d159756..784068f1d877 100644
--- a/libs/hwui/renderthread/TimeLord.cpp
+++ b/libs/hwui/renderthread/TimeLord.cpp
@@ -31,7 +31,7 @@ bool TimeLord::vsyncReceived(nsecs_t vsync) {
nsecs_t TimeLord::computeFrameTimeNanos() {
// Logic copied from Choreographer.java
- nsecs_t now = systemTime(CLOCK_MONOTONIC);
+ nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
nsecs_t jitterNanos = now - mFrameTimeNanos;
if (jitterNanos >= mFrameIntervalNanos) {
nsecs_t lastFrameOffset = jitterNanos % mFrameIntervalNanos;
diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp
index 5173f638068d..35abc57fbe57 100644
--- a/libs/hwui/renderthread/VulkanManager.cpp
+++ b/libs/hwui/renderthread/VulkanManager.cpp
@@ -17,7 +17,8 @@
#include "VulkanManager.h"
#include <android/sync.h>
-#include <gui/Surface.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
#include "Properties.h"
#include "RenderThread.h"
@@ -137,20 +138,14 @@ void VulkanManager::setupDevice(GrVkExtensions& grExtensions, VkPhysicalDeviceFe
err = mCreateInstance(&instance_create, nullptr, &mInstance);
LOG_ALWAYS_FATAL_IF(err < 0);
+ GET_INST_PROC(CreateDevice);
GET_INST_PROC(DestroyInstance);
+ GET_INST_PROC(EnumerateDeviceExtensionProperties);
GET_INST_PROC(EnumeratePhysicalDevices);
- GET_INST_PROC(GetPhysicalDeviceProperties);
- GET_INST_PROC(GetPhysicalDeviceQueueFamilyProperties);
GET_INST_PROC(GetPhysicalDeviceFeatures2);
GET_INST_PROC(GetPhysicalDeviceImageFormatProperties2);
- GET_INST_PROC(CreateDevice);
- GET_INST_PROC(EnumerateDeviceExtensionProperties);
- GET_INST_PROC(CreateAndroidSurfaceKHR);
- GET_INST_PROC(DestroySurfaceKHR);
- GET_INST_PROC(GetPhysicalDeviceSurfaceSupportKHR);
- GET_INST_PROC(GetPhysicalDeviceSurfaceCapabilitiesKHR);
- GET_INST_PROC(GetPhysicalDeviceSurfaceFormatsKHR);
- GET_INST_PROC(GetPhysicalDeviceSurfacePresentModesKHR);
+ GET_INST_PROC(GetPhysicalDeviceProperties);
+ GET_INST_PROC(GetPhysicalDeviceQueueFamilyProperties);
uint32_t gpuCount;
LOG_ALWAYS_FATAL_IF(mEnumeratePhysicalDevices(mInstance, &gpuCount, nullptr));
@@ -317,29 +312,27 @@ void VulkanManager::setupDevice(GrVkExtensions& grExtensions, VkPhysicalDeviceFe
LOG_ALWAYS_FATAL_IF(mCreateDevice(mPhysicalDevice, &deviceInfo, nullptr, &mDevice));
- GET_DEV_PROC(GetDeviceQueue);
- GET_DEV_PROC(DeviceWaitIdle);
- GET_DEV_PROC(DestroyDevice);
- GET_DEV_PROC(CreateCommandPool);
- GET_DEV_PROC(DestroyCommandPool);
GET_DEV_PROC(AllocateCommandBuffers);
- GET_DEV_PROC(FreeCommandBuffers);
- GET_DEV_PROC(ResetCommandBuffer);
GET_DEV_PROC(BeginCommandBuffer);
- GET_DEV_PROC(EndCommandBuffer);
GET_DEV_PROC(CmdPipelineBarrier);
- GET_DEV_PROC(GetDeviceQueue);
- GET_DEV_PROC(QueueSubmit);
- GET_DEV_PROC(QueueWaitIdle);
- GET_DEV_PROC(DeviceWaitIdle);
+ GET_DEV_PROC(CreateCommandPool);
+ GET_DEV_PROC(CreateFence);
GET_DEV_PROC(CreateSemaphore);
+ GET_DEV_PROC(DestroyCommandPool);
+ GET_DEV_PROC(DestroyDevice);
+ GET_DEV_PROC(DestroyFence);
GET_DEV_PROC(DestroySemaphore);
- GET_DEV_PROC(ImportSemaphoreFdKHR);
+ GET_DEV_PROC(DeviceWaitIdle);
+ GET_DEV_PROC(EndCommandBuffer);
+ GET_DEV_PROC(FreeCommandBuffers);
+ GET_DEV_PROC(GetDeviceQueue);
GET_DEV_PROC(GetSemaphoreFdKHR);
- GET_DEV_PROC(CreateFence);
- GET_DEV_PROC(DestroyFence);
- GET_DEV_PROC(WaitForFences);
+ GET_DEV_PROC(ImportSemaphoreFdKHR);
+ GET_DEV_PROC(QueueSubmit);
+ GET_DEV_PROC(QueueWaitIdle);
+ GET_DEV_PROC(ResetCommandBuffer);
GET_DEV_PROC(ResetFences);
+ GET_DEV_PROC(WaitForFences);
}
void VulkanManager::initialize() {
@@ -480,6 +473,13 @@ struct DestroySemaphoreInfo {
PFN_vkDestroySemaphore mDestroyFunction;
VkDevice mDevice;
VkSemaphore mSemaphore;
+ // We need to make sure we don't delete the VkSemaphore until it is done being used by both Skia
+ // (including by the GPU) and inside the VulkanManager. So we always start with two refs, one
+ // owned by Skia and one owned by the VulkanManager. The refs are decremented each time
+ // destroy_semaphore is called with this object. Skia will call destroy_semaphore once it is
+ // done with the semaphore and the GPU has finished work on the semaphore. The VulkanManager
+ // calls destroy_semaphore after sending the semaphore to Skia and exporting it if need be.
+ int mRefs = 2;
DestroySemaphoreInfo(PFN_vkDestroySemaphore destroyFunction, VkDevice device,
VkSemaphore semaphore)
@@ -488,8 +488,11 @@ struct DestroySemaphoreInfo {
static void destroy_semaphore(void* context) {
DestroySemaphoreInfo* info = reinterpret_cast<DestroySemaphoreInfo*>(context);
- info->mDestroyFunction(info->mDevice, info->mSemaphore, nullptr);
- delete info;
+ --info->mRefs;
+ if (!info->mRefs) {
+ info->mDestroyFunction(info->mDevice, info->mSemaphore, nullptr);
+ delete info;
+ }
}
void VulkanManager::swapBuffers(VulkanSurface* surface, const SkRect& dirtyRect) {
@@ -540,6 +543,7 @@ void VulkanManager::swapBuffers(VulkanSurface* surface, const SkRect& dirtyRect)
ALOGE("VulkanManager::swapBuffers(): Semaphore submission failed");
mQueueWaitIdle(mGraphicsQueue);
}
+ destroy_semaphore(destroyInfo);
surface->presentCurrentBuffer(dirtyRect, fenceFd);
}
@@ -642,13 +646,16 @@ status_t VulkanManager::createReleaseFence(sp<Fence>& nativeFence, GrContext* gr
DestroySemaphoreInfo* destroyInfo = new DestroySemaphoreInfo(mDestroySemaphore, mDevice,
semaphore);
+ // Even if Skia fails to submit the semaphore, it will still call the destroy_semaphore callback
+ // which will remove its ref to the semaphore. The VulkanManager must still release its ref,
+ // when it is done with the semaphore.
GrSemaphoresSubmitted submitted =
grContext->flush(kNone_GrFlushFlags, 1, &backendSemaphore,
destroy_semaphore, destroyInfo);
if (submitted == GrSemaphoresSubmitted::kNo) {
ALOGE("VulkanManager::createReleaseFence: Failed to submit semaphore");
- mDestroySemaphore(mDevice, semaphore, nullptr);
+ destroy_semaphore(destroyInfo);
return INVALID_OPERATION;
}
@@ -661,6 +668,7 @@ status_t VulkanManager::createReleaseFence(sp<Fence>& nativeFence, GrContext* gr
int fenceFd = 0;
err = mGetSemaphoreFdKHR(mDevice, &getFdInfo, &fenceFd);
+ destroy_semaphore(destroyInfo);
if (VK_SUCCESS != err) {
ALOGE("VulkanManager::createReleaseFence: Failed to get semaphore Fd");
return INVALID_OPERATION;
diff --git a/libs/hwui/renderthread/VulkanManager.h b/libs/hwui/renderthread/VulkanManager.h
index dd3c6d0dba81..4c6a75504cd0 100644
--- a/libs/hwui/renderthread/VulkanManager.h
+++ b/libs/hwui/renderthread/VulkanManager.h
@@ -31,6 +31,7 @@
#include "Frame.h"
#include "IRenderPipeline.h"
#include "VulkanSurface.h"
+#include "private/hwui/DrawVkInfo.h"
class GrVkExtensions;
@@ -107,14 +108,6 @@ private:
FNPTR_TYPE fPtr;
};
- // WSI interface functions
- VkPtr<PFN_vkCreateAndroidSurfaceKHR> mCreateAndroidSurfaceKHR;
- VkPtr<PFN_vkDestroySurfaceKHR> mDestroySurfaceKHR;
- VkPtr<PFN_vkGetPhysicalDeviceSurfaceSupportKHR> mGetPhysicalDeviceSurfaceSupportKHR;
- VkPtr<PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR> mGetPhysicalDeviceSurfaceCapabilitiesKHR;
- VkPtr<PFN_vkGetPhysicalDeviceSurfaceFormatsKHR> mGetPhysicalDeviceSurfaceFormatsKHR;
- VkPtr<PFN_vkGetPhysicalDeviceSurfacePresentModesKHR> mGetPhysicalDeviceSurfacePresentModesKHR;
-
// Instance Functions
VkPtr<PFN_vkEnumerateInstanceVersion> mEnumerateInstanceVersion;
VkPtr<PFN_vkEnumerateInstanceExtensionProperties> mEnumerateInstanceExtensionProperties;
diff --git a/libs/hwui/renderthread/VulkanSurface.cpp b/libs/hwui/renderthread/VulkanSurface.cpp
index b2cc23e76b8a..bbffb359aebe 100644
--- a/libs/hwui/renderthread/VulkanSurface.cpp
+++ b/libs/hwui/renderthread/VulkanSurface.cpp
@@ -27,15 +27,6 @@ namespace android {
namespace uirenderer {
namespace renderthread {
-static bool IsTransformSupported(int transform) {
- // For now, only support pure rotations, not flip or flip-and-rotate, until we have
- // more time to test them and build sample code. As far as I know we never actually
- // use anything besides pure rotations anyway.
- return transform == 0 || transform == NATIVE_WINDOW_TRANSFORM_ROT_90 ||
- transform == NATIVE_WINDOW_TRANSFORM_ROT_180 ||
- transform == NATIVE_WINDOW_TRANSFORM_ROT_270;
-}
-
static int InvertTransform(int transform) {
switch (transform) {
case NATIVE_WINDOW_TRANSFORM_ROT_90:
@@ -49,21 +40,6 @@ static int InvertTransform(int transform) {
}
}
-static int ConvertVkTransformToNative(VkSurfaceTransformFlagsKHR transform) {
- switch (transform) {
- case VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR:
- return NATIVE_WINDOW_TRANSFORM_ROT_270;
- case VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR:
- return NATIVE_WINDOW_TRANSFORM_ROT_180;
- case VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR:
- return NATIVE_WINDOW_TRANSFORM_ROT_90;
- case VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR:
- case VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR:
- default:
- return 0;
- }
-}
-
static SkMatrix GetPreTransformMatrix(SkISize windowSize, int transform) {
const int width = windowSize.width();
const int height = windowSize.height();
@@ -83,180 +59,157 @@ static SkMatrix GetPreTransformMatrix(SkISize windowSize, int transform) {
return SkMatrix::I();
}
-void VulkanSurface::ComputeWindowSizeAndTransform(WindowInfo* windowInfo, const SkISize& minSize,
- const SkISize& maxSize) {
- SkISize& windowSize = windowInfo->size;
-
- // clamp width & height to handle currentExtent of -1 and protect us from broken hints
- if (windowSize.width() < minSize.width() || windowSize.width() > maxSize.width() ||
- windowSize.height() < minSize.height() || windowSize.height() > maxSize.height()) {
- int width = std::min(maxSize.width(), std::max(minSize.width(), windowSize.width()));
- int height = std::min(maxSize.height(), std::max(minSize.height(), windowSize.height()));
- ALOGE("Invalid Window Dimensions [%d, %d]; clamping to [%d, %d]", windowSize.width(),
- windowSize.height(), width, height);
- windowSize.set(width, height);
- }
-
- windowInfo->actualSize = windowSize;
- if (windowInfo->transform & HAL_TRANSFORM_ROT_90) {
- windowInfo->actualSize.set(windowSize.height(), windowSize.width());
- }
-
- windowInfo->preTransform = GetPreTransformMatrix(windowInfo->size, windowInfo->transform);
-}
-
-static bool ResetNativeWindow(ANativeWindow* window) {
- // -- Reset the native window --
- // The native window might have been used previously, and had its properties
- // changed from defaults. That will affect the answer we get for queries
- // like MIN_UNDEQUEUED_BUFFERS. Reset to a known/default state before we
- // attempt such queries.
+static bool ConnectAndSetWindowDefaults(ANativeWindow* window) {
+ ATRACE_CALL();
int err = native_window_api_connect(window, NATIVE_WINDOW_API_EGL);
if (err != 0) {
- ALOGW("native_window_api_connect failed: %s (%d)", strerror(-err), err);
+ ALOGE("native_window_api_connect failed: %s (%d)", strerror(-err), err);
return false;
}
// this will match what we do on GL so pick that here.
err = window->setSwapInterval(window, 1);
if (err != 0) {
- ALOGW("native_window->setSwapInterval(1) failed: %s (%d)", strerror(-err), err);
+ ALOGE("native_window->setSwapInterval(1) failed: %s (%d)", strerror(-err), err);
return false;
}
err = native_window_set_shared_buffer_mode(window, false);
if (err != 0) {
- ALOGW("native_window_set_shared_buffer_mode(false) failed: %s (%d)", strerror(-err), err);
+ ALOGE("native_window_set_shared_buffer_mode(false) failed: %s (%d)", strerror(-err), err);
return false;
}
err = native_window_set_auto_refresh(window, false);
if (err != 0) {
- ALOGW("native_window_set_auto_refresh(false) failed: %s (%d)", strerror(-err), err);
+ ALOGE("native_window_set_auto_refresh(false) failed: %s (%d)", strerror(-err), err);
return false;
}
- return true;
-}
+ err = native_window_set_scaling_mode(window, NATIVE_WINDOW_SCALING_MODE_FREEZE);
+ if (err != 0) {
+ ALOGE("native_window_set_scaling_mode(NATIVE_WINDOW_SCALING_MODE_FREEZE) failed: %s (%d)",
+ strerror(-err), err);
+ return false;
+ }
-class VkSurfaceAutoDeleter {
-public:
- VkSurfaceAutoDeleter(VkInstance instance, VkSurfaceKHR surface,
- PFN_vkDestroySurfaceKHR destroySurfaceKHR)
- : mInstance(instance), mSurface(surface), mDestroySurfaceKHR(destroySurfaceKHR) {}
- ~VkSurfaceAutoDeleter() { destroy(); }
-
- void destroy() {
- if (mSurface != VK_NULL_HANDLE) {
- mDestroySurfaceKHR(mInstance, mSurface, nullptr);
- mSurface = VK_NULL_HANDLE;
- }
+ // Let consumer drive the size of the buffers.
+ err = native_window_set_buffers_dimensions(window, 0, 0);
+ if (err != 0) {
+ ALOGE("native_window_set_buffers_dimensions(0,0) failed: %s (%d)", strerror(-err), err);
+ return false;
}
-private:
- VkInstance mInstance;
- VkSurfaceKHR mSurface;
- PFN_vkDestroySurfaceKHR mDestroySurfaceKHR;
-};
+ // Enable auto prerotation, so when buffer size is driven by the consumer
+ // and the transform hint specifies a 90 or 270 degree rotation, the width
+ // and height used for buffer pre-allocation and dequeueBuffer will be
+ // additionally swapped.
+ err = native_window_set_auto_prerotation(window, true);
+ if (err != 0) {
+ ALOGE("VulkanSurface::UpdateWindow() native_window_set_auto_prerotation failed: %s (%d)",
+ strerror(-err), err);
+ return false;
+ }
+
+ return true;
+}
VulkanSurface* VulkanSurface::Create(ANativeWindow* window, ColorMode colorMode,
SkColorType colorType, sk_sp<SkColorSpace> colorSpace,
GrContext* grContext, const VulkanManager& vkManager,
uint32_t extraBuffers) {
- VkAndroidSurfaceCreateInfoKHR surfaceCreateInfo;
- memset(&surfaceCreateInfo, 0, sizeof(VkAndroidSurfaceCreateInfoKHR));
- surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR;
- surfaceCreateInfo.pNext = nullptr;
- surfaceCreateInfo.flags = 0;
- surfaceCreateInfo.window = window;
-
- VkSurfaceKHR vkSurface = VK_NULL_HANDLE;
- VkResult res = vkManager.mCreateAndroidSurfaceKHR(vkManager.mInstance, &surfaceCreateInfo,
- nullptr, &vkSurface);
- if (VK_SUCCESS != res) {
- ALOGE("VulkanSurface::Create() vkCreateAndroidSurfaceKHR failed (%d)", res);
+ // Connect and set native window to default configurations.
+ if (!ConnectAndSetWindowDefaults(window)) {
return nullptr;
}
- VkSurfaceAutoDeleter vkSurfaceDeleter(vkManager.mInstance, vkSurface,
- vkManager.mDestroySurfaceKHR);
-
- SkDEBUGCODE(VkBool32 supported; res = vkManager.mGetPhysicalDeviceSurfaceSupportKHR(
- vkManager.mPhysicalDevice, vkManager.mPresentQueueIndex,
- vkSurface, &supported);
- // All physical devices and queue families on Android must be capable of
- // presentation with any native window.
- SkASSERT(VK_SUCCESS == res && supported););
+ // Initialize WindowInfo struct.
+ WindowInfo windowInfo;
+ if (!InitializeWindowInfoStruct(window, colorMode, colorType, colorSpace, vkManager,
+ extraBuffers, &windowInfo)) {
+ return nullptr;
+ }
- // check for capabilities
- VkSurfaceCapabilitiesKHR caps;
- res = vkManager.mGetPhysicalDeviceSurfaceCapabilitiesKHR(vkManager.mPhysicalDevice, vkSurface,
- &caps);
- if (VK_SUCCESS != res) {
- ALOGE("VulkanSurface::Create() vkGetPhysicalDeviceSurfaceCapabilitiesKHR failed (%d)", res);
+ // Now we attempt to modify the window.
+ if (!UpdateWindow(window, windowInfo)) {
return nullptr;
}
- LOG_ALWAYS_FATAL_IF(0 == (caps.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR));
+ return new VulkanSurface(window, windowInfo, grContext);
+}
- /*
- * We must destroy the VK Surface before attempting to update the window as doing so after
- * will cause the native window to be modified in unexpected ways.
- */
- vkSurfaceDeleter.destroy();
+bool VulkanSurface::InitializeWindowInfoStruct(ANativeWindow* window, ColorMode colorMode,
+ SkColorType colorType,
+ sk_sp<SkColorSpace> colorSpace,
+ const VulkanManager& vkManager,
+ uint32_t extraBuffers, WindowInfo* outWindowInfo) {
+ ATRACE_CALL();
- /*
- * Populate Window Info struct
- */
- WindowInfo windowInfo;
+ int width, height;
+ int err = window->query(window, NATIVE_WINDOW_DEFAULT_WIDTH, &width);
+ if (err != 0 || width < 0) {
+ ALOGE("window->query failed: %s (%d) value=%d", strerror(-err), err, width);
+ return false;
+ }
+ err = window->query(window, NATIVE_WINDOW_DEFAULT_HEIGHT, &height);
+ if (err != 0 || height < 0) {
+ ALOGE("window->query failed: %s (%d) value=%d", strerror(-err), err, height);
+ return false;
+ }
+ outWindowInfo->size = SkISize::Make(width, height);
+
+ int query_value;
+ err = window->query(window, NATIVE_WINDOW_TRANSFORM_HINT, &query_value);
+ if (err != 0 || query_value < 0) {
+ ALOGE("window->query failed: %s (%d) value=%d", strerror(-err), err, query_value);
+ return false;
+ }
+ outWindowInfo->transform = query_value;
- windowInfo.transform = ConvertVkTransformToNative(caps.supportedTransforms);
- windowInfo.size = SkISize::Make(caps.currentExtent.width, caps.currentExtent.height);
+ outWindowInfo->actualSize = outWindowInfo->size;
+ if (outWindowInfo->transform & NATIVE_WINDOW_TRANSFORM_ROT_90) {
+ outWindowInfo->actualSize.set(outWindowInfo->size.height(), outWindowInfo->size.width());
+ }
- const SkISize minSize = SkISize::Make(caps.minImageExtent.width, caps.minImageExtent.height);
- const SkISize maxSize = SkISize::Make(caps.maxImageExtent.width, caps.maxImageExtent.height);
- ComputeWindowSizeAndTransform(&windowInfo, minSize, maxSize);
+ outWindowInfo->preTransform =
+ GetPreTransformMatrix(outWindowInfo->size, outWindowInfo->transform);
- int query_value;
- int err = window->query(window, NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &query_value);
+ err = window->query(window, NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &query_value);
if (err != 0 || query_value < 0) {
ALOGE("window->query failed: %s (%d) value=%d", strerror(-err), err, query_value);
- return nullptr;
+ return false;
}
- auto min_undequeued_buffers = static_cast<uint32_t>(query_value);
+ outWindowInfo->bufferCount =
+ static_cast<uint32_t>(query_value) + sTargetBufferCount + extraBuffers;
- windowInfo.bufferCount = min_undequeued_buffers +
- std::max(sTargetBufferCount + extraBuffers, caps.minImageCount);
- if (caps.maxImageCount > 0 && windowInfo.bufferCount > caps.maxImageCount) {
+ err = window->query(window, NATIVE_WINDOW_MAX_BUFFER_COUNT, &query_value);
+ if (err != 0 || query_value < 0) {
+ ALOGE("window->query failed: %s (%d) value=%d", strerror(-err), err, query_value);
+ return false;
+ }
+ if (outWindowInfo->bufferCount > static_cast<uint32_t>(query_value)) {
// Application must settle for fewer images than desired:
- windowInfo.bufferCount = caps.maxImageCount;
+ outWindowInfo->bufferCount = static_cast<uint32_t>(query_value);
}
- // Currently Skia requires the images to be color attachments and support all transfer
- // operations.
- VkImageUsageFlags usageFlags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
- VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
- VK_IMAGE_USAGE_TRANSFER_DST_BIT;
- LOG_ALWAYS_FATAL_IF((caps.supportedUsageFlags & usageFlags) != usageFlags);
-
- windowInfo.dataspace = HAL_DATASPACE_V0_SRGB;
+ outWindowInfo->dataspace = HAL_DATASPACE_V0_SRGB;
if (colorMode == ColorMode::WideColorGamut) {
skcms_Matrix3x3 surfaceGamut;
LOG_ALWAYS_FATAL_IF(!colorSpace->toXYZD50(&surfaceGamut),
"Could not get gamut matrix from color space");
if (memcmp(&surfaceGamut, &SkNamedGamut::kSRGB, sizeof(surfaceGamut)) == 0) {
- windowInfo.dataspace = HAL_DATASPACE_V0_SCRGB;
+ outWindowInfo->dataspace = HAL_DATASPACE_V0_SCRGB;
} else if (memcmp(&surfaceGamut, &SkNamedGamut::kDCIP3, sizeof(surfaceGamut)) == 0) {
- windowInfo.dataspace = HAL_DATASPACE_DISPLAY_P3;
+ outWindowInfo->dataspace = HAL_DATASPACE_DISPLAY_P3;
} else {
LOG_ALWAYS_FATAL("Unreachable: unsupported wide color space.");
}
}
- windowInfo.pixelFormat = ColorTypeToPixelFormat(colorType);
+ outWindowInfo->pixelFormat = ColorTypeToPixelFormat(colorType);
VkFormat vkPixelFormat = VK_FORMAT_R8G8B8A8_UNORM;
- if (windowInfo.pixelFormat == PIXEL_FORMAT_RGBA_FP16) {
+ if (outWindowInfo->pixelFormat == PIXEL_FORMAT_RGBA_FP16) {
vkPixelFormat = VK_FORMAT_R16G16B16A16_SFLOAT;
}
@@ -275,7 +228,10 @@ VulkanSurface* VulkanSurface::Create(ANativeWindow* window, ColorMode colorMode,
imageFormatInfo.format = vkPixelFormat;
imageFormatInfo.type = VK_IMAGE_TYPE_2D;
imageFormatInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
- imageFormatInfo.usage = usageFlags;
+ // Currently Skia requires the images to be color attachments and support all transfer
+ // operations.
+ imageFormatInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT |
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
imageFormatInfo.flags = 0;
VkAndroidHardwareBufferUsageANDROID hwbUsage;
@@ -286,35 +242,27 @@ VulkanSurface* VulkanSurface::Create(ANativeWindow* window, ColorMode colorMode,
imgFormProps.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
imgFormProps.pNext = &hwbUsage;
- res = vkManager.mGetPhysicalDeviceImageFormatProperties2(vkManager.mPhysicalDevice,
- &imageFormatInfo, &imgFormProps);
+ VkResult res = vkManager.mGetPhysicalDeviceImageFormatProperties2(
+ vkManager.mPhysicalDevice, &imageFormatInfo, &imgFormProps);
if (VK_SUCCESS != res) {
ALOGE("Failed to query GetPhysicalDeviceImageFormatProperties2");
- return nullptr;
+ return false;
}
uint64_t consumerUsage;
- native_window_get_consumer_usage(window, &consumerUsage);
- windowInfo.windowUsageFlags = consumerUsage | hwbUsage.androidHardwareBufferUsage;
-
- /*
- * Now we attempt to modify the window!
- */
- if (!UpdateWindow(window, windowInfo)) {
- return nullptr;
+ err = native_window_get_consumer_usage(window, &consumerUsage);
+ if (err != 0) {
+ ALOGE("native_window_get_consumer_usage failed: %s (%d)", strerror(-err), err);
+ return false;
}
+ outWindowInfo->windowUsageFlags = consumerUsage | hwbUsage.androidHardwareBufferUsage;
- return new VulkanSurface(window, windowInfo, minSize, maxSize, grContext);
+ return true;
}
bool VulkanSurface::UpdateWindow(ANativeWindow* window, const WindowInfo& windowInfo) {
ATRACE_CALL();
- if (!ResetNativeWindow(window)) {
- return false;
- }
-
- // -- Configure the native window --
int err = native_window_set_buffers_format(window, windowInfo.pixelFormat);
if (err != 0) {
ALOGE("VulkanSurface::UpdateWindow() native_window_set_buffers_format(%d) failed: %s (%d)",
@@ -330,15 +278,6 @@ bool VulkanSurface::UpdateWindow(ANativeWindow* window, const WindowInfo& window
return false;
}
- const SkISize& size = windowInfo.actualSize;
- err = native_window_set_buffers_dimensions(window, size.width(), size.height());
- if (err != 0) {
- ALOGE("VulkanSurface::UpdateWindow() native_window_set_buffers_dimensions(%d,%d) "
- "failed: %s (%d)",
- size.width(), size.height(), strerror(-err), err);
- return false;
- }
-
// native_window_set_buffers_transform() expects the transform the app is requesting that
// the compositor perform during composition. With native windows, pre-transform works by
// rendering with the same transform the compositor is applying (as in Vulkan), but
@@ -353,16 +292,6 @@ bool VulkanSurface::UpdateWindow(ANativeWindow* window, const WindowInfo& window
return false;
}
- // Vulkan defaults to NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW, but this is different than
- // HWUI's expectation
- err = native_window_set_scaling_mode(window, NATIVE_WINDOW_SCALING_MODE_FREEZE);
- if (err != 0) {
- ALOGE("VulkanSurface::UpdateWindow() native_window_set_scaling_mode(SCALE_TO_WINDOW) "
- "failed: %s (%d)",
- strerror(-err), err);
- return false;
- }
-
err = native_window_set_buffer_count(window, windowInfo.bufferCount);
if (err != 0) {
ALOGE("VulkanSurface::UpdateWindow() native_window_set_buffer_count(%zu) failed: %s (%d)",
@@ -377,16 +306,12 @@ bool VulkanSurface::UpdateWindow(ANativeWindow* window, const WindowInfo& window
return false;
}
- return err == 0;
+ return true;
}
VulkanSurface::VulkanSurface(ANativeWindow* window, const WindowInfo& windowInfo,
- SkISize minWindowSize, SkISize maxWindowSize, GrContext* grContext)
- : mNativeWindow(window)
- , mWindowInfo(windowInfo)
- , mGrContext(grContext)
- , mMinWindowSize(minWindowSize)
- , mMaxWindowSize(maxWindowSize) {}
+ GrContext* grContext)
+ : mNativeWindow(window), mWindowInfo(windowInfo), mGrContext(grContext) {}
VulkanSurface::~VulkanSurface() {
releaseBuffers();
@@ -429,56 +354,49 @@ VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer() {
// value at the end of the function if everything dequeued correctly.
mCurrentBufferInfo = nullptr;
- // check if the native window has been resized or rotated and update accordingly
- SkISize newSize = SkISize::MakeEmpty();
+ // Query the transform hint synced from the initial Surface connect or last queueBuffer. The
+ // auto prerotation on the buffer is based on the same transform hint in use by the producer.
int transformHint = 0;
- mNativeWindow->query(mNativeWindow.get(), NATIVE_WINDOW_WIDTH, &newSize.fWidth);
- mNativeWindow->query(mNativeWindow.get(), NATIVE_WINDOW_HEIGHT, &newSize.fHeight);
- mNativeWindow->query(mNativeWindow.get(), NATIVE_WINDOW_TRANSFORM_HINT, &transformHint);
- if (newSize != mWindowInfo.actualSize || transformHint != mWindowInfo.transform) {
- WindowInfo newWindowInfo = mWindowInfo;
- newWindowInfo.size = newSize;
- newWindowInfo.transform = IsTransformSupported(transformHint) ? transformHint : 0;
- ComputeWindowSizeAndTransform(&newWindowInfo, mMinWindowSize, mMaxWindowSize);
-
- int err = 0;
- if (newWindowInfo.actualSize != mWindowInfo.actualSize) {
- // reset the native buffers and update the window
- err = native_window_set_buffers_dimensions(mNativeWindow.get(),
- newWindowInfo.actualSize.width(),
- newWindowInfo.actualSize.height());
- if (err != 0) {
- ALOGE("native_window_set_buffers_dimensions(%d,%d) failed: %s (%d)",
- newWindowInfo.actualSize.width(), newWindowInfo.actualSize.height(),
- strerror(-err), err);
- return nullptr;
- }
+ int err =
+ mNativeWindow->query(mNativeWindow.get(), NATIVE_WINDOW_TRANSFORM_HINT, &transformHint);
+
+ // Since auto pre-rotation is enabled, dequeueBuffer to get the consumer driven buffer size
+ // from ANativeWindowBuffer.
+ ANativeWindowBuffer* buffer;
+ int fence_fd;
+ err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buffer, &fence_fd);
+ if (err != 0) {
+ ALOGE("dequeueBuffer failed: %s (%d)", strerror(-err), err);
+ return nullptr;
+ }
+
+ SkISize actualSize = SkISize::Make(buffer->width, buffer->height);
+ if (actualSize != mWindowInfo.actualSize || transformHint != mWindowInfo.transform) {
+ if (actualSize != mWindowInfo.actualSize) {
// reset the NativeBufferInfo (including SkSurface) associated with the old buffers. The
// new NativeBufferInfo storage will be populated lazily as we dequeue each new buffer.
+ mWindowInfo.actualSize = actualSize;
releaseBuffers();
- // TODO should we ask the nativewindow to allocate buffers?
}
- if (newWindowInfo.transform != mWindowInfo.transform) {
+ if (transformHint != mWindowInfo.transform) {
err = native_window_set_buffers_transform(mNativeWindow.get(),
- InvertTransform(newWindowInfo.transform));
+ InvertTransform(transformHint));
if (err != 0) {
- ALOGE("native_window_set_buffers_transform(%d) failed: %s (%d)",
- newWindowInfo.transform, strerror(-err), err);
- newWindowInfo.transform = mWindowInfo.transform;
- ComputeWindowSizeAndTransform(&newWindowInfo, mMinWindowSize, mMaxWindowSize);
+ ALOGE("native_window_set_buffers_transform(%d) failed: %s (%d)", transformHint,
+ strerror(-err), err);
+ mNativeWindow->cancelBuffer(mNativeWindow.get(), buffer, fence_fd);
+ return nullptr;
}
+ mWindowInfo.transform = transformHint;
}
- mWindowInfo = newWindowInfo;
- }
+ mWindowInfo.size = actualSize;
+ if (mWindowInfo.transform & NATIVE_WINDOW_TRANSFORM_ROT_90) {
+ mWindowInfo.size.set(actualSize.height(), actualSize.width());
+ }
- ANativeWindowBuffer* buffer;
- int fence_fd;
- int err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buffer, &fence_fd);
- if (err != 0) {
- ALOGE("dequeueBuffer failed: %s (%d)", strerror(-err), err);
- return nullptr;
+ mWindowInfo.preTransform = GetPreTransformMatrix(mWindowInfo.size, mWindowInfo.transform);
}
uint32_t idx;
diff --git a/libs/hwui/renderthread/VulkanSurface.h b/libs/hwui/renderthread/VulkanSurface.h
index b7af596ae762..bd2362612a13 100644
--- a/libs/hwui/renderthread/VulkanSurface.h
+++ b/libs/hwui/renderthread/VulkanSurface.h
@@ -17,6 +17,8 @@
#include <system/graphics.h>
#include <system/window.h>
+#include <ui/BufferQueueDefs.h>
+#include <ui/PixelFormat.h>
#include <vulkan/vulkan.h>
#include <SkRefCnt.h>
@@ -101,11 +103,12 @@ private:
SkMatrix preTransform;
};
- VulkanSurface(ANativeWindow* window, const WindowInfo& windowInfo, SkISize minWindowSize,
- SkISize maxWindowSize, GrContext* grContext);
+ VulkanSurface(ANativeWindow* window, const WindowInfo& windowInfo, GrContext* grContext);
+ static bool InitializeWindowInfoStruct(ANativeWindow* window, ColorMode colorMode,
+ SkColorType colorType, sk_sp<SkColorSpace> colorSpace,
+ const VulkanManager& vkManager, uint32_t extraBuffers,
+ WindowInfo* outWindowInfo);
static bool UpdateWindow(ANativeWindow* window, const WindowInfo& windowInfo);
- static void ComputeWindowSizeAndTransform(WindowInfo* windowInfo, const SkISize& minSize,
- const SkISize& maxSize);
void releaseBuffers();
// TODO: Just use a vector?
@@ -117,11 +120,8 @@ private:
uint32_t mPresentCount = 0;
NativeBufferInfo* mCurrentBufferInfo = nullptr;
-
- const SkISize mMinWindowSize;
- const SkISize mMaxWindowSize;
};
} /* namespace renderthread */
} /* namespace uirenderer */
-} /* namespace android */ \ No newline at end of file
+} /* namespace android */
diff --git a/libs/hwui/service/GraphicsStatsService.cpp b/libs/hwui/service/GraphicsStatsService.cpp
index f79c8d3351e0..12c5b836f711 100644
--- a/libs/hwui/service/GraphicsStatsService.cpp
+++ b/libs/hwui/service/GraphicsStatsService.cpp
@@ -40,6 +40,7 @@ constexpr int32_t sHeaderSize = 4;
static_assert(sizeof(sCurrentFileVersion) == sHeaderSize, "Header size is wrong");
constexpr int sHistogramSize = ProfileData::HistogramSize();
+constexpr int sGPUHistogramSize = ProfileData::GPUHistogramSize();
static bool mergeProfileDataIntoProto(protos::GraphicsStatsProto* proto,
const std::string& package, int64_t versionCode,
@@ -211,6 +212,37 @@ bool mergeProfileDataIntoProto(protos::GraphicsStatsProto* proto, const std::str
bucket->set_frame_count(bucket->frame_count() + entry.frameCount);
index++;
});
+ if (hitMergeError) return false;
+ // fill in GPU frame time histogram
+ creatingHistogram = false;
+ if (proto->gpu_histogram_size() == 0) {
+ proto->mutable_gpu_histogram()->Reserve(sGPUHistogramSize);
+ creatingHistogram = true;
+ } else if (proto->gpu_histogram_size() != sGPUHistogramSize) {
+ ALOGE("GPU histogram size mismatch, proto is %d expected %d", proto->gpu_histogram_size(),
+ sGPUHistogramSize);
+ return false;
+ }
+ index = 0;
+ data->histogramGPUForEach([&](ProfileData::HistogramEntry entry) {
+ if (hitMergeError) return;
+
+ protos::GraphicsStatsHistogramBucketProto* bucket;
+ if (creatingHistogram) {
+ bucket = proto->add_gpu_histogram();
+ bucket->set_render_millis(entry.renderTimeMs);
+ } else {
+ bucket = proto->mutable_gpu_histogram(index);
+ if (bucket->render_millis() != static_cast<int32_t>(entry.renderTimeMs)) {
+ ALOGW("GPU frame time mistmatch %d vs. %u", bucket->render_millis(),
+ entry.renderTimeMs);
+ hitMergeError = true;
+ return;
+ }
+ }
+ bucket->set_frame_count(bucket->frame_count() + entry.frameCount);
+ index++;
+ });
return !hitMergeError;
}
@@ -226,6 +258,22 @@ static int32_t findPercentile(protos::GraphicsStatsProto* proto, int percentile)
return 0;
}
+static int32_t findGPUPercentile(protos::GraphicsStatsProto* proto, int percentile) {
+ uint32_t totalGPUFrameCount = 0; // this is usually proto->summary().total_frames() - 3.
+ for (auto it = proto->gpu_histogram().rbegin(); it != proto->gpu_histogram().rend(); ++it) {
+ totalGPUFrameCount += it->frame_count();
+ }
+ int32_t pos = percentile * totalGPUFrameCount / 100;
+ int32_t remaining = totalGPUFrameCount - pos;
+ for (auto it = proto->gpu_histogram().rbegin(); it != proto->gpu_histogram().rend(); ++it) {
+ remaining -= it->frame_count();
+ if (remaining <= 0) {
+ return it->render_millis();
+ }
+ }
+ return 0;
+}
+
void dumpAsTextToFd(protos::GraphicsStatsProto* proto, int fd) {
// This isn't a full validation, just enough that we can deref at will
if (proto->package_name().empty() || !proto->has_summary()) {
@@ -255,6 +303,14 @@ void dumpAsTextToFd(protos::GraphicsStatsProto* proto, int fd) {
for (const auto& it : proto->histogram()) {
dprintf(fd, " %dms=%d", it.render_millis(), it.frame_count());
}
+ dprintf(fd, "\n50th gpu percentile: %dms", findGPUPercentile(proto, 50));
+ dprintf(fd, "\n90th gpu percentile: %dms", findGPUPercentile(proto, 90));
+ dprintf(fd, "\n95th gpu percentile: %dms", findGPUPercentile(proto, 95));
+ dprintf(fd, "\n99th gpu percentile: %dms", findGPUPercentile(proto, 99));
+ dprintf(fd, "\nGPU HISTOGRAM:");
+ for (const auto& it : proto->gpu_histogram()) {
+ dprintf(fd, " %dms=%d", it.render_millis(), it.frame_count());
+ }
dprintf(fd, "\n");
}
diff --git a/libs/hwui/tests/common/scenes/BitmapShaders.cpp b/libs/hwui/tests/common/scenes/BitmapShaders.cpp
index 510766073b08..c4067af388e3 100644
--- a/libs/hwui/tests/common/scenes/BitmapShaders.cpp
+++ b/libs/hwui/tests/common/scenes/BitmapShaders.cpp
@@ -15,6 +15,7 @@
*/
#include <SkImagePriv.h>
+#include "hwui/Paint.h"
#include "TestSceneBase.h"
#include "tests/common/BitmapAllocationTestUtils.h"
#include "utils/Color.h"
@@ -43,17 +44,15 @@ public:
skCanvas.drawRect(SkRect::MakeXYWH(100, 100, 100, 100), skPaint);
});
- SkPaint paint;
+ Paint paint;
sk_sp<SkImage> image = hwuiBitmap->makeImage();
sk_sp<SkShader> repeatShader =
- image->makeShader(SkShader::TileMode::kRepeat_TileMode,
- SkShader::TileMode::kRepeat_TileMode, nullptr);
+ image->makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat);
paint.setShader(std::move(repeatShader));
canvas.drawRoundRect(0, 0, 500, 500, 50.0f, 50.0f, paint);
sk_sp<SkShader> mirrorShader =
- image->makeShader(SkShader::TileMode::kMirror_TileMode,
- SkShader::TileMode::kMirror_TileMode, nullptr);
+ image->makeShader(SkTileMode::kMirror, SkTileMode::kMirror);
paint.setShader(std::move(mirrorShader));
canvas.drawRoundRect(0, 600, 500, 1100, 50.0f, 50.0f, paint);
}
diff --git a/libs/hwui/tests/common/scenes/HwBitmapInCompositeShader.cpp b/libs/hwui/tests/common/scenes/HwBitmapInCompositeShader.cpp
index 2af955fbb711..5886ea39acce 100644
--- a/libs/hwui/tests/common/scenes/HwBitmapInCompositeShader.cpp
+++ b/libs/hwui/tests/common/scenes/HwBitmapInCompositeShader.cpp
@@ -50,7 +50,7 @@ public:
pixels[4000 + 4 * i + 3] = 255;
}
buffer->unlock();
- sk_sp<Bitmap> hardwareBitmap(Bitmap::createFrom(buffer, kRGBA_8888_SkColorType,
+ sk_sp<Bitmap> hardwareBitmap(Bitmap::createFrom(buffer->toAHardwareBuffer(),
SkColorSpace::MakeSRGB()));
sk_sp<SkShader> hardwareShader(createBitmapShader(*hardwareBitmap));
@@ -60,12 +60,12 @@ public:
colors[0] = Color::Black;
colors[1] = Color::White;
sk_sp<SkShader> gradientShader = SkGradientShader::MakeRadial(
- center, 50, colors, nullptr, 2, SkShader::TileMode::kRepeat_TileMode);
+ center, 50, colors, nullptr, 2, SkTileMode::kRepeat);
sk_sp<SkShader> compositeShader(
- SkShader::MakeComposeShader(hardwareShader, gradientShader, SkBlendMode::kDstATop));
+ SkShaders::Blend(SkBlendMode::kDstATop, hardwareShader, gradientShader));
- SkPaint paint;
+ Paint paint;
paint.setShader(std::move(compositeShader));
canvas.drawRoundRect(0, 0, 400, 200, 10.0f, 10.0f, paint);
}
@@ -74,7 +74,6 @@ public:
sk_sp<SkShader> createBitmapShader(Bitmap& bitmap) {
sk_sp<SkImage> image = bitmap.makeImage();
- return image->makeShader(SkShader::TileMode::kClamp_TileMode,
- SkShader::TileMode::kClamp_TileMode);
+ return image->makeShader();
}
};
diff --git a/libs/hwui/tests/common/scenes/ListOfFadedTextAnimation.cpp b/libs/hwui/tests/common/scenes/ListOfFadedTextAnimation.cpp
index ecaaf487e4f8..a9449b62a1f8 100644
--- a/libs/hwui/tests/common/scenes/ListOfFadedTextAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/ListOfFadedTextAnimation.cpp
@@ -44,12 +44,12 @@ class ListOfFadedTextAnimation : public TestListViewSceneBase {
SkColor colors[2] = {Color::Black, Color::Transparent};
sk_sp<SkShader> s(
- SkGradientShader::MakeLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode));
+ SkGradientShader::MakeLinear(pts, colors, NULL, 2, SkTileMode::kClamp));
SkMatrix matrix;
matrix.setScale(1, length);
matrix.postRotate(-90);
- SkPaint fadingPaint;
+ Paint fadingPaint;
fadingPaint.setShader(s->makeWithLocalMatrix(matrix));
fadingPaint.setBlendMode(SkBlendMode::kDstOut);
canvas.drawRect(0, 0, length, itemHeight, fadingPaint);
diff --git a/libs/hwui/tests/common/scenes/ListViewAnimation.cpp b/libs/hwui/tests/common/scenes/ListViewAnimation.cpp
index feb881f654f8..d031923a112b 100644
--- a/libs/hwui/tests/common/scenes/ListViewAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/ListViewAnimation.cpp
@@ -53,7 +53,7 @@ class ListViewAnimation : public TestListViewSceneBase {
char charToShow = 'A' + (rand() % 26);
const SkPoint pos = {SkIntToScalar(size / 2),
/*approximate centering*/ SkFloatToScalar(size * 0.7f)};
- canvas.drawSimpleText(&charToShow, 1, kUTF8_SkTextEncoding, pos.fX, pos.fY, font, paint);
+ canvas.drawSimpleText(&charToShow, 1, SkTextEncoding::kUTF8, pos.fX, pos.fY, font, paint);
return bitmap;
}
@@ -79,7 +79,7 @@ class ListViewAnimation : public TestListViewSceneBase {
static sk_sp<Bitmap> filledBox(createBoxBitmap(true));
static sk_sp<Bitmap> strokedBox(createBoxBitmap(false));
// TODO: switch to using round rect clipping, once merging correctly handles that
- SkPaint roundRectPaint;
+ Paint roundRectPaint;
roundRectPaint.setAntiAlias(true);
roundRectPaint.setColor(Color::White);
canvas.drawRoundRect(0, 0, itemWidth, itemHeight, dp(6), dp(6), roundRectPaint);
diff --git a/libs/hwui/tests/common/scenes/OvalAnimation.cpp b/libs/hwui/tests/common/scenes/OvalAnimation.cpp
index 4ff868b9d068..402c1ece2146 100644
--- a/libs/hwui/tests/common/scenes/OvalAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/OvalAnimation.cpp
@@ -28,7 +28,7 @@ public:
void createContent(int width, int height, Canvas& canvas) override {
canvas.drawColor(Color::White, SkBlendMode::kSrcOver);
card = TestUtils::createNode(0, 0, 200, 200, [](RenderProperties& props, Canvas& canvas) {
- SkPaint paint;
+ Paint paint;
paint.setAntiAlias(true);
paint.setColor(Color::Black);
canvas.drawOval(0, 0, 200, 200, paint);
diff --git a/libs/hwui/tests/common/scenes/RectGridAnimation.cpp b/libs/hwui/tests/common/scenes/RectGridAnimation.cpp
index 6a3b6a57b28a..80b5cc191089 100644
--- a/libs/hwui/tests/common/scenes/RectGridAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/RectGridAnimation.cpp
@@ -37,11 +37,11 @@ public:
SkRegion region;
for (int xOffset = 0; xOffset < 200; xOffset += 2) {
for (int yOffset = 0; yOffset < 200; yOffset += 2) {
- region.op(xOffset, yOffset, xOffset + 1, yOffset + 1, SkRegion::kUnion_Op);
+ region.op({xOffset, yOffset, xOffset + 1, yOffset + 1}, SkRegion::kUnion_Op);
}
}
- SkPaint paint;
+ Paint paint;
paint.setColor(0xff00ffff);
canvas.drawRegion(region, paint);
});
diff --git a/libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp b/libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp
index 02dd42ff2ae8..97bfba34c790 100644
--- a/libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/SaveLayerAnimation.cpp
@@ -45,7 +45,7 @@ public:
canvas.save(SaveFlags::MatrixClip);
canvas.translate(0, 400);
canvas.saveLayerAlpha(100, 100, 300, 300, 128, SaveFlags::Flags(0)); // unclipped
- SkPaint paint;
+ Paint paint;
paint.setAntiAlias(true);
paint.setColor(Color::Green_700);
canvas.drawCircle(200, 200, 200, paint);
diff --git a/libs/hwui/tests/common/scenes/ShapeAnimation.cpp b/libs/hwui/tests/common/scenes/ShapeAnimation.cpp
index d189a9379c33..70a1557dcf6a 100644
--- a/libs/hwui/tests/common/scenes/ShapeAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/ShapeAnimation.cpp
@@ -30,14 +30,14 @@ public:
void createContent(int width, int height, Canvas& canvas) override {
card = TestUtils::createNode(
0, 0, width, height, [width](RenderProperties& props, Canvas& canvas) {
- std::function<void(Canvas&, float, const SkPaint&)> ops[] = {
- [](Canvas& canvas, float size, const SkPaint& paint) {
+ std::function<void(Canvas&, float, const Paint&)> ops[] = {
+ [](Canvas& canvas, float size, const Paint& paint) {
canvas.drawArc(0, 0, size, size, 50, 189, true, paint);
},
- [](Canvas& canvas, float size, const SkPaint& paint) {
+ [](Canvas& canvas, float size, const Paint& paint) {
canvas.drawOval(0, 0, size, size, paint);
},
- [](Canvas& canvas, float size, const SkPaint& paint) {
+ [](Canvas& canvas, float size, const Paint& paint) {
SkPath diamondPath;
diamondPath.moveTo(size / 2, 0);
diamondPath.lineTo(size, size / 2);
@@ -46,18 +46,18 @@ public:
diamondPath.close();
canvas.drawPath(diamondPath, paint);
},
- [](Canvas& canvas, float size, const SkPaint& paint) {
+ [](Canvas& canvas, float size, const Paint& paint) {
float data[] = {0, 0, size, size, 0, size, size, 0};
canvas.drawLines(data, sizeof(data) / sizeof(float), paint);
},
- [](Canvas& canvas, float size, const SkPaint& paint) {
+ [](Canvas& canvas, float size, const Paint& paint) {
float data[] = {0, 0, size, size, 0, size, size, 0};
canvas.drawPoints(data, sizeof(data) / sizeof(float), paint);
},
- [](Canvas& canvas, float size, const SkPaint& paint) {
+ [](Canvas& canvas, float size, const Paint& paint) {
canvas.drawRect(0, 0, size, size, paint);
},
- [](Canvas& canvas, float size, const SkPaint& paint) {
+ [](Canvas& canvas, float size, const Paint& paint) {
float rad = size / 4;
canvas.drawRoundRect(0, 0, size, size, rad, rad, paint);
}};
@@ -66,7 +66,7 @@ public:
// each combination of strokeWidth + style gets a column
int outerCount = canvas.save(SaveFlags::MatrixClip);
- SkPaint paint;
+ Paint paint;
paint.setAntiAlias(true);
SkPaint::Style styles[] = {SkPaint::kStroke_Style, SkPaint::kFill_Style,
SkPaint::kStrokeAndFill_Style};
diff --git a/libs/hwui/tests/common/scenes/SimpleColorMatrixAnimation.cpp b/libs/hwui/tests/common/scenes/SimpleColorMatrixAnimation.cpp
index ff0cb3705cb8..a0bc5aa245d5 100644
--- a/libs/hwui/tests/common/scenes/SimpleColorMatrixAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/SimpleColorMatrixAnimation.cpp
@@ -52,21 +52,13 @@ private:
return TestUtils::createNode(
x, y, x + width, y + height,
[width, height](RenderProperties& props, Canvas& canvas) {
- SkPaint paint;
- float matrix[20] = {0};
-
+ Paint paint;
// Simple scale/translate case where R, G, and B are all treated equivalently
- matrix[SkColorMatrix::kR_Scale] = 1.1f;
- matrix[SkColorMatrix::kG_Scale] = 1.1f;
- matrix[SkColorMatrix::kB_Scale] = 1.1f;
- matrix[SkColorMatrix::kA_Scale] = 0.5f;
-
- matrix[SkColorMatrix::kR_Trans] = 5.0f;
- matrix[SkColorMatrix::kG_Trans] = 5.0f;
- matrix[SkColorMatrix::kB_Trans] = 5.0f;
- matrix[SkColorMatrix::kA_Trans] = 10.0f;
+ SkColorMatrix cm;
+ cm.setScale(1.1f, 1.1f, 1.1f, 0.5f);
+ cm.postTranslate(5.0f/255, 5.0f/255, 5.0f/255, 10.0f/255);
- paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
+ paint.setColorFilter(SkColorFilters::Matrix(cm));
// set a shader so it's not likely for the matrix to be optimized away (since a
// clever
@@ -75,7 +67,7 @@ private:
SkPoint pts[] = {SkPoint::Make(0, 0), SkPoint::Make(width, height)};
SkColor colors[2] = {Color::DeepPurple_500, Color::DeepOrange_500};
paint.setShader(SkGradientShader::MakeLinear(pts, colors, pos, 2,
- SkShader::kClamp_TileMode));
+ SkTileMode::kClamp));
// overdraw several times to emphasize shader cost
for (int i = 0; i < 10; i++) {
diff --git a/libs/hwui/tests/common/scenes/SimpleGradientAnimation.cpp b/libs/hwui/tests/common/scenes/SimpleGradientAnimation.cpp
index 016c65c17c4c..57a260c8d234 100644
--- a/libs/hwui/tests/common/scenes/SimpleGradientAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/SimpleGradientAnimation.cpp
@@ -51,13 +51,13 @@ private:
[width, height](RenderProperties& props, Canvas& canvas) {
float pos[] = {0, 1};
SkPoint pts[] = {SkPoint::Make(0, 0), SkPoint::Make(width, height)};
- SkPaint paint;
+ Paint paint;
// overdraw several times to emphasize shader cost
for (int i = 0; i < 10; i++) {
// use i%2 start position to pick 2 color combo with black in it
SkColor colors[3] = {Color::Transparent, Color::Black, Color::Cyan_500};
paint.setShader(SkGradientShader::MakeLinear(pts, colors + (i % 2), pos, 2,
- SkShader::kClamp_TileMode));
+ SkTileMode::kClamp));
canvas.drawRect(i, i, width, height, paint);
}
});
diff --git a/libs/hwui/tests/common/scenes/TestSceneBase.h b/libs/hwui/tests/common/scenes/TestSceneBase.h
index 6f76a502ae3e..24d35857c60d 100644
--- a/libs/hwui/tests/common/scenes/TestSceneBase.h
+++ b/libs/hwui/tests/common/scenes/TestSceneBase.h
@@ -17,6 +17,7 @@
#pragma once
#include "hwui/Canvas.h"
+#include "hwui/Paint.h"
#include "RenderNode.h"
#include "tests/common/TestContext.h"
#include "tests/common/TestScene.h"
diff --git a/libs/hwui/tests/common/scenes/TvApp.cpp b/libs/hwui/tests/common/scenes/TvApp.cpp
index 229c7f392629..bac887053d2f 100644
--- a/libs/hwui/tests/common/scenes/TvApp.cpp
+++ b/libs/hwui/tests/common/scenes/TvApp.cpp
@@ -217,9 +217,9 @@ private:
std::unique_ptr<Canvas> canvas(Canvas::create_recording_canvas(
image->stagingProperties().getWidth(), image->stagingProperties().getHeight(),
image.get()));
- SkPaint paint;
+ Paint paint;
sk_sp<SkColorFilter> filter(
- SkColorFilter::MakeModeFilter((curFrame % 150) << 24, SkBlendMode::kSrcATop));
+ SkColorFilters::Blend((curFrame % 150) << 24, SkBlendMode::kSrcATop));
paint.setColorFilter(filter);
sk_sp<Bitmap> bitmap = mCachedBitmaps[ci];
canvas->drawBitmap(*bitmap, 0, 0, &paint);
diff --git a/libs/hwui/tests/macrobench/TestSceneRunner.cpp b/libs/hwui/tests/macrobench/TestSceneRunner.cpp
index 9c845f04e820..22d5abbd3dbc 100644
--- a/libs/hwui/tests/macrobench/TestSceneRunner.cpp
+++ b/libs/hwui/tests/macrobench/TestSceneRunner.cpp
@@ -146,7 +146,7 @@ void run(const TestScene::Info& info, const TestScene::Options& opts,
}
for (int i = 0; i < warmupFrameCount; i++) {
testContext.waitForVsync();
- nsecs_t vsync = systemTime(CLOCK_MONOTONIC);
+ nsecs_t vsync = systemTime(SYSTEM_TIME_MONOTONIC);
UiFrameInfoBuilder(proxy->frameInfo()).setVsync(vsync, vsync);
proxy->syncAndDrawFrame();
}
@@ -161,10 +161,10 @@ void run(const TestScene::Info& info, const TestScene::Options& opts,
ModifiedMovingAverage<double> avgMs(opts.reportFrametimeWeight);
- nsecs_t start = systemTime(CLOCK_MONOTONIC);
+ nsecs_t start = systemTime(SYSTEM_TIME_MONOTONIC);
for (int i = 0; i < opts.count; i++) {
testContext.waitForVsync();
- nsecs_t vsync = systemTime(CLOCK_MONOTONIC);
+ nsecs_t vsync = systemTime(SYSTEM_TIME_MONOTONIC);
{
ATRACE_NAME("UI-Draw Frame");
UiFrameInfoBuilder(proxy->frameInfo()).setVsync(vsync, vsync);
@@ -173,7 +173,7 @@ void run(const TestScene::Info& info, const TestScene::Options& opts,
}
if (opts.reportFrametimeWeight) {
proxy->fence();
- nsecs_t done = systemTime(CLOCK_MONOTONIC);
+ nsecs_t done = systemTime(SYSTEM_TIME_MONOTONIC);
avgMs.add((done - vsync) / 1000000.0);
if (i % 10 == 9) {
printf("Average frametime %.3fms\n", avgMs.average());
@@ -181,7 +181,7 @@ void run(const TestScene::Info& info, const TestScene::Options& opts,
}
}
proxy->fence();
- nsecs_t end = systemTime(CLOCK_MONOTONIC);
+ nsecs_t end = systemTime(SYSTEM_TIME_MONOTONIC);
if (reporter) {
outputBenchmarkReport(info, opts, reporter, proxy.get(), (end - start) / (double)s2ns(1));
diff --git a/libs/hwui/tests/microbench/DisplayListCanvasBench.cpp b/libs/hwui/tests/microbench/DisplayListCanvasBench.cpp
index 70423a70157b..4ce6c32470ea 100644
--- a/libs/hwui/tests/microbench/DisplayListCanvasBench.cpp
+++ b/libs/hwui/tests/microbench/DisplayListCanvasBench.cpp
@@ -18,6 +18,7 @@
#include "DisplayList.h"
#include "hwui/Canvas.h"
+#include "hwui/Paint.h"
#include "pipeline/skia/SkiaDisplayList.h"
#include "tests/common/TestUtils.h"
@@ -93,7 +94,7 @@ void BM_DisplayListCanvas_record_simpleBitmapView(benchmark::State& benchState)
std::unique_ptr<Canvas> canvas(Canvas::create_recording_canvas(100, 100));
delete canvas->finishRecording();
- SkPaint rectPaint;
+ Paint rectPaint;
sk_sp<Bitmap> iconBitmap(TestUtils::createBitmap(80, 80));
while (benchState.KeepRunning()) {
diff --git a/libs/hwui/tests/microbench/main.cpp b/libs/hwui/tests/microbench/main.cpp
index b5abf5bc5efa..9c4d25968d60 100644
--- a/libs/hwui/tests/microbench/main.cpp
+++ b/libs/hwui/tests/microbench/main.cpp
@@ -14,9 +14,6 @@
* limitations under the License.
*/
-#include "debug/GlesDriver.h"
-#include "debug/NullGlesDriver.h"
-
#include "hwui/Typeface.h"
#include <benchmark/benchmark.h>
@@ -24,10 +21,8 @@
#include <memory>
using namespace android;
-using namespace android::uirenderer;
int main(int argc, char** argv) {
- debug::GlesDriver::replace(std::make_unique<debug::NullGlesDriver>());
benchmark::Initialize(&argc, argv);
Typeface::setRobotoTypefaceForTest();
benchmark::RunSpecifiedBenchmarks();
diff --git a/libs/hwui/tests/scripts/skp-capture.sh b/libs/hwui/tests/scripts/skp-capture.sh
index 54fa22929586..4b46fbf86818 100755
--- a/libs/hwui/tests/scripts/skp-capture.sh
+++ b/libs/hwui/tests/scripts/skp-capture.sh
@@ -4,6 +4,12 @@
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+#
+# Before this can be used, the device must be rooted and the filesystem must be writable by Skia
+# - These steps are necessary once after flashing to enable capture -
+# adb root
+# adb remount
+# adb reboot
if [ -z "$1" ]; then
printf 'Usage:\n skp-capture.sh PACKAGE_NAME OPTIONAL_FRAME_COUNT\n\n'
@@ -20,20 +26,27 @@ if ! command -v adb > /dev/null 2>&1; then
exit 2
fi
fi
-phase1_timeout_seconds=15
-phase2_timeout_seconds=60
+phase1_timeout_seconds=60
+phase2_timeout_seconds=300
package="$1"
-filename="$(date '+%H%M%S').skp"
+extension="skp"
+if (( "$2" > 1 )); then # 2nd arg is number of frames
+ extension="mskp" # use different extension for multi frame files.
+fi
+filename="$(date '+%H%M%S').${extension}"
remote_path="/data/data/${package}/cache/${filename}"
local_path_prefix="$(date '+%Y-%m-%d_%H%M%S')_${package}"
-local_path="${local_path_prefix}.skp"
+local_path="${local_path_prefix}.${extension}"
enable_capture_key='debug.hwui.capture_skp_enabled'
enable_capture_value=$(adb shell "getprop '${enable_capture_key}'")
-#printf 'captureflag=' "$enable_capture_value" '\n'
+
+# TODO(nifong): check if filesystem is writable here with "avbctl get-verity"
+# result will either start with "verity is disabled" or "verity is enabled"
+
if [ -z "$enable_capture_value" ]; then
- printf 'Capture SKP property need to be enabled first. Please use\n'
- printf "\"adb shell setprop debug.hwui.capture_skp_enabled true\" and then restart\n"
- printf "the process.\n\n"
+ printf 'debug.hwui.capture_skp_enabled was found to be disabled, enabling it now.\n'
+ printf " restart the process you want to capture on the device, then retry this script.\n\n"
+ adb shell "setprop '${enable_capture_key}' true"
exit 1
fi
if [ ! -z "$2" ]; then
@@ -57,12 +70,18 @@ banner() {
printf ' %s' "$*"
printf '\n=====================\n'
}
-banner '...WAITING...'
-adb_test_exist() {
- test '0' = "$(adb shell "test -e \"$1\"; echo \$?")";
+banner '...WAITING FOR APP INTERACTION...'
+# Waiting for nonzero file is an indication that the pipeline has both opened the file and written
+# the header. With multiple frames this does not occur until the last frame has been recorded,
+# so we continue to show the "waiting for app interaction" message as long as the app still requires
+# interaction to draw more frames.
+adb_test_file_nonzero() {
+ # grab first byte of `du` output
+ X="$(adb shell "du \"$1\" 2> /dev/null | dd bs=1 count=1 2> /dev/null")"
+ test "$X" && test "$X" -ne 0
}
timeout=$(( $(date +%s) + $phase1_timeout_seconds))
-while ! adb_test_exist "$remote_path"; do
+while ! adb_test_file_nonzero "$remote_path"; do
spin 0.05
if [ $(date +%s) -gt $timeout ] ; then
printf '\bTimed out.\n'
@@ -72,20 +91,27 @@ while ! adb_test_exist "$remote_path"; do
done
printf '\b'
-#read -n1 -r -p "Press any key to continue..." key
+# Disable further capturing
+adb shell "setprop '${filename_key}' ''"
banner '...SAVING...'
-adb_test_file_nonzero() {
- # grab first byte of `du` output
- X="$(adb shell "du \"$1\" 2> /dev/null | dd bs=1 count=1 2> /dev/null")"
- test "$X" && test "$X" -ne 0
+# return the size of a file in bytes
+adb_filesize() {
+ adb shell "wc -c \"$1\"" 2> /dev/null | awk '{print $1}'
}
-#adb_filesize() {
-# adb shell "wc -c \"$1\"" 2> /dev/null | awk '{print $1}'
-#}
timeout=$(( $(date +%s) + $phase2_timeout_seconds))
-while ! adb_test_file_nonzero "$remote_path"; do
+last_size='0' # output of last size check command
+unstable=true # false once the file size stops changing
+counter=0 # used to perform size check only 1/sec though we update spinner 20/sec
+# loop until the file size is unchanged for 1 second.
+while [ $unstable != 0 ] ; do
spin 0.05
+ counter=$(( $counter+1 ))
+ if ! (( $counter % 20)) ; then
+ new_size=$(adb_filesize "$remote_path")
+ unstable=$(($(adb_filesize "$remote_path") != last_size))
+ last_size=$new_size
+ fi
if [ $(date +%s) -gt $timeout ] ; then
printf '\bTimed out.\n'
adb shell "setprop '${filename_key}' ''"
@@ -94,7 +120,7 @@ while ! adb_test_file_nonzero "$remote_path"; do
done
printf '\b'
-adb shell "setprop '${filename_key}' ''"
+printf "SKP file serialized: %s\n" $(echo $last_size | numfmt --to=iec)
i=0; while [ $i -lt 10 ]; do spin 0.10; i=$(($i + 1)); done; echo
@@ -105,12 +131,4 @@ if ! [ -f "$local_path" ] ; then
fi
adb shell rm "$remote_path"
printf '\nSKP saved to file:\n %s\n\n' "$local_path"
-if [ ! -z "$2" ]; then
- bridge="_"
- adb shell "setprop 'debug.hwui.capture_skp_frames' ''"
- for i in $(seq 2 $2); do
- adb pull "${remote_path}_${i}" "${local_path_prefix}_${i}.skp"
- adb shell rm "${remote_path}_${i}"
- done
-fi
diff --git a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
index c813cd945905..3632be06c45f 100644
--- a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
+++ b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
@@ -24,6 +24,7 @@
#include "DamageAccumulator.h"
#include "FatalTestCanvas.h"
#include "IContextFactory.h"
+#include "hwui/Paint.h"
#include "RecordingCanvas.h"
#include "SkiaCanvas.h"
#include "pipeline/skia/SkiaDisplayList.h"
@@ -59,7 +60,7 @@ TEST(RenderNodeDrawable, create) {
namespace {
static void drawOrderedRect(Canvas* canvas, uint8_t expectedDrawOrder) {
- SkPaint paint;
+ Paint paint;
// order put in blue channel, transparent so overlapped content doesn't get rejected
paint.setColor(SkColorSetARGB(1, 0, 0, expectedDrawOrder));
canvas->drawRect(0, 0, 100, 100, paint);
@@ -211,7 +212,7 @@ TEST(RenderNodeDrawable, saveLayerClipAndMatrixRestore) {
ASSERT_EQ(SkRect::MakeLTRB(0, 0, 400, 800), getRecorderClipBounds(recorder));
EXPECT_TRUE(getRecorderMatrix(recorder).isIdentity());
- SkPaint paint;
+ Paint paint;
paint.setAntiAlias(true);
paint.setColor(SK_ColorGREEN);
recorder.drawRect(0.0f, 400.0f, 400.0f, 800.0f, paint);
@@ -291,7 +292,7 @@ RENDERTHREAD_TEST(RenderNodeDrawable, projectionReorder) {
properties.setTranslationX(SCROLL_X);
properties.setTranslationY(SCROLL_Y);
- SkPaint paint;
+ Paint paint;
paint.setColor(SK_ColorWHITE);
canvas.drawRect(0, 0, 100, 100, paint);
},
@@ -302,7 +303,7 @@ RENDERTHREAD_TEST(RenderNodeDrawable, projectionReorder) {
[](RenderProperties& properties, SkiaRecordingCanvas& canvas) {
properties.setProjectBackwards(true);
properties.setClipToBounds(false);
- SkPaint paint;
+ Paint paint;
paint.setColor(SK_ColorDKGRAY);
canvas.drawRect(-10, -10, 60, 60, paint);
},
@@ -310,7 +311,7 @@ RENDERTHREAD_TEST(RenderNodeDrawable, projectionReorder) {
auto child = TestUtils::createSkiaNode(
0, 50, 100, 100,
[&projectingRipple](RenderProperties& properties, SkiaRecordingCanvas& canvas) {
- SkPaint paint;
+ Paint paint;
paint.setColor(SK_ColorBLUE);
canvas.drawRect(0, 0, 100, 50, paint);
canvas.drawRenderNode(projectingRipple.get());
@@ -375,14 +376,14 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(RenderNodeDrawable, emptyReceiver) {
[](RenderProperties& properties, SkiaRecordingCanvas& canvas) {
properties.setProjectBackwards(true);
properties.setClipToBounds(false);
- SkPaint paint;
+ Paint paint;
canvas.drawRect(0, 0, 100, 100, paint);
},
"P");
auto child = TestUtils::createSkiaNode(
0, 0, 100, 100,
[&projectingRipple](RenderProperties& properties, SkiaRecordingCanvas& canvas) {
- SkPaint paint;
+ Paint paint;
canvas.drawRect(0, 0, 100, 100, paint);
canvas.drawRenderNode(projectingRipple.get());
},
@@ -483,7 +484,7 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(RenderNodeDrawable, projectionHwLayer) {
properties.setTranslationX(SCROLL_X);
properties.setTranslationY(SCROLL_Y);
- canvas.drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, SkPaint());
+ canvas.drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, Paint());
},
"B"); // B
auto projectingRipple = TestUtils::createSkiaNode(
@@ -491,14 +492,14 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(RenderNodeDrawable, projectionHwLayer) {
[](RenderProperties& properties, SkiaRecordingCanvas& canvas) {
properties.setProjectBackwards(true);
properties.setClipToBounds(false);
- canvas.drawOval(100, 100, 300, 300, SkPaint()); // drawn mostly out of layer bounds
+ canvas.drawOval(100, 100, 300, 300, Paint()); // drawn mostly out of layer bounds
},
"R"); // R
auto child = TestUtils::createSkiaNode(
100, 100, 300, 300,
[&projectingRipple](RenderProperties& properties, SkiaRecordingCanvas& canvas) {
canvas.drawRenderNode(projectingRipple.get());
- canvas.drawArc(0, 0, LAYER_WIDTH, LAYER_HEIGHT, 0.0f, 280.0f, true, SkPaint());
+ canvas.drawArc(0, 0, LAYER_WIDTH, LAYER_HEIGHT, 0.0f, 280.0f, true, Paint());
},
"C"); // C
auto parent = TestUtils::createSkiaNode(
@@ -578,7 +579,7 @@ RENDERTHREAD_TEST(RenderNodeDrawable, projectionChildScroll) {
0, 0, CANVAS_WIDTH, CANVAS_HEIGHT,
[](RenderProperties& properties, SkiaRecordingCanvas& canvas) {
properties.setProjectionReceiver(true);
- canvas.drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, SkPaint());
+ canvas.drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, Paint());
},
"B"); // B
auto projectingRipple = TestUtils::createSkiaNode(
@@ -591,7 +592,7 @@ RENDERTHREAD_TEST(RenderNodeDrawable, projectionChildScroll) {
properties.setTranslationY(SCROLL_Y);
properties.setProjectBackwards(true);
properties.setClipToBounds(false);
- canvas.drawOval(0, 0, 200, 200, SkPaint());
+ canvas.drawOval(0, 0, 200, 200, Paint());
},
"R"); // R
auto child = TestUtils::createSkiaNode(
@@ -946,7 +947,7 @@ RENDERTHREAD_TEST(RenderNodeDrawable, simple) {
[](RenderProperties& props, SkiaRecordingCanvas& canvas) {
sk_sp<Bitmap> bitmap(TestUtils::createBitmap(25, 25));
canvas.drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT,
- SkPaint());
+ Paint());
canvas.drawBitmap(*bitmap, 10, 10, nullptr);
});
@@ -1022,7 +1023,7 @@ TEST(RenderNodeDrawable, renderNode) {
auto child = TestUtils::createSkiaNode(
10, 10, 110, 110, [](RenderProperties& props, SkiaRecordingCanvas& canvas) {
- SkPaint paint;
+ Paint paint;
paint.setColor(SK_ColorWHITE);
canvas.drawRect(0, 0, 100, 100, paint);
});
@@ -1030,7 +1031,7 @@ TEST(RenderNodeDrawable, renderNode) {
auto parent = TestUtils::createSkiaNode(
0, 0, CANVAS_WIDTH, CANVAS_HEIGHT,
[&child](RenderProperties& props, SkiaRecordingCanvas& canvas) {
- SkPaint paint;
+ Paint paint;
paint.setColor(SK_ColorDKGRAY);
canvas.drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, paint);
@@ -1065,7 +1066,7 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(RenderNodeDrawable, layerComposeQuality) {
auto layerNode = TestUtils::createSkiaNode(
0, 0, LAYER_WIDTH, LAYER_HEIGHT,
[](RenderProperties& properties, SkiaRecordingCanvas& canvas) {
- canvas.drawPaint(SkPaint());
+ canvas.drawPaint(Paint());
});
layerNode->animatorProperties().mutateLayerProperties().setType(LayerType::RenderLayer);
@@ -1096,10 +1097,8 @@ TEST(ReorderBarrierDrawable, testShadowMatrix) {
int getDrawCounter() { return mDrawCounter; }
virtual void onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) override {
- // expect to draw 2 RenderNodeDrawable, 1 StartReorderBarrierDrawable,
- // 1 EndReorderBarrierDrawable
- mDrawCounter++;
- SkCanvas::onDrawDrawable(drawable, matrix);
+ // Do not expect this to be called. See RecordingCanvas.cpp DrawDrawable for context.
+ EXPECT_TRUE(false);
}
virtual void didTranslate(SkScalar dx, SkScalar dy) override {
@@ -1159,8 +1158,8 @@ TEST(ReorderBarrierDrawable, testShadowMatrix) {
// create a canvas not backed by any device/pixels, but with dimensions to avoid quick rejection
ShadowTestCanvas canvas(CANVAS_WIDTH, CANVAS_HEIGHT);
RenderNodeDrawable drawable(parent.get(), &canvas, false);
- canvas.drawDrawable(&drawable);
- EXPECT_EQ(9, canvas.getDrawCounter());
+ drawable.draw(&canvas);
+ EXPECT_EQ(5, canvas.getDrawCounter());
}
// Draw a vector drawable twice but with different bounds and verify correct bounds are used.
diff --git a/libs/hwui/tests/unit/SkiaBehaviorTests.cpp b/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
index df5f45618070..7951537e1525 100644
--- a/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
+++ b/libs/hwui/tests/unit/SkiaBehaviorTests.cpp
@@ -48,14 +48,14 @@ TEST(SkiaBehavior, lightingColorFilter_simplify) {
SkColor observedColor;
SkBlendMode observedMode;
- ASSERT_TRUE(filter->asColorMode(&observedColor, &observedMode));
+ ASSERT_TRUE(filter->asAColorMode(&observedColor, &observedMode));
EXPECT_EQ(0xFF223344, observedColor);
EXPECT_EQ(SkBlendMode::kModulate, observedMode);
}
{
sk_sp<SkColorFilter> failFilter(SkColorMatrixFilter::MakeLightingFilter(0x11223344, 0x1));
- EXPECT_FALSE(failFilter->asColorMode(nullptr, nullptr));
+ EXPECT_FALSE(failFilter->asAColorMode(nullptr, nullptr));
}
}
diff --git a/libs/hwui/tests/unit/SkiaCanvasTests.cpp b/libs/hwui/tests/unit/SkiaCanvasTests.cpp
index f6178aff0c2e..fcc64fdd0be6 100644
--- a/libs/hwui/tests/unit/SkiaCanvasTests.cpp
+++ b/libs/hwui/tests/unit/SkiaCanvasTests.cpp
@@ -16,6 +16,7 @@
#include "tests/common/TestUtils.h"
+#include <hwui/Paint.h>
#include <SkBlurDrawLooper.h>
#include <SkCanvasStateUtils.h>
#include <SkPicture.h>
@@ -32,7 +33,7 @@ TEST(SkiaCanvas, drawShadowLayer) {
// clear to white
canvas.drawColor(SK_ColorWHITE, SkBlendMode::kSrc);
- SkPaint paint;
+ Paint paint;
// it is transparent to ensure that we still draw the rect since it has a looper
paint.setColor(SK_ColorTRANSPARENT);
// this is how view's shadow layers are implemented
@@ -78,7 +79,7 @@ TEST(SkiaCanvas, colorSpaceXform) {
sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
// Playback to a software sRGB canvas. The result should be fully red.
- canvas.asSkCanvas()->drawPicture(picture);
+ canvas.drawPicture(*picture);
ASSERT_EQ(0xFF0000FF, *skBitmap.getAddr32(0, 0));
}
diff --git a/libs/hwui/tests/unit/SkiaPipelineTests.cpp b/libs/hwui/tests/unit/SkiaPipelineTests.cpp
index a671bdada09a..958baa78deab 100644
--- a/libs/hwui/tests/unit/SkiaPipelineTests.cpp
+++ b/libs/hwui/tests/unit/SkiaPipelineTests.cpp
@@ -23,12 +23,14 @@
#include "AnimationContext.h"
#include "DamageAccumulator.h"
#include "IContextFactory.h"
+#include "hwui/Paint.h"
#include "SkiaCanvas.h"
#include "pipeline/skia/SkiaDisplayList.h"
#include "pipeline/skia/SkiaOpenGLPipeline.h"
#include "pipeline/skia/SkiaRecordingCanvas.h"
#include "pipeline/skia/SkiaUtils.h"
#include "renderthread/CanvasContext.h"
+#include "tests/common/TestContext.h"
#include "tests/common/TestUtils.h"
#include <gui/BufferItemConsumer.h>
@@ -95,7 +97,7 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, testOnPrepareTree) {
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, renderFrameCheckOpaque) {
auto halfGreenNode = TestUtils::createSkiaNode(
0, 0, 2, 2, [](RenderProperties& props, SkiaRecordingCanvas& bottomHalfGreenCanvas) {
- SkPaint greenPaint;
+ Paint greenPaint;
greenPaint.setColor(SK_ColorGREEN);
greenPaint.setStyle(SkPaint::kFill_Style);
bottomHalfGreenCanvas.drawRect(0, 1, 2, 2, greenPaint);
@@ -293,7 +295,7 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, deferRenderNodeScene) {
};
std::vector<sp<RenderNode>> nodes;
- SkPaint transparentPaint;
+ Paint transparentPaint;
transparentPaint.setAlpha(128);
// backdrop
@@ -424,17 +426,9 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, clip_replace) {
EXPECT_EQ(1, surface->canvas()->mDrawCounter);
}
-static sp<Surface> createDummySurface() {
- sp<IGraphicBufferProducer> producer;
- sp<IGraphicBufferConsumer> consumer;
- BufferQueue::createBufferQueue(&producer, &consumer);
- producer->setMaxDequeuedBufferCount(1);
- producer->setAsyncMode(true);
- return new Surface(producer);
-}
-
RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, context_lost) {
- auto surface = createDummySurface();
+ test::TestContext context;
+ auto surface = context.surface();
auto pipeline = std::make_unique<SkiaOpenGLPipeline>(renderThread);
EXPECT_FALSE(pipeline->isSurfaceReady());
EXPECT_TRUE(pipeline->setSurface(surface.get(), SwapBehavior::kSwap_default, ColorMode::SRGB, 0));
diff --git a/libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp b/libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp
index 635429dea359..eec25c6bd40d 100644
--- a/libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp
+++ b/libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp
@@ -24,6 +24,7 @@
#include "DamageAccumulator.h"
#include "FatalTestCanvas.h"
#include "IContextFactory.h"
+#include "hwui/Paint.h"
#include "SkiaCanvas.h"
#include "pipeline/skia/SkiaDisplayList.h"
#include "pipeline/skia/SkiaPipeline.h"
@@ -60,7 +61,7 @@ static void testProperty(std::function<void(RenderProperties&)> propSetupCallbac
0, 0, CANVAS_WIDTH, CANVAS_HEIGHT,
[propSetupCallback](RenderProperties& props, SkiaRecordingCanvas& canvas) {
propSetupCallback(props);
- SkPaint paint;
+ Paint paint;
paint.setColor(SK_ColorWHITE);
canvas.drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, paint);
});
diff --git a/libs/hwui/tests/unit/VectorDrawableTests.cpp b/libs/hwui/tests/unit/VectorDrawableTests.cpp
index 5db002862fcd..60fd7a753f2d 100644
--- a/libs/hwui/tests/unit/VectorDrawableTests.cpp
+++ b/libs/hwui/tests/unit/VectorDrawableTests.cpp
@@ -395,7 +395,7 @@ TEST(VectorDrawable, drawPathWithoutIncrementingShaderRefCount) {
bitmap.allocN32Pixels(5, 5, false);
SkCanvas canvas(bitmap);
- sk_sp<SkShader> shader = SkShader::MakeColorShader(SK_ColorBLACK);
+ sk_sp<SkShader> shader = SkShaders::Color(SK_ColorBLACK);
// Initial ref count is 1
EXPECT_TRUE(shader->unique());
diff --git a/libs/hwui/tests/unit/main.cpp b/libs/hwui/tests/unit/main.cpp
index 83d888c310f0..402cb5814366 100644
--- a/libs/hwui/tests/unit/main.cpp
+++ b/libs/hwui/tests/unit/main.cpp
@@ -18,8 +18,6 @@
#include "gtest/gtest.h"
#include "Properties.h"
-#include "debug/GlesDriver.h"
-#include "debug/NullGlesDriver.h"
#include "hwui/Typeface.h"
#include "tests/common/LeakChecker.h"
@@ -65,7 +63,6 @@ int main(int argc, char* argv[]) {
}
// Replace the default GLES driver
- debug::GlesDriver::replace(std::make_unique<debug::NullGlesDriver>());
Properties::isolatedProcess = true;
// Run the tests
diff --git a/libs/hwui/thread/WorkQueue.h b/libs/hwui/thread/WorkQueue.h
index 42f8503fd000..46b8bc07b432 100644
--- a/libs/hwui/thread/WorkQueue.h
+++ b/libs/hwui/thread/WorkQueue.h
@@ -31,7 +31,7 @@
namespace android::uirenderer {
struct MonotonicClock {
- static nsecs_t now() { return systemTime(CLOCK_MONOTONIC); }
+ static nsecs_t now() { return systemTime(SYSTEM_TIME_MONOTONIC); }
};
class WorkQueue {
diff --git a/libs/hwui/utils/Color.cpp b/libs/hwui/utils/Color.cpp
index cc7725b7b9de..b93759f87da2 100644
--- a/libs/hwui/utils/Color.cpp
+++ b/libs/hwui/utils/Color.cpp
@@ -19,12 +19,61 @@
#include <utils/Log.h>
#include <ui/ColorSpace.h>
+#ifdef __ANDROID__ // Layoutlib does not support hardware buffers or native windows
+#include <android/hardware_buffer.h>
+#include <android/native_window.h>
+#endif
+
#include <algorithm>
#include <cmath>
namespace android {
namespace uirenderer {
+#ifdef __ANDROID__ // Layoutlib does not support hardware buffers or native windows
+static inline SkImageInfo createImageInfo(int32_t width, int32_t height, int32_t format,
+ sk_sp<SkColorSpace> colorSpace) {
+ SkColorType colorType = kUnknown_SkColorType;
+ SkAlphaType alphaType = kOpaque_SkAlphaType;
+ switch (format) {
+ case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
+ colorType = kN32_SkColorType;
+ alphaType = kPremul_SkAlphaType;
+ break;
+ case AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM:
+ colorType = kN32_SkColorType;
+ alphaType = kOpaque_SkAlphaType;
+ break;
+ case AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM:
+ colorType = kRGB_565_SkColorType;
+ alphaType = kOpaque_SkAlphaType;
+ break;
+ case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
+ colorType = kRGBA_1010102_SkColorType;
+ alphaType = kPremul_SkAlphaType;
+ break;
+ case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
+ colorType = kRGBA_F16_SkColorType;
+ alphaType = kPremul_SkAlphaType;
+ break;
+ default:
+ ALOGV("Unsupported format: %d, return unknown by default", format);
+ break;
+ }
+ return SkImageInfo::Make(width, height, colorType, alphaType, colorSpace);
+}
+
+SkImageInfo ANativeWindowToImageInfo(const ANativeWindow_Buffer& buffer,
+ sk_sp<SkColorSpace> colorSpace) {
+ return createImageInfo(buffer.width, buffer.height, buffer.format, colorSpace);
+}
+
+SkImageInfo BufferDescriptionToImageInfo(const AHardwareBuffer_Desc& bufferDesc,
+ sk_sp<SkColorSpace> colorSpace) {
+ return createImageInfo(bufferDesc.width, bufferDesc.height, bufferDesc.format, colorSpace);
+}
+#endif
+
android::PixelFormat ColorTypeToPixelFormat(SkColorType colorType) {
switch (colorType) {
case kRGBA_8888_SkColorType:
diff --git a/libs/hwui/utils/Color.h b/libs/hwui/utils/Color.h
index 79400de08ee0..07b5ec8fe0f0 100644
--- a/libs/hwui/utils/Color.h
+++ b/libs/hwui/utils/Color.h
@@ -25,6 +25,9 @@
#include <SkColorSpace.h>
#include <SkImageInfo.h>
+struct ANativeWindow_Buffer;
+struct AHardwareBuffer_Desc;
+
namespace android {
namespace uirenderer {
namespace Color {
@@ -89,6 +92,14 @@ static constexpr float EOCF_sRGB(float srgb) {
return srgb <= 0.04045f ? srgb / 12.92f : powf((srgb + 0.055f) / 1.055f, 2.4f);
}
+#ifdef __ANDROID__ // Layoutlib does not support hardware buffers or native windows
+ANDROID_API SkImageInfo ANativeWindowToImageInfo(const ANativeWindow_Buffer& buffer,
+ sk_sp<SkColorSpace> colorSpace);
+
+SkImageInfo BufferDescriptionToImageInfo(const AHardwareBuffer_Desc& bufferDesc,
+ sk_sp<SkColorSpace> colorSpace);
+#endif
+
android::PixelFormat ColorTypeToPixelFormat(SkColorType colorType);
ANDROID_API SkColorType PixelFormatToColorType(android::PixelFormat format);
diff --git a/libs/hwui/utils/GLUtils.cpp b/libs/hwui/utils/GLUtils.cpp
index c694e93f7e21..61897627d842 100644
--- a/libs/hwui/utils/GLUtils.cpp
+++ b/libs/hwui/utils/GLUtils.cpp
@@ -21,19 +21,10 @@
#include "GLUtils.h"
-#if DEBUG_OPENGL >= DEBUG_LEVEL_HIGH && !defined(HWUI_GLES_WRAP_ENABLED)
-#error Setting DEBUG_OPENGL to HIGH requires setting HWUI_ENABLE_OPENGL_VALIDATION to true in the Android.mk!
-#endif
-
namespace android {
namespace uirenderer {
bool GLUtils::dumpGLErrors() {
-#if DEBUG_OPENGL >= DEBUG_LEVEL_HIGH
- // If DEBUG_LEVEL_HIGH is set then every GLES call is already wrapped
- // and asserts that there was no error. So this can just return success.
- return false;
-#else
bool errorObserved = false;
GLenum status = GL_NO_ERROR;
while ((status = glGetError()) != GL_NO_ERROR) {
@@ -56,7 +47,6 @@ bool GLUtils::dumpGLErrors() {
}
}
return errorObserved;
-#endif
}
const char* GLUtils::getGLFramebufferError() {
diff --git a/libs/hwui/utils/HostColorSpace.cpp b/libs/hwui/utils/HostColorSpace.cpp
new file mode 100644
index 000000000000..77a6820c6999
--- /dev/null
+++ b/libs/hwui/utils/HostColorSpace.cpp
@@ -0,0 +1,417 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 is copied from framework/native/libs/ui in order not to include libui in host build
+
+#include <ui/ColorSpace.h>
+
+using namespace std::placeholders;
+
+namespace android {
+
+static constexpr float linearResponse(float v) {
+ return v;
+}
+
+static constexpr float rcpResponse(float x, const ColorSpace::TransferParameters& p) {
+ return x >= p.d * p.c ? (std::pow(x, 1.0f / p.g) - p.b) / p.a : x / p.c;
+}
+
+static constexpr float response(float x, const ColorSpace::TransferParameters& p) {
+ return x >= p.d ? std::pow(p.a * x + p.b, p.g) : p.c * x;
+}
+
+static constexpr float rcpFullResponse(float x, const ColorSpace::TransferParameters& p) {
+ return x >= p.d * p.c ? (std::pow(x - p.e, 1.0f / p.g) - p.b) / p.a : (x - p.f) / p.c;
+}
+
+static constexpr float fullResponse(float x, const ColorSpace::TransferParameters& p) {
+ return x >= p.d ? std::pow(p.a * x + p.b, p.g) + p.e : p.c * x + p.f;
+}
+
+static float absRcpResponse(float x, float g,float a, float b, float c, float d) {
+ float xx = std::abs(x);
+ return std::copysign(xx >= d * c ? (std::pow(xx, 1.0f / g) - b) / a : xx / c, x);
+}
+
+static float absResponse(float x, float g, float a, float b, float c, float d) {
+ float xx = std::abs(x);
+ return std::copysign(xx >= d ? std::pow(a * xx + b, g) : c * xx, x);
+}
+
+static float safePow(float x, float e) {
+ return powf(x < 0.0f ? 0.0f : x, e);
+}
+
+static ColorSpace::transfer_function toOETF(const ColorSpace::TransferParameters& parameters) {
+ if (parameters.e == 0.0f && parameters.f == 0.0f) {
+ return std::bind(rcpResponse, _1, parameters);
+ }
+ return std::bind(rcpFullResponse, _1, parameters);
+}
+
+static ColorSpace::transfer_function toEOTF( const ColorSpace::TransferParameters& parameters) {
+ if (parameters.e == 0.0f && parameters.f == 0.0f) {
+ return std::bind(response, _1, parameters);
+ }
+ return std::bind(fullResponse, _1, parameters);
+}
+
+static ColorSpace::transfer_function toOETF(float gamma) {
+ if (gamma == 1.0f) {
+ return linearResponse;
+ }
+ return std::bind(safePow, _1, 1.0f / gamma);
+}
+
+static ColorSpace::transfer_function toEOTF(float gamma) {
+ if (gamma == 1.0f) {
+ return linearResponse;
+ }
+ return std::bind(safePow, _1, gamma);
+}
+
+static constexpr std::array<float2, 3> computePrimaries(const mat3& rgbToXYZ) {
+ float3 r(rgbToXYZ * float3{1, 0, 0});
+ float3 g(rgbToXYZ * float3{0, 1, 0});
+ float3 b(rgbToXYZ * float3{0, 0, 1});
+
+ return {{r.xy / dot(r, float3{1}),
+ g.xy / dot(g, float3{1}),
+ b.xy / dot(b, float3{1})}};
+}
+
+static constexpr float2 computeWhitePoint(const mat3& rgbToXYZ) {
+ float3 w(rgbToXYZ * float3{1});
+ return w.xy / dot(w, float3{1});
+}
+
+ColorSpace::ColorSpace(
+ const std::string& name,
+ const mat3& rgbToXYZ,
+ transfer_function OETF,
+ transfer_function EOTF,
+ clamping_function clamper) noexcept
+ : mName(name)
+ , mRGBtoXYZ(rgbToXYZ)
+ , mXYZtoRGB(inverse(rgbToXYZ))
+ , mOETF(std::move(OETF))
+ , mEOTF(std::move(EOTF))
+ , mClamper(std::move(clamper))
+ , mPrimaries(computePrimaries(rgbToXYZ))
+ , mWhitePoint(computeWhitePoint(rgbToXYZ)) {
+}
+
+ColorSpace::ColorSpace(
+ const std::string& name,
+ const mat3& rgbToXYZ,
+ const TransferParameters parameters,
+ clamping_function clamper) noexcept
+ : mName(name)
+ , mRGBtoXYZ(rgbToXYZ)
+ , mXYZtoRGB(inverse(rgbToXYZ))
+ , mParameters(parameters)
+ , mOETF(toOETF(mParameters))
+ , mEOTF(toEOTF(mParameters))
+ , mClamper(std::move(clamper))
+ , mPrimaries(computePrimaries(rgbToXYZ))
+ , mWhitePoint(computeWhitePoint(rgbToXYZ)) {
+}
+
+ColorSpace::ColorSpace(
+ const std::string& name,
+ const mat3& rgbToXYZ,
+ float gamma,
+ clamping_function clamper) noexcept
+ : mName(name)
+ , mRGBtoXYZ(rgbToXYZ)
+ , mXYZtoRGB(inverse(rgbToXYZ))
+ , mParameters({gamma, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f})
+ , mOETF(toOETF(gamma))
+ , mEOTF(toEOTF(gamma))
+ , mClamper(std::move(clamper))
+ , mPrimaries(computePrimaries(rgbToXYZ))
+ , mWhitePoint(computeWhitePoint(rgbToXYZ)) {
+}
+
+ColorSpace::ColorSpace(
+ const std::string& name,
+ const std::array<float2, 3>& primaries,
+ const float2& whitePoint,
+ transfer_function OETF,
+ transfer_function EOTF,
+ clamping_function clamper) noexcept
+ : mName(name)
+ , mRGBtoXYZ(computeXYZMatrix(primaries, whitePoint))
+ , mXYZtoRGB(inverse(mRGBtoXYZ))
+ , mOETF(std::move(OETF))
+ , mEOTF(std::move(EOTF))
+ , mClamper(std::move(clamper))
+ , mPrimaries(primaries)
+ , mWhitePoint(whitePoint) {
+}
+
+ColorSpace::ColorSpace(
+ const std::string& name,
+ const std::array<float2, 3>& primaries,
+ const float2& whitePoint,
+ const TransferParameters parameters,
+ clamping_function clamper) noexcept
+ : mName(name)
+ , mRGBtoXYZ(computeXYZMatrix(primaries, whitePoint))
+ , mXYZtoRGB(inverse(mRGBtoXYZ))
+ , mParameters(parameters)
+ , mOETF(toOETF(mParameters))
+ , mEOTF(toEOTF(mParameters))
+ , mClamper(std::move(clamper))
+ , mPrimaries(primaries)
+ , mWhitePoint(whitePoint) {
+}
+
+ColorSpace::ColorSpace(
+ const std::string& name,
+ const std::array<float2, 3>& primaries,
+ const float2& whitePoint,
+ float gamma,
+ clamping_function clamper) noexcept
+ : mName(name)
+ , mRGBtoXYZ(computeXYZMatrix(primaries, whitePoint))
+ , mXYZtoRGB(inverse(mRGBtoXYZ))
+ , mParameters({gamma, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f})
+ , mOETF(toOETF(gamma))
+ , mEOTF(toEOTF(gamma))
+ , mClamper(std::move(clamper))
+ , mPrimaries(primaries)
+ , mWhitePoint(whitePoint) {
+}
+
+constexpr mat3 ColorSpace::computeXYZMatrix(
+ const std::array<float2, 3>& primaries, const float2& whitePoint) {
+ const float2& R = primaries[0];
+ const float2& G = primaries[1];
+ const float2& B = primaries[2];
+ const float2& W = whitePoint;
+
+ float oneRxRy = (1 - R.x) / R.y;
+ float oneGxGy = (1 - G.x) / G.y;
+ float oneBxBy = (1 - B.x) / B.y;
+ float oneWxWy = (1 - W.x) / W.y;
+
+ float RxRy = R.x / R.y;
+ float GxGy = G.x / G.y;
+ float BxBy = B.x / B.y;
+ float WxWy = W.x / W.y;
+
+ float BY =
+ ((oneWxWy - oneRxRy) * (GxGy - RxRy) - (WxWy - RxRy) * (oneGxGy - oneRxRy)) /
+ ((oneBxBy - oneRxRy) * (GxGy - RxRy) - (BxBy - RxRy) * (oneGxGy - oneRxRy));
+ float GY = (WxWy - RxRy - BY * (BxBy - RxRy)) / (GxGy - RxRy);
+ float RY = 1 - GY - BY;
+
+ float RYRy = RY / R.y;
+ float GYGy = GY / G.y;
+ float BYBy = BY / B.y;
+
+ return {
+ float3{RYRy * R.x, RY, RYRy * (1 - R.x - R.y)},
+ float3{GYGy * G.x, GY, GYGy * (1 - G.x - G.y)},
+ float3{BYBy * B.x, BY, BYBy * (1 - B.x - B.y)}
+ };
+}
+
+const ColorSpace ColorSpace::sRGB() {
+ return {
+ "sRGB IEC61966-2.1",
+ {{float2{0.640f, 0.330f}, {0.300f, 0.600f}, {0.150f, 0.060f}}},
+ {0.3127f, 0.3290f},
+ {2.4f, 1 / 1.055f, 0.055f / 1.055f, 1 / 12.92f, 0.04045f, 0.0f, 0.0f}
+ };
+}
+
+const ColorSpace ColorSpace::linearSRGB() {
+ return {
+ "sRGB IEC61966-2.1 (Linear)",
+ {{float2{0.640f, 0.330f}, {0.300f, 0.600f}, {0.150f, 0.060f}}},
+ {0.3127f, 0.3290f}
+ };
+}
+
+const ColorSpace ColorSpace::extendedSRGB() {
+ return {
+ "scRGB-nl IEC 61966-2-2:2003",
+ {{float2{0.640f, 0.330f}, {0.300f, 0.600f}, {0.150f, 0.060f}}},
+ {0.3127f, 0.3290f},
+ std::bind(absRcpResponse, _1, 2.4f, 1 / 1.055f, 0.055f / 1.055f, 1 / 12.92f, 0.04045f),
+ std::bind(absResponse, _1, 2.4f, 1 / 1.055f, 0.055f / 1.055f, 1 / 12.92f, 0.04045f),
+ std::bind(clamp<float>, _1, -0.799f, 2.399f)
+ };
+}
+
+const ColorSpace ColorSpace::linearExtendedSRGB() {
+ return {
+ "scRGB IEC 61966-2-2:2003",
+ {{float2{0.640f, 0.330f}, {0.300f, 0.600f}, {0.150f, 0.060f}}},
+ {0.3127f, 0.3290f},
+ 1.0f,
+ std::bind(clamp<float>, _1, -0.5f, 7.499f)
+ };
+}
+
+const ColorSpace ColorSpace::NTSC() {
+ return {
+ "NTSC (1953)",
+ {{float2{0.67f, 0.33f}, {0.21f, 0.71f}, {0.14f, 0.08f}}},
+ {0.310f, 0.316f},
+ {1 / 0.45f, 1 / 1.099f, 0.099f / 1.099f, 1 / 4.5f, 0.081f, 0.0f, 0.0f}
+ };
+}
+
+const ColorSpace ColorSpace::BT709() {
+ return {
+ "Rec. ITU-R BT.709-5",
+ {{float2{0.640f, 0.330f}, {0.300f, 0.600f}, {0.150f, 0.060f}}},
+ {0.3127f, 0.3290f},
+ {1 / 0.45f, 1 / 1.099f, 0.099f / 1.099f, 1 / 4.5f, 0.081f, 0.0f, 0.0f}
+ };
+}
+
+const ColorSpace ColorSpace::BT2020() {
+ return {
+ "Rec. ITU-R BT.2020-1",
+ {{float2{0.708f, 0.292f}, {0.170f, 0.797f}, {0.131f, 0.046f}}},
+ {0.3127f, 0.3290f},
+ {1 / 0.45f, 1 / 1.099f, 0.099f / 1.099f, 1 / 4.5f, 0.081f, 0.0f, 0.0f}
+ };
+}
+
+const ColorSpace ColorSpace::AdobeRGB() {
+ return {
+ "Adobe RGB (1998)",
+ {{float2{0.64f, 0.33f}, {0.21f, 0.71f}, {0.15f, 0.06f}}},
+ {0.3127f, 0.3290f},
+ 2.2f
+ };
+}
+
+const ColorSpace ColorSpace::ProPhotoRGB() {
+ return {
+ "ROMM RGB ISO 22028-2:2013",
+ {{float2{0.7347f, 0.2653f}, {0.1596f, 0.8404f}, {0.0366f, 0.0001f}}},
+ {0.34567f, 0.35850f},
+ {1.8f, 1.0f, 0.0f, 1 / 16.0f, 0.031248f, 0.0f, 0.0f}
+ };
+}
+
+const ColorSpace ColorSpace::DisplayP3() {
+ return {
+ "Display P3",
+ {{float2{0.680f, 0.320f}, {0.265f, 0.690f}, {0.150f, 0.060f}}},
+ {0.3127f, 0.3290f},
+ {2.4f, 1 / 1.055f, 0.055f / 1.055f, 1 / 12.92f, 0.039f, 0.0f, 0.0f}
+ };
+}
+
+const ColorSpace ColorSpace::DCIP3() {
+ return {
+ "SMPTE RP 431-2-2007 DCI (P3)",
+ {{float2{0.680f, 0.320f}, {0.265f, 0.690f}, {0.150f, 0.060f}}},
+ {0.314f, 0.351f},
+ 2.6f
+ };
+}
+
+const ColorSpace ColorSpace::ACES() {
+ return {
+ "SMPTE ST 2065-1:2012 ACES",
+ {{float2{0.73470f, 0.26530f}, {0.0f, 1.0f}, {0.00010f, -0.0770f}}},
+ {0.32168f, 0.33767f},
+ 1.0f,
+ std::bind(clamp<float>, _1, -65504.0f, 65504.0f)
+ };
+}
+
+const ColorSpace ColorSpace::ACEScg() {
+ return {
+ "Academy S-2014-004 ACEScg",
+ {{float2{0.713f, 0.293f}, {0.165f, 0.830f}, {0.128f, 0.044f}}},
+ {0.32168f, 0.33767f},
+ 1.0f,
+ std::bind(clamp<float>, _1, -65504.0f, 65504.0f)
+ };
+}
+
+std::unique_ptr<float3[]> ColorSpace::createLUT(uint32_t size, const ColorSpace& src,
+ const ColorSpace& dst) {
+ size = clamp(size, 2u, 256u);
+ float m = 1.0f / float(size - 1);
+
+ std::unique_ptr<float3[]> lut(new float3[size * size * size]);
+ float3* data = lut.get();
+
+ ColorSpaceConnector connector(src, dst);
+
+ for (uint32_t z = 0; z < size; z++) {
+ for (int32_t y = int32_t(size - 1); y >= 0; y--) {
+ for (uint32_t x = 0; x < size; x++) {
+ *data++ = connector.transform({x * m, y * m, z * m});
+ }
+ }
+ }
+
+ return lut;
+}
+
+static const float2 ILLUMINANT_D50_XY = {0.34567f, 0.35850f};
+static const float3 ILLUMINANT_D50_XYZ = {0.964212f, 1.0f, 0.825188f};
+static const mat3 BRADFORD = mat3{
+ float3{ 0.8951f, -0.7502f, 0.0389f},
+ float3{ 0.2664f, 1.7135f, -0.0685f},
+ float3{-0.1614f, 0.0367f, 1.0296f}
+};
+
+static mat3 adaptation(const mat3& matrix, const float3& srcWhitePoint, const float3& dstWhitePoint) {
+ float3 srcLMS = matrix * srcWhitePoint;
+ float3 dstLMS = matrix * dstWhitePoint;
+ return inverse(matrix) * mat3{dstLMS / srcLMS} * matrix;
+}
+
+ColorSpaceConnector::ColorSpaceConnector(
+ const ColorSpace& src,
+ const ColorSpace& dst) noexcept
+ : mSource(src)
+ , mDestination(dst) {
+
+ if (all(lessThan(abs(src.getWhitePoint() - dst.getWhitePoint()), float2{1e-3f}))) {
+ mTransform = dst.getXYZtoRGB() * src.getRGBtoXYZ();
+ } else {
+ mat3 rgbToXYZ(src.getRGBtoXYZ());
+ mat3 xyzToRGB(dst.getXYZtoRGB());
+
+ float3 srcXYZ = ColorSpace::XYZ(float3{src.getWhitePoint(), 1});
+ float3 dstXYZ = ColorSpace::XYZ(float3{dst.getWhitePoint(), 1});
+
+ if (any(greaterThan(abs(src.getWhitePoint() - ILLUMINANT_D50_XY), float2{1e-3f}))) {
+ rgbToXYZ = adaptation(BRADFORD, srcXYZ, ILLUMINANT_D50_XYZ) * src.getRGBtoXYZ();
+ }
+
+ if (any(greaterThan(abs(dst.getWhitePoint() - ILLUMINANT_D50_XY), float2{1e-3f}))) {
+ xyzToRGB = inverse(adaptation(BRADFORD, dstXYZ, ILLUMINANT_D50_XYZ) * dst.getRGBtoXYZ());
+ }
+
+ mTransform = xyzToRGB * rgbToXYZ;
+ }
+}
+
+}; // namespace android
diff --git a/libs/hwui/utils/LinearAllocator.h b/libs/hwui/utils/LinearAllocator.h
index 9c4a1be4b269..539e6544ef02 100644
--- a/libs/hwui/utils/LinearAllocator.h
+++ b/libs/hwui/utils/LinearAllocator.h
@@ -115,6 +115,7 @@ public:
* wasted)
*/
size_t usedSize() const { return mTotalAllocated - mWastedSpace; }
+ size_t allocatedSize() const { return mTotalAllocated; }
private:
LinearAllocator(const LinearAllocator& other);
diff --git a/libs/hwui/utils/PaintUtils.h b/libs/hwui/utils/PaintUtils.h
index ebf2343c5518..e2fdf2fcb5a5 100644
--- a/libs/hwui/utils/PaintUtils.h
+++ b/libs/hwui/utils/PaintUtils.h
@@ -67,29 +67,6 @@ public:
return (filter->getFlags() & SkColorFilter::kAlphaUnchanged_Flag) == 0;
}
- struct TextShadow {
- SkScalar radius;
- float dx;
- float dy;
- SkColor color;
- };
-
- static inline bool getTextShadow(const SkPaint* paint, TextShadow* textShadow) {
- SkDrawLooper::BlurShadowRec blur;
- if (paint && paint->getLooper() && paint->getLooper()->asABlurShadow(&blur)) {
- if (textShadow) {
- textShadow->radius = Blur::convertSigmaToRadius(blur.fSigma);
- textShadow->dx = blur.fOffset.fX;
- textShadow->dy = blur.fOffset.fY;
- textShadow->color = blur.fColor;
- }
- return true;
- }
- return false;
- }
-
- static inline bool hasTextShadow(const SkPaint* paint) { return getTextShadow(paint, nullptr); }
-
static inline SkBlendMode getBlendModeDirect(const SkPaint* paint) {
return paint ? paint->getBlendMode() : SkBlendMode::kSrcOver;
}
diff --git a/libs/hwui/utils/TraceUtils.h b/libs/hwui/utils/TraceUtils.h
index 1869d00396c0..e61b4be1784e 100644
--- a/libs/hwui/utils/TraceUtils.h
+++ b/libs/hwui/utils/TraceUtils.h
@@ -16,6 +16,7 @@
#ifndef TRACE_UTILS_H
#define TRACE_UTILS_H
+#include <cutils/trace.h>
#include <utils/Trace.h>
#define ATRACE_FORMAT(fmt, ...) \
diff --git a/libs/input/Android.bp b/libs/input/Android.bp
index 89d3cc4f5083..6bb896fd7b29 100644
--- a/libs/input/Android.bp
+++ b/libs/input/Android.bp
@@ -20,10 +20,11 @@ cc_library_shared {
],
shared_libs: [
+ "libandroid_runtime",
+ "libbinder",
"libcutils",
"liblog",
"libutils",
- "libhwui",
"libgui",
"libui",
"libinput",
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index abf083789c23..e4348f2a9b21 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -24,12 +24,6 @@
#include <log/log.h>
-#include <SkBitmap.h>
-#include <SkCanvas.h>
-#include <SkColor.h>
-#include <SkPaint.h>
-#include <SkBlendMode.h>
-
namespace android {
// --- WeakLooperCallback ---
diff --git a/libs/input/SpriteController.cpp b/libs/input/SpriteController.cpp
index c1868d3a94d6..804644c230b9 100644
--- a/libs/input/SpriteController.cpp
+++ b/libs/input/SpriteController.cpp
@@ -23,11 +23,9 @@
#include <utils/String8.h>
#include <gui/Surface.h>
-#include <SkBitmap.h>
-#include <SkCanvas.h>
-#include <SkColor.h>
-#include <SkPaint.h>
-
+#include <android/graphics/bitmap.h>
+#include <android/graphics/canvas.h>
+#include <android/graphics/paint.h>
#include <android/native_window.h>
namespace android {
@@ -132,8 +130,8 @@ void SpriteController::doUpdateSprites() {
SpriteUpdate& update = updates.editItemAt(i);
if (update.state.surfaceControl == NULL && update.state.wantSurfaceVisible()) {
- update.state.surfaceWidth = update.state.icon.bitmap.width();
- update.state.surfaceHeight = update.state.icon.bitmap.height();
+ update.state.surfaceWidth = update.state.icon.bitmap.getInfo().width;
+ update.state.surfaceHeight = update.state.icon.bitmap.getInfo().height;
update.state.surfaceDrawn = false;
update.state.surfaceVisible = false;
update.state.surfaceControl = obtainSurface(
@@ -154,8 +152,8 @@ void SpriteController::doUpdateSprites() {
}
if (update.state.wantSurfaceVisible()) {
- int32_t desiredWidth = update.state.icon.bitmap.width();
- int32_t desiredHeight = update.state.icon.bitmap.height();
+ int32_t desiredWidth = update.state.icon.bitmap.getInfo().width;
+ int32_t desiredHeight = update.state.icon.bitmap.getInfo().height;
if (update.state.surfaceWidth < desiredWidth
|| update.state.surfaceHeight < desiredHeight) {
needApplyTransaction = true;
@@ -201,26 +199,22 @@ void SpriteController::doUpdateSprites() {
if (status) {
ALOGE("Error %d locking sprite surface before drawing.", status);
} else {
- SkBitmap surfaceBitmap;
- ssize_t bpr = outBuffer.stride * bytesPerPixel(outBuffer.format);
- surfaceBitmap.installPixels(SkImageInfo::MakeN32Premul(outBuffer.width, outBuffer.height),
- outBuffer.bits, bpr);
+ graphics::Paint paint;
+ paint.setBlendMode(ABLEND_MODE_SRC);
- SkCanvas surfaceCanvas(surfaceBitmap);
+ graphics::Canvas canvas(outBuffer, (int32_t) surface->getBuffersDataSpace());
+ canvas.drawBitmap(update.state.icon.bitmap, 0, 0, &paint);
- SkPaint paint;
- paint.setBlendMode(SkBlendMode::kSrc);
- surfaceCanvas.drawBitmap(update.state.icon.bitmap, 0, 0, &paint);
+ const int iconWidth = update.state.icon.bitmap.getInfo().width;
+ const int iconHeight = update.state.icon.bitmap.getInfo().height;
- if (outBuffer.width > update.state.icon.bitmap.width()) {
- paint.setColor(0); // transparent fill color
- surfaceCanvas.drawRect(SkRect::MakeLTRB(update.state.icon.bitmap.width(), 0,
- outBuffer.width, update.state.icon.bitmap.height()), paint);
+ if (outBuffer.width > iconWidth) {
+ paint.setBlendMode(ABLEND_MODE_CLEAR); // clear to transparent
+ canvas.drawRect({iconWidth, 0, outBuffer.width, iconHeight}, paint);
}
- if (outBuffer.height > update.state.icon.bitmap.height()) {
- paint.setColor(0); // transparent fill color
- surfaceCanvas.drawRect(SkRect::MakeLTRB(0, update.state.icon.bitmap.height(),
- outBuffer.width, outBuffer.height), paint);
+ if (outBuffer.height > iconHeight) {
+ paint.setBlendMode(ABLEND_MODE_CLEAR); // clear to transparent
+ canvas.drawRect({0, iconHeight, outBuffer.width, outBuffer.height}, paint);
}
status = surface->unlockAndPost();
@@ -245,7 +239,8 @@ void SpriteController::doUpdateSprites() {
if (update.state.surfaceControl != NULL && (becomingVisible || becomingHidden
|| (wantSurfaceVisibleAndDrawn && (update.state.dirty & (DIRTY_ALPHA
| DIRTY_POSITION | DIRTY_TRANSFORMATION_MATRIX | DIRTY_LAYER
- | DIRTY_VISIBILITY | DIRTY_HOTSPOT | DIRTY_DISPLAY_ID))))) {
+ | DIRTY_VISIBILITY | DIRTY_HOTSPOT | DIRTY_DISPLAY_ID
+ | DIRTY_ICON_STYLE))))) {
needApplyTransaction = true;
if (wantSurfaceVisibleAndDrawn
@@ -274,6 +269,21 @@ void SpriteController::doUpdateSprites() {
update.state.transformationMatrix.dtdy);
}
+ if (wantSurfaceVisibleAndDrawn
+ && (becomingVisible
+ || (update.state.dirty & (DIRTY_HOTSPOT | DIRTY_ICON_STYLE)))) {
+ Parcel p;
+ p.writeInt32(update.state.icon.style);
+ p.writeFloat(update.state.icon.hotSpotX);
+ p.writeFloat(update.state.icon.hotSpotY);
+
+ // Pass cursor metadata in the sprite surface so that when Android is running as a
+ // client OS (e.g. ARC++) the host OS can get the requested cursor metadata and
+ // update mouse cursor in the host OS.
+ t.setMetadata(
+ update.state.surfaceControl, METADATA_MOUSE_CURSOR, p);
+ }
+
int32_t surfaceLayer = mOverlayLayer + update.state.layer;
if (wantSurfaceVisibleAndDrawn
&& (becomingVisible || (update.state.dirty & DIRTY_LAYER))) {
@@ -382,12 +392,7 @@ void SpriteController::SpriteImpl::setIcon(const SpriteIcon& icon) {
uint32_t dirty;
if (icon.isValid()) {
- SkBitmap* bitmapCopy = &mLocked.state.icon.bitmap;
- if (bitmapCopy->tryAllocPixels(icon.bitmap.info().makeColorType(kN32_SkColorType))) {
- icon.bitmap.readPixels(bitmapCopy->info(), bitmapCopy->getPixels(),
- bitmapCopy->rowBytes(), 0, 0);
- }
-
+ mLocked.state.icon.bitmap = icon.bitmap.copy(ANDROID_BITMAP_FORMAT_RGBA_8888);
if (!mLocked.state.icon.isValid()
|| mLocked.state.icon.hotSpotX != icon.hotSpotX
|| mLocked.state.icon.hotSpotY != icon.hotSpotY) {
@@ -397,9 +402,14 @@ void SpriteController::SpriteImpl::setIcon(const SpriteIcon& icon) {
} else {
dirty = DIRTY_BITMAP;
}
+
+ if (mLocked.state.icon.style != icon.style) {
+ mLocked.state.icon.style = icon.style;
+ dirty |= DIRTY_ICON_STYLE;
+ }
} else if (mLocked.state.icon.isValid()) {
mLocked.state.icon.bitmap.reset();
- dirty = DIRTY_BITMAP | DIRTY_HOTSPOT;
+ dirty = DIRTY_BITMAP | DIRTY_HOTSPOT | DIRTY_ICON_STYLE;
} else {
return; // setting to invalid icon and already invalid so nothing to do
}
diff --git a/libs/input/SpriteController.h b/libs/input/SpriteController.h
index 5b216f50d113..2513544d4bdf 100644
--- a/libs/input/SpriteController.h
+++ b/libs/input/SpriteController.h
@@ -20,10 +20,9 @@
#include <utils/RefBase.h>
#include <utils/Looper.h>
+#include <android/graphics/bitmap.h>
#include <gui/SurfaceComposerClient.h>
-#include <SkBitmap.h>
-
namespace android {
/*
@@ -55,31 +54,28 @@ struct SpriteTransformationMatrix {
* Icon that a sprite displays, including its hotspot.
*/
struct SpriteIcon {
- inline SpriteIcon() : hotSpotX(0), hotSpotY(0) { }
- inline SpriteIcon(const SkBitmap& bitmap, float hotSpotX, float hotSpotY) :
- bitmap(bitmap), hotSpotX(hotSpotX), hotSpotY(hotSpotY) { }
+ inline SpriteIcon() : style(0), hotSpotX(0), hotSpotY(0) { }
+ inline SpriteIcon(const graphics::Bitmap& bitmap, int32_t style, float hotSpotX, float hotSpotY) :
+ bitmap(bitmap), style(style), hotSpotX(hotSpotX), hotSpotY(hotSpotY) { }
- SkBitmap bitmap;
+ graphics::Bitmap bitmap;
+ int32_t style;
float hotSpotX;
float hotSpotY;
inline SpriteIcon copy() const {
- SkBitmap bitmapCopy;
- if (bitmapCopy.tryAllocPixels(bitmap.info().makeColorType(kN32_SkColorType))) {
- bitmap.readPixels(bitmapCopy.info(), bitmapCopy.getPixels(), bitmapCopy.rowBytes(),
- 0, 0);
- }
- return SpriteIcon(bitmapCopy, hotSpotX, hotSpotY);
+ return SpriteIcon(bitmap.copy(ANDROID_BITMAP_FORMAT_RGBA_8888), style, hotSpotX, hotSpotY);
}
inline void reset() {
bitmap.reset();
+ style = 0;
hotSpotX = 0;
hotSpotY = 0;
}
inline bool isValid() const {
- return !bitmap.isNull() && !bitmap.empty();
+ return bitmap.isValid() && !bitmap.isEmpty();
}
};
@@ -149,15 +145,15 @@ public:
SpriteController(const sp<Looper>& looper, int32_t overlayLayer);
/* Creates a new sprite, initially invisible. */
- sp<Sprite> createSprite();
+ virtual sp<Sprite> createSprite();
/* Opens or closes a transaction to perform a batch of sprite updates as part of
* a single operation such as setPosition and setAlpha. It is not necessary to
* open a transaction when updating a single property.
* Calls to openTransaction() nest and must be matched by an equal number
* of calls to closeTransaction(). */
- void openTransaction();
- void closeTransaction();
+ virtual void openTransaction();
+ virtual void closeTransaction();
private:
enum {
@@ -174,13 +170,14 @@ private:
DIRTY_VISIBILITY = 1 << 5,
DIRTY_HOTSPOT = 1 << 6,
DIRTY_DISPLAY_ID = 1 << 7,
+ DIRTY_ICON_STYLE = 1 << 8,
};
/* Describes the state of a sprite.
* This structure is designed so that it can be copied during updates so that
* surfaces can be resized and redrawn without blocking the client by holding a lock
* on the sprites for a long time.
- * Note that the SkBitmap holds a reference to a shared (and immutable) pixel ref. */
+ * Note that the SpriteIcon holds a reference to a shared (and immutable) bitmap. */
struct SpriteState {
inline SpriteState() :
dirty(0), visible(false),
diff --git a/libs/input/TEST_MAPPING b/libs/input/TEST_MAPPING
new file mode 100644
index 000000000000..fe74c62d4ec1
--- /dev/null
+++ b/libs/input/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+ "presubmit": [
+ {
+ "name": "libinputservice_test"
+ }
+ ]
+}
diff --git a/libs/input/tests/Android.bp b/libs/input/tests/Android.bp
new file mode 100644
index 000000000000..b1e3d6fe845a
--- /dev/null
+++ b/libs/input/tests/Android.bp
@@ -0,0 +1,45 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+cc_test {
+ name: "libinputservice_test",
+ srcs: [
+ "PointerController_test.cpp",
+ ],
+ shared_libs: [
+ "libandroid_runtime",
+ "libinputservice",
+ "libgui",
+ "libutils",
+ ],
+ static_libs: [
+ "libgmock",
+ "libgtest",
+ ],
+ header_libs: [
+ "libbase_headers",
+ "libinputflinger_headers",
+ ],
+ include_dirs: [
+ "frameworks/base/libs",
+ ],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ ],
+ test_suites: [
+ "general-tests",
+ ],
+}
diff --git a/libs/input/tests/PointerController_test.cpp b/libs/input/tests/PointerController_test.cpp
new file mode 100644
index 000000000000..92efb4ea86ff
--- /dev/null
+++ b/libs/input/tests/PointerController_test.cpp
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 "mocks/MockSprite.h"
+#include "mocks/MockSpriteController.h"
+
+#include <input/PointerController.h>
+#include <input/SpriteController.h>
+
+#include <atomic>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <thread>
+
+namespace android {
+
+enum TestCursorType {
+ CURSOR_TYPE_DEFAULT = 0,
+ CURSOR_TYPE_HOVER,
+ CURSOR_TYPE_TOUCH,
+ CURSOR_TYPE_ANCHOR,
+ CURSOR_TYPE_ADDITIONAL_1,
+ CURSOR_TYPE_ADDITIONAL_2,
+ CURSOR_TYPE_CUSTOM = -1,
+};
+
+using ::testing::AllOf;
+using ::testing::Field;
+using ::testing::NiceMock;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::Test;
+
+std::pair<float, float> getHotSpotCoordinatesForType(int32_t type) {
+ return std::make_pair(type * 10, type * 10 + 5);
+}
+
+class MockPointerControllerPolicyInterface : public PointerControllerPolicyInterface {
+public:
+ virtual void loadPointerIcon(SpriteIcon* icon, int32_t displayId) override;
+ virtual void loadPointerResources(PointerResources* outResources, int32_t displayId) override;
+ virtual void loadAdditionalMouseResources(std::map<int32_t, SpriteIcon>* outResources,
+ std::map<int32_t, PointerAnimation>* outAnimationResources, int32_t displayId) override;
+ virtual int32_t getDefaultPointerIconId() override;
+ virtual int32_t getCustomPointerIconId() override;
+
+private:
+ void loadPointerIconForType(SpriteIcon* icon, int32_t cursorType);
+};
+
+void MockPointerControllerPolicyInterface::loadPointerIcon(SpriteIcon* icon, int32_t) {
+ loadPointerIconForType(icon, CURSOR_TYPE_DEFAULT);
+}
+
+void MockPointerControllerPolicyInterface::loadPointerResources(PointerResources* outResources,
+ int32_t) {
+ loadPointerIconForType(&outResources->spotHover, CURSOR_TYPE_HOVER);
+ loadPointerIconForType(&outResources->spotTouch, CURSOR_TYPE_TOUCH);
+ loadPointerIconForType(&outResources->spotAnchor, CURSOR_TYPE_ANCHOR);
+}
+
+void MockPointerControllerPolicyInterface::loadAdditionalMouseResources(
+ std::map<int32_t, SpriteIcon>* outResources,
+ std::map<int32_t, PointerAnimation>* outAnimationResources,
+ int32_t) {
+ SpriteIcon icon;
+ PointerAnimation anim;
+
+ for (int32_t cursorType : {CURSOR_TYPE_ADDITIONAL_1, CURSOR_TYPE_ADDITIONAL_2}) {
+ loadPointerIconForType(&icon, cursorType);
+ anim.animationFrames.push_back(icon);
+ anim.durationPerFrame = 10;
+ (*outResources)[cursorType] = icon;
+ (*outAnimationResources)[cursorType] = anim;
+ }
+}
+
+int32_t MockPointerControllerPolicyInterface::getDefaultPointerIconId() {
+ return CURSOR_TYPE_DEFAULT;
+}
+
+int32_t MockPointerControllerPolicyInterface::getCustomPointerIconId() {
+ return CURSOR_TYPE_CUSTOM;
+}
+
+void MockPointerControllerPolicyInterface::loadPointerIconForType(SpriteIcon* icon, int32_t type) {
+ icon->style = type;
+ std::pair<float, float> hotSpot = getHotSpotCoordinatesForType(type);
+ icon->hotSpotX = hotSpot.first;
+ icon->hotSpotY = hotSpot.second;
+}
+
+class PointerControllerTest : public Test {
+protected:
+ PointerControllerTest();
+ ~PointerControllerTest();
+
+ sp<MockSprite> mPointerSprite;
+ sp<MockPointerControllerPolicyInterface> mPolicy;
+ sp<MockSpriteController> mSpriteController;
+ sp<PointerController> mPointerController;
+
+private:
+ void loopThread();
+
+ std::atomic<bool> mRunning = true;
+ class MyLooper : public Looper {
+ public:
+ MyLooper() : Looper(false) {}
+ ~MyLooper() = default;
+ };
+ sp<MyLooper> mLooper;
+ std::thread mThread;
+};
+
+PointerControllerTest::PointerControllerTest() : mPointerSprite(new NiceMock<MockSprite>),
+ mLooper(new MyLooper), mThread(&PointerControllerTest::loopThread, this) {
+
+ mSpriteController = new NiceMock<MockSpriteController>(mLooper);
+ mPolicy = new MockPointerControllerPolicyInterface();
+
+ EXPECT_CALL(*mSpriteController, createSprite())
+ .WillOnce(Return(mPointerSprite));
+
+ mPointerController = new PointerController(mPolicy, mLooper, mSpriteController);
+
+ DisplayViewport viewport;
+ viewport.displayId = ADISPLAY_ID_DEFAULT;
+ viewport.logicalRight = 1600;
+ viewport.logicalBottom = 1200;
+ viewport.physicalRight = 800;
+ viewport.physicalBottom = 600;
+ viewport.deviceWidth = 400;
+ viewport.deviceHeight = 300;
+ mPointerController->setDisplayViewport(viewport);
+}
+
+PointerControllerTest::~PointerControllerTest() {
+ mRunning.store(false, std::memory_order_relaxed);
+ mThread.join();
+}
+
+void PointerControllerTest::loopThread() {
+ Looper::setForThread(mLooper);
+
+ while (mRunning.load(std::memory_order_relaxed)) {
+ mLooper->pollOnce(100);
+ }
+}
+
+TEST_F(PointerControllerTest, useDefaultCursorTypeByDefault) {
+ mPointerController->unfade(PointerController::TRANSITION_IMMEDIATE);
+
+ std::pair<float, float> hotspot = getHotSpotCoordinatesForType(CURSOR_TYPE_DEFAULT);
+ EXPECT_CALL(*mPointerSprite, setVisible(true));
+ EXPECT_CALL(*mPointerSprite, setAlpha(1.0f));
+ EXPECT_CALL(*mPointerSprite, setIcon(
+ AllOf(
+ Field(&SpriteIcon::style, CURSOR_TYPE_DEFAULT),
+ Field(&SpriteIcon::hotSpotX, hotspot.first),
+ Field(&SpriteIcon::hotSpotY, hotspot.second))));
+ mPointerController->reloadPointerResources();
+}
+
+TEST_F(PointerControllerTest, updatePointerIcon) {
+ mPointerController->unfade(PointerController::TRANSITION_IMMEDIATE);
+
+ int32_t type = CURSOR_TYPE_ADDITIONAL_1;
+ std::pair<float, float> hotspot = getHotSpotCoordinatesForType(type);
+ EXPECT_CALL(*mPointerSprite, setVisible(true));
+ EXPECT_CALL(*mPointerSprite, setAlpha(1.0f));
+ EXPECT_CALL(*mPointerSprite, setIcon(
+ AllOf(
+ Field(&SpriteIcon::style, type),
+ Field(&SpriteIcon::hotSpotX, hotspot.first),
+ Field(&SpriteIcon::hotSpotY, hotspot.second))));
+ mPointerController->updatePointerIcon(type);
+}
+
+TEST_F(PointerControllerTest, setCustomPointerIcon) {
+ mPointerController->unfade(PointerController::TRANSITION_IMMEDIATE);
+
+ int32_t style = CURSOR_TYPE_CUSTOM;
+ float hotSpotX = 15;
+ float hotSpotY = 20;
+
+ SpriteIcon icon;
+ icon.style = style;
+ icon.hotSpotX = hotSpotX;
+ icon.hotSpotY = hotSpotY;
+
+ EXPECT_CALL(*mPointerSprite, setVisible(true));
+ EXPECT_CALL(*mPointerSprite, setAlpha(1.0f));
+ EXPECT_CALL(*mPointerSprite, setIcon(
+ AllOf(
+ Field(&SpriteIcon::style, style),
+ Field(&SpriteIcon::hotSpotX, hotSpotX),
+ Field(&SpriteIcon::hotSpotY, hotSpotY))));
+ mPointerController->setCustomPointerIcon(icon);
+}
+
+} // namespace android
diff --git a/libs/input/tests/mocks/MockSprite.h b/libs/input/tests/mocks/MockSprite.h
new file mode 100644
index 000000000000..013b79c3a3bf
--- /dev/null
+++ b/libs/input/tests/mocks/MockSprite.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _MOCK_SPRITE_H
+#define _MOCK_SPRITE_H
+
+#include <input/SpriteController.h>
+
+#include <gmock/gmock.h>
+
+namespace android {
+
+class MockSprite : public Sprite {
+public:
+ virtual ~MockSprite() = default;
+
+ MOCK_METHOD(void, setIcon, (const SpriteIcon& icon), (override));
+ MOCK_METHOD(void, setVisible, (bool), (override));
+ MOCK_METHOD(void, setPosition, (float, float), (override));
+ MOCK_METHOD(void, setLayer, (int32_t), (override));
+ MOCK_METHOD(void, setAlpha, (float), (override));
+ MOCK_METHOD(void, setTransformationMatrix, (const SpriteTransformationMatrix&), (override));
+ MOCK_METHOD(void, setDisplayId, (int32_t), (override));
+};
+
+} // namespace android
+
+#endif // _MOCK_SPRITE_H
diff --git a/libs/hwui/debug/MockGlesDriver.h b/libs/input/tests/mocks/MockSpriteController.h
index e48ca193d48f..a034f66c9abf 100644
--- a/libs/hwui/debug/MockGlesDriver.h
+++ b/libs/input/tests/mocks/MockSpriteController.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,24 +14,26 @@
* limitations under the License.
*/
-#pragma once
+#ifndef _MOCK_SPRITE_CONTROLLER_H
+#define _MOCK_SPRITE_CONTROLLER_H
-#include "FatalBaseDriver.h"
+#include "MockSprite.h"
-#include <gmock/gmock.h>
+#include <input/SpriteController.h>
namespace android {
-namespace uirenderer {
-namespace debug {
-class MockGlesDriver : public FatalBaseDriver {
+class MockSpriteController : public SpriteController {
+
public:
- MOCK_METHOD2(glBindBuffer_, void(GLenum target, GLuint buffer));
- MOCK_METHOD4(glBufferData_,
- void(GLenum target, GLsizeiptr size, const void* data, GLenum usage));
- MOCK_METHOD2(glGenBuffers_, void(GLsizei n, GLuint* buffers));
+ MockSpriteController(sp<Looper> looper) : SpriteController(looper, 0) {}
+ ~MockSpriteController() {}
+
+ MOCK_METHOD(sp<Sprite>, createSprite, (), (override));
+ MOCK_METHOD(void, openTransaction, (), (override));
+ MOCK_METHOD(void, closeTransaction, (), (override));
};
-} // namespace debug
-} // namespace uirenderer
} // namespace android
+
+#endif // _MOCK_SPRITE_CONTROLLER_H