WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
100706
[TexMap] Remove unused textures in the texture pool.
https://bugs.webkit.org/show_bug.cgi?id=100706
Summary
[TexMap] Remove unused textures in the texture pool.
Dongseong Hwang
Reported
2012-10-29 15:25:13 PDT
Previously, we did not remove entries in the texture pool of TextureMapper. The texture pool is destroyed when TextureMapper is destroyed. It means the texture pool consumed texture memory until its destruction. This patch removes entries on endPainting() if the entries were unused in this frame: between startPainting() and endPainting().
Attachments
Patch
(8.85 KB, patch)
2012-10-29 15:30 PDT
,
Dongseong Hwang
no flags
Details
Formatted Diff
Diff
Patch
(8.89 KB, patch)
2012-10-29 15:39 PDT
,
Dongseong Hwang
no flags
Details
Formatted Diff
Diff
Patch
(8.14 KB, patch)
2012-10-30 19:50 PDT
,
Dongseong Hwang
no flags
Details
Formatted Diff
Diff
Patch
(8.19 KB, patch)
2012-11-02 20:16 PDT
,
Dongseong Hwang
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Dongseong Hwang
Comment 1
2012-10-29 15:30:35 PDT
Created
attachment 171324
[details]
Patch
Dongseong Hwang
Comment 2
2012-10-29 15:34:08 PDT
I think removing BitmapTextures is well if they are not used in this single frame. However, I do not think it is the best approach. I need your opinion :)
Noam Rosenthal
Comment 3
2012-10-29 15:38:05 PDT
(In reply to
comment #2
)
> I think removing BitmapTextures is well if they are not used in this single frame. However, I do not think it is the best approach. I need your opinion :)
I don't think we need a full-blown LRU. How about having a timer that removes the texture after a few seconds if it wasn't used again? Something like what we do with UpdateAtlas...
Dongseong Hwang
Comment 4
2012-10-29 15:39:32 PDT
Created
attachment 171326
[details]
Patch
Dongseong Hwang
Comment 5
2012-10-29 15:42:22 PDT
(In reply to
comment #3
)
> (In reply to
comment #2
) > I don't think we need a full-blown LRU. How about having a timer that removes the texture after a few seconds if it wasn't used again? Something like what we do with UpdateAtlas...
Ok, good idea. I'll try :) Do you think what time threshold is proper? The threshold of UpdateAtlas is 3 seconds. const double inactiveSecondsTolerance = 3;
Noam Rosenthal
Comment 6
2012-10-29 15:49:03 PDT
(In reply to
comment #5
)
> (In reply to
comment #3
) > > (In reply to
comment #2
) > > I don't think we need a full-blown LRU. How about having a timer that removes the texture after a few seconds if it wasn't used again? Something like what we do with UpdateAtlas... > > Ok, good idea. I'll try :) > > Do you think what time threshold is proper? The threshold of UpdateAtlas is 3 seconds. > const double inactiveSecondsTolerance = 3;
3 is fine.
Noam Rosenthal
Comment 7
2012-10-30 17:41:29 PDT
Comment on
attachment 171326
[details]
Patch See above comments.
Dongseong Hwang
Comment 8
2012-10-30 19:50:31 PDT
Created
attachment 171570
[details]
Patch
Dongseong Hwang
Comment 9
2012-10-30 19:55:50 PDT
(In reply to
comment #6
)
> 3 is fine.
Yes, It's done. When I read your review, I wanted to remove the code recording used time of BitmapTexture. However, I can not remove the code because all BitmapTextures have one ref conut when release timer fires. We need the recent used time of BitmapTexture to determine which one can be removed. In addition, I move the constructor and destructor of TextureMapper to TextureMapper.cpp because both need concrete BitmapTexturePool definition.
Noam Rosenthal
Comment 10
2012-11-02 11:06:56 PDT
Comment on
attachment 171570
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=171570&action=review
Nice! See comments.
> Source/WebCore/ChangeLog:14 > + Changing cache policy is not testabled in layout tests.
testabled -> testable
> Source/WebCore/platform/graphics/texmap/TextureMapper.cpp:36 > + inline void use() { m_usedTime = monotonicallyIncreasingTime(); }
use -> markUsed
> Source/WebCore/platform/graphics/texmap/TextureMapper.cpp:37 > + inline static bool compareLRU(const BitmapTexturePoolEntry& a, const BitmapTexturePoolEntry& b)
inline doesn't help you when you use it as a predicate. Also, this should be called compareTimeLastUsed
> Source/WebCore/platform/graphics/texmap/TextureMapper.cpp:43 > + double m_usedTime;
m_timeLastUsed
Dongseong Hwang
Comment 11
2012-11-02 20:16:18 PDT
Created
attachment 172199
[details]
Patch
Dongseong Hwang
Comment 12
2012-11-02 20:16:54 PDT
(In reply to
comment #10
)
> (From update of
attachment 171570
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=171570&action=review
> > Nice! See comments. >
Thanks for review!
> testabled -> testable > use -> markUsed > m_timeLastUsed
All done.
WebKit Review Bot
Comment 13
2012-11-06 07:12:46 PST
Comment on
attachment 172199
[details]
Patch Clearing flags on attachment: 172199 Committed
r133601
: <
http://trac.webkit.org/changeset/133601
>
WebKit Review Bot
Comment 14
2012-11-06 07:12:50 PST
All reviewed patches have been landed. Closing bug.
Csaba Osztrogonác
Comment 15
2012-11-06 08:22:32 PST
(In reply to
comment #13
)
> (From update of
attachment 172199
[details]
) > Clearing flags on attachment: 172199 > > Committed
r133601
: <
http://trac.webkit.org/changeset/133601
>
It broke the Qt Windows build: C:\WebKitBuildSlave\szeged-windows-1\qt-windows-32bit-release\build\Source\WebCore\platform\graphics\texmap\TextureMapper.cpp(61) : error C2864: 'WebCore::BitmapTexturePool::s_releaseUnusedSecondsTolerance' : only static const integral data members can be initialized within a class C:\WebKitBuildSlave\szeged-windows-1\qt-windows-32bit-release\build\Source\WebCore\platform\graphics\texmap\TextureMapper.cpp(62) : error C2864: 'WebCore::BitmapTexturePool::s_releaseUnusedTexturesTimerInterval' : only static const integral data members can be initialized within a class Could you fix it, please?
Csaba Osztrogonác
Comment 16
2012-11-06 13:16:48 PST
ping?
Noam Rosenthal
Comment 17
2012-11-06 14:12:46 PST
I think it's still pretty early in Korea. If we can't wait for Dongsung, feel free to roll out.
Dongseong Hwang
Comment 18
2012-11-06 14:49:11 PST
(In reply to
comment #17
)
> I think it's still pretty early in Korea. If we can't wait for Dongsung, feel free to roll out.
Sorry. I'm here, and I'll fix immediately!
Dongseong Hwang
Comment 19
2012-11-06 15:52:26 PST
(In reply to
comment #18
)
> I'm here, and I'll fix immediately!
I filed
Bug 101404
and posted a patch. Additionally, if you are in CA, your time - 8 is Korea time :)
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug