Page MenuHomePhabricator

gl_common: do not draw rect without texture
Needs RevisionPublic

Authored by kimcinoo on Aug 7 2018, 3:57 PM.

Details

Reviewers
Hermet
raster
Summary

If evas_gl_common draws rect without texture,
then unexpected rect shows.
We do not have clear reason to show this rect.
Moreover user could regard this as a problem,
and it actually happened in the real world.

Diff Detail

Repository
rEFL core/efl
Branch
gl_common.do.not.draw.rect
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 7255
Build 6955: arc lint + arc unit
kimcinoo created this revision.Aug 7 2018, 3:57 PM
kimcinoo requested review of this revision.Aug 7 2018, 3:57 PM
raster requested changes to this revision.Aug 7 2018, 5:59 PM
raster added a subscriber: raster.

eh? this looks wrong. if there is no texture assigned to the image, there is nothing to draw, so empty/blank is correct (don't draw anything). this could lead to glitches now where there is something drawn (often white rectangles) where before there was nothing.

This revision now requires changes to proceed.Aug 7 2018, 5:59 PM
Hermet added a comment.Aug 7 2018, 9:46 PM

@raster, This situation is in the image preloading. Both are abnormal situation though but IMHO, engine should not do this unexpected visual result. If unexpected situation(no texture) comes, it's better to leave to users fill there with what color or what bg images (of the this texture content). Apps don't allow this embarrasing rectangle come out. For debuging, we can just print message there.

@raster Hey. Do you mean that the calling evas_gl_common_rect_draw when the im->tex is NULL should make nothing?

raster added a comment.Aug 7 2018, 9:50 PM

what preloading? you mean you re using the async preload? when this is used what should happen is the image is not shown until the preload callback comes in, then it is shown and all is fine. in fact it shouldn't draw if still preloading. it should stall and wait for the load to finish. that's how it used to work.

Hermet added a comment.Aug 8 2018, 5:58 AM

@raster let's forget preloading. Acutally, !tex shouldn't be happened, but let's assume the exception case. Developers will be more embarrassing If something solid color rectangle showed up. Because they more likely to think some obstacle objects(i,e rectangle eo) may be onto the image. Only few core developers who exactly know this exceptional handling in this backend engine could understand but not others. Even I firstly guess somewhere dangling white rectangle, clipper or image objects were there but not this (!tex) case. More than this visual, ERR message is more clear.

@raster I am on the @Hermet's page. When I got this white rectangle issue, it was too embarrassing.
Only after checking line by line and change the smelly context color, finally I could find out and I could reach this destination.
BTW what is the glitches? And do you mean that the calling evas_gl_common_rect_draw when the !tex should make nothing?

raster added a comment.Aug 8 2018, 8:53 PM

let's forget preloading. Acutally, !tex shouldn't be happened

correct. it shouldn't - this is to handle a possible code path that somehow maybe end sup in this situation and then do the least "bad" thing which is to render nothing for that image. and ERR message would be better indeed but ... finding the source of this situation would be very hard as the backtrace will not provide it. but visually for users it would be best to provide the least side-effects that we can. making this draw a big (generally white as most images will have a color of 255 255 255 255) makes things worse.

and can you explain to me what the actual situation was that caused this !tex path to be hit? how did this happen? one path could be a major lack of memory or perhaps image bigger than max texture size? i'd have to check...

@raster I am on the @Hermet's page. When I got this white rectangle issue, it was too embarrassing.

like above. how did you get here? :)

BTW what is the glitches? And do you mean that the calling evas_gl_common_rect_draw when the !tex should make nothing?

i meant like the above. right now nothing will be draw. this patch changes things so a rectangle will draw. images are almost always white solid so the rect will be white solid, thus users will start seeing mystery white rectangles pn their screens and complain - perhaps. i don't see this as a good thing... :(