#include "third_party/blink/renderer/core/page/drag_image.h"
#include <algorithm>
#include <memory>
#include <utility>
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "skia/ext/image_operations.h"
#include "third_party/blink/renderer/core/css_value_keywords.h"
#include "third_party/blink/renderer/core/layout/layout_theme_font_provider.h"
#include "third_party/blink/renderer/platform/fonts/font.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/fonts/font_description.h"
#include "third_party/blink/renderer/platform/fonts/font_metrics.h"
#include "third_party/blink/renderer/platform/fonts/string_truncator.h"
#include "third_party/blink/renderer/platform/fonts/text_run_paint_info.h"
#include "third_party/blink/renderer/platform/graphics/bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource_provider.h"
#include "third_party/blink/renderer/platform/graphics/color.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_recorder.h"
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
#include "third_party/blink/renderer/platform/text/text_run.h"
#include "third_party/blink/renderer/platform/transforms/affine_transform.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/rect_f.h"
namespace blink {
namespace {
const float kDragLabelBorderX = …;
const float kDragLabelBorderY = …;
const float kLabelBorderYOffset = …;
const float kMaxDragLabelWidth = …;
const float kMaxDragLabelStringWidth = …;
const float kDragLinkLabelFontSize = …;
const float kDragLinkUrlFontSize = …;
}
gfx::Vector2dF DragImage::ClampedImageScale(const gfx::Size& image_size,
const gfx::Size& size,
const gfx::Size& max_size) { … }
std::unique_ptr<DragImage> DragImage::Create(
Image* image,
RespectImageOrientationEnum should_respect_image_orientation,
InterpolationQuality interpolation_quality,
float opacity,
gfx::Vector2dF image_scale) { … }
static Font DeriveDragLabelFont(int size, FontSelectionValue font_weight) { … }
std::unique_ptr<DragImage> DragImage::Create(const KURL& url,
const String& in_label,
float device_scale_factor) { … }
DragImage::DragImage(const SkBitmap& bitmap,
InterpolationQuality interpolation_quality)
: … { … }
DragImage::~DragImage() = default;
void DragImage::Scale(float scale_x, float scale_y) { … }
}