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

Side by Side Diff: Source/WebCore/html/canvas/WebGLRenderingContext.cpp

Issue 9148050: Merge 104636 - [chromium] Correctly recreate DrawingBuffer on lost device (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | 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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 5007 matching lines...) Expand 10 before | Expand all | Expand 10 after
5018 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts); 5018 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts);
5019 else 5019 else
5020 // This likely shouldn't happen but is the best way to report it to the WebGL app. 5020 // This likely shouldn't happen but is the best way to report it to the WebGL app.
5021 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 5021 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
5022 return; 5022 return;
5023 } 5023 }
5024 5024
5025 // Construct a new drawing buffer with the new GraphicsContext3D. 5025 // Construct a new drawing buffer with the new GraphicsContext3D.
5026 if (m_drawingBuffer) { 5026 if (m_drawingBuffer) {
5027 m_drawingBuffer->discardResources(); 5027 m_drawingBuffer->discardResources();
5028 m_drawingBuffer = DrawingBuffer::create(m_context.get(), m_drawingBuffer ->size(), !m_attributes.preserveDrawingBuffer); 5028 m_drawingBuffer = DrawingBuffer::create(context.get(), m_drawingBuffer-> size(), !m_attributes.preserveDrawingBuffer);
5029 m_drawingBuffer->bind();
5029 } 5030 }
5030 5031
5031 m_context = context; 5032 m_context = context;
5032 m_contextLost = false; 5033 m_contextLost = false;
5033 initializeNewContext(); 5034 initializeNewContext();
5034 canvas()->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextr estoredEvent, false, true, "")); 5035 canvas()->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextr estoredEvent, false, true, ""));
5035 } 5036 }
5036 5037
5037 WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache(int capacity) 5038 WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache(int capacity)
5038 : m_buffers(adoptArrayPtr(new OwnPtr<ImageBuffer>[capacity])) 5039 : m_buffers(adoptArrayPtr(new OwnPtr<ImageBuffer>[capacity]))
(...skipping 27 matching lines...) Expand all
5066 5067
5067 void WebGLRenderingContext::LRUImageBufferCache::bubbleToFront(int idx) 5068 void WebGLRenderingContext::LRUImageBufferCache::bubbleToFront(int idx)
5068 { 5069 {
5069 for (int i = idx; i > 0; --i) 5070 for (int i = idx; i > 0; --i)
5070 m_buffers[i].swap(m_buffers[i-1]); 5071 m_buffers[i].swap(m_buffers[i-1]);
5071 } 5072 }
5072 5073
5073 } // namespace WebCore 5074 } // namespace WebCore
5074 5075
5075 #endif // ENABLE(WEBGL) 5076 #endif // ENABLE(WEBGL)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698