Changeset 140821 in webkit
- Timestamp:
- Jan 25, 2013 5:50:58 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r140820 r140821 1 2013-01-25 Huang Dongsung <luxtella@company100.net> 2 3 [Texmap] Refactor code related to debug border and repaint count. 4 https://bugs.webkit.org/show_bug.cgi?id=105787 5 6 Reviewed by Noam Rosenthal. 7 8 Currently, TextureMapperBackingStore, CoordinatedBackingStore and 9 GraphicsLayerTextureMapper have duplicated code to draw debug border or 10 repaint count. This patch refactors that all platform layers draw debug 11 border and repaint count in the consistent way: 12 TextureMapper::drawBorder() and TextureMapper::drawRepaintCounter(). 13 14 There are three big changes: 15 1. TextureMapperLayer has the debug visuals like GraphicsLayer. 16 Both debug border and repaint count are called as the debug visuals. 17 2. We use the same color and width to Mac port because we get that info using 18 GraphicsLayer::updateDebugIndicators(). 19 3. Draw borders for background color, backing store and contents layer, 20 while drawing repaint count only for backing store. 21 22 No new tests. This functionality is for debugging, so we cannot test using DRT. 23 24 * platform/graphics/cairo/GraphicsContext3DPrivate.h: 25 * platform/graphics/qt/GraphicsContext3DQt.cpp: 26 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: 27 (WebCore::GraphicsLayerTextureMapper::setShowDebugBorder): 28 (WebCore): 29 (WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter): 30 (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly): 31 (WebCore::GraphicsLayerTextureMapper::updateDebugBorderAndRepaintCountIfNeeded): 32 (WebCore::GraphicsLayerTextureMapper::setDebugBorder): 33 (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded): 34 (WebCore::GraphicsLayerTextureMapper::prepareBackingStore): 35 (WebCore::GraphicsLayerTextureMapper::setRepaintCount): 36 * platform/graphics/texmap/GraphicsLayerTextureMapper.h: 37 (GraphicsLayerTextureMapper): 38 (WebCore::GraphicsLayerTextureMapper::debugBorderColor): 39 (WebCore::GraphicsLayerTextureMapper::debugBorderWidth): 40 * platform/graphics/texmap/TextureMapper.h: 41 * platform/graphics/texmap/TextureMapperBackingStore.cpp: 42 (WebCore::TextureMapperTiledBackingStore::adjustedTransformForRect): 43 (WebCore): 44 (WebCore::TextureMapperTiledBackingStore::paintToTextureMapper): 45 (WebCore::TextureMapperTiledBackingStore::drawBorder): 46 Override TextureMapperPlatformLayer::drawBorder() to draw the border 47 for each tile. 48 (WebCore::TextureMapperTiledBackingStore::drawRepaintCounter): 49 * platform/graphics/texmap/TextureMapperBackingStore.h: 50 (WebCore::TextureMapperBackingStore::drawRepaintCounter): 51 (TextureMapperBackingStore): 52 (TextureMapperTiledBackingStore): 53 * platform/graphics/texmap/TextureMapperGL.cpp: 54 (WebCore::TextureMapperGL::drawRepaintCounter): 55 * platform/graphics/texmap/TextureMapperGL.h: 56 * platform/graphics/texmap/TextureMapperImageBuffer.cpp: 57 (WebCore::TextureMapperImageBuffer::drawBorder): 58 (WebCore): 59 (WebCore::TextureMapperImageBuffer::drawRepaintCounter): 60 * platform/graphics/texmap/TextureMapperImageBuffer.h: 61 (TextureMapperImageBuffer): 62 * platform/graphics/texmap/TextureMapperLayer.cpp: 63 (WebCore::TextureMapperLayer::paintSelf): 64 (WebCore::TextureMapperLayer::flushCompositingStateForThisLayerOnly): 65 * platform/graphics/texmap/TextureMapperLayer.h: 66 (State): 67 (WebCore::TextureMapperLayer::State::State): 68 * platform/graphics/texmap/TextureMapperPlatformLayer.h: 69 (WebCore::TextureMapperPlatformLayer::drawBorder): 70 1 71 2013-01-24 Patrick Gansterer <paroga@webkit.org> 2 72 -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h
r127044 r140821 26 26 27 27 #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) 28 #include "TextureMapper .h"28 #include "TextureMapperPlatformLayer.h" 29 29 #endif 30 30 -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
r140497 r140821 35 35 #include "QWebPageClient.h" 36 36 #include "SharedBuffer.h" 37 #include "TextureMapperPlatformLayer.h" 37 38 #include <QWindow> 38 39 #include <qpa/qplatformpixmap.h> -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r140519 r140821 25 25 #include "GraphicsLayerFactory.h" 26 26 #include "ImageBuffer.h" 27 #include "NotImplemented.h"28 27 #include <wtf/CurrentTime.h> 29 30 #if USE(CAIRO)31 #include "CairoUtilities.h"32 #include <wtf/text/CString.h>33 #endif34 28 35 29 namespace WebCore { … … 387 381 } 388 382 383 void GraphicsLayerTextureMapper::setShowDebugBorder(bool show) 384 { 385 if (isShowingDebugBorder() == show) 386 return; 387 388 GraphicsLayer::setShowDebugBorder(show); 389 notifyChange(TextureMapperLayer::DebugVisualsChange); 390 } 391 392 void GraphicsLayerTextureMapper::setShowRepaintCounter(bool show) 393 { 394 if (isShowingRepaintCounter() == show) 395 return; 396 397 GraphicsLayer::setShowRepaintCounter(show); 398 notifyChange(TextureMapperLayer::DebugVisualsChange); 399 } 400 389 401 /* \reimp (GraphicsLayer.h) 390 402 */ 391 403 void GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly() 392 404 { 405 updateDebugBorderAndRepaintCountIfNeeded(); 393 406 m_layer->flushCompositingStateForThisLayerOnly(this); 394 updateBackingStore ();407 updateBackingStoreIfNeeded(); 395 408 didFlushCompositingState(); 409 } 410 411 void GraphicsLayerTextureMapper::updateDebugBorderAndRepaintCountIfNeeded() 412 { 413 if (!m_hasOwnBackingStore) 414 return; 415 416 m_usingTiledLayer = shouldHaveBackingStore(); 417 updateDebugIndicators(); 418 419 // When this has its own backing store (e.g. Qt WK1), update the repaint count before calling TextureMapperLayer::flushCompositingStateForThisLayerOnly(). 420 bool needsToRepaint = shouldHaveBackingStore() && (m_needsDisplay || !m_needsDisplayRect.isEmpty()); 421 if (isShowingRepaintCounter() && needsToRepaint) { 422 incrementRepaintCount(); 423 m_changeMask |= TextureMapperLayer::RepaintCountChange; 424 } 425 } 426 427 void GraphicsLayerTextureMapper::setDebugBorder(const Color& color, float width) 428 { 429 m_debugBorderColor = color; 430 m_debugBorderWidth = width; 431 m_changeMask |= TextureMapperLayer::DebugVisualsChange; 396 432 } 397 433 … … 418 454 } 419 455 420 void GraphicsLayerTextureMapper::updateBackingStore ()456 void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded() 421 457 { 422 458 if (!m_hasOwnBackingStore) 423 459 return; 424 425 460 prepareBackingStore(); 426 461 m_layer->setBackingStore(m_backingStore); … … 452 487 TextureMapperTiledBackingStore* backingStore = static_cast<TextureMapperTiledBackingStore*>(m_backingStore.get()); 453 488 454 if (isShowingRepaintCounter()) 455 incrementRepaintCount(); 456 457 // Paint into an intermediate buffer to avoid painting content more than once. 458 bool paintOnce = true; 459 const IntSize maxTextureSize = textureMapper->maxTextureSize(); 460 // We need to paint directly if the dirty rect exceeds one of the maximum dimensions. 461 if (dirtyRect.width() > maxTextureSize.width() || dirtyRect.height() > maxTextureSize.height()) 462 paintOnce = false; 463 464 if (paintOnce) { 465 OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(dirtyRect.size()); 466 GraphicsContext* context = imageBuffer->context(); 467 context->setImageInterpolationQuality(textureMapper->imageInterpolationQuality()); 468 context->setTextDrawingMode(textureMapper->textDrawingMode()); 469 context->translate(-dirtyRect.x(), -dirtyRect.y()); 470 paintGraphicsLayerContents(*context, dirtyRect); 471 472 if (isShowingRepaintCounter()) 473 drawRepaintCounter(context); 474 475 RefPtr<Image> image = imageBuffer->copyImage(DontCopyBackingStore); 476 backingStore->updateContents(textureMapper, image.get(), m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData); 477 } else 478 backingStore->updateContents(textureMapper, this, m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData); 479 480 backingStore->setShowDebugBorders(isShowingDebugBorder()); 481 backingStore->setDebugBorder(m_debugBorderColor, m_debugBorderWidth); 489 backingStore->updateContents(textureMapper, this, m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData); 482 490 483 491 m_needsDisplay = false; … … 489 497 return drawsContent() && contentsAreVisible() && !m_size.isEmpty(); 490 498 } 491 492 #if USE(CAIRO)493 void GraphicsLayerTextureMapper::drawRepaintCounter(GraphicsContext* context)494 {495 cairo_t* cr = context->platformContext()->cr();496 cairo_save(cr);497 498 CString repaintCount = String::format("%i", this->repaintCount()).utf8();499 cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);500 cairo_set_font_size(cr, 18);501 502 cairo_text_extents_t repaintTextExtents;503 cairo_text_extents(cr, repaintCount.data(), &repaintTextExtents);504 505 static const int repaintCountBorderWidth = 10;506 setSourceRGBAFromColor(cr, isShowingDebugBorder() ? m_debugBorderColor : Color(0, 255, 0, 127));507 cairo_rectangle(cr, 0, 0,508 repaintTextExtents.width + (repaintCountBorderWidth * 2),509 repaintTextExtents.height + (repaintCountBorderWidth * 2));510 cairo_fill(cr);511 512 cairo_set_source_rgb(cr, 1, 1, 1);513 cairo_move_to(cr, repaintCountBorderWidth, repaintTextExtents.height + repaintCountBorderWidth);514 cairo_show_text(cr, repaintCount.data());515 516 cairo_restore(cr);517 }518 #else519 void GraphicsLayerTextureMapper::drawRepaintCounter(GraphicsContext* context)520 {521 notImplemented();522 }523 524 #endif525 499 526 500 bool GraphicsLayerTextureMapper::addAnimation(const KeyframeValueList& valueList, const IntSize& boxSize, const Animation* anim, const String& keyframesName, double timeOffset) … … 565 539 } 566 540 567 void GraphicsLayerTextureMapper::setDebugBorder(const Color& color, float width)568 {569 // The default values for GraphicsLayer debug borders are a little570 // hard to see (some less than one pixel wide), so we double their size here.571 m_debugBorderColor = color;572 m_debugBorderWidth = width * 2;573 }574 575 541 #if ENABLE(CSS_FILTERS) 576 542 bool GraphicsLayerTextureMapper::setFilters(const FilterOperations& filters) … … 581 547 #endif 582 548 583 } 549 void GraphicsLayerTextureMapper::setRepaintCount(int repaintCount) 550 { 551 m_repaintCount = repaintCount; 552 notifyChange(TextureMapperLayer::RepaintCountChange); 553 } 554 555 } -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
r138291 r140821 21 21 #define GraphicsLayerTextureMapper_h 22 22 23 #include "GraphicsContext.h"24 23 #include "GraphicsLayer.h" 25 24 #include "GraphicsLayerClient.h" … … 67 66 virtual void setContentsToMedia(PlatformLayer*); 68 67 virtual void setContentsToCanvas(PlatformLayer* canvas) { setContentsToMedia(canvas); } 68 virtual void setShowDebugBorder(bool) OVERRIDE; 69 virtual void setDebugBorder(const Color&, float width) OVERRIDE; 70 virtual void setShowRepaintCounter(bool) OVERRIDE; 69 71 virtual void flushCompositingState(const FloatRect&); 70 72 virtual void flushCompositingStateForThisLayerOnly(); … … 82 84 TextureMapperLayer* layer() const { return m_layer.get(); } 83 85 84 virtual void setDebugBorder(const Color&, float width);85 86 86 #if ENABLE(CSS_FILTERS) 87 87 virtual bool setFilters(const FilterOperations&); … … 94 94 bool fixedToViewport() const { return m_fixedToViewport; } 95 95 96 void drawRepaintCounter(GraphicsContext*); 96 Color debugBorderColor() const { return m_debugBorderColor; } 97 float debugBorderWidth() const { return m_debugBorderWidth; } 98 void setRepaintCount(int); 99 97 100 private: 98 101 virtual void willBeDestroyed(); 99 102 void didFlushCompositingState(); 100 void updateBackingStore(); 103 void updateDebugBorderAndRepaintCountIfNeeded(); 104 void updateBackingStoreIfNeeded(); 101 105 void prepareBackingStore(); 102 106 bool shouldHaveBackingStore() const; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h
r137982 r140821 37 37 #include "IntRect.h" 38 38 #include "IntSize.h" 39 #include "TextureMapperPlatformLayer.h"40 39 #include "TransformationMatrix.h" 41 40 #include <wtf/UnusedParam.h> … … 131 130 }; 132 131 133 virtual void drawBorder(const Color&, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix = TransformationMatrix()) = 0; 134 virtual void drawRepaintCounter(int value, int pointSize, const FloatPoint&, const TransformationMatrix& modelViewMatrix = TransformationMatrix()) = 0; 132 virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) = 0; 133 virtual void drawRepaintCounter(int repaintCount, const Color&, const FloatPoint&, const TransformationMatrix&) = 0; 134 135 135 virtual void drawTexture(const BitmapTexture&, const FloatRect& target, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0f, const BitmapTexture* maskTexture = 0, unsigned exposedEdges = AllEdges) = 0; 136 136 virtual void drawSolidColor(const FloatRect&, const TransformationMatrix&, const Color&) = 0; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp
r138327 r140821 107 107 108 108 TextureMapperTiledBackingStore::TextureMapperTiledBackingStore() 109 : m_drawsDebugBorders(false)110 109 { 111 110 } … … 134 133 } 135 134 135 TransformationMatrix TextureMapperTiledBackingStore::adjustedTransformForRect(const FloatRect& targetRect) 136 { 137 return TransformationMatrix::rectToRect(rect(), targetRect); 138 } 139 136 140 void TextureMapperTiledBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity, BitmapTexture* mask) 137 141 { 138 142 updateContentsFromImageIfNeeded(textureMapper); 139 TransformationMatrix adjustedTransform = transform; 140 adjustedTransform.multiply(TransformationMatrix::rectToRect(rect(), targetRect)); 141 for (size_t i = 0; i < m_tiles.size(); ++i) { 143 TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect); 144 for (size_t i = 0; i < m_tiles.size(); ++i) 142 145 m_tiles[i].paint(textureMapper, adjustedTransform, opacity, mask, calculateExposedTileEdges(rect(), m_tiles[i].rect())); 143 if (m_drawsDebugBorders) 144 textureMapper->drawBorder(m_debugBorderColor, m_debugBorderWidth, m_tiles[i].rect(), adjustedTransform); 145 } 146 } 147 148 void TextureMapperTiledBackingStore::drawBorder(TextureMapper* textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform) 149 { 150 TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect); 151 for (size_t i = 0; i < m_tiles.size(); ++i) 152 textureMapper->drawBorder(borderColor, borderWidth, m_tiles[i].rect(), adjustedTransform); 153 } 154 155 void TextureMapperTiledBackingStore::drawRepaintCounter(TextureMapper* textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform) 156 { 157 TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect); 158 for (size_t i = 0; i < m_tiles.size(); ++i) 159 textureMapper->drawRepaintCounter(repaintCount, borderColor, m_tiles[i].rect().location(), adjustedTransform); 146 160 } 147 161 … … 235 249 } 236 250 237 void TextureMapperTiledBackingStore::setDebugBorder(const Color& color, float width)238 {239 m_debugBorderColor = color;240 m_debugBorderWidth = width;241 }242 243 251 } 244 252 #endif -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h
r137481 r140821 41 41 virtual PassRefPtr<BitmapTexture> texture() const = 0; 42 42 virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float, BitmapTexture*) = 0; 43 virtual void drawRepaintCounter(TextureMapper*, int /* repaintCount */, const Color&, const FloatRect&, const TransformationMatrix&) { } 43 44 virtual ~TextureMapperBackingStore() { } 45 44 46 45 47 protected: … … 95 97 virtual PassRefPtr<BitmapTexture> texture() const OVERRIDE; 96 98 virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float, BitmapTexture*) OVERRIDE; 99 virtual void drawBorder(TextureMapper*, const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) OVERRIDE; 100 virtual void drawRepaintCounter(TextureMapper*, int repaintCount, const Color&, const FloatRect&, const TransformationMatrix&) OVERRIDE; 97 101 void updateContents(TextureMapper*, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag); 98 102 void updateContents(TextureMapper*, GraphicsLayer*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag); 99 103 100 104 void setContentsToImage(Image* image) { m_image = image; } 101 void setShowDebugBorders(bool drawsDebugBorders) { m_drawsDebugBorders = drawsDebugBorders; }102 void setDebugBorder(const Color&, float width);103 105 104 106 private: … … 106 108 void createOrDestroyTilesIfNeeded(const FloatSize& backingStoreSize, const IntSize& tileSize, bool hasAlpha); 107 109 void updateContentsFromImageIfNeeded(TextureMapper*); 110 TransformationMatrix adjustedTransformForRect(const FloatRect&); 108 111 inline FloatRect rect() const { return FloatRect(FloatPoint::zero(), m_size); } 109 112 … … 111 114 FloatSize m_size; 112 115 RefPtr<Image> m_image; 113 114 bool m_drawsDebugBorders;115 Color m_debugBorderColor;116 float m_debugBorderWidth;117 116 }; 118 117 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
r140518 r140821 322 322 } 323 323 324 void TextureMapperGL::drawRepaintCounter(int value, int pointSize, const FloatPoint& targetPoint, const TransformationMatrix& modelViewMatrix) 325 { 324 void TextureMapperGL::drawRepaintCounter(int repaintCount, const Color& color, const FloatPoint& targetPoint, const TransformationMatrix& modelViewMatrix) 325 { 326 int pointSize = 8; 326 327 #if PLATFORM(QT) 327 QString counterString = QString::number( value);328 QString counterString = QString::number(repaintCount); 328 329 329 330 QFont font(QString::fromLatin1("Monospace"), pointSize, QFont::Bold); … … 340 341 QImage image(size, NativeImageQt::defaultFormatForAlphaEnabledImages()); 341 342 QPainter painter(&image); 342 painter.fillRect(sourceRect, Qt::blue); // Since we won't swap R+B for speed, this will paint red.343 painter.fillRect(sourceRect, Color::createUnchecked(color.blue(), color.green(), color.red())); // Since we won't swap R+B when uploading a texture, paint with the swapped R+B color. 343 344 painter.setFont(font); 344 345 painter.setPen(Qt::white); … … 351 352 352 353 #elif USE(CAIRO) 353 CString counterString = String::number( value).ascii();354 CString counterString = String::number(repaintCount).ascii(); 354 355 // cairo_text_extents() requires a cairo_t, so dimensions need to be guesstimated. 355 356 int width = counterString.length() * pointSize * 1.2; … … 359 360 cairo_t* cr = cairo_create(surface); 360 361 361 cairo_set_source_rgb(cr, 0, 0, 1); // Since we won't swap R+B for speed, this will paint red. 362 float r, g, b, a; 363 color.getRGBA(r, g, b, a); 364 cairo_set_source_rgba(cr, b, g, r, a); // Since we won't swap R+B when uploading a texture, paint with the swapped R+B color. 362 365 cairo_rectangle(cr, 0, 0, width, height); 363 366 cairo_fill(cr); … … 383 386 384 387 #else 385 UNUSED_PARAM( value);388 UNUSED_PARAM(repaintCount); 386 389 UNUSED_PARAM(pointSize); 387 390 UNUSED_PARAM(targetPoint); -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
r139731 r140821 53 53 54 54 // TextureMapper implementation 55 virtual void drawBorder(const Color&, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix = TransformationMatrix()) OVERRIDE;56 virtual void drawRepaintCounter(int value, int pointSize, const FloatPoint&, const TransformationMatrix& modelViewMatrix = TransformationMatrix()) OVERRIDE;55 virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) OVERRIDE; 56 virtual void drawRepaintCounter(int repaintCount, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE; 57 57 virtual void drawTexture(const BitmapTexture&, const FloatRect&, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture, unsigned exposedEdges) OVERRIDE; 58 58 virtual void drawTexture(Platform3DObject texture, Flags, const IntSize& textureSize, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity, const BitmapTexture* maskTexture, unsigned exposedEdges = AllEdges); -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
r139864 r140821 26 26 #include "NativeImageQt.h" 27 27 #endif 28 #include "NotImplemented.h" 28 29 29 30 … … 165 166 } 166 167 168 void TextureMapperImageBuffer::drawBorder(const Color&, float /* borderWidth */, const FloatRect&, const TransformationMatrix&) 169 { 170 notImplemented(); 171 } 172 173 void TextureMapperImageBuffer::drawRepaintCounter(int /* repaintCount */, const Color&, const FloatPoint&, const TransformationMatrix&) 174 { 175 notImplemented(); 176 } 177 167 178 #if ENABLE(CSS_FILTERS) 168 179 PassRefPtr<BitmapTexture> BitmapTextureImageBuffer::applyFilters(TextureMapper*, const BitmapTexture& contentTexture, const FilterOperations& filters) -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
r137481 r140821 54 54 55 55 // TextureMapper implementation 56 virtual void drawBorder(const Color&, float /* borderWidth */, const FloatRect& /* targetRect */, const TransformationMatrix& modelViewMatrix = TransformationMatrix()) OVERRIDE 57 { 58 UNUSED_PARAM(modelViewMatrix); 59 }; 60 virtual void drawRepaintCounter(int /* value */, int /* pointSize */, const FloatPoint&, const TransformationMatrix& modelViewMatrix = TransformationMatrix()) OVERRIDE 61 { 62 UNUSED_PARAM(modelViewMatrix); 63 }; 56 virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) OVERRIDE; 57 virtual void drawRepaintCounter(int repaintCount, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE; 64 58 virtual void drawTexture(const BitmapTexture&, const FloatRect& targetRect, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture, unsigned exposedEdges) OVERRIDE; 65 59 virtual void drawSolidColor(const FloatRect&, const TransformationMatrix&, const Color&) OVERRIDE; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r140519 r140821 130 130 if (m_state.solidColor.isValid() && !m_state.contentsRect.isEmpty()) { 131 131 options.textureMapper->drawSolidColor(m_state.contentsRect, transform, blendWithOpacity(m_state.solidColor, opacity)); 132 if (m_state.showDebugBorders) 133 options.textureMapper->drawBorder(m_state.debugBorderColor, m_state.debugBorderWidth, layerRect(), transform); 132 134 return; 133 135 } … … 137 139 ASSERT(!layerRect().isEmpty()); 138 140 m_backingStore->paintToTextureMapper(options.textureMapper, layerRect(), transform, opacity, mask.get()); 141 if (m_state.showDebugBorders) 142 m_backingStore->drawBorder(options.textureMapper, m_state.debugBorderColor, m_state.debugBorderWidth, layerRect(), transform); 143 // Only draw repaint count for the main backing store. 144 if (m_state.showRepaintCounter) 145 m_backingStore->drawRepaintCounter(options.textureMapper, m_state.repaintCount, m_state.debugBorderColor, layerRect(), transform); 139 146 } 140 147 … … 142 149 ASSERT(!layerRect().isEmpty()); 143 150 m_contentsLayer->paintToTextureMapper(options.textureMapper, m_state.contentsRect, transform, opacity, mask.get()); 151 if (m_state.showDebugBorders) 152 m_contentsLayer->drawBorder(options.textureMapper, m_state.debugBorderColor, m_state.debugBorderWidth, m_state.contentsRect, transform); 144 153 } 145 154 } … … 384 393 return; 385 394 386 graphicsLayer->updateDebugIndicators();387 388 395 if (changeMask & ChildrenChange) 389 396 setChildren(graphicsLayer->children()); … … 401 408 if (changeMask & AnimationChange) 402 409 m_animations = graphicsLayer->m_animations; 410 411 if (changeMask & RepaintCountChange) 412 m_state.repaintCount = graphicsLayer->repaintCount(); 403 413 404 414 m_state.maskLayer = toTextureMapperLayer(graphicsLayer->maskLayer()); … … 424 434 m_fixedToViewport = graphicsLayer->fixedToViewport(); 425 435 436 m_state.showDebugBorders = graphicsLayer->isShowingDebugBorder(); 437 m_state.debugBorderColor = toGraphicsLayerTextureMapper(graphicsLayer)->debugBorderColor(); 438 m_state.debugBorderWidth = toGraphicsLayerTextureMapper(graphicsLayer)->debugBorderWidth(); 439 m_state.showRepaintCounter = graphicsLayer->isShowingRepaintCounter(); 440 426 441 m_contentsLayer = graphicsLayer->platformLayer(); 427 442 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
r139526 r140821 72 72 ReplicaLayerChange = (1L << 21), 73 73 AnimationChange = (1L << 22), 74 FilterChange = (1L << 23) 74 FilterChange = (1L << 23), 75 76 DebugVisualsChange = (1L << 24), 77 RepaintCountChange = (1L << 25) 75 78 }; 76 79 … … 173 176 FilterOperations filters; 174 177 #endif 178 Color debugBorderColor; 179 float debugBorderWidth; 180 int repaintCount; 175 181 176 182 bool preserves3D : 1; … … 181 187 bool backfaceVisibility : 1; 182 188 bool visible : 1; 189 bool showDebugBorders : 1; 190 bool showRepaintCounter : 1; 183 191 184 192 State() … … 186 194 , maskLayer(0) 187 195 , replicaLayer(0) 196 , debugBorderWidth(0) 197 , repaintCount(0) 188 198 , preserves3D(false) 189 199 , masksToBounds(false) … … 193 203 , backfaceVisibility(false) 194 204 , visible(true) 205 , showDebugBorders(false) 206 , showRepaintCounter(false) 195 207 { 196 208 } -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
r135200 r140821 25 25 #endif 26 26 27 #include "TextureMapper.h" 27 28 #include "TransformationMatrix.h" 28 29 29 30 namespace WebCore { 30 31 class TextureMapper;32 class BitmapTexture;33 31 34 32 class TextureMapperPlatformLayer { … … 37 35 virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0, BitmapTexture* mask = 0) = 0; 38 36 virtual void swapBuffers() { } 37 virtual void drawBorder(TextureMapper* textureMapper, const Color& color, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform) 38 { 39 textureMapper->drawBorder(color, borderWidth, targetRect, transform); 40 } 39 41 #if USE(GRAPHICS_SURFACE) 40 42 virtual IntSize platformLayerSize() const { return IntSize(); }
Note: See TracChangeset
for help on using the changeset viewer.