'SK_BUILD_FOR_ANDROID_FRAMEWORK',
'SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)',
'SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)',
- 'SK_IGNORE_ETC1_SUPPORT',
'SK_USE_FREETYPE_EMBOLDEN',
])
# TODO: move these all to android_framework_defines.gni?
#include "effects/GrPorterDuffXferProcessor.h"
#include "effects/GrXfermodeFragmentProcessor.h"
-#ifndef SK_IGNORE_ETC1_SUPPORT
-# include "etc1.h"
-#endif
-
GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo& info, const GrCaps& caps) {
GrSurfaceDesc desc;
desc.fFlags = kNone_GrSurfaceFlags;
builder[4] = imageBounds.fBottom;
}
-GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data,
- int expectedW, int expectedH,
- const void** outStartOfDataToUpload) {
- *outStartOfDataToUpload = nullptr;
-#ifndef SK_IGNORE_ETC1_SUPPORT
- if (!ctx->caps()->isConfigTexturable(kETC1_GrPixelConfig)) {
- return kUnknown_GrPixelConfig;
- }
-
- const uint8_t* bytes = data->bytes();
- if (data->size() > ETC_PKM_HEADER_SIZE && etc1_pkm_is_valid(bytes)) {
- // Does the data match the dimensions of the bitmap? If not,
- // then we don't know how to scale the image to match it...
- if (etc1_pkm_get_width(bytes) != (unsigned)expectedW ||
- etc1_pkm_get_height(bytes) != (unsigned)expectedH)
- {
- return kUnknown_GrPixelConfig;
- }
-
- *outStartOfDataToUpload = bytes + ETC_PKM_HEADER_SIZE;
- return kETC1_GrPixelConfig;
- }
-#endif
- return kUnknown_GrPixelConfig;
-}
-
//////////////////////////////////////////////////////////////////////////////
sk_sp<GrTextureProxy> GrUploadBitmapToTextureProxy(GrResourceProvider* resourceProvider,
const SkBitmap& bitmap) {
to use. */
GrPixelConfig GrRenderableConfigForColorSpace(const SkColorSpace*);
-/**
- * If the compressed data in the SkData is supported (as a texture format, this returns
- * the pixel-config that should be used, and sets outStartOfDataToUpload to the ptr into
- * the data where the actual raw data starts (skipping any header bytes).
- *
- * If the compressed data is not supported, this returns kUnknown_GrPixelConfig, and
- * ignores outStartOfDataToUpload.
- */
-GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data,
- int expectedW, int expectedH,
- const void** outStartOfDataToUpload);
-
-
-
#endif