| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef SKIA_EXT_ANALYSIS_CANVAS_H_ | 5 #ifndef SKIA_EXT_ANALYSIS_CANVAS_H_ |
| 6 #define SKIA_EXT_ANALYSIS_CANVAS_H_ | 6 #define SKIA_EXT_ANALYSIS_CANVAS_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 #include "third_party/skia/include/core/SkPicture.h" | 10 #include "third_party/skia/include/core/SkPicture.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 DrawBitmapRectFlags flags) OVERRIDE; | 52 DrawBitmapRectFlags flags) OVERRIDE; |
| 53 virtual void drawBitmapMatrix(const SkBitmap&, | 53 virtual void drawBitmapMatrix(const SkBitmap&, |
| 54 const SkMatrix&, | 54 const SkMatrix&, |
| 55 const SkPaint* paint = NULL) OVERRIDE; | 55 const SkPaint* paint = NULL) OVERRIDE; |
| 56 virtual void drawBitmapNine(const SkBitmap& bitmap, | 56 virtual void drawBitmapNine(const SkBitmap& bitmap, |
| 57 const SkIRect& center, | 57 const SkIRect& center, |
| 58 const SkRect& dst, | 58 const SkRect& dst, |
| 59 const SkPaint* paint = NULL) OVERRIDE; | 59 const SkPaint* paint = NULL) OVERRIDE; |
| 60 virtual void drawSprite(const SkBitmap&, int left, int top, | 60 virtual void drawSprite(const SkBitmap&, int left, int top, |
| 61 const SkPaint* paint = NULL) OVERRIDE; | 61 const SkPaint* paint = NULL) OVERRIDE; |
| 62 virtual void drawText(const void* text, | |
| 63 size_t byteLength, | |
| 64 SkScalar x, | |
| 65 SkScalar y, | |
| 66 const SkPaint&) OVERRIDE; | |
| 67 virtual void drawPosText(const void* text, | |
| 68 size_t byteLength, | |
| 69 const SkPoint pos[], | |
| 70 const SkPaint&) OVERRIDE; | |
| 71 virtual void drawPosTextH(const void* text, | |
| 72 size_t byteLength, | |
| 73 const SkScalar xpos[], | |
| 74 SkScalar constY, | |
| 75 const SkPaint&) OVERRIDE; | |
| 76 virtual void drawTextOnPath(const void* text, | |
| 77 size_t byteLength, | |
| 78 const SkPath& path, | |
| 79 const SkMatrix* matrix, | |
| 80 const SkPaint&) OVERRIDE; | |
| 81 virtual void drawVertices(VertexMode, | 62 virtual void drawVertices(VertexMode, |
| 82 int vertexCount, | 63 int vertexCount, |
| 83 const SkPoint vertices[], | 64 const SkPoint vertices[], |
| 84 const SkPoint texs[], | 65 const SkPoint texs[], |
| 85 const SkColor colors[], | 66 const SkColor colors[], |
| 86 SkXfermode*, | 67 SkXfermode*, |
| 87 const uint16_t indices[], | 68 const uint16_t indices[], |
| 88 int indexCount, | 69 int indexCount, |
| 89 const SkPaint&) OVERRIDE; | 70 const SkPaint&) OVERRIDE; |
| 90 | 71 |
| 91 protected: | 72 protected: |
| 92 virtual void willSave(SaveFlags) OVERRIDE; | 73 virtual void willSave(SaveFlags) OVERRIDE; |
| 93 virtual SaveLayerStrategy willSaveLayer(const SkRect*, | 74 virtual SaveLayerStrategy willSaveLayer(const SkRect*, |
| 94 const SkPaint*, | 75 const SkPaint*, |
| 95 SaveFlags) OVERRIDE; | 76 SaveFlags) OVERRIDE; |
| 96 virtual void willRestore() OVERRIDE; | 77 virtual void willRestore() OVERRIDE; |
| 97 | 78 |
| 98 virtual void onClipRect(const SkRect& rect, | 79 virtual void onClipRect(const SkRect& rect, |
| 99 SkRegion::Op op, | 80 SkRegion::Op op, |
| 100 ClipEdgeStyle edge_style) OVERRIDE; | 81 ClipEdgeStyle edge_style) OVERRIDE; |
| 101 virtual void onClipRRect(const SkRRect& rrect, | 82 virtual void onClipRRect(const SkRRect& rrect, |
| 102 SkRegion::Op op, | 83 SkRegion::Op op, |
| 103 ClipEdgeStyle edge_style) OVERRIDE; | 84 ClipEdgeStyle edge_style) OVERRIDE; |
| 104 virtual void onClipPath(const SkPath& path, | 85 virtual void onClipPath(const SkPath& path, |
| 105 SkRegion::Op op, | 86 SkRegion::Op op, |
| 106 ClipEdgeStyle edge_style) OVERRIDE; | 87 ClipEdgeStyle edge_style) OVERRIDE; |
| 107 | 88 |
| 108 private: | 89 virtual void onDrawText(const void* text, |
| 90 size_t byteLength, |
| 91 SkScalar x, |
| 92 SkScalar y, |
| 93 const SkPaint&) OVERRIDE; |
| 94 virtual void onDrawPosText(const void* text, |
| 95 size_t byteLength, |
| 96 const SkPoint pos[], |
| 97 const SkPaint&) OVERRIDE; |
| 98 virtual void onDrawPosTextH(const void* text, |
| 99 size_t byteLength, |
| 100 const SkScalar xpos[], |
| 101 SkScalar constY, |
| 102 const SkPaint&) OVERRIDE; |
| 103 virtual void onDrawTextOnPath(const void* text, |
| 104 size_t byteLength, |
| 105 const SkPath& path, |
| 106 const SkMatrix* matrix, |
| 107 const SkPaint&) OVERRIDE; |
| 108 |
| 109 private: |
| 109 typedef SkCanvas INHERITED; | 110 typedef SkCanvas INHERITED; |
| 110 | 111 |
| 111 int saved_stack_size_; | 112 int saved_stack_size_; |
| 112 int force_not_solid_stack_level_; | 113 int force_not_solid_stack_level_; |
| 113 int force_not_transparent_stack_level_; | 114 int force_not_transparent_stack_level_; |
| 114 | 115 |
| 115 bool is_forced_not_solid_; | 116 bool is_forced_not_solid_; |
| 116 bool is_forced_not_transparent_; | 117 bool is_forced_not_transparent_; |
| 117 bool is_solid_color_; | 118 bool is_solid_color_; |
| 118 SkColor color_; | 119 SkColor color_; |
| 119 bool is_transparent_; | 120 bool is_transparent_; |
| 120 bool has_text_; | 121 bool has_text_; |
| 121 }; | 122 }; |
| 122 | 123 |
| 123 } // namespace skia | 124 } // namespace skia |
| 124 | 125 |
| 125 #endif // SKIA_EXT_ANALYSIS_CANVAS_H_ | 126 #endif // SKIA_EXT_ANALYSIS_CANVAS_H_ |
| 126 | 127 |
| OLD | NEW |