OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkAnnotation.h" | 9 #include "SkAnnotation.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; | 259 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; |
260 virtual void endCommentGroup() SK_OVERRIDE; | 260 virtual void endCommentGroup() SK_OVERRIDE; |
261 | 261 |
262 /** | 262 /** |
263 * Flatten an SkBitmap to send to the reader, where it will be referenced | 263 * Flatten an SkBitmap to send to the reader, where it will be referenced |
264 * according to slot. | 264 * according to slot. |
265 */ | 265 */ |
266 bool shuttleBitmap(const SkBitmap&, int32_t slot); | 266 bool shuttleBitmap(const SkBitmap&, int32_t slot); |
267 | 267 |
268 protected: | 268 protected: |
269 virtual void willSave(SaveFlags) SK_OVERRIDE; | 269 virtual void willSave() SK_OVERRIDE; |
270 virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveF
lags) SK_OVERRIDE; | 270 virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveF
lags) SK_OVERRIDE; |
271 virtual void willRestore() SK_OVERRIDE; | 271 virtual void willRestore() SK_OVERRIDE; |
272 | 272 |
273 virtual void didConcat(const SkMatrix&) SK_OVERRIDE; | 273 virtual void didConcat(const SkMatrix&) SK_OVERRIDE; |
274 virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE; | 274 virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE; |
275 | 275 |
276 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK
_OVERRIDE; | 276 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK
_OVERRIDE; |
277 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkS
calar y, | 277 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkS
calar y, |
278 const SkPaint&) SK_OVERRIDE; | 278 const SkPaint&) SK_OVERRIDE; |
279 virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoin
t pos[], | 279 virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoin
t pos[], |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 } | 508 } |
509 } | 509 } |
510 return id; | 510 return id; |
511 } | 511 } |
512 | 512 |
513 /////////////////////////////////////////////////////////////////////////////// | 513 /////////////////////////////////////////////////////////////////////////////// |
514 | 514 |
515 #define NOTIFY_SETUP(canvas) \ | 515 #define NOTIFY_SETUP(canvas) \ |
516 AutoPipeNotify apn(canvas) | 516 AutoPipeNotify apn(canvas) |
517 | 517 |
518 void SkGPipeCanvas::willSave(SaveFlags flags) { | 518 void SkGPipeCanvas::willSave() { |
519 NOTIFY_SETUP(this); | 519 NOTIFY_SETUP(this); |
520 if (this->needOpBytes()) { | 520 if (this->needOpBytes()) { |
521 this->writeOp(kSave_DrawOp, 0, flags); | 521 this->writeOp(kSave_DrawOp); |
522 } | 522 } |
523 | 523 |
524 this->INHERITED::willSave(flags); | 524 this->INHERITED::willSave(); |
525 } | 525 } |
526 | 526 |
527 SkCanvas::SaveLayerStrategy SkGPipeCanvas::willSaveLayer(const SkRect* bounds, c
onst SkPaint* paint, | 527 SkCanvas::SaveLayerStrategy SkGPipeCanvas::willSaveLayer(const SkRect* bounds, c
onst SkPaint* paint, |
528 SaveFlags saveFlags) { | 528 SaveFlags saveFlags) { |
529 NOTIFY_SETUP(this); | 529 NOTIFY_SETUP(this); |
530 size_t size = 0; | 530 size_t size = 0; |
531 unsigned opFlags = 0; | 531 unsigned opFlags = 0; |
532 | 532 |
533 if (bounds) { | 533 if (bounds) { |
534 opFlags |= kSaveLayer_HasBounds_DrawOpFlag; | 534 opFlags |= kSaveLayer_HasBounds_DrawOpFlag; |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 return fCanvas->shuttleBitmap(bitmap, slot); | 1258 return fCanvas->shuttleBitmap(bitmap, slot); |
1259 } | 1259 } |
1260 | 1260 |
1261 void BitmapShuttle::removeCanvas() { | 1261 void BitmapShuttle::removeCanvas() { |
1262 if (NULL == fCanvas) { | 1262 if (NULL == fCanvas) { |
1263 return; | 1263 return; |
1264 } | 1264 } |
1265 fCanvas->unref(); | 1265 fCanvas->unref(); |
1266 fCanvas = NULL; | 1266 fCanvas = NULL; |
1267 } | 1267 } |
OLD | NEW |