GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / cc / debug / traced_picture.h
blobb9d232dc3328963478d600956a24bf94b3039b69
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_DEBUG_TRACED_PICTURE_H_
6 #define CC_DEBUG_TRACED_PICTURE_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "base/trace_event/trace_event.h"
12 #include "cc/resources/picture.h"
14 namespace cc {
16 class TracedPicture : public base::trace_event::ConvertableToTraceFormat {
17 public:
18 explicit TracedPicture(scoped_refptr<const Picture>);
20 static scoped_refptr<base::trace_event::ConvertableToTraceFormat>
21 AsTraceablePicture(const Picture* picture);
23 static scoped_refptr<base::trace_event::ConvertableToTraceFormat>
24 AsTraceablePictureAlias(const Picture* original);
26 void AppendAsTraceFormat(std::string* out) const override;
28 private:
29 ~TracedPicture() override;
31 void AppendPicture(std::string* out) const;
32 void AppendPictureAlias(std::string* out) const;
34 scoped_refptr<const Picture> picture_;
35 bool is_alias_;
37 DISALLOW_COPY_AND_ASSIGN(TracedPicture);
40 } // namespace cc
42 #endif // CC_DEBUG_TRACED_PICTURE_H_