ppb_graphics_2d_api.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright (c) 2012 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. #ifndef PPAPI_THUNK_PPB_GRAPHICS_2D_API_H_
  5. #define PPAPI_THUNK_PPB_GRAPHICS_2D_API_H_
  6. #include <stdint.h>
  7. #include "base/memory/ref_counted.h"
  8. #include "ppapi/c/pp_bool.h"
  9. #include "ppapi/c/pp_completion_callback.h"
  10. #include "ppapi/c/pp_point.h"
  11. #include "ppapi/c/pp_rect.h"
  12. #include "ppapi/c/pp_resource.h"
  13. #include "ppapi/c/pp_size.h"
  14. #include "ppapi/thunk/ppapi_thunk_export.h"
  15. namespace ppapi {
  16. class TrackedCallback;
  17. namespace thunk {
  18. class PPAPI_THUNK_EXPORT PPB_Graphics2D_API {
  19. public:
  20. virtual ~PPB_Graphics2D_API() {}
  21. virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) = 0;
  22. virtual void PaintImageData(PP_Resource image_data,
  23. const PP_Point* top_left,
  24. const PP_Rect* src_rect) = 0;
  25. virtual void Scroll(const PP_Rect* clip_rect,
  26. const PP_Point* amount) = 0;
  27. virtual void ReplaceContents(PP_Resource image_data) = 0;
  28. virtual int32_t Flush(scoped_refptr<TrackedCallback> callback) = 0;
  29. virtual PP_Bool SetScale(float scale) = 0;
  30. virtual float GetScale() = 0;
  31. virtual PP_Bool SetLayerTransform(float scale,
  32. const PP_Point* origin,
  33. const PP_Point* translate) = 0;
  34. // Test only
  35. virtual bool ReadImageData(PP_Resource image, const PP_Point* top_left) = 0;
  36. };
  37. } // namespace thunk
  38. } // namespace ppapi
  39. #endif // PPAPI_THUNK_PPB_GRAPHICS_2D_API_H_