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 #include "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
6 #include "skia/ext/analysis_canvas.h" | 6 #include "skia/ext/analysis_canvas.h" |
7 #include "third_party/skia/include/core/SkDevice.h" | 7 #include "third_party/skia/include/core/SkDevice.h" |
8 #include "third_party/skia/include/core/SkDraw.h" | 8 #include "third_party/skia/include/core/SkDraw.h" |
9 #include "third_party/skia/include/core/SkRRect.h" | 9 #include "third_party/skia/include/core/SkRRect.h" |
10 #include "third_party/skia/include/core/SkShader.h" | 10 #include "third_party/skia/include/core/SkShader.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 namespace skia { | 68 namespace skia { |
69 | 69 |
70 AnalysisDevice::AnalysisDevice(const SkBitmap& bm) | 70 AnalysisDevice::AnalysisDevice(const SkBitmap& bm) |
71 : INHERITED(bm) | 71 : INHERITED(bm) |
72 , isForcedNotSolid_(false) | 72 , isForcedNotSolid_(false) |
73 , isForcedNotTransparent_(false) | 73 , isForcedNotTransparent_(false) |
74 , isSolidColor_(false) | 74 , isSolidColor_(true) |
75 , isTransparent_(false) | 75 , isTransparent_(true) |
76 , hasText_(false) { | 76 , hasText_(false) { |
77 } | 77 } |
78 | 78 |
79 AnalysisDevice::~AnalysisDevice() { | 79 AnalysisDevice::~AnalysisDevice() { |
80 | |
81 } | 80 } |
82 | 81 |
83 bool AnalysisDevice::getColorIfSolid(SkColor* color) const { | 82 bool AnalysisDevice::getColorIfSolid(SkColor* color) const { |
84 if (isTransparent_) { | 83 if (isTransparent_) { |
85 *color = SK_ColorTRANSPARENT; | 84 *color = SK_ColorTRANSPARENT; |
86 return true; | 85 return true; |
87 } | 86 } |
88 if (isSolidColor_) { | 87 if (isSolidColor_) { |
89 *color = color_; | 88 *color = color_; |
90 return true; | 89 return true; |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 if (savedStackSize_ < forceNotTransparentStackLevel_) { | 384 if (savedStackSize_ < forceNotTransparentStackLevel_) { |
386 (static_cast<AnalysisDevice*>(getDevice()))->setForceNotTransparent(false)
; | 385 (static_cast<AnalysisDevice*>(getDevice()))->setForceNotTransparent(false)
; |
387 forceNotTransparentStackLevel_ = kNoLayer; | 386 forceNotTransparentStackLevel_ = kNoLayer; |
388 } | 387 } |
389 } | 388 } |
390 } | 389 } |
391 | 390 |
392 } // namespace skia | 391 } // namespace skia |
393 | 392 |
394 | 393 |
OLD | NEW |