| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 PPAPI_CPP_GRAPHICS_2D_H_ | 5 #ifndef PPAPI_CPP_GRAPHICS_2D_H_ |
| 6 #define PPAPI_CPP_GRAPHICS_2D_H_ | 6 #define PPAPI_CPP_GRAPHICS_2D_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_stdint.h" | 8 #include "ppapi/c/pp_stdint.h" |
| 9 #include "ppapi/cpp/resource.h" | 9 #include "ppapi/cpp/resource.h" |
| 10 #include "ppapi/cpp/size.h" | 10 #include "ppapi/cpp/size.h" |
| 11 | 11 |
| 12 namespace pp { | 12 namespace pp { |
| 13 | 13 |
| 14 class CompletionCallback; | 14 class CompletionCallback; |
| 15 class ImageData; | 15 class ImageData; |
| 16 class Instance; |
| 16 class Point; | 17 class Point; |
| 17 class Rect; | 18 class Rect; |
| 18 | 19 |
| 19 class Graphics2D : public Resource { | 20 class Graphics2D : public Resource { |
| 20 public: | 21 public: |
| 21 // Creates an is_null() ImageData object. | 22 // Creates an is_null() ImageData object. |
| 22 Graphics2D(); | 23 Graphics2D(); |
| 23 | 24 |
| 24 // The copied context will refer to the original (since this is just a wrapper | 25 // The copied context will refer to the original (since this is just a wrapper |
| 25 // around a refcounted resource). | 26 // around a refcounted resource). |
| 26 Graphics2D(const Graphics2D& other); | 27 Graphics2D(const Graphics2D& other); |
| 27 | 28 |
| 28 // Allocates a new 2D graphics context with the given size in the browser, | 29 // Allocates a new 2D graphics context with the given size in the browser, |
| 29 // resulting object will be is_null() if the allocation failed. | 30 // resulting object will be is_null() if the allocation failed. |
| 30 Graphics2D(const Size& size, bool is_always_opaque); | 31 Graphics2D(Instance* instance, const Size& size, bool is_always_opaque); |
| 31 | 32 |
| 32 virtual ~Graphics2D(); | 33 virtual ~Graphics2D(); |
| 33 | 34 |
| 34 Graphics2D& operator=(const Graphics2D& other); | 35 Graphics2D& operator=(const Graphics2D& other); |
| 35 | 36 |
| 36 const Size& size() const { return size_; } | 37 const Size& size() const { return size_; } |
| 37 | 38 |
| 38 // Enqueues paint or scroll commands. THIS COMMAND HAS NO EFFECT UNTIL YOU | 39 // Enqueues paint or scroll commands. THIS COMMAND HAS NO EFFECT UNTIL YOU |
| 39 // CALL Flush(). | 40 // CALL Flush(). |
| 40 // | 41 // |
| (...skipping 24 matching lines...) Expand all Loading... |
| 65 // Please see PPB_Graphics2D.Flush for more details. | 66 // Please see PPB_Graphics2D.Flush for more details. |
| 66 int32_t Flush(const CompletionCallback& cc); | 67 int32_t Flush(const CompletionCallback& cc); |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 Size size_; | 70 Size size_; |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 } // namespace pp | 73 } // namespace pp |
| 73 | 74 |
| 74 #endif // PPAPI_CPP_GRAPHICS_2D_H_ | 75 #endif // PPAPI_CPP_GRAPHICS_2D_H_ |
| OLD | NEW |