| 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/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/trace_event/trace_event.h" | 6 #include "base/trace_event/trace_event.h" |
| 7 #include "skia/ext/analysis_canvas.h" | 7 #include "skia/ext/analysis_canvas.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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 SetForceNotSolid(true); | 411 SetForceNotSolid(true); |
| 412 } | 412 } |
| 413 } | 413 } |
| 414 | 414 |
| 415 // If after we draw to the save layer, we have to blend with the current | 415 // If after we draw to the save layer, we have to blend with the current |
| 416 // layer using any part of the current layer's alpha, then we can | 416 // layer using any part of the current layer's alpha, then we can |
| 417 // conservatively say that the canvas will not be transparent. | 417 // conservatively say that the canvas will not be transparent. |
| 418 SkXfermode::Mode xfermode = SkXfermode::kSrc_Mode; | 418 SkXfermode::Mode xfermode = SkXfermode::kSrc_Mode; |
| 419 if (paint) | 419 if (paint) |
| 420 SkXfermode::AsMode(paint->getXfermode(), &xfermode); | 420 SkXfermode::AsMode(paint->getXfermode(), &xfermode); |
| 421 if (xfermode != SkXfermode::kSrc_Mode) { | 421 if (xfermode != SkXfermode::kDst_Mode) { |
| 422 if (force_not_transparent_stack_level_ == kNoLayer) { | 422 if (force_not_transparent_stack_level_ == kNoLayer) { |
| 423 force_not_transparent_stack_level_ = saved_stack_size_; | 423 force_not_transparent_stack_level_ = saved_stack_size_; |
| 424 SetForceNotTransparent(true); | 424 SetForceNotTransparent(true); |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 INHERITED::willSaveLayer(bounds, paint, flags); | 428 INHERITED::willSaveLayer(bounds, paint, flags); |
| 429 // Actually saving a layer here could cause a new bitmap to be created | 429 // Actually saving a layer here could cause a new bitmap to be created |
| 430 // and real rendering to occur. | 430 // and real rendering to occur. |
| 431 return kNoLayer_SaveLayerStrategy; | 431 return kNoLayer_SaveLayerStrategy; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 444 force_not_transparent_stack_level_ = kNoLayer; | 444 force_not_transparent_stack_level_ = kNoLayer; |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 | 447 |
| 448 INHERITED::willRestore(); | 448 INHERITED::willRestore(); |
| 449 } | 449 } |
| 450 | 450 |
| 451 } // namespace skia | 451 } // namespace skia |
| 452 | 452 |
| 453 | 453 |
| OLD | NEW |