Commit Graph

272 Commits

Author SHA1 Message Date
bsalomon@google.com
aab1fd921c Add sizeInBytes to GrResource, make GrRenderTarget aware of its pixel config
Review URL: http://codereview.appspot.com/4802058/



git-svn-id: http://skia.googlecode.com/svn/trunk@1951 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-25 17:41:12 +00:00
senorblanco@chromium.org
2ce9a04b27 Improve GPU blur performance by clearing only when necessary. This gives a
1.8X speedup on the Blurs sample, and 2.3X on the BigBlur sample.

We don't need to clear while downsampling, since each step reads only the pixels
written in the previous step.  We can avoid destination clears before
convolution by disabling blending.  We also don't need to clear when upsampling,
since the upsample step also only reads pixels written by the convolution.  The
only clears we then need to do are on each side of the srcRect used for
convolution, and a 1-pixel border for bilinear upsampling.  Since our srcRect is
always offset to (0, 0), we only need to clear on the right and bottom.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1941 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-22 15:31:14 +00:00
senorblanco@chromium.org
fdaf2b9f8b Revert r1937 while I try to figure out the GM failures.
(Unreviewed; build fix).



git-svn-id: http://skia.googlecode.com/svn/trunk@1938 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-21 22:16:05 +00:00
senorblanco@chromium.org
b7f28d6ecd Improve GPU blur speed by clearing only when necessary. This gives a
1.8X speedup on the Blurs sample, and 2.3X on the BigBlur sample.

We don't need to clear while downsampling, since each step reads only the pixels
written in the previous step.  We can avoid destination clears before
convolution by disabling blending.  We also don't need to clear when upsampling,
since the upsample step also only reads pixels written by the convolution.  The
only clears we then need to do are on each side of the srcRect used for
convolution.  Since our srcRect is always offset to (0, 0), we only need to
clear on the right and bottom.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1937 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-21 22:07:53 +00:00
tomhudson@google.com
237a461ec9 Instead of turning clipping off during AA, clip to the offscreen tile when
we're writing to it, then restore the onscreen clip when copying it back
to screen. Speeds up rendering of web pages with paths >> tile size.



git-svn-id: http://skia.googlecode.com/svn/trunk@1899 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-19 15:44:00 +00:00
bsalomon@google.com
5c63865b52 Use texture cache for writePixels temp
Review URL: http://codereview.appspot.com/4757050/



git-svn-id: http://skia.googlecode.com/svn/trunk@1887 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-18 19:31:59 +00:00
bsalomon@google.com
d9f826c0db flip Y in uploads to bottom-up textures (and add gm test)
Review URL: http://codereview.appspot.com/4756043/



git-svn-id: http://skia.googlecode.com/svn/trunk@1882 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-18 15:25:04 +00:00
reed@google.com
970cb5597a convolve GrRefCnt and SkRefCnt
git-svn-id: http://skia.googlecode.com/svn/trunk@1873 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-15 15:52:28 +00:00
bsalomon@google.com
6b73e558ba Undo accidental commit of GrContext.cpp in r1860.
git-svn-id: http://skia.googlecode.com/svn/trunk@1861 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-14 15:50:53 +00:00
bsalomon@google.com
eb2aa1d0a2 Make CPU->GPU blur path use texture cache
Review URL: http://codereview.appspot.com/4730041/



git-svn-id: http://skia.googlecode.com/svn/trunk@1860 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-14 15:45:19 +00:00
bsalomon@google.com
84223118f7 Remove some cruft from SampleApp.cpp
Review URL: http://codereview.appspot.com/4724042



git-svn-id: http://skia.googlecode.com/svn/trunk@1858 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-14 14:45:44 +00:00
yangsu@google.com
bd3e3202ad Updated SkUIView to use the current code, added a default gl interface for ios
http://codereview.appspot.com/4717043/


git-svn-id: http://skia.googlecode.com/svn/trunk@1855 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-13 22:05:00 +00:00
bsalomon@google.com
0b96a84ca1 Remove unused SkGpuDevice functions, add GrRenderTarget handle getters
Code Review: http://codereview.appspot.com/4718041/



git-svn-id: http://skia.googlecode.com/svn/trunk@1854 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-13 21:53:49 +00:00
senorblanco@chromium.org
aadd9f8b19 GPU-based blur cleanup. Clean up some issues raised in code review:
- convolveRect() is too low-level; made it private and exposed convolveInX() and
convolveInY() instead
- added GrAutoTextureEntry to automatically unlock a texture entry
- the clipping and bounder checks were returning false from
drawWithGPUMaskFilter(), causing the software blur to kick in; return true
instead
- the Windows build was giving a spurious warning about reading an uninitialized
variable; rearrange the code to fix it

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1842 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-12 19:44:51 +00:00
senorblanco@chromium.org
027de5f922 GPU-based Gaussian blur.
This is a first stab at implementing a GPU-based
Gaussian blur in Ganesh.  The convolution shader is implemented as a new
filtering mode.  There are several known issues:

- no support for blur types other than "normal"
- FBO truncation problem at high zoom values
- uses bilinear for upsampling instead of Mitchell

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1830 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-08 18:03:33 +00:00
bsalomon@google.com
22c5deaf75 Fix div by zero in GPU degenerate radials (and add sample and gm baselines)
Review URL: http://codereview.appspot.com/4675062/


git-svn-id: http://skia.googlecode.com/svn/trunk@1817 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-07 14:38:03 +00:00
bsalomon@google.com
1e257a5db3 Remove nested scope resolutions in GrGpuGLShaders and use enum counts for generating random values in unit test.
git-svn-id: http://skia.googlecode.com/svn/trunk@1807 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-06 19:52:16 +00:00
bsalomon@google.com
2c17fcdc45 Reduce gets of ext string and check validity of stencil format enums
Review URL: http://codereview.appspot.com/4678043/



git-svn-id: http://skia.googlecode.com/svn/trunk@1801 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-06 17:47:02 +00:00
bsalomon@google.com
25fd36c7ef Indexed drawing for paths with multiple contours
Review URL: http://codereview.appspot.com/4648071/



git-svn-id: http://skia.googlecode.com/svn/trunk@1800 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-06 17:41:08 +00:00
reed@google.com
3ef80cf14c suppress printfs
git-svn-id: http://skia.googlecode.com/svn/trunk@1793 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-05 19:09:47 +00:00
bsalomon@google.com
fc899274d9 Offset bounds in GrDefaultPathRenderer by fTranslate.
Review URL: http://codereview.appspot.com/4667053/



git-svn-id: http://skia.googlecode.com/svn/trunk@1787 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-01 22:10:30 +00:00
tomhudson@google.com
0c8d93a940 Reworks r1770 so that users who have replaced SkUserConfig don't have to
make any changes to continue compiling successfully.



git-svn-id: http://skia.googlecode.com/svn/trunk@1779 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-01 17:08:26 +00:00
bsalomon@google.com
9ae4429f9d Don't send NULL buffer data hint in chrome
Review URL: http://codereview.appspot.com/4657067/



git-svn-id: http://skia.googlecode.com/svn/trunk@1778 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-01 15:21:59 +00:00
bsalomon@google.com
ee435122d7 Tesselate path once for tiled offscreen AA
Review URL: http://codereview.appspot.com/4661062/


git-svn-id: http://skia.googlecode.com/svn/trunk@1777 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-01 14:57:55 +00:00
bsalomon@google.com
3582bf9e3d Remove GrAuto*Malloc, replace with SkAuto*Malloc
Review URL: http://codereview.appspot.com/4629088



git-svn-id: http://skia.googlecode.com/svn/trunk@1774 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-30 21:32:31 +00:00
tomhudson@google.com
278cbb452a Enable WebKit/Chromium style logging for Skia.
New macros called in Ganesh functions; by default are compiled away,
in example code resolve to printout, and are compatible with WebKit/Chromium
event logging and GPU profiler.



git-svn-id: http://skia.googlecode.com/svn/trunk@1770 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-30 19:37:01 +00:00
junov@google.com
4ee7ae5dcf Adding the notion of a volatile bitmap to SkBitmap.
Volatility is a hint that indicates that the contents of a bitmap 
are ephemeral. SkGpuDevice will not preserve volatile bitmaps
in its texture cache, and will use textures from a pool of
keyless (recyclable) textures to avoid the performance hit of
texture allocation and release.

A subsequent change is required in webkit in order to take advantage
of this optimization. putImageData, and other methods that create
temporary bitmaps will have to mark their bitmaps as volatile.
before rendering them through skia.



git-svn-id: http://skia.googlecode.com/svn/trunk@1769 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-30 17:30:49 +00:00
tomhudson@google.com
afec7ba759 Fix bug where equality was used instead of assignment.
git-svn-id: http://skia.googlecode.com/svn/trunk@1767 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-30 14:47:55 +00:00
bsalomon@google.com
cb0c5ab54d Fix valgrind reported issue, uninit mem in AutoReleaseGeometry::reset()
Review URL: http://codereview.appspot.com/4667048/




git-svn-id: http://skia.googlecode.com/svn/trunk@1761 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-29 17:48:17 +00:00
senorblanco@chromium.org
78b8253c0a Parse SampleApp command line for a test name. If an argument is passed to
SampleApp on the command line, interpret it as a test name.  If it's a valid
test, open that test at startup.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1742 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-28 19:44:03 +00:00
tomhudson@google.com
c10a88825d Guard against 0 tolerance in curve subdivision.
git-svn-id: http://skia.googlecode.com/svn/trunk@1735 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-28 15:19:32 +00:00
yangsu@google.com
6d2a6a400b Updated the references to iOS util files in the iOSSampleApp project file
renamed gpu/src/skia to gpu/ios



git-svn-id: http://skia.googlecode.com/svn/trunk@1707 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-24 17:26:53 +00:00
tomhudson@google.com
d22b6e4351 Remove global curve subdivision tolerance from GrPathUtils.
Put in framework for changing curve subdivision tolerance when rendering
offscreen AA tiles; however, comment out actual tolerance changes because
of possible quality issues with simple circles (q.v. Arcs slide of SampleApp).



git-svn-id: http://skia.googlecode.com/svn/trunk@1702 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-24 15:53:40 +00:00
caryclark@google.com
1eeaf0ba23 Add support for 8 bits/component glyphs, to
better match the fonts produced by CoreText on OS/X.

M    include/config/SkUserConfig.h
M    include/core/SkMask.h
M    include/core/SkScalerContext.h
M    src/core/SkBlitter_ARGB32.cpp
M    src/core/SkScalerContext.cpp
M    src/core/SkPaint.cpp
M    src/gpu/SkGrFontScaler.cpp
M    src/ports/SkFontHost_mac_coretext.cpp
M    src/ports/SkFontHost_mac.cpp
M    gpu/include/GrTypes.h
M    gpu/src/GrAtlas.cpp



git-svn-id: http://skia.googlecode.com/svn/trunk@1672 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-22 13:19:43 +00:00
bsalomon@google.com
d19aa27e03 Fix copy/paste error in GrDrawTarget::AutoStateRestore::set
Review URL: http://codereview.appspot.com/4639063/



git-svn-id: http://skia.googlecode.com/svn/trunk@1670 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-22 01:28:17 +00:00
bsalomon@google.com
7359eae7c6 fix to free a plot when purging gr font cache
Review URL: http://codereview.appspot.com/4645054/



git-svn-id: http://skia.googlecode.com/svn/trunk@1667 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-21 21:18:25 +00:00
bsalomon@google.com
6aab8e3df7 Initialize members to satisfy coverity.
Code review: http://codereview.appspot.com/4657043/



git-svn-id: http://skia.googlecode.com/svn/trunk@1665 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-21 20:32:12 +00:00
bsalomon@google.com
25fb21f5df Refactor GrDrawTarget vertex/index api
Review URL: http://codereview.appspot.com/4631056/



git-svn-id: http://skia.googlecode.com/svn/trunk@1662 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-21 18:17:25 +00:00
bsalomon@google.com
61f3bde1ba Fix handling of nan when clamping number of pts in quads/cubics
Review URL: http://codereview.appspot.com/4646044/



git-svn-id: http://skia.googlecode.com/svn/trunk@1642 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-17 20:06:49 +00:00
bsalomon@google.com
fe6765293f Remember last successful stencil format
Review URL: http://codereview.appspot.com/4625048/



git-svn-id: http://skia.googlecode.com/svn/trunk@1640 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-17 18:12:21 +00:00
bsalomon@google.com
90405934c5 Fix self-assignment
Review URL: http://codereview.appspot.com/4631047/



git-svn-id: http://skia.googlecode.com/svn/trunk@1637 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-17 15:56:55 +00:00
Scroggo
b092140c18 Remove redundant GrTouchGesture. Switch its only user to SkTouchGesture.
Review at http://codereview.appspot.com/4636045/


git-svn-id: http://skia.googlecode.com/svn/trunk@1636 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-17 15:17:07 +00:00
bsalomon@google.com
b5b3168a64 First pass at improving temporary tex/rt reuse
Review URL: http://codereview.appspot.com/4625043/




git-svn-id: http://skia.googlecode.com/svn/trunk@1616 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-16 18:05:35 +00:00
tomhudson@google.com
e67bd3fbc9 Rename GrGLBug to GrGLCapability.
Default all architectures to kProbe_GrGLCapability.
Use new facilities better from GrGpuGL.cpp



git-svn-id: http://skia.googlecode.com/svn/trunk@1613 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-16 14:08:04 +00:00
Scroggo
c29d7cdf3e Always call notifyTextureDelete in onRelease.
Reviewed at http://codereview.appspot.com/4620050/


git-svn-id: http://skia.googlecode.com/svn/trunk@1611 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-16 13:14:21 +00:00
tomhudson@google.com
30e4bb6667 Avoid checking to see if a bool is less than zero.
Create a symbolic name for -1 when it means "don't know, probe at runtime".



git-svn-id: http://skia.googlecode.com/svn/trunk@1606 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-15 19:41:46 +00:00
senorblanco@chromium.org
129b8e3237 Implement edge AA for concave polys in the tesselated path renderer.
Review URL:  http://codereview.appspot.com/4571072/



git-svn-id: http://skia.googlecode.com/svn/trunk@1600 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-15 17:52:09 +00:00
tomhudson@google.com
a87cd2af4c Increase compatibility with clang, mostly around SK_RESTRICT.
Attempting to fix up our use of __restrict__ so Chrome can enable it.



git-svn-id: http://skia.googlecode.com/svn/trunk@1597 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-15 16:50:27 +00:00
bsalomon@google.com
cd19a5f194 Set texture dirty flag only when texture has really changed
Review URL: http://codereview.appspot.com/4571073/



git-svn-id: http://skia.googlecode.com/svn/trunk@1592 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-15 14:00:23 +00:00
bsalomon@google.com
7ac249bdc7 Enable SSAA on inverse filled paths
Review URL: http://codereview.appspot.com/4613044/



git-svn-id: http://skia.googlecode.com/svn/trunk@1584 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-06-14 18:46:24 +00:00