Chromium Code Reviews| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 DisableAcceleration, | 88 DisableAcceleration, |
| 89 EnableAcceleration, | 89 EnableAcceleration, |
| 90 ForceAccelerationForTesting, | 90 ForceAccelerationForTesting, |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 Canvas2DLayerBridge(std::unique_ptr<WebGraphicsContext3DProvider>, | 93 Canvas2DLayerBridge(std::unique_ptr<WebGraphicsContext3DProvider>, |
| 94 const IntSize&, | 94 const IntSize&, |
| 95 int msaaSampleCount, | 95 int msaaSampleCount, |
| 96 OpacityMode, | 96 OpacityMode, |
| 97 AccelerationMode, | 97 AccelerationMode, |
| 98 sk_sp<SkColorSpace>); | 98 sk_sp<SkColorSpace>, |
| 99 SkColorType); | |
| 99 | 100 |
| 100 ~Canvas2DLayerBridge() override; | 101 ~Canvas2DLayerBridge() override; |
| 101 | 102 |
| 102 // cc::TextureLayerClient implementation. | 103 // cc::TextureLayerClient implementation. |
| 103 bool PrepareTextureMailbox( | 104 bool PrepareTextureMailbox( |
| 104 cc::TextureMailbox* outMailbox, | 105 cc::TextureMailbox* outMailbox, |
| 105 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) override; | 106 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) override; |
| 106 | 107 |
| 107 // Callback for mailboxes given to the compositor from PrepareTextureMailbox. | 108 // Callback for mailboxes given to the compositor from PrepareTextureMailbox. |
| 108 void mailboxReleased(const gpu::Mailbox&, | 109 void mailboxReleased(const gpu::Mailbox&, |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 135 bool isHidden() { return m_isHidden; } | 136 bool isHidden() { return m_isHidden; } |
| 136 OpacityMode opacityMode() { return m_opacityMode; } | 137 OpacityMode opacityMode() { return m_opacityMode; } |
| 137 void dontUseIdleSchedulingForTesting() { | 138 void dontUseIdleSchedulingForTesting() { |
| 138 m_dontUseIdleSchedulingForTesting = true; | 139 m_dontUseIdleSchedulingForTesting = true; |
| 139 } | 140 } |
| 140 | 141 |
| 141 void beginDestruction(); | 142 void beginDestruction(); |
| 142 void hibernate(); | 143 void hibernate(); |
| 143 bool isHibernating() const { return m_hibernationImage.get(); } | 144 bool isHibernating() const { return m_hibernationImage.get(); } |
| 144 sk_sp<SkColorSpace> colorSpace() const { return m_colorSpace; } | 145 sk_sp<SkColorSpace> colorSpace() const { return m_colorSpace; } |
| 146 SkColorType colorType() const { return m_colorType; } | |
|
xidachen
2016/10/18 15:40:37
I think we should be consistent here. Either call
| |
| 145 | 147 |
| 146 sk_sp<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason); | 148 sk_sp<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason); |
| 147 | 149 |
| 148 // The values of the enum entries must not change because they are used for | 150 // The values of the enum entries must not change because they are used for |
| 149 // usage metrics histograms. New values can be added to the end. | 151 // usage metrics histograms. New values can be added to the end. |
| 150 enum HibernationEvent { | 152 enum HibernationEvent { |
| 151 HibernationScheduled = 0, | 153 HibernationScheduled = 0, |
| 152 HibernationAbortedDueToDestructionWhileHibernatePending = 1, | 154 HibernationAbortedDueToDestructionWhileHibernatePending = 1, |
| 153 HibernationAbortedDueToPendingDestruction = 2, | 155 HibernationAbortedDueToPendingDestruction = 2, |
| 154 HibernationAbortedDueToVisibilityChange = 3, | 156 HibernationAbortedDueToVisibilityChange = 3, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 // handling. | 280 // handling. |
| 279 MaxActiveMailboxes = 3, | 281 MaxActiveMailboxes = 3, |
| 280 }; | 282 }; |
| 281 | 283 |
| 282 Deque<MailboxInfo, MaxActiveMailboxes> m_mailboxes; | 284 Deque<MailboxInfo, MaxActiveMailboxes> m_mailboxes; |
| 283 GLenum m_lastFilter; | 285 GLenum m_lastFilter; |
| 284 AccelerationMode m_accelerationMode; | 286 AccelerationMode m_accelerationMode; |
| 285 OpacityMode m_opacityMode; | 287 OpacityMode m_opacityMode; |
| 286 const IntSize m_size; | 288 const IntSize m_size; |
| 287 sk_sp<SkColorSpace> m_colorSpace; | 289 sk_sp<SkColorSpace> m_colorSpace; |
| 290 SkColorType m_colorType; | |
| 288 int m_recordingPixelCount; | 291 int m_recordingPixelCount; |
| 289 | 292 |
| 290 #if USE_IOSURFACE_FOR_2D_CANVAS | 293 #if USE_IOSURFACE_FOR_2D_CANVAS |
| 291 // Each element in this vector represents an IOSurface backed texture that | 294 // Each element in this vector represents an IOSurface backed texture that |
| 292 // is ready to be reused. | 295 // is ready to be reused. |
| 293 // Elements in this vector can safely be purged in low memory conditions. | 296 // Elements in this vector can safely be purged in low memory conditions. |
| 294 Vector<RefPtr<ImageInfo>> m_imageInfoCache; | 297 Vector<RefPtr<ImageInfo>> m_imageInfoCache; |
| 295 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 298 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
| 296 }; | 299 }; |
| 297 | 300 |
| 298 } // namespace blink | 301 } // namespace blink |
| 299 | 302 |
| 300 #endif | 303 #endif |
| OLD | NEW |