chromium/third_party/blink/renderer/platform/graphics/bitmap_image.cc

/*
 * Copyright (C) 2006 Samuel Weinig ([email protected])
 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "third_party/blink/renderer/platform/graphics/bitmap_image.h"

#include <algorithm>
#include <memory>
#include <utility>

#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_macros.h"
#include "cc/paint/paint_flags.h"
#include "third_party/blink/renderer/platform/graphics/bitmap_image_metrics.h"
#include "third_party/blink/renderer/platform/graphics/deferred_image_decoder.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/image_observer.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_canvas.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h"
#include "third_party/blink/renderer/platform/timer.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "ui/gfx/geometry/rect_f.h"

namespace blink {

int GetRepetitionCountWithPolicyOverride(
    int actual_count,
    mojom::blink::ImageAnimationPolicy policy) {}

BitmapImage::BitmapImage(ImageObserver* observer, bool is_multipart)
    :{}

BitmapImage::~BitmapImage() {}

bool BitmapImage::CurrentFrameHasSingleSecurityOrigin() const {}

void BitmapImage::DestroyDecodedData() {}

scoped_refptr<SharedBuffer> BitmapImage::Data() {}

bool BitmapImage::HasData() const {}

size_t BitmapImage::DataSize() const {}

void BitmapImage::NotifyMemoryChanged() {}

size_t BitmapImage::TotalFrameBytes() {}

PaintImage BitmapImage::PaintImageForTesting() {}

PaintImage BitmapImage::CreatePaintImage() {}

void BitmapImage::UpdateSize() const {}

gfx::Size BitmapImage::SizeWithConfig(SizeConfig config) const {}

void BitmapImage::RecordDecodedImageType(UseCounter* use_counter) {}

bool BitmapImage::GetHotSpot(gfx::Point& hot_spot) const {}

// We likely don't need to confirm that this is the first time all data has
// been received as a way to avoid reporting the UMA multiple times for the
// same image. However, we err on the side of caution.
bool BitmapImage::ShouldReportByteSizeUMAs(bool data_now_completely_received) {}

Image::SizeAvailability BitmapImage::SetData(scoped_refptr<SharedBuffer> data,
                                             bool all_data_received) {}

// Return the image density in 0.01 "bits per pixel" rounded to the nearest
// integer.
static inline uint64_t ImageDensityInCentiBpp(gfx::Size size,
                                              size_t image_size_bytes) {}

Image::SizeAvailability BitmapImage::DataChanged(bool all_data_received) {}

bool BitmapImage::HasColorProfile() const {}

String BitmapImage::FilenameExtension() const {}

const AtomicString& BitmapImage::MimeType() const {}

void BitmapImage::Draw(cc::PaintCanvas* canvas,
                       const cc::PaintFlags& flags,
                       const gfx::RectF& dst_rect,
                       const gfx::RectF& src_rect,
                       const ImageDrawOptions& draw_options) {}

size_t BitmapImage::FrameCount() {}

static inline bool HasVisibleImageSize(gfx::Size size) {}

bool BitmapImage::IsSizeAvailable() {}

PaintImage BitmapImage::PaintImageForCurrentFrame() {}

scoped_refptr<Image> BitmapImage::ImageForDefaultFrame() {}

bool BitmapImage::CurrentFrameKnownToBeOpaque() {}

bool BitmapImage::CurrentFrameIsComplete() {}

bool BitmapImage::CurrentFrameIsLazyDecoded() {}

ImageOrientation BitmapImage::CurrentFrameOrientation() const {}

int BitmapImage::RepetitionCount() {}

void BitmapImage::ResetAnimation() {}

bool BitmapImage::MaybeAnimated() {}

void BitmapImage::SetAnimationPolicy(
    mojom::blink::ImageAnimationPolicy policy) {}

}  // namespace blink