pdfviewer: update drawBitmap, and fic a gyp issue: gyp does not run in a consistent way on various palt forms, and it generates some files in ../../../foo instead of ../foo - Solution: use the (inconvenient) Shared intermediary directory that should work on all platforms.

Review URL: https://codereview.chromium.org/20328002

git-svn-id: http://skia.googlecode.com/svn/trunk@10359 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
edisonn@google.com 2013-07-25 15:33:13 +00:00
parent 44a91dcf25
commit 50bbdb4f3e
4 changed files with 28 additions and 16 deletions

View File

@ -83,10 +83,9 @@ protected:
}
virtual void drawBitmap(const SkDraw& dummy1, const SkBitmap& bitmap,
const SkIRect* srcRectOrNull,
const SkMatrix& matrix, const SkPaint& paint) {
before();
INHERITED::drawBitmap(dummy1, bitmap, srcRectOrNull, matrix, paint);
INHERITED::drawBitmap(dummy1, bitmap, matrix, paint);
after();
}

View File

@ -4,7 +4,7 @@ import os
import sys
import datatypes
from autogen.pdfspec_autogen import *
from pdfspec_autogen import *
# TODO(edisonn): date and some other types are in fact strings, with a custom format!!!
# TODO(edisonn): refer to page 99 (PDF data types)
@ -275,7 +275,7 @@ class PdfClassManager:
# write imports
# write enums
fileEnums = open(os.path.join(sys.argv[1], 'autogen', 'SkPdfEnums_autogen.h'), 'w')
fileEnums = open(os.path.join(sys.argv[1], 'native', 'autogen', 'SkPdfEnums_autogen.h'), 'w')
fileEnums.write('#ifndef __DEFINED__SkPdfEnums\n')
fileEnums.write('#define __DEFINED__SkPdfEnums\n')
fileEnums.write('\n')
@ -574,6 +574,10 @@ def generateCode():
global fileHeadersNative
global fileHeadersNativeCpp
global knowTypes
nativeAutogenPath = os.path.join(sys.argv[1], 'native', 'autogen')
if not os.path.exists(nativeAutogenPath):
os.makedirs(nativeAutogenPath)
fileHeadersNative = open(os.path.join(sys.argv[1], 'native', 'autogen', 'SkPdfHeaders_autogen.h'), 'w')
fileHeadersNativeCpp = open(os.path.join(sys.argv[1], 'native', 'autogen', 'SkPdfHeaders_autogen.cpp'), 'w')

View File

@ -22,9 +22,18 @@
'../experimental/PdfViewer/pdfparser/native/SkPdfObject.cpp',
'../experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp',
'../experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp',
'../experimental/PdfViewer/pdfparser/native/autogen/SkPdfMapper_autogen.cpp',
'../experimental/PdfViewer/pdfparser/native/autogen/SkPdfHeaders_autogen.cpp',
'<(SHARED_INTERMEDIATE_DIR)/native/autogen/SkPdfMapper_autogen.cpp',
'<(SHARED_INTERMEDIATE_DIR)/native/autogen/SkPdfHeaders_autogen.cpp',
],
'copies': [
{
'files': [
'../experimental/PdfViewer/datatypes.py',
'../experimental/PdfViewer/generate_code.py',
],
'destination': '<(SHARED_INTERMEDIATE_DIR)',
},
],
'actions': [
{
'action_name': 'spec2def',
@ -33,32 +42,32 @@
'../experimental/PdfViewer/PdfReference-okular-1.txt',
],
'outputs': [
'<(skia_src_path)/../experimental/PdfViewer/autogen/pdfspec_autogen.py',
'<(SHARED_INTERMEDIATE_DIR)/pdfspec_autogen.py',
],
'action': ['python', '<(skia_src_path)/../experimental/PdfViewer/spec2def.py', '<(skia_src_path)/../experimental/PdfViewer/PdfReference-okular-1.txt', '<(skia_src_path)/../experimental/PdfViewer/autogen/pdfspec_autogen.py'],
'action': ['python', '../experimental/PdfViewer/spec2def.py', '../experimental/PdfViewer/PdfReference-okular-1.txt', '<(SHARED_INTERMEDIATE_DIR)/pdfspec_autogen.py'],
},
{
'action_name': 'generate_code',
'inputs': [
'../experimental/PdfViewer/generate_code.py',
'../experimental/PdfViewer/autogen/pdfspec_autogen.py',
'<(SHARED_INTERMEDIATE_DIR)/datatypes.py',
'<(SHARED_INTERMEDIATE_DIR)/generate_code.py',
'<(SHARED_INTERMEDIATE_DIR)/pdfspec_autogen.py',
],
'outputs': [
'<(skia_src_path)/../experimental/PdfViewer/pdfparser/autogen/SkPdfEnums_autogen.h',
'<(skia_src_path)/../experimental/PdfViewer/pdfparser/native/autogen/SkPdfMapper_autogen.cpp',
'<(skia_src_path)/../experimental/PdfViewer/pdfparser/native/autogen/SkPdfHeaders_autogen.cpp',
'<(SHARED_INTERMEDIATE_DIR)/native/autogen/SkPdfEnums_autogen.h',
'<(SHARED_INTERMEDIATE_DIR)/native/autogen/SkPdfMapper_autogen.cpp',
'<(SHARED_INTERMEDIATE_DIR)/native/autogen/SkPdfHeaders_autogen.cpp',
# TODO(edisonn): ok, there are many more files here, which we should list but since
# any change in the above should trigger a change here, we should be fine normally
],
'action': ['python', '<(skia_src_path)/../experimental/PdfViewer/generate_code.py', '<(skia_src_path)/../experimental/PdfViewer/pdfparser/'],
'action': ['python', '<(SHARED_INTERMEDIATE_DIR)/generate_code.py', '<(SHARED_INTERMEDIATE_DIR)'],
},
],
'include_dirs': [
'../experimental/PdfViewer',
'../experimental/PdfViewer/pdfparser',
'../experimental/PdfViewer/pdfparser/autogen',
'../experimental/PdfViewer/pdfparser/native',
'../experimental/PdfViewer/pdfparser/native/autogen',
'<(SHARED_INTERMEDIATE_DIR)/native/autogen',
],
'dependencies': [
'core.gyp:core',