diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-20 17:20:28 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-20 17:20:28 +0000 |
commit | f6c3ebdeb135dcdb9af225bd7af77f1fe1f92787 (patch) | |
tree | e42147c5a3230b8113b6836c33378098813866b8 /src/pdf | |
parent | c789cf1c6f3947283aeb34acb5a22e6204f8f6f5 (diff) |
fix Capitalization of static methods
git-svn-id: http://skia.googlecode.com/svn/trunk@1910 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf')
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 22 | ||||
-rw-r--r-- | src/pdf/SkPDFDocument.cpp | 2 | ||||
-rwxr-xr-x | src/pdf/SkPDFFont.cpp | 32 | ||||
-rw-r--r-- | src/pdf/SkPDFGraphicState.cpp | 34 | ||||
-rw-r--r-- | src/pdf/SkPDFPage.cpp | 2 | ||||
-rw-r--r-- | src/pdf/SkPDFShader.cpp | 6 | ||||
-rw-r--r-- | src/pdf/SkPDFTypes.cpp | 22 |
7 files changed, 60 insertions, 60 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index c9143865e6..7833362b6c 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -826,7 +826,7 @@ void SkPDFDevice::drawText(const SkDraw& d, const void* text, size_t len, font->glyphsToPDFFontEncoding(glyphIDs + consumedGlyphCount, numGlyphs - consumedGlyphCount); SkString encodedString = - SkPDFString::formatString(glyphIDs + consumedGlyphCount, + SkPDFString::FormatString(glyphIDs + consumedGlyphCount, availableGlyphs, font->multiByteGlyphs()); content.entry()->fContent.writeText(encodedString.c_str()); consumedGlyphCount += availableGlyphs; @@ -899,7 +899,7 @@ void SkPDFDevice::drawPosText(const SkDraw& d, const void* text, size_t len, set_text_transform(x, y, textPaint.getTextSkewX(), &content.entry()->fContent); SkString encodedString = - SkPDFString::formatString(&encodedValue, 1, + SkPDFString::FormatString(&encodedValue, 1, font->multiByteGlyphs()); content.entry()->fContent.writeText(encodedString.c_str()); content.entry()->fContent.writeText(" Tj\n"); @@ -1190,7 +1190,7 @@ void SkPDFDevice::drawFormXObjectWithClip(SkPDFFormXObject* xobject, SkRefPtr<SkPDFFormXObject> maskFormXObject; createFormXObjectFromDevice(&maskFormXObject); SkRefPtr<SkPDFGraphicState> sMaskGS = - SkPDFGraphicState::getSMaskGraphicState(maskFormXObject.get(), + SkPDFGraphicState::GetSMaskGraphicState(maskFormXObject.get(), invertClip); sMaskGS->unref(); // SkRefPtr and getSMaskGraphicState both took a ref. @@ -1207,7 +1207,7 @@ void SkPDFDevice::drawFormXObjectWithClip(SkPDFFormXObject* xobject, fXObjectResources.push(xobject); xobject->ref(); - sMaskGS = SkPDFGraphicState::getNoSMaskGraphicState(); + sMaskGS = SkPDFGraphicState::GetNoSMaskGraphicState(); sMaskGS->unref(); // SkRefPtr and getSMaskGraphicState both took a ref. SkPDFUtils::ApplyGraphicState(addGraphicStateResource(sMaskGS.get()), &content.entry()->fContent); @@ -1346,12 +1346,12 @@ void SkPDFDevice::finishContentEntry(const SkXfermode::Mode xfermode, SkRefPtr<SkPDFGraphicState> sMaskGS; if (xfermode == SkXfermode::kSrcIn_Mode || xfermode == SkXfermode::kSrcOut_Mode) { - sMaskGS = SkPDFGraphicState::getSMaskGraphicState( + sMaskGS = SkPDFGraphicState::GetSMaskGraphicState( dst, xfermode == SkXfermode::kSrcOut_Mode); fXObjectResources.push(srcFormXObject.get()); srcFormXObject->ref(); } else { - sMaskGS = SkPDFGraphicState::getSMaskGraphicState( + sMaskGS = SkPDFGraphicState::GetSMaskGraphicState( srcFormXObject.get(), xfermode == SkXfermode::kDstOut_Mode); // dst already added to fXObjectResources in drawFormXObjectWithClip. } @@ -1362,7 +1362,7 @@ void SkPDFDevice::finishContentEntry(const SkXfermode::Mode xfermode, SkPDFUtils::DrawFormXObject(fXObjectResources.count() - 1, &inClipContentEntry.entry()->fContent); - sMaskGS = SkPDFGraphicState::getNoSMaskGraphicState(); + sMaskGS = SkPDFGraphicState::GetNoSMaskGraphicState(); sMaskGS->unref(); // SkRefPtr and getSMaskGraphicState both took a ref. SkPDFUtils::ApplyGraphicState(addGraphicStateResource(sMaskGS.get()), &inClipContentEntry.entry()->fContent); @@ -1406,7 +1406,7 @@ void SkPDFDevice::populateGraphicStateEntryFromPaint( // PDF doesn't support kClamp_TileMode, so we simulate it by making // a pattern the size of the current clip. SkIRect bounds = clipRegion.getBounds(); - pdfShader = SkPDFShader::getPDFShader(*shader, transform, bounds); + pdfShader = SkPDFShader::GetPDFShader(*shader, transform, bounds); SkSafeUnref(pdfShader.get()); // getShader and SkRefPtr both took a ref if (pdfShader.get()) { @@ -1446,11 +1446,11 @@ void SkPDFDevice::populateGraphicStateEntryFromPaint( SkRefPtr<SkPDFGraphicState> newGraphicState; if (color == paint.getColor()) { - newGraphicState = SkPDFGraphicState::getGraphicStateForPaint(paint); + newGraphicState = SkPDFGraphicState::GetGraphicStateForPaint(paint); } else { SkPaint newPaint = paint; newPaint.setColor(color); - newGraphicState = SkPDFGraphicState::getGraphicStateForPaint(newPaint); + newGraphicState = SkPDFGraphicState::GetGraphicStateForPaint(newPaint); } newGraphicState->unref(); // getGraphicState and SkRefPtr both took a ref. int resourceIndex = addGraphicStateResource(newGraphicState.get()); @@ -1493,7 +1493,7 @@ void SkPDFDevice::updateFont(const SkPaint& paint, uint16_t glyphID, } int SkPDFDevice::getFontResourceIndex(SkTypeface* typeface, uint16_t glyphID) { - SkRefPtr<SkPDFFont> newFont = SkPDFFont::getFontResource(typeface, glyphID); + SkRefPtr<SkPDFFont> newFont = SkPDFFont::GetFontResource(typeface, glyphID); newFont->unref(); // getFontResource and SkRefPtr both took a ref. int resourceIndex = fFontResources.find(newFont.get()); if (resourceIndex < 0) { diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp index fa8a028249..1cfe64df12 100644 --- a/src/pdf/SkPDFDocument.cpp +++ b/src/pdf/SkPDFDocument.cpp @@ -68,7 +68,7 @@ bool SkPDFDocument::emitPDF(SkWStream* stream) { // We haven't emitted the document before if fPageTree is empty. if (fPageTree.count() == 0) { SkPDFDict* pageTreeRoot; - SkPDFPage::generatePageTree(fPages, &fCatalog, &fPageTree, + SkPDFPage::GeneratePageTree(fPages, &fCatalog, &fPageTree, &pageTreeRoot); fDocCatalog->insert("Pages", new SkPDFObjRef(pageTreeRoot))->unref(); diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp index e9f8450509..4602c68e1c 100755 --- a/src/pdf/SkPDFFont.cpp +++ b/src/pdf/SkPDFFont.cpp @@ -421,10 +421,10 @@ static void append_cmap_bfchar_sections( */ SkPDFFont::~SkPDFFont() { - SkAutoMutexAcquire lock(canonicalFontsMutex()); + SkAutoMutexAcquire lock(CanonicalFontsMutex()); int index; - if (find(SkTypeface::UniqueID(fTypeface.get()), fFirstGlyphID, &index)) { - canonicalFonts().removeShuffle(index); + if (Find(SkTypeface::UniqueID(fTypeface.get()), fFirstGlyphID, &index)) { + CanonicalFonts().removeShuffle(index); #ifdef SK_DEBUG SkASSERT(!fDescendant); } else { @@ -480,19 +480,19 @@ size_t SkPDFFont::glyphsToPDFFontEncoding(uint16_t* glyphIDs, } // static -SkPDFFont* SkPDFFont::getFontResource(SkTypeface* typeface, uint16_t glyphID) { - SkAutoMutexAcquire lock(canonicalFontsMutex()); +SkPDFFont* SkPDFFont::GetFontResource(SkTypeface* typeface, uint16_t glyphID) { + SkAutoMutexAcquire lock(CanonicalFontsMutex()); const uint32_t fontID = SkTypeface::UniqueID(typeface); int index; - if (find(fontID, glyphID, &index)) { - canonicalFonts()[index].fFont->ref(); - return canonicalFonts()[index].fFont; + if (Find(fontID, glyphID, &index)) { + CanonicalFonts()[index].fFont->ref(); + return CanonicalFonts()[index].fFont; } SkRefPtr<SkAdvancedTypefaceMetrics> fontInfo; SkPDFDict* fontDescriptor = NULL; if (index >= 0) { - SkPDFFont* relatedFont = canonicalFonts()[index].fFont; + SkPDFFont* relatedFont = CanonicalFonts()[index].fFont; SkASSERT(relatedFont->fFontInfo.get()); fontInfo = relatedFont->fFontInfo; fontDescriptor = relatedFont->fDescriptor.get(); @@ -510,34 +510,34 @@ SkPDFFont* SkPDFFont::getFontResource(SkTypeface* typeface, uint16_t glyphID) { SkPDFFont* font = new SkPDFFont(fontInfo.get(), typeface, glyphID, false, fontDescriptor); FontRec newEntry(font, fontID, font->fFirstGlyphID); - index = canonicalFonts().count(); - canonicalFonts().push(newEntry); + index = CanonicalFonts().count(); + CanonicalFonts().push(newEntry); return font; // Return the reference new SkPDFFont() created. } // static -SkTDArray<SkPDFFont::FontRec>& SkPDFFont::canonicalFonts() { +SkTDArray<SkPDFFont::FontRec>& SkPDFFont::CanonicalFonts() { // This initialization is only thread safe with gcc. static SkTDArray<FontRec> gCanonicalFonts; return gCanonicalFonts; } // static -SkMutex& SkPDFFont::canonicalFontsMutex() { +SkMutex& SkPDFFont::CanonicalFontsMutex() { // This initialization is only thread safe with gcc. static SkMutex gCanonicalFontsMutex; return gCanonicalFontsMutex; } // static -bool SkPDFFont::find(uint32_t fontID, uint16_t glyphID, int* index) { +bool SkPDFFont::Find(uint32_t fontID, uint16_t glyphID, int* index) { // TODO(vandebo) optimize this, do only one search? FontRec search(NULL, fontID, glyphID); - *index = canonicalFonts().find(search); + *index = CanonicalFonts().find(search); if (*index >= 0) return true; search.fGlyphID = 0; - *index = canonicalFonts().find(search); + *index = CanonicalFonts().find(search); return false; } diff --git a/src/pdf/SkPDFGraphicState.cpp b/src/pdf/SkPDFGraphicState.cpp index b560bb72c6..59b2817518 100644 --- a/src/pdf/SkPDFGraphicState.cpp +++ b/src/pdf/SkPDFGraphicState.cpp @@ -57,11 +57,11 @@ static const char* blend_mode_from_xfermode(SkXfermode::Mode mode) { } SkPDFGraphicState::~SkPDFGraphicState() { - SkAutoMutexAcquire lock(canonicalPaintsMutex()); + SkAutoMutexAcquire lock(CanonicalPaintsMutex()); if (!fSMask) { - int index = find(fPaint); + int index = Find(fPaint); SkASSERT(index >= 0); - canonicalPaints().removeShuffle(index); + CanonicalPaints().removeShuffle(index); } fResources.unrefAll(); } @@ -89,30 +89,30 @@ size_t SkPDFGraphicState::getOutputSize(SkPDFCatalog* catalog, bool indirect) { // static SkTDArray<SkPDFGraphicState::GSCanonicalEntry>& -SkPDFGraphicState::canonicalPaints() { +SkPDFGraphicState::CanonicalPaints() { // This initialization is only thread safe with gcc. static SkTDArray<SkPDFGraphicState::GSCanonicalEntry> gCanonicalPaints; return gCanonicalPaints; } // static -SkMutex& SkPDFGraphicState::canonicalPaintsMutex() { +SkMutex& SkPDFGraphicState::CanonicalPaintsMutex() { // This initialization is only thread safe with gcc. static SkMutex gCanonicalPaintsMutex; return gCanonicalPaintsMutex; } // static -SkPDFGraphicState* SkPDFGraphicState::getGraphicStateForPaint( +SkPDFGraphicState* SkPDFGraphicState::GetGraphicStateForPaint( const SkPaint& paint) { - SkAutoMutexAcquire lock(canonicalPaintsMutex()); - int index = find(paint); + SkAutoMutexAcquire lock(CanonicalPaintsMutex()); + int index = Find(paint); if (index >= 0) { - canonicalPaints()[index].fGraphicState->ref(); - return canonicalPaints()[index].fGraphicState; + CanonicalPaints()[index].fGraphicState->ref(); + return CanonicalPaints()[index].fGraphicState; } GSCanonicalEntry newEntry(new SkPDFGraphicState(paint)); - canonicalPaints().push(newEntry); + CanonicalPaints().push(newEntry); return newEntry.fGraphicState; } @@ -143,11 +143,11 @@ SkPDFObject* SkPDFGraphicState::GetInvertFunction() { } // static -SkPDFGraphicState* SkPDFGraphicState::getSMaskGraphicState( +SkPDFGraphicState* SkPDFGraphicState::GetSMaskGraphicState( SkPDFFormXObject* sMask, bool invert) { // The practical chances of using the same mask more than once are unlikely // enough that it's not worth canonicalizing. - SkAutoMutexAcquire lock(canonicalPaintsMutex()); + SkAutoMutexAcquire lock(CanonicalPaintsMutex()); SkRefPtr<SkPDFDict> sMaskDict = new SkPDFDict("Mask"); sMaskDict->unref(); // SkRefPtr and new both took a reference. @@ -173,8 +173,8 @@ SkPDFGraphicState* SkPDFGraphicState::getSMaskGraphicState( } // static -SkPDFGraphicState* SkPDFGraphicState::getNoSMaskGraphicState() { - SkAutoMutexAcquire lock(canonicalPaintsMutex()); +SkPDFGraphicState* SkPDFGraphicState::GetNoSMaskGraphicState() { + SkAutoMutexAcquire lock(CanonicalPaintsMutex()); static SkPDFGraphicState* noSMaskGS = NULL; if (!noSMaskGS) { noSMaskGS = new SkPDFGraphicState; @@ -188,9 +188,9 @@ SkPDFGraphicState* SkPDFGraphicState::getNoSMaskGraphicState() { } // static -int SkPDFGraphicState::find(const SkPaint& paint) { +int SkPDFGraphicState::Find(const SkPaint& paint) { GSCanonicalEntry search(&paint); - return canonicalPaints().find(search); + return CanonicalPaints().find(search); } SkPDFGraphicState::SkPDFGraphicState() diff --git a/src/pdf/SkPDFPage.cpp b/src/pdf/SkPDFPage.cpp index c162d51d79..3823f745d7 100644 --- a/src/pdf/SkPDFPage.cpp +++ b/src/pdf/SkPDFPage.cpp @@ -54,7 +54,7 @@ void SkPDFPage::emitPage(SkWStream* stream, SkPDFCatalog* catalog) { } // static -void SkPDFPage::generatePageTree(const SkTDArray<SkPDFPage*>& pages, +void SkPDFPage::GeneratePageTree(const SkTDArray<SkPDFPage*>& pages, SkPDFCatalog* catalog, SkTDArray<SkPDFDict*>* pageTree, SkPDFDict** rootNode) { diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp index e9fa4c2310..95fdb612f0 100644 --- a/src/pdf/SkPDFShader.cpp +++ b/src/pdf/SkPDFShader.cpp @@ -321,7 +321,7 @@ void SkPDFShader::getResources(SkTDArray<SkPDFObject*>* resourceList) { } // static -SkPDFShader* SkPDFShader::getPDFShader(const SkShader& shader, +SkPDFShader* SkPDFShader::GetPDFShader(const SkShader& shader, const SkMatrix& matrix, const SkIRect& surfaceBBox) { SkRefPtr<SkPDFShader> pdfShader; @@ -362,7 +362,7 @@ SkMutex& SkPDFShader::CanonicalShadersMutex() { } // static -SkPDFObject* SkPDFShader::rangeObject() { +SkPDFObject* SkPDFShader::RangeObject() { // This initialization is only thread safe with gcc. static SkPDFArray* range = NULL; // This method is only used with CanonicalShadersMutex, so it's safe to @@ -690,7 +690,7 @@ SkPDFStream* SkPDFShader::makePSFunction(const SkString& psCode, SkPDFStream* result = new SkPDFStream(funcStream.get()); result->insertInt("FunctionType", 4); result->insert("Domain", domain); - result->insert("Range", rangeObject()); + result->insert("Range", RangeObject()); return result; } diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp index 780ecf8e59..810d8601fa 100644 --- a/src/pdf/SkPDFTypes.cpp +++ b/src/pdf/SkPDFTypes.cpp @@ -165,15 +165,15 @@ void SkPDFScalar::Append(SkScalar value, SkWStream* stream) { } SkPDFString::SkPDFString(const char value[]) - : fValue(formatString(value, strlen(value))) { + : fValue(FormatString(value, strlen(value))) { } SkPDFString::SkPDFString(const SkString& value) - : fValue(formatString(value.c_str(), value.size())) { + : fValue(FormatString(value.c_str(), value.size())) { } SkPDFString::SkPDFString(const uint16_t* value, size_t len, bool wideChars) - : fValue(formatString(value, len, wideChars)) { + : fValue(FormatString(value, len, wideChars)) { } SkPDFString::~SkPDFString() {} @@ -192,17 +192,17 @@ size_t SkPDFString::getOutputSize(SkPDFCatalog* catalog, bool indirect) { } // static -SkString SkPDFString::formatString(const char* input, size_t len) { - return doFormatString(input, len, false, false); +SkString SkPDFString::FormatString(const char* input, size_t len) { + return DoFormatString(input, len, false, false); } -SkString SkPDFString::formatString(const uint16_t* input, size_t len, +SkString SkPDFString::FormatString(const uint16_t* input, size_t len, bool wideChars) { - return doFormatString(input, len, true, wideChars); + return DoFormatString(input, len, true, wideChars); } // static -SkString SkPDFString::doFormatString(const void* input, size_t len, +SkString SkPDFString::DoFormatString(const void* input, size_t len, bool wideInput, bool wideOutput) { SkASSERT(len <= kMaxLen); const uint16_t* win = (const uint16_t*) input; @@ -254,8 +254,8 @@ SkString SkPDFString::doFormatString(const void* input, size_t len, return result; } -SkPDFName::SkPDFName(const char name[]) : fValue(formatName(SkString(name))) {} -SkPDFName::SkPDFName(const SkString& name) : fValue(formatName(name)) {} +SkPDFName::SkPDFName(const char name[]) : fValue(FormatName(SkString(name))) {} +SkPDFName::SkPDFName(const SkString& name) : fValue(FormatName(name)) {} SkPDFName::~SkPDFName() {} void SkPDFName::emitObject(SkWStream* stream, SkPDFCatalog* catalog, @@ -270,7 +270,7 @@ size_t SkPDFName::getOutputSize(SkPDFCatalog* catalog, bool indirect) { } // static -SkString SkPDFName::formatName(const SkString& input) { +SkString SkPDFName::FormatName(const SkString& input) { SkASSERT(input.size() <= kMaxLen); SkString result("/"); |