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

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

Issue 1758023003: Move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/174410… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: manual rebase Created 4 years, 9 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
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 7
8 #ifndef SkPDFDevice_DEFINED 8 #ifndef SkPDFDevice_DEFINED
9 #define SkPDFDevice_DEFINED 9 #define SkPDFDevice_DEFINED
10 10
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 SkPDFCanon* getCanon() const { return fCanon; } 191 SkPDFCanon* getCanon() const { return fCanon; }
192 192
193 protected: 193 protected:
194 const SkBitmap& onAccessBitmap() override { 194 const SkBitmap& onAccessBitmap() override {
195 return fLegacyBitmap; 195 return fLegacyBitmap;
196 } 196 }
197 197
198 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) override; 198 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) override;
199 199
200 void drawAnnotation(const SkDraw&, const SkRect&, const char key[], SkData* value) override;
201
200 private: 202 private:
201 struct RectWithData { 203 struct RectWithData {
202 SkRect rect; 204 SkRect rect;
203 SkData* data; 205 SkData* data;
204 RectWithData(const SkRect& rect, SkData* data) 206 RectWithData(const SkRect& rect, SkData* data)
205 : rect(rect), data(SkRef(data)) {} 207 : rect(rect), data(SkRef(data)) {}
206 ~RectWithData() { data->unref(); } 208 ~RectWithData() { data->unref(); }
207 }; 209 };
208 210
209 struct NamedDestination { 211 struct NamedDestination {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 const SkPaint& paint); 313 const SkPaint& paint);
312 314
313 /** Helper method for copyContentToData. It is responsible for copying the 315 /** Helper method for copyContentToData. It is responsible for copying the
314 * list of content entries |entry| to |data|. 316 * list of content entries |entry| to |data|.
315 */ 317 */
316 void copyContentEntriesToData(ContentEntry* entry, SkWStream* data) const; 318 void copyContentEntriesToData(ContentEntry* entry, SkWStream* data) const;
317 319
318 bool handleInversePath(const SkDraw& d, const SkPath& origPath, 320 bool handleInversePath(const SkDraw& d, const SkPath& origPath,
319 const SkPaint& paint, bool pathIsMutable, 321 const SkPaint& paint, bool pathIsMutable,
320 const SkMatrix* prePathMatrix = nullptr); 322 const SkMatrix* prePathMatrix = nullptr);
321 bool handlePointAnnotation(const SkPoint* points, size_t count, 323 void handlePointAnnotation(const SkPoint&, const SkMatrix&, const char key[] , SkData* value);
322 const SkMatrix& matrix, SkAnnotation* annot); 324 void handlePathAnnotation(const SkPath&, const SkDraw& d, const char key[], SkData* value);
323 bool handlePathAnnotation(const SkPath& path, const SkDraw& d,
324 SkAnnotation* annot);
325 325
326 typedef SkBaseDevice INHERITED; 326 typedef SkBaseDevice INHERITED;
327 327
328 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create 328 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create
329 // an SkPDFDevice 329 // an SkPDFDevice
330 //friend class SkDocument_PDF; 330 //friend class SkDocument_PDF;
331 //friend class SkPDFImageShader; 331 //friend class SkPDFImageShader;
332 }; 332 };
333 333
334 #endif 334 #endif
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698