| OLD | NEW |
| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 TRACE_EVENT_INSTANT0("test_gpu", "DrawingBufferCreation", | 157 TRACE_EVENT_INSTANT0("test_gpu", "DrawingBufferCreation", |
| 158 TRACE_EVENT_SCOPE_GLOBAL); | 158 TRACE_EVENT_SCOPE_GLOBAL); |
| 159 } | 159 } |
| 160 | 160 |
| 161 DrawingBuffer::~DrawingBuffer() { | 161 DrawingBuffer::~DrawingBuffer() { |
| 162 DCHECK(m_destructionInProgress); | 162 DCHECK(m_destructionInProgress); |
| 163 m_layer.reset(); | 163 m_layer.reset(); |
| 164 m_contextProvider.reset(); | 164 m_contextProvider.reset(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void DrawingBuffer::markContentsChanged() { | 167 bool DrawingBuffer::markContentsChanged() { |
| 168 m_contentsChanged = true; | 168 if (m_contentsChangeCommitted || !m_contentsChanged) { |
| 169 m_contentsChangeCommitted = false; | 169 m_contentsChangeCommitted = false; |
| 170 m_contentsChanged = true; |
| 171 return true; |
| 172 } |
| 173 return false; |
| 170 } | 174 } |
| 171 | 175 |
| 172 bool DrawingBuffer::bufferClearNeeded() const { | 176 bool DrawingBuffer::bufferClearNeeded() const { |
| 173 return m_bufferClearNeeded; | 177 return m_bufferClearNeeded; |
| 174 } | 178 } |
| 175 | 179 |
| 176 void DrawingBuffer::setBufferClearNeeded(bool flag) { | 180 void DrawingBuffer::setBufferClearNeeded(bool flag) { |
| 177 if (m_preserveDrawingBuffer == Discard) { | 181 if (m_preserveDrawingBuffer == Discard) { |
| 178 m_bufferClearNeeded = flag; | 182 m_bufferClearNeeded = flag; |
| 179 } else { | 183 } else { |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 if (m_pixelUnpackBufferBindingDirty) | 1261 if (m_pixelUnpackBufferBindingDirty) |
| 1258 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); | 1262 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); |
| 1259 } | 1263 } |
| 1260 | 1264 |
| 1261 bool DrawingBuffer::shouldUseChromiumImage() { | 1265 bool DrawingBuffer::shouldUseChromiumImage() { |
| 1262 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && | 1266 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && |
| 1263 m_chromiumImageUsage == AllowChromiumImage; | 1267 m_chromiumImageUsage == AllowChromiumImage; |
| 1264 } | 1268 } |
| 1265 | 1269 |
| 1266 } // namespace blink | 1270 } // namespace blink |
| OLD | NEW |