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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 223 } |
224 | 224 |
225 std::unique_ptr<cc::SharedBitmap> DrawingBuffer::createOrRecycleBitmap() { | 225 std::unique_ptr<cc::SharedBitmap> DrawingBuffer::createOrRecycleBitmap() { |
226 auto it = std::remove_if( | 226 auto it = std::remove_if( |
227 m_recycledBitmaps.begin(), m_recycledBitmaps.end(), | 227 m_recycledBitmaps.begin(), m_recycledBitmaps.end(), |
228 [this](const RecycledBitmap& bitmap) { return bitmap.size != m_size; }); | 228 [this](const RecycledBitmap& bitmap) { return bitmap.size != m_size; }); |
229 m_recycledBitmaps.shrink(it - m_recycledBitmaps.begin()); | 229 m_recycledBitmaps.shrink(it - m_recycledBitmaps.begin()); |
230 | 230 |
231 if (!m_recycledBitmaps.isEmpty()) { | 231 if (!m_recycledBitmaps.isEmpty()) { |
232 RecycledBitmap recycled = std::move(m_recycledBitmaps.last()); | 232 RecycledBitmap recycled = std::move(m_recycledBitmaps.last()); |
233 m_recycledBitmaps.removeLast(); | 233 m_recycledBitmaps.pop_back(); |
234 DCHECK(recycled.size == m_size); | 234 DCHECK(recycled.size == m_size); |
235 return std::move(recycled.bitmap); | 235 return std::move(recycled.bitmap); |
236 } | 236 } |
237 | 237 |
238 return Platform::current()->allocateSharedBitmap(m_size); | 238 return Platform::current()->allocateSharedBitmap(m_size); |
239 } | 239 } |
240 | 240 |
241 bool DrawingBuffer::PrepareTextureMailbox( | 241 bool DrawingBuffer::PrepareTextureMailbox( |
242 cc::TextureMailbox* outMailbox, | 242 cc::TextureMailbox* outMailbox, |
243 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) { | 243 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) { |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 if (m_pixelUnpackBufferBindingDirty) | 1265 if (m_pixelUnpackBufferBindingDirty) |
1266 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); | 1266 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); |
1267 } | 1267 } |
1268 | 1268 |
1269 bool DrawingBuffer::shouldUseChromiumImage() { | 1269 bool DrawingBuffer::shouldUseChromiumImage() { |
1270 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && | 1270 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && |
1271 m_chromiumImageUsage == AllowChromiumImage; | 1271 m_chromiumImageUsage == AllowChromiumImage; |
1272 } | 1272 } |
1273 | 1273 |
1274 } // namespace blink | 1274 } // namespace blink |
OLD | NEW |