Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: ui/gfx/canvas.cc

Issue 2768143002: Back PaintRecord with PaintOpBuffer instead of SkPicture (Closed)
Patch Set: more const casting Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/gfx/canvas.h" 5 #include "ui/gfx/canvas.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 int width = std::max(size.width(), 1); 577 int width = std::max(size.width(), 1);
578 int height = std::max(size.height(), 1); 578 int height = std::max(size.height(), 1);
579 SkAlphaType alpha = is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType; 579 SkAlphaType alpha = is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
580 SkImageInfo info = SkImageInfo::MakeN32(width, height, alpha); 580 SkImageInfo info = SkImageInfo::MakeN32(width, height, alpha);
581 581
582 bitmap_.emplace(); 582 bitmap_.emplace();
583 bitmap_->allocPixels(info); 583 bitmap_->allocPixels(info);
584 // Ensure that the bitmap is zeroed, since the code expects that. 584 // Ensure that the bitmap is zeroed, since the code expects that.
585 memset(bitmap_->getPixels(), 0, bitmap_->getSafeSize()); 585 memset(bitmap_->getPixels(), 0, bitmap_->getSafeSize());
586 586
587 owned_canvas_ = cc::SkiaPaintCanvas(bitmap_.value()); 587 owned_canvas_.emplace(bitmap_.value());
588 return &owned_canvas_.value(); 588 return &owned_canvas_.value();
589 } 589 }
590 590
591 } // namespace gfx 591 } // namespace gfx
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.mm ('k') | ui/views/controls/scrollbar/cocoa_scroll_bar.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698