| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 // ImageBufferSurface implementation | 68 // ImageBufferSurface implementation |
| 69 void finalizeFrame(const FloatRect &dirtyRect); | 69 void finalizeFrame(const FloatRect &dirtyRect); |
| 70 void willAccessPixels(); | 70 void willAccessPixels(); |
| 71 SkCanvas* canvas() const { return m_canvas.get(); } | 71 SkCanvas* canvas() const { return m_canvas.get(); } |
| 72 bool checkSurfaceValid(); | 72 bool checkSurfaceValid(); |
| 73 bool restoreSurface(); | 73 bool restoreSurface(); |
| 74 WebLayer* layer() const; | 74 WebLayer* layer() const; |
| 75 Platform3DObject getBackingTexture(); | 75 Platform3DObject getBackingTexture(); |
| 76 bool isAccelerated() const { return true; } | 76 bool isAccelerated() const { return true; } |
| 77 void setFilterLevel(SkPaint::FilterLevel); |
| 77 void setIsHidden(bool); | 78 void setIsHidden(bool); |
| 78 void setImageBuffer(ImageBuffer* imageBuffer) { m_imageBuffer = imageBuffer;
} | 79 void setImageBuffer(ImageBuffer* imageBuffer) { m_imageBuffer = imageBuffer;
} |
| 79 | 80 |
| 80 // Methods used by Canvas2DLayerManager | 81 // Methods used by Canvas2DLayerManager |
| 81 virtual size_t freeMemoryIfPossible(size_t); // virtual for mocking | 82 virtual size_t freeMemoryIfPossible(size_t); // virtual for mocking |
| 82 virtual void flush(); // virtual for mocking | 83 virtual void flush(); // virtual for mocking |
| 83 virtual size_t storageAllocatedForRecording(); // virtual for faking | 84 virtual size_t storageAllocatedForRecording(); // virtual for faking |
| 84 size_t bytesAllocated() const { return m_bytesAllocated; } | 85 size_t bytesAllocated() const { return m_bytesAllocated; } |
| 85 void limitPendingFrames(); | 86 void limitPendingFrames(); |
| 86 void freeReleasedMailbox(); | 87 void freeReleasedMailbox(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 105 OwnPtr<WebGraphicsContext3DProvider> m_contextProvider; | 106 OwnPtr<WebGraphicsContext3DProvider> m_contextProvider; |
| 106 ImageBuffer* m_imageBuffer; | 107 ImageBuffer* m_imageBuffer; |
| 107 int m_msaaSampleCount; | 108 int m_msaaSampleCount; |
| 108 size_t m_bytesAllocated; | 109 size_t m_bytesAllocated; |
| 109 bool m_didRecordDrawCommand; | 110 bool m_didRecordDrawCommand; |
| 110 bool m_isSurfaceValid; | 111 bool m_isSurfaceValid; |
| 111 int m_framesPending; | 112 int m_framesPending; |
| 112 int m_framesSinceMailboxRelease; | 113 int m_framesSinceMailboxRelease; |
| 113 bool m_destructionInProgress; | 114 bool m_destructionInProgress; |
| 114 bool m_rateLimitingEnabled; | 115 bool m_rateLimitingEnabled; |
| 116 SkPaint::FilterLevel m_filterLevel; |
| 115 bool m_isHidden; | 117 bool m_isHidden; |
| 116 | 118 |
| 117 friend class WTF::DoublyLinkedListNode<Canvas2DLayerBridge>; | 119 friend class WTF::DoublyLinkedListNode<Canvas2DLayerBridge>; |
| 118 friend class ::Canvas2DLayerBridgeTest; | 120 friend class ::Canvas2DLayerBridgeTest; |
| 119 Canvas2DLayerBridge* m_next; | 121 Canvas2DLayerBridge* m_next; |
| 120 Canvas2DLayerBridge* m_prev; | 122 Canvas2DLayerBridge* m_prev; |
| 121 | 123 |
| 122 enum MailboxStatus { | 124 enum MailboxStatus { |
| 123 MailboxInUse, | 125 MailboxInUse, |
| 124 MailboxReleased, | 126 MailboxReleased, |
| 125 MailboxAvailable, | 127 MailboxAvailable, |
| 126 }; | 128 }; |
| 127 | 129 |
| 128 struct MailboxInfo { | 130 struct MailboxInfo { |
| 129 WebExternalTextureMailbox m_mailbox; | 131 WebExternalTextureMailbox m_mailbox; |
| 130 RefPtr<SkImage> m_image; | 132 RefPtr<SkImage> m_image; |
| 131 MailboxStatus m_status; | 133 MailboxStatus m_status; |
| 132 RefPtr<Canvas2DLayerBridge> m_parentLayerBridge; | 134 RefPtr<Canvas2DLayerBridge> m_parentLayerBridge; |
| 133 | 135 |
| 134 MailboxInfo(const MailboxInfo&); | 136 MailboxInfo(const MailboxInfo&); |
| 135 MailboxInfo() {} | 137 MailboxInfo() {} |
| 136 }; | 138 }; |
| 137 MailboxInfo* createMailboxInfo(); | 139 MailboxInfo* createMailboxInfo(); |
| 138 MailboxInfo* releasedMailboxInfo(); | 140 MailboxInfo* releasedMailboxInfo(); |
| 139 | 141 |
| 140 uint32_t m_lastImageId; | 142 uint32_t m_lastImageId; |
| 143 GLenum m_lastFilter; |
| 141 Vector<MailboxInfo> m_mailboxes; | 144 Vector<MailboxInfo> m_mailboxes; |
| 142 int m_releasedMailboxInfoIndex; | 145 int m_releasedMailboxInfoIndex; |
| 143 }; | 146 }; |
| 144 | 147 |
| 145 } // namespace blink | 148 } // namespace blink |
| 146 | 149 |
| 147 #endif | 150 #endif |
| OLD | NEW |