Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1836)

Unified Diff: skia/ext/bitmap_platform_device_skia.cc

Issue 2622713002: Remove bitmap_platform_device_skia (Closed)
Patch Set: Win build fix Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/bitmap_platform_device_skia.h ('k') | skia/ext/bitmap_platform_device_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/bitmap_platform_device_skia.cc
diff --git a/skia/ext/bitmap_platform_device_skia.cc b/skia/ext/bitmap_platform_device_skia.cc
deleted file mode 100644
index 5904d6f2b70d7e7eebd918e0d2cd9c9120cbfef9..0000000000000000000000000000000000000000
--- a/skia/ext/bitmap_platform_device_skia.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2013 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 "skia/ext/bitmap_platform_device_skia.h"
-#include "skia/ext/platform_canvas.h"
-
-namespace skia {
-
-BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
- bool is_opaque) {
- return Create(width, height, is_opaque, nullptr);
-}
-
-BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
- bool is_opaque,
- uint8_t* data) {
- SkBitmap bitmap;
- bitmap.setInfo(SkImageInfo::MakeN32(width, height,
- is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType));
-
- if (data) {
- bitmap.setPixels(data);
- } else {
- if (!bitmap.tryAllocPixels())
- return nullptr;
- // Follow the logic in SkCanvas::createDevice(), initialize the bitmap if
- // it is not opaque.
- if (!is_opaque)
- bitmap.eraseARGB(0, 0, 0, 0);
- }
-
- return new BitmapPlatformDevice(bitmap);
-}
-
-BitmapPlatformDevice::BitmapPlatformDevice(const SkBitmap& bitmap)
- : SkBitmapDevice(bitmap) {
- SetPlatformDevice(this, this);
-}
-
-BitmapPlatformDevice::~BitmapPlatformDevice() {
-}
-
-SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& info,
- const SkPaint*) {
- SkASSERT(info.fInfo.colorType() == kN32_SkColorType);
- return BitmapPlatformDevice::Create(info.fInfo.width(), info.fInfo.height(),
- info.fInfo.isOpaque());
-}
-
-// PlatformCanvas impl
-
-std::unique_ptr<SkCanvas> CreatePlatformCanvasWithPixels(
- int width,
- int height,
- bool is_opaque,
- uint8_t* data,
- OnFailureType failureType) {
- sk_sp<SkBaseDevice> dev(
- BitmapPlatformDevice::Create(width, height, is_opaque, data));
- return CreateCanvas(dev, failureType);
-}
-
-} // namespace skia
« no previous file with comments | « skia/ext/bitmap_platform_device_skia.h ('k') | skia/ext/bitmap_platform_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698