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

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

Issue 1877473002: Disable 2D canvas switch to CPU rendering while backgrounded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 class SharedContextRateLimiter; 54 class SharedContextRateLimiter;
55 55
56 #if OS(MACOSX) 56 #if OS(MACOSX)
57 // Canvas hibernation is currently disabled on MacOS X due to a bug that causes content loss 57 // Canvas hibernation is currently disabled on MacOS X due to a bug that causes content loss
58 // TODO: Find a better fix for crbug.com/588434 58 // TODO: Find a better fix for crbug.com/588434
59 #define CANVAS2D_HIBERNATION_ENABLED 0 59 #define CANVAS2D_HIBERNATION_ENABLED 0
60 #else 60 #else
61 #define CANVAS2D_HIBERNATION_ENABLED 1 61 #define CANVAS2D_HIBERNATION_ENABLED 1
62 #endif 62 #endif
63 63
64 // TODO: Fix background rendering and remove this workaround. crbug.com/600386
65 #define CANVAS2D_BACKGROUND_RENDER_SWITCH_TO_CPU 0
66
64 class PLATFORM_EXPORT Canvas2DLayerBridge : public WebExternalTextureLayerClient , public WebThread::TaskObserver, public RefCounted<Canvas2DLayerBridge> { 67 class PLATFORM_EXPORT Canvas2DLayerBridge : public WebExternalTextureLayerClient , public WebThread::TaskObserver, public RefCounted<Canvas2DLayerBridge> {
65 WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge); 68 WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge);
66 public: 69 public:
67 enum AccelerationMode { 70 enum AccelerationMode {
68 DisableAcceleration, 71 DisableAcceleration,
69 EnableAcceleration, 72 EnableAcceleration,
70 ForceAccelerationForTesting, 73 ForceAccelerationForTesting,
71 }; 74 };
72 75
73 static PassRefPtr<Canvas2DLayerBridge> create(const IntSize&, int msaaSample Count, OpacityMode, AccelerationMode); 76 static PassRefPtr<Canvas2DLayerBridge> create(const IntSize&, int msaaSample Count, OpacityMode, AccelerationMode);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 GLenum m_lastFilter; 199 GLenum m_lastFilter;
197 AccelerationMode m_accelerationMode; 200 AccelerationMode m_accelerationMode;
198 OpacityMode m_opacityMode; 201 OpacityMode m_opacityMode;
199 IntSize m_size; 202 IntSize m_size;
200 int m_recordingPixelCount; 203 int m_recordingPixelCount;
201 }; 204 };
202 205
203 } // namespace blink 206 } // namespace blink
204 207
205 #endif 208 #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