cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / cc / output / copy_output_result.cc
blob55213cde6b86a6c56e09061e85e65a50b4dea35c
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/output/copy_output_result.h"
7 #include "base/logging.h"
8 #include "cc/resources/texture_mailbox.h"
9 #include "third_party/skia/include/core/SkBitmap.h"
11 namespace cc {
13 CopyOutputResult::CopyOutputResult() {}
15 CopyOutputResult::CopyOutputResult(scoped_ptr<SkBitmap> bitmap)
16 : size_(bitmap->width(), bitmap->height()),
17 bitmap_(bitmap.Pass()) {
18 DCHECK(bitmap_);
21 CopyOutputResult::CopyOutputResult(gfx::Size size,
22 scoped_ptr<TextureMailbox> texture_mailbox)
23 : size_(size),
24 texture_mailbox_(texture_mailbox.Pass()) {
25 DCHECK(texture_mailbox_);
26 DCHECK(texture_mailbox_->IsTexture());
29 CopyOutputResult::~CopyOutputResult() {
30 if (texture_mailbox_)
31 texture_mailbox_->RunReleaseCallback(0, false);
34 scoped_ptr<SkBitmap> CopyOutputResult::TakeBitmap() {
35 return bitmap_.Pass();
38 scoped_ptr<TextureMailbox> CopyOutputResult::TakeTexture() {
39 return texture_mailbox_.Pass();
42 } // namespace cc