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

Unified Diff: src/utils/SkTextureCompressor.cpp

Issue 1168303006: Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapi (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox to new test Created 5 years, 6 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 | « src/utils/SkTextureCompressor.h ('k') | src/utils/SkTextureCompressor_Blitter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkTextureCompressor.cpp
diff --git a/src/utils/SkTextureCompressor.cpp b/src/utils/SkTextureCompressor.cpp
index 12621e118f9275f394500008d6a29e2ace4ac369..9d29d51d6084e02765ad0e13cdbc13f19cf2c6ee 100644
--- a/src/utils/SkTextureCompressor.cpp
+++ b/src/utils/SkTextureCompressor.cpp
@@ -173,19 +173,17 @@ bool CompressBufferToFormat(uint8_t* dst, const uint8_t* src, SkColorType srcCol
return false;
}
-SkData* CompressBitmapToFormat(const SkBitmap &bitmap, Format format) {
- SkAutoLockPixels alp(bitmap);
-
- int compressedDataSize = GetCompressedDataSize(format, bitmap.width(), bitmap.height());
+SkData* CompressBitmapToFormat(const SkPixmap& pixmap, Format format) {
+ int compressedDataSize = GetCompressedDataSize(format, pixmap.width(), pixmap.height());
if (compressedDataSize < 0) {
return NULL;
}
- const uint8_t* src = reinterpret_cast<const uint8_t*>(bitmap.getPixels());
+ const uint8_t* src = reinterpret_cast<const uint8_t*>(pixmap.addr());
SkData* dst = SkData::NewUninitialized(compressedDataSize);
- if (!CompressBufferToFormat((uint8_t*)dst->writable_data(), src, bitmap.colorType(),
- bitmap.width(), bitmap.height(), bitmap.rowBytes(), format)) {
+ if (!CompressBufferToFormat((uint8_t*)dst->writable_data(), src, pixmap.colorType(),
+ pixmap.width(), pixmap.height(), pixmap.rowBytes(), format)) {
dst->unref();
dst = NULL;
}
« no previous file with comments | « src/utils/SkTextureCompressor.h ('k') | src/utils/SkTextureCompressor_Blitter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698