Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 REMOTING_CLIENT_DISPLAY_DRAWABLE_H_ | |
| 6 #define REMOTING_CLIENT_DISPLAY_DRAWABLE_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/weak_ptr.h" | |
| 10 | |
| 11 namespace remoting { | |
| 12 | |
| 13 class Canvas; | |
| 14 | |
| 15 // Interface for drawing on a Canvas from a renderer. | |
| 16 class Drawable { | |
| 17 public: | |
| 18 Drawable() {} | |
| 19 virtual ~Drawable() {} | |
| 20 | |
| 21 // Sets the canvas on which the object will be drawn. | |
| 22 // If |canvas| is nullptr, nothing will happen when calling Draw(). | |
| 23 virtual void SetCanvas(base::WeakPtr<Canvas> canvas) = 0; | |
| 24 | |
| 25 // Draws the object on the canvas. | |
| 26 // Returns true if there is a pending next frame. | |
| 27 virtual bool Draw() = 0; | |
| 28 | |
| 29 // Used for the renderer to keep a stack of drawables. | |
| 30 virtual base::WeakPtr<Drawable> GetWeakPtr() = 0; | |
| 31 | |
| 32 // ZIndexDefault is a recommendation for Z Index of drawable components. | |
| 33 enum ZIndexDefault { | |
|
Sergey Ulanov
2017/01/11 22:47:31
I'm not sure we need 'Default' part of the name -
nicholss
2017/01/11 23:43:25
Done.
| |
| 34 DESKTOP = 100, | |
| 35 CURSOR_FEEDBACK = 200, | |
| 36 CURSOR = 300, | |
| 37 }; | |
| 38 | |
| 39 // A higher Z Index shiould be draw ontop of a lower z index. Elements with | |
| 40 // the | |
|
Sergey Ulanov
2017/01/11 22:47:31
nit: comment formatting
nicholss
2017/01/11 23:43:25
some magic from git cl format.
| |
| 41 // same Z Index should draw in order inserted into the renderer. | |
| 42 virtual int ZIndex() = 0; | |
|
Sergey Ulanov
2017/01/11 22:47:31
GetZIndex()
nicholss
2017/01/11 23:43:25
Done.
| |
| 43 | |
| 44 private: | |
| 45 DISALLOW_COPY_AND_ASSIGN(Drawable); | |
| 46 }; | |
| 47 | |
| 48 } // namespace remoting | |
| 49 | |
| 50 #endif // REMOTING_CLIENT_DISPLAY_DRAWABLE_H_ | |
| OLD | NEW |