Flutter Engine
mock_texture.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter 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 #include "flutter/flow/testing/mock_texture.h"
6 
7 namespace flutter {
8 namespace testing {
9 
10 MockTexture::MockTexture(int64_t textureId) : Texture(textureId) {}
11 
12 void MockTexture::Paint(SkCanvas& canvas,
13  const SkRect& bounds,
14  bool freeze,
15  GrDirectContext* context,
16  SkFilterQuality filter_quality) {
17  paint_calls_.emplace_back(
18  PaintCall{canvas, bounds, freeze, context, filter_quality});
19 }
20 
22  const MockTexture::PaintCall& b) {
23  return &a.canvas == &b.canvas && a.bounds == b.bounds &&
24  a.context == b.context && a.freeze == b.freeze &&
26 }
27 
28 std::ostream& operator<<(std::ostream& os, const MockTexture::PaintCall& data) {
29  return os << &data.canvas << " " << data.bounds << " " << data.context << " "
30  << data.freeze << " " << data.filter_quality;
31 }
32 
33 } // namespace testing
34 } // namespace flutter
std::ostream & operator<<(std::ostream &os, const MockTexture::PaintCall &data)
Definition: mock_texture.cc:28
MockTexture(int64_t textureId)
Definition: mock_texture.cc:10
void Paint(SkCanvas &canvas, const SkRect &bounds, bool freeze, GrDirectContext *context, SkFilterQuality filter_quality) override
Definition: mock_texture.cc:12
bool operator==(const MockTexture::PaintCall &a, const MockTexture::PaintCall &b)
Definition: mock_texture.cc:21