Commit Graph

405 Commits

Author SHA1 Message Date
bsalomon@google.com
27661181d7 Fix windows color order
Review URL: http://codereview.appspot.com/4553048/



git-svn-id: http://skia.googlecode.com/svn/trunk@1379 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-19 15:57:44 +00:00
vandebo@chromium.org
466f3d66f0 [PDF] Implement clear xfermode with a mask instead of pushing the clip down.
This approach is much less likely to use an SkRegion and ends up working better for Webkit.

Review URL: http://codereview.appspot.com/4550057

git-svn-id: http://skia.googlecode.com/svn/trunk@1375 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-18 23:06:29 +00:00
vandebo@chromium.org
8989d31cf0 [PDF] Fix windows compile warning.
Review URL: http://codereview.appspot.com/4545056

git-svn-id: http://skia.googlecode.com/svn/trunk@1374 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-18 22:10:09 +00:00
reed@google.com
05ea1810a2 move SHIFT default definitions from SkColorPriv.h to SkPostConfig.h, so that
clients don't accidentally see them defined on some platforms when they only
include SkTypes.h, and not others.



git-svn-id: http://skia.googlecode.com/svn/trunk@1373 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-18 21:24:16 +00:00
reed@google.com
02b5331078 encode current LCD orientation and order into font-cache-key
git-svn-id: http://skia.googlecode.com/svn/trunk@1368 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-18 19:00:53 +00:00
reed@google.com
1fbb30051a add more keys
git-svn-id: http://skia.googlecode.com/svn/trunk@1357 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-17 20:44:54 +00:00
vandebo@chromium.org
ff3903202e [PDF] Improve path effect and drawPath(prePathMatrix) support.
Add path effect handling for drawPoints (via drawPath).
Move path effect handling from drawRect to drawPath.
Add prePathMatrix support to drawPath.

BUG=crbug.com/82849

Review URL: http://codereview.appspot.com/4531047

git-svn-id: http://skia.googlecode.com/svn/trunk@1354 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-17 18:58:44 +00:00
epoger@google.com
2047f00e46 get tests closer to passing for SKIA_SCALAR=fixed
http://codereview.appspot.com/4532064/



git-svn-id: http://skia.googlecode.com/svn/trunk@1351 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-17 17:36:59 +00:00
bungeman@google.com
16bab87a78 Add GL context creation for X so that gm can run GPU on Linux.
http://codereview.appspot.com/4548047/


git-svn-id: http://skia.googlecode.com/svn/trunk@1343 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-17 14:24:46 +00:00
bsalomon@google.com
f2d91557b2 separate coverage stages from color stages.
Review URL: http://codereview.appspot.com/4538064/



git-svn-id: http://skia.googlecode.com/svn/trunk@1339 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-16 20:56:06 +00:00
reed@google.com
4b4fb3a52c fully expand the initialization for rect (android compiler didn't like {0})
git-svn-id: http://skia.googlecode.com/svn/trunk@1336 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-16 18:24:19 +00:00
reed@google.com
07f3ee10d3 use SkPath for GrPath, removing GrPathIter entirely
http://codereview.appspot.com/4515071/



git-svn-id: http://skia.googlecode.com/svn/trunk@1335 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-16 17:21:57 +00:00
reed@google.com
b54455e440 Change getConvexity() to now compute it if the value is set to kUnkown.
Change behavior for degenerate paths: now those return kConvex instead of kUnknown



git-svn-id: http://skia.googlecode.com/svn/trunk@1330 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-16 14:16:04 +00:00
Scroggo
d757df2b1b Optimize colorfilter path when using a constant color.\nReviewed at http://codereview.appspot.com/4548041/
git-svn-id: http://skia.googlecode.com/svn/trunk@1328 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-16 13:11:16 +00:00
reed@google.com
04863fa14a add Convexity enum to SkPath
git-svn-id: http://skia.googlecode.com/svn/trunk@1324 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-15 04:08:24 +00:00
vandebo@chromium.org
6112c215fb [PDF] Add support for SrcIn, SrcOut, DstIn, DstOut xfermodes.
This change uses the soft mask (aka soft clip) functionality of PDF to implement the xfermodes.  It has to put existing content (dst) into a form xobject as well as putting the new (src) content into a different form xobject.  It then draws one of them with the other as the soft mask.
To accomplish this, we add a call to finishContentEntry after each call to setUpContentEntry - this is kind of a hack, but I don't see a better way to extract src.
Unfortunately, soft mask is specified in the Graphic State PDF object (and not in the form xobject), so when handling one of these modes, we add a one time GS object to set the soft mask and invoke a simple GS to reset the soft mask when done.

Review URL: http://codereview.appspot.com/4496041

git-svn-id: http://skia.googlecode.com/svn/trunk@1320 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-13 03:50:38 +00:00
reed@google.com
af8edcc477 update dox
git-svn-id: http://skia.googlecode.com/svn/trunk@1318 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-12 22:31:01 +00:00
vandebo@chromium.org
78dad54080 [PDF] Fix Chrome crash - don't assume that SkDraw.fClipStack != NULL.
Chrome bug is crbug.com/82198.

Review URL: http://codereview.appspot.com/4515061

git-svn-id: http://skia.googlecode.com/svn/trunk@1306 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-11 18:46:03 +00:00
twiz@google.com
246bd0f271 git-svn-id: http://skia.googlecode.com/svn/trunk@1292 2bbb7eff-a529-9590-31e7-b0007b416f81 2011-05-10 23:10:26 +00:00
reed@google.com
f2eb5ab780 fix bug where we wrote uninitialized data to the flatten stream for shaders.
Both shader and gradient_shader write matrices to the flatten stream. However, they were
just calling write(&matrix, sizeof(SkMatrix)) and the matrix can contain lazily-computed
function ptrs as part of its internal cache. Thus two matrices that are logically the
same may write different bytes.

This is a problem because picture relies on flattening objects and then using the
flatten stream as a key into its cache. This matrix-write bug effectively kills the
effectiveness of the cache for shaders.

The fix is to write proper read/write functions for matrix (and region btw). These
call through to the existing low-level flatten routines (which just write into a
memory ptr).



git-svn-id: http://skia.googlecode.com/svn/trunk@1290 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-10 22:56:42 +00:00
bsalomon@google.com
cc4dac3dac Make GrMatrix an alias of SkMatrix. Add new methods to SkMatrix.
Review URL: http://codereview.appspot.com/4538043/

Checked in on behalf of reed@ with some additional work (remove the do-nother sk->gr matrix converter).



git-svn-id: http://skia.googlecode.com/svn/trunk@1289 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-10 13:52:42 +00:00
bsalomon@google.com
ee9aa30457 Fixes from Sk/Gr rect unification.
git-svn-id: http://skia.googlecode.com/svn/trunk@1288 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 22:32:52 +00:00
vandebo@chromium.org
6744d498fc [PDF] Add a ToUnicode mapping for fonts.
This makes text in PDFs searchable and copy&paste-able.

Code from arthurhsu@chromium.org.  Original review: http://codereview.appspot.com/4428082/

Review URL: http://codereview.appspot.com/4525042

git-svn-id: http://skia.googlecode.com/svn/trunk@1280 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 18:13:47 +00:00
reed@google.com
20efde71b4 Share code with SkRect
http://codereview.appspot.com/4523046/



git-svn-id: http://skia.googlecode.com/svn/trunk@1277 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 17:00:02 +00:00
vandebo@chromium.org
25adce81ce [PDF] Add support for Clear, Src, Dst, DstOver xfermodes.
This uses the refactoring in http://codereview.appspot.com/4459041/ to add support for additional xfer modes.  Calling setupContentEntry may affect previous content entries (removing, reordering, or modifying their clip) and indicates to the caller if it should draw the new item or not.

Review URL: http://codereview.appspot.com/4464043

git-svn-id: http://skia.googlecode.com/svn/trunk@1271 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 08:05:01 +00:00
vandebo@chromium.org
a0c7edbb08 [PDF] Fix setting of existing clip for layers.
The current approach of setting the existing clip just before drawing a layer into a device doesn't work.  SkDevice::clear() uses existing clip before that and if we need to put the content in a transparency group (i.e. for SrcIn xfermode), we need a valid existing clip.  Instead, change the factory to use a special constructor when creating a layer device.

Review URL: http://codereview.appspot.com/4495041

git-svn-id: http://skia.googlecode.com/svn/trunk@1270 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 07:58:08 +00:00
vandebo@chromium.org
9fbdf87518 [PDF] Refactor content stream creation in SkPDFDevice to support more xfermodes.
Instead of writing all drawing and state updates into the final content stream immediately, this change creates a new ContentEntry each time the transform, clip, or paint changes.  Drawing is done into a stream in the ContentEntry.  When the consumer asks for the content, we combine all the ContentEntries with appropriate updates to the state (clip, transform, paint) in between.  This allows us to modify the clip even after a drawing has completed.  It also lets us remove ContentEntries with no drawing.  Further optimization can be done to better use the stack features of PDF, for now we follow the previous model of having a single clip followed by a single transform on the graphic state stack.

Push rectangle logic into SkPDFUtil::AppendRectangle.
Change private functions to adhere to coding standards.

Review URL: http://codereview.appspot.com/4459041

git-svn-id: http://skia.googlecode.com/svn/trunk@1269 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 07:55:58 +00:00
reed@google.com
7744c205f2 use SkPoint, creating an alias for GrPoint
http://codereview.appspot.com/4498041/



git-svn-id: http://skia.googlecode.com/svn/trunk@1268 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-06 19:26:26 +00:00
bsalomon@google.com
fc29629525 Replace GrStringBuilder with SkString. First step in cleaning up the shader generator. Slight performance hit when creating a new shader (<10% of total shader gen time on my Windows box is spent in building our string before handing it to GL). Much of this can be recovered by better usage pattern of SkString in coming revisions.
Review URL: http://codereview.appspot.com/4465053/ 



git-svn-id: http://skia.googlecode.com/svn/trunk@1266 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-06 13:53:47 +00:00
bsalomon@google.com
0aa6c3e212 Tab -> spaces
git-svn-id: http://skia.googlecode.com/svn/trunk@1264 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-06 13:02:10 +00:00
reed@google.com
185d3d016d add SkScalarIsInt()
git-svn-id: http://skia.googlecode.com/svn/trunk@1262 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-06 12:18:08 +00:00
reed@google.com
a571c99228 don't require a ptr unless size > 0
git-svn-id: http://skia.googlecode.com/svn/trunk@1259 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-05 20:04:44 +00:00
reed@google.com
8d90eeba09 add find()
git-svn-id: http://skia.googlecode.com/svn/trunk@1243 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-04 18:03:00 +00:00
reed@google.com
3048d4fd4e remove deprecated getViewport/setViewport
git-svn-id: http://skia.googlecode.com/svn/trunk@1235 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-04 13:50:34 +00:00
reed@google.com
acd471f47c updated pipe
git-svn-id: http://skia.googlecode.com/svn/trunk@1231 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-03 21:26:46 +00:00
vandebo@chromium.org
1e1c36f4f8 Add comparison and assignment to SkClipStack (and fix an optimization bug).
Review URL: http://codereview.appspot.com/4423085

git-svn-id: http://skia.googlecode.com/svn/trunk@1230 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-03 16:26:09 +00:00
reed@google.com
7894b92b57 code style
git-svn-id: http://skia.googlecode.com/svn/trunk@1229 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-03 15:41:49 +00:00
reed@google.com
2f3dc9dc4c add typefacecache
speedup lcd blits
clean up some samples



git-svn-id: http://skia.googlecode.com/svn/trunk@1220 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-02 17:33:45 +00:00
vandebo@chromium.org
be2048a371 [PDF] Fix fallout from r1217.
The width and height we pass to SkDevice must be postive.
Shader can no longer use negative coordinates (without transform).
Shader unflip matrix should use same values as passed to SkPDFDevice (height).
Most Shader dictionary entries should be scalars and not ints.

Review URL: http://codereview.appspot.com/4454047

git-svn-id: http://skia.googlecode.com/svn/trunk@1219 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-02 15:24:01 +00:00
ctguil@chromium.org
1526129380 PDF Device should report non-transformed size for width and height.
Review URL: http://codereview.appspot.com/4435074

git-svn-id: http://skia.googlecode.com/svn/trunk@1217 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-29 17:54:16 +00:00
reed@google.com
3b521d0533 update dox
code style



git-svn-id: http://skia.googlecode.com/svn/trunk@1215 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-29 11:53:41 +00:00
mike@reedtribe.org
e9e08cc7b2 rename SkPtrRecorder and related wrappers to SkPtrSet, since that is the pattern
is it providing. Also add a templated wrapper to handle typecasting of ptr types.



git-svn-id: http://skia.googlecode.com/svn/trunk@1214 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-29 01:44:52 +00:00
mike@reedtribe.org
e8f754a41c update dox
git-svn-id: http://skia.googlecode.com/svn/trunk@1213 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-29 01:02:43 +00:00
bsalomon@google.com
06e1795cd9 Add bounding rect for paths
Review URL: http://codereview.appspot.com/4442094/



git-svn-id: http://skia.googlecode.com/svn/trunk@1205 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-27 21:13:04 +00:00
tomhudson@google.com
4b33d28eb3 New 'skdiff' tool to compare two directories full of files, write diff images
into a third directory, and create a summary web page with metrics for easy
inspection of the results.



git-svn-id: http://skia.googlecode.com/svn/trunk@1200 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-27 15:39:30 +00:00
tomhudson@google.com
1447c6f7f4 Add missing flattenable registrations and CreateProc() functions;
fixes gm --serialize xfermode test case.



git-svn-id: http://skia.googlecode.com/svn/trunk@1199 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-27 14:09:52 +00:00
reed@google.com
f31663403b http://codereview.appspot.com/4436057/
Tag some more API headers with SK_API so they are exposed
when doing a DLL build.



git-svn-id: http://skia.googlecode.com/svn/trunk@1193 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-26 20:06:08 +00:00
reed@google.com
c009111446 http://codereview.appspot.com/4438070/
update SK_API for non-windows builds



git-svn-id: http://skia.googlecode.com/svn/trunk@1192 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-26 20:04:16 +00:00
reed@google.com
5b3d5349be add helper available()
git-svn-id: http://skia.googlecode.com/svn/trunk@1188 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-26 17:49:03 +00:00
reed@google.com
bb6992a9d6 add experimental canvas pipe
git-svn-id: http://skia.googlecode.com/svn/trunk@1187 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-26 17:41:56 +00:00