From 9c1e23baf5bfbebd1aebbd6d9a18c225325567ce Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Thu, 24 Mar 2011 10:51:31 -0700 Subject: Add logging of graphics acceleration info to bugreports Change-Id: I9fa4cda6ccf92df9d1c644ccdc0e7274a30106e0 --- libs/hwui/DisplayListLogBuffer.h | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 libs/hwui/DisplayListLogBuffer.h (limited to 'libs/hwui/DisplayListLogBuffer.h') 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 +#include + +namespace android { +namespace uirenderer { + +class DisplayListLogBuffer: public Singleton { + DisplayListLogBuffer(); + ~DisplayListLogBuffer(); + + friend class Singleton; + +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 -- cgit v1.1