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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 2502413004: WTF/std normalization: replace WTF::Vector::last with ::back (Closed)
Patch Set: rebase Created 4 years, 1 month 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 return !m_wantAlphaChannel && rgbEmulation; 223 return !m_wantAlphaChannel && rgbEmulation;
224 } 224 }
225 225
226 std::unique_ptr<cc::SharedBitmap> DrawingBuffer::createOrRecycleBitmap() { 226 std::unique_ptr<cc::SharedBitmap> DrawingBuffer::createOrRecycleBitmap() {
227 auto it = std::remove_if( 227 auto it = std::remove_if(
228 m_recycledBitmaps.begin(), m_recycledBitmaps.end(), 228 m_recycledBitmaps.begin(), m_recycledBitmaps.end(),
229 [this](const RecycledBitmap& bitmap) { return bitmap.size != m_size; }); 229 [this](const RecycledBitmap& bitmap) { return bitmap.size != m_size; });
230 m_recycledBitmaps.shrink(it - m_recycledBitmaps.begin()); 230 m_recycledBitmaps.shrink(it - m_recycledBitmaps.begin());
231 231
232 if (!m_recycledBitmaps.isEmpty()) { 232 if (!m_recycledBitmaps.isEmpty()) {
233 RecycledBitmap recycled = std::move(m_recycledBitmaps.last()); 233 RecycledBitmap recycled = std::move(m_recycledBitmaps.back());
234 m_recycledBitmaps.pop_back(); 234 m_recycledBitmaps.pop_back();
235 DCHECK(recycled.size == m_size); 235 DCHECK(recycled.size == m_size);
236 return std::move(recycled.bitmap); 236 return std::move(recycled.bitmap);
237 } 237 }
238 238
239 return Platform::current()->allocateSharedBitmap(m_size); 239 return Platform::current()->allocateSharedBitmap(m_size);
240 } 240 }
241 241
242 bool DrawingBuffer::PrepareTextureMailbox( 242 bool DrawingBuffer::PrepareTextureMailbox(
243 cc::TextureMailbox* outMailbox, 243 cc::TextureMailbox* outMailbox,
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 if (m_pixelUnpackBufferBindingDirty) 1257 if (m_pixelUnpackBufferBindingDirty)
1258 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); 1258 client->DrawingBufferClientRestorePixelUnpackBufferBinding();
1259 } 1259 }
1260 1260
1261 bool DrawingBuffer::shouldUseChromiumImage() { 1261 bool DrawingBuffer::shouldUseChromiumImage() {
1262 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && 1262 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() &&
1263 m_chromiumImageUsage == AllowChromiumImage; 1263 m_chromiumImageUsage == AllowChromiumImage;
1264 } 1264 }
1265 1265
1266 } // namespace blink 1266 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698