Files
engine/flow/debug_print.cc
T
Chinmay Garde 1c6a531e89 Rework raster cache to fix numerous issues. (#3717)
* Fix pixel rounding error in the picture layer by first ensuring that
  the texture for the image is at least as big as the next integer size
  along each dimension and using kStrict_SrcRectConstraint while
  drawing the same image. We already select the source subset by
  looking at the cull rect of the picture.
* Decompose the transformation matrix into a series of operations that
  generated the same to calculate the scale at which to rasterize the
  picture. This make the rasterization scale resilient to
  transformations that introduce a perspective component to the
  resultant matrix.
* The scale in the decomposed matrix is now part of the key in the
  cache.
* Raster cache images that could never be rasterized were still taking
  part in the cache. Now, those entries are rejected early on. This
  leads to the sweep after the frame iterating over fewer items.
* Added a unit test target.
2017-06-05 15:57:05 -07:00

61 lines
1.9 KiB
C++

// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/debug_print.h"
#include <ostream>
#include "third_party/skia/include/core/SkString.h"
std::ostream& operator<<(std::ostream& os, const flow::MatrixDecomposition& m) {
if (!m.IsValid()) {
os << "Invalid Matrix!" << std::endl;
return os;
}
os << "Translation (x, y, z): " << m.translation() << std::endl;
os << "Scale (z, y, z): " << m.scale() << std::endl;
os << "Shear (zy, yz, zx): " << m.shear() << std::endl;
os << "Perspective (x, y, z, w): " << m.perspective() << std::endl;
os << "Rotation (x, y, z, w): " << m.rotation() << std::endl;
return os;
}
std::ostream& operator<<(std::ostream& os, const SkMatrix& m) {
SkString string;
m.toString(&string);
os << string.c_str();
return os;
}
std::ostream& operator<<(std::ostream& os, const SkMatrix44& m) {
os << m.get(0, 0) << ", " << m.get(0, 1) << ", " << m.get(0, 2) << ", "
<< m.get(0, 3) << std::endl;
os << m.get(1, 0) << ", " << m.get(1, 1) << ", " << m.get(1, 2) << ", "
<< m.get(1, 3) << std::endl;
os << m.get(2, 0) << ", " << m.get(2, 1) << ", " << m.get(2, 2) << ", "
<< m.get(2, 3) << std::endl;
os << m.get(3, 0) << ", " << m.get(3, 1) << ", " << m.get(3, 2) << ", "
<< m.get(3, 3);
return os;
}
std::ostream& operator<<(std::ostream& os, const SkVector3& v) {
os << v.x() << ", " << v.y() << ", " << v.z();
return os;
}
std::ostream& operator<<(std::ostream& os, const SkVector4& v) {
os << v.fData[0] << ", " << v.fData[1] << ", " << v.fData[2] << ", "
<< v.fData[3];
return os;
}
std::ostream& operator<<(std::ostream& os, const flow::RasterCacheKey& k) {
os << "Picture: " << k.picture_id() << " Scale: " << k.scale_key().width()
<< ", " << k.scale_key().height();
return os;
}