skia2/tests/ImageFrom565Bitmap.cpp
scroggo db7dc09e52 Remove SkImageMinRowBytes
As stated in the comments in crrev.com/1379193002, this method name is
misleading. It returns a larger number than the minimum rowbytes - it
increases to the next four-byte alignment. This has the effect that the
one place that calls it does not support 565 (which is not already
four-byte aligned), but does not serve any other purpose. Remove it and
the only call-site.

BUG=skia:4396
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1528383004

Review URL: https://codereview.chromium.org/1528383004
2015-12-18 06:56:01 -08:00

22 lines
562 B
C++

/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkBitmap.h"
#include "SkImageInfo.h"
#include "SkImage.h"
#include "Test.h"
DEF_TEST(ImageFrom565Bitmap, r) {
SkBitmap bm;
bm.allocPixels(SkImageInfo::Make(
5, 7, kRGB_565_SkColorType, kOpaque_SkAlphaType));
SkAutoLockPixels autoLockPixels(bm);
bm.eraseColor(SK_ColorBLACK);
SkAutoTUnref<SkImage> img(SkImage::NewFromBitmap(bm));
REPORTER_ASSERT(r, img.get() != nullptr);
}