This reverts commit 70474c1cb0.
Reason for revert: bot build failure
Original change's description:
> Remove custom SkSort algorithms.
>
> SortBench shows that SkTQSort and SkTHeapSort are inferior to std::sort.
> The difference is small on randomized inputs, but quite significant for
> semi-ordered inputs (forward/backward/repeated). There doesn't seem to
> to be any compelling advantage to SkTQSort.
>
> Nanobench results: https://screenshot.googleplex.com/9JOLV1d6Z0u
>
> (These performance numbers are from an optimized build my local machine;
> it's possible that we might see different results on the test bots.)
>
> Change-Id: Iaf19563041547eae7de2953be249129108f093b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302295
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,brianosman@google.com,johnstiles@google.com
Change-Id: I1126dd4cda95716dac225ad32d5b0e5cf3f09421
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302447
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
SortBench shows that SkTQSort and SkTHeapSort are inferior to std::sort.
The difference is small on randomized inputs, but quite significant for
semi-ordered inputs (forward/backward/repeated). There doesn't seem to
to be any compelling advantage to SkTQSort.
Nanobench results: https://screenshot.googleplex.com/9JOLV1d6Z0u
(These performance numbers are from an optimized build my local machine;
it's possible that we might see different results on the test bots.)
Change-Id: Iaf19563041547eae7de2953be249129108f093b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302295
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Fixes flickering help text
Change-Id: I61159e6946125e9e2ce7be3f8f8f6103473855be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302266
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This CL is working towards replacing GrContext with the GrDirectContext/
GrRecordingContext pair.
Change-Id: Id4488e1280d76a16c37d58bd8d29fb7f8dde6b1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301940
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Just refactored names. Looking at adding SkCloseDynamicLibrary too.
Change-Id: Ibc3ad556386dad3e80bf91bd9ee46e9b9fe68c4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301900
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We are replacing GrContext with the GrDirectContext/GrRecordingContext
pair. This starts making that change visible to clients (and weaning
Skia off of GrContext).
Change-Id: I00cc9bf208499984de855a1646229bd7557fc925
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300706
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I7f9122bb99fea952a67fa47aaada789037438152
Bug: skia:10476
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300906
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
The changes in http://review.skia.org/300182 caused cmd-Q to stop
working normally in Viewer, because the Mac window would report that it
had processed all key equivalents. This prevented the NSApp from
handling key equivalents in the menu bar. This CL now forwards on all
key equivalents to the system for processing (even as it passes them to
ImGui), allowing cmd-Q to work again.
This CL also simplifies the pattern for updating modifier keys slightly.
Change-Id: I2285839b41dd361e34694eccbc6d581662b24648
Bug: skia:10338
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300651
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
A variety of modifier key handling issues are addressed in this CL:
- Added a skui::Key for the Super key (this is ImGui's name for command)
- Added OS X event handling for `flagsChanged` (sent when modifier keys
are pressed)
- OS X manually tracks modifier key state and sends key-up and key-down
events to the ImGuiLayer as necessary
- OS X does not send key-up events when hotkeys are pressed, so these
are manually synthesized and sent to ImGui (otherwise hotkeys are
repeated forever)
- Replaced hardcoded Virtual Key valus in OS X code with named constants
- Our custom bitmask type was lacking the ability to XOR
This CL does NOT enable the OS X clipboard; this uses the ImGui internal
clipboard.
Change-Id: I76b55215858bfb6441dbef18ad638426fa8bc073
Bug: skia:10338
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300182
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Adds in the GR_D3D_CALL_ERRCHECK utility macro to avoid this in the
future.
Change-Id: I68112bcccbd8cb9d55ae02e99de954269d0ac4bd
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300176
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This is a temporary fix to handle an issue where we try to map a
dynamic buffer when it's in use in a previous command list.
Change-Id: Ibc6b071508c11ea394a320b326645ecc4b22105a
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299392
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This new api will eventually replace the version that takes an
SkSurface::BackendAccess.
Change-Id: I48cd013725e14027f386b0b111223459944ac44a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295567
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I9dbe6020d67cc452c9cbbdeace68f1d01275b419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293559
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Change-Id: Ifec54ef7948707f0d9811bc0b865223ad02822b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291181
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Change-Id: I4d4025fb842eb937785509bc7947f85f28a98ab8
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288551
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Catalina requires that we call [NSOpenGLContext clearCurrentContext]
when tearing down contexts. We were doing it in the GLWindowContext
destructor, but not when switching for MSAA.
Bug: skia:10134
Change-Id: I81be962419ca4afa724ab3f896081af4bbedda3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288157
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Change-Id: Id8394acf854f1c069c5fde449ede225b2d81968b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288056
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
According to the documentation at
https://developer.apple.com/documentation/appkit/nsopenglpfamultisample
this attribute is necessary to enable MSAA antialiasing.
(Unfortunately, even with this change, MSAA is still not working
properly in OpenGL.)
Change-Id: I1f59a4659d4891fc239ab4c56df7b134f0f5f2a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287996
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Metal layer was using linear filter which was introducing blur.
Changed to nearest filter.
Bug: skia:10172
Change-Id: Ia69d6c9a56f9a2f69b5e98fd9941be52ec01b7d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286616
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Previously, in cases where the backbuffer was null, we would call layer->onPrePaint (which starts a new frame with ImGui::NewFrame) without a matching call to layer->onPaint (which calls ImGui::Render). This causes the ImGui frame counter to go out of sync, which leads to an assertion when NewFrame is next called.
(The backbuffer can become null if unsupported settings are used, e.g. a MSAA setting above the maximum supported by your GPU.)
Change-Id: I1b8fbaa1bf78ad5e1aa41fd04eda6be206c952b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283196
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This is not part of the public API of Dawn and will be unnecessary once
Dawn move to "surface based swapchains". DawnD3D12WindowContext didn't
need the include so all that's needed is copying the helper in
DawnMTLWindowContext.
Change-Id: I8d0682b6b0801dc311ad4c7d73d4c07e575ecf4e
Bug: chromium:1064305
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282496
Reviewed-by: Zhenyao Mo <zmo@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
It was too easy to get into circular include chains. Added static
asserts to ensure we keep our quad AA flags in sync. Also, IWYU.
Change-Id: I01aefa264aa56420ab5a46a8ecd9e63c021c79ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280405
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Add Dawn's dependencies shaderc and glslang, and roll SPIRV. Update the
BUILD.gn files to match upstream changes.
Bug: skia:9939, chromium:1064563
Change-Id: Ie9720806efe823312da10f7911688f12cad0713e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278770
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
Updated to use sentinel GL context even when GL backend is not built.
This reverts commit 1171d314ef.
Change-Id: Ia94bbe4865ddd4e898446c13886877c539f0eb0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The biggest mismatch between these and SkTHash{Map,Set,Table}
is the old ones provide Iter and ConstIter, the new ones foreach().
This CL,
- adds foreach() methods to the old types,
- replaces all uses of ConstIter with foreach(),
- replaces most uses of Iter with foreach(),
I'm leaving one spot using Iter to walk the table and remove its
elements for its own CL... it'll be a little more complicated to get
that right.
From there it should be straightforward to turn SkTDynamicHash
into a thin wrapper over an SkTHashTable.
Bugs: skia:9703
Change-Id: Ia6ba87c35b89585c42b5b9f118f4cbf3abd04f0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277098
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Use std::min and std::max everywhere.
SkTPin still exists. We can't use std::clamp yet, and even when
we can, it has undefined behavior with NaN. SkTPin is written
to ensure that we return a value in the [lo, hi] range.
Change-Id: I506852a36e024ae405358d5078a872e2c77fa71e
Docs-Preview: https://skia.org/?cl=269357
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269357
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Looks like the OS now holds on to the current GL context and doesn't
release it unless explicitly told to.
Bug: skia:9885
Change-Id: Ic7bc6860ec96d88e278682b7f2f67e1ac365d27b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269369
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Use std::max and std::min instead
Change-Id: Icf3796609e5cb511687fb50bd31229ae4b6b9b39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268841
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Split GrDawnImageInfo into GrDawnTextureInfo and GrDawnRenderTargetInfo.
The former holds only a wgpu::Texture, and the latter holds only a
wgpu::TextureView. This split is necessary because Dawn SwapChains now
vend TextureViews, not Textures.
The TextureView held by GrDawnRenderTargetInfo is always 1-mip, since
it's a requirement for rendering to a texture in Dawn.
Change-Id: Id6e99b5e4bf18f97e939170856a665e2038253ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254810
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Also fix some compile breakages from recent Skia changes.
No changes to Skia API.
Change-Id: Ifd0b1d89fb4ea3cf1f6a7170f2f74614276364ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257877
Commit-Queue: Stephen White <senorblanco@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This improves the encapsulation of all the data required to make a program/pipeline w/in the GrProgramInfo class.
Bug: skia:9455
Change-Id: Ib41519c8ded9f27a7bbe787097a431b38ab101bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253376
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This CL itself doesn't really change how anything is running today. However,
it is the first step into gracefully supporting a vulkan device lost return
error and being able to correctly clean everything up.
Bug: skia:9603
Change-Id: I9693c514a32ca437df61a7aee63651e2e40ee1c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252819
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Forgot to add code to drain the Autorelease pool, so objects created
with autorelease just built up over time.
Bug: skia:8243
Change-Id: I373c6820df8ee102b110386377378858c235b2fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252601
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
The new webgpu_cpp.h hotness for native apps brings with it a new
namespace: wgpu. This is a straight substitution.
Note: no Skia API changes.
Change-Id: I12b26417e76838cd8fa2b39b8161cbaa2cd8fa78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251660
Commit-Queue: Stephen White <senorblanco@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
The purpose of this is to delay acquiring the next drawable in the
swapchain to avoid stalling and gain better parallel execution between
the CPU and GPU.
Change-Id: I40ef7672394fd00616de43685530d2feaf7cab2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249005
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This allows readbacks, which fixes backdrop_hintrect_clipping test.
Change-Id: I6b9002d7387b0bc79301848a2e7c70deb7b95f70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249418
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This requires some changes to dawnSetProcs() and some build file changes.
Change-Id: I8a643ec0690857d53db7c1f8f5223077e30f69e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248860
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Remove optional param to SetIndexBuffer().
Update SetVertexBuffers -> SetVertexBuffer.
PipelineStageDescriptor -> ProgrammableStageDescriptor.
Update past generator changes, ring buffer changes, etc.
Add ErrorScopeTracker.cpp/.h to the build.
Add Vulkan MemoryResourceAllocator files.
Fix vertexShader ShaderStageDescriptor.
Fix spirv-cross include path.
TextureUsageBit -> TextureUsage, etc.
DawnErrorCallback fixes.
Removal of texture.CreateDefaultView.
Fix GL supported_extesions mumbo jumbo.
Update past ChromeOS change.
Add PassResourceUsageTracker.cpp/.h to build.
Add GLFormat.cpp/.h to build.
Add Extensions and Toggles to the build.
Add EncodingContext, AttachmentState to build.
Add RenderEncoderBase to Dawn build.
gn format dawn BUILD.gn, spirv-cross BUILD.gn.
Change-Id: I26538d63c93668647048814aad6ad456ae323679
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248261
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Change-Id: I511f15f056e15beddeaaf203414a1519569bfbe4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248815
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
With these changes we can build across all versions of Metal, and for
the most part run on older OSes (further testing is necessary).
Bug: skia:9408
Change-Id: I00ee03b9a3a0e49483af4a610544b20d482a0cdd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245957
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I87b0fc76ef48c1a21498e576853a6c3b4a6a98f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242563
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Sets UIPinchGestureRecognizer and UISwipeGestureRecognizers and
passes the result down to the sk_app::Window. To simplify detection,
swipes take precedence over pans, and pans require a single touch.
This is less flexible for the app, but in most cases I think is
what we want.
Bug: skia:8737
Change-Id: Ib031b6ad465d3a353da29d7e0b48a666d4ff8b9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239776
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:8737
Change-Id: I81379bd57684626705da48e03c91b83e91031e0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239104
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Adds MetalWindowContext_ios and hooks it up to Window_ios.
Also includes some minor clean up in other iOS code.
Bug: skia:8737
Change-Id: I2e8a0c755310fbc4ed534f975815c60f8eca130b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238438
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This replaces the SDL-based system and should allow Metal to work on iOS.
OpenGL and raster will render but there's no touch input yet.
Bug: skia:8737
Change-Id: I863accc47f0e1781192d567dbe54d1e321c3cd2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231561
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Icd331e8946d80652750b8b6ea0db65f5f676ac3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238058
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Implement Window contexts for D3D12, Metal and Vulkan, as well as
a base class for all of them (DawnWindowContext).
Implement WSI, swap chains and external textures for all backends.
Add Dawn support to Viewer app.
Change-Id: I9368eae8d43594821aa1edd9fd559c8a9ba30066
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228060
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Change-Id: I43044727298265ddb711456346c2b544ca8d509d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231477
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Change-Id: Ie04918f2bfc296eedbba67d96f62ee37e0303061
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231136
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
With this change I also removed GrPixelConfig as param to supportedReadPixelsColorType().
This meant some updates had to be made to Vulkan and Metal to make sure they return the
right GrColorType.
Bug: skia:6718
Change-Id: I71b6360489cf499692c7b777e5915090fad05c56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228349
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
First draft of (mostly stubbed-out) GrDawnGpu.
Skeletons of GrDawnCaps, GrDawnGpuCommandBuffer, GrDawnRenderTarget.
First draft of DawnTestContext.
First draft of psuedo-fences for Dawn, implemented with MapReadAsync.
Change-Id: I443f3370522639e82f2fa0eebe6b206c372f13a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228137
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 6cebea42a8.
Reason for revert: breaking google3 roll
Original change's description:
> First draft of Dawn backend: clears are working.
>
> First draft of (mostly stubbed-out) GrDawnGpu.
> Skeletons of GrDawnCaps, GrDawnGpuCommandBuffer, GrDawnRenderTarget.
> First draft of DawnTestContext.
> First draft of psuedo-fences for Dawn, implemented with MapReadAsync.
>
> Change-Id: Id009436f4441f26ffbc82d485d7af3a499b3281b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226857
> Commit-Queue: Stephen White <senorblanco@chromium.org>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,senorblanco@chromium.org
Change-Id: Ie494b5a403e8537c6539551533ae8b9156e90a61
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228120
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
First draft of (mostly stubbed-out) GrDawnGpu.
Skeletons of GrDawnCaps, GrDawnGpuCommandBuffer, GrDawnRenderTarget.
First draft of DawnTestContext.
First draft of psuedo-fences for Dawn, implemented with MapReadAsync.
Change-Id: Id009436f4441f26ffbc82d485d7af3a499b3281b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226857
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
The Mac GLContext is designed to not constantly teardown on resizes
and minor DisplayParams changes. However, for MSAA we do have to
tear it down.
Change-Id: I1a9d765068fa5f6b22dff49f6355c29e1affb686
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226850
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Adds a separate resolve texture to GrMtlRenderTarget, which can be used
to do a resolve for the main multisample color texture. The resolve is
handled by setting a special Store action for the RenderCommandEncoder.
Bug: skia:8243
Change-Id: I1ffd756c01a9b363116ffefee2c4c50ba9a3e637
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225536
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
MakeFromBackendTextureAsRenderTarget is planned to be deprecated, so we
should use MakeFromBackendTexture with a sampleCount parameter instead.
On Vulkan, this ran into issues because we assumed an allocation for the
VkImage and the swapchain doesn't provide us with one. Fixed so we don't
need an allocation for Borrowed textures.
Bug: skia:
Change-Id: Ib26888020e093f4a734a4159eae898539c2273b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226839
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:
Change-Id: I2e7fc5463ea73baa82e6f1a3340e9c88d1b8be32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226081
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
If you launch the Mac viewer from the command line, it will sit there
until you click on the thumbnail in the dock, and only then will bring
up the window. This fixes that so it will open the window immediately.
Change-Id: I5628dc6c59833f808a61dedde457774114dd0e94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222783
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This makes our usage of sk_cf_obj consistent with Chrome.
Bug: skia:8243
Change-Id: I159339577a0e8595e7cdd47ffb9ab0653269e108
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218973
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This makes GrCFResource a template class with similar semantics to sk_sp.
Change-Id: I9ae9988dac6b39477b16d65591ef6fff44903c36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218376
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Previous changes fixed the zombie device and queue, assuming that
they're bridged correctly.
Bug: skia:8243
Change-Id: Id4c2d10beacbb2ac749187d8d54fc2d276cf7b3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219378
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
* Move OpenGL vsync setup out of initial context setup block
* Fix window repaints for OpenGL and Metal
* Also moved some Mac-specific code into Mac-specific Metal class
Bug: skia:9095
Change-Id: I221edfbd2292d949cc15232ed2791f8fe1bbe2ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214686
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Windowing and events:
* Use a NSTrackingArea to only capture mouse events within the view.
* Use ViewDelegate to track events rather than pulling them out of the
event pump.
* Sets up the autoreleasepool correctly to clear out old events
Context creation:
* Don't use a subview for OpenGL (it's not necessary).
* For Metal, use a CAMetalLayer rather than MTKView.
* Add vsync support to Metal.
Bug: skia:8737
Change-Id: I8ea5cc865df65f8dc2fef47082bf6a4d1657cf03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213672
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Current strategy: everything from the top
Things to look at first are the manual changes:
- added tools/rewrite_includes.py
- removed -Idirectives from BUILD.gn
- various compile.sh simplifications
- tweak tools/embed_resources.py
- update gn/find_headers.py to write paths from the top
- update gn/gn_to_bp.py SkUserConfig.h layout
so that #include "include/config/SkUserConfig.h" always
gets the header we want.
No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Bug: skia:8737
Change-Id: Ib825e5f0c9502692cbecc60fbb68d0d1a2bc635f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208672
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is to match the current features of SkSurface::flush and to prepare
for adding additional features to flush.
Bug: skia:8802
Change-Id: I5d68272e1277b416af357e6ffaf426841ceda943
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207301
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:
Change-Id: I07f8086aaadf1b2dd0d8709bfbc20e2c694c95e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204441
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:
Change-Id: Idcb3e3b0a67c2da65c99c597686cb55961142a38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204263
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I1a223c96fbffc24a3a9263304768c2d7946a7a9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204260
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This also fixes an issue where vulkan would crash any time we change a
display param on unix.
Bug: skia:
Change-Id: Ic6c3843e04bc77c2e9c5301ee38fcc58a409495d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203380
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This updates viewer to show the full frametime including getting new buffers
and presenting buffers to the screen. This is more useful information than
simply the sum the flush and paint.
In a follow up CL we'll enable disabling vsync so we can truly measure how
long it takes us to draw.
Bug: skia:
Change-Id: Ibdbf16b37b44309fca6e771272ce38fd31a0e95c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202708
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.
Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
SkCanvas::flush is problematic and we wish to deprecate it. As a first step, this CL begins to remove Skia's internal usage of it.
Ideally clients would use SkSurface::flush and/or GrContext::flush.
Change-Id: I39bb0702f8230134a97961a4ee70833fd5bd0dcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:
Change-Id: I5e664939a446616ef57acc79d26a10e6908cda10
Reviewed-on: https://skia-review.googlesource.com/c/196643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
* Set correct backing size for Metal and Vulkan
* Don't capture mouse events when resizing
Bug: skia:8737
Change-Id: I7798ca95aebe0c11b75b23a55a94514550317b32
Reviewed-on: https://skia-review.googlesource.com/c/196423
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This change allows Skia to handle transfering from the present layout.
Skia currently never changes to the present layout, though we are looking
at adding support for this in a different CL.
With this change a client can wrap a an VkImage into an SkSurface still in
the queue present layout and Skia will handle the transation to color
attachment. If a client uses this functiality they most likely will want
to immediately call wait(GrBackendSemaphore) on the SkSurface so that Skia
waits on the VkSemaphore that came from a call to vulkan aquire image before
doing any work on the wrapped VkImage.
Bug: skia:
Change-Id: Ia9bd12ad4e6cd972daaa972cce8698d396c002fc
Reviewed-on: https://skia-review.googlesource.com/c/194424
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Works with v1.0.17, will probably need updating for later revisions.
Bug: skia:8737
Change-Id: I9e42fad90656a88efa12625856019a8282ff39fd
Reviewed-on: https://skia-review.googlesource.com/c/191298
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Rather than depend on the Cocoa event system we intercept the events
in our main loop and send them to the appropriate sk_app::Window. A
hashmap that maps from Cocoa windowNumbers to an sk_app::Window is
added to make this possible.
We continue to send the event on through the Cocoa system to catch
system level events -- e.g., window close and drag events. We also
continue to catch key events in an NSView to keep the app from beeping
annoyingly because it thinks it's capturing events outside its focus.
Finally we ensure that move events are always enabled for the window
so that imgui knows that the cursor is over it.
Bug: skia:8737
Change-Id: Id49df51f68942fbf51634d6484291df862074864
Reviewed-on: https://skia-review.googlesource.com/c/191574
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:8737
Change-Id: I5c4c839bcf39f2cd3a9a32d005bf4bdb7c42e6a5
Reviewed-on: https://skia-review.googlesource.com/c/187925
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Trying to shuttle our paint events through the Mac event system seems
to be causing a number of problems, one being that we're refreshing
too often. This works around that by tracking the invalidation flag
per window.
Bug: skia:8737
Change-Id: Ib1b8041f1d9299ff366747831a466439bfd0db29
Reviewed-on: https://skia-review.googlesource.com/c/190673
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Gives 1:1 pixel correspondence with GM resolutions, and fixes
viewport issues.
Bug: skia:8737
Change-Id: Ieb87ed32cbb3211bdb4cdfbcc486c7b57b1c1eda
Reviewed-on: https://skia-review.googlesource.com/c/188627
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Bug: skia:
Change-Id: I1763aab0b4bdb650128c1fcc3aa3a05d194496ca
Reviewed-on: https://skia-review.googlesource.com/c/186360
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
for f in $(git grep -l drawSimpleText); do
sed -i 's/wSimpleText(\([[:alnum:]]\), strlen(\1), kUTF8_SkTextEncoding,/wString(\1,/g' "$f"
sed -i 's/wSimpleText(\([[:alnum:]]*\)\.c_str(), \1\.size(), kUTF8_SkTextEncoding,/wString(\1,/g' "$f"
done
git checkout @~ include/core/SkCanvas.h samplecode/SampleCusp.cpp
git cl format
Change-Id: Ibc0c3afd30f86465a645fadb26177d61919f57fd
Reviewed-on: https://skia-review.googlesource.com/c/181561
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Bug: skia:8569
Change-Id: I4f526c8918a9a4aae4b6cd6d7c803b12e90e82ed
Reviewed-on: https://skia-review.googlesource.com/c/175984
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>