Commit a73fc377 authored by vitalybuka's avatar vitalybuka Committed by Commit bot

Removed unused code in skia/ext/vector_*.

Code is not used after we Chrome stopped generation of EMF inside render.

Review URL: https://codereview.chromium.org/900683004

Cr-Commit-Position: refs/heads/master@{#315076}
parent 0071593b
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "printing/page_size_margins.h" #include "printing/page_size_margins.h"
#include "printing/pdf_metafile_skia.h" #include "printing/pdf_metafile_skia.h"
#include "skia/ext/platform_device.h" #include "skia/ext/platform_device.h"
#include "skia/ext/vector_canvas.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebLocalFrame.h"
#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
...@@ -162,7 +161,7 @@ void PrintWebViewHelper::PrintPageInternal( ...@@ -162,7 +161,7 @@ void PrintWebViewHelper::PrintPageInternal(
gfx::Rect canvas_area = gfx::Rect canvas_area =
params.params.display_header_footer ? gfx::Rect(page_size) : content_area; params.params.display_header_footer ? gfx::Rect(page_size) : content_area;
skia::VectorCanvas* canvas = skia::PlatformCanvas* canvas =
metafile->GetVectorCanvasForNewPage(page_size, canvas_area, scale_factor); metafile->GetVectorCanvasForNewPage(page_size, canvas_area, scale_factor);
if (!canvas) if (!canvas)
return; return;
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "printing/metafile_skia_wrapper.h" #include "printing/metafile_skia_wrapper.h"
#include "printing/page_size_margins.h" #include "printing/page_size_margins.h"
#include "skia/ext/platform_device.h" #include "skia/ext/platform_device.h"
#include "skia/ext/vector_canvas.h"
#include "third_party/WebKit/public/platform/WebCanvas.h" #include "third_party/WebKit/public/platform/WebCanvas.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebLocalFrame.h"
...@@ -118,7 +117,7 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, ...@@ -118,7 +117,7 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
params.display_header_footer ? gfx::Rect(*page_size) : content_area; params.display_header_footer ? gfx::Rect(*page_size) : content_area;
{ {
skia::VectorCanvas* canvas = metafile->GetVectorCanvasForNewPage( skia::PlatformCanvas* canvas = metafile->GetVectorCanvasForNewPage(
*page_size, canvas_area, scale_factor); *page_size, canvas_area, scale_factor);
if (!canvas) if (!canvas)
return; return;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "printing/pdf_metafile_skia.h" #include "printing/pdf_metafile_skia.h"
#include "printing/units.h" #include "printing/units.h"
#include "skia/ext/platform_device.h" #include "skia/ext/platform_device.h"
#include "skia/ext/vector_canvas.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebLocalFrame.h"
namespace printing { namespace printing {
...@@ -178,7 +177,7 @@ void PrintWebViewHelper::PrintPageInternal( ...@@ -178,7 +177,7 @@ void PrintWebViewHelper::PrintPageInternal(
frame->getPrintPageShrink(params.page_number); frame->getPrintPageShrink(params.page_number);
float scale_factor = css_scale_factor * webkit_page_shrink_factor; float scale_factor = css_scale_factor * webkit_page_shrink_factor;
skia::VectorCanvas* canvas = skia::PlatformCanvas* canvas =
metafile->GetVectorCanvasForNewPage(page_size, canvas_area, scale_factor); metafile->GetVectorCanvasForNewPage(page_size, canvas_area, scale_factor);
if (!canvas) if (!canvas)
return; return;
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "content/renderer/render_thread_impl.h" #include "content/renderer/render_thread_impl.h"
#include "sandbox/win/src/sandbox.h" #include "sandbox/win/src/sandbox.h"
#include "skia/ext/fontmgr_default_win.h" #include "skia/ext/fontmgr_default_win.h"
#include "skia/ext/vector_platform_device_emf_win.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h" #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/WebKit/public/web/win/WebFontRendering.h" #include "third_party/WebKit/public/web/win/WebFontRendering.h"
#include "third_party/icu/source/i18n/unicode/timezone.h" #include "third_party/icu/source/i18n/unicode/timezone.h"
...@@ -101,8 +100,6 @@ void RendererMainPlatformDelegate::PlatformInitialize() { ...@@ -101,8 +100,6 @@ void RendererMainPlatformDelegate::PlatformInitialize() {
WarmupDirectWrite(); WarmupDirectWrite();
} else { } else {
SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont);
skia::SetSkiaEnsureTypefaceCharactersAccessible(
SkiaPreCacheFontCharacters);
} }
} }
blink::WebFontRendering::setUseDirectWrite(use_direct_write); blink::WebFontRendering::setUseDirectWrite(use_direct_write);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/win/scoped_gdi_object.h" #include "base/win/scoped_gdi_object.h"
#include "base/win/scoped_hdc.h" #include "base/win/scoped_hdc.h"
#include "base/win/scoped_select_object.h" #include "base/win/scoped_select_object.h"
#include "skia/ext/vector_platform_device_emf_win.h" #include "skia/ext/platform_device.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/jpeg_codec.h" #include "ui/gfx/codec/jpeg_codec.h"
#include "ui/gfx/codec/png_codec.h" #include "ui/gfx/codec/png_codec.h"
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "base/numerics/safe_conversions.h" #include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h" #include "base/posix/eintr_wrapper.h"
#include "skia/ext/refptr.h" #include "skia/ext/refptr.h"
#include "skia/ext/vector_canvas.h"
#include "third_party/skia/include/core/SkData.h" #include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkDocument.h" #include "third_party/skia/include/core/SkDocument.h"
#include "third_party/skia/include/core/SkPictureRecorder.h" #include "third_party/skia/include/core/SkPictureRecorder.h"
...@@ -104,7 +103,7 @@ bool PdfMetafileSkia::StartPage(const gfx::Size& page_size, ...@@ -104,7 +103,7 @@ bool PdfMetafileSkia::StartPage(const gfx::Size& page_size,
return true; return true;
} }
skia::VectorCanvas* PdfMetafileSkia::GetVectorCanvasForNewPage( skia::PlatformCanvas* PdfMetafileSkia::GetVectorCanvasForNewPage(
const gfx::Size& page_size, const gfx::Size& page_size,
const gfx::Rect& content_area, const gfx::Rect& content_area,
const float& scale_factor) { const float& scale_factor) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "printing/metafile.h" #include "printing/metafile.h"
#include "skia/ext/vector_canvas.h" #include "skia/ext/platform_canvas.h"
#if defined(OS_WIN) #if defined(OS_WIN)
#include <windows.h> #include <windows.h>
...@@ -74,14 +74,14 @@ class PRINTING_EXPORT PdfMetafileSkia : public Metafile { ...@@ -74,14 +74,14 @@ class PRINTING_EXPORT PdfMetafileSkia : public Metafile {
scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage(); scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage();
// This method calls StartPage and then returns an appropriate // This method calls StartPage and then returns an appropriate
// VectorCanvas implementation bound to the context created by // PlatformCanvas implementation bound to the context created by
// StartPage or NULL on error. The skia::VectorCanvas pointer that // StartPage or NULL on error. The skia::PlatformCanvas pointer that
// is returned is owned by this PdfMetafileSkia object and does not // is returned is owned by this PdfMetafileSkia object and does not
// need to be ref()ed or unref()ed. The canvas will remain valid // need to be ref()ed or unref()ed. The canvas will remain valid
// until FinishPage() or FinishDocument() is called. // until FinishPage() or FinishDocument() is called.
skia::VectorCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size, skia::PlatformCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size,
const gfx::Rect& content_area, const gfx::Rect& content_area,
const float& scale_factor); const float& scale_factor);
private: private:
scoped_ptr<PdfMetafileSkiaData> data_; scoped_ptr<PdfMetafileSkiaData> data_;
......
...@@ -332,9 +332,6 @@ component("skia") { ...@@ -332,9 +332,6 @@ component("skia") {
"ext/skia_utils_mac.h", "ext/skia_utils_mac.h",
"ext/skia_utils_win.cc", "ext/skia_utils_win.cc",
"ext/skia_utils_win.h", "ext/skia_utils_win.h",
"ext/vector_canvas.h",
"ext/vector_platform_device_emf_win.cc",
"ext/vector_platform_device_emf_win.h",
] ]
# The skia gypi values are relative to the skia_dir, so we need to rebase. # The skia gypi values are relative to the skia_dir, so we need to rebase.
...@@ -646,13 +643,8 @@ test("skia_unittests") { ...@@ -646,13 +643,8 @@ test("skia_unittests") {
"ext/refptr_unittest.cc", "ext/refptr_unittest.cc",
"ext/skia_utils_ios_unittest.mm", "ext/skia_utils_ios_unittest.mm",
"ext/skia_utils_mac_unittest.mm", "ext/skia_utils_mac_unittest.mm",
"ext/vector_canvas_unittest.cc",
] ]
if (!is_win) {
sources -= [ "ext/vector_canvas_unittest.cc" ]
}
if (!is_win && !is_mac) { if (!is_win && !is_mac) {
sources -= [ "ext/platform_canvas_unittest.cc" ] sources -= [ "ext/platform_canvas_unittest.cc" ]
} }
......
// Copyright (c) 2011 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.
#ifndef SKIA_EXT_VECTOR_CANVAS_H_
#define SKIA_EXT_VECTOR_CANVAS_H_
#include "base/compiler_specific.h"
#include "skia/ext/platform_canvas.h"
// This was a specialization of PlatformCanvas, but all necessary functionality
// has been subsumed by just SkCanvas and a specialized device (PDF or EMF).
// Future evolution goal is to replace this notion (canvas+device) with
// an updated version of SkDocument, which will have explicit APIs for margins.
// At that point, this class (and header) will be removed entirely.
namespace skia {
typedef PlatformCanvas VectorCanvas;
} // namespace skia
#endif // SKIA_EXT_VECTOR_CANVAS_H_
This diff is collapsed.
This diff is collapsed.
// Copyright (c) 2011 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.
#ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_
#define SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "skia/ext/platform_device.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkRegion.h"
namespace skia {
// A device is basically a wrapper around SkBitmap that provides a surface for
// SkCanvas to draw into. This specific device is not not backed by a surface
// and is thus unreadable. This is because the backend is completely vectorial.
// This device is a simple wrapper over a Windows device context (HDC) handle.
// TODO(robertphillips): Once Skia's SkBaseDevice is refactored to remove
// the bitmap-specific entry points, this class should derive from it.
class VectorPlatformDeviceEmf : public SkBitmapDevice, public PlatformDevice {
public:
SK_API static SkBaseDevice* CreateDevice(int width, int height, bool isOpaque,
HANDLE shared_section);
// Factory function. The DC is kept as the output context.
static SkBaseDevice* create(HDC dc, int width, int height);
VectorPlatformDeviceEmf(HDC dc, const SkBitmap& bitmap);
virtual ~VectorPlatformDeviceEmf();
// PlatformDevice methods
virtual PlatformSurface BeginPlatformPaint() override;
// SkBaseDevice methods.
virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) override;
virtual void drawPoints(const SkDraw& draw, SkCanvas::PointMode mode,
size_t count, const SkPoint[],
const SkPaint& paint) override;
virtual void drawRect(const SkDraw& draw, const SkRect& r,
const SkPaint& paint) override;
virtual void drawRRect(const SkDraw&, const SkRRect& rr,
const SkPaint& paint) override;
virtual void drawPath(const SkDraw& draw, const SkPath& path,
const SkPaint& paint,
const SkMatrix* prePathMatrix = NULL,
bool pathIsMutable = false) override;
virtual void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
const SkRect* src, const SkRect& dst,
const SkPaint& paint,
SkCanvas::DrawBitmapRectFlags flags) override;
virtual void drawBitmap(const SkDraw& draw, const SkBitmap& bitmap,
const SkMatrix& matrix,
const SkPaint& paint) override;
virtual void drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
int x, int y, const SkPaint& paint) override;
virtual void drawText(const SkDraw& draw, const void* text, size_t len,
SkScalar x, SkScalar y, const SkPaint& paint) override;
virtual void drawPosText(const SkDraw& draw, const void* text, size_t len,
const SkScalar pos[], int scalarsPerPos,
const SkPoint& offset, const SkPaint& paint) override;
virtual void drawTextOnPath(const SkDraw& draw, const void* text, size_t len,
const SkPath& path, const SkMatrix* matrix,
const SkPaint& paint) override;
virtual void drawVertices(const SkDraw& draw, SkCanvas::VertexMode,
int vertexCount,
const SkPoint verts[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) override;
virtual void drawDevice(const SkDraw& draw, SkBaseDevice*, int x, int y,
const SkPaint&) override;
virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region,
const SkClipStack&) override;
void LoadClipRegion();
protected:
virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& info) override;
private:
// Applies the SkPaint's painting properties in the current GDI context, if
// possible. If GDI can't support all paint's properties, returns false. It
// doesn't execute the "commands" in SkPaint.
bool ApplyPaint(const SkPaint& paint);
// Selects a new object in the device context. It can be a pen, a brush, a
// clipping region, a bitmap or a font. Returns the old selected object.
HGDIOBJ SelectObject(HGDIOBJ object);
// Creates a brush according to SkPaint's properties.
bool CreateBrush(bool use_brush, const SkPaint& paint);
// Creates a pen according to SkPaint's properties.
bool CreatePen(bool use_pen, const SkPaint& paint);
// Restores back the previous objects (pen, brush, etc) after a paint command.
void Cleanup();
// Creates a brush according to SkPaint's properties.
bool CreateBrush(bool use_brush, COLORREF color);
// Creates a pen according to SkPaint's properties.
bool CreatePen(bool use_pen, COLORREF color, int stroke_width,
float stroke_miter, DWORD pen_style);
// Draws a bitmap in the the device, using the currently loaded matrix.
void InternalDrawBitmap(const SkBitmap& bitmap, int x, int y,
const SkPaint& paint);
// The Windows Device Context handle. It is the backend used with GDI drawing.
// This backend is write-only and vectorial.
HDC hdc_;
// Translation assigned to the DC: we need to keep track of this separately
// so it can be updated even if the DC isn't created yet.
SkMatrix transform_;
// The current clipping
SkRegion clip_region_;
// Previously selected brush before the current drawing.
HGDIOBJ previous_brush_;
// Previously selected pen before the current drawing.
HGDIOBJ previous_pen_;
DISALLOW_COPY_AND_ASSIGN(VectorPlatformDeviceEmf);
};
typedef void (*SkiaEnsureTypefaceCharactersAccessible)
(const LOGFONT& font, const wchar_t* text, unsigned int text_length);
SK_API void SetSkiaEnsureTypefaceCharactersAccessible(
SkiaEnsureTypefaceCharactersAccessible func);
} // namespace skia
#endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_
...@@ -77,9 +77,6 @@ ...@@ -77,9 +77,6 @@
'ext/skia_utils_mac.h', 'ext/skia_utils_mac.h',
'ext/skia_utils_win.cc', 'ext/skia_utils_win.cc',
'ext/skia_utils_win.h', 'ext/skia_utils_win.h',
'ext/vector_canvas.h',
'ext/vector_platform_device_emf_win.cc',
'ext/vector_platform_device_emf_win.h',
], ],
'conditions': [ 'conditions': [
[ 'OS == "android" and ' [ 'OS == "android" and '
......
...@@ -29,14 +29,8 @@ ...@@ -29,14 +29,8 @@
'ext/refptr_unittest.cc', 'ext/refptr_unittest.cc',
'ext/skia_utils_ios_unittest.mm', 'ext/skia_utils_ios_unittest.mm',
'ext/skia_utils_mac_unittest.mm', 'ext/skia_utils_mac_unittest.mm',
'ext/vector_canvas_unittest.cc',
], ],
'conditions': [ 'conditions': [
['OS != "win"', {
'sources!': [
'ext/vector_canvas_unittest.cc',
],
}],
['OS != "win" and OS != "mac"', { ['OS != "win" and OS != "mac"', {
'sources!': [ 'sources!': [
'ext/platform_canvas_unittest.cc', 'ext/platform_canvas_unittest.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment