Remove references to libchrome
Removed dependencies on libchrome which was used mostly for logging
and switched over to standard Android log macros.
Bug: None
Test: `m -j32` still succeeds
Change-Id: I0a841c19c15c02f9a031af200e82837f9450d88a
diff --git a/libs/vr/libbufferhub/Android.mk b/libs/vr/libbufferhub/Android.mk
index 467f69f..0877b0b 100644
--- a/libs/vr/libbufferhub/Android.mk
+++ b/libs/vr/libbufferhub/Android.mk
@@ -23,7 +23,6 @@
$(LOCAL_PATH)/include
staticLibraries := \
- libchrome \
libdvrcommon \
libpdx_default_transport \
diff --git a/libs/vr/libbufferhub/buffer_hub_client.cpp b/libs/vr/libbufferhub/buffer_hub_client.cpp
index 146780e..e2413bd 100644
--- a/libs/vr/libbufferhub/buffer_hub_client.cpp
+++ b/libs/vr/libbufferhub/buffer_hub_client.cpp
@@ -1,6 +1,6 @@
#include <private/dvr/buffer_hub_client.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include <poll.h>
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <utils/Trace.h>
diff --git a/libs/vr/libbufferhub/bufferhub_tests.cpp b/libs/vr/libbufferhub/bufferhub_tests.cpp
index cb45dbe..0b9e0cc 100644
--- a/libs/vr/libbufferhub/bufferhub_tests.cpp
+++ b/libs/vr/libbufferhub/bufferhub_tests.cpp
@@ -1,11 +1,19 @@
#include <android/native_window.h>
-#include <base/posix/eintr_wrapper.h>
#include <gtest/gtest.h>
#include <private/dvr/buffer_hub_client.h>
#include <mutex>
#include <thread>
+#define RETRY_EINTR(fnc_call) \
+ ([&]() -> decltype(fnc_call) { \
+ decltype(fnc_call) result; \
+ do { \
+ result = (fnc_call); \
+ } while (result == -1 && errno == EINTR); \
+ return result; \
+ })()
+
using android::dvr::BufferProducer;
using android::dvr::BufferConsumer;
using android::pdx::LocalHandle;
@@ -32,27 +40,27 @@
EXPECT_EQ(0, p->Post(LocalHandle(), kContext));
// Both consumers should be triggered.
- EXPECT_GE(0, HANDLE_EINTR(p->Poll(0)));
- EXPECT_LT(0, HANDLE_EINTR(c->Poll(10)));
- EXPECT_LT(0, HANDLE_EINTR(c2->Poll(10)));
+ EXPECT_GE(0, RETRY_EINTR(p->Poll(0)));
+ EXPECT_LT(0, RETRY_EINTR(c->Poll(10)));
+ EXPECT_LT(0, RETRY_EINTR(c2->Poll(10)));
uint64_t context;
LocalHandle fence;
EXPECT_LE(0, c->Acquire(&fence, &context));
EXPECT_EQ(kContext, context);
- EXPECT_GE(0, HANDLE_EINTR(c->Poll(0)));
+ EXPECT_GE(0, RETRY_EINTR(c->Poll(0)));
EXPECT_LE(0, c2->Acquire(&fence, &context));
EXPECT_EQ(kContext, context);
- EXPECT_GE(0, HANDLE_EINTR(c2->Poll(0)));
+ EXPECT_GE(0, RETRY_EINTR(c2->Poll(0)));
EXPECT_EQ(0, c->Release(LocalHandle()));
- EXPECT_GE(0, HANDLE_EINTR(p->Poll(0)));
+ EXPECT_GE(0, RETRY_EINTR(p->Poll(0)));
EXPECT_EQ(0, c2->Discard());
- EXPECT_LE(0, HANDLE_EINTR(p->Poll(0)));
+ EXPECT_LE(0, RETRY_EINTR(p->Poll(0)));
EXPECT_EQ(0, p->Gain(&fence));
- EXPECT_GE(0, HANDLE_EINTR(p->Poll(0)));
+ EXPECT_GE(0, RETRY_EINTR(p->Poll(0)));
}
TEST_F(LibBufferHubTest, TestWithCustomMetadata) {
@@ -69,7 +77,7 @@
Metadata m = {1, 3};
EXPECT_EQ(0, p->Post(LocalHandle(), m));
- EXPECT_LE(0, HANDLE_EINTR(c->Poll(10)));
+ EXPECT_LE(0, RETRY_EINTR(c->Poll(10)));
LocalHandle fence;
Metadata m2 = {};
@@ -78,7 +86,7 @@
EXPECT_EQ(m.field2, m2.field2);
EXPECT_EQ(0, c->Release(LocalHandle()));
- EXPECT_LT(0, HANDLE_EINTR(p->Poll(0)));
+ EXPECT_LT(0, RETRY_EINTR(p->Poll(0)));
}
TEST_F(LibBufferHubTest, TestPostWithWrongMetaSize) {
@@ -95,7 +103,7 @@
int64_t sequence = 3;
EXPECT_NE(0, p->Post(LocalHandle(), sequence));
- EXPECT_GE(0, HANDLE_EINTR(c->Poll(10)));
+ EXPECT_GE(0, RETRY_EINTR(c->Poll(10)));
}
TEST_F(LibBufferHubTest, TestAcquireWithWrongMetaSize) {
diff --git a/libs/vr/libbufferhub/include/private/dvr/native_buffer.h b/libs/vr/libbufferhub/include/private/dvr/native_buffer.h
index f6c24d9..afed052 100644
--- a/libs/vr/libbufferhub/include/private/dvr/native_buffer.h
+++ b/libs/vr/libbufferhub/include/private/dvr/native_buffer.h
@@ -4,8 +4,7 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <android/native_window.h>
-#include <base/logging.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include <system/window.h>
#include <ui/ANativeObjectBase.h>
#include <utils/RefBase.h>
@@ -181,7 +180,7 @@
ANativeWindowBuffer::stride = buffer_->stride();
ANativeWindowBuffer::format = buffer_->format();
ANativeWindowBuffer::usage = buffer_->usage();
- CHECK(buffer_->slice_count() > index);
+ LOG_ALWAYS_FATAL_IF(buffer_->slice_count() <= index);
handle = buffer_->slice(index)->handle();
}
diff --git a/libs/vr/libbufferhub/ion_buffer.cpp b/libs/vr/libbufferhub/ion_buffer.cpp
index 7d20049..4db2164 100644
--- a/libs/vr/libbufferhub/ion_buffer.cpp
+++ b/libs/vr/libbufferhub/ion_buffer.cpp
@@ -1,6 +1,6 @@
#include <private/dvr/ion_buffer.h>
-#include <cutils/log.h>
+#include <log/log.h>
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <utils/Trace.h>
diff --git a/libs/vr/libbufferhubqueue/Android.mk b/libs/vr/libbufferhubqueue/Android.mk
index 46b83e7..3ed7ff2 100644
--- a/libs/vr/libbufferhubqueue/Android.mk
+++ b/libs/vr/libbufferhubqueue/Android.mk
@@ -25,7 +25,6 @@
staticLibraries := \
libbufferhub \
- libchrome \
libdvrcommon \
libpdx_default_transport \
diff --git a/libs/vr/libbufferhubqueue/buffer_hub_queue_client.cpp b/libs/vr/libbufferhubqueue/buffer_hub_queue_client.cpp
index 4fbfcf6..0576b21 100644
--- a/libs/vr/libbufferhubqueue/buffer_hub_queue_client.cpp
+++ b/libs/vr/libbufferhubqueue/buffer_hub_queue_client.cpp
@@ -1,6 +1,7 @@
#include "include/private/dvr/buffer_hub_queue_client.h"
-#include <base/logging.h>
+#include <inttypes.h>
+#include <log/log.h>
#include <sys/epoll.h>
#include <array>
@@ -43,8 +44,8 @@
void BufferHubQueue::Initialize() {
int ret = epoll_fd_.Create();
if (ret < 0) {
- LOG(ERROR) << "BufferHubQueue::BufferHubQueue: Failed to create epoll fd:"
- << strerror(-ret);
+ ALOGE("BufferHubQueue::BufferHubQueue: Failed to create epoll fd: %s",
+ strerror(-ret));
return;
}
@@ -53,8 +54,8 @@
BufferHubQueue::kEpollQueueEventIndex)}};
ret = epoll_fd_.Control(EPOLL_CTL_ADD, event_fd(), &event);
if (ret < 0) {
- LOG(ERROR) << "Failed to register ConsumerQueue into epoll event: "
- << strerror(-ret);
+ ALOGE("Failed to register ConsumerQueue into epoll event: %s",
+ strerror(-ret));
}
}
@@ -63,13 +64,13 @@
InvokeRemoteMethod<BufferHubRPC::CreateConsumerQueue>();
if (!status) {
- LOG(ERROR) << "Cannot create ConsumerQueue: " << status.GetErrorMessage();
+ ALOGE("Cannot create ConsumerQueue: %s", status.GetErrorMessage().c_str());
return nullptr;
}
auto return_value = status.take();
- VLOG(1) << "CreateConsumerQueue: meta_size_bytes=" << return_value.second;
+ ALOGD("CreateConsumerQueue: meta_size_bytes=%zu", return_value.second);
return ConsumerQueue::Create(std::move(return_value.first),
return_value.second);
}
@@ -81,12 +82,12 @@
int ret = epoll_fd_.Wait(events.data(), events.size(), timeout);
if (ret == 0) {
- VLOG(1) << "Wait on epoll returns nothing before timeout.";
+ ALOGD("Wait on epoll returns nothing before timeout.");
return false;
}
if (ret < 0 && ret != -EINTR) {
- LOG(ERROR) << "Failed to wait for buffers:" << strerror(-ret);
+ ALOGE("Failed to wait for buffers: %s", strerror(-ret));
return false;
}
@@ -98,13 +99,13 @@
for (int i = 0; i < num_events; i++) {
int64_t index = static_cast<int64_t>(events[i].data.u64);
- VLOG(1) << "New BufferHubQueue event " << i << ": index=" << index;
+ ALOGD("New BufferHubQueue event %d: index=%" PRId64, i, index);
if (is_buffer_event_index(index) && (events[i].events & EPOLLIN)) {
auto buffer = buffers_[index];
ret = OnBufferReady(buffer);
if (ret < 0) {
- LOG(ERROR) << "Failed to set buffer ready:" << strerror(-ret);
+ ALOGE("Failed to set buffer ready: %s", strerror(-ret));
continue;
}
Enqueue(buffer, index);
@@ -113,18 +114,18 @@
// This maybe caused by producer replacing an exising buffer slot.
// Currently the epoll FD is cleaned up when the replacement consumer
// client is imported.
- LOG(WARNING) << "Receives EPOLLHUP at slot: " << index;
+ ALOGW("Receives EPOLLHUP at slot: %" PRId64, index);
} else if (is_queue_event_index(index) && (events[i].events & EPOLLIN)) {
// Note that after buffer imports, if |count()| still returns 0, epoll
// wait will be tried again to acquire the newly imported buffer.
ret = OnBufferAllocated();
if (ret < 0) {
- LOG(ERROR) << "Failed to import buffer:" << strerror(-ret);
+ ALOGE("Failed to import buffer: %s", strerror(-ret));
continue;
}
} else {
- LOG(WARNING) << "Unknown event " << i << ": u64=" << index
- << ": events=" << events[i].events;
+ ALOGW("Unknown event %d: u64=%" PRId64 ": events=%" PRIu32, i, index,
+ events[i].events);
}
}
}
@@ -137,8 +138,8 @@
if (is_full()) {
// TODO(jwcai) Move the check into Producer's AllocateBuffer and consumer's
// import buffer.
- LOG(ERROR) << "BufferHubQueue::AddBuffer queue is at maximum capacity: "
- << capacity_;
+ ALOGE("BufferHubQueue::AddBuffer queue is at maximum capacity: %zu",
+ capacity_);
return -E2BIG;
}
@@ -152,9 +153,8 @@
epoll_event event = {.events = EPOLLIN | EPOLLET, .data = {.u64 = slot}};
const int ret = epoll_fd_.Control(EPOLL_CTL_ADD, buf->event_fd(), &event);
if (ret < 0) {
- LOG(ERROR)
- << "BufferHubQueue::AddBuffer: Failed to add buffer to epoll set:"
- << strerror(-ret);
+ ALOGE("BufferHubQueue::AddBuffer: Failed to add buffer to epoll set: %s",
+ strerror(-ret));
return ret;
}
@@ -166,15 +166,16 @@
int BufferHubQueue::DetachBuffer(size_t slot) {
auto& buf = buffers_[slot];
if (buf == nullptr) {
- LOG(ERROR) << "BufferHubQueue::DetachBuffer: Invalid slot: " << slot;
+ ALOGE("BufferHubQueue::DetachBuffer: Invalid slot: %zu", slot);
return -EINVAL;
}
const int ret = epoll_fd_.Control(EPOLL_CTL_DEL, buf->event_fd(), nullptr);
if (ret < 0) {
- LOG(ERROR) << "BufferHubQueue::DetachBuffer: Failed to detach buffer from "
- "epoll set:"
- << strerror(-ret);
+ ALOGE(
+ "BufferHubQueue::DetachBuffer: Failed to detach buffer from epoll set: "
+ "%s",
+ strerror(-ret));
return ret;
}
@@ -186,7 +187,7 @@
void BufferHubQueue::Enqueue(std::shared_ptr<BufferHubBuffer> buf,
size_t slot) {
if (count() == capacity_) {
- LOG(ERROR) << "Buffer queue is full!";
+ ALOGE("Buffer queue is full!");
return;
}
@@ -206,7 +207,7 @@
std::shared_ptr<BufferHubBuffer> BufferHubQueue::Dequeue(int timeout,
size_t* slot,
void* meta) {
- VLOG(1) << "Dequeue: count=" << count() << ", timeout=" << timeout;
+ ALOGD("Dequeue: count=%zu, timeout=%d", count(), timeout);
if (count() == 0 && !WaitForBuffers(timeout))
return nullptr;
@@ -224,7 +225,7 @@
available_buffers_.PopFront();
if (!buf) {
- LOG(ERROR) << "Dequeue: Buffer to be dequeued is nullptr";
+ ALOGE("Dequeue: Buffer to be dequeued is nullptr");
return nullptr;
}
@@ -250,9 +251,8 @@
meta_size_, usage_set_mask, usage_clear_mask, usage_deny_set_mask,
usage_deny_clear_mask);
if (!status) {
- LOG(ERROR)
- << "ProducerQueue::ProducerQueue: Failed to create producer queue: %s"
- << status.GetErrorMessage();
+ ALOGE("ProducerQueue::ProducerQueue: Failed to create producer queue: %s",
+ status.GetErrorMessage().c_str());
Close(-status.error());
return;
}
@@ -261,13 +261,13 @@
int ProducerQueue::AllocateBuffer(int width, int height, int format, int usage,
size_t slice_count, size_t* out_slot) {
if (out_slot == nullptr) {
- LOG(ERROR) << "Parameter out_slot cannot be null.";
+ ALOGE("Parameter out_slot cannot be null.");
return -EINVAL;
}
if (is_full()) {
- LOG(ERROR) << "ProducerQueue::AllocateBuffer queue is at maximum capacity: "
- << capacity();
+ ALOGE("ProducerQueue::AllocateBuffer queue is at maximum capacity: %zu",
+ capacity());
return -E2BIG;
}
@@ -277,21 +277,22 @@
InvokeRemoteMethod<BufferHubRPC::ProducerQueueAllocateBuffers>(
width, height, format, usage, slice_count, kBufferCount);
if (!status) {
- LOG(ERROR) << "ProducerQueue::AllocateBuffer failed to create producer "
- "buffer through BufferHub.";
+ ALOGE(
+ "ProducerQueue::AllocateBuffer failed to create producer buffer "
+ "through BufferHub.");
return -status.error();
}
auto buffer_handle_slots = status.take();
- CHECK_EQ(buffer_handle_slots.size(), kBufferCount)
- << "BufferHubRPC::ProducerQueueAllocateBuffers should return one and "
- "only one buffer handle.";
+ LOG_ALWAYS_FATAL_IF(buffer_handle_slots.size() != kBufferCount,
+ "BufferHubRPC::ProducerQueueAllocateBuffers should "
+ "return one and only one buffer handle.");
// We only allocate one buffer at a time.
auto& buffer_handle = buffer_handle_slots[0].first;
size_t buffer_slot = buffer_handle_slots[0].second;
- VLOG(1) << "ProducerQueue::AllocateBuffer, new buffer, channel_handle: "
- << buffer_handle.value();
+ ALOGD("ProducerQueue::AllocateBuffer, new buffer, channel_handle: %d",
+ buffer_handle.value());
*out_slot = buffer_slot;
return AddBuffer(BufferProducer::Import(std::move(buffer_handle)),
@@ -314,9 +315,10 @@
Status<int> status =
InvokeRemoteMethod<BufferHubRPC::ProducerQueueDetachBuffer>(slot);
if (!status) {
- LOG(ERROR) << "ProducerQueue::DetachBuffer failed to detach producer "
- "buffer through BufferHub, error: "
- << status.GetErrorMessage();
+ ALOGE(
+ "ProducerQueue::DetachBuffer failed to detach producer buffer through "
+ "BufferHub, error: %s",
+ status.GetErrorMessage().c_str());
return -status.error();
}
@@ -344,9 +346,10 @@
Status<std::vector<std::pair<LocalChannelHandle, size_t>>> status =
InvokeRemoteMethod<BufferHubRPC::ConsumerQueueImportBuffers>();
if (!status) {
- LOG(ERROR) << "ConsumerQueue::ImportBuffers failed to import consumer "
- "buffer through BufferBub, error: "
- << status.GetErrorMessage();
+ ALOGE(
+ "ConsumerQueue::ImportBuffers failed to import consumer buffer through "
+ "BufferBub, error: %s",
+ status.GetErrorMessage().c_str());
return -status.error();
}
@@ -355,15 +358,15 @@
auto buffer_handle_slots = status.take();
for (auto& buffer_handle_slot : buffer_handle_slots) {
- VLOG(1) << "ConsumerQueue::ImportBuffers, new buffer, buffer_handle: "
- << buffer_handle_slot.first.value();
+ ALOGD("ConsumerQueue::ImportBuffers, new buffer, buffer_handle: %d",
+ buffer_handle_slot.first.value());
std::unique_ptr<BufferConsumer> buffer_consumer =
BufferConsumer::Import(std::move(buffer_handle_slot.first));
int ret = AddBuffer(std::move(buffer_consumer), buffer_handle_slot.second);
if (ret < 0) {
- LOG(ERROR) << "ConsumerQueue::ImportBuffers failed to add buffer, ret: "
- << strerror(-ret);
+ ALOGE("ConsumerQueue::ImportBuffers failed to add buffer, ret: %s",
+ strerror(-ret));
last_error = ret;
continue;
} else {
@@ -384,9 +387,10 @@
size_t* slot, void* meta,
size_t meta_size) {
if (meta_size != meta_size_) {
- LOG(ERROR) << "metadata size (" << meta_size
- << ") for the dequeuing buffer does not match metadata size ("
- << meta_size_ << ") for the queue.";
+ ALOGE(
+ "metadata size (%zu) for the dequeuing buffer does not match metadata "
+ "size (%zu) for the queue.",
+ meta_size, meta_size_);
return nullptr;
}
auto buf = BufferHubQueue::Dequeue(timeout, slot, meta);
@@ -402,11 +406,11 @@
int ConsumerQueue::OnBufferAllocated() {
const int ret = ImportBuffers();
if (ret == 0) {
- LOG(WARNING) << "No new buffer can be imported on buffer allocated event.";
+ ALOGW("No new buffer can be imported on buffer allocated event.");
} else if (ret < 0) {
- LOG(ERROR) << "Failed to import buffers on buffer allocated event.";
+ ALOGE("Failed to import buffers on buffer allocated event.");
}
- VLOG(1) << "Imported " << ret << " consumer buffers.";
+ ALOGD("Imported %d consumer buffers.", ret);
return ret;
}
diff --git a/libs/vr/libbufferhubqueue/buffer_hub_queue_core.cpp b/libs/vr/libbufferhubqueue/buffer_hub_queue_core.cpp
index 3fc0600..a108042 100644
--- a/libs/vr/libbufferhubqueue/buffer_hub_queue_core.cpp
+++ b/libs/vr/libbufferhubqueue/buffer_hub_queue_core.cpp
@@ -1,5 +1,7 @@
#include "include/private/dvr/buffer_hub_queue_core.h"
+#include <log/log.h>
+
namespace android {
namespace dvr {
@@ -14,9 +16,9 @@
std::shared_ptr<BufferHubQueueCore> BufferHubQueueCore::Create(
const std::shared_ptr<ProducerQueue>& producer) {
if (producer->metadata_size() != sizeof(BufferMetadata)) {
- LOG(ERROR)
- << "BufferHubQueueCore::Create producer's metadata size is "
- << "different than the size of BufferHubQueueCore::BufferMetadata";
+ ALOGE(
+ "BufferHubQueueCore::Create producer's metadata size is different than "
+ "the size of BufferHubQueueCore::BufferMetadata");
return nullptr;
}
@@ -39,18 +41,18 @@
// bookkeeping.
if (producer_->AllocateBuffer(width, height, format, usage, slice_count,
&slot) < 0) {
- LOG(ERROR) << "Failed to allocate new buffer in BufferHub.";
+ ALOGE("Failed to allocate new buffer in BufferHub.");
return NO_MEMORY;
}
auto buffer_producer = producer_->GetBuffer(slot);
- CHECK(buffer_producer != nullptr) << "Failed to get buffer producer at slot: "
- << slot;
+ LOG_ALWAYS_FATAL_IF(buffer_producer == nullptr,
+ "Failed to get buffer producer at slot: %zu", slot);
// Allocating a new buffer, |buffers_[slot]| should be in initial state.
- CHECK(buffers_[slot].mGraphicBuffer == nullptr) << "AllocateBuffer: slot "
- << slot << " is not empty.";
+ LOG_ALWAYS_FATAL_IF(buffers_[slot].mGraphicBuffer != nullptr,
+ "AllocateBuffer: slot %zu is not empty.", slot);
// Create new GraphicBuffer based on the newly created |buffer_producer|. Here
// we have to cast |buffer_handle_t| to |native_handle_t|, it's OK because
@@ -65,8 +67,8 @@
const_cast<native_handle_t*>(buffer_producer->buffer()->handle()),
false));
- CHECK_EQ(NO_ERROR, graphic_buffer->initCheck())
- << "Failed to init GraphicBuffer.";
+ LOG_ALWAYS_FATAL_IF(NO_ERROR != graphic_buffer->initCheck(),
+ "Failed to init GraphicBuffer.");
buffers_[slot].mBufferProducer = buffer_producer;
buffers_[slot].mGraphicBuffer = graphic_buffer;
@@ -77,8 +79,8 @@
// Detach the buffer producer via BufferHubRPC.
int ret = producer_->DetachBuffer(slot);
if (ret < 0) {
- LOG(ERROR) << "BufferHubQueueCore::DetachBuffer failed through RPC, ret="
- << strerror(-ret);
+ ALOGE("BufferHubQueueCore::DetachBuffer failed through RPC, ret=%s",
+ strerror(-ret));
return ret;
}
diff --git a/libs/vr/libbufferhubqueue/buffer_hub_queue_producer.cpp b/libs/vr/libbufferhubqueue/buffer_hub_queue_producer.cpp
index 93d7307..752e8c4 100644
--- a/libs/vr/libbufferhubqueue/buffer_hub_queue_producer.cpp
+++ b/libs/vr/libbufferhubqueue/buffer_hub_queue_producer.cpp
@@ -1,5 +1,8 @@
#include "include/private/dvr/buffer_hub_queue_producer.h"
+#include <inttypes.h>
+#include <log/log.h>
+
namespace android {
namespace dvr {
@@ -9,18 +12,17 @@
status_t BufferHubQueueProducer::requestBuffer(int slot,
sp<GraphicBuffer>* buf) {
- VLOG(1) << "requestBuffer: slot=" << slot;;
+ ALOGD("requestBuffer: slot=%d", slot);
std::unique_lock<std::mutex> lock(core_->mutex_);
if (slot < 0 || slot >= req_buffer_count_) {
- LOG(ERROR) << "requestBuffer: slot index " << slot << " out of range [0, "
- << req_buffer_count_ << ")";
+ ALOGE("requestBuffer: slot index %d out of range [0, %d)", slot,
+ req_buffer_count_);
return BAD_VALUE;
} else if (!core_->buffers_[slot].mBufferState.isDequeued()) {
- LOG(ERROR) << "requestBuffer: slot " << slot
- << " is not owned by the producer (state = "
- << core_->buffers_[slot].mBufferState.string() << " )";
+ ALOGE("requestBuffer: slot %d is not owned by the producer (state = %s)",
+ slot, core_->buffers_[slot].mBufferState.string());
return BAD_VALUE;
}
@@ -31,17 +33,16 @@
status_t BufferHubQueueProducer::setMaxDequeuedBufferCount(
int max_dequeued_buffers) {
- VLOG(1) << "setMaxDequeuedBufferCount: max_dequeued_buffers="
- << max_dequeued_buffers;
+ ALOGD("setMaxDequeuedBufferCount: max_dequeued_buffers=%d",
+ max_dequeued_buffers);
std::unique_lock<std::mutex> lock(core_->mutex_);
if (max_dequeued_buffers <= 0 ||
max_dequeued_buffers >
static_cast<int>(BufferHubQueue::kMaxQueueCapacity)) {
- LOG(ERROR) << "setMaxDequeuedBufferCount: " << max_dequeued_buffers
- << " out of range (0, " << BufferHubQueue::kMaxQueueCapacity
- << "]";
+ ALOGE("setMaxDequeuedBufferCount: %d out of range (0, %zu]",
+ max_dequeued_buffers, BufferHubQueue::kMaxQueueCapacity);
return BAD_VALUE;
}
@@ -50,7 +51,7 @@
}
status_t BufferHubQueueProducer::setAsyncMode(bool /* async */) {
- LOG(ERROR) << "BufferHubQueueProducer::setAsyncMode not implemented.";
+ ALOGE("BufferHubQueueProducer::setAsyncMode not implemented.");
return INVALID_OPERATION;
}
@@ -60,8 +61,8 @@
PixelFormat format,
uint32_t usage,
FrameEventHistoryDelta* /* outTimestamps */) {
- VLOG(1) << "dequeueBuffer: w=" << width << ", h=" << height
- << " format=" << format << ", usage=" << usage;
+ ALOGD("dequeueBuffer: w=%u, h=%u, format=%d, usage=%u", width, height, format,
+ usage);
status_t ret;
std::unique_lock<std::mutex> lock(core_->mutex_);
@@ -94,13 +95,12 @@
// Needs reallocation.
// TODO(jwcai) Consider use VLOG instead if we find this log is not useful.
- LOG(INFO) << "dequeueBuffer,: requested buffer (w=" << width
- << ", h=" << height << ", format=" << format
- << ") is different from the buffer returned at slot: " << slot
- << " (w=" << buffer_producer->width()
- << ", h=" << buffer_producer->height()
- << ", format=" << buffer_producer->format()
- << "). Need re-allocattion.";
+ ALOGI(
+ "dequeueBuffer: requested buffer (w=%u, h=%u, format=%d) is different "
+ "from the buffer returned at slot: %zu (w=%d, h=%d, format=%d). Need "
+ "re-allocattion.",
+ width, height, format, slot, buffer_producer->width(),
+ buffer_producer->height(), buffer_producer->format());
// Mark the slot as reallocating, so that later we can set
// BUFFER_NEEDS_REALLOCATION when the buffer actually get dequeued.
core_->buffers_[slot].mIsReallocating = true;
@@ -125,13 +125,13 @@
// BufferHubQueue).
// TODO(jwcai) Clean this up, make mBufferState compatible with BufferHub's
// model.
- CHECK(core_->buffers_[slot].mBufferState.isFree() ||
- core_->buffers_[slot].mBufferState.isQueued())
- << "dequeueBuffer: slot " << slot << " is not free or queued.";
+ LOG_ALWAYS_FATAL_IF(!core_->buffers_[slot].mBufferState.isFree() &&
+ !core_->buffers_[slot].mBufferState.isQueued(),
+ "dequeueBuffer: slot %zu is not free or queued.", slot);
core_->buffers_[slot].mBufferState.freeQueued();
core_->buffers_[slot].mBufferState.dequeue();
- VLOG(1) << "dequeueBuffer: slot=" << slot;
+ ALOGD("dequeueBuffer: slot=%zu", slot);
// TODO(jwcai) Handle fence properly. |BufferHub| has full fence support, we
// just need to exopose that through |BufferHubQueue| once we need fence.
@@ -148,13 +148,13 @@
}
status_t BufferHubQueueProducer::detachBuffer(int /* slot */) {
- LOG(ERROR) << "BufferHubQueueProducer::detachBuffer not implemented.";
+ ALOGE("BufferHubQueueProducer::detachBuffer not implemented.");
return INVALID_OPERATION;
}
status_t BufferHubQueueProducer::detachNextBuffer(
sp<GraphicBuffer>* /* out_buffer */, sp<Fence>* /* out_fence */) {
- LOG(ERROR) << "BufferHubQueueProducer::detachNextBuffer not implemented.";
+ ALOGE("BufferHubQueueProducer::detachNextBuffer not implemented.");
return INVALID_OPERATION;
}
@@ -163,14 +163,14 @@
// With this BufferHub backed implementation, we assume (for now) all buffers
// are allocated and owned by the BufferHub. Thus the attempt of transfering
// ownership of a buffer to the buffer queue is intentionally unsupported.
- LOG(FATAL) << "BufferHubQueueProducer::attachBuffer not supported.";
+ LOG_ALWAYS_FATAL("BufferHubQueueProducer::attachBuffer not supported.");
return INVALID_OPERATION;
}
status_t BufferHubQueueProducer::queueBuffer(int slot,
const QueueBufferInput& input,
QueueBufferOutput* /* output */) {
- VLOG(1) << "queueBuffer: slot " << slot;
+ ALOGD("queueBuffer: slot %d", slot);
int64_t timestamp;
sp<Fence> fence;
@@ -186,7 +186,7 @@
&scaling_mode, &transform, &fence);
if (fence == nullptr) {
- LOG(ERROR) << "queueBuffer: fence is NULL";
+ ALOGE("queueBuffer: fence is NULL");
return BAD_VALUE;
}
@@ -194,13 +194,12 @@
std::unique_lock<std::mutex> lock(core_->mutex_);
if (slot < 0 || slot >= req_buffer_count_) {
- LOG(ERROR) << "queueBuffer: slot index " << slot << " out of range [0, "
- << req_buffer_count_ << ")";
+ ALOGE("queueBuffer: slot index %d out of range [0, %d)", slot,
+ req_buffer_count_);
return BAD_VALUE;
} else if (!core_->buffers_[slot].mBufferState.isDequeued()) {
- LOG(ERROR) << "queueBuffer: slot " << slot
- << " is not owned by the producer (state = "
- << core_->buffers_[slot].mBufferState.string() << " )";
+ ALOGE("queueBuffer: slot %d is not owned by the producer (state = %s)",
+ slot, core_->buffers_[slot].mBufferState.string());
return BAD_VALUE;
}
@@ -218,21 +217,20 @@
status_t BufferHubQueueProducer::cancelBuffer(int slot,
const sp<Fence>& fence) {
- VLOG(1) << (__FUNCTION__);
+ ALOGD(__FUNCTION__);
std::unique_lock<std::mutex> lock(core_->mutex_);
if (slot < 0 || slot >= req_buffer_count_) {
- LOG(ERROR) << "cancelBuffer: slot index " << slot << " out of range [0, "
- << req_buffer_count_ << ")";
+ ALOGE("cancelBuffer: slot index %d out of range [0, %d)", slot,
+ req_buffer_count_);
return BAD_VALUE;
} else if (!core_->buffers_[slot].mBufferState.isDequeued()) {
- LOG(ERROR) << "cancelBuffer: slot " << slot
- << " is not owned by the producer (state = "
- << core_->buffers_[slot].mBufferState.string() << " )";
+ ALOGE("cancelBuffer: slot %d is not owned by the producer (state = %s)",
+ slot, core_->buffers_[slot].mBufferState.string());
return BAD_VALUE;
} else if (fence == NULL) {
- LOG(ERROR) << "cancelBuffer: fence is NULL";
+ ALOGE("cancelBuffer: fence is NULL");
return BAD_VALUE;
}
@@ -240,18 +238,18 @@
core_->producer_->Enqueue(buffer_producer, slot);
core_->buffers_[slot].mBufferState.cancel();
core_->buffers_[slot].mFence = fence;
- VLOG(1) << "cancelBuffer: slot " << slot;
+ ALOGD("cancelBuffer: slot %d", slot);
return NO_ERROR;
}
status_t BufferHubQueueProducer::query(int what, int* out_value) {
- VLOG(1) << (__FUNCTION__);
+ ALOGD(__FUNCTION__);
std::unique_lock<std::mutex> lock(core_->mutex_);
if (out_value == NULL) {
- LOG(ERROR) << "query: out_value was NULL";
+ ALOGE("query: out_value was NULL");
return BAD_VALUE;
}
@@ -277,7 +275,7 @@
return BAD_VALUE;
}
- VLOG(1) << "query: key=" << what << ", v=" << value;
+ ALOGD("query: key=%d, v=%d", what, value);
*out_value = value;
return NO_ERROR;
}
@@ -287,14 +285,14 @@
bool /* producer_controlled_by_app */, QueueBufferOutput* /* output */) {
// Consumer interaction are actually handled by buffer hub, and we need
// to maintain consumer operations here. Hence |connect| is a NO-OP.
- VLOG(1) << (__FUNCTION__);
+ ALOGD(__FUNCTION__);
return NO_ERROR;
}
status_t BufferHubQueueProducer::disconnect(int /* api */, DisconnectMode /* mode */) {
// Consumer interaction are actually handled by buffer hub, and we need
// to maintain consumer operations here. Hence |disconnect| is a NO-OP.
- VLOG(1) << (__FUNCTION__);
+ ALOGD(__FUNCTION__);
return NO_ERROR;
}
@@ -303,7 +301,7 @@
if (stream != NULL) {
// TODO(jwcai) Investigate how is is used, maybe use BufferHubBuffer's
// metadata.
- LOG(ERROR) << "SidebandStream is not currently supported.";
+ ALOGE("SidebandStream is not currently supported.");
return INVALID_OPERATION;
}
return NO_ERROR;
@@ -316,17 +314,17 @@
// TODO(jwcai) |allocateBuffers| aims to preallocate up to the maximum number
// of buffers permitted by the current BufferQueue configuration (aka
// |req_buffer_count_|).
- LOG(ERROR) << "BufferHubQueueProducer::allocateBuffers not implemented.";
+ ALOGE("BufferHubQueueProducer::allocateBuffers not implemented.");
}
status_t BufferHubQueueProducer::allowAllocation(bool /* allow */) {
- LOG(ERROR) << "BufferHubQueueProducer::allowAllocation not implemented.";
+ ALOGE("BufferHubQueueProducer::allowAllocation not implemented.");
return INVALID_OPERATION;
}
status_t BufferHubQueueProducer::setGenerationNumber(
uint32_t generation_number) {
- VLOG(1) << (__FUNCTION__);
+ ALOGD(__FUNCTION__);
std::unique_lock<std::mutex> lock(core_->mutex_);
core_->generation_number_ = generation_number;
@@ -337,23 +335,23 @@
// BufferHub based implementation could have one to many producer/consumer
// relationship, thus |getConsumerName| from the producer side does not
// make any sense.
- LOG(ERROR) << "BufferHubQueueProducer::getConsumerName not supported.";
+ ALOGE("BufferHubQueueProducer::getConsumerName not supported.");
return String8("BufferHubQueue::DummyConsumer");
}
status_t BufferHubQueueProducer::setSharedBufferMode(
bool /* shared_buffer_mode */) {
- LOG(ERROR) << "BufferHubQueueProducer::setSharedBufferMode not implemented.";
+ ALOGE("BufferHubQueueProducer::setSharedBufferMode not implemented.");
return INVALID_OPERATION;
}
status_t BufferHubQueueProducer::setAutoRefresh(bool /* auto_refresh */) {
- LOG(ERROR) << "BufferHubQueueProducer::setAutoRefresh not implemented.";
+ ALOGE("BufferHubQueueProducer::setAutoRefresh not implemented.");
return INVALID_OPERATION;
}
status_t BufferHubQueueProducer::setDequeueTimeout(nsecs_t timeout) {
- VLOG(1) << (__FUNCTION__);
+ ALOGD(__FUNCTION__);
std::unique_lock<std::mutex> lock(core_->mutex_);
core_->dequeue_timeout_ms_ = static_cast<int>(timeout / (1000 * 1000));
@@ -363,17 +361,17 @@
status_t BufferHubQueueProducer::getLastQueuedBuffer(
sp<GraphicBuffer>* /* out_buffer */, sp<Fence>* /* out_fence */,
float /*out_transform_matrix*/[16]) {
- LOG(ERROR) << "BufferHubQueueProducer::getLastQueuedBuffer not implemented.";
+ ALOGE("BufferHubQueueProducer::getLastQueuedBuffer not implemented.");
return INVALID_OPERATION;
}
void BufferHubQueueProducer::getFrameTimestamps(
FrameEventHistoryDelta* /*outDelta*/) {
- LOG(ERROR) << "BufferHubQueueProducer::getFrameTimestamps not implemented.";
+ ALOGE("BufferHubQueueProducer::getFrameTimestamps not implemented.");
}
status_t BufferHubQueueProducer::getUniqueId(uint64_t* out_id) const {
- VLOG(1) << (__FUNCTION__);
+ ALOGD(__FUNCTION__);
*out_id = core_->unique_id_;
return NO_ERROR;
@@ -382,7 +380,7 @@
IBinder* BufferHubQueueProducer::onAsBinder() {
// BufferHubQueueProducer is a non-binder implementation of
// IGraphicBufferProducer.
- LOG(WARNING) << "BufferHubQueueProducer::onAsBinder is not supported.";
+ ALOGW("BufferHubQueueProducer::onAsBinder is not supported.");
return nullptr;
}
diff --git a/libs/vr/libdisplay/Android.mk b/libs/vr/libdisplay/Android.mk
index 670bdcd..f0e62df 100644
--- a/libs/vr/libdisplay/Android.mk
+++ b/libs/vr/libdisplay/Android.mk
@@ -49,7 +49,6 @@
libsync
staticLibraries := \
- libchrome \
libbufferhub \
libbufferhubqueue \
libdvrcommon \
diff --git a/libs/vr/libdisplay/display_client.cpp b/libs/vr/libdisplay/display_client.cpp
index cfb346d..54098e8 100644
--- a/libs/vr/libdisplay/display_client.cpp
+++ b/libs/vr/libdisplay/display_client.cpp
@@ -1,7 +1,7 @@
#include "include/private/dvr/display_client.h"
-#include <cutils/log.h>
#include <cutils/native_handle.h>
+#include <log/log.h>
#include <pdx/default_transport/client_channel.h>
#include <pdx/default_transport/client_channel_factory.h>
#include <pdx/status.h>
diff --git a/libs/vr/libdisplay/frame_history.cpp b/libs/vr/libdisplay/frame_history.cpp
index 67e4a09..154afbe 100644
--- a/libs/vr/libdisplay/frame_history.cpp
+++ b/libs/vr/libdisplay/frame_history.cpp
@@ -1,7 +1,7 @@
#include <private/dvr/frame_history.h>
-#include <cutils/log.h>
#include <errno.h>
+#include <log/log.h>
#include <sync/sync.h>
#include <pdx/file_handle.h>
diff --git a/libs/vr/libdisplay/gl_fenced_flush.cpp b/libs/vr/libdisplay/gl_fenced_flush.cpp
index 64b2e99..c70d554 100644
--- a/libs/vr/libdisplay/gl_fenced_flush.cpp
+++ b/libs/vr/libdisplay/gl_fenced_flush.cpp
@@ -6,7 +6,7 @@
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <utils/Trace.h>
-#include <base/logging.h>
+#include <log/log.h>
using android::pdx::LocalHandle;
@@ -22,14 +22,14 @@
eglCreateSyncKHR(display, EGL_SYNC_NATIVE_FENCE_ANDROID, attribs);
glFlush();
if (sync_point == EGL_NO_SYNC_KHR) {
- LOG(ERROR) << "sync_point == EGL_NO_SYNC_KHR";
+ ALOGE("sync_point == EGL_NO_SYNC_KHR");
return LocalHandle();
}
EGLint fence_fd = eglDupNativeFenceFDANDROID(display, sync_point);
eglDestroySyncKHR(display, sync_point);
if (fence_fd == EGL_NO_NATIVE_FENCE_FD_ANDROID) {
- LOG(ERROR) << "fence_fd == EGL_NO_NATIVE_FENCE_FD_ANDROID";
+ ALOGE("fence_fd == EGL_NO_NATIVE_FENCE_FD_ANDROID");
return LocalHandle();
}
return LocalHandle(fence_fd);
diff --git a/libs/vr/libdisplay/graphics.cpp b/libs/vr/libdisplay/graphics.cpp
index d599616..d0557a9 100644
--- a/libs/vr/libdisplay/graphics.cpp
+++ b/libs/vr/libdisplay/graphics.cpp
@@ -1,10 +1,11 @@
#include <dvr/graphics.h>
+#include <inttypes.h>
#include <sys/timerfd.h>
#include <array>
#include <vector>
-#include <cutils/log.h>
+#include <log/log.h>
#include <utils/Trace.h>
#ifndef VK_USE_PLATFORM_ANDROID_KHR
@@ -372,8 +373,8 @@
case DVR_SURFACE_PARAMETER_VK_SWAPCHAIN_IMAGE_FORMAT_OUT:
break;
default:
- ALOGE("Invalid display surface parameter: key=%d value=%ld", p->key,
- p->value);
+ ALOGE("Invalid display surface parameter: key=%d value=%" PRId64,
+ p->key, p->value);
return nullptr;
}
}
@@ -583,7 +584,8 @@
static int LockBuffer_DEPRECATED(ANativeWindow* window,
ANativeWindowBuffer* buffer);
- DISALLOW_COPY_AND_ASSIGN(DvrGraphicsContext);
+ DvrGraphicsContext(const DvrGraphicsContext&) = delete;
+ void operator=(const DvrGraphicsContext&) = delete;
};
DvrGraphicsContext::DvrGraphicsContext()
@@ -743,8 +745,8 @@
// so that anyone who tries to bind an FBO to context->texture_id
// will not get an incomplete buffer.
context->current_buffer = context->buffer_queue->Dequeue();
- CHECK(context->gl.texture_count ==
- context->current_buffer->buffer()->slice_count());
+ LOG_ALWAYS_FATAL_IF(context->gl.texture_count !=
+ context->current_buffer->buffer()->slice_count());
for (int i = 0; i < context->gl.texture_count; ++i) {
glBindTexture(context->gl.texture_target_type, context->gl.texture_id[i]);
glEGLImageTargetTexture2DOES(context->gl.texture_target_type,
@@ -794,12 +796,12 @@
result = vkCreateAndroidSurfaceKHR(
context->vk.instance, &android_surface_ci,
context->vk.allocation_callbacks, &context->vk.surface);
- CHECK_EQ(result, VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
VkBool32 surface_supports_present = VK_FALSE;
result = vkGetPhysicalDeviceSurfaceSupportKHR(
context->vk.physical_device, context->vk.present_queue_family,
context->vk.surface, &surface_supports_present);
- CHECK_EQ(result, VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
if (!surface_supports_present) {
ALOGE("Error: provided queue family (%u) does not support presentation",
context->vk.present_queue_family);
@@ -809,21 +811,22 @@
result = vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
context->vk.physical_device, context->vk.surface,
&surface_capabilities);
- CHECK_EQ(result, VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
// Determine the swapchain image format.
uint32_t device_surface_format_count = 0;
result = vkGetPhysicalDeviceSurfaceFormatsKHR(
context->vk.physical_device, context->vk.surface,
&device_surface_format_count, nullptr);
- CHECK_EQ(result, VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
std::vector<VkSurfaceFormatKHR> device_surface_formats(
device_surface_format_count);
result = vkGetPhysicalDeviceSurfaceFormatsKHR(
context->vk.physical_device, context->vk.surface,
&device_surface_format_count, device_surface_formats.data());
- CHECK_EQ(result, VK_SUCCESS);
- CHECK_GT(device_surface_format_count, 0U);
- CHECK_NE(device_surface_formats[0].format, VK_FORMAT_UNDEFINED);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(device_surface_format_count == 0U);
+ LOG_ALWAYS_FATAL_IF(device_surface_formats[0].format ==
+ VK_FORMAT_UNDEFINED);
VkSurfaceFormatKHR present_surface_format = device_surface_formats[0];
// Determine the swapchain present mode.
// TODO(cort): query device_present_modes to make sure MAILBOX is supported.
@@ -832,19 +835,19 @@
result = vkGetPhysicalDeviceSurfacePresentModesKHR(
context->vk.physical_device, context->vk.surface,
&device_present_mode_count, nullptr);
- CHECK_EQ(result, VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
std::vector<VkPresentModeKHR> device_present_modes(
device_present_mode_count);
result = vkGetPhysicalDeviceSurfacePresentModesKHR(
context->vk.physical_device, context->vk.surface,
&device_present_mode_count, device_present_modes.data());
- CHECK_EQ(result, VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
VkPresentModeKHR present_mode = VK_PRESENT_MODE_MAILBOX_KHR;
// Extract presentation surface extents, image count, transform, usages,
// etc.
- LOG_ASSERT(
- static_cast<int>(surface_capabilities.currentExtent.width) != -1 &&
- static_cast<int>(surface_capabilities.currentExtent.height) != -1);
+ LOG_ALWAYS_FATAL_IF(
+ static_cast<int>(surface_capabilities.currentExtent.width) == -1 ||
+ static_cast<int>(surface_capabilities.currentExtent.height) == -1);
VkExtent2D swapchain_extent = surface_capabilities.currentExtent;
uint32_t desired_image_count = surface_capabilities.minImageCount;
@@ -856,8 +859,8 @@
surface_capabilities.currentTransform;
VkImageUsageFlags image_usage_flags =
surface_capabilities.supportedUsageFlags;
- CHECK_NE(surface_capabilities.supportedCompositeAlpha,
- static_cast<VkFlags>(0));
+ LOG_ALWAYS_FATAL_IF(surface_capabilities.supportedCompositeAlpha ==
+ static_cast<VkFlags>(0));
VkCompositeAlphaFlagBitsKHR composite_alpha =
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
if (!(surface_capabilities.supportedCompositeAlpha &
@@ -889,18 +892,18 @@
result = vkCreateSwapchainKHR(context->vk.device, &swapchain_ci,
context->vk.allocation_callbacks,
&context->vk.swapchain);
- CHECK_EQ(result, VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
// Create swapchain image views
uint32_t image_count = 0;
result = vkGetSwapchainImagesKHR(context->vk.device, context->vk.swapchain,
&image_count, nullptr);
- CHECK_EQ(result, VK_SUCCESS);
- CHECK_GT(image_count, 0U);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(image_count == 0U);
context->vk.swapchain_images.resize(image_count);
result = vkGetSwapchainImagesKHR(context->vk.device, context->vk.swapchain,
&image_count,
context->vk.swapchain_images.data());
- CHECK_EQ(result, VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
context->vk.swapchain_image_views.resize(image_count);
VkImageViewCreateInfo image_view_ci = {};
image_view_ci.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
@@ -923,7 +926,7 @@
result = vkCreateImageView(context->vk.device, &image_view_ci,
context->vk.allocation_callbacks,
&context->vk.swapchain_image_views[i]);
- CHECK_EQ(result, VK_SUCCESS);
+ LOG_ALWAYS_FATAL_IF(result != VK_SUCCESS);
}
// Fill in any requested output parameters.
for (auto p = parameters; p && p->key != DVR_SURFACE_PARAMETER_NONE; ++p) {
@@ -950,7 +953,7 @@
// by the Vulkan path.
int DvrGraphicsContext::Post(android::dvr::NativeBufferProducer* buffer,
int fence_fd) {
- LOG_ASSERT(graphics_api == DVR_GRAPHICS_API_VULKAN);
+ LOG_ALWAYS_FATAL_IF(graphics_api != DVR_GRAPHICS_API_VULKAN);
ATRACE_NAME(__PRETTY_FUNCTION__);
ALOGI_IF(TRACE, "DvrGraphicsContext::Post: buffer_id=%d, fence_fd=%d",
buffer->buffer()->id(), fence_fd);
@@ -967,7 +970,7 @@
ALOGI_IF(TRACE, "SetSwapInterval: window=%p interval=%d", window, interval);
DvrGraphicsContext* self = getSelf(window);
(void)self;
- LOG_ASSERT(self->graphics_api == DVR_GRAPHICS_API_VULKAN);
+ LOG_ALWAYS_FATAL_IF(self->graphics_api != DVR_GRAPHICS_API_VULKAN);
return android::NO_ERROR;
}
@@ -977,7 +980,7 @@
ATRACE_NAME(__PRETTY_FUNCTION__);
DvrGraphicsContext* self = getSelf(window);
- LOG_ASSERT(self->graphics_api == DVR_GRAPHICS_API_VULKAN);
+ LOG_ALWAYS_FATAL_IF(self->graphics_api != DVR_GRAPHICS_API_VULKAN);
std::lock_guard<std::mutex> autolock(self->lock_);
if (!self->current_buffer) {
@@ -997,7 +1000,7 @@
ALOGI_IF(TRACE, "NativeWindow::QueueBuffer: fence_fd=%d", fence_fd);
DvrGraphicsContext* self = getSelf(window);
- LOG_ASSERT(self->graphics_api == DVR_GRAPHICS_API_VULKAN);
+ LOG_ALWAYS_FATAL_IF(self->graphics_api != DVR_GRAPHICS_API_VULKAN);
std::lock_guard<std::mutex> autolock(self->lock_);
android::dvr::NativeBufferProducer* native_buffer =
@@ -1007,7 +1010,7 @@
if (self->buffer_already_posted) {
// Check that the buffer is the one we expect, but handle it if this happens
// in production by allowing this buffer to post on top of the previous one.
- DCHECK(native_buffer == self->current_buffer);
+ LOG_FATAL_IF(native_buffer != self->current_buffer);
if (native_buffer == self->current_buffer) {
do_post = false;
if (fence_fd >= 0)
@@ -1031,7 +1034,7 @@
ALOGI_IF(TRACE, "DvrGraphicsContext::CancelBuffer: fence_fd: %d", fence_fd);
DvrGraphicsContext* self = getSelf(window);
- LOG_ASSERT(self->graphics_api == DVR_GRAPHICS_API_VULKAN);
+ LOG_ALWAYS_FATAL_IF(self->graphics_api != DVR_GRAPHICS_API_VULKAN);
std::lock_guard<std::mutex> autolock(self->lock_);
android::dvr::NativeBufferProducer* native_buffer =
@@ -1042,7 +1045,7 @@
if (self->buffer_already_posted) {
// Check that the buffer is the one we expect, but handle it if this happens
// in production by returning this buffer to the buffer queue.
- DCHECK(native_buffer == self->current_buffer);
+ LOG_FATAL_IF(native_buffer != self->current_buffer);
if (native_buffer == self->current_buffer) {
do_enqueue = false;
}
@@ -1061,7 +1064,7 @@
int DvrGraphicsContext::Query(const ANativeWindow* window, int what,
int* value) {
DvrGraphicsContext* self = getSelf(const_cast<ANativeWindow*>(window));
- LOG_ASSERT(self->graphics_api == DVR_GRAPHICS_API_VULKAN);
+ LOG_ALWAYS_FATAL_IF(self->graphics_api != DVR_GRAPHICS_API_VULKAN);
std::lock_guard<std::mutex> autolock(self->lock_);
switch (what) {
@@ -1100,7 +1103,7 @@
int DvrGraphicsContext::Perform(ANativeWindow* window, int operation, ...) {
DvrGraphicsContext* self = getSelf(window);
- LOG_ASSERT(self->graphics_api == DVR_GRAPHICS_API_VULKAN);
+ LOG_ALWAYS_FATAL_IF(self->graphics_api != DVR_GRAPHICS_API_VULKAN);
std::lock_guard<std::mutex> autolock(self->lock_);
va_list args;
@@ -1231,7 +1234,7 @@
float32x4_t render_pose_orientation,
float32x4_t render_pose_translation) {
ATRACE_NAME("dvrBeginRenderFrameEds");
- LOG_ASSERT(graphics_context->graphics_api == DVR_GRAPHICS_API_GLES);
+ LOG_ALWAYS_FATAL_IF(graphics_context->graphics_api != DVR_GRAPHICS_API_GLES);
CHECK_GL();
// Grab a buffer from the queue and set its pose.
if (!graphics_context->current_buffer) {
@@ -1270,7 +1273,8 @@
uint32_t* swapchain_image_index,
VkImageView* swapchain_image_view) {
ATRACE_NAME("dvrBeginRenderFrameEds");
- LOG_ASSERT(graphics_context->graphics_api == DVR_GRAPHICS_API_VULKAN);
+ LOG_ALWAYS_FATAL_IF(graphics_context->graphics_api !=
+ DVR_GRAPHICS_API_VULKAN);
// Acquire a swapchain image. This calls Dequeue() internally.
VkResult result = vkAcquireNextImageKHR(
@@ -1313,7 +1317,7 @@
return -EPERM;
}
if (num_views > DVR_GRAPHICS_SURFACE_MAX_VIEWS) {
- LOG(ERROR) << "dvrBeginRenderFrameLateLatch called with too many views.";
+ ALOGE("dvrBeginRenderFrameLateLatch called with too many views.");
return -EINVAL;
}
dvrBeginRenderFrameEds(graphics_context, DVR_POSE_LATE_LATCH,
@@ -1424,7 +1428,7 @@
ATRACE_NAME("dvrGraphicsPostEarly");
ALOGI_IF(TRACE, "dvrGraphicsPostEarly");
- LOG_ASSERT(graphics_context->graphics_api == DVR_GRAPHICS_API_GLES);
+ LOG_ALWAYS_FATAL_IF(graphics_context->graphics_api != DVR_GRAPHICS_API_GLES);
// Note that this function can be called before or after
// dvrBeginRenderFrame.
@@ -1445,7 +1449,7 @@
}
int dvrPresent(DvrGraphicsContext* graphics_context) {
- LOG_ASSERT(graphics_context->graphics_api == DVR_GRAPHICS_API_GLES);
+ LOG_ALWAYS_FATAL_IF(graphics_context->graphics_api != DVR_GRAPHICS_API_GLES);
std::array<char, 128> buf;
snprintf(buf.data(), buf.size(), "dvrPresent|vsync=%d|",
@@ -1482,7 +1486,8 @@
int dvrPresentVk(DvrGraphicsContext* graphics_context,
VkSemaphore submit_semaphore, uint32_t swapchain_image_index) {
- LOG_ASSERT(graphics_context->graphics_api == DVR_GRAPHICS_API_VULKAN);
+ LOG_ALWAYS_FATAL_IF(graphics_context->graphics_api !=
+ DVR_GRAPHICS_API_VULKAN);
std::array<char, 128> buf;
snprintf(buf.data(), buf.size(), "dvrPresent|vsync=%d|",
@@ -1549,7 +1554,7 @@
auto display_surface = graphics_context->display_surface;
// A DisplaySurface must be created prior to the creation of a
// VideoMeshSurface.
- LOG_ASSERT(display_surface != nullptr);
+ LOG_ALWAYS_FATAL_IF(display_surface == nullptr);
LocalChannelHandle surface_handle = display_surface->CreateVideoMeshSurface();
if (!surface_handle.valid()) {
diff --git a/libs/vr/libdisplay/include/private/dvr/video_mesh_surface_client.h b/libs/vr/libdisplay/include/private/dvr/video_mesh_surface_client.h
index a2659a6..e52d0b9 100644
--- a/libs/vr/libdisplay/include/private/dvr/video_mesh_surface_client.h
+++ b/libs/vr/libdisplay/include/private/dvr/video_mesh_surface_client.h
@@ -1,7 +1,6 @@
#ifndef ANDROID_DVR_VIDEO_MESH_SURFACE_CLIENT_H_
#define ANDROID_DVR_VIDEO_MESH_SURFACE_CLIENT_H_
-#include <base/macros.h>
#include <private/dvr/buffer_hub_queue_client.h>
#include <private/dvr/display_client.h>
diff --git a/libs/vr/libdisplay/late_latch.cpp b/libs/vr/libdisplay/late_latch.cpp
index 3681e10..b1a1589 100644
--- a/libs/vr/libdisplay/late_latch.cpp
+++ b/libs/vr/libdisplay/late_latch.cpp
@@ -6,7 +6,7 @@
#include <iostream>
#include <string>
-#include <base/logging.h>
+#include <log/log.h>
#include <private/dvr/clock_ns.h>
#include <private/dvr/debug.h>
#include <private/dvr/graphics/gpu_profiler.h>
@@ -20,7 +20,6 @@
#ifndef LOG_TAG
#define LOG_TAG "latelatch"
#endif
-#include <cutils/log.h>
#define PE(str, ...) \
fprintf(stderr, "[%s:%d] " str, __FILE__, __LINE__, ##__VA_ARGS__); \
@@ -268,18 +267,18 @@
LocalHandle pose_buffer_fd;
pose_client_ = dvrPoseCreate();
if (!pose_client_) {
- LOG(ERROR) << "LateLatch Error: failed to create pose client";
+ ALOGE("LateLatch Error: failed to create pose client");
} else {
int ret = privateDvrPoseGetRingBufferFd(pose_client_, &pose_buffer_fd);
if (ret < 0) {
- LOG(ERROR) << "LateLatch Error: failed to get pose ring buffer";
+ ALOGE("LateLatch Error: failed to get pose ring buffer");
}
}
glGenBuffers(1, &pose_buffer_object_);
glGenBuffers(1, &metadata_buffer_id_);
if (!glBindSharedBufferQCOM) {
- LOG(ERROR) << "Error: Missing gralloc buffer extension, no pose data";
+ ALOGE("Error: Missing gralloc buffer extension, no pose data");
} else {
if (pose_buffer_fd) {
glBindBuffer(GL_SHADER_STORAGE_BUFFER, pose_buffer_object_);
@@ -346,7 +345,7 @@
}
void LateLatch::AddLateLatch(const LateLatchInput& data) const {
- CHECK(is_app_late_latch_);
+ LOG_ALWAYS_FATAL_IF(!is_app_late_latch_);
CHECK_GL();
late_latch_program_.Use();
@@ -361,7 +360,7 @@
if (adata)
*adata = data;
else
- LOG(ERROR) << "Error: LateLatchInput gl mapping is null";
+ ALOGE("Error: LateLatchInput gl mapping is null");
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, INPUT_BINDING, input_buffer_id_);
glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
@@ -410,7 +409,7 @@
void LateLatch::AddEdsLateLatch(const LateLatchInput& data,
GLuint render_pose_buffer_object) const {
- CHECK(!is_app_late_latch_);
+ LOG_ALWAYS_FATAL_IF(is_app_late_latch_);
late_latch_program_.Use();
// Fall back on internal buffer when none is provided.
diff --git a/libs/vr/libdisplay/native_buffer_queue.cpp b/libs/vr/libdisplay/native_buffer_queue.cpp
index 2d1e23d..8dd0ee0 100644
--- a/libs/vr/libdisplay/native_buffer_queue.cpp
+++ b/libs/vr/libdisplay/native_buffer_queue.cpp
@@ -1,7 +1,6 @@
#include "include/private/dvr/native_buffer_queue.h"
-#include <base/logging.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include <sys/epoll.h>
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <utils/Trace.h>
@@ -23,7 +22,7 @@
: surface_(surface),
buffers_(capacity),
buffer_queue_(capacity) {
- CHECK(surface);
+ LOG_ALWAYS_FATAL_IF(!surface);
epoll_fd_ = epoll_create(64);
if (epoll_fd_ < 0) {
@@ -34,7 +33,7 @@
// The kSurfaceBufferMaxCount must be >= the capacity so that shader code
// can bind surface buffer array data.
- CHECK(kSurfaceBufferMaxCount >= capacity);
+ LOG_ALWAYS_FATAL_IF(kSurfaceBufferMaxCount < capacity);
for (size_t i = 0; i < capacity; i++) {
uint32_t buffer_index = 0;
diff --git a/libs/vr/libdisplay/native_window.cpp b/libs/vr/libdisplay/native_window.cpp
index 63c81ed..24ecd8a 100644
--- a/libs/vr/libdisplay/native_window.cpp
+++ b/libs/vr/libdisplay/native_window.cpp
@@ -1,7 +1,6 @@
#include <EGL/egl.h>
#include <android/native_window.h>
-#include <base/logging.h>
#include <cutils/native_handle.h>
#include <errno.h>
#include <pthread.h>
@@ -17,7 +16,7 @@
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <utils/Trace.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include <memory>
#include <mutex>
@@ -177,7 +176,7 @@
if (self->next_buffer_already_posted_) {
// Check that the buffer is the one we expect, but handle it if this happens
// in production by allowing this buffer to post on top of the previous one.
- DCHECK(native_buffer == self->next_post_buffer_.get());
+ LOG_FATAL_IF(native_buffer != self->next_post_buffer_.get());
if (native_buffer == self->next_post_buffer_.get()) {
do_post = false;
if (fence_fd >= 0)
@@ -210,7 +209,7 @@
if (self->next_buffer_already_posted_) {
// Check that the buffer is the one we expect, but handle it if this happens
// in production by returning this buffer to the buffer queue.
- DCHECK(native_buffer == self->next_post_buffer_.get());
+ LOG_FATAL_IF(native_buffer != self->next_post_buffer_.get());
if (native_buffer == self->next_post_buffer_.get()) {
do_enqueue = false;
}
diff --git a/libs/vr/libdisplay/screenshot_client.cpp b/libs/vr/libdisplay/screenshot_client.cpp
index 78f5e0f..3ad0c68 100644
--- a/libs/vr/libdisplay/screenshot_client.cpp
+++ b/libs/vr/libdisplay/screenshot_client.cpp
@@ -1,6 +1,6 @@
#include "include/private/dvr/screenshot_client.h"
-#include <cutils/log.h>
+#include <log/log.h>
#include <mutex>
diff --git a/libs/vr/libdisplay/vsync_client.cpp b/libs/vr/libdisplay/vsync_client.cpp
index c4cad50..a0fb313 100644
--- a/libs/vr/libdisplay/vsync_client.cpp
+++ b/libs/vr/libdisplay/vsync_client.cpp
@@ -1,6 +1,6 @@
#include "include/private/dvr/vsync_client.h"
-#include <cutils/log.h>
+#include <log/log.h>
#include <pdx/default_transport/client_channel_factory.h>
#include <private/dvr/display_rpc.h>
diff --git a/libs/vr/libdvrcommon/Android.mk b/libs/vr/libdvrcommon/Android.mk
index 72afab2..80eb3a6 100644
--- a/libs/vr/libdvrcommon/Android.mk
+++ b/libs/vr/libdvrcommon/Android.mk
@@ -36,7 +36,6 @@
libhardware
staticLibraries := \
- libchrome \
libpdx_default_transport \
include $(CLEAR_VARS)
diff --git a/libs/vr/libdvrcommon/frame_time_history.cpp b/libs/vr/libdvrcommon/frame_time_history.cpp
index 796498c..d4718a9 100644
--- a/libs/vr/libdvrcommon/frame_time_history.cpp
+++ b/libs/vr/libdvrcommon/frame_time_history.cpp
@@ -1,6 +1,6 @@
#include <private/dvr/frame_time_history.h>
-#include <cutils/log.h>
+#include <log/log.h>
namespace android {
namespace dvr {
diff --git a/libs/vr/libdvrcommon/include/private/dvr/debug.h b/libs/vr/libdvrcommon/include/private/dvr/debug.h
index 7db681a..c31a385 100644
--- a/libs/vr/libdvrcommon/include/private/dvr/debug.h
+++ b/libs/vr/libdvrcommon/include/private/dvr/debug.h
@@ -4,15 +4,15 @@
#include <GLES3/gl3.h>
#include <math.h>
-#include <base/logging.h>
+#include <log/log.h>
#ifndef NDEBUG
-#define CHECK_GL() \
- do { \
- const GLenum err = glGetError(); \
- if (err != GL_NO_ERROR) { \
- LOG(ERROR) << "OpenGL error " << err; \
- } \
+#define CHECK_GL() \
+ do { \
+ const GLenum err = glGetError(); \
+ if (err != GL_NO_ERROR) { \
+ ALOGE("OpenGL error %d", err); \
+ } \
} while (0)
#define CHECK_GL_FBO() \
@@ -22,10 +22,10 @@
case GL_FRAMEBUFFER_COMPLETE: \
break; \
case GL_FRAMEBUFFER_UNSUPPORTED: \
- LOG(ERROR) << "GL_FRAMEBUFFER_UNSUPPORTED"; \
+ ALOGE("GL_FRAMEBUFFER_UNSUPPORTED"); \
break; \
default: \
- LOG(ERROR) << "FBO user error: " << status; \
+ ALOGE("FBO user error: %d", status); \
break; \
} \
} while (0)
diff --git a/libs/vr/libdvrcommon/include/private/dvr/epoll_file_descriptor.h b/libs/vr/libdvrcommon/include/private/dvr/epoll_file_descriptor.h
index 8df741c..91e12c5 100644
--- a/libs/vr/libdvrcommon/include/private/dvr/epoll_file_descriptor.h
+++ b/libs/vr/libdvrcommon/include/private/dvr/epoll_file_descriptor.h
@@ -2,7 +2,7 @@
#define LIBS_VR_LIBDVRCOMMON_INCLUDE_PRIVATE_DVR_EPOLL_FILE_DESCRIPTOR_H_
#include <android-base/unique_fd.h>
-#include <base/logging.h>
+#include <log/log.h>
#include <sys/epoll.h>
namespace android {
@@ -24,7 +24,7 @@
int Create() {
if (IsValid()) {
- LOG(WARNING) << "epoll fd has already been created.";
+ ALOGW("epoll fd has already been created.");
return -EALREADY;
}
diff --git a/libs/vr/libdvrcommon/include/private/dvr/log_helpers.h b/libs/vr/libdvrcommon/include/private/dvr/log_helpers.h
index c9f7f8e..12ef622 100644
--- a/libs/vr/libdvrcommon/include/private/dvr/log_helpers.h
+++ b/libs/vr/libdvrcommon/include/private/dvr/log_helpers.h
@@ -2,8 +2,8 @@
#define ANDROID_DVR_LOG_HELPERS_H_
#include <iomanip>
+#include <ostream>
-#include <base/logging.h>
#include <private/dvr/eigen.h>
#include <private/dvr/field_of_view.h>
@@ -32,7 +32,8 @@
template <typename T>
inline std::ostream& operator<<(std::ostream& out,
const Eigen::AffineMatrix<T, 4>& mat) {
- out << std::setfill(' ') << std::setprecision(4) << std::fixed << std::showpos;
+ out << std::setfill(' ') << std::setprecision(4) << std::fixed
+ << std::showpos;
out << "\nmat4[";
out << std::setw(10) << mat(0, 0) << " " << std::setw(10) << mat(0, 1) << " "
<< std::setw(10) << mat(0, 2) << " " << std::setw(10) << mat(0, 3);
diff --git a/libs/vr/libdvrcommon/revision.cpp b/libs/vr/libdvrcommon/revision.cpp
index ae8603f..7925f65 100644
--- a/libs/vr/libdvrcommon/revision.cpp
+++ b/libs/vr/libdvrcommon/revision.cpp
@@ -9,7 +9,7 @@
#include <sys/types.h>
#include <unistd.h>
-#include <base/logging.h>
+#include <log/log.h>
#include "revision_path.h"
@@ -74,16 +74,16 @@
fd = open(dvr_product_revision_file_path(), O_RDONLY);
if (fd < 0) {
- PLOG(ERROR) << "Could not open '" << dvr_product_revision_file_path()
- << "' to get product revision";
+ ALOGE("Could not open '%s' to get product revision: %s",
+ dvr_product_revision_file_path(), strerror(errno));
global_product_revision_processed = true;
return;
}
read_rc = read(fd, global_product_revision_str, kProductRevisionStringSize);
if (read_rc <= 0) {
- PLOG(ERROR) << "Could not read from '" << dvr_product_revision_file_path()
- << "'";
+ ALOGE("Could not read from '%s': %s", dvr_product_revision_file_path(),
+ strerror(errno));
global_product_revision_processed = true;
return;
}
@@ -102,8 +102,8 @@
global_product = product_revision->product;
global_revision = product_revision->revision;
} else {
- LOG(ERROR) << "Unable to match '" << global_product_revision_str
- << "' to a product/revision.";
+ ALOGE("Unable to match '%s' to a product/revision.",
+ global_product_revision_str);
}
global_product_revision_processed = true;
diff --git a/libs/vr/libdvrgraphics/Android.mk b/libs/vr/libdvrgraphics/Android.mk
index 3d84319..b95b18e 100644
--- a/libs/vr/libdvrgraphics/Android.mk
+++ b/libs/vr/libdvrgraphics/Android.mk
@@ -13,7 +13,6 @@
$(LOCAL_PATH)/include
staticLibraries := \
- libchrome \
libbufferhub \
libdvrcommon \
libpdx_default_transport \
diff --git a/libs/vr/libdvrgraphics/blur.cpp b/libs/vr/libdvrgraphics/blur.cpp
index 7365b0e..90e271e 100644
--- a/libs/vr/libdvrgraphics/blur.cpp
+++ b/libs/vr/libdvrgraphics/blur.cpp
@@ -11,8 +11,7 @@
#include <string>
-#include <base/logging.h>
-#include <base/strings/string_number_conversions.h>
+#include <log/log.h>
#include <private/dvr/debug.h>
#include <private/dvr/graphics/egl_image.h>
#include <private/dvr/graphics/shader_program.h>
@@ -78,7 +77,7 @@
width_(w),
height_(h),
fbo_q_free_(1 + num_blur_outputs) {
- CHECK(num_blur_outputs > 0);
+ LOG_ALWAYS_FATAL_IF(num_blur_outputs <= 0);
source_fbo_ =
CreateFbo(w, h, source_texture, source_texture_target, is_external);
fbo_half_ = CreateFbo(w / 2, h / 2, 0, target_texture_target, is_external);
@@ -113,7 +112,7 @@
}
GLuint Blur::DrawBlur(GLuint source_texture) {
- CHECK(fbo_q_free_.GetSize() >= 2);
+ LOG_ALWAYS_FATAL_IF(fbo_q_free_.GetSize() < 2);
// Downsample to half w x half h.
glBindFramebuffer(GL_READ_FRAMEBUFFER, source_fbo_.fbo);
diff --git a/libs/vr/libdvrgraphics/gpu_profiler.cpp b/libs/vr/libdvrgraphics/gpu_profiler.cpp
index d252a34..49c515f 100644
--- a/libs/vr/libdvrgraphics/gpu_profiler.cpp
+++ b/libs/vr/libdvrgraphics/gpu_profiler.cpp
@@ -1,6 +1,6 @@
#include "include/private/dvr/graphics/gpu_profiler.h"
-#include <cutils/log.h>
+#include <log/log.h>
#include <private/dvr/clock_ns.h>
diff --git a/libs/vr/libdvrgraphics/shader_program.cpp b/libs/vr/libdvrgraphics/shader_program.cpp
index bf36eff..2d36600 100644
--- a/libs/vr/libdvrgraphics/shader_program.cpp
+++ b/libs/vr/libdvrgraphics/shader_program.cpp
@@ -3,15 +3,14 @@
#include <regex>
#include <sstream>
-#include <base/logging.h>
-#include <base/strings/string_util.h>
+#include <log/log.h>
namespace {
static bool CompileShader(GLuint shader, const std::string& shader_string) {
- std::string prefix = "";
- if (!base::StartsWith(shader_string, "#version",
- base::CompareCase::SENSITIVE)) {
+ std::string prefix;
+ const std::string kVersion = "#version";
+ if (shader_string.substr(0, kVersion.size()) != kVersion) {
prefix = "#version 310 es\n";
}
std::string string_with_prefix = prefix + shader_string;
@@ -24,8 +23,7 @@
if (!success) {
GLchar infoLog[512];
glGetShaderInfoLog(shader, 512, nullptr, infoLog);
- LOG(ERROR) << "Shader Failed to compile: " << *shader_str << " -- "
- << infoLog;
+ ALOGE("Shader Failed to compile: %s -- %s", *shader_str, infoLog);
return false;
}
return true;
@@ -43,7 +41,7 @@
if (!success) {
GLchar infoLog[512];
glGetProgramInfoLog(program, 512, nullptr, infoLog);
- LOG(ERROR) << "Shader failed to link: " << infoLog;
+ ALOGE("Shader failed to link: %s", infoLog);
return false;
}
@@ -60,7 +58,7 @@
if (!success) {
GLchar infoLog[512];
glGetProgramInfoLog(program, 512, nullptr, infoLog);
- LOG(ERROR) << "Shader failed to link: " << infoLog;
+ ALOGE("Shader failed to link: %s", infoLog);
return false;
}
diff --git a/libs/vr/libdvrgraphics/timer_query.cpp b/libs/vr/libdvrgraphics/timer_query.cpp
index dcc6216..23d2b7c 100644
--- a/libs/vr/libdvrgraphics/timer_query.cpp
+++ b/libs/vr/libdvrgraphics/timer_query.cpp
@@ -1,7 +1,7 @@
#include "include/private/dvr/graphics/timer_query.h"
#include <GLES2/gl2ext.h>
-#include <base/logging.h>
+#include <log/log.h>
namespace android {
namespace dvr {
@@ -38,7 +38,7 @@
double SyncTimerQuery::FlushAndGetTimeInMS() {
if (timer_.query_ == 0) {
- LOG(ERROR) << "Error: Only call FlushAndGetTimeInMS() once.";
+ ALOGE("Error: Only call FlushAndGetTimeInMS() once.");
return 0.0;
}
timer_.End();
@@ -51,7 +51,7 @@
GLint disjoint_occurred = 0;
glGetIntegerv(GL_GPU_DISJOINT_EXT, &disjoint_occurred);
if (disjoint_occurred) {
- LOG(ERROR) << "Disjoint occurred.";
+ ALOGE("Disjoint occurred.");
timer_.Delete();
return 0.0;
}
diff --git a/libs/vr/libeds/Android.mk b/libs/vr/libeds/Android.mk
index 0345f6d..373e68e 100644
--- a/libs/vr/libeds/Android.mk
+++ b/libs/vr/libeds/Android.mk
@@ -39,7 +39,6 @@
libvulkan
staticLibraries := \
- libchrome \
libdisplay \
libdvrcommon \
libdvrgraphics \
diff --git a/libs/vr/libeds/composite_hmd.cpp b/libs/vr/libeds/composite_hmd.cpp
index d29cd65..d6bf164 100644
--- a/libs/vr/libeds/composite_hmd.cpp
+++ b/libs/vr/libeds/composite_hmd.cpp
@@ -1,6 +1,7 @@
#include "include/private/dvr/composite_hmd.h"
-#include <base/logging.h>
+#include <log/log.h>
+
#include <private/dvr/numeric.h>
namespace android {
@@ -113,9 +114,9 @@
float meters_per_tan_angle = virtual_eye_to_screen_dist;
vec2 pixels_per_tan_angle = pixels_per_meter * meters_per_tan_angle;
- CHECK_NE(0.0f, display_width_meters);
- CHECK_NE(0.0f, display_height_meters);
- CHECK_NE(0.0f, virtual_eye_to_screen_dist);
+ LOG_ALWAYS_FATAL_IF(0.0f == display_width_meters);
+ LOG_ALWAYS_FATAL_IF(0.0f == display_height_meters);
+ LOG_ALWAYS_FATAL_IF(0.0f == virtual_eye_to_screen_dist);
// Height of lenses from the bottom of the screen.
float lens_y_center = 0;
diff --git a/libs/vr/libeds/distortion_renderer.cpp b/libs/vr/libeds/distortion_renderer.cpp
index a19843f..59029d8 100644
--- a/libs/vr/libeds/distortion_renderer.cpp
+++ b/libs/vr/libeds/distortion_renderer.cpp
@@ -8,7 +8,7 @@
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <utils/Trace.h>
-#include <base/logging.h>
+#include <log/log.h>
#include <private/dvr/clock_ns.h>
#include <private/dvr/composite_hmd.h>
#include <private/dvr/debug.h>
@@ -303,12 +303,12 @@
vert_builder += "#define COMPOSITE_LAYER_2\n";
frag_builder += "#define COMPOSITE_LAYER_2\n";
} else {
- CHECK_EQ(num_layers, 1);
+ LOG_ALWAYS_FATAL_IF(num_layers != 1);
}
if (blend_with_previous_layer) {
// Check for unsupported shader combinations:
- CHECK_EQ(num_layers, 1);
- CHECK_EQ(use_alpha_vignette, false);
+ LOG_ALWAYS_FATAL_IF(num_layers != 1);
+ LOG_ALWAYS_FATAL_IF(!use_alpha_vignette);
if (kUseFramebufferReadback)
frag_builder += "#define BLEND_WITH_PREVIOUS_LAYER\n";
}
@@ -320,7 +320,7 @@
vert_builder += vertex;
frag_builder += fragment;
pgm.Link(vert_builder, frag_builder);
- CHECK(pgm.IsUsable());
+ LOG_ALWAYS_FATAL_IF(!pgm.IsUsable());
pgm.Use();
@@ -343,7 +343,7 @@
projectionMatrix =
projectionMatrix * Eigen::AngleAxisf(rotation, vec3::UnitZ());
- CHECK(sizeof(mat4) == 4 * 4 * 4);
+ LOG_ALWAYS_FATAL_IF(sizeof(mat4) != 4 * 4 * 4);
glUniformMatrix4fv(uProjectionMatrix, 1, false, projectionMatrix.data());
}
@@ -367,8 +367,7 @@
if (eds_enabled_) {
// Late latch must be on if eds_enabled_ is true.
if (!late_latch_enabled) {
- LOG(ERROR) << "Cannot enable EDS without late latch. "
- << "Force enabling late latch.";
+ ALOGE("Cannot enable EDS without late latch. Force enabling late latch.");
late_latch_enabled = true;
}
}
@@ -633,11 +632,11 @@
PrepGlState(eye);
if (num_textures > kMaxLayers) {
- LOG(ERROR) << "Too many textures for DistortionRenderer";
+ ALOGE("Too many textures for DistortionRenderer");
num_textures = kMaxLayers;
}
- CHECK(num_textures == 1 || num_textures == 2);
+ LOG_ALWAYS_FATAL_IF(num_textures != 1 && num_textures != 2);
if (num_textures == 2) {
if (chromatic_aberration_correction_enabled_) {
@@ -776,7 +775,7 @@
bool DistortionRenderer::GetLastEdsPose(LateLatchOutput* out_data, int layer_id) const {
if (layer_id >= kMaxLayers) {
- LOG(ERROR) << "Accessing invalid layer " << layer_id << std::endl;
+ ALOGE("Accessing invalid layer %d", layer_id);
return false;
}
@@ -784,7 +783,7 @@
late_latch_[layer_id]->CaptureOutputData(out_data);
return true;
} else {
- LOG(ERROR) << "Late latch shader not enabled." << std::endl;
+ ALOGE("Late latch shader not enabled.");
return false;
}
}
diff --git a/libs/vr/libeds/eds_mesh.cpp b/libs/vr/libeds/eds_mesh.cpp
index 2c7dc2f..01a90cf 100644
--- a/libs/vr/libeds/eds_mesh.cpp
+++ b/libs/vr/libeds/eds_mesh.cpp
@@ -1,8 +1,8 @@
#include "include/private/dvr/eds_mesh.h"
+#include <log/log.h>
#include <math.h>
-#include <base/logging.h>
#include <private/dvr/types.h>
namespace {
@@ -105,7 +105,7 @@
// provided by |hmd| for |eye|.
EdsMesh BuildDistortionMesh(EyeType eye, int resolution,
const DistortionFunction& distortion_function) {
- CHECK_GT(resolution, 2);
+ LOG_ALWAYS_FATAL_IF(resolution <= 2);
// Number of indices produced by the strip method
// (see comment in ComputeDistortionMeshIndices):
diff --git a/libs/vr/libeds/lucid_pose_tracker.cpp b/libs/vr/libeds/lucid_pose_tracker.cpp
index c321bb0..5247020 100644
--- a/libs/vr/libeds/lucid_pose_tracker.cpp
+++ b/libs/vr/libeds/lucid_pose_tracker.cpp
@@ -1,7 +1,7 @@
#include "include/private/dvr/lucid_pose_tracker.h"
#define LOG_TAG "LucidPoseTracker"
-#include <cutils/log.h>
+#include <log/log.h>
#include <private/dvr/clock_ns.h>
diff --git a/libs/vr/libeds/tests/eds_app_tests.cpp b/libs/vr/libeds/tests/eds_app_tests.cpp
index 1742736..549d864 100644
--- a/libs/vr/libeds/tests/eds_app_tests.cpp
+++ b/libs/vr/libeds/tests/eds_app_tests.cpp
@@ -1,7 +1,6 @@
#include <EGL/egl.h>
#include <GLES2/gl2.h>
-#include <base/logging.h>
#include <dvr/graphics.h>
#include <dvr/pose_client.h>
#include <gtest/gtest.h>
diff --git a/libs/vr/libgvr/Android.mk b/libs/vr/libgvr/Android.mk
index 0fcf94b..be78605 100644
--- a/libs/vr/libgvr/Android.mk
+++ b/libs/vr/libgvr/Android.mk
@@ -68,14 +68,12 @@
libhardware \
liblog \
libsync \
- libevent \
libprotobuf-cpp-full
LOCAL_STATIC_LIBRARIES := \
libdisplay \
libbufferhub \
libbufferhubqueue \
- libchrome \
libdvrcommon \
libeds \
libdvrgraphics \
@@ -125,7 +123,6 @@
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_SRC_FILES := dummy_gvr_ext.cpp
-LOCAL_STATIC_LIBRARIES := libchrome
LOCAL_LDLIBS := -llog
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES += libgvr
diff --git a/libs/vr/libgvr/dummy_gvr_ext.cpp b/libs/vr/libgvr/dummy_gvr_ext.cpp
index c507038..f73838d 100644
--- a/libs/vr/libgvr/dummy_gvr_ext.cpp
+++ b/libs/vr/libgvr/dummy_gvr_ext.cpp
@@ -1,4 +1,4 @@
-#include <base/logging.h>
+#include <log/log.h>
#include <vr/gvr/capi/include/gvr.h>
#include <vr/gvr/capi/include/gvr_ext.h>
#include <vr/gvr/capi/include/gvr_types.h>
@@ -14,8 +14,8 @@
gvr_mat4f gvr_get_6dof_head_pose_in_start_space(gvr_context* gvr,
uint32_t /* vsync_count */) {
- LOG(FATAL) << "gvr_get_6dof_head_pose_in_start_space is not implemented. "
- << "Use gvr_get_head_space_from_start_space_pose instead.";
+ LOG_ALWAYS_FATAL("gvr_get_6dof_head_pose_in_start_space is not implemented. "
+ "Use gvr_get_head_space_from_start_space_pose instead.");
return gvr_mat4f({{{1.0f, 0.0f, 0.0f, 0.0f},
{0.0f, 1.0f, 0.0f, 0.0f},
{0.0f, 0.0f, 1.0f, 0.0f},
@@ -25,5 +25,5 @@
void gvr_wait_next_frame(gvr_swap_chain* /* swap_chain */,
int64_t /* sched_offset_nanos */,
gvr_frame_schedule* /* out_next_frame_schedule */) {
- LOG(FATAL) << "gvr_wait_next_frame is not implemented.";
+ LOG_ALWAYS_FATAL("gvr_wait_next_frame is not implemented.");
}
diff --git a/libs/vr/libgvr/shim_gvr.cpp b/libs/vr/libgvr/shim_gvr.cpp
index 264952e..fa8a655 100644
--- a/libs/vr/libgvr/shim_gvr.cpp
+++ b/libs/vr/libgvr/shim_gvr.cpp
@@ -19,10 +19,10 @@
#endif
#endif
-#include <cutils/log.h>
#include <dvr/graphics.h>
#include <dvr/performance_client_api.h>
#include <dvr/pose_client.h>
+#include <log/log.h>
#include <private/dvr/buffer_hub_queue_core.h>
#include <private/dvr/buffer_hub_queue_producer.h>
#include <private/dvr/clock_ns.h>
@@ -1326,14 +1326,14 @@
}
void* gvr_external_surface_get_surface(const gvr_external_surface* surface) {
- CHECK(surface->swap_chain != nullptr &&
- surface->swap_chain->context != nullptr &&
- surface->swap_chain->context->jni_env_ != nullptr)
- << "gvr_external_surface_get_surface: Surface must be constructed within "
- << "a JNIEnv. Check |gvr_create| call.";
+ LOG_ALWAYS_FATAL_IF(surface->swap_chain == nullptr ||
+ surface->swap_chain->context == nullptr ||
+ surface->swap_chain->context->jni_env_ == nullptr,
+ "gvr_external_surface_get_surface: Surface must be "
+ "constructed within a JNIEnv. Check |gvr_create| call.");
- CHECK(surface->video_surface != nullptr)
- << "gvr_external_surface_get_surface: Invalid surface.";
+ LOG_ALWAYS_FATAL_IF(surface->video_surface == nullptr,
+ "gvr_external_surface_get_surface: Invalid surface.");
std::shared_ptr<android::dvr::ProducerQueue> producer_queue =
surface->video_surface->client->GetProducerQueue();
diff --git a/libs/vr/libgvr/shim_gvr_controller.cpp b/libs/vr/libgvr/shim_gvr_controller.cpp
index 54bc270..0f55903 100644
--- a/libs/vr/libgvr/shim_gvr_controller.cpp
+++ b/libs/vr/libgvr/shim_gvr_controller.cpp
@@ -1,6 +1,6 @@
#define LOG_TAG "libgvr_controller_shim"
-#include <cutils/log.h>
+#include <log/log.h>
#include <vr/gvr/capi/include/gvr_controller.h>
#include <vr/gvr/capi/include/gvr_types.h>
diff --git a/libs/vr/libgvr/shim_gvr_private.cpp b/libs/vr/libgvr/shim_gvr_private.cpp
index 6ab6971..25a5110 100644
--- a/libs/vr/libgvr/shim_gvr_private.cpp
+++ b/libs/vr/libgvr/shim_gvr_private.cpp
@@ -1,6 +1,6 @@
#define LOG_TAG "libgvr_shim_private"
-#include <cutils/log.h>
+#include <log/log.h>
#include <private/dvr/display_rpc.h>
#include <private/dvr/internal_types.h>
#include <vr/gvr/capi/include/gvr.h>
@@ -42,7 +42,7 @@
serialized_viewer_params_size_bytes);
std::unique_ptr<proto::DeviceParams> device_params(new proto::DeviceParams);
if (!device_params->ParseFromString(serialized_device_params_string)) {
- LOG(ERROR) << "Invalid serialized Cardboard DeviceParams";
+ ALOGE("Invalid serialized Cardboard DeviceParams");
return false;
}
diff --git a/libs/vr/libimageio/include/private/dvr/image_io_logging.h b/libs/vr/libimageio/include/private/dvr/image_io_logging.h
index 3c0f2a5..ac78179 100644
--- a/libs/vr/libimageio/include/private/dvr/image_io_logging.h
+++ b/libs/vr/libimageio/include/private/dvr/image_io_logging.h
@@ -1,7 +1,7 @@
#ifndef LIB_LIBIMAGEIO_PRIVATE_DREAMOS_IMAGE_IO_LOGGING_H_
#define LIB_LIBIMAGEIO_PRIVATE_DREAMOS_IMAGE_IO_LOGGING_H_
-// This header acts as cutils/log.h if LOG_TO_STDERR is not defined.
+// This header acts as log/log.h if LOG_TO_STDERR is not defined.
// If LOG_TO_STDERR is defined, then android logging macros (such as ALOGE)
// would log to stderr. This is useful if the code is also being used/tested on
// a desktop.
@@ -33,7 +33,7 @@
#define ALOGV(fmt, ...) LogToStderr("VERBOSE", fmt, ##__VA_ARGS__)
#else // LOG_TO_STDERR
-#include <cutils/log.h>
+#include <log/log.h>
#endif // LOG_TO_STDERR
#endif // LIB_LIBIMAGEIO_PRIVATE_DREAMOS_IMAGE_IO_LOGGING_H_
diff --git a/libs/vr/libpdx/private/pdx/service.h b/libs/vr/libpdx/private/pdx/service.h
index 029e6bf..175cedf 100644
--- a/libs/vr/libpdx/private/pdx/service.h
+++ b/libs/vr/libpdx/private/pdx/service.h
@@ -1,8 +1,8 @@
#ifndef ANDROID_PDX_SERVICE_H_
#define ANDROID_PDX_SERVICE_H_
-#include <cutils/log.h>
#include <errno.h>
+#include <log/log.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/libs/vr/libpdx/service.cpp b/libs/vr/libpdx/service.cpp
index 0053af8..daf9af8 100644
--- a/libs/vr/libpdx/service.cpp
+++ b/libs/vr/libpdx/service.cpp
@@ -1,8 +1,8 @@
#define LOG_TAG "ServiceFramework"
#include "pdx/service.h"
-#include <cutils/log.h>
#include <fcntl.h>
+#include <log/log.h>
#include <utils/misc.h>
#include <algorithm>
diff --git a/libs/vr/libposepredictor/linear_pose_predictor.cpp b/libs/vr/libposepredictor/linear_pose_predictor.cpp
index a2ce2ca..de1b951 100644
--- a/libs/vr/libposepredictor/linear_pose_predictor.cpp
+++ b/libs/vr/libposepredictor/linear_pose_predictor.cpp
@@ -1,4 +1,4 @@
-#include <cutils/log.h>
+#include <log/log.h>
#include <private/dvr/linear_pose_predictor.h>
diff --git a/libs/vr/libsensor/Android.mk b/libs/vr/libsensor/Android.mk
index db1514d..8c7ad43 100644
--- a/libs/vr/libsensor/Android.mk
+++ b/libs/vr/libsensor/Android.mk
@@ -23,7 +23,6 @@
staticLibraries := \
libbufferhub \
- libchrome \
libdvrcommon \
libpdx_default_transport \
@@ -33,7 +32,6 @@
libhardware \
liblog \
libutils \
- libevent
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(sourceFiles)
diff --git a/libs/vr/libsensor/pose_client.cpp b/libs/vr/libsensor/pose_client.cpp
index a65d668..9eae3aa 100644
--- a/libs/vr/libsensor/pose_client.cpp
+++ b/libs/vr/libsensor/pose_client.cpp
@@ -3,8 +3,7 @@
#include <stdint.h>
-#include <base/logging.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include <pdx/client.h>
#include <pdx/default_transport/client_channel_factory.h>
#include <pdx/file_handle.h>
@@ -18,6 +17,8 @@
using android::pdx::Status;
using android::pdx::Transaction;
+#define arraysize(x) (static_cast<int32_t>(std::extent<decltype(x)>::value))
+
namespace android {
namespace dvr {
@@ -64,8 +65,7 @@
int GetControllerPose(int32_t controller_id, uint32_t vsync_count,
DvrPoseAsync* out_pose) {
- if (controller_id < 0 ||
- controller_id >= static_cast<int32_t>(arraysize(controllers_))) {
+ if (controller_id < 0 || controller_id >= arraysize(controllers_)) {
return -EINVAL;
}
if (!controllers_[controller_id].mapped_pose_buffer) {
@@ -154,14 +154,14 @@
}
pose_buffer_.swap(buffer);
mapped_pose_buffer_ = static_cast<const DvrPoseRingBuffer*>(addr);
- LOG(INFO) << "Mapped pose data translation "
- << mapped_pose_buffer_->ring[0].translation[0] << ','
- << mapped_pose_buffer_->ring[0].translation[1] << ','
- << mapped_pose_buffer_->ring[0].translation[2] << ", quat "
- << mapped_pose_buffer_->ring[0].orientation[0] << ','
- << mapped_pose_buffer_->ring[0].orientation[1] << ','
- << mapped_pose_buffer_->ring[0].orientation[2] << ','
- << mapped_pose_buffer_->ring[0].orientation[3];
+ ALOGI("Mapped pose data translation %f,%f,%f quat %f,%f,%f,%f",
+ mapped_pose_buffer_->ring[0].translation[0],
+ mapped_pose_buffer_->ring[0].translation[1],
+ mapped_pose_buffer_->ring[0].translation[2],
+ mapped_pose_buffer_->ring[0].orientation[0],
+ mapped_pose_buffer_->ring[0].orientation[1],
+ mapped_pose_buffer_->ring[0].orientation[2],
+ mapped_pose_buffer_->ring[0].orientation[3]);
if (out_info) {
GetPoseRingBufferInfo(out_info);
}
@@ -169,8 +169,7 @@
}
int GetControllerRingBuffer(int32_t controller_id) {
- if (controller_id < 0 ||
- controller_id >= static_cast<int32_t>(arraysize(controllers_))) {
+ if (controller_id < 0 || controller_id >= arraysize(controllers_)) {
return -EINVAL;
}
ControllerClientState& client_state = controllers_[controller_id];
@@ -200,15 +199,15 @@
}
client_state.pose_buffer.swap(buffer);
client_state.mapped_pose_buffer = static_cast<const DvrPoseAsync*>(addr);
- LOG(INFO) << "Mapped controller " << controller_id
- << " pose data translation "
- << client_state.mapped_pose_buffer[0].translation[0] << ','
- << client_state.mapped_pose_buffer[0].translation[1] << ','
- << client_state.mapped_pose_buffer[0].translation[2] << ", quat "
- << client_state.mapped_pose_buffer[0].orientation[0] << ','
- << client_state.mapped_pose_buffer[0].orientation[1] << ','
- << client_state.mapped_pose_buffer[0].orientation[2] << ','
- << client_state.mapped_pose_buffer[0].orientation[3];
+ ALOGI(
+ "Mapped controller %d pose data translation %f,%f,%f quat %f,%f,%f,%f",
+ controller_id, client_state.mapped_pose_buffer[0].translation[0],
+ client_state.mapped_pose_buffer[0].translation[1],
+ client_state.mapped_pose_buffer[0].translation[2],
+ client_state.mapped_pose_buffer[0].orientation[0],
+ client_state.mapped_pose_buffer[0].orientation[1],
+ client_state.mapped_pose_buffer[0].orientation[2],
+ client_state.mapped_pose_buffer[0].orientation[3]);
return 0;
}
diff --git a/libs/vr/libsensor/sensor_client.cpp b/libs/vr/libsensor/sensor_client.cpp
index 1c240f5..04e88cc 100644
--- a/libs/vr/libsensor/sensor_client.cpp
+++ b/libs/vr/libsensor/sensor_client.cpp
@@ -1,7 +1,7 @@
#define LOG_TAG "SensorClient"
#include <private/dvr/sensor_client.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include <poll.h>
#include <pdx/default_transport/client_channel_factory.h>
diff --git a/libs/vr/libsensor/tests/sensor_app_tests.cpp b/libs/vr/libsensor/tests/sensor_app_tests.cpp
index 8cd6f79..0f5bf00 100644
--- a/libs/vr/libsensor/tests/sensor_app_tests.cpp
+++ b/libs/vr/libsensor/tests/sensor_app_tests.cpp
@@ -2,10 +2,10 @@
#include <GLES2/gl2.h>
#include <math.h>
-#include <base/logging.h>
#include <dvr/graphics.h>
#include <dvr/pose_client.h>
#include <gtest/gtest.h>
+#include <log/log.h>
#include <private/dvr/types.h>
using android::dvr::vec4;
@@ -63,9 +63,9 @@
// startup anomalies.
if (i > 0) {
if (last_vsync_count == schedule.vsync_count)
- LOG(ERROR) << "vsync did not increment: " << schedule.vsync_count;
+ ALOGE("vsync did not increment: %u", schedule.vsync_count);
if (pose.timestamp_ns == last_pose.timestamp_ns)
- LOG(ERROR) << "timestamp did not change: " << pose.timestamp_ns;
+ ALOGE("timestamp did not change: %" PRIu64, pose.timestamp_ns);
// TODO(jbates) figure out why the bots are not passing this check.
// EXPECT_NE(last_vsync_count, schedule.vsync_count);
// EXPECT_NE(pose.timestamp_ns, last_pose.timestamp_ns);
@@ -112,9 +112,9 @@
// startup anomalies.
if (i > 0) {
if (last_vsync_count == schedule.vsync_count)
- LOG(ERROR) << "vsync did not increment: " << schedule.vsync_count;
+ ALOGE("vsync did not increment: %u", schedule.vsync_count);
if (pose.timestamp_ns == last_pose.timestamp_ns)
- LOG(ERROR) << "timestamp did not change: " << pose.timestamp_ns;
+ ALOGE("timestamp did not change: %" PRIu64, pose.timestamp_ns);
// TODO(jbates) figure out why the bots are not passing this check.
// EXPECT_NE(last_vsync_count, schedule.vsync_count);
// EXPECT_NE(pose.timestamp_ns, last_pose.timestamp_ns);
diff --git a/services/vr/bufferhubd/Android.mk b/services/vr/bufferhubd/Android.mk
index 492acb2..4ba2373 100644
--- a/services/vr/bufferhubd/Android.mk
+++ b/services/vr/bufferhubd/Android.mk
@@ -23,7 +23,6 @@
producer_queue_channel.cpp \
staticLibraries := \
- libchrome \
libperformance \
libpdx_default_transport \
libbufferhub
diff --git a/services/vr/bufferhubd/buffer_hub.cpp b/services/vr/bufferhubd/buffer_hub.cpp
index a0c7439..12243dc 100644
--- a/services/vr/bufferhubd/buffer_hub.cpp
+++ b/services/vr/bufferhubd/buffer_hub.cpp
@@ -1,6 +1,6 @@
#include "buffer_hub.h"
-#include <cutils/log.h>
+#include <log/log.h>
#include <poll.h>
#include <utils/Trace.h>
diff --git a/services/vr/bufferhubd/bufferhubd.cpp b/services/vr/bufferhubd/bufferhubd.cpp
index a8e2ddf..d4fc540 100644
--- a/services/vr/bufferhubd/bufferhubd.cpp
+++ b/services/vr/bufferhubd/bufferhubd.cpp
@@ -1,7 +1,7 @@
#include <sched.h>
#include <unistd.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include <dvr/performance_client_api.h>
#include <pdx/default_transport/service_dispatcher.h>
diff --git a/services/vr/bufferhubd/consumer_channel.cpp b/services/vr/bufferhubd/consumer_channel.cpp
index 8db92a3..4f0ca4e 100644
--- a/services/vr/bufferhubd/consumer_channel.cpp
+++ b/services/vr/bufferhubd/consumer_channel.cpp
@@ -1,6 +1,6 @@
#include "consumer_channel.h"
-#include <cutils/log.h>
+#include <log/log.h>
#include <utils/Trace.h>
#include <thread>
diff --git a/services/vr/bufferhubd/producer_channel.cpp b/services/vr/bufferhubd/producer_channel.cpp
index b87b709..c1ef22c 100644
--- a/services/vr/bufferhubd/producer_channel.cpp
+++ b/services/vr/bufferhubd/producer_channel.cpp
@@ -1,6 +1,6 @@
#include "producer_channel.h"
-#include <cutils/log.h>
+#include <log/log.h>
#include <sync/sync.h>
#include <sys/poll.h>
#include <utils/Trace.h>
@@ -9,7 +9,6 @@
#include <atomic>
#include <thread>
-#include <base/logging.h>
#include <private/dvr/bufferhub_rpc.h>
#include "consumer_channel.h"
diff --git a/services/vr/performanced/cpu_set.cpp b/services/vr/performanced/cpu_set.cpp
index 916226e..1a3723f 100644
--- a/services/vr/performanced/cpu_set.cpp
+++ b/services/vr/performanced/cpu_set.cpp
@@ -1,6 +1,6 @@
#include "cpu_set.h"
-#include <cutils/log.h>
+#include <log/log.h>
#include <algorithm>
#include <iomanip>
diff --git a/services/vr/performanced/main.cpp b/services/vr/performanced/main.cpp
index 114413d..ca66c71 100644
--- a/services/vr/performanced/main.cpp
+++ b/services/vr/performanced/main.cpp
@@ -3,9 +3,9 @@
#include <sys/prctl.h>
#include <sys/stat.h>
-#include <cutils/log.h>
#include <cutils/properties.h>
#include <cutils/sched_policy.h>
+#include <log/log.h>
#include <sys/resource.h>
#include <utils/threads.h>
diff --git a/services/vr/performanced/task.cpp b/services/vr/performanced/task.cpp
index ad12858..1175a7b 100644
--- a/services/vr/performanced/task.cpp
+++ b/services/vr/performanced/task.cpp
@@ -1,8 +1,8 @@
#include "task.h"
-#include <cutils/log.h>
#include <errno.h>
#include <fcntl.h>
+#include <log/log.h>
#include <stdio.h>
#include <cctype>
diff --git a/services/vr/sensord/Android.mk b/services/vr/sensord/Android.mk
index 907c3d6..36d8400 100644
--- a/services/vr/sensord/Android.mk
+++ b/services/vr/sensord/Android.mk
@@ -32,7 +32,6 @@
libperformance \
libbufferhub \
libpdx_default_transport \
- libchrome \
libposepredictor \
sharedLibraries := \
diff --git a/services/vr/sensord/pose_service.cpp b/services/vr/sensord/pose_service.cpp
index 75919d8..8e4dbba 100644
--- a/services/vr/sensord/pose_service.cpp
+++ b/services/vr/sensord/pose_service.cpp
@@ -11,12 +11,12 @@
#include <sstream>
#include <type_traits>
-#include <cutils/log.h>
#include <cutils/properties.h>
#include <cutils/trace.h>
#include <dvr/performance_client_api.h>
#include <dvr/pose_client.h>
#include <hardware/sensors.h>
+#include <log/log.h>
#include <pdx/default_transport/service_endpoint.h>
#include <private/dvr/benchmark.h>
#include <private/dvr/clock_ns.h>
diff --git a/services/vr/sensord/sensor_hal_thread.cpp b/services/vr/sensord/sensor_hal_thread.cpp
index 59b433f..c321d4f 100644
--- a/services/vr/sensord/sensor_hal_thread.cpp
+++ b/services/vr/sensord/sensor_hal_thread.cpp
@@ -1,7 +1,7 @@
#include "sensor_hal_thread.h"
-#include <cutils/log.h>
#include <dvr/performance_client_api.h>
+#include <log/log.h>
namespace android {
namespace dvr {
diff --git a/services/vr/sensord/sensor_ndk_thread.cpp b/services/vr/sensord/sensor_ndk_thread.cpp
index b5e16e7..815453b 100644
--- a/services/vr/sensord/sensor_ndk_thread.cpp
+++ b/services/vr/sensord/sensor_ndk_thread.cpp
@@ -1,7 +1,7 @@
#include "sensor_ndk_thread.h"
-#include <cutils/log.h>
#include <dvr/performance_client_api.h>
+#include <log/log.h>
namespace android {
namespace dvr {
diff --git a/services/vr/sensord/sensor_service.cpp b/services/vr/sensord/sensor_service.cpp
index 4396851..1b809b0 100644
--- a/services/vr/sensord/sensor_service.cpp
+++ b/services/vr/sensord/sensor_service.cpp
@@ -1,9 +1,9 @@
#include "sensor_service.h"
-#include <cutils/log.h>
#include <hardware/sensors.h>
-#include <poll.h>
+#include <log/log.h>
#include <pdx/default_transport/service_endpoint.h>
+#include <poll.h>
#include <private/dvr/sensor-ipc.h>
#include <time.h>
diff --git a/services/vr/virtual_touchpad/EvdevInjector.cpp b/services/vr/virtual_touchpad/EvdevInjector.cpp
index be20c6c..d8a1dfa 100644
--- a/services/vr/virtual_touchpad/EvdevInjector.cpp
+++ b/services/vr/virtual_touchpad/EvdevInjector.cpp
@@ -1,9 +1,9 @@
#include "EvdevInjector.h"
-#include <cutils/log.h>
#include <errno.h>
#include <inttypes.h>
#include <linux/input.h>
+#include <log/log.h>
#include <string.h>
#include <sys/fcntl.h>
#include <unistd.h>
diff --git a/services/vr/virtual_touchpad/VirtualTouchpad.cpp b/services/vr/virtual_touchpad/VirtualTouchpad.cpp
index f3936fc..4793058 100644
--- a/services/vr/virtual_touchpad/VirtualTouchpad.cpp
+++ b/services/vr/virtual_touchpad/VirtualTouchpad.cpp
@@ -1,9 +1,9 @@
#include "VirtualTouchpad.h"
#include <android/input.h>
-#include <cutils/log.h>
#include <inttypes.h>
#include <linux/input.h>
+#include <log/log.h>
// References:
// [0] Multi-touch (MT) Protocol,
diff --git a/services/vr/virtual_touchpad/VirtualTouchpadService.cpp b/services/vr/virtual_touchpad/VirtualTouchpadService.cpp
index 5e3321f..25c1a4f 100644
--- a/services/vr/virtual_touchpad/VirtualTouchpadService.cpp
+++ b/services/vr/virtual_touchpad/VirtualTouchpadService.cpp
@@ -1,8 +1,8 @@
#include "VirtualTouchpadService.h"
#include <binder/Status.h>
-#include <cutils/log.h>
#include <linux/input.h>
+#include <log/log.h>
#include <utils/Errors.h>
namespace android {
diff --git a/services/vr/virtual_touchpad/main.cpp b/services/vr/virtual_touchpad/main.cpp
index 57471c5..1debe9f 100644
--- a/services/vr/virtual_touchpad/main.cpp
+++ b/services/vr/virtual_touchpad/main.cpp
@@ -1,7 +1,7 @@
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include "VirtualTouchpadService.h"
diff --git a/services/vr/vr_window_manager/Android.mk_disable b/services/vr/vr_window_manager/Android.mk_disable
index d7d98b3..9a6f752 100644
--- a/services/vr/vr_window_manager/Android.mk_disable
+++ b/services/vr/vr_window_manager/Android.mk_disable
@@ -51,7 +51,6 @@
libsensor \
libperformance \
libpdx_default_transport \
- libchrome \
libcutils \
shared_libs := \
@@ -79,7 +78,7 @@
LOCAL_SRC_FILES := $(src)
LOCAL_C_INCLUDES := hardware/qcom/display/msm8996/libgralloc
LOCAL_STATIC_LIBRARIES := $(static_libs)
-LOCAL_SHARED_LIBRARIES := $(shared_libs) libevent
+LOCAL_SHARED_LIBRARIES := $(shared_libs)
LOCAL_SHARED_LIBRARIES += libgvr
LOCAL_STATIC_LIBRARIES += libgvr_ext
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
diff --git a/services/vr/vr_window_manager/application.cpp b/services/vr/vr_window_manager/application.cpp
index 081de74..b4568b8 100644
--- a/services/vr/vr_window_manager/application.cpp
+++ b/services/vr/vr_window_manager/application.cpp
@@ -1,14 +1,14 @@
#include "application.h"
+#include <EGL/egl.h>
+#include <GLES3/gl3.h>
#include <binder/IServiceManager.h>
-#include <cutils/log.h>
#include <dvr/graphics.h>
#include <dvr/performance_client_api.h>
#include <dvr/pose_client.h>
-#include <EGL/egl.h>
-#include <GLES3/gl3.h>
#include <gui/ISurfaceComposer.h>
#include <hardware/hwcomposer_defs.h>
+#include <log/log.h>
#include <private/dvr/graphics/vr_gl_extensions.h>
#include <vector>
diff --git a/services/vr/vr_window_manager/elbow_model.cpp b/services/vr/vr_window_manager/elbow_model.cpp
index 54d1eb4..9543f17 100644
--- a/services/vr/vr_window_manager/elbow_model.cpp
+++ b/services/vr/vr_window_manager/elbow_model.cpp
@@ -1,6 +1,6 @@
#include "elbow_model.h"
-#include <cutils/log.h>
+#include <log/log.h>
namespace android {
namespace dvr {
diff --git a/services/vr/vr_window_manager/render_thread.cpp b/services/vr/vr_window_manager/render_thread.cpp
index 00e3161..5f777e3 100644
--- a/services/vr/vr_window_manager/render_thread.cpp
+++ b/services/vr/vr_window_manager/render_thread.cpp
@@ -1,6 +1,6 @@
-#include <cutils/log.h>
-#include <future>
#include <jni.h>
+#include <log/log.h>
+#include <future>
#include "render_thread.h"
#include "shell_view.h"
diff --git a/services/vr/vr_window_manager/shell_view.cpp b/services/vr/vr_window_manager/shell_view.cpp
index 3b18f74..ca49db7 100644
--- a/services/vr/vr_window_manager/shell_view.cpp
+++ b/services/vr/vr_window_manager/shell_view.cpp
@@ -1,11 +1,11 @@
#include "shell_view.h"
-#include <android/input.h>
-#include <binder/IServiceManager.h>
-#include <cutils/log.h>
#include <EGL/eglext.h>
#include <GLES3/gl3.h>
+#include <android/input.h>
+#include <binder/IServiceManager.h>
#include <hardware/hwcomposer2.h>
+#include <log/log.h>
#include "controller_mesh.h"
#include "texture.h"
diff --git a/services/vr/vr_window_manager/texture.cpp b/services/vr/vr_window_manager/texture.cpp
index dbd91b7..2229efa 100644
--- a/services/vr/vr_window_manager/texture.cpp
+++ b/services/vr/vr_window_manager/texture.cpp
@@ -1,7 +1,7 @@
#include "texture.h"
-#include <cutils/log.h>
#include <GLES/glext.h>
+#include <log/log.h>
#include <system/window.h>
namespace android {
diff --git a/services/vr/vr_window_manager/vr_window_manager_jni.cpp b/services/vr/vr_window_manager/vr_window_manager_jni.cpp
index f52658a..49eaba1 100644
--- a/services/vr/vr_window_manager/vr_window_manager_jni.cpp
+++ b/services/vr/vr_window_manager/vr_window_manager_jni.cpp
@@ -1,5 +1,5 @@
-#include <cutils/log.h>
#include <jni.h>
+#include <log/log.h>
#include <memory>