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

Side by Side Diff: skia/ext/vector_platform_device_skia.cc

Issue 10915065: Add PlatformPictureSkia and RecordingPlatformDeviceSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And one more.. Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "skia/ext/vector_platform_device_skia.h" 5 #include "skia/ext/vector_platform_device_skia.h"
6 6
7 #include "skia/ext/bitmap_platform_device.h" 7 #include "skia/ext/bitmap_platform_device.h"
8 #include "third_party/skia/include/core/SkClipStack.h" 8 #include "third_party/skia/include/core/SkClipStack.h"
9 #include "third_party/skia/include/core/SkDraw.h" 9 #include "third_party/skia/include/core/SkDraw.h"
10 #include "third_party/skia/include/core/SkRect.h" 10 #include "third_party/skia/include/core/SkRect.h"
(...skipping 12 matching lines...) Expand all
23 const SkISize& pageSize, 23 const SkISize& pageSize,
24 const SkISize& contentSize, 24 const SkISize& contentSize,
25 const SkMatrix& initialTransform) 25 const SkMatrix& initialTransform)
26 : SkPDFDevice(pageSize, contentSize, initialTransform) { 26 : SkPDFDevice(pageSize, contentSize, initialTransform) {
27 SetPlatformDevice(this, this); 27 SetPlatformDevice(this, this);
28 } 28 }
29 29
30 VectorPlatformDeviceSkia::~VectorPlatformDeviceSkia() { 30 VectorPlatformDeviceSkia::~VectorPlatformDeviceSkia() {
31 } 31 }
32 32
33 bool VectorPlatformDeviceSkia::SupportsPlatformPaint() { 33 PlatformDevice::PlatformPaint VectorPlatformDeviceSkia::
34 return false; 34 PlatformPaintSupport() {
35 return PLATFORM_PAINT_UNSUPPORTED;
35 } 36 }
36 37
37 PlatformSurface VectorPlatformDeviceSkia::BeginPlatformPaint() { 38 PlatformSurface VectorPlatformDeviceSkia::BeginPlatformPaint() {
38 // Even when drawing a vector representation of the page, we have to 39 // Even when drawing a vector representation of the page, we have to
39 // provide a raster surface for plugins to render into - they don't have 40 // provide a raster surface for plugins to render into - they don't have
40 // a vector interface. Therefore we create a BitmapPlatformDevice here 41 // a vector interface. Therefore we create a BitmapPlatformDevice here
41 // and return the context from it, then layer on the raster data as an 42 // and return the context from it, then layer on the raster data as an
42 // image in EndPlatformPaint. 43 // image in EndPlatformPaint.
43 DCHECK(raster_surface_ == NULL); 44 DCHECK(raster_surface_ == NULL);
44 raster_surface_ = BitmapPlatformDevice::CreateAndClear(width(), height(), 45 raster_surface_ = BitmapPlatformDevice::CreateAndClear(width(), height(),
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 81 }
81 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD) 82 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD)
82 void VectorPlatformDeviceSkia::DrawToNativeContext( 83 void VectorPlatformDeviceSkia::DrawToNativeContext(
83 PlatformSurface surface, int x, int y, const PlatformRect* src_rect) { 84 PlatformSurface surface, int x, int y, const PlatformRect* src_rect) {
84 // Should never be called on Linux. 85 // Should never be called on Linux.
85 SkASSERT(false); 86 SkASSERT(false);
86 } 87 }
87 #endif 88 #endif
88 89
89 } // namespace skia 90 } // namespace skia
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698