Commit Graph

652 Commits

Author SHA1 Message Date
reed@google.com
82ce2b8afb add more SkInstCnt plumbing
git-svn-id: http://skia.googlecode.com/svn/trunk@4343 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-26 17:43:26 +00:00
reed@google.com
3b42998466 stick SkInstCnt in more classes, to help track down leaks
git-svn-id: http://skia.googlecode.com/svn/trunk@4341 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-26 15:30:08 +00:00
reed@google.com
34342f6f51 export flags on the state of the world when a picture was serialized.
e.g. don't read/write functionptrs in that case (sizeof may be different for one)
Review URL: https://codereview.appspot.com/6331050

git-svn-id: http://skia.googlecode.com/svn/trunk@4318 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-25 14:36:28 +00:00
robertphillips@google.com
15c0fea699 AutoScratchTexture can now release its texture and it will return to the texture cache when freed
http://codereview.appspot.com/6262043/



git-svn-id: http://skia.googlecode.com/svn/trunk@4301 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-22 12:41:43 +00:00
robertphillips@google.com
15e9d3e66e Expanded distribution of instance counting
http://codereview.appspot.com/6300114/



git-svn-id: http://skia.googlecode.com/svn/trunk@4291 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-21 20:25:03 +00:00
bsalomon@google.com
4da34e36cb Add GrMemoryPool as a helper to override operators new/delete
Review URL: http://codereview.appspot.com/6306090/



git-svn-id: http://skia.googlecode.com/svn/trunk@4282 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-19 15:40:27 +00:00
robertphillips@google.com
4d73ac22a1 Version 2 of the Instance Counting system. This one simplifies the print out of information.
http://codereview.appspot.com/6296069/



git-svn-id: http://skia.googlecode.com/svn/trunk@4255 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-13 18:54:08 +00:00
reed@google.com
9a323c98f6 faster SkScalarIsFinite()
git-svn-id: http://skia.googlecode.com/svn/trunk@4244 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-13 13:03:08 +00:00
robertphillips@google.com
4bdfb8c9d6 Compiler complaints + some minor cleanup
http://codereview.appspot.com/6295070/



git-svn-id: http://skia.googlecode.com/svn/trunk@4238 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-12 21:23:49 +00:00
reed@google.com
51c62a6cfa add readPtr and writePtr to SkReader32 and SkWriter32
add template helper SkSWriter32, which allocates initial storage buffer
Review URL: https://codereview.appspot.com/6299075

git-svn-id: http://skia.googlecode.com/svn/trunk@4237 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-12 20:47:53 +00:00
djsollen@google.com
64a0ec3655 Move SkColorTable into its own header and reduce includes in SkFlattenable.h
Review URL: https://codereview.appspot.com/6299072

git-svn-id: http://skia.googlecode.com/svn/trunk@4236 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-12 15:17:27 +00:00
robertphillips@google.com
f6747b0b90 Split GrContext's AA Rect drawing methods into helper class
http://codereview.appspot.com/6300070/



git-svn-id: http://skia.googlecode.com/svn/trunk@4233 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-12 00:32:28 +00:00
reed@google.com
7886ad3de1 remove SK_CAN_USE_FLOAT (deprecated)
git-svn-id: http://skia.googlecode.com/svn/trunk@4232 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-11 21:21:26 +00:00
djsollen@google.com
94e75ee46a Rename the existing flatten(void*) methods.
This change avoids naminc confusion with the SkFlattenable flatten methods and
also changes SkPath to use the void* model instead of taking a SkReader32.
Review URL: https://codereview.appspot.com/6299062

git-svn-id: http://skia.googlecode.com/svn/trunk@4215 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-08 18:30:46 +00:00
bsalomon@google.com
df9d656c35 Add SkPath::getVerbs/countVerbs
Review URL: http://codereview.appspot.com/6306053/


git-svn-id: http://skia.googlecode.com/svn/trunk@4209 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-07 21:43:15 +00:00
reed@google.com
83226976b5 extend asAGradient for Conical type (to be implemented by PDF and XPS)
Review URL: https://codereview.appspot.com/6308051

git-svn-id: http://skia.googlecode.com/svn/trunk@4207 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-07 20:26:47 +00:00
bsalomon@google.com
f6d3c5aa5f Make SkPath::RawIter require a non-NULL pts pointer.
Review URL: http://codereview.appspot.com/6301060/



git-svn-id: http://skia.googlecode.com/svn/trunk@4206 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-07 17:47:33 +00:00
caryclark@google.com
3dd459151f fix warnings on Mac in miscellaneous files
Fix these class of warnings:
- unused functions
- unused locals
- sign mismatch
- missing function prototypes
- missing newline at end of file
- 64 to 32 bit truncation

The changes prefer to link in dead code in the debug build
with 'if (false)' than to comment it out, but trivial cases
are commented out or sometimes deleted if it appears to be
a copy/paste error.
Review URL: https://codereview.appspot.com/6305047

git-svn-id: http://skia.googlecode.com/svn/trunk@4186 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-06 12:11:10 +00:00
robertphillips@google.com
977b9c8af3 Instance counting for SkRefCnt-derived objects (w/ CanvasTest fix)
http://codereview.appspot.com/6242070/



git-svn-id: http://skia.googlecode.com/svn/trunk@4170 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-05 19:35:09 +00:00
robertphillips@google.com
25c199343d Reverting r4162
git-svn-id: http://skia.googlecode.com/svn/trunk@4164 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-05 16:24:32 +00:00
robertphillips@google.com
3227ab5f64 Added instance counting system for SkRefCnt-derived objects
http://codereview.appspot.com/6242070/



git-svn-id: http://skia.googlecode.com/svn/trunk@4162 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-05 15:40:54 +00:00
reed@google.com
8b0d0f6a9c remove public function-ptr based colorfilter
Review URL: https://codereview.appspot.com/6286046

git-svn-id: http://skia.googlecode.com/svn/trunk@4141 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-04 18:10:33 +00:00
junov@chromium.org
4866cc0afb Adding option to serialize mutable bitmaps in SkPicture
BUG=http://code.google.com/p/chromium/issues/detail?id=115654
REVIEW=http://codereview.appspot.com/6221066/



git-svn-id: http://skia.googlecode.com/svn/trunk@4130 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-01 21:23:07 +00:00
bungeman@google.com
04640299dc VC++ allows template parameter shadowing.
git-svn-id: http://skia.googlecode.com/svn/trunk@4127 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-01 19:47:51 +00:00
bungeman@google.com
e70f798ebc Serialize support for GDI.
http://codereview.appspot.com/6263046/



git-svn-id: http://skia.googlecode.com/svn/trunk@4126 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-01 19:38:19 +00:00
tomhudson@google.com
1f90287df3 Punctuation cleanup to satisfy idiosyncracies of OpenBSD gcc 4.2.1.
Original patch by landry.breuil.

http://code.google.com/p/skia/issues/detail?id=626



git-svn-id: http://skia.googlecode.com/svn/trunk@4112 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-01 13:15:47 +00:00
djsollen@google.com
15eeca0068 Update the implementation of SkTypeface_android.h functions.
This CL removes the hardcoded mappings of FallbackScripts to
a particular font file and replaces it with a dynamic mechanism
that takes a style and representative character code for a given
FallbackScript class and returns the most appropriate SkTypeface
that contains that character code.
Review URL: https://codereview.appspot.com/6197074

git-svn-id: http://skia.googlecode.com/svn/trunk@4111 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-01 12:52:26 +00:00
djsollen@google.com
9714516a0d Add SkFontDescriptor for serializing fonts.
Review URL: https://codereview.appspot.com/6250080

git-svn-id: http://skia.googlecode.com/svn/trunk@4106 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-31 19:55:08 +00:00
reed@google.com
0d10280190 We often rgn-diff an area >= the other rgn. now we detect that and return empty
We do this when we update our devices in SkCanvas.cpp
Review URL: https://codereview.appspot.com/6249073

git-svn-id: http://skia.googlecode.com/svn/trunk@4101 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-31 18:28:59 +00:00
robertphillips@google.com
d414406073 Windows compiler complaint cleanup
http://codereview.appspot.com/6262047/



git-svn-id: http://skia.googlecode.com/svn/trunk@4098 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-31 15:29:44 +00:00
djsollen@google.com
d2700eec7e Refactor dictionaries for use by entities other than just SkPicture
Review URL: https://codereview.appspot.com/6101043

git-svn-id: http://skia.googlecode.com/svn/trunk@4077 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-30 16:54:13 +00:00
digit@google.com
eec9dbcace arm: First step towards dynamic NEON support.
This patch adds minimal support for dynamic ARM NEON support,
i.e. the ability to probe the CPU at runtime for NEON and
provide alternate code paths when it is available.

- Add include/core/SkUtilsArm.h, which declares a few helper
  macros (e.g. SK_NEON_ARM_IS_DYNAMIC), plus the handy
  function 'sk_cpu_arm_has_neon()' which returns true if
  the target CPU supports the ARM NEON instruction set.

  Note that the header is in include/core/ because it will
  have to be included from NEON-specific code under src/code/

  It would probably be more logical to put it under include/opts/
  instead, but this would require moving all the NEON-specific
  stuff under src/code/ into src/opts/, which is not trivial
  due to the way the code is currently architected.

- Add src/core/SkUtilsArm.cpp which implements
  'sk_cpu_arm_has_neon' for ARM-based Linux systems, only
  when SK_NEON_ARM_IS_DYNAMIC is true.

  (For other cases, 'sk_cpu_arm_has_neon' is an inline function
   that returns a constant 'true' or 'false' value).

  There is no user-level accessible CPUID instruction on ARM,
  so do all CPU feature probing by parsing /proc/cpuinfo.
  This is Linux-specific.

  For Debug build types, the CPU probing result is printed
  to the Android log (or Linux command-line) for easier
  debugging.

- Create a new 'opts_neon' target (static library) which shall
  contain all the NEON-specific code paths for the library.

  This is necessary because -mfpu=neon impacts also non-scalar
  code. Just like with -mssse3 on x86, we can't build the rest
  of the library with this flag.

  Note that for now, we only include memset16_neon and
  memset32_neon in this library.

- Modify opts_check_arm.cpp to implement SK_ARM_NEON_IS_DYNAMIC
  properly.

Compared to a 'xoom' build, the only difference is the use of
NEON-optimized memset16/32 functions. Later patches will move
more NEON-specific code paths to 'opts_neon'.
Review URL: https://codereview.appspot.com/6247058

git-svn-id: http://skia.googlecode.com/svn/trunk@4069 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-30 13:54:41 +00:00
reed@google.com
744fabad47 addPoly() entry-point, to quickly add MoveTo+N*LineTo (useful in dashing)
Review URL: https://codereview.appspot.com/6256063

git-svn-id: http://skia.googlecode.com/svn/trunk@4061 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-29 19:54:52 +00:00
reed@google.com
8b06f1a7ff Detect when the caller was hairline AND strokeandfill, and resolve that into FILL
This fixes the unittests on WIN in the trybot for DEPS roll 4048
Review URL: https://codereview.appspot.com/6242057

git-svn-id: http://skia.googlecode.com/svn/trunk@4057 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-29 12:03:46 +00:00
mike@reedtribe.org
398b1bcb7d add SkPoint::isZero(), match the existing method on SkIPoint
git-svn-id: http://skia.googlecode.com/svn/trunk@4055 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-29 01:40:15 +00:00
reed@google.com
fd4be26c42 Change patheffect to take a (new) StrokeRec object, which encapsulates the fill
or stroke parameters for a path.

Today, the patheffect only sees if the caller was going to stroke or fill, and
if stroke, it just sees the width. With this change, the effect can see all of the
related parameters (e.g. cap/join/miter). No other change is intended at this
time.

After this change, I hope to use this additional data to allow SkDashPathEffect
to, at times, apply the stroke as part of its effect, which may be much more
efficient than first dashing, and then reading that and stroking it.

Most of these files changed just because of the new parameter to filterPath. The
key changes are in SkPathEffect.[h,cpp], SkPaint.cpp and SkScalerContext.cpp
Review URL: https://codereview.appspot.com/6250051

git-svn-id: http://skia.googlecode.com/svn/trunk@4048 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-25 01:04:12 +00:00
reed@google.com
d3521f1a8d revert 4046 -- GM:pathfill failed on one bot, maybe uninitialized memory somewhere?
git-svn-id: http://skia.googlecode.com/svn/trunk@4047 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-24 20:32:22 +00:00
reed@google.com
9797272edf Change patheffect to take a (new) StrokeRec object, which encapsulates the fill
or stroke parameters for a path.

Today, the patheffect only sees if the caller was going to stroke or fill, and if
stroke, it just sees the width. With this change, the effect can see all of the
related parameters (e.g. cap/join/miter). No other change is intended at this
time.

After this change, I hope to use this additional data to allow SkDashPathEffect
to, at times, apply the stroke as part of its effect, which may be much more
efficient than first dashing, and then reading that and stroking it.

Most of these files changed just because of the new parameter to filterPath. The
key changes are in SkPathEffect.[h,cpp], SkPaint.cpp and SkScalerContext.cpp
Review URL: https://codereview.appspot.com/6249050

git-svn-id: http://skia.googlecode.com/svn/trunk@4046 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-24 20:13:57 +00:00
robertphillips@google.com
49d9fd5fdb Plumbing to propagate save & restore from SkCanvas down to GrContext & lower
http://codereview.appspot.com/6203067/



git-svn-id: http://skia.googlecode.com/svn/trunk@4034 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-23 11:44:08 +00:00
reed@google.com
1f1db4cc5b update dox for NewFromMalloc() to clarify ownership
git-svn-id: http://skia.googlecode.com/svn/trunk@4017 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-21 20:00:39 +00:00
tomhudson@google.com
ffe39bd3b6 Fix type errors and a few warnings for Visual Studio 2010 64-bit build.
We're still far from 64b statically safe, mostly around SkReader32.h
and the address-alignment code in GrTypes.h.
Original code provided by jianliang79.

http://code.google.com/p/skia/issues/detail?id=601



git-svn-id: http://skia.googlecode.com/svn/trunk@3994 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-17 15:38:00 +00:00
reed@google.com
ebd24962df change SkChunkAlloc to grow its allocations geometrically (not linearly)
plus add a bench and unittest for it.



git-svn-id: http://skia.googlecode.com/svn/trunk@3989 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-17 14:28:11 +00:00
reed@google.com
803c67dbd7 change SetTLSFontCacheLimit to be void, since it doesn't easily know the prev value
git-svn-id: http://skia.googlecode.com/svn/trunk@3987 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-17 13:50:36 +00:00
reed@google.com
6172d67d1c Allow font-cache to use thread_local_storage for a private cache
Review URL: https://codereview.appspot.com/6200051

git-svn-id: http://skia.googlecode.com/svn/trunk@3986 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-17 13:38:03 +00:00
reed@google.com
ff0da4ff48 Mutexes in pixelrefs were done very sloppily initially. The code (a) assumes all
pixelref subclasses want a mutex to guard their lock/unlock virtuals, and (b)
most subclasses use the same mutex for *all* of their instances, even when there
is no explicit need to guard modifying one instances with another.

When we try drawing bitmaps from multiple threads, we are seeing a lot of slow-
down from these mutexes. This CL has two changes to try to speed things up.

1. Add setPreLocked(), for pixelrefs who never need the onLockPixels
virtual to be called. This speeds up those subclasses in multithreaded environs
as it avoids the mutex lock all together (e.g. SkMallocPixelRef).

2. Add setMutex() to allow a subclass to change the mutex choice. ashmem wants
this, since its unflattening constructor cannot pass down the null, it needs
to cleanup afterwards.
Review URL: https://codereview.appspot.com/6199075

git-svn-id: http://skia.googlecode.com/svn/trunk@3985 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-17 13:14:52 +00:00
bungeman@google.com
526956644a Add 'inline' to suppress unused warnings with Android NDK build.
git-svn-id: http://skia.googlecode.com/svn/trunk@3982 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-16 20:37:39 +00:00
reed@google.com
73a025811c computeFastStrokeBounds needs to pass kStroke_Style instead of kFill_Style (ya think?)
git-svn-id: http://skia.googlecode.com/svn/trunk@3981 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-16 19:21:12 +00:00
reed@google.com
115d931d2f pass the region-op to the clipstack for SkCanvas::clipRegion.
we were defaulting to intersect all the time (doh).



git-svn-id: http://skia.googlecode.com/svn/trunk@3980 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-16 18:50:40 +00:00
bungeman@google.com
20a0477009 Fix new atomic declarations for Android.
git-svn-id: http://skia.googlecode.com/svn/trunk@3979 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-16 18:37:31 +00:00
bungeman@google.com
a02bc1519c WeakRefCnt
http://codereview.appspot.com/5649046/


git-svn-id: http://skia.googlecode.com/svn/trunk@3978 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-16 18:21:56 +00:00