This is mostly s/public SkNoncopyable/SkNoncopyable/g.
Two classes (SkDrawLooper::Context and SkPicture::OperationList) don't actually work with SkNoncopyable because they introduce a virtual destructor. I added SkNoncopyableVirtual to make them work as intended. Sort of questionable whether they really need to be noncopyable in the first place, but I guess it doesn't hurt to keep the behavior the same.
BUG=skia:
R=reed@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/226183018
git-svn-id: http://skia.googlecode.com/svn/trunk@14081 2bbb7eff-a529-9590-31e7-b0007b416f81
Instead of passing a pointer to a pointer to a NULL looper, which can
then be set to point to a new looper (which then must be looped and
deleted), pass a pointer to the current looper. Each function can then
create a looper based on the parent (on the stack) and call loop()
itself.
Remove setUp(). Now that there is a pointer to the parent at creation
time, there is no need for this function.
Modify the constructors to only provide ones that are needed.
Add documentation.
Remove PdfInlineImageLooper::done(), which is never used.
R=mtklein@google.com
Review URL: https://codereview.chromium.org/83183004
git-svn-id: http://skia.googlecode.com/svn/trunk@12447 2bbb7eff-a529-9590-31e7-b0007b416f81
Move its functionality out of readToken() and into its own class.
Callers of the previous readToken() now call
SkPdfNativeTokenizer::readToken(), which in turn calls a function
for writing the diff to a file, if the caller requests it and
PDF_TRACE_DIFF_IN_PNG is defined.
Do not attempt to draw a diff for compatibility sections, which we
do not draw.
Use SkString to handle string manipulation.
Hide globals only used by PDF_TRACE_DIFF_IN_PNG behind that flag.
Remove hasVisualEffects, which always returns true.
Rename gLastOpKeyword to gOpCounter for clarity.
In SkPdfNativeTokenizer, set fEmpty to true when the entire stream
has been read.
Use SkBitmap::copyTo instead of manually copying an SkBitmap.
Builds on https://codereview.chromium.org/79933003/R=mtklein@google.com
Review URL: https://codereview.chromium.org/80463005
git-svn-id: http://skia.googlecode.com/svn/trunk@12436 2bbb7eff-a529-9590-31e7-b0007b416f81
The only change in behavior is that SkPdfAllocator on SkPdfContext is
no longer allocated on the heap.
In general, I have just moved code.
SkPdfContext:
Inherit from SkNoncopyable.
Make SkPdfContext directly own fTmpPageAllocator. fTmpPageAllocator is
created when SkPdfContext is, and destroyed at the same time as well,
so there is no reason for the extra allocation.
Add the function parseStream. This eliminates code duplication, and
allows making fTmpPageAllocator private.
Move PdfMainLooper into the implementation file, since it is now only
used by parseStream.
Move SkTDictWithDefaultConstructor and render stats info here, in
support of PdfMainLooper.
SkPdfTokenLooper:
Rename PdfTokenLooper to SkPdfTokenLooper.
Move readToken here, unchanged.
Remove tokenizer(), which is unused.
SkPdfNativeDoc:
Remove tokenizerOfPage and tokenizerOfBuffer, which are unused.
SkPdfOps:
Move gPdfOps and PdfOperatorRenderer into a header file (hidden for
now), so they can be accessed by both SkPdfRenderer.cpp and
SkPdfContext.cpp.
SkPdfRenderer:
Harvest things into other files:
PdfMainLooper (and the code that calls it) -> SkPdfContext.
readToken -> SkPdfTokenLooper.
R=mtklein@google.com
Review URL: https://codereview.chromium.org/79933003
git-svn-id: http://skia.googlecode.com/svn/trunk@12435 2bbb7eff-a529-9590-31e7-b0007b416f81
SkTDStackNester is a class used by PdfViewer to assist in saving
and restoring the PDF state. Clean up and test this class.
Add some documentation.
Add FIXME's where I have questions to resolve.
Fix a bug where fNestingLevel was not initialized.
Remove a commented out line of code copied over from
SkTDStack.
Rename SkTDStackNester::nests() to nestingLevel() and make it const.
Remove unnecessary predeclaration and friend declaration.
Remove index() (both const and non-const versions). They were
unused, return something that may not be expected (index from
the top, rather than from the bottom), and don't work to get any
elements in earlier Recs once the first one is full.
Report a warning if the nesting level goes above the maximum level,
or if we attempt to bring it below zero.
Prevent fNestingLevel from dropping below zero.
Add kUnusedObject_SkPdfIssue, and use it where appropriate.
Depends on https://codereview.chromium.org/64093009/R=mtklein@google.com
Review URL: https://codereview.chromium.org/68843006
git-svn-id: http://skia.googlecode.com/svn/trunk@12328 2bbb7eff-a529-9590-31e7-b0007b416f81
Mostly superficial changes, to help me make sure I understand the
code while making modifications.
SkPdfRenderer:
First class I'm modifying. Move it into include/ and src/ directories.
Inherit from SkNoncopyable.
Replace load() with factory function which returns NULL if the load
fails.
Remove unload() and loaded(), which no longer make sense, since the
factory will return NULL on a failure to load, and unload() happens
on destruction.
Use a const char* for loading a PDF, following the convention of
SkStream::NewFromFile.
Remove unnecessary call to sqrt in SkPDFNativeRenderToBitmap.
Also in SkPDFNativeRenderToBitmap, use an appropriate SkScalar macro
to convert to an integer.
Use this-> when calling member functions.
pdf_viewer_main.cpp:
Call the new interface for SkPdfRenderer.
gyp files:
Refer to the new location of SkPdfRenderer.
R=edisonn@google.com
Review URL: https://codereview.chromium.org/59493011
git-svn-id: http://skia.googlecode.com/svn/trunk@12296 2bbb7eff-a529-9590-31e7-b0007b416f81