#include "ui/gfx/safe_integer_conversions.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/size_conversions.h"
-#include "ui/gfx/skbitmap_operations.h"
#if defined(OS_CHROMEOS)
#include "ui/base/l10n/l10n_util.h"
skia::ImageOperations::RESIZE_LANCZOS3,
gfx::ToCeiledInt(image.width() * scale),
gfx::ToCeiledInt(image.height() * scale));
- // If --highlight-missing-scaled-resources is specified, log the resource
- // id and blend the created resource with red.
- if (ShouldHighlightMissingScaledResources()) {
- LOG(ERROR) << "Missing " << scale << "x scaled resource. id="
- << resource_id_;
-
- SkBitmap mask;
- mask.setConfig(SkBitmap::kARGB_8888_Config,
- image.width(), image.height());
- mask.allocPixels();
- mask.eraseColor(SK_ColorRED);
- image = SkBitmapOperations::CreateBlendedBitmap(image, mask, 0.2);
- }
} else {
image = PlatformScaleImage(image,
ui::GetScaleForScaleFactor(scale_factor),
void ResourceBundle::AddDataPack(DataPack* data_pack) {
data_packs_.push_back(data_pack);
- if (GetImageScale(data_pack->GetScaleFactor()) >
- GetImageScale(max_scale_factor_))
+ if (GetScaleForScaleFactor(data_pack->GetScaleFactor()) >
+ GetScaleForScaleFactor(max_scale_factor_))
max_scale_factor_ = data_pack->GetScaleFactor();
}
}
// static
-bool ResourceBundle::ShouldHighlightMissingScaledResources() {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kHighlightMissingScaledResources);
-}
-
-// static
bool ResourceBundle::PNGContainsFallbackMarker(const unsigned char* buf,
size_t size) {
if (size < arraysize(kPngMagic) ||