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

Commit c84590a9 authored by Jerome Gaillard's avatar Jerome Gaillard Committed by Android (Google) Code Review
Browse files

Merge "Remove unnecessary #ifdef in Color.h/cpp" into main

parents 842b6c54 40622c17
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -16,22 +16,18 @@

#include "Color.h"

#include <ui/ColorSpace.h>
#include <utils/Log.h>

#ifdef __ANDROID__ // Layoutlib does not support hardware buffers or native windows
#include <Properties.h>
#include <android/hardware_buffer.h>
#include <android/native_window.h>
#endif
#include <ui/ColorSpace.h>
#include <utils/Log.h>

#include <algorithm>
#include <cmath>
#include <Properties.h>

namespace android {
namespace uirenderer {

#ifdef __ANDROID__ // Layoutlib does not support hardware buffers or native windows
static inline SkImageInfo createImageInfo(int32_t width, int32_t height, int32_t format,
                                          sk_sp<SkColorSpace> colorSpace) {
    SkColorType colorType = kUnknown_SkColorType;
@@ -121,7 +117,6 @@ SkColorType BufferFormatToColorType(uint32_t format) {
            return kUnknown_SkColorType;
    }
}
#endif

namespace {
static constexpr skcms_TransferFunction k2Dot6 = {2.6f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
+0 −2
Original line number Diff line number Diff line
@@ -92,7 +92,6 @@ static constexpr float EOCF_sRGB(float srgb) {
    return srgb <= 0.04045f ? srgb / 12.92f : powf((srgb + 0.055f) / 1.055f, 2.4f);
}

#ifdef __ANDROID__ // Layoutlib does not support hardware buffers or native windows
SkImageInfo ANativeWindowToImageInfo(const ANativeWindow_Buffer& buffer,
                                                 sk_sp<SkColorSpace> colorSpace);

@@ -101,7 +100,6 @@ SkImageInfo BufferDescriptionToImageInfo(const AHardwareBuffer_Desc& bufferDesc,

uint32_t ColorTypeToBufferFormat(SkColorType colorType);
SkColorType BufferFormatToColorType(uint32_t bufferFormat);
#endif

ANDROID_API sk_sp<SkColorSpace> DataSpaceToColorSpace(android_dataspace dataspace);