OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 , m_mutex(mutex) | 70 , m_mutex(mutex) |
71 { | 71 { |
72 } | 72 } |
73 | 73 |
74 DiscardablePixelRef::~DiscardablePixelRef() | 74 DiscardablePixelRef::~DiscardablePixelRef() |
75 { | 75 { |
76 } | 76 } |
77 | 77 |
78 bool DiscardablePixelRef::allocAndLockDiscardableMemory(size_t bytes) | 78 bool DiscardablePixelRef::allocAndLockDiscardableMemory(size_t bytes) |
79 { | 79 { |
80 m_discardable = adoptPtr(WebKit::Platform::current()->allocateAndLockDiscard
ableMemory(bytes)); | 80 m_discardable = adoptPtr(blink::Platform::current()->allocateAndLockDiscarda
bleMemory(bytes)); |
81 if (m_discardable) { | 81 if (m_discardable) { |
82 m_lockedMemory = m_discardable->data(); | 82 m_lockedMemory = m_discardable->data(); |
83 return true; | 83 return true; |
84 } | 84 } |
85 return false; | 85 return false; |
86 } | 86 } |
87 | 87 |
88 void* DiscardablePixelRef::onLockPixels(SkColorTable** ctable) | 88 void* DiscardablePixelRef::onLockPixels(SkColorTable** ctable) |
89 { | 89 { |
90 if (!m_lockedMemory && m_discardable->lock()) | 90 if (!m_lockedMemory && m_discardable->lock()) |
(...skipping 12 matching lines...) Expand all Loading... |
103 | 103 |
104 bool DiscardablePixelRef::isDiscardable(SkPixelRef* pixelRef) | 104 bool DiscardablePixelRef::isDiscardable(SkPixelRef* pixelRef) |
105 { | 105 { |
106 // FIXME: DEFINE_STATIC_LOCAL is not thread safe. | 106 // FIXME: DEFINE_STATIC_LOCAL is not thread safe. |
107 // ImageDecodingStore provides the synchronization for this. | 107 // ImageDecodingStore provides the synchronization for this. |
108 DEFINE_STATIC_LOCAL(const SkString, discardable, (labelDiscardable)); | 108 DEFINE_STATIC_LOCAL(const SkString, discardable, (labelDiscardable)); |
109 return pixelRef && pixelRef->getURI() && discardable.equals(pixelRef->getURI
()); | 109 return pixelRef && pixelRef->getURI() && discardable.equals(pixelRef->getURI
()); |
110 } | 110 } |
111 | 111 |
112 } // namespace WebCore | 112 } // namespace WebCore |
OLD | NEW |