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

Unified Diff: src/utils/SkTextureCompressor.cpp

Issue 1164373003: Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 9d29d51d6084e02765ad0e13cdbc13f19cf2c6ee..12621e118f9275f394500008d6a29e2ace4ac369 100644
--- a/src/utils/SkTextureCompressor.cpp
+++ b/src/utils/SkTextureCompressor.cpp
@@ -173,17 +173,19 @@
return false;
}
-SkData* CompressBitmapToFormat(const SkPixmap& pixmap, Format format) {
- int compressedDataSize = GetCompressedDataSize(format, pixmap.width(), pixmap.height());
+SkData* CompressBitmapToFormat(const SkBitmap &bitmap, Format format) {
+ SkAutoLockPixels alp(bitmap);
+
+ int compressedDataSize = GetCompressedDataSize(format, bitmap.width(), bitmap.height());
if (compressedDataSize < 0) {
return NULL;
}
- const uint8_t* src = reinterpret_cast<const uint8_t*>(pixmap.addr());
+ const uint8_t* src = reinterpret_cast<const uint8_t*>(bitmap.getPixels());
SkData* dst = SkData::NewUninitialized(compressedDataSize);
- if (!CompressBufferToFormat((uint8_t*)dst->writable_data(), src, pixmap.colorType(),
- pixmap.width(), pixmap.height(), pixmap.rowBytes(), format)) {
+ if (!CompressBufferToFormat((uint8_t*)dst->writable_data(), src, bitmap.colorType(),
+ bitmap.width(), bitmap.height(), bitmap.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