summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sally Qi <sallyqi@google.com> 2021-07-15 00:00:54 +0000
committer Sally Qi <sallyqi@google.com> 2021-07-16 19:07:52 +0000
commit7e3f93bc673d2d5fe21df04dfbaffff13660ca97 (patch)
tree967aaf0af1252ecae3020d0ee8f6e434a25f56cc
parent97a9cc212e1ec8cd2dc4202a8981d3b59d65bdb9 (diff)
Migrate HWUI logs from SkDebugf to ALOGD
Bug: 192062380 Test: Compile pass Change-Id: I64a0cb0016cf6a4e8a9da85dbce5ba8934109763
-rw-r--r--libs/hwui/Layer.cpp4
-rwxr-xr-xlibs/hwui/jni/Bitmap.cpp2
-rw-r--r--libs/hwui/jni/CreateJavaOutputStreamAdaptor.cpp10
-rw-r--r--libs/hwui/jni/GIFMovie.cpp4
-rw-r--r--libs/hwui/jni/Utils.cpp20
-rw-r--r--libs/hwui/jni/YuvToJpegEncoder.cpp4
-rw-r--r--libs/hwui/pipeline/skia/LayerDrawable.cpp2
-rw-r--r--libs/hwui/pipeline/skia/VkInteropFunctorDrawable.cpp2
8 files changed, 26 insertions, 22 deletions
diff --git a/libs/hwui/Layer.cpp b/libs/hwui/Layer.cpp
index b14ade97ca5f..47c47e0427a4 100644
--- a/libs/hwui/Layer.cpp
+++ b/libs/hwui/Layer.cpp
@@ -20,6 +20,8 @@
#include "utils/Color.h"
#include "utils/MathUtils.h"
+#include <log/log.h>
+
namespace android {
namespace uirenderer {
@@ -90,7 +92,7 @@ static bool shouldFilterRect(const SkMatrix& matrix, const SkRect& srcRect, cons
void Layer::draw(SkCanvas* canvas) {
GrRecordingContext* context = canvas->recordingContext();
if (context == nullptr) {
- SkDEBUGF(("Attempting to draw LayerDrawable into an unsupported surface"));
+ ALOGD("Attempting to draw LayerDrawable into an unsupported surface");
return;
}
SkMatrix layerTransform = getTransform();
diff --git a/libs/hwui/jni/Bitmap.cpp b/libs/hwui/jni/Bitmap.cpp
index 05278f24ebbd..6989ac032c36 100755
--- a/libs/hwui/jni/Bitmap.cpp
+++ b/libs/hwui/jni/Bitmap.cpp
@@ -873,7 +873,7 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject,
jlong bitmapHandle, jint density, jobject parcel) {
#ifdef __ANDROID__ // Layoutlib does not support parcel
if (parcel == NULL) {
- SkDebugf("------- writeToParcel null parcel\n");
+ ALOGD("------- writeToParcel null parcel\n");
return JNI_FALSE;
}
diff --git a/libs/hwui/jni/CreateJavaOutputStreamAdaptor.cpp b/libs/hwui/jni/CreateJavaOutputStreamAdaptor.cpp
index 785a5dc995ab..15e529e169fc 100644
--- a/libs/hwui/jni/CreateJavaOutputStreamAdaptor.cpp
+++ b/libs/hwui/jni/CreateJavaOutputStreamAdaptor.cpp
@@ -107,7 +107,7 @@ private:
jint n = env->CallIntMethod(fJavaInputStream,
gInputStream_readMethodID, fJavaByteArray, 0, requested);
if (checkException(env)) {
- SkDebugf("---- read threw an exception\n");
+ ALOGD("---- read threw an exception\n");
return bytesRead;
}
@@ -119,7 +119,7 @@ private:
env->GetByteArrayRegion(fJavaByteArray, 0, n,
reinterpret_cast<jbyte*>(buffer));
if (checkException(env)) {
- SkDebugf("---- read:GetByteArrayRegion threw an exception\n");
+ ALOGD("---- read:GetByteArrayRegion threw an exception\n");
return bytesRead;
}
@@ -136,7 +136,7 @@ private:
jlong skipped = env->CallLongMethod(fJavaInputStream,
gInputStream_skipMethodID, (jlong)size);
if (checkException(env)) {
- SkDebugf("------- skip threw an exception\n");
+ ALOGD("------- skip threw an exception\n");
return 0;
}
if (skipped < 0) {
@@ -236,7 +236,7 @@ public:
if (env->ExceptionCheck()) {
env->ExceptionDescribe();
env->ExceptionClear();
- SkDebugf("--- write:SetByteArrayElements threw an exception\n");
+ ALOGD("--- write:SetByteArrayElements threw an exception\n");
return false;
}
@@ -245,7 +245,7 @@ public:
if (env->ExceptionCheck()) {
env->ExceptionDescribe();
env->ExceptionClear();
- SkDebugf("------- write threw an exception\n");
+ ALOGD("------- write threw an exception\n");
return false;
}
diff --git a/libs/hwui/jni/GIFMovie.cpp b/libs/hwui/jni/GIFMovie.cpp
index f84a4bd09073..c5c47116b5a6 100644
--- a/libs/hwui/jni/GIFMovie.cpp
+++ b/libs/hwui/jni/GIFMovie.cpp
@@ -15,6 +15,8 @@
#include "gif_lib.h"
+#include <log/log.h>
+
#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
#define DGifCloseFile(a, b) DGifCloseFile(a)
#endif
@@ -244,7 +246,7 @@ static void drawFrame(SkBitmap* bm, const SavedImage* frame, const ColorMapObjec
}
if (cmap == nullptr || cmap->ColorCount != (1 << cmap->BitsPerPixel)) {
- SkDEBUGFAIL("bad colortable setup");
+ ALOGD("bad colortable setup");
return;
}
diff --git a/libs/hwui/jni/Utils.cpp b/libs/hwui/jni/Utils.cpp
index 1259bb5a4f65..106c6db57e18 100644
--- a/libs/hwui/jni/Utils.cpp
+++ b/libs/hwui/jni/Utils.cpp
@@ -31,7 +31,7 @@ AssetStreamAdaptor::AssetStreamAdaptor(Asset* asset)
bool AssetStreamAdaptor::rewind() {
off64_t pos = fAsset->seek(0, SEEK_SET);
if (pos == (off64_t)-1) {
- SkDebugf("----- fAsset->seek(rewind) failed\n");
+ ALOGD("----- fAsset->seek(rewind) failed\n");
return false;
}
return true;
@@ -59,7 +59,7 @@ bool AssetStreamAdaptor::hasPosition() const {
size_t AssetStreamAdaptor::getPosition() const {
const off64_t offset = fAsset->seek(0, SEEK_CUR);
if (offset == -1) {
- SkDebugf("---- fAsset->seek(0, SEEK_CUR) failed\n");
+ ALOGD("---- fAsset->seek(0, SEEK_CUR) failed\n");
return 0;
}
@@ -68,7 +68,7 @@ size_t AssetStreamAdaptor::getPosition() const {
bool AssetStreamAdaptor::seek(size_t position) {
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;
}
@@ -77,7 +77,7 @@ bool AssetStreamAdaptor::seek(size_t position) {
bool AssetStreamAdaptor::move(long offset) {
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;
}
@@ -96,12 +96,12 @@ size_t AssetStreamAdaptor::read(void* buffer, size_t size) {
off64_t oldOffset = fAsset->seek(0, SEEK_CUR);
if (-1 == oldOffset) {
- SkDebugf("---- fAsset->seek(oldOffset) failed\n");
+ ALOGD("---- fAsset->seek(oldOffset) failed\n");
return 0;
}
off64_t newOffset = fAsset->seek(size, SEEK_CUR);
if (-1 == newOffset) {
- SkDebugf("---- fAsset->seek(%zu) failed\n", size);
+ ALOGD("---- fAsset->seek(%zu) failed\n", size);
return 0;
}
amount = newOffset - oldOffset;
@@ -122,20 +122,20 @@ sk_sp<SkData> android::CopyAssetToData(Asset* asset) {
const off64_t seekReturnVal = asset->seek(0, SEEK_SET);
if ((off64_t)-1 == seekReturnVal) {
- SkDebugf("---- copyAsset: asset rewind failed\n");
+ ALOGD("---- copyAsset: asset rewind failed\n");
return NULL;
}
const off64_t size = asset->getLength();
if (size <= 0) {
- SkDebugf("---- copyAsset: asset->getLength() returned %" PRId64 "\n", size);
+ ALOGD("---- copyAsset: asset->getLength() returned %" PRId64 "\n", size);
return NULL;
}
sk_sp<SkData> data(SkData::MakeUninitialized(size));
const off64_t len = asset->read(data->writable_data(), 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;
}
@@ -144,7 +144,7 @@ sk_sp<SkData> android::CopyAssetToData(Asset* asset) {
jobject android::nullObjectReturn(const char msg[]) {
if (msg) {
- SkDebugf("--- %s\n", msg);
+ ALOGD("--- %s\n", msg);
}
return NULL;
}
diff --git a/libs/hwui/jni/YuvToJpegEncoder.cpp b/libs/hwui/jni/YuvToJpegEncoder.cpp
index 689cf0bea741..77f42ae70268 100644
--- a/libs/hwui/jni/YuvToJpegEncoder.cpp
+++ b/libs/hwui/jni/YuvToJpegEncoder.cpp
@@ -85,7 +85,7 @@ Yuv420SpToJpegEncoder::Yuv420SpToJpegEncoder(int* strides) :
void Yuv420SpToJpegEncoder::compress(jpeg_compress_struct* cinfo,
uint8_t* yuv, int* offsets) {
- SkDebugf("onFlyCompress");
+ ALOGD("onFlyCompress");
JSAMPROW y[16];
JSAMPROW cb[8];
JSAMPROW cr[8];
@@ -161,7 +161,7 @@ Yuv422IToJpegEncoder::Yuv422IToJpegEncoder(int* strides) :
void Yuv422IToJpegEncoder::compress(jpeg_compress_struct* cinfo,
uint8_t* yuv, int* offsets) {
- SkDebugf("onFlyCompress_422");
+ ALOGD("onFlyCompress_422");
JSAMPROW y[16];
JSAMPROW cb[16];
JSAMPROW cr[16];
diff --git a/libs/hwui/pipeline/skia/LayerDrawable.cpp b/libs/hwui/pipeline/skia/LayerDrawable.cpp
index 471a7f7af3b1..e32788c9ec51 100644
--- a/libs/hwui/pipeline/skia/LayerDrawable.cpp
+++ b/libs/hwui/pipeline/skia/LayerDrawable.cpp
@@ -75,7 +75,7 @@ bool LayerDrawable::DrawLayer(GrRecordingContext* context,
const SkRect* dstRect,
bool useLayerTransform) {
if (context == nullptr) {
- SkDEBUGF(("Attempting to draw LayerDrawable into an unsupported surface"));
+ ALOGD("Attempting to draw LayerDrawable into an unsupported surface");
return false;
}
// transform the matrix based on the layer
diff --git a/libs/hwui/pipeline/skia/VkInteropFunctorDrawable.cpp b/libs/hwui/pipeline/skia/VkInteropFunctorDrawable.cpp
index ddfb66f84f28..3c7617d35c7c 100644
--- a/libs/hwui/pipeline/skia/VkInteropFunctorDrawable.cpp
+++ b/libs/hwui/pipeline/skia/VkInteropFunctorDrawable.cpp
@@ -68,7 +68,7 @@ void VkInteropFunctorDrawable::onDraw(SkCanvas* canvas) {
ATRACE_CALL();
if (canvas->recordingContext() == nullptr) {
- SkDEBUGF(("Attempting to draw VkInteropFunctor into an unsupported surface"));
+ ALOGD("Attempting to draw VkInteropFunctor into an unsupported surface");
return;
}