OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ANDROID_WEBVIEW_BROWSER_PARENT_OUTPUT_SURFACE_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_PARENT_OUTPUT_SURFACE_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "cc/output/output_surface.h" |
| 10 |
| 11 namespace android_webview { |
| 12 |
| 13 class ParentOutputSurface : NON_EXPORTED_BASE(public cc::OutputSurface) { |
| 14 public: |
| 15 explicit ParentOutputSurface( |
| 16 scoped_refptr<cc::ContextProvider> context_provider); |
| 17 virtual ~ParentOutputSurface(); |
| 18 |
| 19 // OutputSurface. |
| 20 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; |
| 21 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE {} |
| 22 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; |
| 23 |
| 24 base::WeakPtr<ParentOutputSurface> GetWeakPtr(); |
| 25 void SetDrawConstraints(const gfx::Size& surface_size, const gfx::Rect& clip); |
| 26 |
| 27 private: |
| 28 void UpdateClientBeforeDraw(); |
| 29 |
| 30 base::WeakPtrFactory<ParentOutputSurface> weak_factory_; |
| 31 gfx::Rect clip_; |
| 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(ParentOutputSurface); |
| 34 }; |
| 35 |
| 36 } // namespace android_webview |
| 37 |
| 38 #endif // ANDROID_WEBVIEW_BROWSER_PARENT_OUTPUT_SURFACE_H_ |
OLD | NEW |