#include "ui/gtk/window_frame_provider_gtk.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "third_party/skia/include/core/SkRRect.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/gtk/gtk_compat.h"
#include "ui/gtk/gtk_util.h"
#include "ui/native_theme/native_theme.h"
namespace gtk {
namespace {
constexpr int kMaxFrameSizeDip = …;
constexpr int kMaxCornerRadiusDip = …;
GtkCssContext WindowContext(bool solid_frame, bool tiled, bool focused) { … }
GtkCssContext DecorationContext(bool solid_frame, bool tiled, bool focused) { … }
GtkCssContext HeaderContext(bool solid_frame, bool tiled, bool focused) { … }
SkBitmap PaintBitmap(const gfx::Size& bitmap_size,
const gfx::RectF& render_bounds,
GtkCssContext context,
float scale) { … }
SkBitmap PaintHeaderbar(const gfx::Size& size,
GtkCssContext context,
float scale) { … }
int ComputeTopCornerRadius() { … }
bool HeaderIsTranslucent() { … }
}
WindowFrameProviderGtk::Asset::Asset() = default;
WindowFrameProviderGtk::Asset::Asset(const WindowFrameProviderGtk::Asset& src) =
default;
WindowFrameProviderGtk::Asset& WindowFrameProviderGtk::Asset::operator=(
const WindowFrameProviderGtk::Asset& src) = default;
WindowFrameProviderGtk::Asset::~Asset() = default;
WindowFrameProviderGtk::WindowFrameProviderGtk(bool solid_frame, bool tiled)
: … { … }
WindowFrameProviderGtk::~WindowFrameProviderGtk() = default;
int WindowFrameProviderGtk::GetTopCornerRadiusDip() { … }
bool WindowFrameProviderGtk::IsTopFrameTranslucent() { … }
gfx::Insets WindowFrameProviderGtk::GetFrameThicknessDip() { … }
void WindowFrameProviderGtk::PaintWindowFrame(gfx::Canvas* canvas,
const gfx::Rect& rect_dip,
int top_area_height_dip,
bool focused,
const gfx::Insets& input_insets) { … }
WindowFrameProviderGtk::Asset& WindowFrameProviderGtk::GetOrCreateAsset(
float scale) { … }
int WindowFrameProviderGtk::BitmapSizePx(const Asset& asset) const { … }
void WindowFrameProviderGtk::OnThemeChanged(GtkSettings* settings,
GtkParamSpec* param) { … }
}