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

Side by Side Diff: Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 660083002: Remove usage of kReturnToCache_FlagBit in C2D layer bridge. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 if (!mailboxInfo) 312 if (!mailboxInfo)
313 return; 313 return;
314 314
315 ASSERT(mailboxInfo->m_status == MailboxReleased); 315 ASSERT(mailboxInfo->m_status == MailboxReleased);
316 if (mailboxInfo->m_mailbox.syncPoint) { 316 if (mailboxInfo->m_mailbox.syncPoint) {
317 context()->waitSyncPoint(mailboxInfo->m_mailbox.syncPoint); 317 context()->waitSyncPoint(mailboxInfo->m_mailbox.syncPoint);
318 mailboxInfo->m_mailbox.syncPoint = 0; 318 mailboxInfo->m_mailbox.syncPoint = 0;
319 } 319 }
320 // Invalidate texture state in case the compositor altered it since the copy -on-write. 320 // Invalidate texture state in case the compositor altered it since the copy -on-write.
321 if (mailboxInfo->m_image) { 321 if (mailboxInfo->m_image) {
322 if (isHidden() || releasedMailboxHasExpired())
323 mailboxInfo->m_image->getTexture()->resetFlag(static_cast<GrTextureF lags>(GrTexture::kReturnToCache_FlagBit));
324 mailboxInfo->m_image->getTexture()->textureParamsModified(); 322 mailboxInfo->m_image->getTexture()->textureParamsModified();
325 mailboxInfo->m_image.clear(); 323 mailboxInfo->m_image.clear();
326 } 324 }
327 mailboxInfo->m_status = MailboxAvailable; 325 mailboxInfo->m_status = MailboxAvailable;
328 m_releasedMailboxInfoIndex = InvalidMailboxIndex; 326 m_releasedMailboxInfoIndex = InvalidMailboxIndex;
329 Canvas2DLayerManager::get().layerTransientResourceAllocationChanged(this); 327 Canvas2DLayerManager::get().layerTransientResourceAllocationChanged(this);
330 } 328 }
331 329
332 WebGraphicsContext3D* Canvas2DLayerBridge::context() 330 WebGraphicsContext3D* Canvas2DLayerBridge::context()
333 { 331 {
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // This copy constructor should only be used for Vector reallocation 592 // This copy constructor should only be used for Vector reallocation
595 // Assuming 'other' is to be destroyed, we transfer m_image and 593 // Assuming 'other' is to be destroyed, we transfer m_image and
596 // m_parentLayerBridge ownership rather than do a refcount dance. 594 // m_parentLayerBridge ownership rather than do a refcount dance.
597 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); 595 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox));
598 m_image = const_cast<MailboxInfo*>(&other)->m_image.release(); 596 m_image = const_cast<MailboxInfo*>(&other)->m_image.release();
599 m_parentLayerBridge = const_cast<MailboxInfo*>(&other)->m_parentLayerBridge. release(); 597 m_parentLayerBridge = const_cast<MailboxInfo*>(&other)->m_parentLayerBridge. release();
600 m_status = other.m_status; 598 m_status = other.m_status;
601 } 599 }
602 600
603 } // namespace blink 601 } // 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