diff options
author | Nicolas Roard <nicolasroard@google.com> | 2012-03-05 11:36:55 -0800 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2012-03-05 11:36:55 -0800 |
commit | 7483b3848348ceffac033e3bb29120efb6c0792c (patch) | |
tree | 682a975075c81e560f07c7a3badaba8da82e8dbf /Source | |
parent | 00e488ce021bfdc927c43c9e88d971eef60c10c3 (diff) | |
download | external_webkit-7483b3848348ceffac033e3bb29120efb6c0792c.zip external_webkit-7483b3848348ceffac033e3bb29120efb6c0792c.tar.gz external_webkit-7483b3848348ceffac033e3bb29120efb6c0792c.tar.bz2 |
Removes unused classes
Now that find text is done through webkit, we don't need those.
Change-Id: I70a7bbdcc0e6842ab2ce181871c2893ce84012c7
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebCore/platform/graphics/android/LayerAndroid.cpp | 136 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/LayerAndroid.h | 3 |
2 files changed, 0 insertions, 139 deletions
diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp index e6a79ce..67d3dd3 100644 --- a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -389,142 +389,6 @@ void LayerAndroid::clipInner(SkTDArray<SkRect>* region, getChild(i)->clipInner(region, m_haveClip ? localBounds : local); } -class FindCheck : public SkBounder { -public: - FindCheck() - : m_drew(false) - , m_drewText(false) - { - } - - bool drew() const { return m_drew; } - bool drewText() const { return m_drewText; } - void reset() { m_drew = m_drewText = false; } - -protected: - virtual bool onIRect(const SkIRect& ) - { - m_drew = true; - return false; - } - - virtual bool onIRectGlyph(const SkIRect& , const SkBounder::GlyphRec& ) - { - m_drew = m_drewText = true; - return false; - } - - bool m_drew; - bool m_drewText; -}; - -class FindCanvas : public ParseCanvas { -public: - void draw(SkPicture* picture, SkScalar offsetX, SkScalar offsetY) - { - save(); - translate(-offsetX, -offsetY); - picture->draw(this); - restore(); - } -}; - -class LayerAndroid::FindState { -public: - static const int TOUCH_SLOP = 10; - - FindState(int x, int y) - : m_x(x) - , m_y(y) - , m_bestX(x) - , m_bestY(y) - , m_best(0) - { - m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, TOUCH_SLOP * 2, - TOUCH_SLOP * 2); - m_checker.setBounder(&m_findCheck); - m_checker.setBitmapDevice(m_bitmap); - } - - const LayerAndroid* best() const { return m_best; } - int bestX() const { return m_bestX; } - int bestY() const { return m_bestY; } - - bool drew(SkPicture* picture, const SkRect& localBounds) - { - m_findCheck.reset(); - SkScalar localX = SkIntToScalar(m_x - TOUCH_SLOP) - localBounds.fLeft; - SkScalar localY = SkIntToScalar(m_y - TOUCH_SLOP) - localBounds.fTop; - m_checker.draw(picture, localX, localY); - return m_findCheck.drew(); - } - - bool drewText() { return m_findCheck.drewText(); } - - void setBest(const LayerAndroid* best, int x, int y) - { - m_best = best; - m_bestX = x; - m_bestY = y; - } - int x() const { return m_x; } - int y() const { return m_y; } - - void setLocation(int x, int y) - { - m_x = x; - m_y = y; - } - -protected: - int m_x; - int m_y; - int m_bestX; - int m_bestY; - const LayerAndroid* m_best; - FindCheck m_findCheck; - SkBitmap m_bitmap; - FindCanvas m_checker; -}; - -void LayerAndroid::findInner(LayerAndroid::FindState& state) const -{ - int x = state.x(); - int y = state.y(); - SkRect localBounds; - bounds(&localBounds); - if (!localBounds.contains(x, y)) - return; - // Move into local coordinates. - state.setLocation(x - localBounds.fLeft, y - localBounds.fTop); - for (int i = 0; i < countChildren(); i++) - getChild(i)->findInner(state); - // Move back into the parent coordinates. - int testX = state.x(); - int testY = state.y(); - state.setLocation(x + localBounds.fLeft, y + localBounds.fTop); - if (!m_recordingPicture) - return; - if (!contentIsScrollable() && !state.drew(m_recordingPicture, localBounds)) - return; - state.setBest(this, testX, testY); // set last match (presumably on top) -} - -const LayerAndroid* LayerAndroid::find(int* xPtr, int* yPtr, SkPicture* root) const -{ - FindState state(*xPtr, *yPtr); - SkRect rootBounds; - rootBounds.setEmpty(); - if (root && state.drew(root, rootBounds) && state.drewText()) - return 0; // use the root picture only if it contains the text - findInner(state); - *xPtr = state.bestX(); - *yPtr = state.bestY(); - return state.best(); -} - -/////////////////////////////////////////////////////////////////////////////// - bool LayerAndroid::updateFixedLayersPositions(SkRect viewport, LayerAndroid* parentIframeLayer) { bool hasFixedElements = false; diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.h b/Source/WebCore/platform/graphics/android/LayerAndroid.h index 9dbe7fa..86d27bc 100644 --- a/Source/WebCore/platform/graphics/android/LayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/LayerAndroid.h @@ -94,7 +94,6 @@ namespace WebCore { class AndroidAnimation; class BaseTileTexture; class GLWebViewState; -class LayerAndroidFindState; class RenderLayer; class TiledPage; class PaintedSurface; @@ -318,13 +317,11 @@ protected: TransformationMatrix m_drawTransform; private: - class FindState; #if DUMP_NAV_CACHE friend class CachedLayer::Debug; // debugging access only #endif void copyAnimationStartTimes(LayerAndroid* oldLayer); - void findInner(FindState&) const; bool prepareContext(bool force = false); void clipInner(SkTDArray<SkRect>* region, const SkRect& local) const; |