Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11addb2a authored by Sally Qi's avatar Sally Qi Committed by Android (Google) Code Review
Browse files

Merge "Migrate HWUI logs from SkDebugf to ALOGD"

parents 56685c88 7e3f93bc
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -20,6 +20,8 @@
#include "utils/Color.h"
#include "utils/Color.h"
#include "utils/MathUtils.h"
#include "utils/MathUtils.h"


#include <log/log.h>

namespace android {
namespace android {
namespace uirenderer {
namespace uirenderer {


@@ -90,7 +92,7 @@ static bool shouldFilterRect(const SkMatrix& matrix, const SkRect& srcRect, cons
void Layer::draw(SkCanvas* canvas) {
void Layer::draw(SkCanvas* canvas) {
    GrRecordingContext* context = canvas->recordingContext();
    GrRecordingContext* context = canvas->recordingContext();
    if (context == nullptr) {
    if (context == nullptr) {
        SkDEBUGF(("Attempting to draw LayerDrawable into an unsupported surface"));
        ALOGD("Attempting to draw LayerDrawable into an unsupported surface");
        return;
        return;
    }
    }
    SkMatrix layerTransform = getTransform();
    SkMatrix layerTransform = getTransform();
+1 −1
Original line number Original line Diff line number Diff line
@@ -873,7 +873,7 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject,
                                     jlong bitmapHandle, jint density, jobject parcel) {
                                     jlong bitmapHandle, jint density, jobject parcel) {
#ifdef __ANDROID__ // Layoutlib does not support parcel
#ifdef __ANDROID__ // Layoutlib does not support parcel
    if (parcel == NULL) {
    if (parcel == NULL) {
        SkDebugf("------- writeToParcel null parcel\n");
        ALOGD("------- writeToParcel null parcel\n");
        return JNI_FALSE;
        return JNI_FALSE;
    }
    }


+5 −5
Original line number Original line Diff line number Diff line
@@ -107,7 +107,7 @@ private:
            jint n = env->CallIntMethod(fJavaInputStream,
            jint n = env->CallIntMethod(fJavaInputStream,
                                        gInputStream_readMethodID, fJavaByteArray, 0, requested);
                                        gInputStream_readMethodID, fJavaByteArray, 0, requested);
            if (checkException(env)) {
            if (checkException(env)) {
                SkDebugf("---- read threw an exception\n");
                ALOGD("---- read threw an exception\n");
                return bytesRead;
                return bytesRead;
            }
            }


@@ -119,7 +119,7 @@ private:
            env->GetByteArrayRegion(fJavaByteArray, 0, n,
            env->GetByteArrayRegion(fJavaByteArray, 0, n,
                                    reinterpret_cast<jbyte*>(buffer));
                                    reinterpret_cast<jbyte*>(buffer));
            if (checkException(env)) {
            if (checkException(env)) {
                SkDebugf("---- read:GetByteArrayRegion threw an exception\n");
                ALOGD("---- read:GetByteArrayRegion threw an exception\n");
                return bytesRead;
                return bytesRead;
            }
            }


@@ -136,7 +136,7 @@ private:
        jlong skipped = env->CallLongMethod(fJavaInputStream,
        jlong skipped = env->CallLongMethod(fJavaInputStream,
                                            gInputStream_skipMethodID, (jlong)size);
                                            gInputStream_skipMethodID, (jlong)size);
        if (checkException(env)) {
        if (checkException(env)) {
            SkDebugf("------- skip threw an exception\n");
            ALOGD("------- skip threw an exception\n");
            return 0;
            return 0;
        }
        }
        if (skipped < 0) {
        if (skipped < 0) {
@@ -236,7 +236,7 @@ public:
            if (env->ExceptionCheck()) {
            if (env->ExceptionCheck()) {
                env->ExceptionDescribe();
                env->ExceptionDescribe();
                env->ExceptionClear();
                env->ExceptionClear();
                SkDebugf("--- write:SetByteArrayElements threw an exception\n");
                ALOGD("--- write:SetByteArrayElements threw an exception\n");
                return false;
                return false;
            }
            }


@@ -245,7 +245,7 @@ public:
            if (env->ExceptionCheck()) {
            if (env->ExceptionCheck()) {
                env->ExceptionDescribe();
                env->ExceptionDescribe();
                env->ExceptionClear();
                env->ExceptionClear();
                SkDebugf("------- write threw an exception\n");
                ALOGD("------- write threw an exception\n");
                return false;
                return false;
            }
            }


+3 −1
Original line number Original line Diff line number Diff line
@@ -15,6 +15,8 @@


#include "gif_lib.h"
#include "gif_lib.h"


#include <log/log.h>

#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
#define DGifCloseFile(a, b) DGifCloseFile(a)
#define DGifCloseFile(a, b) DGifCloseFile(a)
#endif
#endif
@@ -244,7 +246,7 @@ static void drawFrame(SkBitmap* bm, const SavedImage* frame, const ColorMapObjec
    }
    }


    if (cmap == nullptr || cmap->ColorCount != (1 << cmap->BitsPerPixel)) {
    if (cmap == nullptr || cmap->ColorCount != (1 << cmap->BitsPerPixel)) {
        SkDEBUGFAIL("bad colortable setup");
        ALOGD("bad colortable setup");
        return;
        return;
    }
    }


+10 −10
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ AssetStreamAdaptor::AssetStreamAdaptor(Asset* asset)
bool AssetStreamAdaptor::rewind() {
bool AssetStreamAdaptor::rewind() {
    off64_t pos = fAsset->seek(0, SEEK_SET);
    off64_t pos = fAsset->seek(0, SEEK_SET);
    if (pos == (off64_t)-1) {
    if (pos == (off64_t)-1) {
        SkDebugf("----- fAsset->seek(rewind) failed\n");
        ALOGD("----- fAsset->seek(rewind) failed\n");
        return false;
        return false;
    }
    }
    return true;
    return true;
@@ -59,7 +59,7 @@ bool AssetStreamAdaptor::hasPosition() const {
size_t AssetStreamAdaptor::getPosition() const {
size_t AssetStreamAdaptor::getPosition() const {
    const off64_t offset = fAsset->seek(0, SEEK_CUR);
    const off64_t offset = fAsset->seek(0, SEEK_CUR);
    if (offset == -1) {
    if (offset == -1) {
        SkDebugf("---- fAsset->seek(0, SEEK_CUR) failed\n");
        ALOGD("---- fAsset->seek(0, SEEK_CUR) failed\n");
        return 0;
        return 0;
    }
    }


@@ -68,7 +68,7 @@ size_t AssetStreamAdaptor::getPosition() const {


bool AssetStreamAdaptor::seek(size_t position) {
bool AssetStreamAdaptor::seek(size_t position) {
    if (fAsset->seek(position, SEEK_SET) == -1) {
    if (fAsset->seek(position, SEEK_SET) == -1) {
        SkDebugf("---- fAsset->seek(0, SEEK_SET) failed\n");
        ALOGD("---- fAsset->seek(0, SEEK_SET) failed\n");
        return false;
        return false;
    }
    }


@@ -77,7 +77,7 @@ bool AssetStreamAdaptor::seek(size_t position) {


bool AssetStreamAdaptor::move(long offset) {
bool AssetStreamAdaptor::move(long offset) {
    if (fAsset->seek(offset, SEEK_CUR) == -1) {
    if (fAsset->seek(offset, SEEK_CUR) == -1) {
        SkDebugf("---- fAsset->seek(%li, SEEK_CUR) failed\n", offset);
        ALOGD("---- fAsset->seek(%li, SEEK_CUR) failed\n", offset);
        return false;
        return false;
    }
    }


@@ -96,12 +96,12 @@ size_t AssetStreamAdaptor::read(void* buffer, size_t size) {


        off64_t oldOffset = fAsset->seek(0, SEEK_CUR);
        off64_t oldOffset = fAsset->seek(0, SEEK_CUR);
        if (-1 == oldOffset) {
        if (-1 == oldOffset) {
            SkDebugf("---- fAsset->seek(oldOffset) failed\n");
            ALOGD("---- fAsset->seek(oldOffset) failed\n");
            return 0;
            return 0;
        }
        }
        off64_t newOffset = fAsset->seek(size, SEEK_CUR);
        off64_t newOffset = fAsset->seek(size, SEEK_CUR);
        if (-1 == newOffset) {
        if (-1 == newOffset) {
            SkDebugf("---- fAsset->seek(%zu) failed\n", size);
            ALOGD("---- fAsset->seek(%zu) failed\n", size);
            return 0;
            return 0;
        }
        }
        amount = newOffset - oldOffset;
        amount = newOffset - oldOffset;
@@ -122,20 +122,20 @@ sk_sp<SkData> android::CopyAssetToData(Asset* asset) {


    const off64_t seekReturnVal = asset->seek(0, SEEK_SET);
    const off64_t seekReturnVal = asset->seek(0, SEEK_SET);
    if ((off64_t)-1 == seekReturnVal) {
    if ((off64_t)-1 == seekReturnVal) {
        SkDebugf("---- copyAsset: asset rewind failed\n");
        ALOGD("---- copyAsset: asset rewind failed\n");
        return NULL;
        return NULL;
    }
    }


    const off64_t size = asset->getLength();
    const off64_t size = asset->getLength();
    if (size <= 0) {
    if (size <= 0) {
        SkDebugf("---- copyAsset: asset->getLength() returned %" PRId64 "\n", size);
        ALOGD("---- copyAsset: asset->getLength() returned %" PRId64 "\n", size);
        return NULL;
        return NULL;
    }
    }


    sk_sp<SkData> data(SkData::MakeUninitialized(size));
    sk_sp<SkData> data(SkData::MakeUninitialized(size));
    const off64_t len = asset->read(data->writable_data(), size);
    const off64_t len = asset->read(data->writable_data(), size);
    if (len != size) {
    if (len != size) {
        SkDebugf("---- copyAsset: asset->read(%" PRId64 ") returned %" PRId64 "\n", size, len);
        ALOGD("---- copyAsset: asset->read(%" PRId64 ") returned %" PRId64 "\n", size, len);
        return NULL;
        return NULL;
    }
    }


@@ -144,7 +144,7 @@ sk_sp<SkData> android::CopyAssetToData(Asset* asset) {


jobject android::nullObjectReturn(const char msg[]) {
jobject android::nullObjectReturn(const char msg[]) {
    if (msg) {
    if (msg) {
        SkDebugf("--- %s\n", msg);
        ALOGD("--- %s\n", msg);
    }
    }
    return NULL;
    return NULL;
}
}
Loading