| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSTIOR_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSTIOR_ |
| 6 #define CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_ | 6 #define CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_ |
| 7 | 7 |
| 8 #include "ui/gfx/rect.h" |
| 9 #include "ui/gfx/size.h" |
| 10 |
| 8 class SkCanvas; | 11 class SkCanvas; |
| 9 | 12 |
| 13 namespace gfx { |
| 14 class Transform; |
| 15 }; |
| 16 |
| 10 namespace content { | 17 namespace content { |
| 11 | 18 |
| 12 class SynchronousCompositorClient; | 19 class SynchronousCompositorClient; |
| 13 | 20 |
| 14 // Interface for embedders that which to direct compositing operations | 21 // Interface for embedders that which to direct compositing operations |
| 15 // synchronously under their own control. Only meaningful when the | 22 // synchronously under their own control. Only meaningful when the |
| 16 // kEnableSyncrhonousRendererCompositor flag is specified. | 23 // kEnableSyncrhonousRendererCompositor flag is specified. |
| 17 class SynchronousCompositor { | 24 class SynchronousCompositor { |
| 18 public: | 25 public: |
| 19 // Allows changing or resetting the client to NULL (this must be used if | 26 // Allows changing or resetting the client to NULL (this must be used if |
| 20 // the client is being deleted prior to the DidDestroyCompositor() call | 27 // the client is being deleted prior to the DidDestroyCompositor() call |
| 21 // being received by the client). Ownership of |client| remains with | 28 // being received by the client). Ownership of |client| remains with |
| 22 // the caller. | 29 // the caller. |
| 23 virtual void SetClient(SynchronousCompositorClient* client) = 0; | 30 virtual void SetClient(SynchronousCompositorClient* client) = 0; |
| 24 | 31 |
| 25 // "On demand" SW draw, into the supplied canvas (observing the transform | 32 // "On demand" SW draw, into the supplied canvas (observing the transform |
| 26 // and clip set there-in). | 33 // and clip set there-in). |
| 27 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; | 34 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; |
| 28 | 35 |
| 36 // "On demand" hardware draw. The content is first clipped to |damage_area|, |
| 37 // then transformed through |transform|, and finally clipped to |view_size|. |
| 38 virtual bool DemandDrawHw( |
| 39 gfx::Size view_size, |
| 40 const gfx::Transform& transform, |
| 41 gfx::Rect damage_area) = 0; |
| 42 |
| 29 protected: | 43 protected: |
| 30 virtual ~SynchronousCompositor() {} | 44 virtual ~SynchronousCompositor() {} |
| 31 }; | 45 }; |
| 32 | 46 |
| 33 } // namespace content | 47 } // namespace content |
| 34 | 48 |
| 35 #endif // CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSTIOR_ | 49 #endif // CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSTIOR_ |
| OLD | NEW |