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

Side by Side Diff: src/pdf/SkPDFBitmap.h

Issue 1372783003: SkPDF: Implement drawImage*() properly (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-09-29 (Tuesday) 14:09:03 EDT Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #ifndef SkPDFBitmap_DEFINED 7 #ifndef SkPDFBitmap_DEFINED
8 #define SkPDFBitmap_DEFINED 8 #define SkPDFBitmap_DEFINED
9 9
10 #include "SkPDFTypes.h" 10 #include "SkPDFTypes.h"
11 #include "SkBitmap.h"
12 11
13 class SkPDFCanon; 12 class SkImage;
14 13
15 /** 14 /**
16 * SkPDFBitmap wraps a SkBitmap and serializes it as an image Xobject. 15 * SkPDFBitmap wraps a SkImage and serializes it as an image Xobject.
17 * It is designed to use a minimal amout of memory, aside from refing 16 * It is designed to use a minimal amout of memory, aside from refing
18 * the bitmap's pixels, and its emitObject() does not cache any data. 17 * the image, and its emitObject() does not cache any data.
19 *
20 * If !bitmap.isImmutable(), then a copy of the bitmap must be made;
21 * there is no way around this.
22 *
23 * The SkPDFBitmap::Create function will check the canon for duplicates.
24 */ 18 */
25 class SkPDFBitmap : public SkPDFObject { 19 SkPDFObject* SkPDFCreateBitmapObject(const SkImage*);
26 public:
27 // Returns nullptr on unsupported bitmap;
28 static SkPDFBitmap* Create(SkPDFCanon*, const SkBitmap&);
29 bool equals(const SkBitmap& other) const {
30 return fBitmap.getGenerationID() == other.getGenerationID() &&
31 fBitmap.pixelRefOrigin() == other.pixelRefOrigin() &&
32 fBitmap.dimensions() == other.dimensions();
33 }
34
35 protected:
36 const SkBitmap fBitmap;
37 SkPDFBitmap(const SkBitmap& bm) : fBitmap(bm) {}
38 };
39 20
40 #endif // SkPDFBitmap_DEFINED 21 #endif // SkPDFBitmap_DEFINED
OLDNEW
« no previous file with comments | « src/pdf/SkJpegInfo.cpp ('k') | src/pdf/SkPDFBitmap.cpp » ('j') | src/pdf/SkPDFBitmap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698