diff options
author | Chris Craik <ccraik@google.com> | 2012-03-05 18:56:54 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-05 18:56:54 -0800 |
commit | cc845c6b387500f968dea35d760d4a6bddae805a (patch) | |
tree | bc4c31dcefdb2990cbe52c428b2ad07ccc5812d6 | |
parent | 090354d00cb78dbde302cb96fc7a10d2c194ea86 (diff) | |
parent | cc427ce09e1d439a2cf786a4ed329733fe933047 (diff) | |
download | external_webkit-cc845c6b387500f968dea35d760d4a6bddae805a.zip external_webkit-cc845c6b387500f968dea35d760d4a6bddae805a.tar.gz external_webkit-cc845c6b387500f968dea35d760d4a6bddae805a.tar.bz2 |
Merge "operation and filter cleanup"
6 files changed, 8 insertions, 98 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp b/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp index 7c04c74..955d6dd 100644 --- a/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp +++ b/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp @@ -28,7 +28,6 @@ #include "BaseTile.h" #include "ClassTracker.h" -#include "DeleteTextureOperation.h" #include "GLUtils.h" #include "TilesManager.h" diff --git a/Source/WebCore/platform/graphics/android/DeleteTextureOperation.h b/Source/WebCore/platform/graphics/android/DeleteTextureOperation.h deleted file mode 100644 index f3cb57c..0000000 --- a/Source/WebCore/platform/graphics/android/DeleteTextureOperation.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2010, The Android Open Source Project - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DeleteTextureOperation_h -#define DeleteTextureOperation_h - -#include "GLUtils.h" -#include "QueuedOperation.h" - -namespace WebCore { - -class DeleteTextureOperation : public QueuedOperation { -public: - DeleteTextureOperation(GLuint textureId, EGLImageKHR eglImage) - : QueuedOperation(QueuedOperation::DeleteTexture, 0) - , m_textureId(textureId) - , m_eglImage(eglImage) {} - virtual bool operator==(const QueuedOperation* operation) - { - if (operation->type() != type()) - return false; - const DeleteTextureOperation* op = static_cast<const DeleteTextureOperation*>(operation); - return op->m_textureId == m_textureId; - } - virtual void run() - { - if (m_textureId) - GLUtils::deleteTexture(&m_textureId); - if (m_eglImage) - eglDestroyImageKHR(eglGetCurrentDisplay(), m_eglImage); - } -private: - GLuint m_textureId; - EGLImageKHR m_eglImage; -}; - -} - -#endif // DeleteTextureOperation_h diff --git a/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp b/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp index 9fb06b3..a79298c 100644 --- a/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp +++ b/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp @@ -34,7 +34,7 @@ namespace WebCore { PaintTileOperation::PaintTileOperation(BaseTile* tile, TilePainter* painter) - : QueuedOperation(QueuedOperation::PaintTile, tile->page()) + : QueuedOperation(tile->page()) , m_tile(tile) , m_painter(painter) { @@ -60,8 +60,6 @@ PaintTileOperation::~PaintTileOperation() bool PaintTileOperation::operator==(const QueuedOperation* operation) { - if (operation->type() != type()) - return false; const PaintTileOperation* op = static_cast<const PaintTileOperation*>(operation); return op->m_tile == m_tile; } diff --git a/Source/WebCore/platform/graphics/android/PaintTileOperation.h b/Source/WebCore/platform/graphics/android/PaintTileOperation.h index 3ade065..4e98287 100644 --- a/Source/WebCore/platform/graphics/android/PaintTileOperation.h +++ b/Source/WebCore/platform/graphics/android/PaintTileOperation.h @@ -59,12 +59,8 @@ public: , m_scale(scale) {} virtual bool check(QueuedOperation* operation) { - if (operation->type() == QueuedOperation::PaintTile) { - PaintTileOperation* op = static_cast<PaintTileOperation*>(operation); - if ((op->painter() == m_painter) && (op->scale() != m_scale)) - return true; - } - return false; + PaintTileOperation* op = static_cast<PaintTileOperation*>(operation); + return ((op->painter() == m_painter) && (op->scale() != m_scale)); } private: const TilePainter* m_painter; @@ -77,12 +73,8 @@ public: TilePainterFilter(TilePainter* painter) : m_painter(painter) {} virtual bool check(QueuedOperation* operation) { - if (operation->type() == QueuedOperation::PaintTile) { - PaintTileOperation* op = static_cast<PaintTileOperation*>(operation); - if (op->painter() == m_painter) - return true; - } - return false; + PaintTileOperation* op = static_cast<PaintTileOperation*>(operation); + return op->painter() == m_painter; } private: TilePainter* m_painter; diff --git a/Source/WebCore/platform/graphics/android/QueuedOperation.h b/Source/WebCore/platform/graphics/android/QueuedOperation.h index 1a83f65..2f36547 100644 --- a/Source/WebCore/platform/graphics/android/QueuedOperation.h +++ b/Source/WebCore/platform/graphics/android/QueuedOperation.h @@ -32,18 +32,14 @@ class TiledPage; class QueuedOperation { public: - enum OperationType { Undefined, PaintTile, PaintLayer, DeleteTexture }; - QueuedOperation(OperationType type, TiledPage* page) - : m_type(type) - , m_page(page) {} + QueuedOperation(TiledPage* page) + : m_page(page) {} virtual ~QueuedOperation() {} virtual void run() = 0; virtual bool operator==(const QueuedOperation* operation) = 0; virtual int priority() { return -1; } - OperationType type() const { return m_type; } TiledPage* page() const { return m_page; } private: - OperationType m_type; TiledPage* m_page; }; @@ -66,20 +62,6 @@ private: TiledPage* m_page; }; -class PagePaintFilter : public OperationFilter { -public: - PagePaintFilter(TiledPage* page) : m_page(page) {} - virtual bool check(QueuedOperation* operation) - { - if (operation->type() == QueuedOperation::PaintTile - && operation->page() == m_page) - return true; - return false; - } -private: - TiledPage* m_page; -}; - } #endif // QueuedOperation_h diff --git a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp index bccb99b..4f7c1f0 100644 --- a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp +++ b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp @@ -67,7 +67,7 @@ void TexturesGenerator::removeOperationsForPage(TiledPage* page) void TexturesGenerator::removePaintOperationsForPage(TiledPage* page, bool waitForRunning) { - removeOperationsForFilter(new PagePaintFilter(page), waitForRunning); + removeOperationsForFilter(new PageFilter(page), waitForRunning); } void TexturesGenerator::removeOperationsForFilter(OperationFilter* filter) |