Commit Graph

197 Commits

Author SHA1 Message Date
bsalomon@google.com
2368f6f572 Remove createPlatformRenderTarget, undeprecate createRenderTargetFrom3DAPIState
Review URL: http://codereview.appspot.com/4552053/



git-svn-id: http://skia.googlecode.com/svn/trunk@1387 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-19 21:22:39 +00:00
senorblanco@chromium.org
64cc579efa The plain Makefile was using -Wall, but the gyp build wasn't. This CL turns on
-Wall -Wextra and -Wno-unused in common.gypi.  This revealed a lot of warnings
(and some actual bugs), all of which I fixed here.  This is pretty mindless
stuff for the most part (order of intialization, missing initializers, && within
||, etc), but will allow us to build cleanly with -Wall and -Wextra (and
-Werror, if we so choose).

I put defaults into switches that were missing cases.  I could put in the actual
missing enums instead if that's desired.  I could also assert on missing enums
instead of break, if that's desired.  I wasn't sure how to test the stuff in
"animator", so that should be looked at a bit more closely.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1386 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-19 19:58:58 +00:00
bungeman@google.com
0e45441994 Add Mesa as a GL backend.
http://codereview.appspot.com/4545055/


git-svn-id: http://skia.googlecode.com/svn/trunk@1382 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-19 17:47:02 +00:00
senorblanco@chromium.org
ef3913bcbf Batch up draws into triangle fans as large as possible when drawing convex
edge AA polys, so we minimize state changes and GL calls.  This requires
querying GL for the maximum number of fragment uniforms.  It also makes the
shader generator produce custom shaders for the number of relevant edges. 
This gives a ~5X speedup on the "Shapes" SampleApp.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1380 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-19 17:11:07 +00:00
bsalomon@google.com
00e17c5a1b Fix uninit of mask var
git-svn-id: http://skia.googlecode.com/svn/trunk@1369 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-18 19:02:42 +00:00
bsalomon@google.com
26c2d0a69e Use coverage stages for supersample AA resolve, edgeAA, and glyph masks. Expose a mask stage through GrPaint
Review URL: http://codereview.appspot.com/4548048/



git-svn-id: http://skia.googlecode.com/svn/trunk@1356 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-17 20:15:30 +00:00
senorblanco@chromium.org
db2566bf96 Set fEdgesUni to kUseUniform when we need to upload it. Fix for bug introduced
in r1339 where the tesselated path renderer would render nothing.

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


git-svn-id: http://skia.googlecode.com/svn/trunk@1355 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-17 19:11:04 +00:00
senorblanco@chromium.org
5793a1ff40 Pass forceClose "true" to SkPath::Iter constructor in
GrPathUtils::worstCasePointCount().  worstCasePointCount() is sometimes
returning a lower value than the number of points subsequently generated by
the path renderers.  This is because it constructs the SkPath::Iter with
forceClose set to "false", while the path renderers use one with forceClose
set to "true".  They should both be the same, and since we're filling paths, I
think it should be set "true".

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1353 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-17 18:29:26 +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
junov@google.com
d31cbc4650 Removing remnants of GrGLEffect.
Bug: http://code.google.com/p/skia/issues/detail?id=264
Code review: http://codereview.appspot.com/4517073/



git-svn-id: http://skia.googlecode.com/svn/trunk@1350 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-17 17:01:17 +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
junov@google.com
6acc9b3d2b Fixed color bleeding issue when drawing a sub region of a bitmap with filtering enabled.
Problem was resolved by adding the notion of a custom texture domain in generated shaders, when necessary.




git-svn-id: http://skia.googlecode.com/svn/trunk@1337 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-16 18:32:07 +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
senorblanco@chromium.org
ff174b3947 Fix winding order check for negative scale in tesselated path rendering. The
isCCW() code in GrTesselatedPathRenderer was using untransformed vertices,
which fails for transforms with negative scale.  Doing the check after
transformation fixes it.  This was causing some missing geometry in the
PolyToPoly and Shapes tests in SampleApp.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1334 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-16 16:59:57 +00:00
bsalomon@google.com
27a4dc4c36 Upload matrix as gl float rather than gr scalar (fixes a build break when scalar==fixed)
Review URL: http://codereview.appspot.com/4516051/


git-svn-id: http://skia.googlecode.com/svn/trunk@1329 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-16 13:14:03 +00:00
bsalomon@google.com
12ad3aa49b Disable blend for edge AA not general AA
Review URL: http://codereview.appspot.com/4526051/




git-svn-id: http://skia.googlecode.com/svn/trunk@1316 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-12 20:34:19 +00:00
Scroggo
5d7574099b Style fix
git-svn-id: http://skia.googlecode.com/svn/trunk@1315 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-12 18:27:05 +00:00
senorblanco@chromium.org
92e0f222fb Edge antialiasing for convex shapes in Ganesh
This patch implements edge antialiasing for convex shapes, using the fragment
shader to compare against the edge equations for each triangle.  Currently, it
only works for flat shaded primitives (i.e., it was not integrated into the
"active stages" path).  The skia.gyp changes cause this code to be compiled into
SampleApp, but do not enable the tesselated path by default.

Notes:  the SkOSWindow_Unix.cpp change is to silence a valgrind warning about
memcpy() with overlapping regions.  The GrBinHashKey change is to avoid running
a two-pass hash (GrProgramDesc is now 52 bytes or so, exceeding the 32 byte
default size).

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1314 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-12 15:49:15 +00:00
Scroggo
0bad67303d Allow blending if there is a color filter.
git-svn-id: http://skia.googlecode.com/svn/trunk@1309 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-11 20:25:01 +00:00
bsalomon@google.com
dcf1b0b0ab Add space between mediump and float in 2pt radial vertex uniform decl
Review URL http://codereview.appspot.com/4544041/




git-svn-id: http://skia.googlecode.com/svn/trunk@1308 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-11 19:00:54 +00:00
Scroggo
a8a57be564 Remove a warning.
git-svn-id: http://skia.googlecode.com/svn/trunk@1303 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-11 18:16:56 +00:00
Scroggo
01b87ec6a6 Store 1/255 as a constant to reduce number of divides.
git-svn-id: http://skia.googlecode.com/svn/trunk@1301 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-11 18:05:38 +00:00
Scroggo
25a61c37b7 Remove unused variable.
git-svn-id: http://skia.googlecode.com/svn/trunk@1299 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-11 17:04:25 +00:00
bsalomon@google.com
2d9ddf9df1 Keep program cache consistent when program creation fails.
Review URL: http://codereview.appspot.com/4523056/

git-svn-id: http://skia.googlecode.com/svn/trunk@1298 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-11 16:52:59 +00:00
Scroggo
97c88c255c Add color filters to gpu path.
git-svn-id: http://skia.googlecode.com/svn/trunk@1297 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-11 14:05:25 +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
72b4fcb587 Fix unused var warning
git-svn-id: http://skia.googlecode.com/svn/trunk@1285 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 20:47:34 +00:00
bsalomon@google.com
55b4e8038d remove deleted include file (oops)
git-svn-id: http://skia.googlecode.com/svn/trunk@1283 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 18:50:47 +00:00
bsalomon@google.com
b9afba3193 Remove previous shader generator class. No longer compiles due to elimination of separate GrStringBuilder class in favor or SkString.
git-svn-id: http://skia.googlecode.com/svn/trunk@1282 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 18:44:52 +00:00
bsalomon@google.com
9196130af8 Make shader generator more legible. Get rid of some magic values.
Review URL: http://codereview.appspot.com/4531043/


git-svn-id: http://skia.googlecode.com/svn/trunk@1281 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 18:39:58 +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
reed@google.com
59f9961d00 remove #if 0 code
git-svn-id: http://skia.googlecode.com/svn/trunk@1276 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 13:37:36 +00:00
bsalomon@google.com
1da0e5e26c Suppress int/NULL comparison warning
git-svn-id: http://skia.googlecode.com/svn/trunk@1275 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-09 13:28:55 +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
reed@google.com
2e550127e6 share macros and types with SkScalar, but keep aliases for now, to avoid editing
call sites.



git-svn-id: http://skia.googlecode.com/svn/trunk@1267 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-06 17:30:45 +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
0292935cd4 remove unused var, fixes warning
git-svn-id: http://skia.googlecode.com/svn/trunk@1265 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-06 13:12:38 +00:00
bsalomon@google.com
2ba4abbb31 Switch to GrGpuGLShaders (instead of GrGpuGLShaders2).
git-svn-id: http://skia.googlecode.com/svn/trunk@1251 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-05 12:39:20 +00:00
bsalomon@google.com
6aef1fb4eb Add 4x4 downsample filter with 4 bilinear texture reads, use for ssaa.
Review URL: http://codereview.appspot.com/4483042/

git-svn-id: http://skia.googlecode.com/svn/trunk@1250 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-05 12:33:22 +00:00
senorblanco@chromium.org
99c2a8b362 SampleApp builds skia on Linux with BGRA pixel order, but Ganesh's SampleApp
assumes GL_RGBA texture format on all platforms except Windows (where it uses
GL_BGRA), so texture colours come out wrong.  As a temporary fix, do on Linux
what we do on Windows, and assume GL_BGRA.  (This should be made more general
later, and the assumption of matching formats between Skia and Ganesh removed.)

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1247 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-04 20:12:01 +00:00
senorblanco@chromium.org
2dbd0449bf Minor fixes to get SampleApp's OpenGL path not to crash on Linux. Initialize
SkOSWindow::fGLAttched (and fVi while we're at it), since it was being checked
uninitialized.  Don't call has_gl_extension() while initializing the
GrGLDefaultInterface, since it derefs the default interface (which is still
NULL); use has_gl_extension_from_string() instead.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1242 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-04 15:29:04 +00:00
bsalomon@google.com
4b9b6a20d4 Fix validation (glTexEnvi is fixed pipe only)
git-svn-id: http://skia.googlecode.com/svn/trunk@1241 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-04 15:01:16 +00:00
bsalomon@google.com
bf2a46941e Add all ES2 glUniform functions to GrGLInterface. Add interface validation for fixed pipe or shader pipe use.
Review URL: http://codereview.appspot.com/4435082/



git-svn-id: http://skia.googlecode.com/svn/trunk@1234 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-04 12:35:39 +00:00
bsalomon@google.com
05ef510389 Remove GrContext.h dependence on GrGpu.h
Review URL:  http://codereview.appspot.com/4433096/



git-svn-id: http://skia.googlecode.com/svn/trunk@1227 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-02 21:14:59 +00:00
bsalomon@google.com
8295dc1474 4x4 SSAA with improvements in determination of when to apply. Still disabled at compile time.
Review URL: http://codereview.appspot.com/4445075/




git-svn-id: http://skia.googlecode.com/svn/trunk@1218 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-05-02 12:53:34 +00:00
junov@google.com
c97db4c40b Fixing a simple build error in GrGpuGLShaders.cpp with GR_AGGRESSIVE_SHADER_OPTS
git-svn-id: http://skia.googlecode.com/svn/trunk@1216 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-29 17:25:42 +00:00
bsalomon@google.com
d5d10494e3 Only define debugging GL globals when the code paths are enabled
git-svn-id: http://skia.googlecode.com/svn/trunk@1212 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-28 21:16:31 +00:00
bsalomon@google.com
eaf6a5daf4 Make reserveAndLockGeometry set index/vertex ptr to null if none requested. We are expecting this behavior in a caller and it seems reasonable.
git-svn-id: http://skia.googlecode.com/svn/trunk@1210 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-28 19:22:57 +00:00
bsalomon@google.com
6a77cc5dde Fix warnings.
git-svn-id: http://skia.googlecode.com/svn/trunk@1209 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-28 17:33:34 +00:00
agl@chromium.org
83747252b8 Adding newline at end of file to fix compiler error.
Unreviewed, build fix.


git-svn-id: http://skia.googlecode.com/svn/trunk@1206 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-04-27 23:11:21 +00:00