BackingStore.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Copyright (C) 2009, 2010, 2011 Research In Motion Limited. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef BackingStore_h
  19. #define BackingStore_h
  20. #include "BlackBerryGlobal.h"
  21. #include <BlackBerryPlatformMisc.h>
  22. namespace WebCore {
  23. class ChromeClientBlackBerry;
  24. class FloatPoint;
  25. class FrameLoaderClientBlackBerry;
  26. class GLES2Context;
  27. class IntRect;
  28. }
  29. namespace BlackBerry {
  30. namespace Platform {
  31. class IntRect;
  32. class FloatPoint;
  33. namespace Graphics {
  34. class Buffer;
  35. }
  36. }
  37. }
  38. namespace BlackBerry {
  39. namespace WebKit {
  40. class WebPage;
  41. class WebPagePrivate;
  42. class WebPageCompositorPrivate;
  43. class BackingStorePrivate;
  44. class BackingStoreClient;
  45. class BLACKBERRY_EXPORT BackingStore {
  46. public:
  47. enum ResumeUpdateOperation { None, Blit, RenderAndBlit };
  48. BackingStore(WebPage*, BackingStoreClient*);
  49. virtual ~BackingStore();
  50. void createSurface();
  51. void suspendBackingStoreUpdates();
  52. void resumeBackingStoreUpdates();
  53. void suspendGeometryUpdates();
  54. void resumeGeometryUpdates();
  55. void suspendScreenUpdates();
  56. void resumeScreenUpdates(BackingStore::ResumeUpdateOperation);
  57. bool isScrollingOrZooming() const;
  58. void setScrollingOrZooming(bool);
  59. void blitVisibleContents();
  60. void repaint(int x, int y, int width, int height, bool contentChanged, bool immediate);
  61. bool hasBlitJobs() const;
  62. void blitOnIdle();
  63. void acquireBackingStoreMemory();
  64. void releaseOwnedBackingStoreMemory();
  65. bool drawContents(BlackBerry::Platform::Graphics::Buffer*, const BlackBerry::Platform::IntRect& dstRect, double scale, const BlackBerry::Platform::FloatPoint& documentScrollPosition);
  66. private:
  67. friend class BlackBerry::WebKit::BackingStoreClient;
  68. friend class BlackBerry::WebKit::BackingStorePrivate;
  69. friend class BlackBerry::WebKit::WebPage;
  70. friend class BlackBerry::WebKit::WebPagePrivate; // FIXME: For now, we expose our internals to WebPagePrivate. See PR #120301.
  71. friend class BlackBerry::WebKit::WebPageCompositorPrivate;
  72. friend class WebCore::ChromeClientBlackBerry;
  73. friend class WebCore::FrameLoaderClientBlackBerry;
  74. friend class WebCore::GLES2Context;
  75. BackingStorePrivate *d;
  76. DISABLE_COPY(BackingStore)
  77. };
  78. }
  79. }
  80. #endif // BackingStore_h