chromium/cc/paint/solid_color_analyzer.cc

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

#include "cc/paint/solid_color_analyzer.h"

#include <cmath>

#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "cc/paint/paint_op.h"
#include "cc/paint/paint_op_buffer_iterator.h"
#include "third_party/skia/include/core/SkTypes.h"
#include "third_party/skia/include/utils/SkNoDrawCanvas.h"

namespace cc {
namespace {

SkColor4f DoSrcOverAlphaBlend(SkColor4f src, SkColor4f dst) {}

bool ActsLikeClear(SkBlendMode mode, float src_alpha) {}

bool IsSolidColorBlendMode(SkBlendMode blendmode) {}

bool IsSolidColorPaint(const PaintFlags& flags) {}

// Returns true if the specified |drawn_shape| will cover the entire canvas
// and that the canvas is not clipped (i.e. it covers ALL of the canvas).
// We expect this method to return false most of the time so we take
// conservative early-outs when possible.
template <typename T>
bool IsFullQuad(const SkCanvas& canvas, const T& drawn_shape) {}

void CalculateSolidColor(SkColor4f src_color,
                         SkBlendMode blendmode,
                         SkColor4f* dst_color,
                         bool* is_solid_color) {}

void CheckIfSolidColor(const SkCanvas& canvas,
                       SkColor4f color,
                       SkBlendMode blendmode,
                       bool* is_solid_color,
                       bool* is_transparent,
                       SkColor4f* out_color) {}

template <typename T>
void CheckIfSolidShape(const SkCanvas& canvas,
                       const T& shape,
                       const PaintFlags& flags,
                       bool* is_solid_color,
                       bool* is_transparent,
                       SkColor4f* color) {}

bool CheckIfRRectClipCoversCanvas(const SkCanvas& canvas,
                                  const SkRRect& rrect) {}

}  // namespace

std::optional<SkColor4f> SolidColorAnalyzer::DetermineIfSolidColor(
    const PaintOpBuffer& buffer,
    const gfx::Rect& rect,
    int max_ops_to_analyze,
    const std::vector<size_t>* offsets) {}

}  // namespace cc