third_party/ktx: put WriteBitmapToKTX back
BUG=skia: Change-Id: I876e802db370a7812cd53e42cb4927702e6c1fb6 Reviewed-on: https://skia-review.googlesource.com/5418 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
b2e29bbf22
commit
a4d861a5b4
8
third_party/ktx/ktx.cpp
vendored
8
third_party/ktx/ktx.cpp
vendored
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "ktx.h"
|
||||
#include "SkPixmap.h"
|
||||
#include "SkBitmap.h"
|
||||
#include "SkStream.h"
|
||||
#include "SkEndian.h"
|
||||
|
||||
@ -557,3 +557,9 @@ bool SkKTXFile::WritePixmapToKTX(SkWStream* stream, const SkPixmap& pixmap) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SkKTXFile::WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap) {
|
||||
SkAutoLockPixels autoLockPixels(bitmap);
|
||||
SkPixmap pixmap;
|
||||
return bitmap.peekPixels(&pixmap) && SkKTXFile::WritePixmapToKTX(stream, pixmap);
|
||||
}
|
||||
|
5
third_party/ktx/ktx.h
vendored
5
third_party/ktx/ktx.h
vendored
@ -16,6 +16,7 @@
|
||||
#include "SkString.h"
|
||||
#include "SkRefCnt.h"
|
||||
|
||||
class SkBitmap;
|
||||
class SkPixmap;
|
||||
class SkStreamRewindable;
|
||||
class SkWStream;
|
||||
@ -65,7 +66,9 @@ public:
|
||||
|
||||
static bool WriteETC1ToKTX(SkWStream* stream, const uint8_t *etc1Data,
|
||||
uint32_t width, uint32_t height);
|
||||
static bool WritePixmapToKTX(SkWStream* stream, const SkPixmap& bitmap);
|
||||
static bool WritePixmapToKTX(SkWStream* stream, const SkPixmap& pixmap);
|
||||
static bool WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap);
|
||||
|
||||
private:
|
||||
|
||||
// The blob holding the file data.
|
||||
|
Loading…
Reference in New Issue
Block a user