Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-03-19 02:36:07 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-03-19 02:37:30 +0300
commit7fed213ba40d6f36282b09245ea459b22d4f6c5b (patch)
tree8538ed2d0723684af69c5dd9897cbc7547b478cb /source/blender/draw/engines
parent356073c13e16489ba13f3988478ec0749af9fdf1 (diff)
Revert "Compositor: Support backdrop offset for the Viewer node"
This reverts commit 33409f9f1cd42e899f2706fe7878e5e89b50d617, as it breaks panning in the image editor. Fixes T96543
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/image/image_drawing_mode.hh1
-rw-r--r--source/blender/draw/engines/image/image_engine.cc7
-rw-r--r--source/blender/draw/engines/image/image_instance_data.hh2
-rw-r--r--source/blender/draw/engines/image/image_space.hh1
-rw-r--r--source/blender/draw/engines/image/image_space_image.hh3
-rw-r--r--source/blender/draw/engines/image/image_space_node.hh9
6 files changed, 9 insertions, 14 deletions
diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh b/source/blender/draw/engines/image/image_drawing_mode.hh
index af3ec24d085..46482ab6668 100644
--- a/source/blender/draw/engines/image/image_drawing_mode.hh
+++ b/source/blender/draw/engines/image/image_drawing_mode.hh
@@ -129,6 +129,7 @@ template<typename TextureMethod> class ScreenSpaceDrawingMode : public AbstractD
{
GPUShader *shader = IMAGE_shader_depth_get();
DRWShadingGroup *shgrp = DRW_shgroup_create(shader, instance_data.passes.depth_pass);
+
float image_mat[4][4];
unit_m4(image_mat);
diff --git a/source/blender/draw/engines/image/image_engine.cc b/source/blender/draw/engines/image/image_engine.cc
index 09efaea3e71..e972d21cda4 100644
--- a/source/blender/draw/engines/image/image_engine.cc
+++ b/source/blender/draw/engines/image/image_engine.cc
@@ -99,11 +99,8 @@ class ImageEngine {
/* Setup the matrix to go from screen UV coordinates to UV texture space coordinates. */
float image_resolution[2] = {image_buffer ? image_buffer->x : 1024.0f,
image_buffer ? image_buffer->y : 1024.0f};
- float image_display_offset[2] = {(float)instance_data->image->display_offset_x,
- (float)instance_data->image->display_offset_y};
- space->init_ss_to_texture_matrix(draw_ctx->region,
- image_display_offset,
- image_resolution, instance_data->ss_to_texture);
+ space->init_ss_to_texture_matrix(
+ draw_ctx->region, image_resolution, instance_data->ss_to_texture);
const Scene *scene = DRW_context_state_get()->scene;
instance_data->sh_params.update(space.get(), scene, instance_data->image, image_buffer);
diff --git a/source/blender/draw/engines/image/image_instance_data.hh b/source/blender/draw/engines/image/image_instance_data.hh
index 02ca86312c6..682b93a80b3 100644
--- a/source/blender/draw/engines/image/image_instance_data.hh
+++ b/source/blender/draw/engines/image/image_instance_data.hh
@@ -21,7 +21,7 @@
/**
* \brief max allowed textures to use by the ScreenSpaceDrawingMode.
*
- * 1 texture is used to reduce uploading screen space textures when translating the image.
+ * 4 textures are used to reduce uploading screen space textures when translating the image.
*/
constexpr int SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN = 1;
diff --git a/source/blender/draw/engines/image/image_space.hh b/source/blender/draw/engines/image/image_space.hh
index a2f923a7118..7a11d14b567 100644
--- a/source/blender/draw/engines/image/image_space.hh
+++ b/source/blender/draw/engines/image/image_space.hh
@@ -77,7 +77,6 @@ class AbstractSpaceAccessor {
* (0..1) to texture space UV coordinates.
*/
virtual void init_ss_to_texture_matrix(const ARegion *region,
- const float image_display_offset[2],
const float image_resolution[2],
float r_uv_to_texture[4][4]) const = 0;
diff --git a/source/blender/draw/engines/image/image_space_image.hh b/source/blender/draw/engines/image/image_space_image.hh
index 264129e0728..40aa117514c 100644
--- a/source/blender/draw/engines/image/image_space_image.hh
+++ b/source/blender/draw/engines/image/image_space_image.hh
@@ -148,8 +148,7 @@ class SpaceImageAccessor : public AbstractSpaceAccessor {
}
void init_ss_to_texture_matrix(const ARegion *region,
- const float image_display_offset[2],
- const float image_resolution[2],
+ const float UNUSED(image_resolution[2]),
float r_uv_to_texture[4][4]) const override
{
unit_m4(r_uv_to_texture);
diff --git a/source/blender/draw/engines/image/image_space_node.hh b/source/blender/draw/engines/image/image_space_node.hh
index 4057f7b78cf..6f38dcb86aa 100644
--- a/source/blender/draw/engines/image/image_space_node.hh
+++ b/source/blender/draw/engines/image/image_space_node.hh
@@ -99,7 +99,6 @@ class SpaceNodeAccessor : public AbstractSpaceAccessor {
* screen.
*/
void init_ss_to_texture_matrix(const ARegion *region,
- const float image_display_offset[2],
const float image_resolution[2],
float r_uv_to_texture[4][4]) const override
{
@@ -108,10 +107,10 @@ class SpaceNodeAccessor : public AbstractSpaceAccessor {
mul_v2_v2fl(display_resolution, image_resolution, snode->zoom);
const float scale_x = display_resolution[0] / region->winx;
const float scale_y = display_resolution[1] / region->winy;
- const float translate_x = ((region->winx - display_resolution[0]) * 0.5f + snode->xof + image_display_offset[0]) /
- region->winx ;
- const float translate_y = ((region->winy - display_resolution[1]) * 0.5f + snode->yof + image_display_offset[1]) /
- region->winy;
+ const float translate_x = ((region->winx - display_resolution[0]) * 0.5f + snode->xof) /
+ region->winx;
+ const float translate_y = ((region->winy - display_resolution[1]) * 0.5f + snode->yof) /
+ region->winy;
r_uv_to_texture[0][0] = scale_x;
r_uv_to_texture[1][1] = scale_y;