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 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::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 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 212 of file embedder_assertions.h.

References kFlutterBackingStoreTypeOpenGL, and kFlutterBackingStoreTypeSoftware.

Referenced by operator<<().

213  {
214  switch (type) {
216  return "kFlutterBackingStoreTypeOpenGL";
218  return "kFlutterBackingStoreTypeSoftware";
219  }
220  return "Unknown";
221 }
Specified an software allocation for Flutter to render into using the CPU.
Definition: embedder.h:846

◆ FlutterLayerContentTypeToString()

std::string FlutterLayerContentTypeToString ( FlutterLayerContentType  type)
inline

Definition at line 201 of file embedder_assertions.h.

References kFlutterLayerContentTypeBackingStore, and kFlutterLayerContentTypePlatformView.

Referenced by operator<<().

202  {
203  switch (type) {
205  return "kFlutterLayerContentTypeBackingStore";
207  return "kFlutterLayerContentTypePlatformView";
208  }
209  return "Unknown";
210 }
Indicates that the contents of this layer are determined by the embedder.
Definition: embedder.h:881

◆ FlutterOpenGLTargetTypeToString()

std::string FlutterOpenGLTargetTypeToString ( FlutterOpenGLTargetType  type)
inline

Definition at line 291 of file embedder_assertions.h.

References kFlutterOpenGLTargetTypeFramebuffer, and kFlutterOpenGLTargetTypeTexture.

Referenced by operator<<().

292  {
293  switch (type) {
295  return "kFlutterOpenGLTargetTypeTexture";
297  return "kFlutterOpenGLTargetTypeFramebuffer";
298  }
299  return "Unknown";
300 }

◆ FlutterPlatformViewMutationTypeToString()

std::string FlutterPlatformViewMutationTypeToString ( FlutterPlatformViewMutationType  type)
inline

Definition at line 239 of file embedder_assertions.h.

References kFlutterPlatformViewMutationTypeClipRect, kFlutterPlatformViewMutationTypeClipRoundedRect, kFlutterPlatformViewMutationTypeOpacity, and kFlutterPlatformViewMutationTypeTransformation.

Referenced by operator<<().

240  {
241  switch (type) {
243  return "kFlutterPlatformViewMutationTypeOpacity";
245  return "kFlutterPlatformViewMutationTypeClipRect";
247  return "kFlutterPlatformViewMutationTypeClipRoundedRect";
249  return "kFlutterPlatformViewMutationTypeTransformation";
250  }
251  return "Unknown";
252 }

◆ FlutterPointMake()

FlutterPoint FlutterPointMake ( double  x,
double  y 
)
inline

Definition at line 365 of file embedder_assertions.h.

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

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

365  {
366  FlutterPoint point = {};
367  point.x = x;
368  point.y = y;
369  return point;
370 }
A structure to represent a 2D point.
Definition: embedder.h:332
double y
Definition: embedder.h:334
double x
Definition: embedder.h:333

◆ FlutterRectMake()

FlutterRect FlutterRectMake ( const SkRect &  rect)
inline

Definition at line 417 of file embedder_assertions.h.

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

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

417  {
418  FlutterRect r = {};
419  r.left = rect.left();
420  r.top = rect.top();
421  r.right = rect.right();
422  r.bottom = rect.bottom();
423  return r;
424 }
double right
Definition: embedder.h:327
double top
Definition: embedder.h:326
A structure to represent a rectangle.
Definition: embedder.h:324
double left
Definition: embedder.h:325
double bottom
Definition: embedder.h:328

◆ FlutterRectMakeLTRB()

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

Definition at line 426 of file embedder_assertions.h.

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

426  {
427  FlutterRect rect = {};
428  rect.left = l;
429  rect.top = t;
430  rect.right = r;
431  rect.bottom = b;
432  return rect;
433 }
double right
Definition: embedder.h:327
double top
Definition: embedder.h:326
A structure to represent a rectangle.
Definition: embedder.h:324
double left
Definition: embedder.h:325
double bottom
Definition: embedder.h:328

◆ FlutterRoundedRectMake()

FlutterRoundedRect FlutterRoundedRectMake ( const SkRRect &  rect)
inline

Definition at line 439 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().

439  {
440  FlutterRoundedRect r = {};
441  r.rect = FlutterRectMake(rect.rect());
443  FlutterSizeMake(rect.radii(SkRRect::Corner::kUpperLeft_Corner));
445  FlutterSizeMake(rect.radii(SkRRect::Corner::kUpperRight_Corner));
447  FlutterSizeMake(rect.radii(SkRRect::Corner::kLowerRight_Corner));
449  FlutterSizeMake(rect.radii(SkRRect::Corner::kLowerLeft_Corner));
450  return r;
451 }
FlutterRect FlutterRectMake(const SkRect &rect)
FlutterSize upper_left_corner_radius
Definition: embedder.h:340
FlutterSize upper_right_corner_radius
Definition: embedder.h:341
FlutterSize FlutterSizeMake(double width, double height)
FlutterSize lower_right_corner_radius
Definition: embedder.h:342
A structure to represent a rounded rectangle.
Definition: embedder.h:338
FlutterSize lower_left_corner_radius
Definition: embedder.h:343
FlutterRect rect
Definition: embedder.h:339

◆ FlutterSizeMake() [1/2]

FlutterSize FlutterSizeMake ( double  width,
double  height 
)
inline

Definition at line 372 of file embedder_assertions.h.

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

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

372  {
373  FlutterSize size = {};
374  size.width = width;
375  size.height = height;
376  return size;
377 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
int32_t height
int32_t width
double width
Definition: embedder.h:311
A structure to represent the width and height.
Definition: embedder.h:310
double height
Definition: embedder.h:312

◆ FlutterSizeMake() [2/2]

FlutterSize FlutterSizeMake ( const SkVector &  vector)
inline

Definition at line 379 of file embedder_assertions.h.

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

379  {
380  FlutterSize size = {};
381  size.width = vector.x();
382  size.height = vector.y();
383  return size;
384 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
double width
Definition: embedder.h:311
A structure to represent the width and height.
Definition: embedder.h:310
double height
Definition: embedder.h:312

◆ FlutterTransformationMake()

FlutterTransformation FlutterTransformationMake ( const SkMatrix &  matrix)
inline

Definition at line 386 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().

386  {
387  FlutterTransformation transformation = {};
388  transformation.scaleX = matrix[SkMatrix::kMScaleX];
389  transformation.skewX = matrix[SkMatrix::kMSkewX];
390  transformation.transX = matrix[SkMatrix::kMTransX];
391  transformation.skewY = matrix[SkMatrix::kMSkewY];
392  transformation.scaleY = matrix[SkMatrix::kMScaleY];
393  transformation.transY = matrix[SkMatrix::kMTransY];
394  transformation.pers0 = matrix[SkMatrix::kMPersp0];
395  transformation.pers1 = matrix[SkMatrix::kMPersp1];
396  transformation.pers2 = matrix[SkMatrix::kMPersp2];
397  return transformation;
398 }
double skewY
vertical skew factor
Definition: embedder.h:230
double skewX
horizontal skew factor
Definition: embedder.h:226
double pers1
input y-axis perspective factor
Definition: embedder.h:238
double pers2
perspective scale factor
Definition: embedder.h:240
double pers0
input x-axis perspective factor
Definition: embedder.h:236
double scaleY
vertical scale factor
Definition: embedder.h:232
double transX
horizontal translation
Definition: embedder.h:228
double transY
vertical translation
Definition: embedder.h:234
double scaleX
horizontal scale factor
Definition: embedder.h:224

◆ operator<<() [1/13]

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

Definition at line 164 of file embedder_assertions.h.

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

164  {
165  return out << "(" << point.x << ", " << point.y << ")";
166 }
double y
Definition: embedder.h:334
double x
Definition: embedder.h:333

◆ operator<<() [2/13]

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

Definition at line 168 of file embedder_assertions.h.

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

168  {
169  return out << "LTRB (" << r.left << ", " << r.top << ", " << r.right << ", "
170  << r.bottom << ")";
171 }
double right
Definition: embedder.h:327
double top
Definition: embedder.h:326
double left
Definition: embedder.h:325
double bottom
Definition: embedder.h:328

◆ operator<<() [3/13]

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

Definition at line 173 of file embedder_assertions.h.

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

173  {
174  return out << "(" << size.width << ", " << size.height << ")";
175 }
double width
Definition: embedder.h:311
double height
Definition: embedder.h:312

◆ operator<<() [4/13]

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

Definition at line 177 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.

178  {
179  out << "Rect: " << r.rect << ", ";
180  out << "Upper Left Corner Radius: " << r.upper_left_corner_radius << ", ";
181  out << "Upper Right Corner Radius: " << r.upper_right_corner_radius << ", ";
182  out << "Lower Right Corner Radius: " << r.lower_right_corner_radius << ", ";
183  out << "Lower Left Corner Radius: " << r.lower_left_corner_radius;
184  return out;
185 }
FlutterSize upper_left_corner_radius
Definition: embedder.h:340
FlutterSize upper_right_corner_radius
Definition: embedder.h:341
FlutterSize lower_right_corner_radius
Definition: embedder.h:342
FlutterSize lower_left_corner_radius
Definition: embedder.h:343
FlutterRect rect
Definition: embedder.h:339

◆ operator<<() [5/13]

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

Definition at line 187 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.

188  {
189  out << "Scale X: " << t.scaleX << ", ";
190  out << "Skew X: " << t.skewX << ", ";
191  out << "Trans X: " << t.transX << ", ";
192  out << "Skew Y: " << t.skewY << ", ";
193  out << "Scale Y: " << t.scaleY << ", ";
194  out << "Trans Y: " << t.transY << ", ";
195  out << "Pers 0: " << t.pers0 << ", ";
196  out << "Pers 1: " << t.pers1 << ", ";
197  out << "Pers 2: " << t.pers2;
198  return out;
199 }
double skewY
vertical skew factor
Definition: embedder.h:230
double skewX
horizontal skew factor
Definition: embedder.h:226
double pers1
input y-axis perspective factor
Definition: embedder.h:238
double pers2
perspective scale factor
Definition: embedder.h:240
double pers0
input x-axis perspective factor
Definition: embedder.h:236
double scaleY
vertical scale factor
Definition: embedder.h:232
double transX
horizontal translation
Definition: embedder.h:228
double transY
vertical translation
Definition: embedder.h:234
double scaleX
horizontal scale factor
Definition: embedder.h:224

◆ operator<<() [6/13]

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

Definition at line 223 of file embedder_assertions.h.

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

224  {
225  return out << "(FlutterOpenGLTexture) Target: 0x" << std::hex << item.target
226  << std::dec << " Name: " << item.name << " Format: " << item.format
227  << " User Data: " << item.user_data << " Destruction Callback: "
228  << reinterpret_cast<void*>(item.destruction_callback);
229 }
VoidCallback destruction_callback
Definition: embedder.h:266
uint32_t name
The name of the texture.
Definition: embedder.h:259
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:263
uint32_t format
The texture format (example GL_RGBA8).
Definition: embedder.h:261

◆ operator<<() [7/13]

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

Definition at line 231 of file embedder_assertions.h.

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

232  {
233  return out << "(FlutterOpenGLFramebuffer) Target: 0x" << std::hex
234  << item.target << std::dec << " Name: " << item.name
235  << " User Data: " << item.user_data << " Destruction Callback: "
236  << reinterpret_cast<void*>(item.destruction_callback);
237 }
VoidCallback destruction_callback
Definition: embedder.h:291
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:287
uint32_t name
The name of the framebuffer.
Definition: embedder.h:284

◆ operator<<() [8/13]

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

Definition at line 254 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.

255  {
256  out << "(FlutterPlatformViewMutation) Type: "
258  switch (m.type) {
260  out << "Opacity: " << m.opacity;
262  out << "Clip Rect: " << m.clip_rect;
264  out << "Clip Rounded Rect: " << m.clip_rounded_rect;
266  out << "Transformation: " << m.transformation;
267  }
268  return out;
269 }
FlutterTransformation transformation
Definition: embedder.h:812
std::string FlutterPlatformViewMutationTypeToString(FlutterPlatformViewMutationType type)
FlutterRoundedRect clip_rounded_rect
Definition: embedder.h:811
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:807

◆ operator<<() [9/13]

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

Definition at line 271 of file embedder_assertions.h.

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

272  {
273  out << "["
274  << "(FlutterPlatformView) Struct Size: " << platform_view.struct_size
275  << " Identifier: " << platform_view.identifier
276  << " Mutations Count: " << platform_view.mutations_count;
277 
278  if (platform_view.mutations_count > 0) {
279  out << std::endl;
280  for (size_t i = 0; i < platform_view.mutations_count; i++) {
281  out << "Mutation " << i << ": " << *platform_view.mutations[i]
282  << std::endl;
283  }
284  }
285 
286  out << "]";
287 
288  return out;
289 }
FlutterPlatformViewIdentifier identifier
Definition: embedder.h:822
size_t mutations_count
Definition: embedder.h:825
const FlutterPlatformViewMutation ** mutations
Definition: embedder.h:838
size_t struct_size
The size of this struct. Must be sizeof(FlutterPlatformView).
Definition: embedder.h:818

◆ operator<<() [10/13]

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

Definition at line 302 of file embedder_assertions.h.

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

303  {
304  out << "(FlutterOpenGLBackingStore) Type: "
305  << FlutterOpenGLTargetTypeToString(item.type) << " ";
306  switch (item.type) {
308  out << item.texture;
309  break;
311  out << item.framebuffer;
312  break;
313  }
314  return out;
315 }
FlutterOpenGLFramebuffer framebuffer
Definition: embedder.h:769
FlutterOpenGLTargetType type
Definition: embedder.h:763
std::string FlutterOpenGLTargetTypeToString(FlutterOpenGLTargetType type)
FlutterOpenGLTexture texture
A texture for Flutter to render into.
Definition: embedder.h:766

◆ operator<<() [11/13]

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

Definition at line 317 of file embedder_assertions.h.

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

318  {
319  return out << "(FlutterSoftwareBackingStore) Allocation: " << item.allocation
320  << " Row Bytes: " << item.row_bytes << " Height: " << item.height
321  << " User Data: " << item.user_data << " Destruction Callback: "
322  << reinterpret_cast<void*>(item.destruction_callback);
323 }
VoidCallback destruction_callback
Definition: embedder.h:787
size_t row_bytes
The number of bytes in a single row of the allocation.
Definition: embedder.h:778
size_t height
The number of rows in the allocation.
Definition: embedder.h:780

◆ operator<<() [12/13]

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

Definition at line 325 of file embedder_assertions.h.

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

326  {
327  out << "(FlutterBackingStore) Struct size: " << backing_store.struct_size
328  << " User Data: " << backing_store.user_data
329  << " Type: " << FlutterBackingStoreTypeToString(backing_store.type)
330  << " ";
331 
332  switch (backing_store.type) {
334  out << backing_store.open_gl;
335  break;
336 
338  out << backing_store.software;
339  break;
340  }
341 
342  return out;
343 }
Specified an software allocation for Flutter to render into using the CPU.
Definition: embedder.h:846
std::string FlutterBackingStoreTypeToString(FlutterBackingStoreType type)
FlutterSoftwareBackingStore software
The description of the software backing store.
Definition: embedder.h:865
FlutterOpenGLBackingStore open_gl
The description of the OpenGL backing store.
Definition: embedder.h:863
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStore).
Definition: embedder.h:851
FlutterBackingStoreType type
Specifies the type of backing store.
Definition: embedder.h:857

◆ operator<<() [13/13]

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

Definition at line 345 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.

345  {
346  out << "(Flutter Layer) Struct size: " << layer.struct_size
347  << " Type: " << FlutterLayerContentTypeToString(layer.type);
348 
349  switch (layer.type) {
351  out << *layer.backing_store;
352  break;
354  out << *layer.platform_view;
355  break;
356  }
357 
358  return out << " Offset: " << layer.offset << " Size: " << layer.size;
359 }
const FlutterBackingStore * backing_store
Definition: embedder.h:893
FlutterSize size
The size of the layer (in physical pixels).
Definition: embedder.h:902
FlutterPoint offset
Definition: embedder.h:900
Indicates that the contents of this layer are determined by the embedder.
Definition: embedder.h:881
const FlutterPlatformView * platform_view
Definition: embedder.h:896
FlutterLayerContentType type
Definition: embedder.h:889
size_t struct_size
This size of this struct. Must be sizeof(FlutterLayer).
Definition: embedder.h:886
std::string FlutterLayerContentTypeToString(FlutterLayerContentType type)

◆ operator==() [1/13]

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:334
double x
Definition: embedder.h:333

◆ operator==() [2/13]

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

◆ operator==() [3/13]

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:311
double height
Definition: embedder.h:312

◆ operator==() [4/13]

◆ operator==() [5/13]

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:230
double skewX
horizontal skew factor
Definition: embedder.h:226
double pers1
input y-axis perspective factor
Definition: embedder.h:238
double pers2
perspective scale factor
Definition: embedder.h:240
double pers0
input x-axis perspective factor
Definition: embedder.h:236
double scaleY
vertical scale factor
Definition: embedder.h:232
double transX
horizontal translation
Definition: embedder.h:228
double transY
vertical translation
Definition: embedder.h:234
double scaleX
horizontal scale factor
Definition: embedder.h:224

◆ operator==() [6/13]

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:266
uint32_t name
The name of the texture.
Definition: embedder.h:259
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:263
uint32_t format
The texture format (example GL_RGBA8).
Definition: embedder.h:261

◆ operator==() [7/13]

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:291
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:287
uint32_t name
The name of the framebuffer.
Definition: embedder.h:284

◆ operator==() [8/13]

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

Definition at line 68 of file embedder_assertions.h.

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

69  {
70  if (!(a.type == b.type)) {
71  return false;
72  }
73 
74  switch (a.type) {
76  return a.texture == b.texture;
78  return a.framebuffer == b.framebuffer;
79  }
80 
81  return false;
82 }
FlutterOpenGLFramebuffer framebuffer
Definition: embedder.h:769
FlutterOpenGLTargetType type
Definition: embedder.h:763
FlutterOpenGLTexture texture
A texture for Flutter to render into.
Definition: embedder.h:766

◆ operator==() [9/13]

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

Definition at line 84 of file embedder_assertions.h.

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

85  {
86  return a.allocation == b.allocation && a.row_bytes == b.row_bytes &&
87  a.height == b.height && a.user_data == b.user_data &&
89 }
VoidCallback destruction_callback
Definition: embedder.h:787
size_t row_bytes
The number of bytes in a single row of the allocation.
Definition: embedder.h:778
size_t height
The number of rows in the allocation.
Definition: embedder.h:780

◆ operator==() [10/13]

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

Definition at line 91 of file embedder_assertions.h.

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

92  {
93  if (!(a.struct_size == b.struct_size && a.user_data == b.user_data &&
94  a.type == b.type && a.did_update == b.did_update)) {
95  return false;
96  }
97 
98  switch (a.type) {
100  return a.open_gl == b.open_gl;
102  return a.software == b.software;
103  }
104 
105  return false;
106 }
Specified an software allocation for Flutter to render into using the CPU.
Definition: embedder.h:846
FlutterSoftwareBackingStore software
The description of the software backing store.
Definition: embedder.h:865
FlutterOpenGLBackingStore open_gl
The description of the OpenGL backing store.
Definition: embedder.h:863
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStore).
Definition: embedder.h:851
FlutterBackingStoreType type
Specifies the type of backing store.
Definition: embedder.h:857

◆ operator==() [11/13]

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

Definition at line 108 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.

109  {
110  if (a.type != b.type) {
111  return false;
112  }
113 
114  switch (a.type) {
118  return a.clip_rect == b.clip_rect;
120  return a.clip_rounded_rect == b.clip_rounded_rect;
122  return a.transformation == b.transformation;
123  }
124 
125  return false;
126 }
bool NumberNear(double a, double b)
Definition: assertions.h:13
FlutterTransformation transformation
Definition: embedder.h:812
FlutterRoundedRect clip_rounded_rect
Definition: embedder.h:811
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:807

◆ operator==() [12/13]

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

Definition at line 128 of file embedder_assertions.h.

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

129  {
130  if (!(a.struct_size == b.struct_size && a.identifier == b.identifier &&
132  return false;
133  }
134 
135  for (size_t i = 0; i < a.mutations_count; ++i) {
136  if (!(*a.mutations[i] == *b.mutations[i])) {
137  return false;
138  }
139  }
140 
141  return true;
142 }
FlutterPlatformViewIdentifier identifier
Definition: embedder.h:822
size_t mutations_count
Definition: embedder.h:825
const FlutterPlatformViewMutation ** mutations
Definition: embedder.h:838
size_t struct_size
The size of this struct. Must be sizeof(FlutterPlatformView).
Definition: embedder.h:818

◆ operator==() [13/13]

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

Definition at line 144 of file embedder_assertions.h.

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

144  {
145  if (!(a.struct_size == b.struct_size && a.type == b.type &&
146  a.offset == b.offset && a.size == b.size)) {
147  return false;
148  }
149 
150  switch (a.type) {
152  return *a.backing_store == *b.backing_store;
154  return *a.platform_view == *b.platform_view;
155  }
156 
157  return false;
158 }
const FlutterBackingStore * backing_store
Definition: embedder.h:893
FlutterSize size
The size of the layer (in physical pixels).
Definition: embedder.h:902
FlutterPoint offset
Definition: embedder.h:900
Indicates that the contents of this layer are determined by the embedder.
Definition: embedder.h:881
const FlutterPlatformView * platform_view
Definition: embedder.h:896
FlutterLayerContentType type
Definition: embedder.h:889
size_t struct_size
This size of this struct. Must be sizeof(FlutterLayer).
Definition: embedder.h:886

◆ SkMatrixMake()

SkMatrix SkMatrixMake ( const FlutterTransformation xformation)
inline

Definition at line 400 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().

400  {
401  return SkMatrix::MakeAll(xformation.scaleX, //
402  xformation.skewX, //
403  xformation.transX, //
404  xformation.skewY, //
405  xformation.scaleY, //
406  xformation.transY, //
407  xformation.pers0, //
408  xformation.pers1, //
409  xformation.pers2 //
410  );
411 }
double skewY
vertical skew factor
Definition: embedder.h:230
double skewX
horizontal skew factor
Definition: embedder.h:226
double pers1
input y-axis perspective factor
Definition: embedder.h:238
double pers2
perspective scale factor
Definition: embedder.h:240
double pers0
input x-axis perspective factor
Definition: embedder.h:236
double scaleY
vertical scale factor
Definition: embedder.h:232
double transX
horizontal translation
Definition: embedder.h:228
double transY
vertical translation
Definition: embedder.h:234
double scaleX
horizontal scale factor
Definition: embedder.h:224

◆ SkRectMake()

SkRect SkRectMake ( const FlutterRect rect)
inline

Definition at line 435 of file embedder_assertions.h.

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

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

435  {
436  return SkRect::MakeLTRB(rect.left, rect.top, rect.right, rect.bottom);
437 }
double right
Definition: embedder.h:327
double top
Definition: embedder.h:326
double left
Definition: embedder.h:325
double bottom
Definition: embedder.h:328

◆ ToEmbedderEngine()

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

Definition at line 413 of file embedder_assertions.h.

References engine.

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

413  {
414  return reinterpret_cast<flutter::EmbedderEngine*>(engine);
415 }