| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 , m_next(0) | 53 , m_next(0) |
| 54 , m_prev(0) | 54 , m_prev(0) |
| 55 , m_lastImageId(0) | 55 , m_lastImageId(0) |
| 56 { | 56 { |
| 57 ASSERT(m_canvas); | 57 ASSERT(m_canvas); |
| 58 // Used by browser tests to detect the use of a Canvas2DLayerBridge. | 58 // Used by browser tests to detect the use of a Canvas2DLayerBridge. |
| 59 TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation"); | 59 TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation"); |
| 60 m_canvas->setNotificationClient(this); | 60 m_canvas->setNotificationClient(this); |
| 61 m_layer = adoptPtr(WebKit::Platform::current()->compositorSupport()->createE
xternalTextureLayer(this)); | 61 m_layer = adoptPtr(WebKit::Platform::current()->compositorSupport()->createE
xternalTextureLayer(this)); |
| 62 m_layer->setOpaque(opacityMode == Opaque); | 62 m_layer->setOpaque(opacityMode == Opaque); |
| 63 m_layer->setBlendBackgroundColor(opacityMode != Opaque); |
| 63 GraphicsLayer::registerContentsLayer(m_layer->layer()); | 64 GraphicsLayer::registerContentsLayer(m_layer->layer()); |
| 64 m_layer->setRateLimitContext(m_rateLimitingEnabled); | 65 m_layer->setRateLimitContext(m_rateLimitingEnabled); |
| 65 } | 66 } |
| 66 | 67 |
| 67 Canvas2DLayerBridge::~Canvas2DLayerBridge() | 68 Canvas2DLayerBridge::~Canvas2DLayerBridge() |
| 68 { | 69 { |
| 69 GraphicsLayer::unregisterContentsLayer(m_layer->layer()); | 70 GraphicsLayer::unregisterContentsLayer(m_layer->layer()); |
| 70 Canvas2DLayerManager::get().layerToBeDestroyed(this); | 71 Canvas2DLayerManager::get().layerToBeDestroyed(this); |
| 71 m_canvas->setNotificationClient(0); | 72 m_canvas->setNotificationClient(0); |
| 72 m_layer->clearTexture(); | 73 m_layer->clearTexture(); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { | 271 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { |
| 271 // This copy constructor should only be used for Vector reallocation | 272 // This copy constructor should only be used for Vector reallocation |
| 272 // Assuming 'other' is to be destroyed, we swap m_image ownership | 273 // Assuming 'other' is to be destroyed, we swap m_image ownership |
| 273 // rather than do a refcount dance. | 274 // rather than do a refcount dance. |
| 274 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); | 275 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); |
| 275 m_image.swap(const_cast<SkAutoTUnref<SkImage>*>(&other.m_image)); | 276 m_image.swap(const_cast<SkAutoTUnref<SkImage>*>(&other.m_image)); |
| 276 m_status = other.m_status; | 277 m_status = other.m_status; |
| 277 } | 278 } |
| 278 | 279 |
| 279 } | 280 } |
| OLD | NEW |