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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.h

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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
Index: third_party/WebKit/Source/platform/graphics/GraphicsContext.h
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.h b/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
index 7aa52e1b47b85476e49046293ea9bc3b4ec834c1..6c6bed45ef0d652e4c8322769f1baf7527df29fb 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
@@ -35,8 +35,11 @@
#include "platform/graphics/GraphicsContextState.h"
#include "platform/graphics/ImageOrientation.h"
#include "platform/graphics/skia/SkiaUtils.h"
+#include "skia/ext/cdl_picture.h"
#include "third_party/skia/include/core/SkMetaData.h"
-#include "third_party/skia/include/core/SkPictureRecorder.h"
+#include "third_party/skia/include/core/SkImageFilter.h"
+#include "skia/ext/cdl_common.h"
+#include "skia/ext/cdl_picture_recorder.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "wtf/Allocator.h"
@@ -45,9 +48,7 @@
#include <memory>
class SkBitmap;
-class SkPaint;
class SkPath;
-class SkPicture;
class SkRRect;
struct SkRect;
@@ -76,8 +77,8 @@ class PLATFORM_EXPORT GraphicsContext {
~GraphicsContext();
- SkCanvas* canvas() { return m_canvas; }
- const SkCanvas* canvas() const { return m_canvas; }
+ CdlCanvas* canvas() { return m_canvas; }
+ const CdlCanvas* canvas() const { return m_canvas; }
PaintController& getPaintController() { return m_paintController; }
@@ -178,8 +179,8 @@ class PLATFORM_EXPORT GraphicsContext {
void strokeRect(const FloatRect&, float lineWidth);
- void drawPicture(const SkPicture*);
- void compositePicture(sk_sp<SkPicture>,
+ void drawPicture(const CdlPicture*);
+ void compositePicture(sk_sp<CdlPicture>,
const FloatRect& dest,
const FloatRect& src,
SkBlendMode);
@@ -212,10 +213,10 @@ class PLATFORM_EXPORT GraphicsContext {
// These methods write to the canvas.
// Also drawLine(const IntPoint& point1, const IntPoint& point2) and
// fillRoundedRect().
- void drawOval(const SkRect&, const SkPaint&);
- void drawPath(const SkPath&, const SkPaint&);
- void drawRect(const SkRect&, const SkPaint&);
- void drawRRect(const SkRRect&, const SkPaint&);
+ void drawOval(const SkRect&, const CdlPaint&);
+ void drawPath(const SkPath&, const CdlPaint&);
+ void drawRect(const SkRect&, const CdlPaint&);
+ void drawRRect(const SkRRect&, const CdlPaint&);
void clip(const IntRect& rect) { clipRect(rect); }
void clip(const FloatRect& rect) { clipRect(rect); }
@@ -241,7 +242,7 @@ class PLATFORM_EXPORT GraphicsContext {
void drawText(const Font&,
const TextRunPaintInfo&,
const FloatPoint&,
- const SkPaint&);
+ const CdlPaint&);
void drawEmphasisMarks(const Font&,
const TextRunPaintInfo&,
const AtomicString& mark,
@@ -286,7 +287,7 @@ class PLATFORM_EXPORT GraphicsContext {
// Returns a picture with any recorded draw commands since the prerequisite
// call to beginRecording(). The picture is guaranteed to be non-null (but
// not necessarily non-empty), even when the context is disabled.
- sk_sp<SkPicture> endRecording();
+ sk_sp<CdlPicture> endRecording();
void setShadow(const FloatSize& offset,
float blur,
@@ -320,8 +321,10 @@ class PLATFORM_EXPORT GraphicsContext {
float shadowSpread,
Edges clippedEdges = NoEdge);
- const SkPaint& fillPaint() const { return immutableState()->fillPaint(); }
- const SkPaint& strokePaint() const { return immutableState()->strokePaint(); }
+ const CdlPaint& fillPaint() const { return immutableState()->fillPaint(); }
+ const CdlPaint& strokePaint() const {
+ return immutableState()->strokePaint();
+ }
// ---------- Transformation methods -----------------
void concatCTM(const AffineTransform&);
@@ -387,7 +390,7 @@ class PLATFORM_EXPORT GraphicsContext {
static void draw2xMarker(SkBitmap*, int);
#endif
- void saveLayer(const SkRect* bounds, const SkPaint*);
+ void saveLayer(const SkRect* bounds, const CdlPaint*);
void restoreLayer();
// Helpers for drawing a focus ring (drawFocusRing)
@@ -427,7 +430,7 @@ class PLATFORM_EXPORT GraphicsContext {
const SkMetaData& metaData() const { return m_metaData; }
// null indicates painting is contextDisabled. Never delete this object.
- SkCanvas* m_canvas;
+ CdlCanvas* m_canvas;
PaintController& m_paintController;
@@ -442,7 +445,7 @@ class PLATFORM_EXPORT GraphicsContext {
// Raw pointer to the current state.
GraphicsContextState* m_paintState;
- SkPictureRecorder m_pictureRecorder;
+ CdlPictureRecorder m_pictureRecorder;
SkMetaData m_metaData;

Powered by Google App Engine
This is Rietveld 408576698