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

Unified Diff: src/pdf/SkPDFCanon.h

Issue 944643002: PDF: Now threadsafe! (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: TODO=DONE Created 5 years, 10 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/pdf/SkPDFBitmap.cpp ('k') | src/pdf/SkPDFCanon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFCanon.h
diff --git a/src/pdf/SkPDFCanon.h b/src/pdf/SkPDFCanon.h
index 7c5cdf70c1ece5ef39e3cabd71dd663b1368ea57..369106ada4c2c6017b9129a01e7562ff9b691de2 100644
--- a/src/pdf/SkPDFCanon.h
+++ b/src/pdf/SkPDFCanon.h
@@ -8,42 +8,33 @@
#define SkPDFCanon_DEFINED
#include "SkPDFShader.h"
-#include "SkThread.h"
#include "SkTDArray.h"
-struct SkIRect;
class SkBitmap;
-class SkMatrix;
class SkPDFFont;
class SkPDFGraphicState;
class SkPDFBitmap;
class SkPaint;
-// This class's fields and methods will eventually become part of
-// SkPDFDocument/SkDocument_PDF. For now, it exists as a singleton to
-// preflight that transition. This replaces three global arrays in
-// SkPDFFont, SkPDFShader, and SkPDFGraphicsContext.
-//
-// IF YOU ARE LOOKING AT THIS API PLEASE DO NOT WRITE THE CHANGE
-// YOU ARE ABOUT TO WRITE WITHOUT TALKING TO HALCANARY@.
-//
-// Note that this class does not create, delete, reference or
-// dereference the SkPDFObject objects that it indexes. It is up to
-// the caller to manage the lifetime of these objects.
+/**
+ * The SkPDFCanon canonicalizes objects across PDF pages(SkPDFDevices).
+ *
+ * The PDF backend works correctly if:
+ * - There is no more than one SkPDFCanon for each thread.
+ * - Every SkPDFDevice is given a pointer to a SkPDFCanon on creation.
+ * - All SkPDFDevices in a document share the same SkPDFCanon.
+ * The SkDocument_PDF class makes this happen by owning a single
+ * SkPDFCanon.
+ *
+ * Note that this class does not create, delete, reference or
+ * dereference the SkPDFObject objects that it indexes. It is up to
+ * the caller to manage the lifetime of these objects.
+ */
class SkPDFCanon : SkNoncopyable {
public:
SkPDFCanon();
~SkPDFCanon();
- static SkPDFCanon& GetCanon();
-
- // This mutexes will be removed once this class is subsumed into
- // SkPDFDocument.
- static SkBaseMutex& GetFontMutex();
- static SkBaseMutex& GetShaderMutex();
- static SkBaseMutex& GetPaintMutex();
- static SkBaseMutex& GetBitmapMutex();
-
// Returns exact match if there is one. If not, it returns NULL.
// If there is no exact match, but there is a related font, we
// still return NULL, but also set *relatedFont.
« no previous file with comments | « src/pdf/SkPDFBitmap.cpp ('k') | src/pdf/SkPDFCanon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698