blob: 12b21de039e7af2a95aad6a78f8e61f7ded33123 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "build/build_config.h"
#include "third_party/skia/include/core/SkFilterQuality.h"
#include "third_party/skia/include/core/SkPixmap.h"
#if defined(OS_ANDROID)
#include "base/android/build_info.h"
namespace cc {
class ImageDecodeCacheUtils {
static bool CanResizeF16Image(SkFilterQuality filter_quality) {
#if defined(OS_ANDROID)
// Return false on Android KitKat or lower if filter quality is medium or
// high (hence, mipmaps are used), return true otherwise. This is because
// of skia:8410 which causes a crash when trying to scale a f16 image on
// these configs.
return (base::android::BuildInfo::GetInstance()->sdk_int() >=
base::android::SDK_VERSION_LOLLIPOP) ||
(filter_quality < kMedium_SkFilterQuality);
return true;
static bool ScaleToHalfFloatPixmapUsingN32Intermediate(
const SkPixmap& source_pixmap,
SkPixmap* scaled_pixmap,
SkFilterQuality filter_quality);
} // namespace cc