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

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

Issue 2799783008: Implementation of preserveDrawingBuffer:Discard in software (Closed)
Patch Set: Created 3 years, 8 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) 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 outMailbox->set_color_space(m_colorSpace); 317 outMailbox->set_color_space(m_colorSpace);
318 318
319 // This holds a ref on the DrawingBuffer that will keep it alive until the 319 // This holds a ref on the DrawingBuffer that will keep it alive until the
320 // mailbox is released (and while the release callback is running). It also 320 // mailbox is released (and while the release callback is running). It also
321 // owns the SharedBitmap. 321 // owns the SharedBitmap.
322 auto func = WTF::bind(&DrawingBuffer::mailboxReleasedSoftware, 322 auto func = WTF::bind(&DrawingBuffer::mailboxReleasedSoftware,
323 RefPtr<DrawingBuffer>(this), 323 RefPtr<DrawingBuffer>(this),
324 WTF::passed(std::move(bitmap)), m_size); 324 WTF::passed(std::move(bitmap)), m_size);
325 *outReleaseCallback = 325 *outReleaseCallback =
326 cc::SingleReleaseCallback::Create(convertToBaseCallback(std::move(func))); 326 cc::SingleReleaseCallback::Create(convertToBaseCallback(std::move(func)));
327
328 if (m_preserveDrawingBuffer == Discard) {
329 setBufferClearNeeded(true);
330 }
331
327 return true; 332 return true;
328 } 333 }
329 334
330 bool DrawingBuffer::finishPrepareTextureMailboxGpu( 335 bool DrawingBuffer::finishPrepareTextureMailboxGpu(
331 cc::TextureMailbox* outMailbox, 336 cc::TextureMailbox* outMailbox,
332 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) { 337 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) {
333 DCHECK(m_stateRestorer); 338 DCHECK(m_stateRestorer);
334 if (m_webGLVersion > WebGL1) { 339 if (m_webGLVersion > WebGL1) {
335 m_stateRestorer->setPixelUnpackBufferBindingDirty(); 340 m_stateRestorer->setPixelUnpackBufferBindingDirty();
336 m_gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); 341 m_gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 if (m_pixelUnpackBufferBindingDirty) 1301 if (m_pixelUnpackBufferBindingDirty)
1297 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); 1302 client->DrawingBufferClientRestorePixelUnpackBufferBinding();
1298 } 1303 }
1299 1304
1300 bool DrawingBuffer::shouldUseChromiumImage() { 1305 bool DrawingBuffer::shouldUseChromiumImage() {
1301 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && 1306 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() &&
1302 m_chromiumImageUsage == AllowChromiumImage; 1307 m_chromiumImageUsage == AllowChromiumImage;
1303 } 1308 }
1304 1309
1305 } // namespace blink 1310 } // namespace blink
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