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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 namespace blink { | 57 namespace blink { |
58 | 58 |
59 class Canvas2DLayerBridgeHistogramLogger; | 59 class Canvas2DLayerBridgeHistogramLogger; |
60 class Canvas2DLayerBridgeTest; | 60 class Canvas2DLayerBridgeTest; |
61 class ImageBuffer; | 61 class ImageBuffer; |
62 class WebGraphicsContext3DProvider; | 62 class WebGraphicsContext3DProvider; |
63 class SharedContextRateLimiter; | 63 class SharedContextRateLimiter; |
64 | 64 |
65 #if OS(MACOSX) | 65 #if OS(MACOSX) |
66 // Canvas hibernation is currently disabled on MacOS X due to a bug that causes
content loss | 66 // Canvas hibernation is currently disabled on MacOS X due to a bug that causes |
67 // TODO: Find a better fix for crbug.com/588434 | 67 // content loss. TODO: Find a better fix for crbug.com/588434 |
68 #define CANVAS2D_HIBERNATION_ENABLED 0 | 68 #define CANVAS2D_HIBERNATION_ENABLED 0 |
69 | 69 |
70 // IOSurfaces are a primitive only present on OS X. | 70 // IOSurfaces are a primitive only present on OS X. |
71 #define USE_IOSURFACE_FOR_2D_CANVAS 1 | 71 #define USE_IOSURFACE_FOR_2D_CANVAS 1 |
72 #else | 72 #else |
73 #define CANVAS2D_HIBERNATION_ENABLED 1 | 73 #define CANVAS2D_HIBERNATION_ENABLED 1 |
74 #define USE_IOSURFACE_FOR_2D_CANVAS 0 | 74 #define USE_IOSURFACE_FOR_2D_CANVAS 0 |
75 #endif | 75 #endif |
76 | 76 |
77 // TODO: Fix background rendering and remove this workaround. crbug.com/600386 | 77 // TODO: Fix background rendering and remove this workaround. crbug.com/600386 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 bool m_dontUseIdleSchedulingForTesting = false; | 267 bool m_dontUseIdleSchedulingForTesting = false; |
268 | 268 |
269 friend class Canvas2DLayerBridgeTest; | 269 friend class Canvas2DLayerBridgeTest; |
270 friend class CanvasRenderingContext2DTest; | 270 friend class CanvasRenderingContext2DTest; |
271 friend class HTMLCanvasPainterTestForSPv2; | 271 friend class HTMLCanvasPainterTestForSPv2; |
272 | 272 |
273 uint32_t m_lastImageId; | 273 uint32_t m_lastImageId; |
274 | 274 |
275 enum { | 275 enum { |
276 // We should normally not have more that two active mailboxes at a time, | 276 // We should normally not have more that two active mailboxes at a time, |
277 // but sometime we may have three due to the async nature of mailbox handlin
g. | 277 // but sometimes we may have three due to the async nature of mailbox |
| 278 // handling. |
278 MaxActiveMailboxes = 3, | 279 MaxActiveMailboxes = 3, |
279 }; | 280 }; |
280 | 281 |
281 Deque<MailboxInfo, MaxActiveMailboxes> m_mailboxes; | 282 Deque<MailboxInfo, MaxActiveMailboxes> m_mailboxes; |
282 GLenum m_lastFilter; | 283 GLenum m_lastFilter; |
283 AccelerationMode m_accelerationMode; | 284 AccelerationMode m_accelerationMode; |
284 OpacityMode m_opacityMode; | 285 OpacityMode m_opacityMode; |
285 const IntSize m_size; | 286 const IntSize m_size; |
286 sk_sp<SkColorSpace> m_colorSpace; | 287 sk_sp<SkColorSpace> m_colorSpace; |
287 int m_recordingPixelCount; | 288 int m_recordingPixelCount; |
288 | 289 |
289 #if USE_IOSURFACE_FOR_2D_CANVAS | 290 #if USE_IOSURFACE_FOR_2D_CANVAS |
290 // Each element in this vector represents an IOSurface backed texture that | 291 // Each element in this vector represents an IOSurface backed texture that |
291 // is ready to be reused. | 292 // is ready to be reused. |
292 // Elements in this vector can safely be purged in low memory conditions. | 293 // Elements in this vector can safely be purged in low memory conditions. |
293 Vector<RefPtr<ImageInfo>> m_imageInfoCache; | 294 Vector<RefPtr<ImageInfo>> m_imageInfoCache; |
294 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 295 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
295 }; | 296 }; |
296 | 297 |
297 } // namespace blink | 298 } // namespace blink |
298 | 299 |
299 #endif | 300 #endif |
OLD | NEW |