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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, getGLFilter()); | 341 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, getGLFilter()); |
342 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 342 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
343 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 343 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
344 | 344 |
345 // Re-use the texture's existing mailbox, if there is one. | 345 // Re-use the texture's existing mailbox, if there is one. |
346 if (mailboxInfo.m_image->getTexture()->getCustomData()) { | 346 if (mailboxInfo.m_image->getTexture()->getCustomData()) { |
347 DCHECK(mailboxInfo.m_image->getTexture()->getCustomData()->size() == siz
eof(mailboxInfo.m_mailbox.name)); | 347 DCHECK(mailboxInfo.m_image->getTexture()->getCustomData()->size() == siz
eof(mailboxInfo.m_mailbox.name)); |
348 memcpy(&mailboxInfo.m_mailbox.name[0], mailboxInfo.m_image->getTexture()
->getCustomData()->data(), sizeof(mailboxInfo.m_mailbox.name)); | 348 memcpy(&mailboxInfo.m_mailbox.name[0], mailboxInfo.m_image->getTexture()
->getCustomData()->data(), sizeof(mailboxInfo.m_mailbox.name)); |
349 } else { | 349 } else { |
350 gl->GenMailboxCHROMIUM(mailboxInfo.m_mailbox.name); | 350 gl->GenMailboxCHROMIUM(mailboxInfo.m_mailbox.name); |
351 RefPtr<SkData> mailboxNameData = adoptRef(SkData::NewWithCopy(&mailboxIn
fo.m_mailbox.name[0], sizeof(mailboxInfo.m_mailbox.name))); | 351 sk_sp<SkData> mailboxNameData = SkData::MakeWithCopy(&mailboxInfo.m_mail
box.name[0], sizeof(mailboxInfo.m_mailbox.name)); |
352 mailboxInfo.m_image->getTexture()->setCustomData(mailboxNameData.get()); | 352 mailboxInfo.m_image->getTexture()->setCustomData(mailboxNameData.get()); |
353 gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailboxInfo.m_mailbox.name); | 353 gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailboxInfo.m_mailbox.name); |
354 } | 354 } |
355 | 355 |
356 if (isHidden()) { | 356 if (isHidden()) { |
357 // With hidden canvases, we release the SkImage immediately because | 357 // With hidden canvases, we release the SkImage immediately because |
358 // there is no need for animations to be double buffered. | 358 // there is no need for animations to be double buffered. |
359 mailboxInfo.m_image.clear(); | 359 mailboxInfo.m_image.clear(); |
360 } else { | 360 } else { |
361 // FIXME: We'd rather insert a syncpoint than perform a flush here, | 361 // FIXME: We'd rather insert a syncpoint than perform a flush here, |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 992 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
993 } | 993 } |
994 | 994 |
995 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) | 995 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) |
996 { | 996 { |
997 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); | 997 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); |
998 hibernationHistogram.count(event); | 998 hibernationHistogram.count(event); |
999 } | 999 } |
1000 | 1000 |
1001 } // namespace blink | 1001 } // namespace blink |
OLD | NEW |