Flutter Engine
embedder_assertions.h File Reference
#include <sstream>
#include "flutter/fml/logging.h"
#include "flutter/shell/platform/embedder/embedder.h"
#include "flutter/shell/platform/embedder/embedder_engine.h"
#include "flutter/testing/assertions.h"
#include "gtest/gtest.h"
#include "third_party/skia/include/core/SkPoint.h"
#include "third_party/skia/include/core/SkSize.h"

Go to the source code of this file.

Functions

bool operator== (const FlutterPoint &a, const FlutterPoint &b)
 
bool operator== (const FlutterRect &a, const FlutterRect &b)
 
bool operator== (const FlutterSize &a, const FlutterSize &b)
 
bool operator== (const FlutterRoundedRect &a, const FlutterRoundedRect &b)
 
bool operator== (const FlutterTransformation &a, const FlutterTransformation &b)
 
bool operator== (const FlutterOpenGLTexture &a, const FlutterOpenGLTexture &b)
 
bool operator== (const FlutterOpenGLFramebuffer &a, const FlutterOpenGLFramebuffer &b)
 
bool operator== (const FlutterMetalTexture &a, const FlutterMetalTexture &b)
 
bool operator== (const FlutterMetalBackingStore &a, const FlutterMetalBackingStore &b)
 
bool operator== (const FlutterOpenGLBackingStore &a, const FlutterOpenGLBackingStore &b)
 
bool operator== (const FlutterSoftwareBackingStore &a, const FlutterSoftwareBackingStore &b)
 
bool operator== (const FlutterBackingStore &a, const FlutterBackingStore &b)
 
bool operator== (const FlutterPlatformViewMutation &a, const FlutterPlatformViewMutation &b)
 
bool operator== (const FlutterPlatformView &a, const FlutterPlatformView &b)
 
bool operator== (const FlutterLayer &a, const FlutterLayer &b)
 
std::ostream & operator<< (std::ostream &out, const FlutterPoint &point)
 
std::ostream & operator<< (std::ostream &out, const FlutterRect &r)
 
std::ostream & operator<< (std::ostream &out, const FlutterSize &size)
 
std::ostream & operator<< (std::ostream &out, const FlutterRoundedRect &r)
 
std::ostream & operator<< (std::ostream &out, const FlutterTransformation &t)
 
std::string FlutterLayerContentTypeToString (FlutterLayerContentType type)
 
std::string FlutterBackingStoreTypeToString (FlutterBackingStoreType type)
 
std::ostream & operator<< (std::ostream &out, const FlutterOpenGLTexture &item)
 
std::ostream & operator<< (std::ostream &out, const FlutterOpenGLFramebuffer &item)
 
std::ostream & operator<< (std::ostream &out, const FlutterMetalTexture &item)
 
std::string FlutterPlatformViewMutationTypeToString (FlutterPlatformViewMutationType type)
 
std::ostream & operator<< (std::ostream &out, const FlutterPlatformViewMutation &m)
 
std::ostream & operator<< (std::ostream &out, const FlutterPlatformView &platform_view)
 
std::string FlutterOpenGLTargetTypeToString (FlutterOpenGLTargetType type)
 
std::ostream & operator<< (std::ostream &out, const FlutterOpenGLBackingStore &item)
 
std::ostream & operator<< (std::ostream &out, const FlutterSoftwareBackingStore &item)
 
std::ostream & operator<< (std::ostream &out, const FlutterMetalBackingStore &item)
 
std::ostream & operator<< (std::ostream &out, const FlutterBackingStore &backing_store)
 
std::ostream & operator<< (std::ostream &out, const FlutterLayer &layer)
 
FlutterPoint FlutterPointMake (double x, double y)
 
FlutterSize FlutterSizeMake (double width, double height)
 
FlutterSize FlutterSizeMake (const SkVector &vector)
 
FlutterTransformation FlutterTransformationMake (const SkMatrix &matrix)
 
SkMatrix SkMatrixMake (const FlutterTransformation &xformation)
 
flutter::EmbedderEngineToEmbedderEngine (const FlutterEngine &engine)
 
FlutterRect FlutterRectMake (const SkRect &rect)
 
FlutterRect FlutterRectMakeLTRB (double l, double t, double r, double b)
 
SkRect SkRectMake (const FlutterRect &rect)
 
FlutterRoundedRect FlutterRoundedRectMake (const SkRRect &rect)
 

Function Documentation

◆ FlutterBackingStoreTypeToString()

std::string FlutterBackingStoreTypeToString ( FlutterBackingStoreType  type)
inline

Definition at line 224 of file embedder_assertions.h.

References kFlutterBackingStoreTypeMetal, kFlutterBackingStoreTypeOpenGL, and kFlutterBackingStoreTypeSoftware.

Referenced by operator<<().

225  {
226  switch (type) {
228  return "kFlutterBackingStoreTypeOpenGL";
230  return "kFlutterBackingStoreTypeSoftware";
232  return "kFlutterBackingStoreTypeMetal";
233  }
234  return "Unknown";
235 }
KeyCallType type
Specified an software allocation for Flutter to render into using the CPU.
Definition: embedder.h:1048
Specifies a Metal backing store. This is backed by a Metal texture.
Definition: embedder.h:1050

◆ FlutterLayerContentTypeToString()

std::string FlutterLayerContentTypeToString ( FlutterLayerContentType  type)
inline

Definition at line 213 of file embedder_assertions.h.

References kFlutterLayerContentTypeBackingStore, and kFlutterLayerContentTypePlatformView.

Referenced by operator<<().

214  {
215  switch (type) {
217  return "kFlutterLayerContentTypeBackingStore";
219  return "kFlutterLayerContentTypePlatformView";
220  }
221  return "Unknown";
222 }
KeyCallType type
Indicates that the contents of this layer are determined by the embedder.
Definition: embedder.h:1087

◆ FlutterOpenGLTargetTypeToString()

std::string FlutterOpenGLTargetTypeToString ( FlutterOpenGLTargetType  type)
inline

Definition at line 311 of file embedder_assertions.h.

References kFlutterOpenGLTargetTypeFramebuffer, and kFlutterOpenGLTargetTypeTexture.

Referenced by operator<<().

312  {
313  switch (type) {
315  return "kFlutterOpenGLTargetTypeTexture";
317  return "kFlutterOpenGLTargetTypeFramebuffer";
318  }
319  return "Unknown";
320 }
KeyCallType type

◆ FlutterPlatformViewMutationTypeToString()

std::string FlutterPlatformViewMutationTypeToString ( FlutterPlatformViewMutationType  type)
inline

Definition at line 259 of file embedder_assertions.h.

References kFlutterPlatformViewMutationTypeClipRect, kFlutterPlatformViewMutationTypeClipRoundedRect, kFlutterPlatformViewMutationTypeOpacity, and kFlutterPlatformViewMutationTypeTransformation.

Referenced by operator<<().

260  {
261  switch (type) {
263  return "kFlutterPlatformViewMutationTypeOpacity";
265  return "kFlutterPlatformViewMutationTypeClipRect";
267  return "kFlutterPlatformViewMutationTypeClipRoundedRect";
269  return "kFlutterPlatformViewMutationTypeTransformation";
270  }
271  return "Unknown";
272 }
KeyCallType type

◆ FlutterPointMake()

FlutterPoint FlutterPointMake ( double  x,
double  y 
)
inline

Definition at line 394 of file embedder_assertions.h.

References FlutterPoint::x, and FlutterPoint::y.

Referenced by flutter::testing::TEST_F().

394  {
395  FlutterPoint point = {};
396  point.x = x;
397  point.y = y;
398  return point;
399 }
A structure to represent a 2D point.
Definition: embedder.h:341
double y
Definition: embedder.h:343
double x
Definition: embedder.h:342

◆ FlutterRectMake()

FlutterRect FlutterRectMake ( const SkRect &  rect)
inline

Definition at line 446 of file embedder_assertions.h.

References FlutterRect::bottom, FlutterRect::left, FlutterRect::right, and FlutterRect::top.

Referenced by FlutterRoundedRectMake(), and flutter::testing::TEST_F().

446  {
447  FlutterRect r = {};
448  r.left = rect.left();
449  r.top = rect.top();
450  r.right = rect.right();
451  r.bottom = rect.bottom();
452  return r;
453 }
double right
Definition: embedder.h:336
double top
Definition: embedder.h:335
A structure to represent a rectangle.
Definition: embedder.h:333
double left
Definition: embedder.h:334
double bottom
Definition: embedder.h:337

◆ FlutterRectMakeLTRB()

FlutterRect FlutterRectMakeLTRB ( double  l,
double  t,
double  r,
double  b 
)
inline

Definition at line 455 of file embedder_assertions.h.

References FlutterRect::bottom, FlutterRect::left, FlutterRect::right, and FlutterRect::top.

455  {
456  FlutterRect rect = {};
457  rect.left = l;
458  rect.top = t;
459  rect.right = r;
460  rect.bottom = b;
461  return rect;
462 }
double right
Definition: embedder.h:336
double top
Definition: embedder.h:335
A structure to represent a rectangle.
Definition: embedder.h:333
double left
Definition: embedder.h:334
double bottom
Definition: embedder.h:337

◆ FlutterRoundedRectMake()

FlutterRoundedRect FlutterRoundedRectMake ( const SkRRect &  rect)
inline

Definition at line 468 of file embedder_assertions.h.

References FlutterRectMake(), FlutterSizeMake(), FlutterRoundedRect::lower_left_corner_radius, FlutterRoundedRect::lower_right_corner_radius, FlutterRoundedRect::rect, FlutterRoundedRect::upper_left_corner_radius, and FlutterRoundedRect::upper_right_corner_radius.

Referenced by flutter::testing::TEST_F().

468  {
469  FlutterRoundedRect r = {};
470  r.rect = FlutterRectMake(rect.rect());
472  FlutterSizeMake(rect.radii(SkRRect::Corner::kUpperLeft_Corner));
474  FlutterSizeMake(rect.radii(SkRRect::Corner::kUpperRight_Corner));
476  FlutterSizeMake(rect.radii(SkRRect::Corner::kLowerRight_Corner));
478  FlutterSizeMake(rect.radii(SkRRect::Corner::kLowerLeft_Corner));
479  return r;
480 }
FlutterRect FlutterRectMake(const SkRect &rect)
FlutterSize upper_left_corner_radius
Definition: embedder.h:349
FlutterSize upper_right_corner_radius
Definition: embedder.h:350
FlutterSize FlutterSizeMake(double width, double height)
FlutterSize lower_right_corner_radius
Definition: embedder.h:351
A structure to represent a rounded rectangle.
Definition: embedder.h:347
FlutterSize lower_left_corner_radius
Definition: embedder.h:352
FlutterRect rect
Definition: embedder.h:348

◆ FlutterSizeMake() [1/2]

FlutterSize FlutterSizeMake ( double  width,
double  height 
)
inline

Definition at line 401 of file embedder_assertions.h.

References height, FlutterSize::height, fml::size(), width, and FlutterSize::width.

Referenced by FlutterRoundedRectMake(), and flutter::testing::TEST_F().

401  {
402  FlutterSize size = {};
403  size.width = width;
404  size.height = height;
405  return size;
406 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
double width
Definition: embedder.h:320
A structure to represent the width and height.
Definition: embedder.h:319
int32_t width
int32_t height
double height
Definition: embedder.h:321

◆ FlutterSizeMake() [2/2]

FlutterSize FlutterSizeMake ( const SkVector &  vector)
inline

Definition at line 408 of file embedder_assertions.h.

References FlutterSize::height, fml::size(), and FlutterSize::width.

408  {
409  FlutterSize size = {};
410  size.width = vector.x();
411  size.height = vector.y();
412  return size;
413 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
double width
Definition: embedder.h:320
A structure to represent the width and height.
Definition: embedder.h:319
double height
Definition: embedder.h:321

◆ FlutterTransformationMake()

FlutterTransformation FlutterTransformationMake ( const SkMatrix &  matrix)
inline

Definition at line 415 of file embedder_assertions.h.

References FlutterTransformation::pers0, FlutterTransformation::pers1, FlutterTransformation::pers2, FlutterTransformation::scaleX, FlutterTransformation::scaleY, FlutterTransformation::skewX, FlutterTransformation::skewY, FlutterTransformation::transX, and FlutterTransformation::transY.

Referenced by flutter::testing::EmbedderTestContext::GetRootSurfaceTransformation(), and flutter::testing::TEST_F().

415  {
416  FlutterTransformation transformation = {};
417  transformation.scaleX = matrix[SkMatrix::kMScaleX];
418  transformation.skewX = matrix[SkMatrix::kMSkewX];
419  transformation.transX = matrix[SkMatrix::kMTransX];
420  transformation.skewY = matrix[SkMatrix::kMSkewY];
421  transformation.scaleY = matrix[SkMatrix::kMScaleY];
422  transformation.transY = matrix[SkMatrix::kMTransY];
423  transformation.pers0 = matrix[SkMatrix::kMPersp0];
424  transformation.pers1 = matrix[SkMatrix::kMPersp1];
425  transformation.pers2 = matrix[SkMatrix::kMPersp2];
426  return transformation;
427 }
double skewY
vertical skew factor
Definition: embedder.h:238
double skewX
horizontal skew factor
Definition: embedder.h:234
double pers1
input y-axis perspective factor
Definition: embedder.h:246
double pers2
perspective scale factor
Definition: embedder.h:248
double pers0
input x-axis perspective factor
Definition: embedder.h:244
double scaleY
vertical scale factor
Definition: embedder.h:240
double transX
horizontal translation
Definition: embedder.h:236
double transY
vertical translation
Definition: embedder.h:242
double scaleX
horizontal scale factor
Definition: embedder.h:232

◆ operator<<() [1/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterPoint point 
)
inline

Definition at line 176 of file embedder_assertions.h.

References FlutterPoint::x, and FlutterPoint::y.

176  {
177  return out << "(" << point.x << ", " << point.y << ")";
178 }
double y
Definition: embedder.h:343
double x
Definition: embedder.h:342

◆ operator<<() [2/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterRect r 
)
inline

Definition at line 180 of file embedder_assertions.h.

References FlutterRect::bottom, FlutterRect::left, FlutterRect::right, and FlutterRect::top.

180  {
181  return out << "LTRB (" << r.left << ", " << r.top << ", " << r.right << ", "
182  << r.bottom << ")";
183 }
double right
Definition: embedder.h:336
double top
Definition: embedder.h:335
double left
Definition: embedder.h:334
double bottom
Definition: embedder.h:337

◆ operator<<() [3/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterSize size 
)
inline

Definition at line 185 of file embedder_assertions.h.

References FlutterSize::height, and FlutterSize::width.

185  {
186  return out << "(" << size.width << ", " << size.height << ")";
187 }
double width
Definition: embedder.h:320
double height
Definition: embedder.h:321

◆ operator<<() [4/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterRoundedRect r 
)
inline

Definition at line 189 of file embedder_assertions.h.

References FlutterRoundedRect::lower_left_corner_radius, FlutterRoundedRect::lower_right_corner_radius, FlutterRoundedRect::rect, FlutterRoundedRect::upper_left_corner_radius, and FlutterRoundedRect::upper_right_corner_radius.

190  {
191  out << "Rect: " << r.rect << ", ";
192  out << "Upper Left Corner Radius: " << r.upper_left_corner_radius << ", ";
193  out << "Upper Right Corner Radius: " << r.upper_right_corner_radius << ", ";
194  out << "Lower Right Corner Radius: " << r.lower_right_corner_radius << ", ";
195  out << "Lower Left Corner Radius: " << r.lower_left_corner_radius;
196  return out;
197 }
FlutterSize upper_left_corner_radius
Definition: embedder.h:349
FlutterSize upper_right_corner_radius
Definition: embedder.h:350
FlutterSize lower_right_corner_radius
Definition: embedder.h:351
FlutterSize lower_left_corner_radius
Definition: embedder.h:352
FlutterRect rect
Definition: embedder.h:348

◆ operator<<() [5/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterTransformation t 
)
inline

Definition at line 199 of file embedder_assertions.h.

References FlutterTransformation::pers0, FlutterTransformation::pers1, FlutterTransformation::pers2, FlutterTransformation::scaleX, FlutterTransformation::scaleY, FlutterTransformation::skewX, FlutterTransformation::skewY, FlutterTransformation::transX, and FlutterTransformation::transY.

200  {
201  out << "Scale X: " << t.scaleX << ", ";
202  out << "Skew X: " << t.skewX << ", ";
203  out << "Trans X: " << t.transX << ", ";
204  out << "Skew Y: " << t.skewY << ", ";
205  out << "Scale Y: " << t.scaleY << ", ";
206  out << "Trans Y: " << t.transY << ", ";
207  out << "Pers 0: " << t.pers0 << ", ";
208  out << "Pers 1: " << t.pers1 << ", ";
209  out << "Pers 2: " << t.pers2;
210  return out;
211 }
double skewY
vertical skew factor
Definition: embedder.h:238
double skewX
horizontal skew factor
Definition: embedder.h:234
double pers1
input y-axis perspective factor
Definition: embedder.h:246
double pers2
perspective scale factor
Definition: embedder.h:248
double pers0
input x-axis perspective factor
Definition: embedder.h:244
double scaleY
vertical scale factor
Definition: embedder.h:240
double transX
horizontal translation
Definition: embedder.h:236
double transY
vertical translation
Definition: embedder.h:242
double scaleX
horizontal scale factor
Definition: embedder.h:232

◆ operator<<() [6/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterOpenGLTexture item 
)
inline

Definition at line 237 of file embedder_assertions.h.

References FlutterOpenGLTexture::destruction_callback, FlutterOpenGLTexture::format, FlutterOpenGLTexture::name, FlutterOpenGLTexture::target, and FlutterOpenGLTexture::user_data.

238  {
239  return out << "(FlutterOpenGLTexture) Target: 0x" << std::hex << item.target
240  << std::dec << " Name: " << item.name << " Format: " << item.format
241  << " User Data: " << item.user_data << " Destruction Callback: "
242  << reinterpret_cast<void*>(item.destruction_callback);
243 }
VoidCallback destruction_callback
Definition: embedder.h:274
uint32_t name
The name of the texture.
Definition: embedder.h:267
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:271
uint32_t format
The texture format (example GL_RGBA8).
Definition: embedder.h:269

◆ operator<<() [7/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterOpenGLFramebuffer item 
)
inline

Definition at line 245 of file embedder_assertions.h.

References FlutterOpenGLFramebuffer::destruction_callback, FlutterOpenGLFramebuffer::name, FlutterOpenGLFramebuffer::target, and FlutterOpenGLFramebuffer::user_data.

246  {
247  return out << "(FlutterOpenGLFramebuffer) Target: 0x" << std::hex
248  << item.target << std::dec << " Name: " << item.name
249  << " User Data: " << item.user_data << " Destruction Callback: "
250  << reinterpret_cast<void*>(item.destruction_callback);
251 }
VoidCallback destruction_callback
Definition: embedder.h:299
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:295
uint32_t name
The name of the framebuffer.
Definition: embedder.h:292

◆ operator<<() [8/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterMetalTexture item 
)
inline

Definition at line 253 of file embedder_assertions.h.

References FlutterMetalTexture::texture, and FlutterMetalTexture::texture_id.

254  {
255  return out << "(FlutterMetalTexture) Texture ID: " << std::hex
256  << item.texture_id << std::dec << " Handle: 0x" << std::hex
257  << item.texture;
258 }
int64_t texture_id
Definition: embedder.h:499
FlutterMetalTextureHandle texture
Definition: embedder.h:502

◆ operator<<() [9/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterPlatformViewMutation m 
)
inline

Definition at line 274 of file embedder_assertions.h.

References FlutterPlatformViewMutation::clip_rect, FlutterPlatformViewMutation::clip_rounded_rect, FlutterPlatformViewMutationTypeToString(), kFlutterPlatformViewMutationTypeClipRect, kFlutterPlatformViewMutationTypeClipRoundedRect, kFlutterPlatformViewMutationTypeOpacity, kFlutterPlatformViewMutationTypeTransformation, FlutterPlatformViewMutation::opacity, FlutterPlatformViewMutation::transformation, and FlutterPlatformViewMutation::type.

275  {
276  out << "(FlutterPlatformViewMutation) Type: "
278  switch (m.type) {
280  out << "Opacity: " << m.opacity;
282  out << "Clip Rect: " << m.clip_rect;
284  out << "Clip Rounded Rect: " << m.clip_rounded_rect;
286  out << "Transformation: " << m.transformation;
287  }
288  return out;
289 }
FlutterTransformation transformation
Definition: embedder.h:1014
std::string FlutterPlatformViewMutationTypeToString(FlutterPlatformViewMutationType type)
FlutterRoundedRect clip_rounded_rect
Definition: embedder.h:1013
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:1009

◆ operator<<() [10/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterPlatformView platform_view 
)
inline

Definition at line 291 of file embedder_assertions.h.

References FlutterPlatformView::identifier, FlutterPlatformView::mutations, FlutterPlatformView::mutations_count, and FlutterPlatformView::struct_size.

292  {
293  out << "["
294  << "(FlutterPlatformView) Struct Size: " << platform_view.struct_size
295  << " Identifier: " << platform_view.identifier
296  << " Mutations Count: " << platform_view.mutations_count;
297 
298  if (platform_view.mutations_count > 0) {
299  out << std::endl;
300  for (size_t i = 0; i < platform_view.mutations_count; i++) {
301  out << "Mutation " << i << ": " << *platform_view.mutations[i]
302  << std::endl;
303  }
304  }
305 
306  out << "]";
307 
308  return out;
309 }
FlutterPlatformViewIdentifier identifier
Definition: embedder.h:1024
size_t mutations_count
Definition: embedder.h:1027
const FlutterPlatformViewMutation ** mutations
Definition: embedder.h:1040
size_t struct_size
The size of this struct. Must be sizeof(FlutterPlatformView).
Definition: embedder.h:1020

◆ operator<<() [11/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterOpenGLBackingStore item 
)
inline

Definition at line 322 of file embedder_assertions.h.

References FlutterOpenGLTargetTypeToString(), FlutterOpenGLBackingStore::framebuffer, kFlutterOpenGLTargetTypeFramebuffer, kFlutterOpenGLTargetTypeTexture, FlutterOpenGLBackingStore::texture, and FlutterOpenGLBackingStore::type.

323  {
324  out << "(FlutterOpenGLBackingStore) Type: "
325  << FlutterOpenGLTargetTypeToString(item.type) << " ";
326  switch (item.type) {
328  out << item.texture;
329  break;
331  out << item.framebuffer;
332  break;
333  }
334  return out;
335 }
FlutterOpenGLFramebuffer framebuffer
Definition: embedder.h:960
FlutterOpenGLTargetType type
Definition: embedder.h:954
std::string FlutterOpenGLTargetTypeToString(FlutterOpenGLTargetType type)
FlutterOpenGLTexture texture
A texture for Flutter to render into.
Definition: embedder.h:957

◆ operator<<() [12/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterSoftwareBackingStore item 
)
inline

Definition at line 337 of file embedder_assertions.h.

References FlutterSoftwareBackingStore::allocation, FlutterSoftwareBackingStore::destruction_callback, FlutterSoftwareBackingStore::height, FlutterSoftwareBackingStore::row_bytes, and FlutterSoftwareBackingStore::user_data.

338  {
339  return out << "(FlutterSoftwareBackingStore) Allocation: " << item.allocation
340  << " Row Bytes: " << item.row_bytes << " Height: " << item.height
341  << " User Data: " << item.user_data << " Destruction Callback: "
342  << reinterpret_cast<void*>(item.destruction_callback);
343 }
VoidCallback destruction_callback
Definition: embedder.h:978
size_t row_bytes
The number of bytes in a single row of the allocation.
Definition: embedder.h:969
size_t height
The number of rows in the allocation.
Definition: embedder.h:971

◆ operator<<() [13/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterMetalBackingStore item 
)
inline

Definition at line 345 of file embedder_assertions.h.

References FlutterMetalBackingStore::texture.

346  {
347  return out << "(FlutterMetalBackingStore) Texture: " << item.texture;
348 }
FlutterMetalTexture texture
Definition: embedder.h:988

◆ operator<<() [14/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterBackingStore backing_store 
)
inline

Definition at line 350 of file embedder_assertions.h.

References FlutterBackingStoreTypeToString(), kFlutterBackingStoreTypeMetal, kFlutterBackingStoreTypeOpenGL, kFlutterBackingStoreTypeSoftware, FlutterBackingStore::metal, FlutterBackingStore::open_gl, FlutterBackingStore::software, FlutterBackingStore::struct_size, FlutterBackingStore::type, and FlutterBackingStore::user_data.

351  {
352  out << "(FlutterBackingStore) Struct size: " << backing_store.struct_size
353  << " User Data: " << backing_store.user_data
354  << " Type: " << FlutterBackingStoreTypeToString(backing_store.type)
355  << " ";
356 
357  switch (backing_store.type) {
359  out << backing_store.open_gl;
360  break;
361 
363  out << backing_store.software;
364  break;
365 
367  out << backing_store.metal;
368  break;
369  }
370 
371  return out;
372 }
Specified an software allocation for Flutter to render into using the CPU.
Definition: embedder.h:1048
std::string FlutterBackingStoreTypeToString(FlutterBackingStoreType type)
Specifies a Metal backing store. This is backed by a Metal texture.
Definition: embedder.h:1050
FlutterSoftwareBackingStore software
The description of the software backing store.
Definition: embedder.h:1069
FlutterOpenGLBackingStore open_gl
The description of the OpenGL backing store.
Definition: embedder.h:1067
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStore).
Definition: embedder.h:1055
FlutterBackingStoreType type
Specifies the type of backing store.
Definition: embedder.h:1061
FlutterMetalBackingStore metal
Definition: embedder.h:1071

◆ operator<<() [15/15]

std::ostream& operator<< ( std::ostream &  out,
const FlutterLayer layer 
)
inline

Definition at line 374 of file embedder_assertions.h.

References FlutterLayer::backing_store, FlutterLayerContentTypeToString(), kFlutterLayerContentTypeBackingStore, kFlutterLayerContentTypePlatformView, FlutterLayer::offset, FlutterLayer::platform_view, FlutterLayer::size, FlutterLayer::struct_size, and FlutterLayer::type.

374  {
375  out << "(Flutter Layer) Struct size: " << layer.struct_size
376  << " Type: " << FlutterLayerContentTypeToString(layer.type);
377 
378  switch (layer.type) {
380  out << *layer.backing_store;
381  break;
383  out << *layer.platform_view;
384  break;
385  }
386 
387  return out << " Offset: " << layer.offset << " Size: " << layer.size;
388 }
const FlutterBackingStore * backing_store
Definition: embedder.h:1099
FlutterSize size
The size of the layer (in physical pixels).
Definition: embedder.h:1108
FlutterPoint offset
Definition: embedder.h:1106
Indicates that the contents of this layer are determined by the embedder.
Definition: embedder.h:1087
const FlutterPlatformView * platform_view
Definition: embedder.h:1102
FlutterLayerContentType type
Definition: embedder.h:1095
size_t struct_size
This size of this struct. Must be sizeof(FlutterLayer).
Definition: embedder.h:1092
std::string FlutterLayerContentTypeToString(FlutterLayerContentType type)

◆ operator==() [1/15]

bool operator== ( const FlutterPoint a,
const FlutterPoint b 
)
inline

Definition at line 21 of file embedder_assertions.h.

References flutter::testing::NumberNear(), FlutterPoint::x, and FlutterPoint::y.

21  {
22  return flutter::testing::NumberNear(a.x, b.x) &&
24 }
bool NumberNear(double a, double b)
Definition: assertions.h:13
double y
Definition: embedder.h:343
double x
Definition: embedder.h:342

◆ operator==() [2/15]

bool operator== ( const FlutterRect a,
const FlutterRect b 
)
inline

◆ operator==() [3/15]

bool operator== ( const FlutterSize a,
const FlutterSize b 
)
inline

Definition at line 33 of file embedder_assertions.h.

References FlutterSize::height, flutter::testing::NumberNear(), and FlutterSize::width.

33  {
36 }
bool NumberNear(double a, double b)
Definition: assertions.h:13
double width
Definition: embedder.h:320
double height
Definition: embedder.h:321

◆ operator==() [4/15]

◆ operator==() [5/15]

bool operator== ( const FlutterTransformation a,
const FlutterTransformation b 
)
inline

Definition at line 47 of file embedder_assertions.h.

References FlutterTransformation::pers0, FlutterTransformation::pers1, FlutterTransformation::pers2, FlutterTransformation::scaleX, FlutterTransformation::scaleY, FlutterTransformation::skewX, FlutterTransformation::skewY, FlutterTransformation::transX, and FlutterTransformation::transY.

48  {
49  return a.scaleX == b.scaleX && a.skewX == b.skewX && a.transX == b.transX &&
50  a.skewY == b.skewY && a.scaleY == b.scaleY && a.transY == b.transY &&
51  a.pers0 == b.pers0 && a.pers1 == b.pers1 && a.pers2 == b.pers2;
52 }
double skewY
vertical skew factor
Definition: embedder.h:238
double skewX
horizontal skew factor
Definition: embedder.h:234
double pers1
input y-axis perspective factor
Definition: embedder.h:246
double pers2
perspective scale factor
Definition: embedder.h:248
double pers0
input x-axis perspective factor
Definition: embedder.h:244
double scaleY
vertical scale factor
Definition: embedder.h:240
double transX
horizontal translation
Definition: embedder.h:236
double transY
vertical translation
Definition: embedder.h:242
double scaleX
horizontal scale factor
Definition: embedder.h:232

◆ operator==() [6/15]

bool operator== ( const FlutterOpenGLTexture a,
const FlutterOpenGLTexture b 
)
inline

Definition at line 54 of file embedder_assertions.h.

References FlutterOpenGLTexture::destruction_callback, FlutterOpenGLTexture::format, FlutterOpenGLTexture::name, FlutterOpenGLTexture::target, and FlutterOpenGLTexture::user_data.

55  {
56  return a.target == b.target && a.name == b.name && a.format == b.format &&
57  a.user_data == b.user_data &&
59 }
VoidCallback destruction_callback
Definition: embedder.h:274
uint32_t name
The name of the texture.
Definition: embedder.h:267
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:271
uint32_t format
The texture format (example GL_RGBA8).
Definition: embedder.h:269

◆ operator==() [7/15]

bool operator== ( const FlutterOpenGLFramebuffer a,
const FlutterOpenGLFramebuffer b 
)
inline

Definition at line 61 of file embedder_assertions.h.

References FlutterOpenGLFramebuffer::destruction_callback, FlutterOpenGLFramebuffer::name, FlutterOpenGLFramebuffer::target, and FlutterOpenGLFramebuffer::user_data.

62  {
63  return a.target == b.target && a.name == b.name &&
64  a.user_data == b.user_data &&
66 }
VoidCallback destruction_callback
Definition: embedder.h:299
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:295
uint32_t name
The name of the framebuffer.
Definition: embedder.h:292

◆ operator==() [8/15]

bool operator== ( const FlutterMetalTexture a,
const FlutterMetalTexture b 
)
inline

Definition at line 68 of file embedder_assertions.h.

References FlutterMetalTexture::texture, and FlutterMetalTexture::texture_id.

69  {
70  return a.texture_id == b.texture_id && a.texture == b.texture;
71 }
int64_t texture_id
Definition: embedder.h:499
FlutterMetalTextureHandle texture
Definition: embedder.h:502

◆ operator==() [9/15]

bool operator== ( const FlutterMetalBackingStore a,
const FlutterMetalBackingStore b 
)
inline

Definition at line 73 of file embedder_assertions.h.

References FlutterMetalBackingStore::texture.

74  {
75  return a.texture == b.texture;
76 }
FlutterMetalTexture texture
Definition: embedder.h:988

◆ operator==() [10/15]

bool operator== ( const FlutterOpenGLBackingStore a,
const FlutterOpenGLBackingStore b 
)
inline

Definition at line 78 of file embedder_assertions.h.

References FlutterOpenGLBackingStore::framebuffer, kFlutterOpenGLTargetTypeFramebuffer, kFlutterOpenGLTargetTypeTexture, FlutterOpenGLBackingStore::texture, and FlutterOpenGLBackingStore::type.

79  {
80  if (!(a.type == b.type)) {
81  return false;
82  }
83 
84  switch (a.type) {
86  return a.texture == b.texture;
88  return a.framebuffer == b.framebuffer;
89  }
90 
91  return false;
92 }
FlutterOpenGLFramebuffer framebuffer
Definition: embedder.h:960
FlutterOpenGLTargetType type
Definition: embedder.h:954
FlutterOpenGLTexture texture
A texture for Flutter to render into.
Definition: embedder.h:957

◆ operator==() [11/15]

bool operator== ( const FlutterSoftwareBackingStore a,
const FlutterSoftwareBackingStore b 
)
inline

Definition at line 94 of file embedder_assertions.h.

References FlutterSoftwareBackingStore::allocation, FlutterSoftwareBackingStore::destruction_callback, FlutterSoftwareBackingStore::height, FlutterSoftwareBackingStore::row_bytes, and FlutterSoftwareBackingStore::user_data.

95  {
96  return a.allocation == b.allocation && a.row_bytes == b.row_bytes &&
97  a.height == b.height && a.user_data == b.user_data &&
99 }
VoidCallback destruction_callback
Definition: embedder.h:978
size_t row_bytes
The number of bytes in a single row of the allocation.
Definition: embedder.h:969
size_t height
The number of rows in the allocation.
Definition: embedder.h:971

◆ operator==() [12/15]

bool operator== ( const FlutterBackingStore a,
const FlutterBackingStore b 
)
inline

Definition at line 101 of file embedder_assertions.h.

References FlutterBackingStore::did_update, kFlutterBackingStoreTypeMetal, kFlutterBackingStoreTypeOpenGL, kFlutterBackingStoreTypeSoftware, FlutterBackingStore::metal, FlutterBackingStore::open_gl, FlutterBackingStore::software, FlutterBackingStore::struct_size, FlutterBackingStore::type, and FlutterBackingStore::user_data.

102  {
103  if (!(a.struct_size == b.struct_size && a.user_data == b.user_data &&
104  a.type == b.type && a.did_update == b.did_update)) {
105  return false;
106  }
107 
108  switch (a.type) {
110  return a.open_gl == b.open_gl;
112  return a.software == b.software;
114  return a.metal == b.metal;
115  }
116 
117  return false;
118 }
Specified an software allocation for Flutter to render into using the CPU.
Definition: embedder.h:1048
Specifies a Metal backing store. This is backed by a Metal texture.
Definition: embedder.h:1050
FlutterSoftwareBackingStore software
The description of the software backing store.
Definition: embedder.h:1069
FlutterOpenGLBackingStore open_gl
The description of the OpenGL backing store.
Definition: embedder.h:1067
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStore).
Definition: embedder.h:1055
FlutterBackingStoreType type
Specifies the type of backing store.
Definition: embedder.h:1061
FlutterMetalBackingStore metal
Definition: embedder.h:1071

◆ operator==() [13/15]

bool operator== ( const FlutterPlatformViewMutation a,
const FlutterPlatformViewMutation b 
)
inline

Definition at line 120 of file embedder_assertions.h.

References FlutterPlatformViewMutation::clip_rect, FlutterPlatformViewMutation::clip_rounded_rect, kFlutterPlatformViewMutationTypeClipRect, kFlutterPlatformViewMutationTypeClipRoundedRect, kFlutterPlatformViewMutationTypeOpacity, kFlutterPlatformViewMutationTypeTransformation, flutter::testing::NumberNear(), FlutterPlatformViewMutation::opacity, FlutterPlatformViewMutation::transformation, and FlutterPlatformViewMutation::type.

121  {
122  if (a.type != b.type) {
123  return false;
124  }
125 
126  switch (a.type) {
130  return a.clip_rect == b.clip_rect;
132  return a.clip_rounded_rect == b.clip_rounded_rect;
134  return a.transformation == b.transformation;
135  }
136 
137  return false;
138 }
bool NumberNear(double a, double b)
Definition: assertions.h:13
FlutterTransformation transformation
Definition: embedder.h:1014
FlutterRoundedRect clip_rounded_rect
Definition: embedder.h:1013
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:1009

◆ operator==() [14/15]

bool operator== ( const FlutterPlatformView a,
const FlutterPlatformView b 
)
inline

Definition at line 140 of file embedder_assertions.h.

References FlutterPlatformView::identifier, FlutterPlatformView::mutations, FlutterPlatformView::mutations_count, and FlutterPlatformView::struct_size.

141  {
142  if (!(a.struct_size == b.struct_size && a.identifier == b.identifier &&
144  return false;
145  }
146 
147  for (size_t i = 0; i < a.mutations_count; ++i) {
148  if (!(*a.mutations[i] == *b.mutations[i])) {
149  return false;
150  }
151  }
152 
153  return true;
154 }
FlutterPlatformViewIdentifier identifier
Definition: embedder.h:1024
size_t mutations_count
Definition: embedder.h:1027
const FlutterPlatformViewMutation ** mutations
Definition: embedder.h:1040
size_t struct_size
The size of this struct. Must be sizeof(FlutterPlatformView).
Definition: embedder.h:1020

◆ operator==() [15/15]

bool operator== ( const FlutterLayer a,
const FlutterLayer b 
)
inline

Definition at line 156 of file embedder_assertions.h.

References FlutterLayer::backing_store, kFlutterLayerContentTypeBackingStore, kFlutterLayerContentTypePlatformView, FlutterLayer::offset, FlutterLayer::platform_view, FlutterLayer::size, FlutterLayer::struct_size, and FlutterLayer::type.

156  {
157  if (!(a.struct_size == b.struct_size && a.type == b.type &&
158  a.offset == b.offset && a.size == b.size)) {
159  return false;
160  }
161 
162  switch (a.type) {
164  return *a.backing_store == *b.backing_store;
166  return *a.platform_view == *b.platform_view;
167  }
168 
169  return false;
170 }
const FlutterBackingStore * backing_store
Definition: embedder.h:1099
FlutterSize size
The size of the layer (in physical pixels).
Definition: embedder.h:1108
FlutterPoint offset
Definition: embedder.h:1106
Indicates that the contents of this layer are determined by the embedder.
Definition: embedder.h:1087
const FlutterPlatformView * platform_view
Definition: embedder.h:1102
FlutterLayerContentType type
Definition: embedder.h:1095
size_t struct_size
This size of this struct. Must be sizeof(FlutterLayer).
Definition: embedder.h:1092

◆ SkMatrixMake()

SkMatrix SkMatrixMake ( const FlutterTransformation xformation)
inline

Definition at line 429 of file embedder_assertions.h.

References FlutterTransformation::pers0, FlutterTransformation::pers1, FlutterTransformation::pers2, FlutterTransformation::scaleX, FlutterTransformation::scaleY, FlutterTransformation::skewX, FlutterTransformation::skewY, FlutterTransformation::transX, and FlutterTransformation::transY.

Referenced by flutter::testing::GetTotalMutationTransformationMatrix(), and flutter::testing::TEST_F().

429  {
430  return SkMatrix::MakeAll(xformation.scaleX, //
431  xformation.skewX, //
432  xformation.transX, //
433  xformation.skewY, //
434  xformation.scaleY, //
435  xformation.transY, //
436  xformation.pers0, //
437  xformation.pers1, //
438  xformation.pers2 //
439  );
440 }
double skewY
vertical skew factor
Definition: embedder.h:238
double skewX
horizontal skew factor
Definition: embedder.h:234
double pers1
input y-axis perspective factor
Definition: embedder.h:246
double pers2
perspective scale factor
Definition: embedder.h:248
double pers0
input x-axis perspective factor
Definition: embedder.h:244
double scaleY
vertical scale factor
Definition: embedder.h:240
double transX
horizontal translation
Definition: embedder.h:236
double transY
vertical translation
Definition: embedder.h:242
double scaleX
horizontal scale factor
Definition: embedder.h:232

◆ SkRectMake()

SkRect SkRectMake ( const FlutterRect rect)
inline

Definition at line 464 of file embedder_assertions.h.

References FlutterRect::bottom, FlutterRect::left, FlutterRect::right, and FlutterRect::top.

Referenced by flutter::testing::TEST_F().

464  {
465  return SkRect::MakeLTRB(rect.left, rect.top, rect.right, rect.bottom);
466 }
double right
Definition: embedder.h:336
double top
Definition: embedder.h:335
double left
Definition: embedder.h:334
double bottom
Definition: embedder.h:337

◆ ToEmbedderEngine()

flutter::EmbedderEngine* ToEmbedderEngine ( const FlutterEngine engine)
inline

Definition at line 442 of file embedder_assertions.h.

References engine.

Referenced by flutter::testing::TEST_F().

442  {
443  return reinterpret_cast<flutter::EmbedderEngine*>(engine);
444 }