OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 height(), | 46 height(), |
47 false, /* not opaque */ | 47 false, /* not opaque */ |
48 NULL); | 48 NULL); |
49 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 49 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
50 raster_surface_ = BitmapPlatformDevice::Create(width(), | 50 raster_surface_ = BitmapPlatformDevice::Create(width(), |
51 height(), | 51 height(), |
52 false /* not opaque */); | 52 false /* not opaque */); |
53 #endif | 53 #endif |
54 raster_surface_->unref(); // SkRefPtr and create both took a reference. | 54 raster_surface_->unref(); // SkRefPtr and create both took a reference. |
55 | 55 |
56 #if defined(OS_WIN) || defined(OS_MACOSX) | |
vandebo (ex-Chrome)
2012/03/14 23:38:29
I comment wouldn't hurt here.
Jeff Timanus
2012/03/15 19:01:28
Done.
| |
56 SkCanvas canvas(raster_surface_.get()); | 57 SkCanvas canvas(raster_surface_.get()); |
vandebo (ex-Chrome)
2012/03/14 23:38:29
nit: Why is/was this here?
Jeff Timanus
2012/03/15 19:01:28
I noticed this, and was also confused. I left it
vandebo (ex-Chrome)
2012/03/15 20:40:57
Ahh - in that revision, the device is cleared to b
| |
58 canvas.clear(SkColorSetARGB(0, 0, 0, 0)); | |
59 #endif | |
57 return raster_surface_->BeginPlatformPaint(); | 60 return raster_surface_->BeginPlatformPaint(); |
58 } | 61 } |
59 | 62 |
60 void VectorPlatformDeviceSkia::EndPlatformPaint() { | 63 void VectorPlatformDeviceSkia::EndPlatformPaint() { |
61 DCHECK(raster_surface_ != NULL); | 64 DCHECK(raster_surface_ != NULL); |
62 SkPaint paint; | 65 SkPaint paint; |
63 // SkPDFDevice checks the passed SkDraw for an empty clip (only). Fake | 66 // SkPDFDevice checks the passed SkDraw for an empty clip (only). Fake |
64 // it out by setting a non-empty clip. | 67 // it out by setting a non-empty clip. |
65 SkDraw draw; | 68 SkDraw draw; |
66 SkRegion clip(SkIRect::MakeWH(width(), height())); | 69 SkRegion clip(SkIRect::MakeWH(width(), height())); |
(...skipping 23 matching lines...) Expand all Loading... | |
90 } | 93 } |
91 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD) | 94 #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD) |
92 void VectorPlatformDeviceSkia::DrawToNativeContext( | 95 void VectorPlatformDeviceSkia::DrawToNativeContext( |
93 PlatformSurface surface, int x, int y, const PlatformRect* src_rect) { | 96 PlatformSurface surface, int x, int y, const PlatformRect* src_rect) { |
94 // Should never be called on Linux. | 97 // Should never be called on Linux. |
95 SkASSERT(false); | 98 SkASSERT(false); |
96 } | 99 } |
97 #endif | 100 #endif |
98 | 101 |
99 } // namespace skia | 102 } // namespace skia |
OLD | NEW |