#include "pdf/draw_utils/shadow.h"
#include <math.h>
#include <stddef.h>
#include <algorithm>
#include "base/check_op.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
namespace chrome_pdf {
namespace draw_utils {
constexpr uint8_t kOpaqueAlpha = …;
constexpr uint8_t kTransparentAlpha = …;
inline uint8_t GetBlue(const uint32_t& pixel) { … }
inline uint8_t GetGreen(const uint32_t& pixel) { … }
inline uint8_t GetRed(const uint32_t& pixel) { … }
inline uint8_t GetAlpha(const uint32_t& pixel) { … }
inline uint32_t MakePixel(uint8_t red,
uint8_t green,
uint8_t blue,
uint8_t alpha) { … }
inline uint8_t ProcessColor(uint8_t src_color,
uint8_t dest_color,
uint8_t alpha) { … }
ShadowMatrix::ShadowMatrix(uint32_t depth, double factor, uint32_t background)
: … { … }
ShadowMatrix::~ShadowMatrix() = default;
namespace {
void PaintShadow(SkBitmap& image,
const gfx::Rect& clip_rc,
const gfx::Rect& shadow_rc,
const ShadowMatrix& matrix) { … }
}
void DrawShadow(SkBitmap& image,
const gfx::Rect& shadow_rc,
const gfx::Rect& object_rc,
const gfx::Rect& clip_rc,
const ShadowMatrix& matrix) { … }
}
}