mtklein
dbfd7ab108
Replace a lot of 'static const' with 'constexpr' or 'const'.
...
'static const' means, there must be at most one of these, and initialize it at
compile time if possible or runtime if necessary. This leads to unexpected
code execution, and TSAN* will complain about races on the guard variables.
Generally 'constexpr' or 'const' are better choices. Neither can cause races:
they're either intialized at compile time (constexpr) or intialized each time
independently (const).
This CL prefers constexpr where possible, and uses const where not. It even
prefers constexpr over const where they don't make a difference... I want to have
lots of examples of constexpr for people to see and mimic.
The scoped-to-class static has nothing to do with any of this, and is not changed.
* Not yet on the bots, which use an older TSAN.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2300623005
Review-Url: https://codereview.chromium.org/2300623005
2016-09-01 11:24:54 -07:00
robertphillips
28a838e532
Move GrPipelineBuilder out of gms & reduce use of GrPipelineBuilder.h
...
Just another step in reining in the GrPLB
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2086293006
Review-Url: https://codereview.chromium.org/2086293006
2016-06-23 14:07:00 -07:00
bungeman
06ca8ec87c
sk_sp for Ganesh.
...
Convert use of GrFragmentProcessor, GrGeometryProcessor, and
GrXPFactory to sk_sp. This clarifies ownership and should
reduce reference count churn by moving ownership.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041113004
Review-Url: https://codereview.chromium.org/2041113004
2016-06-09 08:01:03 -07:00
robertphillips
55fdcccf01
Remove GrRenderTarget from GrPipelineBuilder
...
This used to be "Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder"
but has been split into:
https://codereview.chromium.org/1993263002/ (Make GrAppliedClip friendless)
https://codereview.chromium.org/1997773002/ (Retract GrRenderTarget from GLProgramsTest)
https://codereview.chromium.org/1993403002/ (GrSWMaskHelper and GrSoftwarePathRenderer only need the textureProvider (not GrContext))
https://codereview.chromium.org/2004433002/ (Retract GrRenderTarget from GrTestTarget)
https://codereview.chromium.org/2015333002/ (Change parameters to GrPipelineBuilder's ctor)
https://codereview.chromium.org/2035823002/ (Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack)
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1988923002
Review-Url: https://codereview.chromium.org/1988923002
2016-06-06 06:16:21 -07:00
robertphillips
175dd9b5e3
Clean up test drawContext usage
...
The general idea is to provide access to SkGpuDevice's drawContext rather than its GrRenderTarget. That is usually what the testing framework actually wants.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930623003
Review-Url: https://codereview.chromium.org/1930623003
2016-04-28 14:32:04 -07:00
robertphillips
6c7e325236
Bring sk_sp to GrDrawContext
...
This is split out of: https://codereview.chromium.org/1914883002/ (Refactor drawContext/RenderTarget creation)
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1918003003
Review-Url: https://codereview.chromium.org/1918003003
2016-04-27 10:47:51 -07:00
robertphillips
5e3815b4d0
Rein in the use of SkDevice.h
...
Nothing interesting.
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1904673003
Review URL: https://codereview.chromium.org/1904673003
2016-04-20 05:29:51 -07:00
bsalomon
342bfc25de
Simplify GrDrawBatch uploads and token uage.
...
GrVertexBatch subclasses no longer need "initDraw".
Simplifies GrTestBatch
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1835283002
Review URL: https://codereview.chromium.org/1835283002
2016-04-01 06:06:20 -07:00
halcanary
9d524f22bf
Style bikeshed - remove extraneous whitespace
...
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002
Review URL: https://codereview.chromium.org/1842753002
2016-03-29 09:03:53 -07:00
robertphillips
391395dcfb
Begin weaning GrClipMaskManager off of GrDrawTarget (take 2)
...
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1754563003
Committed: https://skia.googlesource.com/skia/+/86c60758e9e4f9e203d7462cb22b2a245a0f51bd
Review URL: https://codereview.chromium.org/1754563003
2016-03-02 09:26:36 -08:00
robertphillips
8b8f36fc49
Revert of Begin weaning GrClipMaskManager off of GrDrawTarget (take 2) (patchset #7 id:120001 of https://codereview.chromium.org/1754563003/ )
...
Reason for revert:
fAuditTrail
Original issue's description:
> Begin weaning GrClipMaskManager off of GrDrawTarget (take 2)
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1754563003
>
> Committed: https://skia.googlesource.com/skia/+/86c60758e9e4f9e203d7462cb22b2a245a0f51bd
TBR=joshualitt@chromium.org ,bsalomon@google.com,joshualitt@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1754353002
2016-03-02 08:53:12 -08:00
robertphillips
86c60758e9
Begin weaning GrClipMaskManager off of GrDrawTarget (take 2)
...
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1754563003
Review URL: https://codereview.chromium.org/1754563003
2016-03-02 08:43:13 -08:00
joshualitt
f5883a6d75
Hide drawBatch on GrDrawTarget from test Methods
...
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574383002
Review URL: https://codereview.chromium.org/1574383002
2016-01-13 07:47:38 -08:00
joshualitt
144c3c8b7f
Make onPrepareDraws const
...
BUG=skia:
Review URL: https://codereview.chromium.org/1483103003
2015-11-30 12:30:13 -08:00
egdaniel
c4b72720e7
Don't create a GXPFactory when blend is SrcOver
...
BUG=skia:
Review URL: https://codereview.chromium.org/1471053002
2015-11-23 13:20:42 -08:00
robertphillips
504ce5dc77
Optionally pass rendertarget to getTestTarget
...
This shouldn't really make any difference but allocating and holding on to a GrRenderTarget for each test target generates image differences for Mali GPUs. This CL allows an existing render target to be used for the test target.
TBR=bsalomon@google.com
Review URL: https://codereview.chromium.org/1447113002
2015-11-16 11:02:05 -08:00
robertphillips
a13e202563
Move GrBatchFlushState from GrDrawTarget to GrDrawingManager
...
This CL:
moves the flushState
disables immediate mode (it was proving difficult to implement)
also moves the program unit test to the drawing manager
BUG=skia:4094
TBR=bsalomon@google.com
Review URL: https://codereview.chromium.org/1437843002
2015-11-11 12:01:09 -08:00
reed
1b55a963a2
Reland of add a ClassID function to GrBatch (patchset #1 id:1 of https://codereview.chromium.org/1353043002/ )
...
Reason for revert:
DEPS roll seems to have landed w/o this revert, so revert it again
Original issue's description:
> Revert of add a ClassID function to GrBatch (patchset #5 id:80001 of https://codereview.chromium.org/1352813003/ )
>
> Reason for revert:
> Speculative revert to unblock DEPS roll
>
> Original issue's description:
> > add a ClassID function to GrBatch
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9
> >
> > Committed: https://skia.googlesource.com/skia/+/eb44d53cf96a7eaf103a98d76079ce1f5495e343
>
> TBR=robertphillips@google.com ,bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/48e3a45ade15c52c0c1a10cb00907dd444897745
TBR=robertphillips@google.com ,bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1344373005
2015-09-17 20:16:13 -07:00
reed
48e3a45ade
Revert of add a ClassID function to GrBatch (patchset #5 id:80001 of https://codereview.chromium.org/1352813003/ )
...
Reason for revert:
Speculative revert to unblock DEPS roll
Original issue's description:
> add a ClassID function to GrBatch
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9
>
> Committed: https://skia.googlesource.com/skia/+/eb44d53cf96a7eaf103a98d76079ce1f5495e343
TBR=robertphillips@google.com ,bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1353043002
2015-09-17 17:35:11 -07:00
joshualitt
eb44d53cf9
add a ClassID function to GrBatch
...
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9
Review URL: https://codereview.chromium.org/1352813003
2015-09-17 11:50:57 -07:00
joshualitt
a7008403dc
Revert of add a ClassID function to GrBatch (patchset #5 id:80001 of https://codereview.chromium.org/1352813003/ )
...
Reason for revert:
breaks mac bot
Original issue's description:
> add a ClassID function to GrBatch
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9
TBR=robertphillips@google.com ,bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1345393003
2015-09-17 11:43:02 -07:00
joshualitt
4078d529e9
add a ClassID function to GrBatch
...
BUG=skia:
Review URL: https://codereview.chromium.org/1352813003
2015-09-17 11:21:17 -07:00
halcanary
2a24338c77
GM: replace boilerplate with macros
...
I have verified locally that nothing draws differently.
Motivation:
* SK_SIMPLE_GM makes it easier to write a GM.
* Reducing 1100 lines of code makes maintenance easier.
* Simple GMs are easy to convert to Fiddles.
Review URL: https://codereview.chromium.org/1333553002
2015-09-09 08:16:41 -07:00
halcanary
96fcdcc219
Style Change: NULL->nullptr
...
DOCS_PREVIEW= https://skia.org/?cl=1316233002
Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
halcanary
385fe4d4b6
Style Change: SkNEW->new; SkDELETE->delete
...
DOCS_PREVIEW= https://skia.org/?cl=1316123003
Review URL: https://codereview.chromium.org/1316123003
2015-08-26 13:07:49 -07:00
bsalomon
7539856c1b
Make GrVertexBatch objects hold their own draws during GrDrawTarget flush
...
NO_MERGE_BUILDS
Review URL: https://codereview.chromium.org/1286043004
2015-08-17 12:55:38 -07:00
bsalomon
abd30f54b7
Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches
...
Review URL: https://codereview.chromium.org/1293583002
2015-08-13 13:34:48 -07:00
joshualitt
2771b5617c
GrDrawVertices to batches
...
BUG=skia:
Review URL: https://codereview.chromium.org/1276333004
2015-08-07 12:46:26 -07:00
bsalomon
fb1141ae1d
Don't pass pipeline to GrBatch::generateGeometry()
...
R=joshualitt@google.com
Review URL: https://codereview.chromium.org/1275083002
2015-08-06 08:52:49 -07:00
joshualitt
dbe1e6f0c3
Give GrBatch a pointer to GrPipeline
...
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/1170a12839218f7a23c93487bf95fd83aae0201f
Review URL: https://codereview.chromium.org/1237283007
2015-07-16 08:12:45 -07:00
joshualitt
0df62e3d68
Revert of Give GrBatch a pointer to GrPipeline (patchset #1 id:1 of https://codereview.chromium.org/1237283007/ )
...
Reason for revert:
breaking nanobench
Original issue's description:
> Give GrBatch a pointer to GrPipeline
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1170a12839218f7a23c93487bf95fd83aae0201f
TBR=bsalomon@google.com ,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1239073002
2015-07-16 07:16:53 -07:00
joshualitt
1170a12839
Give GrBatch a pointer to GrPipeline
...
BUG=skia:
Review URL: https://codereview.chromium.org/1237283007
2015-07-16 07:06:50 -07:00
joshualitt
1c735488cb
Start to propagate constness of GrPipelineBuilder up the stack
...
BUG=skia:
Review URL: https://codereview.chromium.org/1229143007
2015-07-13 08:08:25 -07:00
joshualitt
b8c241ad09
Preliminary attempt to remove batch tracker
...
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/cbfe91d82500f4ae8c3ff7bd74b3021a4b89fd84
Review URL: https://codereview.chromium.org/1139723004
2015-05-19 08:23:30 -07:00
joshualitt
d3a560fa80
Revert of Preliminary attempt to remove batch tracker (patchset #3 id:40001 of https://codereview.chromium.org/1139723004/ )
...
Reason for revert:
breaking bots
Original issue's description:
> Preliminary attempt to remove batch tracker
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/cbfe91d82500f4ae8c3ff7bd74b3021a4b89fd84
TBR=robertphillips@google.com ,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1132323003
2015-05-19 07:15:28 -07:00
joshualitt
cbfe91d825
Preliminary attempt to remove batch tracker
...
BUG=skia:
Review URL: https://codereview.chromium.org/1139723004
2015-05-19 06:49:32 -07:00
joshualitt
88c23fc6e8
remove color from GrGeometryProcessor
...
BUG=skia:
Review URL: https://codereview.chromium.org/1140983002
2015-05-13 14:18:07 -07:00
bsalomon
e64eb570a5
Iterate over instanced draws in GrGpu rather than above GrBatchTarget
...
Review URL: https://codereview.chromium.org/1127273007
2015-05-07 11:35:55 -07:00
robertphillips
e40d397259
Isolate GrBufferAllocPools inside GrBatchTarget
...
This CL refactors the location of the GrBufferAllocPools so they reside entirely inside the GrBatchTarget. This is in preparation for making them use scratch resources.
Review URL: https://codereview.chromium.org/1131553002
2015-05-07 09:51:43 -07:00
bsalomon
cb8979d088
Move DrawInfo out from GrDrawTarget and rename to GrVertices.
...
Review URL: https://codereview.chromium.org/1124733004
2015-05-05 09:51:38 -07:00
bsalomon
b5238a7571
Start on simplifying generateGeometry() overrides
...
Committed: https://skia.googlesource.com/skia/+/f28381c6866cad92af8ebe5b9d2db074613b1963
Review URL: https://codereview.chromium.org/1122673002
2015-05-05 07:49:49 -07:00
bsalomon
8415abe44c
Revert of Start on simplifying generateGeometry() overrides (patchset #10 id:160001 of https://codereview.chromium.org/1122673002/ )
...
Reason for revert:
Breaking bots
Original issue's description:
> Start on simplifying generateGeometry() overrides
>
> Committed: https://skia.googlesource.com/skia/+/f28381c6866cad92af8ebe5b9d2db074613b1963
TBR=joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1124633003
2015-05-04 11:41:42 -07:00
bsalomon
f28381c686
Start on simplifying generateGeometry() overrides
...
Review URL: https://codereview.chromium.org/1122673002
2015-05-04 11:27:45 -07:00
bsalomon
ed0bcad9c8
Move instanced index buffer creation to flush time
...
Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26
Review URL: https://codereview.chromium.org/1116943004
2015-05-04 10:36:43 -07:00
bsalomon
d8ed1b64a6
Revert of Move instanced index buffer creation to flush time (patchset #6 id:100001 of https://codereview.chromium.org/1116943004/ )
...
Reason for revert:
messed up caching, recreating index buffers all the time.
Original issue's description:
> Move instanced index buffer creation to flush time
>
> Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26
TBR=joshualitt@google.com ,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1126613003
2015-05-04 10:09:24 -07:00
bsalomon
ab622c7b8c
Move instanced index buffer creation to flush time
...
Review URL: https://codereview.chromium.org/1116943004
2015-05-04 08:09:30 -07:00
joshualitt
99c7c07e0f
Move bounds to GrBatch
...
BUG=skia:
Review URL: https://codereview.chromium.org/1121463002
2015-05-01 13:43:30 -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
joshualitt
4b31de8328
handle null vertex or index buffers in batch
...
BUG=skia:
Review URL: https://codereview.chromium.org/979343002
2015-03-05 14:33:41 -08:00
joshualitt
44701df5ce
Move clip off of draw target
...
BUG=skia:
Review URL: https://codereview.chromium.org/947443003
2015-02-23 14:44:58 -08:00