Changeset 148129 in webkit
- Timestamp:
- Apr 10, 2013 12:56:23 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 17 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148128 r148129 1 2013-04-10 Arvid Nilsson <anilsson@rim.com> 2 3 [BlackBerry] Rename BlackBerry specific Texture class 4 https://bugs.webkit.org/show_bug.cgi?id=95781 5 6 Reviewed by Rob Buis. 7 8 Texture was a bit too generic and prone to name conflicts. Renamed it 9 to LayerTexture. 10 11 No change in behavior, no new tests. 12 13 PR 322882 14 15 * PlatformBlackBerry.cmake: 16 * platform/graphics/blackberry/LayerCompositingThread.cpp: 17 (WebCore::LayerCompositingThread::drawSurface): 18 (WebCore::LayerCompositingThread::contentsTexture): 19 * platform/graphics/blackberry/LayerCompositingThread.h: 20 (LayerCompositingThread): 21 * platform/graphics/blackberry/LayerCompositingThreadClient.h: 22 (WebCore): 23 (WebCore::LayerCompositingThreadClient::contentsTexture): 24 * platform/graphics/blackberry/LayerFilterRenderer.cpp: 25 (WebCore::LayerFilterRenderer::applyActions): 26 * platform/graphics/blackberry/LayerFilterRenderer.h: 27 (LayerFilterRenderer): 28 * platform/graphics/blackberry/LayerRendererSurface.h: 29 (WebCore::LayerRendererSurface::texture): 30 (LayerRendererSurface): 31 * platform/graphics/blackberry/LayerTexture.cpp: Renamed from Source/WebCore/platform/graphics/blackberry/Texture.cpp. 32 (WebCore): 33 (WebCore::LayerTexture::LayerTexture): 34 (WebCore::LayerTexture::~LayerTexture): 35 (WebCore::LayerTexture::updateContents): 36 (WebCore::LayerTexture::setContentsToColor): 37 (WebCore::LayerTexture::protect): 38 * platform/graphics/blackberry/LayerTexture.h: Renamed from Source/WebCore/platform/graphics/blackberry/Texture.h. 39 (WebCore): 40 (LayerTexture): 41 (WebCore::LayerTexture::create): 42 (WebCore::LayerTexture::textureId): 43 (WebCore::LayerTexture::isDirty): 44 (WebCore::LayerTexture::hasTexture): 45 (WebCore::LayerTexture::isColor): 46 (WebCore::LayerTexture::isOpaque): 47 (WebCore::LayerTexture::isProtected): 48 (WebCore::LayerTexture::protect): 49 (WebCore::LayerTexture::unprotect): 50 (WebCore::LayerTexture::size): 51 (WebCore::LayerTexture::width): 52 (WebCore::LayerTexture::height): 53 (WebCore::LayerTexture::bytesPerPixel): 54 (WebCore::LayerTexture::sizeInBytes): 55 (WebCore::LayerTexture::setTextureId): 56 (WebCore::LayerTexture::setSize): 57 * platform/graphics/blackberry/LayerTile.cpp: 58 (WebCore::LayerTile::setContents): 59 (WebCore::LayerTile::updateContents): 60 (WebCore::LayerTile::setTexture): 61 * platform/graphics/blackberry/LayerTile.h: 62 (WebCore::LayerTile::texture): 63 (LayerTile): 64 * platform/graphics/blackberry/LayerTiler.cpp: 65 (WebCore::LayerTiler::drawTile): 66 (WebCore::LayerTiler::contentsTexture): 67 * platform/graphics/blackberry/LayerTiler.h: 68 (LayerTiler): 69 (WebCore::LayerTiler::TextureJob::TextureJob): 70 (WebCore::LayerTiler::TextureJob::setContents): 71 (WebCore::LayerTiler::TextureJob::updateContents): 72 (TextureJob): 73 * platform/graphics/blackberry/TextureCacheCompositingThread.cpp: 74 (WebCore::TextureProtector::TextureProtector): 75 (TextureProtector): 76 (WebCore::TextureCacheCompositingThread::allocateTextureId): 77 (WebCore::freeTextureId): 78 (WebCore::TextureCacheCompositingThread::textureResized): 79 (WebCore::TextureCacheCompositingThread::textureSizeInBytesChanged): 80 (WebCore::TextureCacheCompositingThread::textureDestroyed): 81 (WebCore::TextureCacheCompositingThread::install): 82 (WebCore::TextureCacheCompositingThread::resizeTexture): 83 (WebCore::TextureCacheCompositingThread::evict): 84 (WebCore::TextureCacheCompositingThread::textureAccessed): 85 (WebCore::TextureCacheCompositingThread::prune): 86 (WebCore::TextureCacheCompositingThread::textureForTiledContents): 87 (WebCore::TextureCacheCompositingThread::textureForColor): 88 (WebCore::TextureCacheCompositingThread::updateContents): 89 * platform/graphics/blackberry/TextureCacheCompositingThread.h: 90 (WebCore::TextureCacheCompositingThread::createTexture): 91 (TextureCacheCompositingThread): 92 (WebCore::TextureCacheCompositingThread::ZombieTexture::ZombieTexture): 93 (ZombieTexture): 94 1 95 2013-04-10 Andreas Kling <akling@apple.com> 2 96 -
trunk/Source/WebCore/PlatformBlackBerry.cmake
r147883 r148129 243 243 ${WEBCORE_DIR}/platform/graphics/blackberry/LayerRenderer.cpp 244 244 ${WEBCORE_DIR}/platform/graphics/blackberry/LayerRendererSurface.cpp 245 ${WEBCORE_DIR}/platform/graphics/blackberry/LayerTexture.cpp 245 246 ${WEBCORE_DIR}/platform/graphics/blackberry/LayerTile.cpp 246 247 ${WEBCORE_DIR}/platform/graphics/blackberry/LayerTiler.cpp 247 248 ${WEBCORE_DIR}/platform/graphics/blackberry/LayerWebKitThread.cpp 248 249 ${WEBCORE_DIR}/platform/graphics/blackberry/PluginLayerWebKitThread.cpp 249 ${WEBCORE_DIR}/platform/graphics/blackberry/Texture.cpp250 250 ${WEBCORE_DIR}/platform/graphics/blackberry/TextureCacheCompositingThread.cpp 251 251 ${WEBCORE_DIR}/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp -
trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp
r146906 r148129 273 273 274 274 if (m_layerRenderer->layerAlreadyOnSurface(this)) { 275 Texture* surfaceTexture = layerRendererSurface()->texture();275 LayerTexture* surfaceTexture = layerRendererSurface()->texture(); 276 276 if (!surfaceTexture) { 277 277 ASSERT_NOT_REACHED(); … … 287 287 288 288 if (mask) { 289 Texture* maskTexture = mask->contentsTexture();289 LayerTexture* maskTexture = mask->contentsTexture(); 290 290 if (maskTexture) { 291 291 GLuint maskTexID = reinterpret_cast<GLuint>(platformBufferHandle(maskTexture->textureId())); … … 426 426 } 427 427 428 Texture* LayerCompositingThread::contentsTexture()428 LayerTexture* LayerCompositingThread::contentsTexture() 429 429 { 430 430 if (m_client) -
trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h
r146058 r148129 150 150 bool updateAnimations(double currentTime); 151 151 void updateTextureContentsIfNeeded(); 152 Texture* contentsTexture();152 LayerTexture* contentsTexture(); 153 153 154 154 const LayerCompositingThread* rootLayer() const; -
trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThreadClient.h
r144465 r148129 32 32 33 33 class LayerCompositingThread; 34 class Texture;34 class LayerTexture; 35 35 36 36 class LayerCompositingThreadClient { … … 47 47 48 48 // Optional. Allows layers to serve as a mask for other layers 49 virtual Texture* contentsTexture(LayerCompositingThread*) { return 0; }49 virtual LayerTexture* contentsTexture(LayerCompositingThread*) { return 0; } 50 50 51 51 // Optional. Allow the layer to commit thread sensitive content during a sync point -
trunk/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.cpp
r144465 r148129 720 720 721 721 if (actions[i]->shouldPushSnapshot()) { 722 RefPtr< Texture> currentTexture = (!(i % 2) ? surface->texture() : m_texture);722 RefPtr<LayerTexture> currentTexture = (!(i % 2) ? surface->texture() : m_texture); 723 723 GLuint texid = reinterpret_cast<GLuint>(platformBufferHandle(currentTexture->textureId())); 724 724 if (!texid) { -
trunk/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.h
r127040 r148129 24 24 #include "IntRect.h" 25 25 #include "LayerData.h" 26 #include " Texture.h"26 #include "LayerTexture.h" 27 27 #include "TransformationMatrix.h" 28 28 … … 257 257 258 258 // Textures for playing ping-pong - see note in applyActions() 259 RefPtr< Texture> m_texture;260 RefPtr< Texture> m_snapshotTexture;259 RefPtr<LayerTexture> m_texture; 260 RefPtr<LayerTexture> m_snapshotTexture; 261 261 262 262 friend class LayerFilterRendererAction; -
trunk/Source/WebCore/platform/graphics/blackberry/LayerRendererSurface.h
r109809 r148129 25 25 #include "IntRect.h" 26 26 #include "IntSize.h" 27 #include " Texture.h"27 #include "LayerTexture.h" 28 28 #include "TransformationMatrix.h" 29 29 … … 55 55 bool ensureTexture(); 56 56 void releaseTexture(); 57 Texture* texture() const { return m_texture.get(); }57 LayerTexture* texture() const { return m_texture.get(); } 58 58 59 59 float drawOpacity() { return m_opacity; } … … 61 61 62 62 private: 63 RefPtr< Texture> m_texture;63 RefPtr<LayerTexture> m_texture; 64 64 65 65 FloatRect m_contentRect; -
trunk/Source/WebCore/platform/graphics/blackberry/LayerTexture.cpp
r148128 r148129 18 18 19 19 #include "config.h" 20 #include " Texture.h"20 #include "LayerTexture.h" 21 21 22 22 #if USE(ACCELERATED_COMPOSITING) … … 33 33 namespace WebCore { 34 34 35 Texture::Texture(bool isColor)35 LayerTexture::LayerTexture(bool isColor) 36 36 : m_protectionCount(0) 37 37 , m_handle(0) … … 43 43 } 44 44 45 Texture::~Texture()45 LayerTexture::~LayerTexture() 46 46 { 47 47 textureCacheCompositingThread()->textureDestroyed(this); 48 48 } 49 49 50 void Texture::updateContents(constTexture::HostType& contents, const IntRect& dirtyRect, const IntRect& tile, bool isOpaque)50 void LayerTexture::updateContents(const LayerTexture::HostType& contents, const IntRect& dirtyRect, const IntRect& tile, bool isOpaque) 51 51 { 52 52 if (m_handle) … … 58 58 } 59 59 60 void Texture::setContentsToColor(const Color& color)60 void LayerTexture::setContentsToColor(const Color& color) 61 61 { 62 62 m_isOpaque = !color.hasAlpha(); … … 78 78 } 79 79 80 bool Texture::protect(const IntSize& size, BlackBerry::Platform::Graphics::BufferType type)80 bool LayerTexture::protect(const IntSize& size, BlackBerry::Platform::Graphics::BufferType type) 81 81 { 82 82 if (!hasTexture()) { -
trunk/Source/WebCore/platform/graphics/blackberry/LayerTexture.h
r148128 r148129 17 17 */ 18 18 19 #ifndef Texture_h20 #define Texture_h19 #ifndef LayerTexture_h 20 #define LayerTexture_h 21 21 22 22 #if USE(ACCELERATED_COMPOSITING) … … 34 34 class TextureCacheCompositingThread; 35 35 36 // Texture encapsulates a volatile texture - at any time, the underlying OpenGL36 // LayerTexture encapsulates a volatile texture - at any time, the underlying OpenGL 37 37 // texture may be deleted by the TextureCacheCompositingThread. The user must 38 // check using Texture::isDirty() immediately before using it, every time.39 // The only way to prevent eviction this is to call Texture::protect().38 // check using LayerTexture::isDirty() immediately before using it, every time. 39 // The only way to prevent eviction this is to call LayerTexture::protect(). 40 40 // If the texture isDirty(), you must updateContents() before you can use it. 41 class Texture : public RefCounted<Texture> {41 class LayerTexture : public RefCounted<LayerTexture> { 42 42 public: 43 static PassRefPtr< Texture> create(bool isColor = false)43 static PassRefPtr<LayerTexture> create(bool isColor = false) 44 44 { 45 return adoptRef(new Texture(isColor));45 return adoptRef(new LayerTexture(isColor)); 46 46 } 47 47 48 ~ Texture();48 ~LayerTexture(); 49 49 50 50 typedef BlackBerry::Platform::Graphics::Buffer* GpuHandle; … … 78 78 friend class TextureCacheCompositingThread; 79 79 80 Texture(bool isColor = false);80 LayerTexture(bool isColor = false); 81 81 void setTextureId(GpuHandle id) 82 82 { … … 104 104 #endif // USE(ACCELERATED_COMPOSITING) 105 105 106 #endif // Texture_h106 #endif // LayerTexture_h -
trunk/Source/WebCore/platform/graphics/blackberry/LayerTile.cpp
r144465 r148129 40 40 } 41 41 42 void LayerTile::setContents(const Texture::HostType& contents, const IntRect& tileRect, const TileIndex& index, bool isOpaque)42 void LayerTile::setContents(const LayerTexture::HostType& contents, const IntRect& tileRect, const TileIndex& index, bool isOpaque) 43 43 { 44 44 setTexture(textureCacheCompositingThread()->textureForTiledContents(contents, tileRect, index, isOpaque)); … … 50 50 } 51 51 52 void LayerTile::updateContents(const Texture::HostType& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque)52 void LayerTile::updateContents(const LayerTexture::HostType& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque) 53 53 { 54 54 setTexture(textureCacheCompositingThread()->updateContents(m_texture, contents, dirtyRect, tileRect, isOpaque)); … … 78 78 } 79 79 80 void LayerTile::setTexture(PassRefPtr< Texture> texture)80 void LayerTile::setTexture(PassRefPtr<LayerTexture> texture) 81 81 { 82 82 // Clear this flag regardless of the value of the texture parameter. -
trunk/Source/WebCore/platform/graphics/blackberry/LayerTile.h
r144465 r148129 22 22 #if USE(ACCELERATED_COMPOSITING) 23 23 24 #include " Texture.h"24 #include "LayerTexture.h" 25 25 26 26 #include <wtf/RefPtr.h> … … 38 38 ~LayerTile(); 39 39 40 Texture* texture() const { return m_texture.get(); }40 LayerTexture* texture() const { return m_texture.get(); } 41 41 42 42 bool isVisible() const { return m_visible; } … … 47 47 bool hasTexture() const { return m_texture && m_texture->hasTexture(); } 48 48 49 void setContents(const Texture::HostType& contents, const IntRect& tileRect, const TileIndex&, bool isOpaque);49 void setContents(const LayerTexture::HostType& contents, const IntRect& tileRect, const TileIndex&, bool isOpaque); 50 50 void setContentsToColor(const Color&); 51 void updateContents(const Texture::HostType& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque);51 void updateContents(const LayerTexture::HostType& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque); 52 52 void discardContents(); 53 53 … … 65 65 66 66 private: 67 void setTexture(PassRefPtr< Texture>);67 void setTexture(PassRefPtr<LayerTexture>); 68 68 69 69 // Never assign to m_texture directly, use setTexture() above. 70 RefPtr< Texture> m_texture;70 RefPtr<LayerTexture> m_texture; 71 71 bool m_contentsDirty : 1; 72 72 bool m_visible : 1; -
trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp
r145193 r148129 230 230 // FIXME: the zoom preview only works if we don't re-tile the 231 231 // layer. We need to store texture coordinates in 232 // WebCore:: Texture to be able to fix that.232 // WebCore::LayerTexture to be able to fix that. 233 233 if (didResize && !(isZoomJob && wasOneTile && isOneTile)) 234 234 addTextureJob(TextureJob::discardContents(tileRect)); … … 493 493 if (visible) { 494 494 if (tile->hasTexture()) { 495 Texture* texture = tile->texture();495 LayerTexture* texture = tile->texture(); 496 496 textureCacheCompositingThread()->textureAccessed(texture); 497 497 … … 672 672 } 673 673 674 Texture* LayerTiler::contentsTexture(LayerCompositingThread*)674 LayerTexture* LayerTiler::contentsTexture(LayerCompositingThread*) 675 675 { 676 676 ASSERT(m_tiles.size() == 1); -
trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.h
r144465 r148129 68 68 virtual void layerVisibilityChanged(LayerCompositingThread*, bool visible); 69 69 virtual void uploadTexturesIfNeeded(LayerCompositingThread*); 70 virtual Texture* contentsTexture(LayerCompositingThread*);70 virtual LayerTexture* contentsTexture(LayerCompositingThread*); 71 71 virtual void drawTextures(LayerCompositingThread*, double scale, const BlackBerry::Platform::Graphics::GLES2Program&); 72 72 virtual void deleteTextures(LayerCompositingThread*); … … 102 102 } 103 103 104 TextureJob(Type type, const Texture::HostType& contents, const IntRect& dirtyRect, bool isOpaque)104 TextureJob(Type type, const LayerTexture::HostType& contents, const IntRect& dirtyRect, bool isOpaque) 105 105 : m_type(type) 106 106 , m_contents(contents) … … 122 122 } 123 123 124 static TextureJob setContents(const Texture::HostType& contents, const IntRect& contentsRect, bool isOpaque)124 static TextureJob setContents(const LayerTexture::HostType& contents, const IntRect& contentsRect, bool isOpaque) 125 125 { 126 126 return TextureJob(SetContents, contents, contentsRect, isOpaque); 127 127 } 128 128 static TextureJob setContentsToColor(const Color& color, const TileIndex& index) { return TextureJob(SetContentsToColor, color, index); } 129 static TextureJob updateContents(const Texture::HostType& contents, const IntRect& dirtyRect, bool isOpaque) { return TextureJob(UpdateContents, contents, dirtyRect, isOpaque); }129 static TextureJob updateContents(const LayerTexture::HostType& contents, const IntRect& dirtyRect, bool isOpaque) { return TextureJob(UpdateContents, contents, dirtyRect, isOpaque); } 130 130 static TextureJob discardContents(const IntRect& dirtyRect) { return TextureJob(DiscardContents, dirtyRect); } 131 131 static TextureJob resizeContents(const IntSize& newSize) { return TextureJob(ResizeContents, newSize); } … … 135 135 136 136 Type m_type; 137 Texture::HostType m_contents;137 LayerTexture::HostType m_contents; 138 138 bool m_isOpaque; 139 139 IntRect m_dirtyRect; -
trunk/Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.cpp
r144465 r148129 38 38 class TextureProtector { 39 39 public: 40 TextureProtector( Texture* texture)40 TextureProtector(LayerTexture* texture) 41 41 : m_texture(texture) 42 42 { … … 50 50 51 51 private: 52 Texture* m_texture;52 LayerTexture* m_texture; 53 53 }; 54 54 … … 59 59 } 60 60 61 Texture::GpuHandle TextureCacheCompositingThread::allocateTextureId(const IntSize& size, BlackBerry::Platform::Graphics::BufferType type)61 LayerTexture::GpuHandle TextureCacheCompositingThread::allocateTextureId(const IntSize& size, BlackBerry::Platform::Graphics::BufferType type) 62 62 { 63 63 return BlackBerry::Platform::Graphics::createBuffer(size, type); 64 64 } 65 65 66 static void freeTextureId( Texture::GpuHandle id)66 static void freeTextureId(LayerTexture::GpuHandle id) 67 67 { 68 68 BlackBerry::Platform::Graphics::destroyBuffer(id); … … 78 78 } 79 79 80 void TextureCacheCompositingThread::textureResized( Texture* texture, const IntSize& oldSize)81 { 82 int delta = (texture->width() * texture->height() - oldSize.width() * oldSize.height()) * Texture::bytesPerPixel();80 void TextureCacheCompositingThread::textureResized(LayerTexture* texture, const IntSize& oldSize) 81 { 82 int delta = (texture->width() * texture->height() - oldSize.width() * oldSize.height()) * LayerTexture::bytesPerPixel(); 83 83 incMemoryUsage(delta); 84 84 if (delta > 0) … … 86 86 } 87 87 88 void TextureCacheCompositingThread::textureSizeInBytesChanged( Texture*, int delta)88 void TextureCacheCompositingThread::textureSizeInBytesChanged(LayerTexture*, int delta) 89 89 { 90 90 incMemoryUsage(delta); … … 93 93 } 94 94 95 void TextureCacheCompositingThread::textureDestroyed( Texture* texture)95 void TextureCacheCompositingThread::textureDestroyed(LayerTexture* texture) 96 96 { 97 97 if (texture->isColor()) { … … 105 105 } 106 106 107 bool TextureCacheCompositingThread::install( Texture* texture, const IntSize& size, BlackBerry::Platform::Graphics::BufferType type)107 bool TextureCacheCompositingThread::install(LayerTexture* texture, const IntSize& size, BlackBerry::Platform::Graphics::BufferType type) 108 108 { 109 109 if (!texture) … … 111 111 112 112 if (!texture->hasTexture() && !size.isEmpty()) { 113 Texture::GpuHandle textureId = allocateTextureId(size, type);113 LayerTexture::GpuHandle textureId = allocateTextureId(size, type); 114 114 if (!textureId) 115 115 return false; … … 126 126 } 127 127 128 bool TextureCacheCompositingThread::resizeTexture( Texture* texture, const IntSize& size, BlackBerry::Platform::Graphics::BufferType type)128 bool TextureCacheCompositingThread::resizeTexture(LayerTexture* texture, const IntSize& size, BlackBerry::Platform::Graphics::BufferType type) 129 129 { 130 130 IntSize oldSize = texture->size(); 131 131 132 132 // Reallocate the buffer 133 Texture::GpuHandle textureId = allocateTextureId(size, type);133 LayerTexture::GpuHandle textureId = allocateTextureId(size, type); 134 134 if (!textureId) 135 135 return false; … … 147 147 return; 148 148 149 Texture* texture = *it;149 LayerTexture* texture = *it; 150 150 if (texture->hasTexture()) { 151 151 int delta = 0; 152 delta += texture->width() * texture->height() * Texture::bytesPerPixel();152 delta += texture->width() * texture->height() * LayerTexture::bytesPerPixel(); 153 153 delta += texture->sizeInBytes(); 154 154 if (delta) … … 160 160 } 161 161 162 void TextureCacheCompositingThread::textureAccessed( Texture* texture)162 void TextureCacheCompositingThread::textureAccessed(LayerTexture* texture) 163 163 { 164 164 if (texture->isColor()) … … 184 184 bool found = false; 185 185 for (TextureSet::iterator it = m_textures.begin(); it != m_textures.end(); ++it) { 186 Texture* texture = *it;186 LayerTexture* texture = *it; 187 187 if (texture->isProtected() || (texture->size().isEmpty() && !texture->sizeInBytes())) 188 188 continue; … … 210 210 } 211 211 212 PassRefPtr< Texture> TextureCacheCompositingThread::textureForTiledContents(constTexture::HostType& contents, const IntRect& tileRect, const TileIndex& index, bool isOpaque)213 { 214 RefPtr< Texture> texture = createTexture();212 PassRefPtr<LayerTexture> TextureCacheCompositingThread::textureForTiledContents(const LayerTexture::HostType& contents, const IntRect& tileRect, const TileIndex& index, bool isOpaque) 213 { 214 RefPtr<LayerTexture> texture = createTexture(); 215 215 216 216 // Protect newly created texture from being evicted. … … 222 222 } 223 223 224 PassRefPtr< Texture> TextureCacheCompositingThread::textureForColor(const Color& color)224 PassRefPtr<LayerTexture> TextureCacheCompositingThread::textureForColor(const Color& color) 225 225 { 226 226 // Just to make sure we don't get fooled by some malicious web page … … 230 230 231 231 ColorTextureMap::iterator it = m_colors.find(color); 232 RefPtr< Texture> texture;232 RefPtr<LayerTexture> texture; 233 233 if (it == m_colors.end()) { 234 texture = Texture::create(true /* isColor */);234 texture = LayerTexture::create(true /* isColor */); 235 235 #if DEBUG_TEXTURE_MEMORY_USAGE 236 236 fprintf(stderr, "Creating texture 0x%x for color 0x%x\n", texture.get(), color.rgb()); … … 248 248 } 249 249 250 PassRefPtr< Texture> TextureCacheCompositingThread::updateContents(const RefPtr<Texture>& textureIn, constTexture::HostType& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque)251 { 252 RefPtr< Texture> texture(textureIn);250 PassRefPtr<LayerTexture> TextureCacheCompositingThread::updateContents(const RefPtr<LayerTexture>& textureIn, const LayerTexture::HostType& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque) 251 { 252 RefPtr<LayerTexture> texture(textureIn); 253 253 254 254 // If the texture was 0, or needs to transition from a solid color texture to a contents texture, -
trunk/Source/WebCore/platform/graphics/blackberry/TextureCacheCompositingThread.h
r144465 r148129 23 23 24 24 #include "Color.h" 25 #include "LayerTexture.h" 25 26 #include "LayerTileIndex.h" 26 #include "Texture.h"27 27 28 28 #include <BlackBerryPlatformGraphics.h> … … 46 46 47 47 // Creates a new texture managed by this cache. 48 PassRefPtr< Texture> createTexture()48 PassRefPtr<LayerTexture> createTexture() 49 49 { 50 return Texture::create();50 return LayerTexture::create(); 51 51 } 52 52 53 53 // Retrieve a texture from the cache. 54 PassRefPtr< Texture> textureForTiledContents(constTexture::HostType& contents, const IntRect& tileRect, const TileIndex&, bool isOpaque);55 PassRefPtr< Texture> textureForColor(const Color&);54 PassRefPtr<LayerTexture> textureForTiledContents(const LayerTexture::HostType& contents, const IntRect& tileRect, const TileIndex&, bool isOpaque); 55 PassRefPtr<LayerTexture> textureForColor(const Color&); 56 56 57 57 // Update contents of an existing texture, or create a new one if texture is 0. 58 PassRefPtr< Texture> updateContents(const RefPtr<Texture>&, constTexture::HostType& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque);58 PassRefPtr<LayerTexture> updateContents(const RefPtr<LayerTexture>&, const LayerTexture::HostType& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque); 59 59 60 60 size_t memoryUsage() const { return m_memoryUsage; } … … 70 70 71 71 // Update the LRU list. 72 void textureAccessed( Texture*);72 void textureAccessed(LayerTexture*); 73 73 74 74 // Deleting destroyed textures is provided as a separate method, because … … 77 77 void collectGarbage(); 78 78 79 void textureDestroyed( Texture*);80 void textureResized( Texture*, const IntSize& oldSize);81 void textureSizeInBytesChanged( Texture*, int delta);79 void textureDestroyed(LayerTexture*); 80 void textureResized(LayerTexture*, const IntSize& oldSize); 81 void textureSizeInBytesChanged(LayerTexture*, int delta); 82 82 83 83 // Undo the effects of eviction, if possible. 84 bool install( Texture*, const IntSize& textureSize = IntSize(0, 0), BlackBerry::Platform::Graphics::BufferType = BlackBerry::Platform::Graphics::BackedWhenNecessary);85 bool resizeTexture( Texture*, const IntSize& newSize, BlackBerry::Platform::Graphics::BufferType = BlackBerry::Platform::Graphics::BackedWhenNecessary);84 bool install(LayerTexture*, const IntSize& textureSize = IntSize(0, 0), BlackBerry::Platform::Graphics::BufferType = BlackBerry::Platform::Graphics::BackedWhenNecessary); 85 bool resizeTexture(LayerTexture*, const IntSize& newSize, BlackBerry::Platform::Graphics::BufferType = BlackBerry::Platform::Graphics::BackedWhenNecessary); 86 86 87 87 private: 88 88 struct ZombieTexture { 89 explicit ZombieTexture( Texture* texture)89 explicit ZombieTexture(LayerTexture* texture) 90 90 : id(texture->textureId()) 91 91 , size(texture->size()) … … 94 94 } 95 95 96 Texture::GpuHandle id;96 LayerTexture::GpuHandle id; 97 97 IntSize size; 98 98 size_t sizeInBytes; 99 99 }; 100 typedef ListHashSet< Texture* > TextureSet;101 typedef HashMap<TileIndex, RefPtr< Texture> > TextureMap;100 typedef ListHashSet<LayerTexture* > TextureSet; 101 typedef HashMap<TileIndex, RefPtr<LayerTexture> > TextureMap; 102 102 typedef Vector<ZombieTexture> Garbage; 103 103 … … 105 105 ~TextureCacheCompositingThread(); 106 106 107 Texture::GpuHandle allocateTextureId(const IntSize& textureSize, BlackBerry::Platform::Graphics::BufferType);107 LayerTexture::GpuHandle allocateTextureId(const IntSize& textureSize, BlackBerry::Platform::Graphics::BufferType); 108 108 109 109 void incMemoryUsage(int delta) { setMemoryUsage(memoryUsage() + delta); } … … 131 131 static bool isDeletedValue(const Color& value) { return !value.isValid() && value.rgb() == Color::white; } 132 132 }; 133 typedef HashMap<Color, RefPtr< Texture>, ColorHash, ColorHashTraits> ColorTextureMap;133 typedef HashMap<Color, RefPtr<LayerTexture>, ColorHash, ColorHashTraits> ColorTextureMap; 134 134 ColorTextureMap m_colors; 135 135 Garbage m_garbage; -
trunk/Source/WebKit/blackberry/Api/WebOverlay.cpp
r147738 r148129 447 447 } 448 448 449 Texture::HostType textureContents =Texture::HostType();449 LayerTexture::HostType textureContents = LayerTexture::HostType(); 450 450 IntSize textureSize; 451 451 … … 497 497 } 498 498 499 m_texture = Texture::create();499 m_texture = LayerTexture::create(); 500 500 m_texture->protect(IntSize(), BlackBerry::Platform::Graphics::BackedWhenNecessary); 501 501 IntRect bitmapRect(0, 0, textureSize.width(), textureSize.height()); -
trunk/Source/WebKit/blackberry/Api/WebOverlay_p.h
r147740 r148129 24 24 #include "GraphicsLayer.h" 25 25 #include "LayerCompositingThread.h" 26 #include " Texture.h"26 #include "LayerTexture.h" 27 27 #include "WebOverlay.h" 28 28 #include "WebOverlayOverride.h" … … 206 206 private: 207 207 bool m_drawsContent; 208 RefPtr<WebCore:: Texture> m_texture;208 RefPtr<WebCore::LayerTexture> m_texture; 209 209 BlackBerry::Platform::Graphics::TiledImage m_image; 210 210 BlackBerry::Platform::Graphics::TiledImage m_uploadedImage; -
trunk/Source/WebKit/blackberry/ChangeLog
r148123 r148129 1 2013-04-10 Arvid Nilsson <anilsson@rim.com> 2 3 [BlackBerry] Rename BlackBerry specific Texture class 4 https://bugs.webkit.org/show_bug.cgi?id=95781 5 6 Reviewed by Rob Buis. 7 8 Texture was a bit too generic and prone to name conflicts. Renamed it 9 to LayerTexture. 10 11 PR 322882 12 13 * Api/WebOverlay.cpp: 14 (BlackBerry::WebKit::WebOverlayLayerCompositingThreadClient::uploadTexturesIfNeeded): 15 * Api/WebOverlay_p.h: 16 (WebOverlayLayerCompositingThreadClient): 17 1 18 2013-04-08 Anders Carlsson <andersca@apple.com> 2 19
Note: See TracChangeset
for help on using the changeset viewer.