OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // of "dest" is not guaranteed. | 123 // of "dest" is not guaranteed. |
124 HAS_STRICTLY_TYPED_ARG | 124 HAS_STRICTLY_TYPED_ARG |
125 bool getAsBytes(void* dest, STRICTLY_TYPED_ARG(byteLength)) const | 125 bool getAsBytes(void* dest, STRICTLY_TYPED_ARG(byteLength)) const |
126 { | 126 { |
127 STRICT_ARG_TYPE(size_t); | 127 STRICT_ARG_TYPE(size_t); |
128 return getAsBytesInternal(dest, byteLength); | 128 return getAsBytesInternal(dest, byteLength); |
129 } | 129 } |
130 | 130 |
131 // Creates an SkData and copies this SharedBuffer's contents to that | 131 // Creates an SkData and copies this SharedBuffer's contents to that |
132 // SkData without merging segmented buffers into a flat buffer. | 132 // SkData without merging segmented buffers into a flat buffer. |
133 PassRefPtr<SkData> getAsSkData() const; | 133 sk_sp<SkData> getAsSkData() const; |
134 | 134 |
135 // See PurgeableVector::lock(). | 135 // See PurgeableVector::lock(). |
136 bool lock(); | 136 bool lock(); |
137 | 137 |
138 // WARNING: Calling unlock() on a SharedBuffer that wasn't created with the | 138 // WARNING: Calling unlock() on a SharedBuffer that wasn't created with the |
139 // purgeability option does an extra memcpy(). Please use | 139 // purgeability option does an extra memcpy(). Please use |
140 // SharedBuffer::createPurgeable() if you intend to call unlock(). | 140 // SharedBuffer::createPurgeable() if you intend to call unlock(). |
141 void unlock(); | 141 void unlock(); |
142 | 142 |
143 bool isLocked() const; | 143 bool isLocked() const; |
(...skipping 15 matching lines...) Expand all Loading... |
159 size_t getSomeDataInternal(const char*& data, size_t position) const; | 159 size_t getSomeDataInternal(const char*& data, size_t position) const; |
160 | 160 |
161 size_t m_size; | 161 size_t m_size; |
162 mutable PurgeableVector m_buffer; | 162 mutable PurgeableVector m_buffer; |
163 mutable Vector<char*> m_segments; | 163 mutable Vector<char*> m_segments; |
164 }; | 164 }; |
165 | 165 |
166 } // namespace blink | 166 } // namespace blink |
167 | 167 |
168 #endif // SharedBuffer_h | 168 #endif // SharedBuffer_h |
OLD | NEW |