| Index: webkit/tools/test_shell/simple_webpaintsurface_impl.h
|
| ===================================================================
|
| --- webkit/tools/test_shell/simple_webpaintsurface_impl.h (revision 0)
|
| +++ webkit/tools/test_shell/simple_webpaintsurface_impl.h (revision 0)
|
| @@ -0,0 +1,50 @@
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_WEBPAINTSURFACE_IMPL_H_
|
| +#define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_WEBPAINTSURFACE_IMPL_H_
|
| +
|
| +#include "gfx/rect.h"
|
| +#include "skia/ext/platform_canvas.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebPaintSurface.h"
|
| +
|
| +class SimpleWebPaintSurfaceImpl : public WebKit::WebPaintSurface {
|
| + public:
|
| + class Delegate {
|
| + public:
|
| + // Called when the paint surface is modified. In response to this method,
|
| + // the delegate should asynchronously call DidCopyPaintSurface, which will
|
| + // permit further modifications to the paint surface.
|
| + virtual void DidModifyPaintSurface(const gfx::Rect& bounds) = 0;
|
| + };
|
| +
|
| + SimpleWebPaintSurfaceImpl(Delegate* delegate, const gfx::Size& size);
|
| + ~SimpleWebPaintSurfaceImpl();
|
| +
|
| + const gfx::Size& size() const { return size_; }
|
| + skia::PlatformCanvas* canvas() { return &canvas_; }
|
| +
|
| + // Called asynchronously in response to DidModifyPaintSurface.
|
| + void DidCopyPaintSurface();
|
| +
|
| + private:
|
| + // WebKit::WebPaintSurface methods:
|
| + virtual void setClient(WebKit::WebPaintSurfaceClient* client);
|
| + virtual WebKit::WebPaintBuffer* createBuffer(const WebKit::WebSize& size);
|
| + virtual void paint(WebKit::WebPaintBuffer* buffer,
|
| + const WebKit::WebPoint& destination_point,
|
| + const WebKit::WebRect& source_rect);
|
| + virtual void scroll(const WebKit::WebRect& clip_rect,
|
| + const WebKit::WebPoint& scroll_delta);
|
| + virtual bool flush();
|
| +
|
| + Delegate* delegate_;
|
| + gfx::Size size_;
|
| + skia::PlatformCanvas canvas_;
|
| + WebKit::WebPaintSurfaceClient* client_;
|
| + gfx::Rect damage_bounds_;
|
| + bool flushing_;
|
| +};
|
| +
|
| +#endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_WEBPAINTSURFACE_IMPL_H_
|
|
|
| Property changes on: webkit\tools\test_shell\simple_webpaintsurface_impl.h
|
| ___________________________________________________________________
|
| Added: svn:eol-style
|
| + LF
|
|
|
|
|