Commit Graph

16738 Commits

Author SHA1 Message Date
reed
a644116c33 Revert of Make the canvas draw looper setup update the canvas save count (patchset #1 id:1 of https://codereview.chromium.org/1034033004/)
Reason for revert:
makes internalSave and internalSaveLayer inconsistent. Need to find a different solution.

Original issue's description:
> Make the canvas draw looper setup update the canvas save count
>
> Image filter in a paint would leave save count in wrong state
> for normal draws. This could be observed through the canvas
> references during the draw call. An example of this is
> inspecting the canvas during a draw looper.
>
> patch from issue 993863002 at patchset 20001 (http://crrev.com/993863002#ps20001)
>
> BUG=skia:
> TBR=kkinnunen@nvidia.com
>
> Committed: https://skia.googlesource.com/skia/+/fd3a91e1fc4de69611b5297f624a1cd65db4ced1

TBR=kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1037653004
2015-03-26 13:40:09 -07:00
reed
fd3a91e1fc Make the canvas draw looper setup update the canvas save count
Image filter in a paint would leave save count in wrong state
for normal draws. This could be observed through the canvas
references during the draw call. An example of this is
inspecting the canvas during a draw looper.

patch from issue 993863002 at patchset 20001 (http://crrev.com/993863002#ps20001)

BUG=skia:
TBR=kkinnunen@nvidia.com

Review URL: https://codereview.chromium.org/1034033004
2015-03-26 13:29:56 -07:00
mtklein
3d4c4a5a9f SkPMFloat::trunc()
Add and test trunc(), which is what get() used to be before rounding.
Using trunc() is a ~40% speedup on our linear gradient bench.

#neon #floats
BUG=skia:3592
#n5
#n9
CQ_INCLUDE_TRYBOTS=client.skia.android:Test-Android-Nexus5-Adreno330-Arm7-Debug-Trybot;client.skia.android:Test-Android-Nexus9-TegraK1-Arm64-Release-Trybot

Review URL: https://codereview.chromium.org/1032243002
2015-03-26 12:32:29 -07:00
tomhudson
d968a6f29e Android HWUI backend Nanobench
Uses filtering canvas from utils/android, shared with DM.
Follow-up plans in https://skbug.com/3589, https://skbug.com/3595

R=djsollen@google.com

Review URL: https://codereview.chromium.org/1029423010
2015-03-26 11:28:06 -07:00
joshualitt
e0b19d4985 small fix for nanobench segfault when not running any tests
BUG=skia:

Review URL: https://codereview.chromium.org/1030353004
2015-03-26 10:41:02 -07:00
egdaniel
9665eee8d5 Remove unused HWAA flag and uniqueID field from GrDrawTargetCaps.
BUG=skia:

Review URL: https://codereview.chromium.org/1019303005
2015-03-26 10:13:05 -07:00
robertphillips
546db46a76 Debugger: remove dead feature (SkPicture offset display) & fix bug (unbalanced indents)
Displaying the offset into an SkPicture hasn't worked for a while so this CL deletes the feature.
When "Save Layer" was renamed to "SaveLayer" the code that computes the indent in the list view was broken. This CL patches the problem.

Review URL: https://codereview.chromium.org/1034733004
2015-03-26 10:08:04 -07:00
scroggo
0eed6df064 Silence PNG warnings from SkPngCodec.
Review URL: https://codereview.chromium.org/1009633005
2015-03-26 10:07:56 -07:00
reed
5501103881 use new faster/vector impl for chopping conics
BUG=skia:

Review URL: https://codereview.chromium.org/1035943002
2015-03-26 09:10:22 -07:00
egdaniel
384181c810 Add support for using alternative backends (like DirectX) when creating a GrGpu.
BUG=skia:

Review URL: https://codereview.chromium.org/1038643002
2015-03-26 09:09:41 -07:00
caryclark
d8bc16b306 add legacy pathop enums; fix uninitialized warning
R=reed@google.com
BUG=skia:3588
NOTREECHECKS=true
NOTRY=true
NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1034073004
2015-03-26 09:05:12 -07:00
caryclark
54359294a7 cumulative pathops patch
Replace the implicit curve intersection with a geometric curve intersection. The implicit intersection proved mathematically unstable and took a long time to zero in on an answer.

Use pointers instead of indices to refer to parts of curves. Indices required awkward renumbering.

Unify t and point values so that small intervals can be eliminated in one pass.

Break cubics up front to eliminate loops and cusps.

Make the Simplify and Op code more regular and eliminate arbitrary differences.

Add a builder that takes an array of paths and operators.

Delete unused code.

BUG=skia:3588
R=reed@google.com

Review URL: https://codereview.chromium.org/1037573004
2015-03-26 07:52:43 -07:00
reed
c08330f160 remove slower scalar code in favor of vectors
BUG=skia:

Review URL: https://codereview.chromium.org/1001833006
2015-03-26 07:26:08 -07:00
fmalita
65cdb57ae8 Add a paint filter utility canvas (SkPaintFilterCanvas)
Introduce a paint filter proxy base class as a SkDrawFilter replacement,
and convert SkDebugCanvas to use the new approach.

BUG=skia:3587
R=reed@google.com,mtklein@google.com,robertphillips@google.com,tomhudson@google.com

Review URL: https://codereview.chromium.org/1032173002
2015-03-26 07:24:48 -07:00
scroggo
230d4ac701 Use a wrapper for SkDebugf in SkCodec.
It can be silenced or not with one flag.
Always print when building for the android framework.

Also remove the meaningless define of override to override.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1032093004
2015-03-26 07:15:55 -07:00
halcanary
b880d7f87e SkCodec: conditionally remove fInfo
Review URL: https://codereview.chromium.org/1029423005
2015-03-26 06:29:03 -07:00
mtklein
dee3df930b Add a go-fast button to Skia GYP configs.
./gyp_skia -Dskia_fast=1 will
  - always optimize for the current machine as much as possible
  - drop the frame pointer
  - optimize floating point arithmetic ignoring IEEE compliance

This allows things like 3-argument VEX prefix SSE instructions and
NEON autovectorization, and can give some seriously helpful clues
about how to rearrange floating point math for speed.

I've been having trouble with LTO linking, so I'll leave that out for now.

I don't think we should set up bots with this mode.  -ffast-math means
I'm forced to run DM with --match ~Blend ~Path ~Rect ~Math ~Scalar
~Matrix ~Point before it passes, which is a disconcerting chunk of tests
to disable (including all of PathOps).

BUG=skia:

Review URL: https://codereview.chromium.org/1036533003
2015-03-26 05:30:44 -07:00
mtklein
ce86687310 pdf skp tabl_worldjournal.skp took 5 days to run on Valgrind
#notry

BUG=skia:
NOTRY=true

Review URL: https://codereview.chromium.org/1030263003
2015-03-26 05:12:13 -07:00
reed
3756d810d4 remove #if 0 code
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1032273003
2015-03-26 04:15:19 -07:00
reed
83e22e407e use custom search for pathmeasure
BUG=skia:

Review URL: https://codereview.chromium.org/1037653002
2015-03-26 04:13:08 -07:00
mtklein
36352bf5e3 C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
2015-03-25 18:17:32 -07:00
mtklein
02fd592c8d hack on linear gradient
Am I going nuts or can we get this down to just adds and converts in the loop?

#floats #n9
BUG=skia:3592
CQ_INCLUDE_TRYBOTS=client.skia.android:Test-Android-Nexus9-TegraK1-Arm64-Release-Trybot

Review URL: https://codereview.chromium.org/1008973004
2015-03-25 18:13:02 -07:00
bungeman
05035d43e7 Remove sfnt dependency from xps gyp tartget.
The xps gyp target depends on skia_lib, which in turn contains
the sfnt target (and re-exports it settings). As a result, it
should not separately depend on the sfnt target. This currently
isn't causing issues because the sfnt target is mostly header only,
but any code in it may be duplicated.

Review URL: https://codereview.chromium.org/1038693003
2015-03-25 14:48:05 -07:00
reed
b25a83bd88 Use Sk4x to speed-up bounds of an array of points
BUG=skia:

Review URL: https://codereview.chromium.org/1015633004
2015-03-25 14:30:49 -07:00
cdalton
e68f7362b1 Add more parameters to GrTextContext::canDraw
Updates canDraw to accept all the same Skia/Gr objects as the drawText
functions, since that information may very well be relevant in
determining whether a context can draw.

Also moves the onDrawTextBlob implementation directly into
drawTextBlob.

BUG=skia:

Review URL: https://codereview.chromium.org/1010113004
2015-03-25 14:02:37 -07:00
scroggo
9c59ebc0db Test scanline decoding in DM.
BUG=skia:3475

Review URL: https://codereview.chromium.org/999173010
2015-03-25 13:48:49 -07:00
djsollen
59f9ec7e9c Replace error checking mutex initializer with the glibc-compatible version
No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1038733002
2015-03-25 13:47:13 -07:00
mtklein
15391ee4ac Update 4-at-a-time APIs.
There is no reason to require the 4 SkPMFloats (registers) to be adjacent.
The only potential win in loads and stores comes from the SkPMColors being adjacent.

Makes no difference to existing bench.

BUG=skia:

Review URL: https://codereview.chromium.org/1035583002
2015-03-25 13:43:34 -07:00
joshualitt
2af858354d simple patch to always init SkTextBlob uniqueID
BUG=skia:

Review URL: https://codereview.chromium.org/1036613002
2015-03-25 13:40:13 -07:00
halcanary
d4714af018 SkPDF SkPDFObject::addResources signature simplified
-   SkPDFcatalog keeps a ordered list of object pointers
-   Elimiante SkTSet template class
-   SkPDFObject::addResources signature changes

BUG=skia:3585

Review URL: https://codereview.chromium.org/1038523004
2015-03-25 13:23:13 -07:00
mtklein
b3e5e4d314 Lazy SKP image decoding in DM.
@sugoi:
Early out to avoid some segfaults in SkImageDecoder_libjpeg.cpp.
I am just flailing here... things seem to work, but I have no idea why.
This prints out a lot:
    libjpeg error 85 <End Of Image> from output_raw_data [0 0]

@halcanary:
I'm skipping on ImageSrc for now.  Leon's refactoring that quite a lot.

This causes minor diffs for the GPU backend, given that we're now
going through the YUV path.  It also reduced peak RAM usage on
my desktop from 1.26GB to 1.08GB.

BUG=skia:

Review URL: https://codereview.chromium.org/1010983004
2015-03-25 13:13:43 -07:00
mtklein
c4a933be63 land some real hashtags
BUG=skia:

Review URL: https://codereview.chromium.org/1029973003
2015-03-25 13:08:42 -07:00
rmistry
3cfd1ad6c7 Add post upload hook to substitute hashtags for their mapped text
BUG=skia:3586
NOTRY=true

Review URL: https://codereview.chromium.org/1004733009
2015-03-25 12:53:36 -07:00
halcanary
2f7ebcb424 SkPDF: eliminate skpdfpage class
BUG=skia:3585

Review URL: https://codereview.chromium.org/1007083004
2015-03-25 12:45:28 -07:00
msarett
114912d4b9 Fix android_run_skia script to allow for larger blacklist
BUG=skia:

Review URL: https://codereview.chromium.org/1011653004
2015-03-25 12:28:33 -07:00
halcanary
a43b41538a SkPDF: merge skdocument_pdf and skpdfdocument
BUG=skia:3585

Review URL: https://codereview.chromium.org/1034793002
2015-03-25 12:15:04 -07:00
halcanary
f41061cc8d SKPDF: refactor pdfcatalog and pdfdocument
SkPDFCatalog:
-   remove first-page-specific code (no longer needed, never
    used) (e.g. addObject()).
-   Make use of SkHashMap for lookups (simplifies code).
-   inline all small methods
-   emitXrefTable moved to SkPDFDocument.cpp
-   no longer store offsets in this data structure (moved to
    SkPDFDocument.cpp)
-   setFileOffset gone.
-   own substitute refs directly.

SkPDFDocument::EmitPDF()
-   All sites that call into SkPDFCatalog modified.
-   catalog.addObject only called in a single place, after the
    resouceSet is built
-   offsets moved to local array.

SkPDFPage:
-   finalizePage no longer deals with SkPDFCatalog or resource sets.
-   GeneratePageTree no longer deals with SkPDFCatalog

SkPDFObjRef
-   emitObject respects the substitution map

Unit Tests:
-   respect SkPDFCatalog::addObject signature change.

SkTHash:
-   #include SkChecksum for SkGoodHash
-   Copyright notice added

Review URL: https://codereview.chromium.org/1033543002
2015-03-25 11:29:18 -07:00
scroggo
05245900bf Add scanline decoding to SkCodec.
Add an interface for decoding scanlines, and implement that interface
in the PNG decoder.

Use a separate method to determine whether an image that used a type
with alpha was actually opaque.

SkScanlineDecoder.h:
New interface for decoding scanlines.

SkCodec.h:
Add getScanlineDecoder.
Add a virtual function (with non-virtual caller) for determining
whether the image truly had alpha. The client can call this to
determine if the image was actually opaque if it reported having alpha.
Remove code to sneakily change the passed in alpha type.

SkCodec_libpng.*:
Split up code onGetPixels into helper functions that can be shared with
the scanline decoder.
Implement scanline decoding.
Implement onReallyHasAlpha.

SkSwizzler.*:
Add a new SrcConfig as a default, which is invalid.
Add a function for setting fDstRow directly.
Assert fDstRow is not NULL.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1010903003
2015-03-25 11:11:52 -07:00
halcanary
038cb5e8d8 SkTHash: add checksum include
Review URL: https://codereview.chromium.org/1030883006
2015-03-25 10:22:54 -07:00
scroggo
3e5622764a Add copyright headers to remaining gyp files.
Prevents some PRESUBMIT errors.

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/1035523003
2015-03-25 10:22:41 -07:00
robertphillips
e523d4f90c Remove SkClipStack's manual rounding of BW clip rects
The full fix for this bug is nudging the image in device space. That is going to be a large change. This CL should address the immediate problem.

This CL will alter the following GMs:
clipdrawdraw
convex_poly_clip
complexclip_bw_*
filltypespersp
complexclip3_simple

BUG=423834

Review URL: https://codereview.chromium.org/1033453003
2015-03-25 09:11:30 -07:00
halcanary
6d622703e5 SkPDF: skpdfdocument and skpdfpage use skpdfdevice in a const way
BUG=skia:3585

Review URL: https://codereview.chromium.org/1035513003
2015-03-25 08:45:42 -07:00
halcanary
26b5d15dab SkPDF: add canon assert before adding code that might break it
Motivation: We can write subsets (by page) of pdf documents (but this
in't yet exposed in the public API), but it is a bad idea to mix pages
from multiple documents (de-duping will break).  This assert verifies
that we don't do this by accident in the future.

BUG=skia:3585

Review URL: https://codereview.chromium.org/1037573005
2015-03-25 08:38:03 -07:00
halcanary
7a0118465a SkPDF: unclass skpdfdocument
BUG=skia:3585

Review URL: https://codereview.chromium.org/1030193002
2015-03-25 07:52:56 -07:00
mtklein
18e55800c6 More file types to check for (C).
- objective C++           (31)
 - objective C             (4)
 - C                       (2)
 - alternate C++ extension (1)
 - Go                      (1)

BUG=skia:

Review URL: https://codereview.chromium.org/1032143002
2015-03-25 07:21:20 -07:00
joshualitt
73bb4562a6 Fix for ClipMaskManager drawSimpleRect
BUG=chromium:466819

Review URL: https://codereview.chromium.org/1031143002
2015-03-25 07:16:21 -07:00
scroggo
648ac53ea3 Add copyright to gyp/codec.gyp.
Review URL: https://codereview.chromium.org/1023673010
2015-03-25 07:16:13 -07:00
halcanary
9d85145590 SkPDF: clean up skpdfdocument, add static functions
Add SkPDFDocument::EmitPDF and SkPDFDocument::GetCountOfFontTypes

Also, make SkPDFDocument::appendPage return void, not bool.

Motivation: These static functions can be used to print subsets of a
pdf document (functionality to be added in a later CL).

BUG=skia:3585

Review URL: https://codereview.chromium.org/1036853002
2015-03-25 07:11:08 -07:00
scroggo
478652e918 Add copyright headers DM.
Review URL: https://codereview.chromium.org/1037713003
2015-03-25 07:11:02 -07:00
msarett
d0be5bb899 Fixing memory leak in ico decoder
BUG=skia:

NOTREECHECKS=true
TBR=scroggo@google.com
NOTRY=true

Review URL: https://codereview.chromium.org/1036873002
2015-03-25 06:29:18 -07:00