diff options
author | Chet Haase <chet@google.com> | 2011-03-24 10:51:31 -0700 |
---|---|---|
committer | Chet Haase <chet@google.com> | 2011-04-01 13:24:53 -0700 |
commit | 9c1e23baf5bfbebd1aebbd6d9a18c225325567ce (patch) | |
tree | 00eeed008fc5b296391adfcb20a610e37849cf87 /libs/hwui/DisplayListLogBuffer.h | |
parent | 827107f4ec7d9a53d7bb6e4071858252f263fa8c (diff) | |
download | frameworks_base-9c1e23baf5bfbebd1aebbd6d9a18c225325567ce.zip frameworks_base-9c1e23baf5bfbebd1aebbd6d9a18c225325567ce.tar.gz frameworks_base-9c1e23baf5bfbebd1aebbd6d9a18c225325567ce.tar.bz2 |
Add logging of graphics acceleration info to bugreports
Change-Id: I9fa4cda6ccf92df9d1c644ccdc0e7274a30106e0
Diffstat (limited to 'libs/hwui/DisplayListLogBuffer.h')
-rw-r--r-- | libs/hwui/DisplayListLogBuffer.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/libs/hwui/DisplayListLogBuffer.h b/libs/hwui/DisplayListLogBuffer.h new file mode 100644 index 0000000..bf16f29 --- /dev/null +++ b/libs/hwui/DisplayListLogBuffer.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 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. + */ + +#ifndef ANDROID_HWUI_DISPLAY_LIST_LOG_BUFFER_H +#define ANDROID_HWUI_DISPLAY_LIST_LOG_BUFFER_H + +#include <utils/Singleton.h> +#include <stdio.h> + +namespace android { +namespace uirenderer { + +class DisplayListLogBuffer: public Singleton<DisplayListLogBuffer> { + DisplayListLogBuffer(); + ~DisplayListLogBuffer(); + + friend class Singleton<DisplayListLogBuffer>; + +public: + void writeCommand(int level, int op); + void writeInt(int value); + void outputCommands(FILE *file, const char* opNames[]); + + bool isEmpty() { + return (mStart == mEnd); + } + +private: + int *mBufferFirst; // where the memory starts + int* mStart; // where the current command stream starts + int* mEnd; // where the current commands end + int* mBufferLast; // where the buffer memory ends + +}; + +}; // namespace uirenderer +}; // namespace android + +#endif // ANDROID_HWUI_DISPLAY_LIST_LOG_BUFFER_H |