| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 return fromSkSp(surface); | 85 return fromSkSp(surface); |
| 86 } | 86 } |
| 87 | 87 |
| 88 PassRefPtr<Canvas2DLayerBridge> Canvas2DLayerBridge::create(const IntSize& size,
int msaaSampleCount, OpacityMode opacityMode, AccelerationMode accelerationMode
) | 88 PassRefPtr<Canvas2DLayerBridge> Canvas2DLayerBridge::create(const IntSize& size,
int msaaSampleCount, OpacityMode opacityMode, AccelerationMode accelerationMode
) |
| 89 { | 89 { |
| 90 TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation", TRACE_EVENT_
SCOPE_GLOBAL); | 90 TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation", TRACE_EVENT_
SCOPE_GLOBAL); |
| 91 OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::cu
rrent()->createSharedOffscreenGraphicsContext3DProvider()); | 91 OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::cu
rrent()->createSharedOffscreenGraphicsContext3DProvider()); |
| 92 if (!contextProvider) | 92 if (!contextProvider) |
| 93 return nullptr; | 93 return nullptr; |
| 94 RefPtr<Canvas2DLayerBridge> layerBridge; | 94 RefPtr<Canvas2DLayerBridge> layerBridge; |
| 95 layerBridge = adoptRef(new Canvas2DLayerBridge(contextProvider.release(), si
ze, msaaSampleCount, opacityMode, accelerationMode)); | 95 layerBridge = adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), s
ize, msaaSampleCount, opacityMode, accelerationMode)); |
| 96 return layerBridge.release(); | 96 return layerBridge.release(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 Canvas2DLayerBridge::Canvas2DLayerBridge(PassOwnPtr<WebGraphicsContext3DProvider
> contextProvider, const IntSize& size, int msaaSampleCount, OpacityMode opacity
Mode, AccelerationMode accelerationMode) | 99 Canvas2DLayerBridge::Canvas2DLayerBridge(PassOwnPtr<WebGraphicsContext3DProvider
> contextProvider, const IntSize& size, int msaaSampleCount, OpacityMode opacity
Mode, AccelerationMode accelerationMode) |
| 100 : m_contextProvider(std::move(contextProvider)) | 100 : m_contextProvider(std::move(contextProvider)) |
| 101 , m_logger(adoptPtr(new Logger)) | 101 , m_logger(adoptPtr(new Logger)) |
| 102 , m_weakPtrFactory(this) | 102 , m_weakPtrFactory(this) |
| 103 , m_imageBuffer(0) | 103 , m_imageBuffer(0) |
| 104 , m_msaaSampleCount(msaaSampleCount) | 104 , m_msaaSampleCount(msaaSampleCount) |
| 105 , m_bytesAllocated(0) | 105 , m_bytesAllocated(0) |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 983 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
| 984 } | 984 } |
| 985 | 985 |
| 986 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) | 986 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) |
| 987 { | 987 { |
| 988 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); | 988 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); |
| 989 hibernationHistogram.count(event); | 989 hibernationHistogram.count(event); |
| 990 } | 990 } |
| 991 | 991 |
| 992 } // namespace blink | 992 } // namespace blink |
| OLD | NEW |