| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 MailboxInfo tmp; | 301 MailboxInfo tmp; |
| 302 tmp.m_parentLayerBridge = this; | 302 tmp.m_parentLayerBridge = this; |
| 303 m_mailboxes.prepend(tmp); | 303 m_mailboxes.prepend(tmp); |
| 304 } | 304 } |
| 305 | 305 |
| 306 bool Canvas2DLayerBridge::prepareMailboxFromImage(PassRefPtr<SkImage> image, Web
ExternalTextureMailbox* outMailbox) | 306 bool Canvas2DLayerBridge::prepareMailboxFromImage(PassRefPtr<SkImage> image, Web
ExternalTextureMailbox* outMailbox) |
| 307 { | 307 { |
| 308 createMailboxInfo(); | 308 createMailboxInfo(); |
| 309 MailboxInfo& mailboxInfo = m_mailboxes.first(); | 309 MailboxInfo& mailboxInfo = m_mailboxes.first(); |
| 310 mailboxInfo.m_mailbox.nearestNeighbor = getGLFilter() == GL_NEAREST; | 310 mailboxInfo.m_mailbox.nearestNeighbor = getGLFilter() == GL_NEAREST; |
| 311 mailboxInfo.m_mailbox.textureSize = WebSize(m_size.width(), m_size.height())
; |
| 311 | 312 |
| 312 GrContext* grContext = m_contextProvider->grContext(); | 313 GrContext* grContext = m_contextProvider->grContext(); |
| 313 if (!grContext) { | 314 if (!grContext) { |
| 314 mailboxInfo.m_image = image; | 315 mailboxInfo.m_image = image; |
| 315 return true; // for testing: skip gl stuff when using a mock graphics co
ntext. | 316 return true; // for testing: skip gl stuff when using a mock graphics co
ntext. |
| 316 } | 317 } |
| 317 | 318 |
| 318 #if USE_IOSURFACE_FOR_2D_CANVAS | 319 #if USE_IOSURFACE_FOR_2D_CANVAS |
| 319 if (RuntimeEnabledFeatures::canvas2dImageChromiumEnabled()) { | 320 if (RuntimeEnabledFeatures::canvas2dImageChromiumEnabled()) { |
| 320 if (prepareIOSurfaceMailboxFromImage(image.get(), outMailbox)) | 321 if (prepareIOSurfaceMailboxFromImage(image.get(), outMailbox)) |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 990 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
| 990 } | 991 } |
| 991 | 992 |
| 992 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) | 993 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) |
| 993 { | 994 { |
| 994 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); | 995 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); |
| 995 hibernationHistogram.count(event); | 996 hibernationHistogram.count(event); |
| 996 } | 997 } |
| 997 | 998 |
| 998 } // namespace blink | 999 } // namespace blink |
| OLD | NEW |