summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2022-01-11LibGUI: Make Tableview handle multi-selected indexes when deletingGlenford Williams
Previously when the delete key was pressed, only the first selected cell index would have been deleted. This commit remedies that by first checking when more than a single index is selected.
2022-01-11AK+LibC+LibPthread: Introduce NoAllocationGuardkleines Filmröllchen
NoAllocationGuard is an RAII stack guard that prevents allocations while it exists. This is done through a thread-local global flag which causes malloc to crash on a VERIFY if it is false. The guard allows for recursion. The intended use case for this class is in real-time audio code. In such code, allocations are really bad, and this is an easy way of dynamically enforcing the no-allocations rule while giving the user good feedback if it is violated. Before real-time audio code is executed, e.g. in LibDSP, a NoAllocationGuard is instantiated. This is not done with this commit, as currently some code in LibDSP may still incorrectly allocate in real- time situations. Other use cases for the Kernel have also been added, so this commit builds on the previous to add the support both in Userland and in the Kernel.
2022-01-10LibC: Implement strsep()Linus Groh
2022-01-10Taskbar: Tweak taskbar button progress bar renderingAndreas Kling
The rects didn't take the "thin cap" button style into account, causing in-button progress bars to look a little off.
2022-01-10LibJS: Include hour-cycle in DateTimeFormat optionsTimothy Flynn
This is a normative change to the Intl spec: https://github.com/tc39/ecma402/commit/20e5c26 Note that this doesn't actually affect us. Its purpose is to provide the hour-cycle to BestFitFormatMatcher. This AO is implementation defined, and ours just invokes BasicFormatMatcher, which doesn't use this field. We could now have LibUnicode generate this field and use it to find a better format pattern, though.
2022-01-10LibUnicode: Add an hour-cycle field to DateTimeFormat's format patternTimothy Flynn
2022-01-10LibGUI+AK: Add DRAG_DEBUG opt and put drag operations behind dbgln_ifMarcus Nilsson
No need to have this enabled all the time.
2022-01-102048: Add action icons for New Game and SettingsDylan Katz
2022-01-102048: Simplify dialog box when target reachedDylan Katz
Previously, upon reaching the target, the player is presented with potentially two dialog boxes: one asking if the user wants to continue endlessly and another showing the player's statistics, which would only be shown if the user does not want to continue. This commit consolidates these into a single dialog box that shows the relevant statistics and asks the user if they want to continue endlessly.
2022-01-102048: Fix off-by-1 when opening settingsDylan Katz
When opening 2048's settings, it translates the target tile into a power of 2. Previously, it was done incorrectly, causing the resulting value to be off by one, and the number would increase every time one opens, saves and closes the settings. With this change, it now works as expected.
2022-01-09LibGUI: Show hours and minutes in "unsaved changes" dialogsRafał Babiarz
2022-01-09LibGL: Add stub for `glColorMaterial`Jelle Raaijmakers
2022-01-09LibGL: Add capabilities to context parametersJelle Raaijmakers
Context parameters are LibGL's way of centrally defining all parameters that can be retrieved through `glGetBoolean*`, `glGetInteger*`, etc. The spec describes that capabilities such as `GL_LIGHTING` can also be retrieved through these methods, but it should not be possible to retrieve random boolean parameters through `glIsEnabled`. For example, `GL_UNPACK_LSB_FIRST` can only be retrieved through `glGet*`. This moves reading of capabilities to `::get_context_parameter` and implements its use in `::gl_is_enabled`.
2022-01-09LibJS: Implement proper Iterator recordsLinus Groh
Instead of using plain objects as Iterator records, causes confusion about the object itself actually being its [[Iterator]] slot, and requires non-standard type conversion shenanigans fpr the [[NextValue]] and [[Done]] internal slots, implement a proper Iterator record struct and use it throughout. Also annotate the remaining Iterator AOs with spec comments while we're here.
2022-01-09LibJS: Use Optional<Value> for potentially missing value in Iterator AOsLinus Groh
Given we're already moving away from using the empty Value elsewhere, and I'm about to update most of this code, let's do this small tweak now.
2022-01-09LibCrypto: Link against LibCoreDaniel Bertalan
The ASN1 parser calls `LibCore::DateTime::create` and `LibCore::DateTime::now`.
2022-01-09Spreadsheet: Properly pass parent window to WorkbookGlenford Williams
Change the parent of the WizardDialog to that of the Spreadsheet window. Previously the WizardDialog was using the open file dialog as the parent resulting in the csv import dialog
2022-01-09PixelPaint: Verify that we have an ImageEditor instead of returningMarcus Nilsson
We should never be in a state where an action requiring an ImageEditor is enabled if all tabs are closed.
2022-01-09PixelPaint: Disable actions when no ImageEditor is openMarcus Nilsson
Disable all actions when the last tab is closed and enable them when a new ImageEditor is created.
2022-01-09LibGUI: Add Menu::set_children_actions_enabled() helperMarcus Nilsson
This adds a helper function to Menu that allows us to set all the children enabled/disabled.
2022-01-09PixelPaint: Keep a RefPtr to layer in LayerPropertiesWidgetMarcus Nilsson
Using a WeakPtr to keep a reference to the active layer caused it to be destroyed when the last tab was closed, which made the m_layer == layer check in set_layer() return early since it was already null. Because of this the LayerPropertiesWidget was never disabled.
2022-01-09PixelPaint: Make PaletteWidget::set_image_editor take a ImageEditor*Marcus Nilsson
After closing the last open ImageEditor, selecting a color would try to dereference it causing a crash. Instead make set_image_editor() take a pointer to it and set it to nullptr when closing the last tab like we do with LayerListWidget and LayerPropertiesWidget.
2022-01-09LibGL+LibSoftGPU: Implement viewport supportJelle Raaijmakers
This implements the `glViewport` API call, the coordinate transformation and the `GL_VIEWPORT` context parameter.
2022-01-09LibSoftGPU: Rename window coordinate transformation functionJelle Raaijmakers
The name `scissor_box_to_window_coordinates` was wildy inaccurate since we are actually transforming window coordinates into whatever the coordinate space of the backing bitmap is.
2022-01-09Help: Scroll to the top of page when opening a new linksholm
Previously the scroll position would not reset when loading a new page. This caused various problems such as opening the page at the previous pages scroll position and in some instances not even showing the new page at all.
2022-01-09LibSoftGPU: Take sample from pixel centerStephan Unverwerth
This adds a half pixel offset to the edge value calculation in order to sample the triangle at pixel centers. This is in line with actual OpenGL rasterization rules and generates correctly interpolated vertex attributes including texture coordinates.
2022-01-09LibSoftGPU: Make divide-by-zero guard more explicit in stats overlayStephan Unverwerth
This previously assigned 1 to any divisor that was 0 which was a bit confusing
2022-01-09LibSoftGPU: Allow arbitrary render target sizesStephan Unverwerth
With the RASTERIZER_BLOCK_SIZE gone we can now render to any size, even odd ones. We have to be careful to not generate out of bounds accesses when calculating the render target and depth buffer pointers. Thus we check the coverage mask and generate nullptrs for pixels that will not be updated. This also masks out pixels that would touch the triangle but are outside the render target/scissor rect bounds.
2022-01-09LibSoftGPU: Also interpolate normal during triangle clippingStephan Unverwerth
2022-01-09LibSoftGPU: Move alpha test into separate functionStephan Unverwerth
2022-01-09LibSoftGPU: Move alpha blend factor setup out of triangle rasterizationStephan Unverwerth
Since the alpha blend configuration should not change between most calls of draw_primitives it makes no sense to reinitialize the blend factors for every rasterized triangle. The alpha blend factors are now set up whenever the device config changes. The blend factors are stored in struct AlphaBlendFactors.
2022-01-09LibSoftGPU: Make rasterization and shading member functions of DeviceStephan Unverwerth
This adds member functions Device::rasterize_triangle() and Device::shade_fragments(). They were free standing functions/lambdas previously which led to a lot of parameters being passed around.
2022-01-09LibSoftGPU: Vectorize color conversion from/to framebufferStephan Unverwerth
Functions to_rgba32 and to_vec4 now process 4 color values at the same time. Co-authored-by: Jesse Buhagiar <jooster669@gmail.com>
2022-01-09LibSoftGPU: Only interpolate fog values if fog is enabledStephan Unverwerth
2022-01-09LibSoftGPU: Add SIMD utilization counter to debug overlayStephan Unverwerth
This adds a counter to the debug overlay that displays the average percentage of SIMD lane utilization. This number represents the number of pixels that were output for each quad. A utilization of 100% means that all 4 SIMD lanes were used and no pixels were masked out before being written to the color buffer.
2022-01-09LibSoftGPU: Vectorize the rest of the rasterizer pipelineStephan Unverwerth
2022-01-09LibSoftGPU: Use bitwise and instead of modulus operator for POT texturesStephan Unverwerth
Where possible the sampler will wrap texture coordinates using a bitwise and instead of a modulus. This speeds up the calculation quite a bit.
2022-01-09LibSoftGPU: Vectorize texture sampling and shadingStephan Unverwerth
2022-01-09LibSoftGPU: Add PixelQuad struct that holds data for each rendered quadStephan Unverwerth
2022-01-09LibGfx: Allow Vector{2,3,4} operators to accept different argument typesStephan Unverwerth
This is needed to e.g. multiply a Vector4<f32x4> by a float.
2022-01-09LibSoftGPU: Add SIMD.h with SoftGPU specific SIMD functionsStephan Unverwerth
Adds functions to expand Vector{2,3,4} to their SIMD equivalent.
2022-01-09Userland: Port wasm to LibMainFederico Guerinoni
2022-01-09Userland: Port tac to LibMainFederico Guerinoni
2022-01-09PixelPaint: Move out common logic from Filters into base classMustafa Quraish
Now, each new filter only has to describe how to actually change the bitmaps, and the common logic of pulling out the bitmap from the layer, and marking the action as done, etc is all handled in the `Filter` base class. This also makes it possible to apply filters to external bitmaps, which are not embedded in a `Layer` (which we can use to preview filters in the future!)
2022-01-09Shell: Add a "noop" builtin aliased to ":"Ali Mohammad Pur
POSIX comes up with such silly names sometimes... This builtin does nothing. at all.
2022-01-09Shell: Refresh PATH cache after 'unset PATH'Ali Mohammad Pur
Note that `execvp` has a default value for PATH (both on Serenity and on Linux) and so this does not 'fix' #11608.
2022-01-09Shell: Don't reset 'last_return_code' before running commandsAli Mohammad Pur
Some variables depend on its value to function correctly. Fixes the following issue: $ false; echo $? 1 $ false $ echo $? 128
2022-01-09Shell: Make interrupts kill the whole chain and not just the current jobAli Mohammad Pur
This makes interrupting `sleep 10; echo hi` not print `hi` anymore, which is the expected behaviour anyway. Also fixes the problem with fast-running loops "eating" interrupts and not quitting.
2022-01-09beep: Port to LibMain :^)Junior Rantila
2022-01-09LibCore: Add beep wrapperJunior Rantila