Changeset 86265 in webkit
- Timestamp:
- May 11, 2011 2:06:04 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86264 r86265 1 2011-05-11 Noam Rosenthal <noam.rosenthal@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Texmap][Qt] Upstream texture-mapper changes from Qt's WebKit2 branch 6 https://bugs.webkit.org/show_bug.cgi?id=60439 7 8 Patch 2/12: Add a few functions to the TextureMapper API, allowing: 9 1. an entry/exit point for painting (beginPaint/endPaint) 10 2. Clipping with a matrix, since we use stencil instead of scissors 11 3. Draw a texture directly with an ID 12 4. Remove offset, since we're using real tiling 13 5. numberOfBytes calculation for textures, for memory management 14 15 No new tests. Tests in LayoutTests/compositing test this. 16 17 * platform/graphics/texmap/TextureMapper.h: 18 (WebCore::BitmapTexture::destroy): 19 (WebCore::BitmapTexture::allowOfflineTextureUpload): 20 (WebCore::BitmapTexture::bpp): 21 (WebCore::BitmapTexture::numberOfBytes): 22 (WebCore::TextureMapper::viewportSize): 23 (WebCore::TextureMapper::setViewportSize): 24 (WebCore::TextureMapper::allowPartialUpdates): 25 (WebCore::TextureMapper::isOpenGLBacked): 26 (WebCore::TextureMapper::setTransform): 27 (WebCore::TextureMapper::transform): 28 (WebCore::TextureMapper::beginPainting): 29 (WebCore::TextureMapper::endPainting): 30 1 31 2011-05-11 Noam Rosenthal <noam.rosenthal@nokia.com> 2 32 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h
r81230 r86265 31 31 #include "IntRect.h" 32 32 #include "IntSize.h" 33 #include "TextureMapperPlatformLayer.h" 33 34 #include "TransformationMatrix.h" 34 35 #include <wtf/UnusedParam.h> … … 48 49 BitmapTexture() : m_lockCount(0) {} 49 50 virtual ~BitmapTexture() { } 51 virtual void destroy() { } 50 52 51 53 virtual bool allowOfflineTextureUpload() const { return false; } 52 virtual void destroy() = 0;53 54 virtual IntSize size() const = 0; 55 virtual int bpp() const { return 32; } 54 56 virtual bool isValid() const = 0; 55 57 virtual void reset(const IntSize& size, bool opaque = false) … … 76 78 inline bool isLocked() { return m_lockCount; } 77 79 inline IntSize contentSize() const { return m_contentSize; } 78 inline void setOffset(const IntPoint& o) { m_offset = o; } 79 inline IntPoint offset() const { return m_offset; } 80 inline int numberOfBytes() const { return size().width() * size().height() * bpp() >> 3; } 80 81 81 82 protected: 82 83 private:84 83 int m_lockCount; 85 84 IntSize m_contentSize; 86 85 bool m_isOpaque; 87 IntPoint m_offset;88 86 }; 89 87 … … 97 95 virtual ~TextureMapper() { } 98 96 99 virtual void drawTexture(const BitmapTexture& texture, const IntRect& target, const TransformationMatrix& matrix = TransformationMatrix(), float opacity = 1.0f, const BitmapTexture* maskTexture = 0) = 0;97 virtual void drawTexture(const BitmapTexture&, const FloatRect& target, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0f, const BitmapTexture* maskTexture = 0) = 0; 100 98 101 99 // makes a surface the target for the following drawTexture calls. 102 100 virtual void bindSurface(BitmapTexture* surface) = 0; 103 virtual void paintToTarget(const BitmapTexture& texture, const IntSize&, const TransformationMatrix& matrix, float opacity, const IntRect& visibleRect) 104 { 105 UNUSED_PARAM(visibleRect); 106 drawTexture(texture, IntRect(0, 0, texture.contentSize().width(), texture.contentSize().height()), matrix, opacity, 0); 107 } 108 109 virtual void setGraphicsContext(GraphicsContext*) { } 110 virtual void setClip(const IntRect&) = 0; 101 virtual void setGraphicsContext(GraphicsContext*) = 0; 102 virtual GraphicsContext* graphicsContext() = 0; 103 virtual void beginClip(const TransformationMatrix&, const FloatRect&) = 0; 104 virtual void endClip() = 0; 111 105 virtual bool allowSurfaceForRoot() const = 0; 112 106 virtual PassRefPtr<BitmapTexture> createTexture() = 0; 107 IntSize viewportSize() const { return m_viewportSize; } 108 void setViewportSize(const IntSize& s) { m_viewportSize = s; } 113 109 114 110 void setImageInterpolationQuality(InterpolationQuality quality) { m_interpolationQuality = quality; } … … 117 113 InterpolationQuality imageInterpolationQuality() const { return m_interpolationQuality; } 118 114 TextDrawingModeFlags textDrawingMode() const { return m_textDrawingMode; } 115 virtual bool allowPartialUpdates() const { return false; } 116 virtual bool isOpenGLBacked() const { return false; } 119 117 120 void setViewportSize(const IntSize&); 118 void setTransform(const TransformationMatrix& matrix) { m_transform = matrix; } 119 TransformationMatrix transform() const { return m_transform; } 120 121 virtual void beginPainting() { } 122 virtual void endPainting() { } 123 121 124 122 125 protected: … … 129 132 InterpolationQuality m_interpolationQuality; 130 133 TextDrawingModeFlags m_textDrawingMode; 134 TransformationMatrix m_transform; 135 IntSize m_viewportSize; 131 136 }; 132 137
Note: See TracChangeset
for help on using the changeset viewer.