OLD | NEW |
---|---|
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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
425 // there is no need for animations to be double buffered. | 425 // there is no need for animations to be double buffered. |
426 mailboxInfo.m_image.reset(); | 426 mailboxInfo.m_image.reset(); |
427 } else { | 427 } else { |
428 // FIXME: We'd rather insert a syncpoint than perform a flush here, | 428 // FIXME: We'd rather insert a syncpoint than perform a flush here, |
429 // but currently the canvas will flicker if we don't flush here. | 429 // but currently the canvas will flicker if we don't flush here. |
430 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); | 430 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); |
431 gl->Flush(); | 431 gl->Flush(); |
432 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken.GetData()); | 432 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken.GetData()); |
433 } | 433 } |
434 mailboxInfo.m_mailbox = mailbox; | 434 mailboxInfo.m_mailbox = mailbox; |
435 *outMailbox = cc::TextureMailbox(mailbox, syncToken, GL_TEXTURE_2D); | 435 *outMailbox = cc::TextureMailbox(mailbox, syncToken, GL_TEXTURE_2D, m_size, |
436 false, false); | |
Justin Novosad
2016/10/25 21:28:16
These "false" literals are bad for code readabilit
dshwang
2016/10/26 15:26:28
Done. Could you review again?
In addition, do you
| |
436 | 437 |
437 gl->BindTexture(GL_TEXTURE_2D, 0); | 438 gl->BindTexture(GL_TEXTURE_2D, 0); |
438 // Because we are changing the texture binding without going through skia, | 439 // Because we are changing the texture binding without going through skia, |
439 // we must dirty the context. | 440 // we must dirty the context. |
440 grContext->resetContext(kTextureBinding_GrGLBackendState); | 441 grContext->resetContext(kTextureBinding_GrGLBackendState); |
441 return true; | 442 return true; |
442 } | 443 } |
443 | 444 |
444 void Canvas2DLayerBridge::resetSkiaTextureBinding() { | 445 void Canvas2DLayerBridge::resetSkiaTextureBinding() { |
445 GrContext* grContext = m_contextProvider->grContext(); | 446 GrContext* grContext = m_contextProvider->grContext(); |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1136 default; | 1137 default; |
1137 | 1138 |
1138 void Canvas2DLayerBridge::Logger::reportHibernationEvent( | 1139 void Canvas2DLayerBridge::Logger::reportHibernationEvent( |
1139 HibernationEvent event) { | 1140 HibernationEvent event) { |
1140 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, | 1141 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, |
1141 ("Canvas.HibernationEvents", HibernationEventCount)); | 1142 ("Canvas.HibernationEvents", HibernationEventCount)); |
1142 hibernationHistogram.count(event); | 1143 hibernationHistogram.count(event); |
1143 } | 1144 } |
1144 | 1145 |
1145 } // namespace blink | 1146 } // namespace blink |
OLD | NEW |