chromium/ui/gtk/window_frame_provider_gtk.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// The maximum reasonable size of the frame edges in DIPs.  If a GTK theme draws
// window decorations larger than this, they will be clipped.
constexpr int kMaxFrameSizeDip =;

// The maximum reasonable radius of the frame top corners in DIPs.  If this
// limit is exceeded, the corners will be drawn correctly, but the compositor
// will get an incorrect hint as to which pixels are fully opaque.
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() {}

// Returns true iff any part of the header is transparent (even a single pixel).
// This is used as an optimization hint to the compositor so that it doesn't
// have to composite behind opaque regions.  The consequence of a false-negative
// is rendering artifacts, but the consequence of a false-positive is only a
// slight performance penalty, so this function is intentionally conservative
// in deciding if the header is translucent.
bool HeaderIsTranslucent() {}

}  // namespace

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) {}

}  // namespace gtk