blob: 28641a2bbfa9f35ab87e956d465a1d658212d84e [file] [log] [blame]
// Copyright (C) 2016 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.
package replay
import (
"android.googlesource.com/platform/tools/gpu/framework/log"
"android.googlesource.com/platform/tools/gpu/gapid/atom"
"android.googlesource.com/platform/tools/gpu/gapid/gfxapi"
"android.googlesource.com/platform/tools/gpu/gapid/image"
"android.googlesource.com/platform/tools/gpu/gapid/service"
)
// QueryIssues is the interface implemented by types that can verify the replay
// performs as expected and without errors. The returned chan will receive a
// stream of issues detected while replaying the capture and the chan will close
// after the last issue is sent (if any).
// If the capture includes FramebufferObservation atoms, this also includes
// checking the replayed framebuffer matches (within reasonable error) the
// framebuffer observed at capture time.
type QueryIssues interface {
QueryIssues(
ctx log.Context,
intent Intent,
mgr *Manager,
out chan<- Issue)
}
// QueryFramebufferAttachment is the interface implemented by types that can
// return the content of a framebuffer attachment at a particular point in a
// capture.
type QueryFramebufferAttachment interface {
QueryFramebufferAttachment(
ctx log.Context,
intent Intent,
mgr *Manager,
after atom.ID,
width, height uint32,
attachment gfxapi.FramebufferAttachment,
wireframeMode WireframeMode) (*image.Image, error)
}
// QueryCallDurations is the interface implemented by types that can time the
// duration of each call in a capture.
type QueryCallDurations interface {
QueryCallDurations(
ctx log.Context,
intent Intent,
mgr *Manager,
flags service.TimingFlags,
out chan<- CallTiming)
}
// Issue represents a single replay issue reported by QueryIssues.
type Issue struct {
Atom atom.ID // The atom that reported the issue.
Severity log.Severity // The severity of the issue.
Error error // The issue's error.
}
// CallTiming represents the call timing information for a replay.
type CallTiming struct {
TimingInfo service.TimingInfo // The timing data.
Error error // The error that occurred generating the timing, if there was one.
}