| 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_DEVICE_CONTEXT_2D_H_ | 5 #ifndef PPAPI_CPP_DEVICE_CONTEXT_2D_H_ | 
| 6 #define PPAPI_CPP_DEVICE_CONTEXT_2D_H_ | 6 #define PPAPI_CPP_DEVICE_CONTEXT_2D_H_ | 
| 7 | 7 | 
| 8 #include "ppapi/c/pp_stdint.h" | 8 #include "ppapi/c/pp_stdint.h" | 
| 9 #include "ppapi/c/ppb_device_context_2d.h" |  | 
| 10 #include "ppapi/cpp/resource.h" | 9 #include "ppapi/cpp/resource.h" | 
| 11 | 10 | 
|  | 11 typedef struct _pp_CompletionCallback PP_CompletionCallback; | 
| 12 typedef struct _pp_Rect PP_Rect; | 12 typedef struct _pp_Rect PP_Rect; | 
| 13 | 13 | 
| 14 namespace pp { | 14 namespace pp { | 
| 15 | 15 | 
|  | 16 class CompletionCallback; | 
| 16 class ImageData; | 17 class ImageData; | 
| 17 | 18 | 
| 18 class DeviceContext2D : public Resource { | 19 class DeviceContext2D : public Resource { | 
| 19  public: | 20  public: | 
| 20   // Creates an is_null() ImageData object. | 21   // Creates an is_null() ImageData object. | 
| 21   DeviceContext2D(); | 22   DeviceContext2D(); | 
| 22 | 23 | 
| 23   // The copied device will refer to the original (since this is just a wrapper | 24   // The copied device will refer to the original (since this is just a wrapper | 
| 24   // around a refcounted resource). | 25   // around a refcounted resource). | 
| 25   DeviceContext2D(const DeviceContext2D& other); | 26   DeviceContext2D(const DeviceContext2D& other); | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 47 | 48 | 
| 48   // The browser will take ownership of the given image data. The object | 49   // The browser will take ownership of the given image data. The object | 
| 49   // pointed to by the parameter will be cleared. To avoid horrible artifacts, | 50   // pointed to by the parameter will be cleared. To avoid horrible artifacts, | 
| 50   // you should also not use any other ImageData objects referring to the same | 51   // you should also not use any other ImageData objects referring to the same | 
| 51   // resource will no longer be usable. THIS COMMAND HAS NO EFFECT UNTIL YOU | 52   // resource will no longer be usable. THIS COMMAND HAS NO EFFECT UNTIL YOU | 
| 52   // CALL Flush(). | 53   // CALL Flush(). | 
| 53   // | 54   // | 
| 54   // Please see PPB_DeviceContext2D.Swap for more details. | 55   // Please see PPB_DeviceContext2D.Swap for more details. | 
| 55   bool ReplaceContents(ImageData* image); | 56   bool ReplaceContents(ImageData* image); | 
| 56 | 57 | 
| 57   // Flushes all the currently enqueued Paint, Scroll, and Swap commands. Can | 58   // Flushes all the currently enqueued Paint, Scroll, and Replace commands. | 
| 58   // be used in synchronous mode (NULL callback pointer) from background | 59   // Can be used in synchronous mode (NULL callback pointer) from background | 
| 59   // threads. | 60   // threads. | 
| 60   // | 61   // | 
| 61   // Please see PPB_DeviceContext2D.Flush for more details. | 62   // Please see PPB_DeviceContext2D.Flush for more details. | 
| 62   bool Flush(PPB_DeviceContext2D_FlushCallback callback, void* callback_data); | 63   int32_t Flush(const CompletionCallback& cc); | 
| 63 | 64 | 
| 64  private: | 65  private: | 
| 65   int32_t width_; | 66   int32_t width_; | 
| 66   int32_t height_; | 67   int32_t height_; | 
| 67 }; | 68 }; | 
| 68 | 69 | 
| 69 }  // namespace pp | 70 }  // namespace pp | 
| 70 | 71 | 
| 71 #endif  // PPAPI_CPP_DEVICE_CONTEXT_2D_H_ | 72 #endif  // PPAPI_CPP_DEVICE_CONTEXT_2D_H_ | 
| OLD | NEW | 
|---|