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/gpu/DrawingBuffer.cpp

Issue 2627323007: Migrate WebGL contexts on backgrounded tabs to the integrated GPU.
Patch Set: Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 WebGraphicsContext3DProvider* DrawingBuffer::contextProvider() { 192 WebGraphicsContext3DProvider* DrawingBuffer::contextProvider() {
193 return m_contextProvider->contextProvider(); 193 return m_contextProvider->contextProvider();
194 } 194 }
195 195
196 void DrawingBuffer::setIsHidden(bool hidden) { 196 void DrawingBuffer::setIsHidden(bool hidden) {
197 if (m_isHidden == hidden) 197 if (m_isHidden == hidden)
198 return; 198 return;
199 m_isHidden = hidden; 199 m_isHidden = hidden;
200 if (m_isHidden) 200 if (m_isHidden)
201 m_recycledColorBufferQueue.clear(); 201 m_recycledColorBufferQueue.clear();
202 m_gl->PerformanceHintCHROMIUM(hidden ? GL_LOW_POWER_CHROMIUM
203 : GL_DEFAULT_POWER_CHROMIUM);
204 m_gl->Flush();
202 } 205 }
203 206
204 void DrawingBuffer::setFilterQuality(SkFilterQuality filterQuality) { 207 void DrawingBuffer::setFilterQuality(SkFilterQuality filterQuality) {
205 if (m_filterQuality != filterQuality) { 208 if (m_filterQuality != filterQuality) {
206 m_filterQuality = filterQuality; 209 m_filterQuality = filterQuality;
207 if (m_layer) 210 if (m_layer)
208 m_layer->setNearestNeighbor(filterQuality == kNone_SkFilterQuality); 211 m_layer->setNearestNeighbor(filterQuality == kNone_SkFilterQuality);
209 } 212 }
210 } 213 }
211 214
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 if (m_pixelUnpackBufferBindingDirty) 1269 if (m_pixelUnpackBufferBindingDirty)
1267 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); 1270 client->DrawingBufferClientRestorePixelUnpackBufferBinding();
1268 } 1271 }
1269 1272
1270 bool DrawingBuffer::shouldUseChromiumImage() { 1273 bool DrawingBuffer::shouldUseChromiumImage() {
1271 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && 1274 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() &&
1272 m_chromiumImageUsage == AllowChromiumImage; 1275 m_chromiumImageUsage == AllowChromiumImage;
1273 } 1276 }
1274 1277
1275 } // namespace blink 1278 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698