 Chromium Code Reviews
 Chromium Code Reviews Issue 786533002:
  aw: Rendering test harness and end-to-end smoke test  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 786533002:
  aw: Rendering test harness and end-to-end smoke test  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: android_webview/browser/test/fake_view_root_impl.h | 
| diff --git a/android_webview/browser/test/fake_view_root_impl.h b/android_webview/browser/test/fake_view_root_impl.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..da6ea4f5c88c05263d6df3f1812ea587c87bba33 | 
| --- /dev/null | 
| +++ b/android_webview/browser/test/fake_view_root_impl.h | 
| @@ -0,0 +1,84 @@ | 
| +// Copyright 2014 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. | 
| + | 
| +#include <map> | 
| + | 
| +#include "base/memory/weak_ptr.h" | 
| +#include "base/single_thread_task_runner.h" | 
| +#include "ui/gfx/geometry/rect.h" | 
| +#include "ui/gl/gl_context.h" | 
| +#include "ui/gl/gl_surface.h" | 
| + | 
| +namespace base { | 
| +class Thread; | 
| +class WaitableEvent; | 
| +} | 
| + | 
| +namespace android_webview { | 
| + | 
| +class BrowserViewRenderer; | 
| +class SharedRendererState; | 
| + | 
| +class ViewRootHooks { | 
| + public: | 
| + virtual ~ViewRootHooks() {} | 
| + | 
| + virtual void WillOnDraw() = 0; | 
| + virtual void DidOnDraw() = 0; | 
| + | 
| + virtual void WillSyncOnRT(SharedRendererState* functor) = 0; | 
| + virtual void DidSyncOnRT(SharedRendererState* functor) = 0; | 
| + virtual void WillProcessOnRT(SharedRendererState* functor) = 0; | 
| + virtual void DidProcessOnRT(SharedRendererState* functor) = 0; | 
| + virtual void WillDrawOnRT(SharedRendererState* functor) = 0; | 
| + virtual void DidDrawOnRT(SharedRendererState* functor) = 0; | 
| +}; | 
| + | 
| +class FakeViewRootImpl { | 
| + public: | 
| + FakeViewRootImpl(BrowserViewRenderer* view, | 
| + ViewRootHooks* hooks, | 
| + gfx::Rect location); | 
| + ~FakeViewRootImpl(); | 
| + | 
| + void Detach(); | 
| + | 
| + // BrowserViewRendererClient methods. | 
| + void RequestDrawGL(bool wait_for_completion); | 
| + void PostInvalidate(); | 
| + | 
| + private: | 
| + void OnDrawHardware(); | 
| + void CheckRenderThread(); | 
| + | 
| + void InitializeOnRT(base::WaitableEvent* sync); | 
| + void DestroyOnRT(base::WaitableEvent* sync); | 
| + void ProcessFunctorOnRT(base::WaitableEvent* sync); | 
| + void DrawFunctorOnRT(base::WaitableEvent* sync); | 
| + | 
| + class ScopedMakeCurrent; | 
| + | 
| + // const so can be used on both threads. | 
| + BrowserViewRenderer* view_; | 
| 
hush (inactive)
2014/12/10 20:07:58
so the following pointers need to be const?
 
boliu
2014/12/10 21:30:32
Umm, I think I can declare it "BVR* const view" or
 | 
| + ViewRootHooks* hooks_; | 
| + const gfx::Size surface_size_; | 
| + | 
| + // UI on | 
| + gfx::Rect location_; | 
| 
hush (inactive)
2014/12/10 20:07:58
how is the location a rect? You mean the view itse
 
boliu
2014/12/10 21:30:32
Yeah.
This is supposed to be the viewrootimpl or
 | 
| + bool on_draw_hardware_pending_; | 
| + | 
| + // Render thread members. | 
| + scoped_ptr<base::Thread> render_thread_; | 
| + SharedRendererState* functor_; | 
| + scoped_refptr<base::SingleThreadTaskRunner> render_thread_loop_; | 
| + scoped_refptr<gfx::GLSurface> surface_; | 
| + scoped_refptr<gfx::GLContext> context_; | 
| + bool context_current_; | 
| + | 
| + base::WeakPtrFactory<FakeViewRootImpl> weak_ptr_factory_; | 
| + | 
| + DISALLOW_COPY_AND_ASSIGN(FakeViewRootImpl); | 
| +}; | 
| + | 
| +} // namespace android_webview |