Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h

Issue 1857763002: Disable 2D canvas switch to CPU rendering while backgrounded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698