| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #ifndef WebCompositorSupport_h | 26 #ifndef WebCompositorSupport_h |
| 27 #define WebCompositorSupport_h | 27 #define WebCompositorSupport_h |
| 28 | 28 |
| 29 #include "WebCommon.h" | 29 #include "WebCommon.h" |
| 30 #include "WebFloatPoint.h" | 30 #include "WebFloatPoint.h" |
| 31 #include "WebLayerTreeView.h" | 31 #include "WebLayerTreeView.h" |
| 32 #include "WebScrollbar.h" | 32 #include "WebScrollbar.h" |
| 33 #include "WebScrollbarThemePainter.h" | 33 #include "WebScrollbarThemePainter.h" |
| 34 | 34 |
| 35 #include <memory> |
| 36 |
| 35 namespace cc { | 37 namespace cc { |
| 36 class Layer; | 38 class Layer; |
| 37 class TextureLayerClient; | 39 class TextureLayerClient; |
| 38 } | 40 } |
| 39 | 41 |
| 40 namespace blink { | 42 namespace blink { |
| 41 | 43 |
| 42 class WebContentLayer; | 44 class WebContentLayer; |
| 43 class WebContentLayerClient; | 45 class WebContentLayerClient; |
| 44 class WebExternalTextureLayer; | 46 class WebExternalTextureLayer; |
| 45 class WebImageLayer; | 47 class WebImageLayer; |
| 46 class WebLayer; | 48 class WebLayer; |
| 47 class WebScrollbarLayer; | 49 class WebScrollbarLayer; |
| 48 class WebScrollbarThemeGeometry; | 50 class WebScrollbarThemeGeometry; |
| 49 | 51 |
| 50 class WebCompositorSupport { | 52 class WebCompositorSupport { |
| 51 public: | 53 public: |
| 52 // Layers ------------------------------------------------------- | 54 // Layers ------------------------------------------------------- |
| 53 | 55 |
| 54 virtual WebLayer* createLayer() { return nullptr; } | 56 virtual std::unique_ptr<WebLayer> createLayer() = 0; |
| 55 | 57 |
| 56 virtual WebLayer* createLayerFromCCLayer(cc::Layer*) { return nullptr; } | 58 virtual std::unique_ptr<WebLayer> createLayerFromCCLayer(cc::Layer*) = 0; |
| 57 | 59 |
| 58 virtual WebContentLayer* createContentLayer(WebContentLayerClient*) { | 60 virtual std::unique_ptr<WebContentLayer> createContentLayer( |
| 59 return nullptr; | 61 WebContentLayerClient*) = 0; |
| 60 } | |
| 61 | 62 |
| 62 virtual WebExternalTextureLayer* createExternalTextureLayer( | 63 virtual std::unique_ptr<WebExternalTextureLayer> createExternalTextureLayer( |
| 63 cc::TextureLayerClient*) { | 64 cc::TextureLayerClient*) = 0; |
| 64 return nullptr; | |
| 65 } | |
| 66 | 65 |
| 67 virtual WebImageLayer* createImageLayer() { return nullptr; } | 66 virtual std::unique_ptr<WebImageLayer> createImageLayer() = 0; |
| 68 | 67 |
| 69 // The ownership of the WebScrollbarThemeGeometry pointer is passed to | 68 virtual std::unique_ptr<WebScrollbarLayer> createScrollbarLayer( |
| 70 // Chromium. | 69 std::unique_ptr<WebScrollbar>, |
| 71 virtual WebScrollbarLayer* createScrollbarLayer(WebScrollbar*, | 70 WebScrollbarThemePainter, |
| 72 WebScrollbarThemePainter, | 71 std::unique_ptr<WebScrollbarThemeGeometry>) = 0; |
| 73 WebScrollbarThemeGeometry*) { | |
| 74 return nullptr; | |
| 75 } | |
| 76 | 72 |
| 77 virtual WebScrollbarLayer* createSolidColorScrollbarLayer( | 73 virtual std::unique_ptr<WebScrollbarLayer> createSolidColorScrollbarLayer( |
| 78 WebScrollbar::Orientation, | 74 WebScrollbar::Orientation, |
| 79 int thumbThickness, | 75 int thumbThickness, |
| 80 int trackStart, | 76 int trackStart, |
| 81 bool isLeftSideVerticalScrollbar) { | 77 bool isLeftSideVerticalScrollbar) = 0; |
| 82 return nullptr; | |
| 83 } | |
| 84 | 78 |
| 85 protected: | 79 protected: |
| 86 virtual ~WebCompositorSupport() {} | 80 virtual ~WebCompositorSupport() {} |
| 87 }; | 81 }; |
| 88 } | 82 } |
| 89 | 83 |
| 90 #endif // WebCompositorSupport_h | 84 #endif // WebCompositorSupport_h |
| OLD | NEW |