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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 }; | 50 }; |
51 | 51 |
52 #ifndef NDEBUG | 52 #ifndef NDEBUG |
53 WTF::RefCountedLeakCounter& canvas2DLayerBridgeInstanceCounter() | 53 WTF::RefCountedLeakCounter& canvas2DLayerBridgeInstanceCounter() |
54 { | 54 { |
55 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticCanvas2DLayerBridgeIns
tanceCounter, ("Canvas2DLayerBridge")); | 55 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticCanvas2DLayerBridgeIns
tanceCounter, ("Canvas2DLayerBridge")); |
56 return staticCanvas2DLayerBridgeInstanceCounter; | 56 return staticCanvas2DLayerBridgeInstanceCounter; |
57 } | 57 } |
58 #endif | 58 #endif |
59 | 59 |
60 } // unnamed | 60 } // namespace |
61 | 61 |
62 namespace blink { | 62 namespace blink { |
63 | 63 |
64 static PassRefPtr<SkSurface> createSkSurface(GrContext* gr, const IntSize& size,
int msaaSampleCount, OpacityMode opacityMode, bool* surfaceIsAccelerated) | 64 static PassRefPtr<SkSurface> createSkSurface(GrContext* gr, const IntSize& size,
int msaaSampleCount, OpacityMode opacityMode, bool* surfaceIsAccelerated) |
65 { | 65 { |
66 if (gr) | 66 if (gr) |
67 gr->resetContext(); | 67 gr->resetContext(); |
68 | 68 |
69 SkAlphaType alphaType = (Opaque == opacityMode) ? kOpaque_SkAlphaType : kPre
mul_SkAlphaType; | 69 SkAlphaType alphaType = (Opaque == opacityMode) ? kOpaque_SkAlphaType : kPre
mul_SkAlphaType; |
70 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), alphaTy
pe); | 70 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), alphaTy
pe); |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 m_image = other.m_image; | 822 m_image = other.m_image; |
823 m_parentLayerBridge = other.m_parentLayerBridge; | 823 m_parentLayerBridge = other.m_parentLayerBridge; |
824 } | 824 } |
825 | 825 |
826 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) | 826 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) |
827 { | 827 { |
828 blink::Platform::current()->histogramEnumeration("Canvas.HibernationEvents",
event, HibernationEventCount); | 828 blink::Platform::current()->histogramEnumeration("Canvas.HibernationEvents",
event, HibernationEventCount); |
829 } | 829 } |
830 | 830 |
831 } // namespace blink | 831 } // namespace blink |
OLD | NEW |