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

Unified Diff: gm/gmmain.cpp

Issue 105893012: change offset to xy for pixelref subsetting (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | « dm/DMSerializeTask.cpp ('k') | include/core/SkBitmap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 0e43c554c69829cd186c9ca723fd24e6d4e60cd9..e4c1c301102124233ca8e2395cd034e2ab2fc498 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -1011,21 +1011,9 @@ public:
return pict;
}
- static SkData* bitmap_encoder(size_t* pixelRefOffset, const SkBitmap& bm) {
- SkPixelRef* pr = bm.pixelRef();
- if (pr != NULL) {
- SkData* data = pr->refEncodedData();
- if (data != NULL) {
- *pixelRefOffset = bm.pixelRefOffset();
- return data;
- }
- }
- return NULL;
- }
-
static SkPicture* stream_to_new_picture(const SkPicture& src) {
SkDynamicMemoryWStream storage;
- src.serialize(&storage, &bitmap_encoder);
+ src.serialize(&storage, NULL);
SkAutoTUnref<SkStreamAsset> pictReadback(storage.detachAsStream());
SkPicture* retval = SkPicture::CreateFromStream(pictReadback,
&SkImageDecoder::DecodeMemory);
@@ -1474,7 +1462,7 @@ DEFINE_int32(pdfRasterDpi, 72, "Scale at which at which the non suported "
"features in PDF are rasterized. Must be be in range 0-10000. "
"Default is 72. N = 0 will disable rasterizing features like "
"text shadows or perspective bitmaps.");
-static SkData* encode_to_dct_data(size_t* pixelRefOffset, const SkBitmap& bitmap) {
+static SkData* encode_to_dct_data(size_t*, const SkBitmap& bitmap) {
// Filter output of warnings that JPEG is not available for the image.
if (bitmap.width() >= 65500 || bitmap.height() >= 65500) return NULL;
if (FLAGS_pdfJpegQuality == -1) return NULL;
@@ -1492,12 +1480,10 @@ static SkData* encode_to_dct_data(size_t* pixelRefOffset, const SkBitmap& bitmap
if (pr != NULL) {
SkData* data = pr->refEncodedData();
if (data != NULL) {
- *pixelRefOffset = bm.pixelRefOffset();
return data;
}
}
- *pixelRefOffset = 0;
return SkImageEncoder::EncodeData(bm,
SkImageEncoder::kJPEG_Type,
FLAGS_pdfJpegQuality);
« no previous file with comments | « dm/DMSerializeTask.cpp ('k') | include/core/SkBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698