Commit Graph

1045 Commits

Author SHA1 Message Date
egdaniel
54f0e9d784 Add Xfer Processor for GrCustomXfermodes
BUG=skia:

Review URL: https://codereview.chromium.org/852203003
2015-01-16 06:29:47 -08:00
egdaniel
0063a9b69a Move XferEffects class to GrCustomXfermode file
BUG=skia:

Review URL: https://codereview.chromium.org/844913003
2015-01-15 10:52:32 -08:00
bsalomon
5236cf480d Make uncached textures uncached from the get go.
This avoids the problem of a newly created uncached texture causing a purge of cached resources.

BUG=chromium:445885

Review URL: https://codereview.chromium.org/846303002
2015-01-14 10:42:08 -08:00
joshualitt
abb52a1a70 Move most of the transform logic into the primitive processors
BUG=skia:

Review URL: https://codereview.chromium.org/822423004
2015-01-13 15:02:10 -08:00
mtklein
6f07665768 Simplify SkInstCnt
This code requires fewer macros to use it (just one), has less code in macro
definitions, and has simpler synchronization code (just atomic ints, no SkOnce,
no SkMutex, etc.)

A minor downside, we lose indentation and reverse-ordering in the final report:
  Leaked SkRefCntBase: 7
     Leaked SkFontMgr: 1
     Leaked SkWeakRefCnt: 1
         Leaked SkTypeface: 1
     Leaked SkFlattenable: 3
         Leaked SkXfermode: 3
     Leaked SkPathRef: 1
     Leaked SkPixelRef: 1
         Leaked SkMallocPixelRef: 1
becomes
  Leaked SkXfermode: 3
  Leaked SkMallocPixelRef: 1
  Leaked SkPixelRef: 1
  Leaked SkPathRef: 1
  Leaked SkFlattenable: 3
  Leaked SkTypeface: 1
  Leaked SkWeakRefCnt: 1
  Leaked SkFontMgr: 1
  Leaked SkRefCntBase: 7

This is motivated by wanting to land https://codereview.chromium.org/806473006/,
which makes sure all static use of SkOnce are in global scope.  The current
implementation of SkInstCnt uses them in function scope, which isn't safe.
BUG=skia:

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/841263004
2015-01-13 08:22:44 -08:00
mtklein
72c9faab45 Fix up all the easy virtual ... SK_OVERRIDE cases.
This fixes every case where virtual and SK_OVERRIDE were on the same line,
which should be the bulk of cases.  We'll have to manually clean up the rest
over time unless I level up in regexes.

for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end

BUG=skia:

Review URL: https://codereview.chromium.org/806653007
2015-01-09 10:06:40 -08:00
bsalomon
7775c85611 Add a simpler key type for scratch resource keys.
BUG=skia:2889

Review URL: https://codereview.chromium.org/815833004
2014-12-30 12:50:52 -08:00
joshualitt
8059eb9f6e Move ViewMatrix off of drawstate
BUG=skia:

Review URL: https://codereview.chromium.org/815553003
2014-12-29 15:10:07 -08:00
joshualitt
40d4bd8daf removing coord change matrices
BUG=skia:

Review URL: https://codereview.chromium.org/821243003
2014-12-29 09:04:40 -08:00
bsalomon
b0ae649b7e Add device space skshader GM to test kDevice_GrCoordSet
Review URL: https://codereview.chromium.org/816003002
2014-12-29 07:05:27 -08:00
joshualitt
8fc6c2d82c This CL cleans up the last remaining users of localCoordChange on paint
NOTREECHECKS=True
BUG=skia:

Review URL: https://codereview.chromium.org/817853002
2014-12-22 15:27:05 -08:00
jvanverth
fa1e8a7cef Add sRGB texture support.
Review URL: https://codereview.chromium.org/791823003
2014-12-22 08:31:49 -08:00
egdaniel
080e673b10 Add XP to handle the cases where we disable color write.
BUG=skia:

Review URL: https://codereview.chromium.org/787233003
2014-12-22 07:35:52 -08:00
reed
f65f0b92f5 remove dead SK_SUPPORT_LEGACY_GRTYPES dead
BUG=skia:
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/823503002
2014-12-21 11:52:15 -08:00
joshualitt
290c09b8bb initial changes to add local matrix to primitive processor
BUG=skia:

Review URL: https://codereview.chromium.org/820523002
2014-12-19 13:45:20 -08:00
joshualitt
c2625821b3 Remove the low hanging fruit with coord change matrices
BUG=skia:

Review URL: https://codereview.chromium.org/793013003
2014-12-18 16:40:55 -08:00
egdaniel
9e4ecdc9f8 Add an InvariantOutput for the XPF.
The Invariant output holds information about final post blended color and other
general information like will it blend with dst. Having this new struct allowed
me to also remove some functions that were previously querying subsets of the
invariant output.

BUG=skia:

Review URL: https://codereview.chromium.org/814933002
2014-12-18 12:44:55 -08:00
bsalomon
309d4d5909 Remove GrCoordTransform::kPosition_CoordSet
Review URL: https://codereview.chromium.org/811373002
2014-12-18 10:17:45 -08:00
joshualitt
16b2789895 Change to create device coord coordset
BUG=skia:

Review URL: https://codereview.chromium.org/812063002
2014-12-18 07:47:17 -08:00
joshualitt
5531d51ce7 remove view matrix from context
BUG=skia:

Review URL: https://codereview.chromium.org/808703006
2014-12-17 15:50:11 -08:00
bsalomon
3e79124a69 Stop creating GrODS for stencilPath commands.
Review URL: https://codereview.chromium.org/816513003
2014-12-17 13:43:13 -08:00
egdaniel
8750924a14 Add Coverage Drawing XP
BUG=skia:

Review URL: https://codereview.chromium.org/808813002
2014-12-17 13:37:13 -08:00
joshualitt
9b98932ada This change will ultimately pull uniform color, and to a much lesser degree uniform coverage, into GPs. There are still some loose ends because drawstate has the ability to override the GP, but fixing these cleanly will have to wait until we have deferred geometry in place and can make attribute / uniform decisions on the fly.
BUG=skia:

Review URL: https://codereview.chromium.org/746423007
2014-12-15 14:16:27 -08:00
egdaniel
54160f3286 Add xp optimization for RGB coverage.
This is needed since clearColorStages is being changed to ignore color input. For RGB coverage,
we want to clear all the color stages (since we know the final output color), but we don't want
to ignore the color input since it is needed.

In future we will change this so the XP stores the color internally and thus can tell the GP to
simiply ignore color.

BUG=skia:

Review URL: https://codereview.chromium.org/791933006
2014-12-15 12:38:53 -08:00
tfarina
912ed6ebb8 Cleanup: Mark some overridden methods with 'SK_OVERRIDE'.
This fixes errors like this:

../../include/gpu/effects/GrPorterDuffXferProcessor.h:27:25: error:
'name' overrides a member function but is not marked 'override'
[-Werror,-Winconsistent-missing-override]

BUG=skia:3075
TEST=ninja -C out/Debug skia_lib
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/804813002
2014-12-14 15:20:11 -08:00
joshualitt
56995b5cc0 Remove GP from drawstate, revision of invariant output for GP
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/c6bc58eded89b0c0a36b8e20e193c200f297a0da

Review URL: https://codereview.chromium.org/791743003
2014-12-11 15:44:02 -08:00
junov
5756aff409 Adding a custom data field to GrGpuResource
Motivation: allow Blink to track pre-existing mailbox names for
textures that are recycled by the ganesh scratch texture pool.

BUG=440462
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/796163002
2014-12-11 14:59:32 -08:00
egdaniel
c230414861 Create xfer processor backend.
This includes:
-Having an actual XP stage at the end of the gl pipeline.
-All Blending work is handled by XP until actually setting GL blend states
-GLPrograms test to test XP

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4dffc940c430eec66d4707490eace19c9b3f7904

Review URL: https://codereview.chromium.org/764643004
2014-12-11 13:15:14 -08:00
junov
436293a330 Making GrGpuResource::release public for special case in Blink
BUG=440462

Review URL: https://codereview.chromium.org/739383006
2014-12-11 10:32:32 -08:00
joshualitt
294738268d Revert of Create xfer processor backend. (patchset #6 id:100001 of https://codereview.chromium.org/764643004/)
Reason for revert:
CL breaks windows DM

Original issue's description:
> Create xfer processor backend.
>
> This includes:
> -Having an actual XP stage at the end of the gl pipeline.
> -All Blending work is handled by XP until actually setting GL blend states
> -GLPrograms test to test XP
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4dffc940c430eec66d4707490eace19c9b3f7904

TBR=bsalomon@google.com,joshualitt@chromium.org,egdaniel@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/789343002
2014-12-10 15:03:01 -08:00
joshualitt
06f019fc0f Revert of Fix to set correct output type when blending when we've read dst (patchset #4 id:60001 of https://codereview.chromium.org/791143002/)
Reason for revert:
Breaks DM on windows

Original issue's description:
> Fix to set correct output type when blending when we've read dst
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/733fc2054044377e914559fa4f46db66ab7d9cea

TBR=bsalomon@google.com,egdaniel@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/795783002
2014-12-10 14:57:50 -08:00
joshualitt
8c0f615fdd Revert of Remove GP from drawstate, revision of invariant output for GP (patchset #9 id:160001 of https://codereview.chromium.org/791743003/)
Reason for revert:
breaks mac

Original issue's description:
> Remove GP from drawstate, revision of invariant output for GP
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c6bc58eded89b0c0a36b8e20e193c200f297a0da

TBR=bsalomon@google.com,egdaniel@google.com,joshualitt@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/794843002
2014-12-10 14:12:22 -08:00
joshualitt
c6bc58eded Remove GP from drawstate, revision of invariant output for GP
BUG=skia:

Review URL: https://codereview.chromium.org/791743003
2014-12-10 13:48:57 -08:00
egdaniel
733fc20540 Fix to set correct output type when blending when we've read dst
BUG=skia:

Review URL: https://codereview.chromium.org/791143002
2014-12-10 12:45:20 -08:00
egdaniel
4dffc940c4 Create xfer processor backend.
This includes:
-Having an actual XP stage at the end of the gl pipeline.
-All Blending work is handled by XP until actually setting GL blend states
-GLPrograms test to test XP

BUG=skia:

Review URL: https://codereview.chromium.org/764643004
2014-12-10 07:43:50 -08:00
joshualitt
2e3b3e369d This cl moves color and coverage off of drawstate. In an effort to keep this CL manageable, I have left the compute invariant input / output in a bit of a strange state(fixing this will be complicated).
In addition, NVPR makes this very complicated, and I haven't quite figured out a good way to handle it, so for now color and coverage DO live on optstate, but I will figure out some way to refactor that in future CLs.

BUG=skia:

Review URL: https://codereview.chromium.org/783763002
2014-12-09 13:31:15 -08:00
egdaniel
9513143efa Make all blending up to GrOptDrawState be handled by the xp/xp factory.
In this cl the blending information is extracted for the xp and stored in the ODS
which is then used as it currently is. In the follow up cl, an XP backend will be added
and at that point all blending work will take place inside XP's.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4

Review URL: https://codereview.chromium.org/759713002
2014-12-09 11:15:44 -08:00
bsalomon
9f876a37d8 Use threshold of 1 texture coord value per pixel w/ nearest neighbor.
Review URL: https://codereview.chromium.org/787873002
2014-12-09 10:51:07 -08:00
egdaniel
309e346744 Rename CustomCoordTextureEffect to GrBitmapTextGeoProc.
Also add in explicit set for LCD text in invariantOutput.

BUG=skia:

Review URL: https://codereview.chromium.org/786293002
2014-12-09 10:35:58 -08:00
bsalomon
422f56f6e5 Make addUniform take a precision
Review URL: https://codereview.chromium.org/788733003
2014-12-09 10:18:12 -08:00
bsalomon
c0bd6484f6 Move shader precision out of GrShaderVar
Review URL: https://codereview.chromium.org/777443003
2014-12-09 10:04:14 -08:00
bsalomon
17168df779 Use texture size to determine precision of texture coord varyings.
Review URL: https://codereview.chromium.org/778783002
2014-12-09 09:00:49 -08:00
egdaniel
8d95ffa497 Revert of Make all blending up to GrOptDrawState be handled by the xp/xp factory. (patchset #7 id:140001 of https://codereview.chromium.org/759713002/)
Reason for revert:
break many gm's

Original issue's description:
> Make all blending up to GrOptDrawState be handled by the xp/xp factory.
>
> In this cl the blending information is extracted for the xp and stored in the ODS
> which is then used as it currently is. In the follow up cl, an XP backend will be added
> and at that point all blending work will take place inside XP's.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4

TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/766653008
2014-12-08 13:26:43 -08:00
egdaniel
4ccf0b9405 Fix GrUnPreMulColor.
Current version incorrectly unpacked the resulting sk unpremulled color into rgba.

BUG=skia:3208

Review URL: https://codereview.chromium.org/787713002
2014-12-08 12:35:16 -08:00
egdaniel
7c66342a39 Make all blending up to GrOptDrawState be handled by the xp/xp factory.
In this cl the blending information is extracted for the xp and stored in the ODS
which is then used as it currently is. In the follow up cl, an XP backend will be added
and at that point all blending work will take place inside XP's.

BUG=skia:

Review URL: https://codereview.chromium.org/759713002
2014-12-08 11:20:40 -08:00
jvanverth
28f9c606e4 Add support for half float alpha textures.
This allows us to create distance field textures with better precision,
which may help text quality.

BUG=skia:3103

Review URL: https://codereview.chromium.org/762923003
2014-12-05 13:06:35 -08:00
egdaniel
915187b71d Check XpFactory equality in DrawState
BUG=skia:

Review URL: https://codereview.chromium.org/767873006
2014-12-05 12:58:28 -08:00
egdaniel
8bf2bd335f Move GrPorterDuffXferProcessor to include/gpu/effects.
BUG=skia:

Review URL: https://codereview.chromium.org/780263003
2014-12-05 12:14:27 -08:00
bsalomon
c92aadcf9a clean up default precision handling
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/766753006
2014-12-04 13:02:47 -08:00
joshualitt
eb2a676165 Remove backend factories
BUG=skia:

Review URL: https://codereview.chromium.org/778453002
2014-12-04 11:35:34 -08:00