RESOLVED FIXED 80121
[BlackBerry] Upstream Texture and TextureCache
https://bugs.webkit.org/show_bug.cgi?id=80121
Summary [BlackBerry] Upstream Texture and TextureCache
Robin Cao
Reported 2012-03-02 00:50:16 PST
Class Texture encapsulates an OpenGL texture, while TextureCache maintains a LRU cache for all OpenGL textures.
Attachments
patch (29.83 KB, patch)
2012-03-02 01:58 PST, Robin Cao
no flags
updated patch (29.64 KB, patch)
2012-03-05 02:23 PST, Robin Cao
no flags
patch-for-landing (29.64 KB, patch)
2012-03-06 22:27 PST, Robin Cao
no flags
Robin Cao
Comment 1 2012-03-02 01:58:23 PST
Rob Buis
Comment 2 2012-03-04 16:14:10 PST
Comment on attachment 129847 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=129847&action=review Looks good overall, but can be improved some more. > Source/WebCore/platform/graphics/blackberry/Texture.h:24 > +#include "Color.h" A forward reference could be enough. > Source/WebCore/platform/graphics/blackberry/Texture.h:28 > +#include <SkBitmap.h> Ditto. > Source/WebCore/platform/graphics/blackberry/Texture.h:50 > + } I think that this would be clearer with an enum. So you could do Texture::create(ColorTexture|NormalTexture) or something and only need one create. > Source/WebCore/platform/graphics/blackberry/Texture.h:78 > + // The following method is only called by our dear friend. Ha ha :) Not the best of comments, I think you can remove it without losing anything. > Source/WebCore/platform/graphics/blackberry/Texture.h:79 > + friend class TextureCacheCompositingThread; Usually this is put just under private. > Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp:30 > +static const int defaultMemoryLimit = 64 * 1024 * 1024; // Bytes Comment is a bit short... Maybe // Measured in bytes. > Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp:97 > + int delta = (texture->width() * texture->height() - oldSize.width() * oldSize.height()) * texture->bytesPerPixel(); bytesPerPixel is staic, so could as well use Texturee: bytesPerPixel() to make it consistent > Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.h:77 > + // The following methods are called by Texture class. Is this comment really relevant?
Robin Cao
Comment 3 2012-03-05 02:07:44 PST
(In reply to comment #2) > (From update of attachment 129847 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=129847&action=review > > Looks good overall, but can be improved some more. > > > Source/WebCore/platform/graphics/blackberry/Texture.h:24 > > +#include "Color.h" > > A forward reference could be enough. > > > Source/WebCore/platform/graphics/blackberry/Texture.h:28 > > +#include <SkBitmap.h> > > Ditto. > Fixed. > > Source/WebCore/platform/graphics/blackberry/Texture.h:50 > > + } > > I think that this would be clearer with an enum. So you could do Texture::create(ColorTexture|NormalTexture) or something and only need one create. > I have merge those two functions into one: Texture::create(bool isColor = false) > > Source/WebCore/platform/graphics/blackberry/Texture.h:78 > > + // The following method is only called by our dear friend. > > Ha ha :) Not the best of comments, I think you can remove it without losing anything. > Removed. > > Source/WebCore/platform/graphics/blackberry/Texture.h:79 > > + friend class TextureCacheCompositingThread; > > Usually this is put just under private. > Fixed. > > Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp:30 > > +static const int defaultMemoryLimit = 64 * 1024 * 1024; // Bytes > > Comment is a bit short... Maybe // Measured in bytes. > Fixed. > > Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp:97 > > + int delta = (texture->width() * texture->height() - oldSize.width() * oldSize.height()) * texture->bytesPerPixel(); > > bytesPerPixel is staic, so could as well use Texturee: bytesPerPixel() to make it consistent > Good catch, fixed. > > Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.h:77 > > + // The following methods are called by Texture class. > > Is this comment really relevant? I agree this can be removed. Will update the patch soon.
Robin Cao
Comment 4 2012-03-05 02:23:31 PST
Created attachment 130084 [details] updated patch
Rob Buis
Comment 5 2012-03-05 06:55:22 PST
Comment on attachment 130084 [details] updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=130084&action=review Looks good, please have a look at my remarks before landing, maybe Leo can set cq+ once that is done. > Source/WebCore/platform/graphics/blackberry/Texture.cpp:83 > + bool subImage = (tile.size() == m_size); Could just be bool subImage = tile.size() == m_size; > Source/WebCore/platform/graphics/blackberry/Texture.cpp:91 > + IntSize yeOldeSize = size; yeOldeSize sounds a bit silly, can just be oldSize. > Source/WebCore/platform/graphics/blackberry/Texture.h:24 > +#include "IntRect.h" Looks like it can be a forward class reference. > Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.h:29 > +#include <memory> Nothing in that file seems needed here?
Robin Cao
Comment 6 2012-03-06 22:22:38 PST
(In reply to comment #5) > (From update of attachment 130084 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=130084&action=review > > > Source/WebCore/platform/graphics/blackberry/Texture.cpp:83 > > + bool subImage = (tile.size() == m_size); > > Could just be bool subImage = tile.size() == m_size; > > > Source/WebCore/platform/graphics/blackberry/Texture.cpp:91 > > + IntSize yeOldeSize = size; > > yeOldeSize sounds a bit silly, can just be oldSize. > > > Source/WebCore/platform/graphics/blackberry/Texture.h:24 > > +#include "IntRect.h" > > Looks like it can be a forward class reference. > > > Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.h:29 > > +#include <memory> > > Nothing in that file seems needed here? Thank you very much! Will fix these before landing.
Robin Cao
Comment 7 2012-03-06 22:27:41 PST
Created attachment 130545 [details] patch-for-landing
WebKit Review Bot
Comment 8 2012-03-07 02:33:17 PST
Comment on attachment 130545 [details] patch-for-landing Clearing flags on attachment: 130545 Committed r110040: <http://trac.webkit.org/changeset/110040>
WebKit Review Bot
Comment 9 2012-03-07 02:33:23 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.