summaryrefslogtreecommitdiff
path: root/gsk
Commit message (Collapse)AuthorAgeFilesLines
* Partially revert GskTexture → GdkTexture renameEmmanuele Bassi2017-11-045-39/+39
| | | | | Excessive use of sed when moving GskTexture to GDK; the GskTextureNode should still live under the GSK namespace.
* renderer: Assert having been unrealized in disposeBenjamin Otte2017-11-041-1/+3
| | | | | | | | | | | We cannot unrealize a renderer in the dispose function, because that would cause this chain to happen: gsk_gl_renderer_dispose gsk_renderer_dispose gsk_renderer_unrealize gsk_gl_renderer_unrealize So we would call into thje GL renderers unrealize when it has already (partially) disposed itself and ause accesses to dead variables.
* GskTexture => GdkTextureBenjamin Otte2017-11-0424-776/+98
| | | | We want this thing to replace GdkPixbuf, so it has to live in GDK.
* gskgl: Deal with being rerealizedBenjamin Otte2017-11-011-2/+3
|
* gsk: Apply scale factor for fallback renderingMatthias Clasen2017-10-281-2/+3
| | | | | | | This fixes blurry text and icons whenever we apply shadows in a hidpi window. Shadow nodes are the last ones that we still use fallback for, and this was causing us to render the text blurry.
* Triival cleanupMatthias Clasen2017-10-281-1/+1
| | | | | No need to go to the window, we store a copy of the scale factor in the render pass object.
* gsk: Scale glyphs in the glyph cacheMatthias Clasen2017-10-289-27/+48
| | | | | | | | Pass a scale factor when caching glyphs or looking them up in the cache. The glyphs in the cache are rendered with subpixel precision determined by the scale. Update all callers to pass a scale factor according to the window scale. This lets us render crisp glyphs on hidpi systems.
* gsk: Drop the GskRenderer::scale-factor propertyMatthias Clasen2017-10-284-86/+7
| | | | | | This is can always be obtained from the window that is already associated with the renderer, no need to maintain a separate property for it.
* gsk: Make text nodes more compactMatthias Clasen2017-10-277-28/+49
| | | | | | | The copy of the PangoGlyphString we do here was showing up in some profiles. To avoid it, allocate the PangoGlyphInfo array as part of the node itself. Update all callers to deal with the slight api change required for this.
* vulkan: No need to redefine gl_PerVertexBenjamin Otte2017-10-2422-44/+0
| | | | The compiler has those predefined, so use them.
* vulkan: Delete unused shadersBenjamin Otte2017-10-2412-411/+0
| | | | | These have been renamed to .frag/.vert, apparently the originals weren't deleted.
* Remove unnecessary constEmmanuele Bassi2017-10-232-2/+2
| | | | | | We return a scalar value, so we don't need it to be constant. https://bugzilla.gnome.org/show_bug.cgi?id=789351
* Fix compiler warningsMatthias Clasen2017-10-211-5/+5
| | | | I overlooked these when I recently did the render node api changes.
* Remove some outdated informationMatthias Clasen2017-10-201-4/+1
| | | | | Render nodes don't have transformations, currently. Only transform nodes do.
* Tweak transform node apisMatthias Clasen2017-10-204-13/+11
| | | | | | Rename the getter to follow the peek naming scheme. Update all callers.
* gsk: Tweak text node apisMatthias Clasen2017-10-203-18/+18
| | | | | | Rename getters to follow the peek naming pattern. Update all callers.
* gsk: Tweak cairo node apisMatthias Clasen2017-10-205-19/+11
| | | | | | | | Rename the surface getter to peek, following other render node getters, and make the surface-based constructor private, since it is not something we want to encourage. Update all callers.
* Make render node getter publicMatthias Clasen2017-10-202-119/+159
| | | | Keeping these private does not really buy us anything.
* Avoid super-luminous pixelsMatthias Clasen2017-10-194-2/+1
| | | | | | The color-matrix shader was creating pixels with r,g,b > a in some cases, which leads to unexpected test failures. In particular this as visible the opacity render node test for opacity 0.
* rendernode: Don't leak mem_surfaceTimm Bäder2017-10-101-10/+12
|
* Fix blendmode shaderMatthias Clasen2017-10-084-98/+106
| | | | My reading of the spec formulas was imperfect.
* Revise coordinate handling for blend nodesMatthias Clasen2017-10-081-2/+12
| | | | | This is the same change that was applied to cross-fade nodes.
* Revise the coordinate handling one more timeMatthias Clasen2017-10-081-2/+12
| | | | | This makes the new reftests pass and hopefully does not break other things.
* vulkan: Fix cross-fade node coordinatesMatthias Clasen2017-10-081-2/+2
| | | | This is the same fix as was just committed for blendmode nodes.
* vulkan: Fix blendmode coordinate handlingMatthias Clasen2017-10-081-2/+2
| | | | | | | We were node handling coordinates correctly when dealing with differently sized child nodes in a blendmode node. This was showing up in the gtk4-demo css blendmode example, for blendmodes other than normal.
* vulkan: Fix repeat node coordinatesMatthias Clasen2017-10-081-3/+12
| | | | | | We were not treating non-trivial child bounds right at all. This was visible in the css blendmode cmyk example in gtk4-demo, for the normal blendmode.
* gsk: Move gsk_cairo_node_new_for_surface into public APIUmang Jain2017-10-082-1/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=788534
* gsk: Fix serialization of cairo nodeUmang Jain2017-10-081-3/+25
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=788534
* gskrenderer: Make the window property not constructMatthias Clasen2017-10-061-2/+1
| | | | | We never set this, since it is assigned as a side-effect of realizing the renderer. Make this a plain readonly property.
* build: Enable -Wswitch-enum and -Wswitch-defaultBenjamin Otte2017-10-064-2/+32
| | | | | | | | | | | | | | | | | | | This patch makes that work using 1 of 2 options: 1. Add all missing enums to the switch statement or 2. Cast the switch argument to a uint to avoid having to do that (mostly for GdkEventType). I even found a bug while doing that: clearing a GtkImage with a surface did not notify thae surface property. The reason for enabling this flag even though it is tedious at times is that it is very useful when adding values to an enum, because it makes GTK immediately warn about all the switch statements where this enum is relevant. And I expect changes to enums to be frequent during the GTK4 development cycle.
* build: Don't turn off critical warningsBenjamin Otte2017-10-061-8/+8
| | | | | | | | -Wint-conversion is important because it checks casts from ints to pointers. -Wdiscarded-qualifiers is important to catch cases where we don't strings when we should.
* Clip intermediate texturesMatthias Clasen2017-10-018-123/+197
| | | | | | | | | | | | | | | | | | In some cases, we were creating gigantic intermediate textures only to clip out a small section afterwards (e.g. in the listbox example in gtk4-demo). This is wasteful if we apply effects on the texture, such as blur or color-matrix. So, clip the dimensions of the intermediate texture with the current clip. To make this feasible, we move the texture coordinate computation out of the pipeline setup functions into the node_as_texture function where this clipping happens. One extra complication we encounter is that the node might get clipped away completely. Since Vulkan does not allow to create empty images, we bail out in this case and not draw anything. With these changes, the listbox example in gtk4-demo goes from 32M pixels of intermediate texture to 320000.
* Add a forgotten renameMatthias Clasen2017-09-301-3/+3
| | | | | When I renamed blend to texture, I overlooked that the color text pipeline also uses this shader. Fix it.
* Reshuffle things a little bitMatthias Clasen2017-09-303-41/+24
| | | | | | | | | | Instead of having a function with lots of arguments in GskVulkanRender that we call from GskVulkanRenderPass which then just calls back into GskVulkanRenderPass, just create the new render pass object locally, and an api to add it to the list that GskVulkanRender keeps. This makes it a lot easier to preserve all the relevant parameters from the parent render pass.
* Small simplificationMatthias Clasen2017-09-301-9/+6
| | | | | Just keep the viewport as a graphene_rect_t, we don't need to use the Vulkan type here.
* vulkan: Add a counter for intermediate texturesMatthias Clasen2017-09-302-0/+15
| | | | | Count how many pixels of intermediate textures we create. If we can count it, we can optimize it.
* CosmeticsMatthias Clasen2017-09-301-11/+15
| | | | Factor out a helper function.
* Fix a doc commentMatthias Clasen2017-09-301-1/+3
| | | | It was missing a return.
* Support repeat nodes in vulkanMatthias Clasen2017-09-291-5/+51
| | | | We can use the texture pipeline for this, with a repeating sampler.
* vulkan: Add a repeating samplerMatthias Clasen2017-09-293-9/+35
| | | | None of the render ops use it, yet.
* vulkan: Move sampler creation downMatthias Clasen2017-09-293-52/+72
| | | | This is in preparation of allowing multiple samplers.
* vulkan: Rename blend pipeline to textureMatthias Clasen2017-09-2919-178/+178
| | | | | This is what it does, and the name blend is easily confused with blend-mode.
* vulkan: Allow to control scaling in the blend pipelineMatthias Clasen2017-09-293-6/+9
| | | | | | Pass in a second rect that defines the size of the texture. Update the sole caller to pass in the same rect, for unchanged behavior.
* vulkan: Fix setup for dependent render passesMatthias Clasen2017-09-294-12/+29
| | | | We were not correctly preserving the modelview transform.
* gsk: Fix a typoMatthias Clasen2017-09-281-1/+1
| | | | | Repeating linear gradient nodes share most of the implementation with linear gradient nodes, but they shouldn't share the class name.
* gsk: remove gsk_blend_node_get_blend_mode from public apiMatthias Clasen2017-09-282-4/+1
| | | | | We don't have any other such getters in the public api at this point, so leave this one out as well.
* vulkan: Measure gpu timeMatthias Clasen2017-09-282-0/+16
| | | | | | Since this value is only meaningful if we wait for the rendering to end, we only keep this timer if GSK_RENDERING_MODE=sync is enabled.
* gsk: Change the profiler setupMatthias Clasen2017-09-281-8/+0
| | | | | | Move away from the idea of intra-frame sampling, since we only push samples once per frame, anyway. Instead, make the profiler keep a rolling average of the last n frames.
* gsk: Redo the sampling in the profilerMatthias Clasen2017-09-281-11/+25
| | | | | | Reset the min/max/average counters before calculating, and only print the values if we have samples. In addition, print the number of samples.
* gsk: Add a profile counter for vulkan render passesMatthias Clasen2017-09-282-0/+18
| | | | This is interesting now that we have multiple render passes.