| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ANDROID_WEBVIEW_BROWSER_TEST_FAKE_WINDOW_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_TEST_FAKE_WINDOW_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_TEST_FAKE_WINDOW_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_TEST_FAKE_WINDOW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 public: | 28 public: |
| 29 virtual ~WindowHooks() {} | 29 virtual ~WindowHooks() {} |
| 30 | 30 |
| 31 virtual void WillOnDraw() = 0; | 31 virtual void WillOnDraw() = 0; |
| 32 virtual void DidOnDraw(bool success) = 0; | 32 virtual void DidOnDraw(bool success) = 0; |
| 33 | 33 |
| 34 virtual void WillSyncOnRT(SharedRendererState* functor) = 0; | 34 virtual void WillSyncOnRT(SharedRendererState* functor) = 0; |
| 35 virtual void DidSyncOnRT(SharedRendererState* functor) = 0; | 35 virtual void DidSyncOnRT(SharedRendererState* functor) = 0; |
| 36 virtual void WillProcessOnRT(SharedRendererState* functor) = 0; | 36 virtual void WillProcessOnRT(SharedRendererState* functor) = 0; |
| 37 virtual void DidProcessOnRT(SharedRendererState* functor) = 0; | 37 virtual void DidProcessOnRT(SharedRendererState* functor) = 0; |
| 38 virtual void WillDrawOnRT(SharedRendererState* functor) = 0; | 38 virtual bool WillDrawOnRT(SharedRendererState* functor) = 0; |
| 39 virtual void DidDrawOnRT(SharedRendererState* functor) = 0; | 39 virtual void DidDrawOnRT(SharedRendererState* functor) = 0; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 class FakeWindow { | 42 class FakeWindow { |
| 43 public: | 43 public: |
| 44 FakeWindow(BrowserViewRenderer* view, | 44 FakeWindow(BrowserViewRenderer* view, |
| 45 WindowHooks* hooks, | 45 WindowHooks* hooks, |
| 46 gfx::Rect location); | 46 gfx::Rect location); |
| 47 ~FakeWindow(); | 47 ~FakeWindow(); |
| 48 | 48 |
| 49 void Detach(); | 49 void Detach(); |
| 50 | 50 |
| 51 // BrowserViewRendererClient methods. | 51 // BrowserViewRendererClient methods. |
| 52 void RequestDrawGL(bool wait_for_completion); | 52 void RequestDrawGL(bool wait_for_completion); |
| 53 void PostInvalidate(); | 53 void PostInvalidate(); |
| 54 const gfx::Size& surface_size() { return surface_size_; } |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 class ScopedMakeCurrent; | 57 class ScopedMakeCurrent; |
| 57 | 58 |
| 58 void OnDrawHardware(); | 59 void OnDrawHardware(); |
| 59 void CheckCurrentlyOnUIThread(); | 60 void CheckCurrentlyOnUIThread(); |
| 60 void CreateRenderThreadIfNeeded(); | 61 void CreateRenderThreadIfNeeded(); |
| 61 | 62 |
| 62 void InitializeOnRT(base::WaitableEvent* sync); | 63 void InitializeOnRT(base::WaitableEvent* sync); |
| 63 void DestroyOnRT(base::WaitableEvent* sync); | 64 void DestroyOnRT(base::WaitableEvent* sync); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 85 bool context_current_; | 86 bool context_current_; |
| 86 | 87 |
| 87 base::WeakPtrFactory<FakeWindow> weak_ptr_factory_; | 88 base::WeakPtrFactory<FakeWindow> weak_ptr_factory_; |
| 88 | 89 |
| 89 DISALLOW_COPY_AND_ASSIGN(FakeWindow); | 90 DISALLOW_COPY_AND_ASSIGN(FakeWindow); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 } // namespace android_webview | 93 } // namespace android_webview |
| 93 | 94 |
| 94 #endif // ANDROID_WEBVIEW_BROWSER_TEST_FAKE_WINDOW_H_ | 95 #endif // ANDROID_WEBVIEW_BROWSER_TEST_FAKE_WINDOW_H_ |
| OLD | NEW |