| Index: Source/platform/graphics/ImageBufferSurface.cpp
|
| diff --git a/Source/core/rendering/LayoutRectRecorder.h b/Source/platform/graphics/ImageBufferSurface.cpp
|
| similarity index 67%
|
| copy from Source/core/rendering/LayoutRectRecorder.h
|
| copy to Source/platform/graphics/ImageBufferSurface.cpp
|
| index c92eb5efc90d50bfbac57653cda3a1c84df4b4b2..c5e22dbdd036ea8fb2057d573de8ed9d25f96f95 100644
|
| --- a/Source/core/rendering/LayoutRectRecorder.h
|
| +++ b/Source/platform/graphics/ImageBufferSurface.cpp
|
| @@ -28,31 +28,33 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef LayoutRectRecorder_h
|
| -#define LayoutRectRecorder_h
|
| +#include "config.h"
|
|
|
| -#include "platform/geometry/LayoutRect.h"
|
| -#include "wtf/Noncopyable.h"
|
| +#include "platform/graphics/ImageBufferSurface.h"
|
|
|
| -namespace WebCore {
|
| -
|
| -class RenderLayerModelObject;
|
| -class RenderObject;
|
| +#include "third_party/skia/include/core/SkCanvas.h"
|
| +#include "third_party/skia/include/core/SkDevice.h"
|
|
|
| -class LayoutRectRecorder {
|
| - WTF_MAKE_NONCOPYABLE(LayoutRectRecorder);
|
| -public:
|
| - LayoutRectRecorder(RenderObject&, bool skipRecording = false);
|
| - ~LayoutRectRecorder();
|
| +namespace WebCore {
|
|
|
| - static bool shouldRecordLayoutRects();
|
| +void ImageBufferSurface::clear()
|
| +{
|
| + // Clear the background transparent or opaque, as required. It would be nice if this wasn't
|
| + // required, but the canvas is currently filled with the magic transparency
|
| + // color. Can we have another way to manage this?
|
| + if (isValid()) {
|
| + if (m_opacityMode == Opaque)
|
| + canvas()->drawARGB(255, 0, 0, 0, SkXfermode::kSrc_Mode);
|
| + else
|
| + canvas()->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
|
| + }
|
| +}
|
| +
|
| +const SkBitmap& ImageBufferSurface::bitmap() const
|
| +{
|
| + ASSERT(canvas());
|
| + return canvas()->getTopDevice()->accessBitmap(false);
|
| +}
|
|
|
| -private:
|
| - RenderObject& m_object;
|
| - bool m_skipRecording;
|
| -};
|
|
|
| } // namespace WebCore
|
| -
|
| -#endif // LayoutRectRecorder_h
|
| -
|
|
|