chromium/third_party/blink/renderer/core/paint/paint_auto_dark_mode.cc

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

#include "third_party/blink/renderer/core/paint/paint_auto_dark_mode.h"

#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "ui/display/screen_info.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"

namespace blink {

namespace {

// The maximum ratio of image size to screen size that is considered an icon.
constexpr float kMaxIconRatio =;
constexpr int kMaxImageLength =;
// Images with either dimension less than this value are considered separators.
constexpr int kMaxImageSeparatorLength =;

// We need to do image classification first before calling
// DarkModeFilter::GenerateImageFilter.
DarkModeFilter::ImageType GetImageType(float dest_to_device_ratio,
                                       const gfx::Rect& dest_rect,
                                       const gfx::Rect& src_rect) {}

float GetRatio(const display::ScreenInfo& screen_info,
               const gfx::RectF& dest_rect) {}

}  // namespace

// static
ImageAutoDarkMode ImageClassifierHelper::GetImageAutoDarkMode(
    LocalFrame& local_frame,
    const ComputedStyle& style,
    const gfx::RectF& dest_rect,
    const gfx::RectF& src_rect,
    DarkModeFilter::ElementRole role) {}

// static
DarkModeFilter::ImageType ImageClassifierHelper::GetImageTypeForTesting(
    display::ScreenInfo& screen_info,
    const gfx::RectF& dest_rect,
    const gfx::RectF& src_rect) {}

}  // namespace blink