#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/gfx/skbitmap_operations.h"
#include <stdint.h>
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "third_party/skia/include/core/SkUnPreMultiply.h"
namespace {
inline bool ColorsClose(uint32_t a, uint32_t b) { … }
inline bool MultipliedColorsClose(uint32_t a, uint32_t b) { … }
bool BitmapsClose(const SkBitmap& a, const SkBitmap& b) { … }
void FillDataToBitmap(int w, int h, SkBitmap* bmp) { … }
SkBitmap ReferenceCreateHSLShiftedBitmap(
const SkBitmap& bitmap,
color_utils::HSL hsl_shift) { … }
}
TEST(SkBitmapOperationsTest, CreateInvertedBitmap) { … }
TEST(SkBitmapOperationsTest, CreateBlendedBitmap) { … }
TEST(SkBitmapOperationsTest, CreateMaskedBitmap) { … }
TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapToSame) { … }
TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) { … }
TEST(SkBitmapOperationsTest, ValidateHSLShift) { … }
TEST(SkBitmapOperationsTest, CreateCroppedBitmap) { … }
TEST(SkBitmapOperationsTest, CreateCroppedBitmapWrapping) { … }
TEST(SkBitmapOperationsTest, DownsampleByTwo) { … }
TEST(SkBitmapOperationsTest, DownsampleByTwoSmall) { … }
TEST(SkBitmapOperationsTest, DownsampleByTwoUntilSize) { … }
TEST(SkBitmapOperationsTest, UnPreMultiply) { … }
TEST(SkBitmapOperationsTest, UnPreMultiplyOpaque) { … }
TEST(SkBitmapOperationsTest, UnPreMultiplyAlreadyUnPreMultiplied) { … }
TEST(SkBitmapOperationsTest, CreateTransposedBitmap) { … }
void DrawRectWithColor(SkCanvas* canvas,
int left,
int top,
int right,
int bottom,
SkColor color) { … }
TEST(SkBitmapOperationsTest, RotateImage) { … }