Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Unified Diff: ui/gfx/skia_util.cc

Issue 13863015: Add flag for drawing layers to screen with Ganesh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/skia_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/skia_util.cc
diff --git a/ui/gfx/skia_util.cc b/ui/gfx/skia_util.cc
index 162a5ba6bf25f35af7ae53da4c83b92f8e22efc0..50092ab13b6d1cace96df9e0af6eff2379d27bf0 100644
--- a/ui/gfx/skia_util.cc
+++ b/ui/gfx/skia_util.cc
@@ -15,6 +15,7 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/rect_f.h"
#include "ui/gfx/shadow_value.h"
+#include "ui/gfx/transform.h"
namespace gfx {
@@ -46,6 +47,19 @@ RectF SkRectToRectF(const SkRect& rect) {
SkScalarToFloat(rect.height()));
}
+void TransformToFlattenedSkMatrix(const gfx::Transform& transform,
+ SkMatrix* flattened) {
+ // Convert from 4x4 to 3x3 by dropping the third row and column.
+ flattened->set(0, SkDoubleToScalar(transform.matrix().getDouble(0, 0)));
+ flattened->set(1, SkDoubleToScalar(transform.matrix().getDouble(0, 1)));
+ flattened->set(2, SkDoubleToScalar(transform.matrix().getDouble(0, 3)));
+ flattened->set(3, SkDoubleToScalar(transform.matrix().getDouble(1, 0)));
+ flattened->set(4, SkDoubleToScalar(transform.matrix().getDouble(1, 1)));
+ flattened->set(5, SkDoubleToScalar(transform.matrix().getDouble(1, 3)));
+ flattened->set(6, SkDoubleToScalar(transform.matrix().getDouble(3, 0)));
+ flattened->set(7, SkDoubleToScalar(transform.matrix().getDouble(3, 1)));
+ flattened->set(8, SkDoubleToScalar(transform.matrix().getDouble(3, 3)));
+}
skia::RefPtr<SkShader> CreateImageRepShader(const gfx::ImageSkiaRep& image_rep,
SkShader::TileMode tile_mode,
« no previous file with comments | « ui/gfx/skia_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698