Home | History | Annotate | Download | only in service
      1 // Copyright (c) 2012 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.
      4 
      5 // This file contains the GPUTrace class.
      6 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_
      7 #define GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_
      8 
      9 #include <string>
     10 
     11 #include "base/basictypes.h"
     12 #include "base/memory/scoped_ptr.h"
     13 
     14 namespace gpu {
     15 namespace gles2 {
     16 
     17 // Traces GPU Commands.
     18 class GPUTracer {
     19  public:
     20   static scoped_ptr<GPUTracer> Create();
     21 
     22   GPUTracer() {}
     23   virtual ~GPUTracer() {}
     24 
     25   // Begin a trace.
     26   virtual bool Begin(const std::string& name) = 0;
     27 
     28   // End the last started trace.
     29   virtual bool End() = 0;
     30 
     31   // Retrieve the name of the current open trace.
     32   // Returns empty string if no current open trace.
     33   virtual const std::string& CurrentName() const = 0;
     34 
     35  private:
     36   DISALLOW_COPY_AND_ASSIGN(GPUTracer);
     37 };
     38 
     39 }  // namespace gles2
     40 }  // namespace gpu
     41 
     42 #endif  // GPU_COMMAND_BUFFER_SERVICE_GPU_TRACER_H_
     43