Chromium Code Reviews| Index: cc/playback/image_hijack_canvas.cc |
| diff --git a/cc/playback/image_hijack_canvas.cc b/cc/playback/image_hijack_canvas.cc |
| index f0fc139ed6d32b821141bdcdc41c368e2e498a1b..94dd39867420822f629bbc9036dc31fd74511fdd 100644 |
| --- a/cc/playback/image_hijack_canvas.cc |
| +++ b/cc/playback/image_hijack_canvas.cc |
| @@ -2,11 +2,12 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "base/optional.h" |
|
bungeman-chromium
2016/04/27 18:15:05
This include should go with the second set of incl
|
| + |
| #include "cc/playback/image_hijack_canvas.h" |
| #include "cc/playback/discardable_image_map.h" |
| #include "cc/tiles/image_decode_controller.h" |
| -#include "third_party/skia/include/core/SkTLazy.h" |
| namespace cc { |
| namespace { |
| @@ -33,8 +34,8 @@ class ScopedDecodedImageLock { |
| image_decode_controller_->GetDecodedImageForDraw(draw_image_)) { |
| DCHECK(draw_image_.image()->isLazyGenerated()); |
| if (paint) |
| - decoded_paint_.set(*paint)->setFilterQuality( |
| - decoded_draw_image_.filter_quality()); |
| + (decoded_paint_ = *paint) |
|
vmpstr
2016/04/27 18:01:01
Can you separate this into two separate steps, ple
|
| + ->setFilterQuality(decoded_draw_image_.filter_quality()); |
| } |
| ~ScopedDecodedImageLock() { |
| @@ -43,14 +44,15 @@ class ScopedDecodedImageLock { |
| } |
| const DecodedDrawImage& decoded_image() const { return decoded_draw_image_; } |
| - const SkPaint* decoded_paint() const { return decoded_paint_.getMaybeNull(); } |
| + const SkPaint* decoded_paint() const { |
| + return decoded_paint_ ? &(*decoded_paint_) : NULL; |
|
vmpstr
2016/04/27 18:01:02
nullptr
|
| + } |
| private: |
| ImageDecodeController* image_decode_controller_; |
| DrawImage draw_image_; |
| DecodedDrawImage decoded_draw_image_; |
| - // TODO(fmalita): use base::Optional when it becomes available |
| - SkTLazy<SkPaint> decoded_paint_; |
| + base::Optional<SkPaint> decoded_paint_; |
| }; |
| } // namespace |