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 |
| 14 : NON_EXPORTED_BASE(public cc::OutputSurface) { |
| 15 public: |
| 16 explicit ParentOutputSurface( |
| 17 scoped_refptr<cc::ContextProvider> context_provider); |
| 18 virtual ~ParentOutputSurface(); |
| 19 |
| 20 // OutputSurface. |
| 21 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; |
| 22 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE {} |
| 23 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; |
| 24 |
| 25 base::WeakPtr<ParentOutputSurface> GetWeakPtr(); |
| 26 void SetDrawConstraints(const gfx::Size& surface_size, const gfx::Rect& clip); |
| 27 |
| 28 private: |
| 29 void UpdateClientBeforeDraw(); |
| 30 |
| 31 base::WeakPtrFactory<ParentOutputSurface> weak_factory_; |
| 32 gfx::Rect clip_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(ParentOutputSurface); |
| 35 }; |
| 36 |
| 37 } // namespace android_webview |
| 38 |
| 39 #endif // ANDROID_WEBVIEW_BROWSER_PARENT_OUTPUT_SURFACE_H_ |
OLD | NEW |