Commit Graph

2736 Commits

Author SHA1 Message Date
Mike Klein
9ac801c12c ok, exit() child processes instead of _exit()
We want the atexit() hook to print deferred logs (crash dumps, etc.) only when the main, parent process exits.  Ending the child processes with _exit() instead of exit() avoids calling atexit() hooks, but also global destructors.  This is more complex than we need: we can just print before main() exits.  Only the main, parent process gets there.

This now runs each child process' global destructors, which makes trace.json "work": we get a trace of whichever child process finishes last.  It's a start.

Change-Id: I0cc2b12592f0f79e73a43a160b9fd06dba1fee25
Reviewed-on: https://skia-review.googlesource.com/26800
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-07-26 13:19:49 +00:00
Yuqian Li
df60e369a8 New analytic AA scan converter using delta (I call it DAA for now)
DAA is:

1. Much simpler than AAA.
   SkScan_AAAPath.cpp is about 1700 lines.
   SkScan_DAAPath.cpp is about 300 lines.
   The whole DAA CL is only about 800 lines.

2. Much faster than AAA for complicated paths.
   The speedup applies to GL backend (including ccpr)!
   Here's the frame time of 'SampleApp --slide Chart' on macbook pro:
     AAA-raster: 33ms
     DAA-raster: 21ms
     AAA-gl:     30ms
     DAA-gl:     20ms
     AAA-ccpr:   18ms
     DAA-ccpr:   12ms
   My linux desktop doesn't have SSE3 so the speedup is smaller
   (~25% for Chart). I believe that DAA is so fast that I can enable
   it for any paths (AAA is not enabled by default for complicated
   paths because it is slow; hence our older supersampling scan
   converter is used for stroking on Chart for AAA-xxx config.)

3. The SkCoverageDelta is suitable for threaded backend with
   out-of-order concurrent scan conversion as commented in the source
   code. Maybe we can also just send deltas to GPU.

4. Similar to most analytic path renderers, the quality is on the best
   ground-truth level, unless there are intersections within a pixel.
   The intersections look good to my eyes although theoretically that
   could be arbitrary far from the ground truth (see my AAA slides).

5. For simple paths, such as circle, triangle, rrect, etc., DAA is
   slower than AAA. But DAA is faster than our older supersampling
   scan converter in most cases. As those simple paths usually don't
   constitute the bottleneck of a picture (skp or svg), I strongly
   recommend use DAA.

6. DAA also heavily favors blitMask so it may work quite well with
   SkRasterPipeline and SkRasterPipelineBlitter.

Finally, please check https://skia-review.googlesource.com/c/22420/
which accelerate DAA by specializing blitCoverageDeltas for
SkARGB32_Blitter and SkARGB32_Black_Blitter. It brings a little(<5%)
speedup. But I couldn't figure out how to reduce the duplicate code
so I don't intend to land it.

Bug: skia:
Change-Id: I3b7ed6a727447922e645b1acb737a506e7c09a4c
Reviewed-on: https://skia-review.googlesource.com/19666
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-07-25 21:55:19 +00:00
Mike Reed
ede7bac43f use unique_ptr for codec factories
Will need guards for android (at least)

Bug: skia:
Change-Id: I2bb8e656997984489ef1f2e41cd3d301c4e7b947
Reviewed-on: https://skia-review.googlesource.com/26040
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-25 15:35:23 +00:00
Greg Daniel
02611d9afd Add Make[backend] calls for creating GrContexts
Docs-Preview: https://skia.org/?cl=26369
Bug: skia:
Change-Id: I460ee63e466f85b05918479f068a2e5ca2d70550
Reviewed-on: https://skia-review.googlesource.com/26369
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-25 14:33:03 +00:00
Mike Klein
b323a5ed1f sprinkle more tracing in GM, tests, and ok, and add TRACE_FUNC
Change-Id: I562d438bd65e9fd900cfc6831f971b4af25c8ae6
Reviewed-on: https://skia-review.googlesource.com/26361
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-07-24 20:02:07 +00:00
Mike Klein
3bf0042caa ok, basic tracing support
This doesn't do anything in the default process-per-task mode, because
those child tasks exit using _exit(), which doesn't trigger the event
tracer destructor to flush.

I don't remember exactly why I exit with _exit(), so I'm going to have
to follow up on that.  But written this way as I think I'm at least
initializing the tracing in the right place for each process for the
future.

In threaded (-j -1) and serial (-j 0) modes, everything seems to work
great.

I'm also thinking I might add a tracer like the SkDebugf tracer but
using ok_log(), which handles interlaced logging from concurrent tasks
better than vanilla SkDebugf.

Example:
    ninja -C out ok; and out/ok gm 8888 filter:search=fontmgr_bounds trace -j -1

Change-Id: Ia3cdad930ce65e6fd12fa74f3fb00894e35138d3
Reviewed-on: https://skia-review.googlesource.com/26350
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-07-24 19:22:05 +00:00
Mike Klein
1431e5ea69 ok, do not print time or memory use for skipped tests
Change-Id: I6feb4924ab67e1da08f923315ef6d3a580881b23
Reviewed-on: https://skia-review.googlesource.com/26340
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-07-24 17:37:56 +00:00
Brian Osman
bc8150feef Faster, thread-safe implementation
Bug: skia:
Change-Id: I401c5a9885c348aa424ab07b094acecddb209490
Reviewed-on: https://skia-review.googlesource.com/25860
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-24 17:13:05 +00:00
Mike Klein
fd51b2ba45 add suggested decode color type to colorspaceinfo
E.g.

~/skia (decode-as|✚1…) $ ninja -C out/ colorspaceinfo; and out/colorspaceinfo --input ~/Downloads/prophoto.png
    ninja: Entering directory `out/'
    [2/2] link colorspaceinfo
    SkCodec would naturally decode as colorType=RGBA_8888
    Color Profile Description:
    "Google/Skia/215028B4833C240E0583AFE600C80A79"
    ...

Change-Id: Id36efadaa84e9ffa5d67153e074be8a8426b6c42
Reviewed-on: https://skia-review.googlesource.com/26140
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-07-24 15:57:29 +00:00
Mike Reed
71f867c229 have resources return unique_ptr for stream
Bug: skia:
Change-Id: I649f4435d06704a5a581a481fe3c46b6ec677baf
Reviewed-on: https://skia-review.googlesource.com/26041
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-23 18:24:24 +00:00
Brian Osman
de6e5bf33f Tracing cleanup and bugfixes
TraceID was unused, remove it.

Simplify casting logic by using the same union helper as the macros.
This fixes a bug that was present in the bool handling - we were
treating the union value as a pointer, so we were dereferencing
random stack memory. Luckily it never crashes, we did get the wrong
values for bools.

Bug: skia:
Change-Id: I15d44756214f34c1f6479980d9a487ac7f3d8f6c
Reviewed-on: https://skia-review.googlesource.com/25801
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-21 20:57:27 +00:00
Ben Wagner
219f3622ba Add strikeout font metrics.
This also updates create_test_font so that it can be built, compiles,
and uses SkFontStyle instead of SkTypeface::Style.

BUG=b/63669723

Change-Id: I6eb0f851853f4721cf8e5052255b5b6750c3257f
Reviewed-on: https://skia-review.googlesource.com/24740
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-07-21 18:59:05 +00:00
Brian Osman
65e4c614f0 Add category support to JSON and SkDebugf tracing
Bug: skia:
Change-Id: I4d0bdb9d954e49b79ace0552d7b74b36a512c00d
Reviewed-on: https://skia-review.googlesource.com/25642
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-07-21 16:38:23 +00:00
Brian Osman
53136aa93f First stab at JSON event tracer
Not yet thread safe (so it forces threading off).
Builds JSON on the fly, so overhead is certainly bad.
Plan to fix all of that, but this at least "works".

There is now one tracing flag: 'trace'.
- 'debugf' installs the SkDebugf tracer.
- 'atrace' installs the Android ATrace tracer.
- Any other value is interpreted as a filename, and
  produces a JSON file for chrome://tracing.

All three modes work in DM, nanobench, and Viewer.

Bug: skia:
Change-Id: I3fbc22382b99418a508c670be2770195c0a1c364
Reviewed-on: https://skia-review.googlesource.com/24781
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-20 20:11:22 +00:00
Mike Klein
45c16fa82c convert over to 2d-mode
[√] convert all stages to use SkJumper_MemoryCtx / be 2d-compatible
 [√] convert compile to 2d also, remove 1d run/compile
 [√] convert all call sites
 [√] no diffs

Change-Id: I3b806eb8fe0c3ec043359616409f7cd1211a1e43
Reviewed-on: https://skia-review.googlesource.com/24263
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-07-20 19:50:32 +00:00
Brian Salomon
d17f6584df Remove GrBackendTextureDesc
Change-Id: I2b123d1782400e97ab2ce2f11e3e3d325a13e6c8
Reviewed-on: https://skia-review.googlesource.com/24748
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-20 00:21:18 +00:00
Greg Daniel
81e7bf8d6d Update gpu caps for valid sample counts.
Instead of query and maxSampleCount and using that to cap, we now have
each config store its supported values and when requested returns either
the next highest or equal supported value, or if non the max config supported.

Bug: skia:
Change-Id: I8802d44c13b3b1703ee54a7e69b82102d4b8dc2d
Reviewed-on: https://skia-review.googlesource.com/24302
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-19 19:13:25 +00:00
Brian Salomon
e5b399ee69 Remove GrLegacyMeshDrawOp and GrPipelineBuilder
Change-Id: Ib301a0e7d4b4c4f05417d28862017307949748c9
Reviewed-on: https://skia-review.googlesource.com/23584
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-19 18:16:05 +00:00
Brian Salomon
dcbb9d90db Add SkDebugf trace event handler.
Also adds more trace events to GPU backend.

Change-Id: Ifa5f0cd4b1fd582f0cc30d37d9e6414dc498c75d
Reviewed-on: https://skia-review.googlesource.com/24622
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-19 15:41:34 +00:00
Brian Salomon
fc26f3ca5f Remove GrAnalyticRectOp, the last legacy GrMeshDrawOp
Change-Id: I2b8d1f4c1585af4a157d269a526874bccc74ac81
Reviewed-on: https://skia-review.googlesource.com/23484
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-19 15:21:05 +00:00
Brian Salomon
44acb5b09b Revert "Revert "Make GrAtlasTextOp a non-legacy GrMeshDrawOp""
This reverts commit e3e9628ecf.

Adds blendmode_mask_* benchs to blacklist for Chromecast.
Otherwise a clean revert of the revert.

Bug: skia:
Change-Id: I9f64ae55804fa4aad97c1785834281039570c56c
Reviewed-on: https://skia-review.googlesource.com/24409
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-19 12:17:34 +00:00
Ravi Mistry
863ffef385 Do not move over webpage archives, they are needed for capturing SKPs
NoTry: true
Bug: skia:6850
Change-Id: I35ac2c10ae58561ab5424033d9bb5e14b75c526f
Reviewed-on: https://skia-review.googlesource.com/24327
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2017-07-18 17:29:14 +00:00
Mike Reed
086a427b0c guard references to SkColorTable
Bug: skia:6828
Change-Id: I0c8c78e70b118f51cb59dc45675e4ddcd4776108
Reviewed-on: https://skia-review.googlesource.com/24260
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-07-18 15:50:43 +00:00
Mike Reed
262b319dcd Index8 is dead, remove guarded code
Needs google3 to be updated before this can land.

Bug: skia:6828
Change-Id: I2c16be13c6937ffa48768cc24f9f980171c824d6
Reviewed-on: https://skia-review.googlesource.com/23940
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-17 20:37:28 +00:00
Brian Salomon
ce5ee602ed Add support for GL 565 and 4444 configs to test tools
Change-Id: I395e3387df44cf5370fef6ab73db73228225622f
Reviewed-on: https://skia-review.googlesource.com/23946
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-17 17:09:08 +00:00
Brian Salomon
e3e9628ecf Revert "Make GrAtlasTextOp a non-legacy GrMeshDrawOp"
This reverts commit 434a58ab5f.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Make GrAtlasTextOp a non-legacy GrMeshDrawOp
> 
> Change-Id: Ib9eaf149100b0ccecf1c18a755263f2579b8e6f6
> Reviewed-on: https://skia-review.googlesource.com/23482
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=jvanverth@google.com,bsalomon@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I7fd8503b4e0c297b2cfaf979545354aa58d1f989
Reviewed-on: https://skia-review.googlesource.com/23760
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-17 13:08:38 +00:00
Chris Dalton
1a325d25b9 Coverage counting path renderer
Initial implementation of a GPU path renderer that draws antialiased
paths by counting coverage in an offscreen buffer.

Initially disabled until it has had time to soak.

Bug: skia:
Change-Id: I003d8cfdf8dc62641581b5ea2dc4f0aa00108df6
Reviewed-on: https://skia-review.googlesource.com/21541
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-14 21:45:35 +00:00
Brian Salomon
434a58ab5f Make GrAtlasTextOp a non-legacy GrMeshDrawOp
Change-Id: Ib9eaf149100b0ccecf1c18a755263f2579b8e6f6
Reviewed-on: https://skia-review.googlesource.com/23482
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-14 20:24:15 +00:00
Greg Daniel
2811aa25f1 Add metal config to tools
Bug: skia:
Change-Id: I84dbd56c17d4856496af4491f340ec560e29c8a6
Reviewed-on: https://skia-review.googlesource.com/23200
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-14 13:57:34 +00:00
Brian Salomon
b295573c93 Move GrAALinearizingConvexPathRenderer off GrLegacyMeshDrawOp
Change-Id: I7d3c4053d4a833215371d77de683964cef317a5c
Reviewed-on: https://skia-review.googlesource.com/20460
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-13 21:52:14 +00:00
Greg Daniel
b76a72a659 Add support for creating a GrContext backed by Metal.
Also adds the support code to allow our TestContext to create a Metal
backend.

Bug: skia:
Change-Id: Ia850687019d79b897bb16e2c151f4f8526721ad9
Reviewed-on: https://skia-review.googlesource.com/22644
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-07-13 21:29:33 +00:00
Brian Salomon
ee3e0bacc8 Make DefaultPathOp a non-legacy GrMeshDrawOp
Change-Id: I9abc795e7c3aca7c129faee48190be749c6dc159
Reviewed-on: https://skia-review.googlesource.com/23101
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-13 21:09:14 +00:00
Brian Salomon
c2f425440a Make GrDrawVerticesOp a non-legacy GrMeshDrawOp
Change-Id: I0e1e6815ed41764115bc84a5967b3da3be4ce147
Reviewed-on: https://skia-review.googlesource.com/22722
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-13 20:39:53 +00:00
Brian Salomon
0088f94817 Make GrDrawAtlasOp a non-legacy GrMeshDrawOp
Change-Id: I4d517855dbe3ee6894d7d457e0fc4488f204300c
Reviewed-on: https://skia-review.googlesource.com/22542
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-13 18:39:23 +00:00
Brian Salomon
0596909b05 Make ShadowRRectOp a non-legacy GrMeshDrawOp
This also removes the ability to have an arbitrary GrPaint with this op and as a consequence simplifies the op and its GrGeometryProcessor.

Change-Id: I19cc1c6f73a47e8925fc826291aad42e9423164d
Reviewed-on: https://skia-review.googlesource.com/22380
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-07-13 15:46:32 +00:00
Mike Reed
580501382f Guard to remove kIndex_8_SkColorType
Bug: skia:6828
Change-Id: Ia942a36abb18213184f8d436555a658270d97d47
Reviewed-on: https://skia-review.googlesource.com/22721
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-07-13 10:44:42 +00:00
Brian Salomon
f0366326cc Make RegionOp a non-legacy GrMeshDrawOp
Also add a test factory function.

Change-Id: I612973312824a4ba358965ce8378160a980b86fa
Reviewed-on: https://skia-review.googlesource.com/22213
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-13 00:45:51 +00:00
Greg Daniel
6b7e0e2c74 Add arc support to gpu Obj c++ code
This is mainly for getting ready to start adding lots of metal backend code.
I've also update the "gpu tools" target to require ARC with involved updating
one IOS file in there.

Bug: skia:
Change-Id: Ied22e8fe7532445cc274efb529e3450654a6614b
Reviewed-on: https://skia-review.googlesource.com/22484
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-07-12 20:49:32 +00:00
Brian Osman
80a82dff82 On Windows, always re-create window for GL or Vulkan
On at least one machine, I've seen SetPixelFormat fail after Vulkan was
used to render to a window, preventing us from creating a GL context.
This is ham-fisted, but solves the problem.

Bug: skia:
Change-Id: I76d0cb26e181304846aa06109c1af768f8363a18
Reviewed-on: https://skia-review.googlesource.com/22740
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-07-12 20:31:38 +00:00
Brian Salomon
98222ac41d Revert "Revert "Make DashOp a non-legacy GrMeshDrawOp.""
This reverts commit beae8a9faa.

Clean revert of revert.

Change-Id: Ibb486bf3411ed347b560fc110a2cfbb0e0caa4f2
Reviewed-on: https://skia-review.googlesource.com/22730
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-12 20:25:46 +00:00
Mike Reed
304a07c6c9 remove references to kIndex_8_SkColorType from our tools/tests
Bug: skia:6828
Change-Id: Ib5049c28c11b7320bece20f5a0a886de8b2a4343
Reviewed-on: https://skia-review.googlesource.com/22728
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-12 20:25:44 +00:00
Brian Salomon
beae8a9faa Revert "Make DashOp a non-legacy GrMeshDrawOp."
This reverts commit ebb38256c6.

Reason for revert: Assertions on ANGLE bots

Original change's description:
> Make DashOp a non-legacy GrMeshDrawOp.
> 
> Change-Id: I84ee3c64a5af8889e9a122cbc08d70ed6b25fbab
> Reviewed-on: https://skia-review.googlesource.com/22210
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I886a0bd75221f05d737d8b27c6b3d8d6cce5573c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/22680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-12 16:59:04 +00:00
Mike Reed
6409f84fc3 Revert "Revert "Change image encode api to return sk_sp""
This reverts commit 64778d9f27.

Bug: skia:
Change-Id: I779515ff1e16a40c33890a4bac7a8a07171aadfe
Reviewed-on: https://skia-review.googlesource.com/22261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-12 15:44:35 +00:00
Brian Salomon
ebb38256c6 Make DashOp a non-legacy GrMeshDrawOp.
Change-Id: I84ee3c64a5af8889e9a122cbc08d70ed6b25fbab
Reviewed-on: https://skia-review.googlesource.com/22210
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-12 15:44:33 +00:00
Brian Salomon
febbd23eb7 Make SmallPathOp a non-legacy GrMeshDrawOp
Change-Id: I7fd0739d7bae9176e816772b3aed54528c4fa576
Reviewed-on: https://skia-review.googlesource.com/21865
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-07-12 13:13:35 +00:00
Mike Reed
64778d9f27 Revert "Change image encode api to return sk_sp"
This reverts commit dc799550e2.

Reason for revert: need to fix sites in Document_none

Original change's description:
> Change image encode api to return sk_sp
> 
> Bug: skia:
> Change-Id: I238289bc630be27795cb1384955dd6e887597c05
> Reviewed-on: https://skia-review.googlesource.com/22208
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=scroggo@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Id7f67027e5f1405a60fdbde29863cdf8daef0cb7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/22280
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-11 16:00:32 +00:00
Mike Reed
dc799550e2 Change image encode api to return sk_sp
Bug: skia:
Change-Id: I238289bc630be27795cb1384955dd6e887597c05
Reviewed-on: https://skia-review.googlesource.com/22208
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-07-11 15:43:21 +00:00
Brian Salomon
9530f7ebf5 Revert "Revert "Make TessellatingPathOp be a non-legacy GrMeshDrawOp""
This reverts commit 7343c197fc.

The initial revert was because the random test factory was choosing msaa as the aatype when the render target was not msaa, triggering and assert.

Bug: skia:
Change-Id: I1bfec86492b69af1101c65d249140af804c16684
Reviewed-on: https://skia-review.googlesource.com/22203
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-11 15:29:32 +00:00
Brian Salomon
815486c42f Convert NonAALatticeOp to non-legacy GrMeshDrawOp.
Also adds a test factory and fixes a bug in the lattice iter validator where it compared each div value against the start rather than the previous div.

Bug: skia:
Change-Id: I30e9ddfcbaab7829a2f646ad851f99d1e518ab4a
Reviewed-on: https://skia-review.googlesource.com/21871
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-11 13:39:21 +00:00
Hal Canary
a8565e502d ICC: SkICCGetColorProfileTag supports special cases
Special cases:
  - "sRGB"
  - "AdobeRGB"
  - "DCI-P3"
  - "Linear Transfer with sRGB Gamut"
  - "2.2 Transfer with sRGB Gamut"
  - "sRGB Transfer with DCI-P3 Gamut"
  - "Linear Transfer with DCI-P3 Gamut"
  - "sRGB Transfer with Rec-BT-2020 Gamut"
  - "Linear Transfer with Rec-BT-2020 Gamut"

tools/colorspaceinfo now prints out the Tag.

Also: constants representing gSRGB_TransferFn, g2Dot2_TransferFn, and
gLinear_TransferFn, gDCIP3_TransferFn.

BUG=skia:6720
Change-Id: I92a3f9db9d744d3ec366e4e59afd759ba043c235
Reviewed-on: https://skia-review.googlesource.com/20225
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-07-10 17:08:28 +00:00
Leon Scroggins III
da1893fe3a Fixes for get_images_from_skps
Do not consider kErrorInInput a failure. This probably means a corrupted
image stored in the SKP. This will fix the buildbot.

In addition, fix some other problems:
- Return an error when no SkPicture is created, rather than crashing.
- Use a different name for failed decodes, so they don't get overwritten
  by future failed or successful decodes.

Bug: skia:6840
Change-Id: Ia1d04e145a58495fb955d4b07dbb260cb7a35809
Reviewed-on: https://skia-review.googlesource.com/22031
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-07-10 16:37:45 +00:00
Ethan Nicholas
7343c197fc Revert "Make TessellatingPathOp be a non-legacy GrMeshDrawOp"
This reverts commit 086ce11386.

Reason for revert: Looks to be upsetting the bots (grglgpu.cpp(2766): fatal error: "assert(!useHWAA || rt->isStencilBufferMultisampled())")

Original change's description:
> Make TessellatingPathOp be a non-legacy GrMeshDrawOp
> 
> Change-Id: Ic92fdca7bdca91eab3a87e4fea3972ffdcfd5b12
> Reviewed-on: https://skia-review.googlesource.com/21867
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=jvanverth@google.com,bsalomon@google.com

Change-Id: Ibb0c8f8f4e2dea018b54686ab780535e2f69539a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/22060
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-07-10 15:47:16 +00:00
Brian Salomon
086ce11386 Make TessellatingPathOp be a non-legacy GrMeshDrawOp
Change-Id: Ic92fdca7bdca91eab3a87e4fea3972ffdcfd5b12
Reviewed-on: https://skia-review.googlesource.com/21867
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-10 13:24:35 +00:00
Brian Salomon
8fe24272fa Add mock config to tools and run through gms and benchs without crashing.
Change-Id: I7e2474129ef2b15899ad2baeb8d18f39d05da98c
Reviewed-on: https://skia-review.googlesource.com/21820
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-07 20:47:38 +00:00
Brian Salomon
a531f25028 Make AAHairlineOp a non-legacy GrDrawMeshOp
Change-Id: I814c696e38c685a294f9696984612807bc94b43d
Reviewed-on: https://skia-review.googlesource.com/21862
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-07 20:47:36 +00:00
Brian Salomon
cfe910dc79 Revert "Revert "Make mock GrContext unit testable.""
This reverts commit c867a89b01.

Reason for revert: test

Original change's description:
> Revert "Make mock GrContext unit testable."
> 
> This reverts commit 993e7e2521.
> 
> Reason for revert: Seeing if this fixes the NexusPlayer bots
> 
> Original change's description:
> > Make mock GrContext unit testable.
> > 
> > Bug: skia:
> > Change-Id: I959122f1f2c390832ab1033bcdbdd2ca6cfc0419
> > Reviewed-on: https://skia-review.googlesource.com/20699
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: I25ed9329962d930fe38108f779ff7083e0e4847e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/21731
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I62c579e087db1ff9891cf6c41b3eb40f47561887
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/21733
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-06 21:59:18 +00:00
Brian Salomon
c867a89b01 Revert "Make mock GrContext unit testable."
This reverts commit 993e7e2521.

Reason for revert: Seeing if this fixes the NexusPlayer bots

Original change's description:
> Make mock GrContext unit testable.
> 
> Bug: skia:
> Change-Id: I959122f1f2c390832ab1033bcdbdd2ca6cfc0419
> Reviewed-on: https://skia-review.googlesource.com/20699
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I25ed9329962d930fe38108f779ff7083e0e4847e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/21731
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-06 18:21:37 +00:00
Brian Salomon
993e7e2521 Make mock GrContext unit testable.
Bug: skia:
Change-Id: I959122f1f2c390832ab1033bcdbdd2ca6cfc0419
Reviewed-on: https://skia-review.googlesource.com/20699
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-06 15:25:35 +00:00
Cary Clark
0933f33996 output flags once
When asking for help on more than one item,
e.g. foo -h me -h oh -h my just print Flags:
once.

TBR=scroggo@google.com

Change-Id: I67080c7390e6bacf4c36096304dd959229fdd07b
Reviewed-on: https://skia-review.googlesource.com/21660
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-07-06 12:56:27 +00:00
Mike Reed
412cda7379 add srgb gamma colorfilters
... faster and more accurate than using SkTableColorFilter

todo: update blink after this lands

Bug:737981
Change-Id: I55b5c60dd23b9d2cbe9d60f83c74be1a8f3dcfcf
Reviewed-on: https://skia-review.googlesource.com/21368
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-07-05 20:16:27 +00:00
Hal Canary
466c7d6597 header cleanup
Change-Id: I3f7667a1357194ae2bdd341ad9d46eb93920f404
Reviewed-on: https://skia-review.googlesource.com/21374
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-07-05 15:18:52 +00:00
Eric Boren
101f3f304d Valgrind suppressions for new Debian 9 GPU bot
Bug: skia:
Change-Id: I813fe71812ec65778b48b8b13f238b8df7b8f8cd
Reviewed-on: https://skia-review.googlesource.com/21360
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-06-30 14:53:38 +00:00
Mike Reed
9c1d780228 remove filterSpan from SkColorFilter
Bug: skia:
Change-Id: Ie8a31ea8131c08d251a825622484342e3e174474
Reviewed-on: https://skia-review.googlesource.com/21207
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-06-29 16:09:37 +00:00
Eric Boren
89cd35795f Fix recipes/tests for new Debian bots
Bug: skia:6612
Change-Id: I2920bb7b1aa3ebb021223ed6345f13f1f9c8bc24
Reviewed-on: https://skia-review.googlesource.com/21141
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2017-06-28 18:46:16 +00:00
Mike Klein
c2d207603e clean up low-hanging swap_rb
There are two remaining swap_rb uses that both look non-trivial to
replace:
   - sampling out of index8 when the color table is bgra
   - table transforms on bgra inputs in SkColorSpaceXform

I don't think it's a big deal to just leave swap_rb around,
just a little sad.

Change-Id: I3d30200cf867cbf37d6f86572b1574d3e22e3490
Reviewed-on: https://skia-review.googlesource.com/21040
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-28 17:41:56 +00:00
Ben Wagner
78f1f5a5e7 Add rest of paint flags to debug canvas.
Allows the Skia debugger to list all the flags on the paint.

Change-Id: I9068965a676809a3e23b066d804506d58910db05
Reviewed-on: https://skia-review.googlesource.com/20689
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-06-23 19:02:12 +00:00
Brian Osman
2ac96dc82c Hack to fix MSAA GL -> Vk transition on Windows Viewer
Bug: skia:
Change-Id: I49417789ab43734a1cbb4010281482970579971d
Reviewed-on: https://skia-review.googlesource.com/20505
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-23 17:56:31 +00:00
Brian Salomon
91a3e52552 Move mock gpu and caps, add Gr prefix, and create via GrContext::Create
Change-Id: I02427839f78372e337ed717b071c6baaa8ba4450
Reviewed-on: https://skia-review.googlesource.com/20622
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-23 15:42:15 +00:00
Brian Salomon
8c86588d1b Add correctness testing for ANGLE D3D11 ES3
Bug=skia:6776

Change-Id: I51c851d6b80992039c87ae43037721db52958f0c
Reviewed-on: https://skia-review.googlesource.com/20503
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-23 14:05:20 +00:00
Jim Van Verth
2e5eaf022e Revert "Revert "Clean up onTransferPixels""
Bug: skia:5126
Change-Id: Ia1eaef56cca266ad4c413e711e63646e913222be
Reviewed-on: https://skia-review.googlesource.com/20445
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-06-22 13:14:01 +00:00
Jim Van Verth
ce57552e11 Revert "Clean up onTransferPixels"
This reverts commit f7037d003c.

Reason for revert: Issues on test bots.

Original change's description:
> Clean up onTransferPixels
> 
> Bug: skia:5126
> Change-Id: I323c50e7854744302007b4ae7bd25e5742c14cbc
> Reviewed-on: https://skia-review.googlesource.com/19055
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com

Change-Id: I923fda4d5cd8c2896fb347f9b2695b7f83d9137b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:5126
Reviewed-on: https://skia-review.googlesource.com/20444
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-06-21 15:50:51 +00:00
Jim Van Verth
f7037d003c Clean up onTransferPixels
Bug: skia:5126
Change-Id: I323c50e7854744302007b4ae7bd25e5742c14cbc
Reviewed-on: https://skia-review.googlesource.com/19055
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-21 15:28:50 +00:00
Mike Klein
99609bb7ab add memory via to ok
Just like the time via, but instead of printing how long the thing took
to run it prints how much memory was used by the process at peak.

When ok runs in (default) process-per-task mode, this is quite handy.

Change-Id: I331d446e39363a44c545278d7153fa7548e2add0
Reviewed-on: https://skia-review.googlesource.com/20261
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-19 19:32:52 +00:00
Greg Daniel
a5cb781c17 Revert "Revert "Add API for flushing surfaces with gpu semaphores""
This reverts commit 7292231905.

This change relands the original plus the follow on change:
https://skia-review.googlesource.com/20059.

Additionally it adds a blacklist for the mac intel bots which
don't see to respect the added fences on the GPU.

Original change's description:
> Revert "Add API for flushing surfaces with gpu semaphores"
> 
> This reverts commit 66366c6978.
> 
> Reason for revert: Failing test on mac bots
> 
> Original change's description:
> > Add API for flushing surfaces with gpu semaphores
> > 
> > BUG=skia:
> > 
> > Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1
> > Reviewed-on: https://skia-review.googlesource.com/11488
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Forrest Reiling <freiling@google.com>
> 
> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com
> 
> Change-Id: I75633a2732d2d48b1926f9ad818a9f1a9196d211
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/20063
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com

Change-Id: I4dc6c0e1deb0398eeb165a34f0a26af7a58259f1
Reviewed-on: https://skia-review.googlesource.com/20141
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-16 14:22:34 +00:00
Greg Daniel
7292231905 Revert "Add API for flushing surfaces with gpu semaphores"
This reverts commit 66366c6978.

Reason for revert: Failing test on mac bots

Original change's description:
> Add API for flushing surfaces with gpu semaphores
> 
> BUG=skia:
> 
> Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1
> Reviewed-on: https://skia-review.googlesource.com/11488
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Forrest Reiling <freiling@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com

Change-Id: I75633a2732d2d48b1926f9ad818a9f1a9196d211
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/20063
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-15 21:55:03 +00:00
Brian Salomon
10978a6ead Migrate AAConvexPathOp off of GrLegacyMeshDrawOp
Change-Id: If6df4292ec5c78a7f2fdde0a4540f7327e69e294
Reviewed-on: https://skia-review.googlesource.com/20058
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-15 21:04:31 +00:00
Greg Daniel
66366c6978 Add API for flushing surfaces with gpu semaphores
BUG=skia:

Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1
Reviewed-on: https://skia-review.googlesource.com/11488
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Forrest Reiling <freiling@google.com>
2017-06-15 19:49:18 +00:00
Robert Phillips
fbcef6eb8a Clean up GrResourceProvider usage
The only substantive changes are the removal of GrProxy instantiation in:

SkGpuBlurUtils::GaussianBlur
GrSimpleTextureEffect::Make*

Change-Id: I10970609693bd6ff5b3a3c21b41d82642bb277bc
Reviewed-on: https://skia-review.googlesource.com/19965
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-15 17:18:19 +00:00
Brian Salomon
baaf439eb5 Revert "Revert "Converts remaining rect ops from GrLegacyMeshDrawOp to GrMeshDrawOp subclasses.""
This reverts commit a0485d9452.

Bug: skia:
Change-Id: If50b2d1af285a6c3c943373bb7258b56e1af28d6
Reviewed-on: https://skia-review.googlesource.com/19961
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-15 16:49:40 +00:00
Joe Gregorio
4f12f1e209 [fiddle] Clear the canvas to white before calling draw().
Bug: skia:
Change-Id: I17f1d47c3d04f09ca613e2d3f98d4c73e4bad02c
Reviewed-on: https://skia-review.googlesource.com/19847
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2017-06-15 13:20:29 +00:00
Brian Salomon
a0485d9452 Revert "Converts remaining rect ops from GrLegacyMeshDrawOp to GrMeshDrawOp subclasses."
This reverts commit 1ec03f33cf.

Revert "Fix logic reversal in NonAAFillRectOp test factory"

This reverts commit 89c1c2552e.

Reason: Unexpected GM changes.

Bug: skia:
Change-Id: I9edf5f0e4a54b5cad86bd438a505aaaef38563de
Reviewed-on: https://skia-review.googlesource.com/19960
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-14 23:32:05 +00:00
Brian Salomon
1ec03f33cf Converts remaining rect ops from GrLegacyMeshDrawOp to GrMeshDrawOp subclasses.
Consolidates op factory functions to a rewritten GrRectOpFactory.

Removes GrRenderTargetContext::drawNonAAFilledRect() in favor of creating and adding ops directly by the callers.

Change-Id: I57e5fc739bf4e92b4a4710c739e6d22cce82a479
Reviewed-on: https://skia-review.googlesource.com/17711
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-06-14 20:26:51 +00:00
Mike Reed
d20b5c489b use #ifdef instead of #if for SK_VULKAN
Try to fix android roll

Bug: skia:
Change-Id: Iae32027b299d8a975d3caf70f0f8910541ca972d
Reviewed-on: https://skia-review.googlesource.com/19800
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-06-14 10:23:07 +00:00
Robert Phillips
fcd5fddb02 Revert "Revert "Update skia to use ifdefs for Vulkan code instead of dummy header""
This reverts commit fad9e3f541.

Reason for revert: Can't find the error message anymore (?!?) Let's try again shall we

Original change's description:
> Revert "Update skia to use ifdefs for Vulkan code instead of dummy header"
> 
> This reverts commit c0f8e426c5.
> 
> Reason for revert: Experiment to see if this will unblock the Android roll
> 
> Original change's description:
> > Update skia to use ifdefs for Vulkan code instead of dummy header
> > 
> > Bug: skia:6721
> > Change-Id: I80a4c9f2acc09c174497f625c50ed12a8bb76505
> > Reviewed-on: https://skia-review.googlesource.com/19547
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com
> 
> Change-Id: Ib51c1672570f2071a17b6fbde692a5174b0358ce
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:6721
> Reviewed-on: https://skia-review.googlesource.com/19724
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Iecef7ddcfe31d82938336120a4193525ac6693be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6721
Reviewed-on: https://skia-review.googlesource.com/19782
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-14 01:43:38 +00:00
Robert Phillips
fad9e3f541 Revert "Update skia to use ifdefs for Vulkan code instead of dummy header"
This reverts commit c0f8e426c5.

Reason for revert: Experiment to see if this will unblock the Android roll

Original change's description:
> Update skia to use ifdefs for Vulkan code instead of dummy header
> 
> Bug: skia:6721
> Change-Id: I80a4c9f2acc09c174497f625c50ed12a8bb76505
> Reviewed-on: https://skia-review.googlesource.com/19547
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com

Change-Id: Ib51c1672570f2071a17b6fbde692a5174b0358ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6721
Reviewed-on: https://skia-review.googlesource.com/19724
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-13 22:16:19 +00:00
Greg Daniel
c0f8e426c5 Update skia to use ifdefs for Vulkan code instead of dummy header
Bug: skia:6721
Change-Id: I80a4c9f2acc09c174497f625c50ed12a8bb76505
Reviewed-on: https://skia-review.googlesource.com/19547
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-13 18:50:03 +00:00
Robert Phillips
646e4293f0 Retract GrTexture*.h & GrRenderTarget*.h from other headers
This does push some additional work (& includes) into the .cpp files.

Change-Id: I27c847e371802270d13594dcc22aae44039990bb
Reviewed-on: https://skia-review.googlesource.com/19660
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-13 17:21:41 +00:00
Mike Klein
a611be86f0 ok: add 8888 and rp dsts
8888 is just a friendly alias for sw.
rp is the same, but forcing SkRasterPipelineBlitter.

Change-Id: Ie7a809643f21f49d6c696d4a4eac0e1deee7eaf8
Reviewed-on: https://skia-review.googlesource.com/19620
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-13 14:25:41 +00:00
Robert Phillips
c4f0a8245c Move Flags from GrRenderTarget to GrTypesPriv.h & rename
The motivation for this is to prevent GrRenderTarget.h appearing in GrRenderTargetProxy.h

Change-Id: I4ef126972c0780cbacb35fa2aa6290777c66eddf
Reviewed-on: https://skia-review.googlesource.com/19521
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-13 13:12:17 +00:00
Mike Klein
03a787968a append(from_srgb) -> append_from_srgb(kUnpremul)
No behavior change here, just using the safe, non-asserting API...

Change-Id: I982079a44dad311850b383d1ef44c6f0f4d3edea
Reviewed-on: https://skia-review.googlesource.com/19486
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-06-12 15:23:41 +00:00
Mike Klein
fc3341632f port encode_bitmap_for_png() to SkRasterPipeline
This logically shouldn't change anything, but it does a bit:
   - no diffs in 565
   - sRGB and 8888 show minor diffs, only when unpremul is non-trivial
   - f16 shows minor diffs all over, and major ones in shallow gradients

I think the shallow gradient diffs make sense. F16's high-precision is
being quantized down to a much narrower range (something like 10-40
values), so where the lines are drawn between sRGB bits will come down
to all sorts of things, especially rounding.

Change-Id: I156b7c613b73d6d6089221e61d0c529798ac1f9f
Reviewed-on: https://skia-review.googlesource.com/19449
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-12 14:41:15 +00:00
Matt Sarett
ee7c8202eb Remove debug checks for unsupported ICC profiles
This was never fully integrated with our automated image testing.
I feel it has limited usefulness in terms of catching bugs.

Bug: skia:
Change-Id: Iecd0a4e9b664ab0b351debde45ada864379de7ec
Reviewed-on: https://skia-review.googlesource.com/19267
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-06-09 15:26:48 +00:00
Mike Klein
39afa1226f fix f16 -> sRGB in encode_bitmap_for_png()
The existing logic looks wrong to me:
   - clamp premul to [0,1]
   - unpremul, ignoring zero alpha

It seems like we should do:
   - unpremul, avoiding any divide by zero
   - clamp unpremul to [0,1]

Am I misunderstanding this or has this just always been wrong?

Change-Id: I9636b9566c746bc05371e1e660f4e59dde16827b
Reviewed-on: https://skia-review.googlesource.com/19264
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-09 14:18:12 +00:00
Robert Phillips
fee2b4ed0f Create a new HDC for each ANGLE context
Bug: skia:6711
Change-Id: I9c4720a8dbad4c6b18efe73e0e61afbdc19627bc
Reviewed-on: https://skia-review.googlesource.com/19090
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-09 00:39:00 +00:00
Robert Phillips
cdabbcc3b5 Store context type (rather than backend type) in ContextInfo
Change-Id: I7dbfb735f1f094fa0a025b84f69e06a3533f2815
Reviewed-on: https://skia-review.googlesource.com/19101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-08 20:29:44 +00:00
Brian Osman
b53f48cfec Touch input support for Windows
Had to add some logic to avoid touch and mouse cross-talk, because
(at least on my laptop), the touch screen generates both kinds of
events.

This seems really useful [1] for the many [2] Skia developers with
touch-enabled Windows devices.

----------
1: No, not really.
2: N = 1?

Bug: skia:
Change-Id: Ib888bf4198f2cc0a29a31581ec4b64d3d9008c33
Reviewed-on: https://skia-review.googlesource.com/18920
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-07 14:27:09 +00:00
Florin Malita
82d8087b1e Show SkPaint/blendMode in debugger
Change-Id: I4347ab1bf3e26ca3b8c18dead85ec3646d3694bd
Reviewed-on: https://skia-review.googlesource.com/18921
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-06-07 11:53:08 +00:00
Mike Klein
31550dbc98 Revert "Revert "Workaround Adreno driver issue with stencil clears.""
This reverts commit 8b06ed7c9f.

Reason for revert: try again.

Original change's description:
> Revert "Workaround Adreno driver issue with stencil clears."
> 
> This reverts commit 4e8c581f2a.
> 
> Reason for revert: breaks Google3 roll
> 
> Original change's description:
> > Workaround Adreno driver issue with stencil clears.
> > 
> > This also removes the "debug wire rect" which was not used and not implemented for Vulkan.
> > 
> > Also some declared but not implemented methods are removed from GrGLGpu.
> > 
> > Bug: skia:5587
> > 
> > Change-Id: I750051e90e6cfbfad6a6fe20792226182f698bcf
> > Reviewed-on: https://skia-review.googlesource.com/18639
> > Reviewed-by: Chris Dalton <csmartdalton@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,csmartdalton@google.com
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:5587
> 
> Change-Id: I65aa16b3f8c70cdef56ff16e16304ba09604c475
> Reviewed-on: https://skia-review.googlesource.com/18924
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,bsalomon@google.com,reviews@skia.org,csmartdalton@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:5587

Change-Id: Ice49027bda1c1ff7e0362d0680341ac862159850
Reviewed-on: https://skia-review.googlesource.com/18928
Reviewed-by: Mike Klein <mtklein@google.com>
2017-06-06 23:32:28 +00:00
Mike Klein
8b06ed7c9f Revert "Workaround Adreno driver issue with stencil clears."
This reverts commit 4e8c581f2a.

Reason for revert: breaks Google3 roll

Original change's description:
> Workaround Adreno driver issue with stencil clears.
> 
> This also removes the "debug wire rect" which was not used and not implemented for Vulkan.
> 
> Also some declared but not implemented methods are removed from GrGLGpu.
> 
> Bug: skia:5587
> 
> Change-Id: I750051e90e6cfbfad6a6fe20792226182f698bcf
> Reviewed-on: https://skia-review.googlesource.com/18639
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:5587

Change-Id: I65aa16b3f8c70cdef56ff16e16304ba09604c475
Reviewed-on: https://skia-review.googlesource.com/18924
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2017-06-06 22:12:48 +00:00
Brian Salomon
4e8c581f2a Workaround Adreno driver issue with stencil clears.
This also removes the "debug wire rect" which was not used and not implemented for Vulkan.

Also some declared but not implemented methods are removed from GrGLGpu.

Bug: skia:5587

Change-Id: I750051e90e6cfbfad6a6fe20792226182f698bcf
Reviewed-on: https://skia-review.googlesource.com/18639
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-06 19:36:31 +00:00
Robert Phillips
67d52cf0d8 sk_sp-ify GrResourceProvider some more
I believe this addresses the concerns of this particular bug (although more remains to be done)

Bug: skia:5327
Change-Id: Ie82f08f87b3cf3d7986fe4eeb16a5d2553173913
Reviewed-on: https://skia-review.googlesource.com/18599
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-05 18:07:05 +00:00
Robert Phillips
bab680d891 Revert "Destroy ANGLE displays in destroyGLContext"
This reverts commit c1359888c0.

Reason for revert: failing botbots

Original change's description:
> Destroy ANGLE displays in destroyGLContext
> 
> Bug: skia:6711
> Change-Id: I770bb390d7b4e156116411bc6ce796375a6ddf21
> Reviewed-on: https://skia-review.googlesource.com/18588
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6711

Change-Id: I2087153f1601dfade8442f0918ffd71e0cacff08
Reviewed-on: https://skia-review.googlesource.com/18621
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-05 17:39:32 +00:00
Robert Phillips
c1359888c0 Destroy ANGLE displays in destroyGLContext
Bug: skia:6711
Change-Id: I770bb390d7b4e156116411bc6ce796375a6ddf21
Reviewed-on: https://skia-review.googlesource.com/18588
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-05 16:39:05 +00:00
Brian Osman
42bb6acf56 Simplify some Viewer code, and fix a few bugs
The content rect was always identical to the window rect,
so most of the related code did nothing. The translation
limit code is always useful (to avoid dragging the slide
way off-screen with the mouse), so always include it.
The auto-scaling to fit the screen is also still useful,
but just base it on the window rect.

The zoom code has four state variables, only used two of
them, and one was a trivially derived computation. Fold
most of that work into computeMatrix. (The translation
was always zero -- we never changed the zoom center.)

Include fDefaultMatrix in the matrix from computeMatrix,
rather than needing to apply it specially to the canvas.

Don't apply the inverse default matrix to touch or mouse
points. The absolute positions of those touch points is
not important, but because that matrix includes scale
(and sometimes very large or very small scale), it just
had the effect of greatly amplifying or damping the drag
speed. Without it, the slide always pans at the speed of
the touch/mouse drag -- which seems more desirable.

The use of the inverse default matrix was a clever trick,
but it caused the translation (applied to the global mtx)
to be scaled, so the slide was always pinned incorrectly.
Instead, supply the unmodified window rect and the default
matrix, so the trans limit code can do the obvious correct
thing: xform the slide bounds completely, then limit the
translation that will be applied after that. Slides are
now correctly pinned to screen edge regardless of how
much zoom is present in the default matrix.

Note: There are still several bugs related to all of this
code, but given the web of xform state, it's hard to
unravel. The touch gesture still doesn't know about
viewer's zoom, so that's ignored when doing the pinning.
Beyond that, it doesn't even know about window resize -
it only configures the translation limit when setting up
a slide. I had a fix for all of this (doing the
translation limiting in computeMatrix), but then the touch
gesture doesn't know about it, and can accumulate drag
motion that needs to be un-dragged to get back on-screen,
even though the slide is never really translated that far.

SkTouchGesture is in include. No one uses it except viewer:
TBR=bsalomon@google.com

Bug: skia:
Change-Id: I460cc07c3de6d36e63826f57d359faf1facf5ab3
Reviewed-on: https://skia-review.googlesource.com/18524
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-05 15:21:43 +00:00
Leon Scroggins III
4b0b00e0c3 Support passing single SKP to get_images_from_skps
In addition to allowing the user to supply a directory, allow them
to supply a file. Simplifies my typical use case of testing a single
file.

Change-Id: I4f268cfb33fc70ff3121135941693023b6840cd3
Reviewed-on: https://skia-review.googlesource.com/18586
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-05 14:51:33 +00:00
Cary Clark
219b4e81db add nonsquare scale to pathops sorter tool
Change-Id: I1b45992cc6eb18d0f79edcbd97d00d73c66c349a
Reviewed-on: https://skia-review.googlesource.com/18035
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-06-02 19:30:07 +00:00
Stan Iliev
7e910df7f1 Implement an SkImage backed by a Android hardware buffer
Create a new SkImage public API to make an image from an Android
hardware buffer. Implementation is using a SkImageGenerator
derived class GrAndroidBufferImageGenerator.
A new EGLImage texture is created, which is then wrapped with
GrTextureProxy.

Bug: skia:
Change-Id: I610a4c5a58198686ce7c03e9a0adad3f9d2342e0
Reviewed-on: https://skia-review.googlesource.com/17789
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2017-06-02 14:51:24 +00:00
Joe Gregorio
97b10ac484 [fiddle] Report GL driver info.
Bug: skia:
Change-Id: I5338d6abef062f7da420e8cddafa082bedcfff25
Reviewed-on: https://skia-review.googlesource.com/18310
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2017-06-01 18:03:45 +00:00
Mike Klein
c6912f712f make SkColorFilter::onAppendStages() pure
Change-Id: I2851e19648fb0478db9b940e86c6ddb2020000b3
Reviewed-on: https://skia-review.googlesource.com/18264
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-06-01 14:55:10 +00:00
Mike Reed
25f3805efa slant colorfilter away from filterSpan4f
rename to make it easy to delete any impl that also had onAppendStages...
i.e. rename to make it clear that it is just an impl trick for rasterpipeline.

Bug: skia:
Change-Id: If3c3b2811eff12d399cdf7a77552c01e72c06996
Reviewed-on: https://skia-review.googlesource.com/18234
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-05-31 19:54:05 +00:00
Joe Gregorio
a8fabd3f28 Fiddle can use EGL if available.
To test this turn on egl, e.g. --args='skia_use_egl=true', and run by altering the
library path to point to the right directory of the EGL driver you want to use, for example:

  LD_LIBRARY_PATH=/usr/lib/nvidia-367/ ./out/Release/fiddle  | ./tools/fiddle/parse-fiddle-output 

Bug: skia:
Change-Id: I2cce80318925fe88f9407646acb67628a8e48810
Reviewed-on: https://skia-review.googlesource.com/18137
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-31 14:23:56 +00:00
Brian Salomon
96789b31f2 Fix resource and skp paths in Android viewer
Docs-Preview: https://skia.org/?cl=18037
Change-Id: If92e561c6c24de1f51f81477d89b927e10308f13
Reviewed-on: https://skia-review.googlesource.com/18037
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-26 18:29:48 +00:00
Kevin Lubick
ffce079f4e Enable chromecast gpu perf
The new #ifndef account for what the chromecast sdk
cannot handle (e.g. posix).

Bug: skia:6581
Change-Id: I3d64d25980d80185f8b95c05badee5f665d97cd3
Reviewed-on: https://skia-review.googlesource.com/13811
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2017-05-24 20:30:05 +00:00
Robert Phillips
92de631edd Remove compressed (ETC1) texture support from Ganesh (take 2)
Reland of https://skia-review.googlesource.com/c/17456/ (Remove compressed (ETC1) texture support from Ganesh) but w/o removing third_part\etc1 files

TBR=bsalomon@google.com
Change-Id: I8ec4b7e3ddf47d213cb24c382731c050ffb8847f
Reviewed-on: https://skia-review.googlesource.com/17700
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-23 12:45:21 +00:00
Brian Osman
bc262e110a Revert "Remove compressed (ETC1) texture support from Ganesh"
This reverts commit ee26363aaa.

Reason for revert: Failing Google 3 roll.

Original change's description:
> Remove compressed (ETC1) texture support from Ganesh
> 
> Change-Id: If4cf286df87ea87338aba47001d90a5fcc4f2667
> Reviewed-on: https://skia-review.googlesource.com/17456
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ie1a57187287e03600a69e374501478e93c41415c
Reviewed-on: https://skia-review.googlesource.com/17527
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-22 20:14:50 +00:00
Robert Phillips
ee26363aaa Remove compressed (ETC1) texture support from Ganesh
Change-Id: If4cf286df87ea87338aba47001d90a5fcc4f2667
Reviewed-on: https://skia-review.googlesource.com/17456
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-22 18:02:52 +00:00
Robert Phillips
b7b7e5fba0 Add fixes & test for isConfigTexturable and isConfigRenderable
This CL fixes:
  isConfigTexturable was returning true for:
            kRG_float for ANGLE ES2 configs
  isConfigRenderable was returning true for:
            kAlpha_8 for ANGLE ES2 configs
  isConfigTexturable and isConfigRenderable were returning true for:
            SBGRA on ES2
  The NexusPlayer was marking RGBA & RG float configs as renderable but not textureable

Bug: 720325

Change-Id: If21361870dbdde8f3e09bc9dff3a394f2a329157
Reviewed-on: https://skia-review.googlesource.com/17387
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-22 17:55:48 +00:00
Brian Salomon
154ce91dc9 Replace most uses of GrSurface::desc() with conifg(), width(), etc.
Change-Id: Ic283c0ddf9efa0a467e97e10f5413ba9dfcb414f
Reviewed-on: https://skia-review.googlesource.com/17211
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-17 18:56:50 +00:00
Matt Sarett
9f1c403362 Add tool to create test images with interesting color profiles
Bug: skia:
Change-Id: Ia4f892368fceda4a99490f5bd29851837a7a6927
Reviewed-on: https://skia-review.googlesource.com/17212
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-17 18:15:20 +00:00
Robert Phillips
318c419d3e Remove RenderTarget pointer from GrRenderTargetOpList::RecordedOp
Change-Id: I08afe531cd9c65af4b3f6b6006bc3eaf7071cfec

Change-Id: I08afe531cd9c65af4b3f6b6006bc3eaf7071cfec
Reviewed-on: https://skia-review.googlesource.com/17117
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-17 14:19:40 +00:00
Brian Salomon
05441c40d6 Convert GrOvalOpFactory from GrLegacyMeshDrawOp to GrMeshDrawOp using GrSimpleDrawOpHelper.
Change-Id: Ib9f59ddf1c2c3f2bd0004ae16f842e52f45df8c9
Reviewed-on: https://skia-review.googlesource.com/16832
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-05-15 21:11:41 +00:00
Mike Klein
0dc6dd0a3f Add sRGB support to monobench.
We'll now run non-rendering and raster benchmarks,
for simplicity choosing sRGB as the only raster configuration.

$ ninja -C out monobench; and out/monobench "linear_clamp_(3color|pos)\$"
    gradient_linear_clamp_…
    6257  …3color 1x  …pos 1.03x

$ ninja -C out monobench; and out/monobench "linear_clamp_.*[^4][^f]\$"
    gradient_linear_clamp_…
    321  …shallow 1x  …shallow_dither 1x  …3color 1.49x  …hicolor 1.5x  …pos 1.52x

Change-Id: I7282a84c982eb1f11f0ea2dfe39afea66231761c
Reviewed-on: https://skia-review.googlesource.com/16877
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-15 20:24:26 +00:00
Greg Daniel
604b197c6b Add support for creating a shared vulkan test context
Bug: skia:
Change-Id: I997c6269e4676bf4cedddcd87e71d107053678bb
Reviewed-on: https://skia-review.googlesource.com/16905
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-05-15 18:12:59 +00:00
Brian Salomon
177266339c Include non-legacy GrMeshDrawOps in GLPrograms test.
Bug: skia:
Change-Id: Ifa0c3ffb5643c84ccdcb339fae75ea5d03a8451c
Reviewed-on: https://skia-review.googlesource.com/16580
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-12 19:08:32 +00:00
Brian Salomon
175f588831 Modify SkEventTracer::SetInstance to fail rather than assert if a tracer has already been installed.
Chromium usually calls SetInstance once per process. However, when run in single process more renderer threads will try to set the instance after the browser process already has done so. This allows them to fail gracefully without asserting.

Bug: skia:6603
Change-Id: Ic8a35422d787335aa67eefc07d0658f0fbe73db4
Reviewed-on: https://skia-review.googlesource.com/16664
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-12 16:49:07 +00:00
Matt Sarett
ebb1b5c297 Add new SkImageGenerator::getPixels() API, deprecate the old
This is fairly aggressive in that it will break any client
that is currently using SkImageGenerator with kIndex8.
I'm guessing that we don't have any clients doing that.

Bug: skia:6620
Change-Id: Ifd16f5232bb3a9f759c225315c57492d917ed9ca
Reviewed-on: https://skia-review.googlesource.com/16601
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-05-12 16:48:17 +00:00
Brian Salomon
ac70f84e7f Move all non-AA fill rect ops off of GrLegacyMeshDrawOp.
This adds perspective to GrNewNonAAFillRectOp, renames it to GrNonAAFillRectOp, and deletes the previous version of that namespace.

Change-Id: I20f35bf019f9c9105e6ec83dda11328451138109
Reviewed-on: https://skia-review.googlesource.com/15634
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-10 14:48:47 +00:00
Mike Klein
452a7a248b ok, fix typo: struct -> static
Change-Id: I2b26ccd017d9e66ced41a1af04929e2d83a5a2d5
Reviewed-on: https://skia-review.googlesource.com/16343
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-09 22:42:05 +00:00
Mike Klein
62669ad29c ok, add timer via
Change-Id: I3d25a2aa9ae6dacb52779142cea062c7d9df40f5
Reviewed-on: https://skia-review.googlesource.com/16238
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-09 22:00:39 +00:00
Brian Osman
13dddce65f Added SkImage::MakeCrossContextFromEncoded
Designed for Flutter's threading architecture, with
an eye to being useful to other clients. Under the
hood, uses a new image generator class to lazily wrap
a texture for multiple GrContexts.

Re-land of https://skia-review.googlesource.com/c/14180/

Bug: skia:
Change-Id: I3dd382640629b79b3058f18fee68d043566e43e5
Reviewed-on: https://skia-review.googlesource.com/15895
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-09 18:45:04 +00:00
Eric Karl
5c77975e4c Add flag to avoid stencil buffers in Skia
Certain systems experience a leak in the GL driver associated with
stencil buffers. Attempts to avoid the leak (while still using stencil
buffers) dind't succeed. This patch adds a GrContextOption
fAvoidStencilBuffers. This disables certain path rendering modes, as
well as stencil based masking/clipping.

Bug: 713854
Change-Id: Ifa6c0f2bd5ee395547bda9165d6c79d197ae8b8b
Reviewed-on: https://skia-review.googlesource.com/15253
Commit-Queue: Eric Karl <ericrk@chromium.org>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-09 17:41:25 +00:00
Brian Salomon
449d78f5a8 Revert "Added SkImage::MakeCrossContextFromEncoded"
This reverts commit 83b1b3db36.

Reason for revert: unit test failing and asan leaks

Original change's description:
> Added SkImage::MakeCrossContextFromEncoded
> 
> Designed for Flutter's threading architecture, with
> an eye to being useful to other clients. Under the
> hood, uses a new image generator class to lazily wrap
> a texture for multiple GrContexts.
> 
> Bug: skia:
> Change-Id: I6c37b12c8ab5bce94b91190e5f0beb91d31ae81b
> Reviewed-on: https://skia-review.googlesource.com/14180
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I1f0bf580aa0ea2d132e18b64ff610ddac9d073a7
Reviewed-on: https://skia-review.googlesource.com/15892
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-08 20:46:26 +00:00
Brian Osman
83b1b3db36 Added SkImage::MakeCrossContextFromEncoded
Designed for Flutter's threading architecture, with
an eye to being useful to other clients. Under the
hood, uses a new image generator class to lazily wrap
a texture for multiple GrContexts.

Bug: skia:
Change-Id: I6c37b12c8ab5bce94b91190e5f0beb91d31ae81b
Reviewed-on: https://skia-review.googlesource.com/14180
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-08 19:56:27 +00:00
Mike Klein
39748b2771 port ok to SkPngEncoder
I can't tell you how excited I am to turn down the libpng settings...
anything that saves me a few seconds is a nice quality of life win.

This CL makes ok run in about half the time when producing .pngs.

Profile running `ok gm srgb png` before:
    10.59   s   16.5%    10.59   s          longest_match
    8.98    s   14.0%    8.98    s          png_setup_paeth_row
    8.93    s   13.9%    8.93    s          skia_png_write_find_filter
    7.75    s   12.1%    7.75    s          deflate_slow
    4.63    s    7.2%    4.63    s          std::wait_until(...) const
    959.00 ms    1.5%    959.00 ms          SkPathRef::validate() const
    935.00 ms    1.4%    935.00 ms          sk_to_srgb_hsw
    ...

After:
    2.35    s    8.7%    2.35    s          std::wait_until(...) const
    1.70    s    6.2%    1.70    s          longest_match
    1.19    s    4.4%    1.19    s          deflate_fast
    931.00 ms    3.4%    931.00 ms          SkPathRef::validate() const
    898.00 ms    3.3%    898.00 ms          sk_to_srgb_hsw
    ...

Change-Id: I425c30b2ecd97a0e4a4392779de6301db473ee47
Reviewed-on: https://skia-review.googlesource.com/15547
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-05-08 17:09:31 +00:00
Chris Dalton
fe199b7d51 Add postFlush call to GrOnFlushCallbackObject
Adds a new postFlush method and renames the class to
GrOnFlushCallbackObject. Also removes the ref counting in favor of
making the callback object a purely virtual interface. ref/unref on the
callback interface would conflict with existing ref/unref methods on the
subclass. It is now the caller’s responsibility to ensure the lifetime
of the callback is tied to that of the context.

Bug: skia:
Change-Id: I2fc1f98c700032e296a36f3a9a09c0753ab47aea
Reviewed-on: https://skia-review.googlesource.com/15463
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-05 15:53:36 +00:00
Hal Canary
ce78bad054 header cleanup
Change-Id: I9d93add4e7998d8a1aa37cba9e7829fcbda867d5
Reviewed-on: https://skia-review.googlesource.com/15318
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-05 14:06:08 +00:00
Jim Van Verth
e7705780c9 Add ShadowUtils sample.
Also enables mouse support in Viewer.

Change-Id: Iaed08d42a64f591f0cd9b24684b3aee43404ed94
Reviewed-on: https://skia-review.googlesource.com/15313
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-04 18:37:55 +00:00
Mike Reed
b9641bd55a force all colorfilters to implement 4f
high-contrast gms differ at most by 1 bit

Bug: skia:
Change-Id: I1308bd105020ea3cd5a30fd3dd322ed134fb5ed5
Reviewed-on: https://skia-review.googlesource.com/15249
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-05-04 15:21:39 +00:00
Florin Malita
ab244f045a Revert "Revert "Reland: Remove SkLights include from SkCanvas.h""
This reverts commit 9d5f66d9c2.

Reason for revert: Leon landed Android fixes.

Original change's description:
> Revert "Reland: Remove SkLights include from SkCanvas.h"
> 
> This reverts commit fed00319c9.
> 
> Reason for revert: breaking the Android roll.
> 
> Original change's description:
> > Reland: Remove SkLights include from SkCanvas.h
> > 
> > SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
> > works fine).
> > 
> > Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb
> > TBR=reed@google.com
> > Reviewed-on: https://skia-review.googlesource.com/15143
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > 
> 
> TBR=fmalita@chromium.org,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I3b0e69f1d04d160f16a5567b09982d35cc9ca84e
> Reviewed-on: https://skia-review.googlesource.com/15195
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> 

TBR=msarett@google.com,reviews@skia.org,fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I0a1c2f9df61f16987ab72dfb4f3a205fbcc37667
Reviewed-on: https://skia-review.googlesource.com/15229
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-03 19:17:11 +00:00
Florin Malita
9d5f66d9c2 Revert "Reland: Remove SkLights include from SkCanvas.h"
This reverts commit fed00319c9.

Reason for revert: breaking the Android roll.

Original change's description:
> Reland: Remove SkLights include from SkCanvas.h
> 
> SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
> works fine).
> 
> Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb
> TBR=reed@google.com
> Reviewed-on: https://skia-review.googlesource.com/15143
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> 

TBR=fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I3b0e69f1d04d160f16a5567b09982d35cc9ca84e
Reviewed-on: https://skia-review.googlesource.com/15195
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-03 15:41:07 +00:00
Florin Malita
fed00319c9 Reland: Remove SkLights include from SkCanvas.h
SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
works fine).

Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb
TBR=reed@google.com
Reviewed-on: https://skia-review.googlesource.com/15143
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-05-03 13:22:28 +00:00
Mike Klein
16a6144dfd ok, add sRGB support
Change-Id: Ic375a593bcf67aad0d7bd0847ea6bcd0b9ac4ab6
Reviewed-on: https://skia-review.googlesource.com/15160
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-03 01:40:35 +00:00
Jim Van Verth
343fe49b82 Remove translateZ and lights from SkCanvas
Bug: skia:6557
Change-Id: I0dbf70c4131ab59e7fc6c674a6587767af98e13a
Reviewed-on: https://skia-review.googlesource.com/15151
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-02 21:17:01 +00:00
Jim Van Verth
fbdc080d3c Add wireframe mode to Viewer.
Change-Id: I0ff11088465a4702acf9841a791d76f286ddbaf1
Reviewed-on: https://skia-review.googlesource.com/15147
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-05-02 20:27:26 +00:00
Jim Van Verth
4c9155bd66 Remove EXPERIMENTAL_SHADOWING, Part 1
Bug: skia:6557
Change-Id: I6482d74be7b360c93141a73dd80c67854530c7a1
Reviewed-on: https://skia-review.googlesource.com/15101
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-02 17:22:44 +00:00
Florin Malita
38aad81a54 Revert "Remove SkLights include from SkCanvas.h"
This reverts commit 9ff301bf91.

Reason for revert: need to update G3, Flutter.

Original change's description:
> Remove SkLights include from SkCanvas.h
> 
> SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
> works fine).
> 
> Change-Id: Id2d7176eb3bf4609f72f46d513eebf59318f542f
> Reviewed-on: https://skia-review.googlesource.com/14904
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> 

TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I4799ad5b31aaeaf529c8b912bbe09aa8869a5e6c
Reviewed-on: https://skia-review.googlesource.com/15107
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-02 15:42:07 +00:00
Florin Malita
9ff301bf91 Remove SkLights include from SkCanvas.h
SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
works fine).

Change-Id: Id2d7176eb3bf4609f72f46d513eebf59318f542f
Reviewed-on: https://skia-review.googlesource.com/14904
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-02 14:50:38 +00:00
Greg Daniel
207282eb5a Make GrBackendTexture take Gr*Info refs in ctor, and copy them.
Bug: skia:
Change-Id: Ic05d3384fa07560fc18c52bb8ae03541a72515f7
Reviewed-on: https://skia-review.googlesource.com/14374
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-02 14:08:28 +00:00
Matt Sarett
687cc6c033 colorspaceinfo tool: Add flag to indicate that the input is an icc profile
Bug: skia:
Change-Id: Ieb5cff92bae1aa64df5bc7f3a398514fe5b20f77
Reviewed-on: https://skia-review.googlesource.com/14956
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-02 13:22:20 +00:00
Matt Sarett
1fa986c95a Added A2B support to colorspaceinfo tool
Tool now parses A2B images/profiles.
Tool can now display a cross-section based visualization for the color
look-up tables in A2B profiles.

BUG=skia:

Change-Id: I68abb3e947b080c533e283783d7859feea8d35d6
Reviewed-on: https://skia-review.googlesource.com/6119
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-05-01 22:10:58 +00:00