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

Unified Diff: cc/paint/paint_canvas.cc

Issue 2752593002: cc: Make PaintCanvas abstract (Closed)
Patch Set: Remove default parameters on virtual functions Created 3 years, 9 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 | « cc/paint/paint_canvas.h ('k') | cc/paint/paint_recorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/paint_canvas.cc
diff --git a/cc/paint/paint_canvas.cc b/cc/paint/paint_canvas.cc
index d3a8b57183aaa11d888aa959082ba32372fd8f56..f4c348f7c015e64a0dc9a2a3903422215eec847f 100644
--- a/cc/paint/paint_canvas.cc
+++ b/cc/paint/paint_canvas.cc
@@ -9,7 +9,6 @@
#include "cc/paint/paint_recorder.h"
#include "third_party/skia/include/core/SkAnnotation.h"
#include "third_party/skia/include/core/SkMetaData.h"
-#include "third_party/skia/include/utils/SkNWayCanvas.h"
#if defined(OS_MACOSX)
namespace {
@@ -19,27 +18,8 @@ const char kIsPreviewMetafileKey[] = "CrIsPreviewMetafile";
namespace cc {
-PaintCanvas::PaintCanvas(SkCanvas* canvas) : canvas_(canvas) {}
-
-PaintCanvas::PaintCanvas(const SkBitmap& bitmap)
- : canvas_(new SkCanvas(bitmap)), owned_(canvas_) {}
-
-PaintCanvas::PaintCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)
- : canvas_(new SkCanvas(bitmap, props)), owned_(canvas_) {}
-
-PaintCanvas::~PaintCanvas() = default;
-
bool ToPixmap(PaintCanvas* canvas, SkPixmap* output) {
- SkImageInfo info;
- size_t row_bytes;
- void* pixels = canvas->canvas_->accessTopLayerPixels(&info, &row_bytes);
- if (!pixels) {
- output->reset();
- return false;
- }
-
- output->reset(info, pixels, row_bytes);
- return true;
+ return canvas->ToPixmap(output);
}
#if defined(OS_MACOSX)
@@ -60,19 +40,19 @@ bool IsPreviewMetafile(PaintCanvas* canvas) {
void PaintCanvasAnnotateRectWithURL(PaintCanvas* canvas,
const SkRect& rect,
SkData* data) {
- SkAnnotateRectWithURL(canvas->canvas_, rect, data);
+ canvas->AnnotateRectWithURL(rect, data);
}
void PaintCanvasAnnotateNamedDestination(PaintCanvas* canvas,
const SkPoint& point,
SkData* data) {
- SkAnnotateNamedDestination(canvas->canvas_, point, data);
+ canvas->AnnotateNamedDestination(point, data);
}
void PaintCanvasAnnotateLinkToDestination(PaintCanvas* canvas,
const SkRect& rect,
SkData* data) {
- SkAnnotateLinkToDestination(canvas->canvas_, rect, data);
+ canvas->AnnotateLinkToDestination(rect, data);
}
} // namespace cc
« no previous file with comments | « cc/paint/paint_canvas.h ('k') | cc/paint/paint_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698