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

Unified Diff: cc/output/copy_output_result.h

Issue 1531403002: Revert "Delete CC." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/copy_output_request.cc ('k') | cc/output/copy_output_result.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/copy_output_result.h
diff --git a/cc/output/copy_output_result.h b/cc/output/copy_output_result.h
new file mode 100644
index 0000000000000000000000000000000000000000..7d4a5bbbbd3a445f99c53ba6cd35079ef89968e8
--- /dev/null
+++ b/cc/output/copy_output_result.h
@@ -0,0 +1,61 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_OUTPUT_COPY_OUTPUT_RESULT_H_
+#define CC_OUTPUT_COPY_OUTPUT_RESULT_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "cc/resources/single_release_callback.h"
+#include "cc/resources/texture_mailbox.h"
+#include "ui/gfx/geometry/size.h"
+
+class SkBitmap;
+
+namespace cc {
+class TextureMailbox;
+
+class CopyOutputResult {
+ public:
+ static scoped_ptr<CopyOutputResult> CreateEmptyResult() {
+ return make_scoped_ptr(new CopyOutputResult);
+ }
+ static scoped_ptr<CopyOutputResult> CreateBitmapResult(
+ scoped_ptr<SkBitmap> bitmap) {
+ return make_scoped_ptr(new CopyOutputResult(bitmap.Pass()));
+ }
+ static scoped_ptr<CopyOutputResult> CreateTextureResult(
+ const gfx::Size& size,
+ const TextureMailbox& texture_mailbox,
+ scoped_ptr<SingleReleaseCallback> release_callback) {
+ return make_scoped_ptr(
+ new CopyOutputResult(size, texture_mailbox, release_callback.Pass()));
+ }
+
+ ~CopyOutputResult();
+
+ bool IsEmpty() const { return !HasBitmap() && !HasTexture(); }
+ bool HasBitmap() const { return !!bitmap_; }
+ bool HasTexture() const { return texture_mailbox_.IsValid(); }
+
+ gfx::Size size() const { return size_; }
+ scoped_ptr<SkBitmap> TakeBitmap();
+ void TakeTexture(TextureMailbox* texture_mailbox,
+ scoped_ptr<SingleReleaseCallback>* release_callback);
+
+ private:
+ CopyOutputResult();
+ explicit CopyOutputResult(scoped_ptr<SkBitmap> bitmap);
+ explicit CopyOutputResult(const gfx::Size& size,
+ const TextureMailbox& texture_mailbox,
+ scoped_ptr<SingleReleaseCallback> release_callback);
+
+ gfx::Size size_;
+ scoped_ptr<SkBitmap> bitmap_;
+ TextureMailbox texture_mailbox_;
+ scoped_ptr<SingleReleaseCallback> release_callback_;
+};
+
+} // namespace cc
+
+#endif // CC_OUTPUT_COPY_OUTPUT_RESULT_H_
« no previous file with comments | « cc/output/copy_output_request.cc ('k') | cc/output/copy_output_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698