diff options
author | Kaan Baloglu <kaanb@google.com> | 2013-02-21 15:22:14 -0800 |
---|---|---|
committer | Kaan Baloglu <kaanb@google.com> | 2013-04-16 16:51:21 -0700 |
commit | c5cde8c18df853e11d1ec528508fd0fe2e742d5c (patch) | |
tree | 605c6327d44da06c4957482730b4b9128bc451d3 /chromium/plat_support/graphic_buffer_impl.h | |
parent | bef5c8e29d2693c07fa32952088de0e46059c461 (diff) | |
download | webview-c5cde8c18df853e11d1ec528508fd0fe2e742d5c.tar.gz |
Implementation of the graphic buffer interface for cc
Change-Id: Ic023e690448abbbae8689d13b3357ec497808ea7
Diffstat (limited to 'chromium/plat_support/graphic_buffer_impl.h')
-rw-r--r-- | chromium/plat_support/graphic_buffer_impl.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/chromium/plat_support/graphic_buffer_impl.h b/chromium/plat_support/graphic_buffer_impl.h new file mode 100644 index 0000000..7db502f --- /dev/null +++ b/chromium/plat_support/graphic_buffer_impl.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Provides the implementation of the GraphicBuffer interface in +// renderer compostior + +#ifndef ANDROID_GRAPHIC_BUFFER_IMPL_H +#define ANDROID_GRAPHIC_BUFFER_IMPL_H + +#include <ui/GraphicBuffer.h> + +namespace android { + +class GraphicBufferImpl { + public: + ~GraphicBufferImpl(); + + static int Create(int w, int h); + static void Release(int buffer_id); + static int LockStatic(int buffer_id, int mode, void** vaddr); + static int UnlockStatic(int buffer_id); + static void* GetNativeBufferStatic(int buffer_id); + static uint32_t GetStrideStatic(int buffer_id); + + private: + status_t Lock(int mode, void** vaddr); + status_t Unlock(); + status_t InitCheck() const; + void* GetNativeBuffer() const; + uint32_t GetStride() const; + GraphicBufferImpl(uint32_t w, uint32_t h); + + sp<android::GraphicBuffer> mBuffer; +}; + +} // namespace android + +#endif // ANDROID_GRAPHIC_BUFFER_IMPL_H |