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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // TODO: Find a better fix for crbug.com/588434 | 65 // TODO: Find a better fix for crbug.com/588434 |
66 #define CANVAS2D_HIBERNATION_ENABLED 0 | 66 #define CANVAS2D_HIBERNATION_ENABLED 0 |
67 | 67 |
68 // IOSurfaces are a primitive only present on OS X. | 68 // IOSurfaces are a primitive only present on OS X. |
69 #define USE_IOSURFACE_FOR_2D_CANVAS 1 | 69 #define USE_IOSURFACE_FOR_2D_CANVAS 1 |
70 #else | 70 #else |
71 #define CANVAS2D_HIBERNATION_ENABLED 1 | 71 #define CANVAS2D_HIBERNATION_ENABLED 1 |
72 #define USE_IOSURFACE_FOR_2D_CANVAS 0 | 72 #define USE_IOSURFACE_FOR_2D_CANVAS 0 |
73 #endif | 73 #endif |
74 | 74 |
| 75 // TODO: Fix background rendering and remove this workaround. crbug.com/600386 |
| 76 #define CANVAS2D_BACKGROUND_RENDER_SWITCH_TO_CPU 0 |
| 77 |
75 class PLATFORM_EXPORT Canvas2DLayerBridge : public WebExternalTextureLayerClient
, public WebThread::TaskObserver, public RefCounted<Canvas2DLayerBridge> { | 78 class PLATFORM_EXPORT Canvas2DLayerBridge : public WebExternalTextureLayerClient
, public WebThread::TaskObserver, public RefCounted<Canvas2DLayerBridge> { |
76 WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge); | 79 WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge); |
77 public: | 80 public: |
78 enum AccelerationMode { | 81 enum AccelerationMode { |
79 DisableAcceleration, | 82 DisableAcceleration, |
80 EnableAcceleration, | 83 EnableAcceleration, |
81 ForceAccelerationForTesting, | 84 ForceAccelerationForTesting, |
82 }; | 85 }; |
83 | 86 |
84 static PassRefPtr<Canvas2DLayerBridge> create(const IntSize&, int msaaSample
Count, OpacityMode, AccelerationMode); | 87 static PassRefPtr<Canvas2DLayerBridge> create(const IntSize&, int msaaSample
Count, OpacityMode, AccelerationMode); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // Each element in this vector represents an IOSurface backed texture that | 274 // Each element in this vector represents an IOSurface backed texture that |
272 // is ready to be reused. | 275 // is ready to be reused. |
273 // Elements in this vector can safely be purged in low memory conditions. | 276 // Elements in this vector can safely be purged in low memory conditions. |
274 Vector<ImageInfo> m_imageInfoCache; | 277 Vector<ImageInfo> m_imageInfoCache; |
275 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 278 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
276 }; | 279 }; |
277 | 280 |
278 } // namespace blink | 281 } // namespace blink |
279 | 282 |
280 #endif | 283 #endif |
OLD | NEW |