Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: webkit/tools/test_shell/simple_webpaintsurface_impl.h

Issue 6283019: Render using WebPaintSurface. Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « webkit/tools/test_shell/resources/test_shell.rc ('k') | webkit/tools/test_shell/simple_webpaintsurface_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698